@profoundlogic/coderflow-server 0.8.6 → 0.8.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 (183) hide show
  1. package/dist/base-image/Dockerfile +3 -2
  2. package/dist/base-image/agent-wrapper.sh +7 -2
  3. package/dist/coder-server.js +1 -1
  4. package/dist/config.js +1 -1
  5. package/dist/lib/agent-keepalive.js +1 -1
  6. package/dist/lib/agent-models.js +1 -1
  7. package/dist/lib/api-keys.js +1 -1
  8. package/dist/lib/apiKeys.js +1 -1
  9. package/dist/lib/app-server-ports.js +1 -1
  10. package/dist/lib/auto-judge.js +1 -1
  11. package/dist/lib/automation-service.js +1 -1
  12. package/dist/lib/basic-auth.js +1 -1
  13. package/dist/lib/bindings.js +1 -1
  14. package/dist/lib/build-history.js +1 -1
  15. package/dist/lib/build-output-service.js +1 -1
  16. package/dist/lib/build-scheduler.js +1 -1
  17. package/dist/lib/build-service.js +1 -1
  18. package/dist/lib/ca-certificates.js +1 -1
  19. package/dist/lib/claude-oauth-refresh.js +1 -1
  20. package/dist/lib/cli/build.js +1 -1
  21. package/dist/lib/cli/cleanup-users.js +1 -1
  22. package/dist/lib/cli/config-command.js +1 -1
  23. package/dist/lib/cli/config.js +1 -1
  24. package/dist/lib/cli/create-user.js +1 -1
  25. package/dist/lib/cli/grant-admin.js +1 -1
  26. package/dist/lib/cli/init.js +1 -1
  27. package/dist/lib/cli/jira.js +1 -1
  28. package/dist/lib/cli/license.js +1 -1
  29. package/dist/lib/cli/list-roles.js +1 -1
  30. package/dist/lib/cli/list-users.js +1 -1
  31. package/dist/lib/cli/server-manager.js +1 -1
  32. package/dist/lib/cli/set-password.js +1 -1
  33. package/dist/lib/compression-filter.js +1 -1
  34. package/dist/lib/config-migration.js +1 -1
  35. package/dist/lib/container-credential-sync.js +1 -1
  36. package/dist/lib/container-tokens.js +1 -1
  37. package/dist/lib/data-dir.js +1 -1
  38. package/dist/lib/deployment-history.js +1 -1
  39. package/dist/lib/deployment-service.js +1 -1
  40. package/dist/lib/docker-utils.js +1 -1
  41. package/dist/lib/email.js +1 -1
  42. package/dist/lib/emailTemplates.js +1 -1
  43. package/dist/lib/entitlement.js +1 -1
  44. package/dist/lib/external-connections.js +1 -1
  45. package/dist/lib/fetch-utils.js +1 -1
  46. package/dist/lib/git-commit-details-route.js +1 -1
  47. package/dist/lib/git-history-diff-guardrails.js +1 -1
  48. package/dist/lib/git-provider-service.js +1 -1
  49. package/dist/lib/git-provider-setup/github-setup-handler.js +1 -1
  50. package/dist/lib/git-provider-setup/index.js +1 -1
  51. package/dist/lib/git-provider-setup/setup-factory.js +1 -1
  52. package/dist/lib/git-provider-setup/setup-interface.js +1 -1
  53. package/dist/lib/git-providers/azure-devops-provider.js +1 -1
  54. package/dist/lib/git-providers/github-app-provider.js +1 -1
  55. package/dist/lib/git-providers/index.js +1 -1
  56. package/dist/lib/git-providers/provider-factory.js +1 -1
  57. package/dist/lib/git-providers/provider-interface.js +1 -1
  58. package/dist/lib/github-urls.js +1 -1
  59. package/dist/lib/group-objective-linking.js +1 -1
  60. package/dist/lib/ibmi-sync.js +1 -1
  61. package/dist/lib/jira-client.js +1 -1
  62. package/dist/lib/judge-blinding.js +1 -1
  63. package/dist/lib/logger.js +1 -1
  64. package/dist/lib/memory-utils.js +1 -1
  65. package/dist/lib/migration-to-scoped-rbac.js +1 -1
  66. package/dist/lib/model-fetcher.js +1 -1
  67. package/dist/lib/notifications.js +1 -1
  68. package/dist/lib/objective-context.js +1 -1
  69. package/dist/lib/oidc-auth.js +1 -1
  70. package/dist/lib/oidc-device-flow.js +1 -1
  71. package/dist/lib/passwordTokens.js +1 -1
  72. package/dist/lib/permission-resolver.js +1 -1
  73. package/dist/lib/pin-cascade.js +1 -1
  74. package/dist/lib/provider-accounts.js +1 -1
  75. package/dist/lib/provider-oauth.js +1 -1
  76. package/dist/lib/provider-profile.js +1 -1
  77. package/dist/lib/provider-token-refresh.js +1 -1
  78. package/dist/lib/rbac-user-state.js +1 -1
  79. package/dist/lib/request-url.js +1 -1
  80. package/dist/lib/rewind.js +1 -1
  81. package/dist/lib/role-definitions.js +1 -1
  82. package/dist/lib/roles.js +1 -1
  83. package/dist/lib/secrets.js +1 -1
  84. package/dist/lib/setup-repo-git-auth.js +1 -1
  85. package/dist/lib/slack-service.js +1 -0
  86. package/dist/lib/state-capture.js +1 -1
  87. package/dist/lib/static-files.js +1 -1
  88. package/dist/lib/task-aliases.js +1 -1
  89. package/dist/lib/task-container-init.js +1 -1
  90. package/dist/lib/task-context-usage.js +1 -1
  91. package/dist/lib/task-name-format.js +1 -1
  92. package/dist/lib/task-name-generator.js +1 -1
  93. package/dist/lib/task-source-metadata.js +1 -1
  94. package/dist/lib/teams.js +1 -1
  95. package/dist/lib/user-git-oauth.js +1 -1
  96. package/dist/lib/user-git-tokens.js +1 -1
  97. package/dist/lib/users.js +1 -1
  98. package/dist/middleware/requireAuth.js +1 -1
  99. package/dist/middleware/requireInit.js +1 -1
  100. package/dist/middleware/requirePermission.js +1 -1
  101. package/dist/package.json +1 -1
  102. package/dist/playwright.config.js +1 -1
  103. package/dist/playwright.task-terminal.config.js +1 -1
  104. package/dist/routes/apiKeys.js +1 -1
  105. package/dist/routes/auth-oidc.js +1 -1
  106. package/dist/routes/auth.js +1 -1
  107. package/dist/routes/automations.js +1 -1
  108. package/dist/routes/bindings.js +1 -1
  109. package/dist/routes/build.js +1 -1
  110. package/dist/routes/containers.js +1 -1
  111. package/dist/routes/deploy-task.js +1 -1
  112. package/dist/routes/environment-management.js +1 -1
  113. package/dist/routes/environments.js +1 -1
  114. package/dist/routes/external-skills.js +1 -1
  115. package/dist/routes/git-credentials.js +1 -1
  116. package/dist/routes/git-oauth.js +1 -1
  117. package/dist/routes/git-provider-setup.js +1 -1
  118. package/dist/routes/health.js +1 -1
  119. package/dist/routes/jira.js +1 -1
  120. package/dist/routes/logs.js +1 -1
  121. package/dist/routes/objective-management.js +1 -1
  122. package/dist/routes/password.js +1 -1
  123. package/dist/routes/prompt.js +1 -1
  124. package/dist/routes/provider-auth.js +1 -1
  125. package/dist/routes/qa.js +1 -1
  126. package/dist/routes/roles.js +1 -1
  127. package/dist/routes/settings.js +1 -1
  128. package/dist/routes/skill-management.js +1 -1
  129. package/dist/routes/skills.js +1 -1
  130. package/dist/routes/slack.js +1 -0
  131. package/dist/routes/stats.js +1 -1
  132. package/dist/routes/tasks.js +1 -1
  133. package/dist/routes/teams.js +1 -1
  134. package/dist/routes/templates.js +1 -1
  135. package/dist/routes/test-task.js +1 -1
  136. package/dist/routes/test.js +1 -1
  137. package/dist/routes/users.js +1 -1
  138. package/dist/routes/visualizations.js +1 -1
  139. package/dist/scripts/create-user.js +1 -1
  140. package/dist/scripts/migrate-config-to-data-dir.js +1 -1
  141. package/dist/start.js +1 -1
  142. package/dist/web-ui/public/activity-detail-modal.js +1 -1
  143. package/dist/web-ui/public/activity-feed.js +1 -1
  144. package/dist/web-ui/public/activity-formatters.js +1 -1
  145. package/dist/web-ui/public/admin.js +1 -1
  146. package/dist/web-ui/public/agent-event-parser.js +1 -1
  147. package/dist/web-ui/public/app.js +1 -1
  148. package/dist/web-ui/public/approve-dialog.js +1 -1
  149. package/dist/web-ui/public/automation-links.js +1 -1
  150. package/dist/web-ui/public/automation-schedule.js +1 -1
  151. package/dist/web-ui/public/comments-widget.js +1 -1
  152. package/dist/web-ui/public/diff-utils.js +1 -1
  153. package/dist/web-ui/public/environments.js +1 -1
  154. package/dist/web-ui/public/feedback-widget.js +1 -1
  155. package/dist/web-ui/public/file-selection-tree.js +1 -1
  156. package/dist/web-ui/public/git-history-lazy-utils.js +1 -1
  157. package/dist/web-ui/public/git-history.js +1 -1
  158. package/dist/web-ui/public/git-status.js +1 -1
  159. package/dist/web-ui/public/ibmi-file-filter.js +1 -1
  160. package/dist/web-ui/public/index.js +1 -1
  161. package/dist/web-ui/public/login.js +1 -1
  162. package/dist/web-ui/public/markdown-editor.js +1 -1
  163. package/dist/web-ui/public/markdown-file-editor.js +1 -1
  164. package/dist/web-ui/public/modal-maximize.js +1 -1
  165. package/dist/web-ui/public/notifications.js +1 -1
  166. package/dist/web-ui/public/permissions.js +1 -1
  167. package/dist/web-ui/public/pr-dialog.js +1 -1
  168. package/dist/web-ui/public/roles.js +1 -1
  169. package/dist/web-ui/public/settings.html +146 -0
  170. package/dist/web-ui/public/settings.js +1 -1
  171. package/dist/web-ui/public/setup-password.js +1 -1
  172. package/dist/web-ui/public/skills.js +1 -1
  173. package/dist/web-ui/public/sse-client.js +1 -1
  174. package/dist/web-ui/public/sse-client.transport-warning.js +1 -0
  175. package/dist/web-ui/public/sse-shared-worker.js +1 -1
  176. package/dist/web-ui/public/task-judging-helpers.js +1 -1
  177. package/dist/web-ui/public/task.js +1 -1
  178. package/dist/web-ui/public/teams.js +1 -1
  179. package/dist/web-ui/public/terminal.js +1 -1
  180. package/dist/web-ui/public/theme.js +1 -1
  181. package/dist/web-ui/public/users.js +1 -1
  182. package/dist/web-ui/public/variant-grouping.js +1 -1
  183. package/package.json +1 -1
@@ -1 +1 @@
1
- function isLogOnlyTaskType(_0x1f4fb8){return _0x1f4fb8==='test'||_0x1f4fb8==='deploy';}export function createApproveDialogHTML(_0x5f1abc='',_0x28ec44={}){const _0x161ba2=_0x5f1abc,_0xae59c5=_0x28ec44['useTaskPageStyles']?'modal\x20profound-approve-modal':'profound-feedback-modal\x20profound-approve-modal',_0x40df4e=_0x28ec44['useTaskPageStyles']?'modal-warning':'approve-modal-warning',_0x29fd5a=_0x28ec44['useTaskPageStyles']?'modal-error':'approve-modal-error';return'\x0a\x20\x20\x20\x20<div\x20id=\x22'+_0x161ba2+'approve-modal\x22\x20class=\x22'+_0xae59c5+'\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-overlay\x22></div>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-content\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h2>Approve\x20Changes</h2>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22modal-close\x22\x20id=\x22'+_0x161ba2+'close-approve-modal\x22>&times;</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-body\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x161ba2+'approve-warning\x22\x20class=\x22'+_0x40df4e+'\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22warning-icon\x22>!</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x161ba2+'approve-warning-text\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x161ba2+'approve-error\x22\x20class=\x22'+_0x29fd5a+'\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22error-icon\x22>!</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x161ba2+'approve-error-text\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x161ba2+'conflict-resolution\x22\x20class=\x22conflict-resolution-panel\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22conflict-resolution-message\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22warning-icon\x22>!</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Remote\x20has\x20conflicting\x20changes\x20that\x20couldn\x27t\x20be\x20merged\x20automatically.</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22conflict-resolution-options\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x20btn-small\x22\x20id=\x22'+_0x161ba2+'conflict-agent-resolve\x22>Let\x20the\x20agent\x20resolve\x20conflicts</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22>The\x20agent\x20will\x20pull\x20remote\x20changes,\x20resolve\x20conflicts,\x20and\x20prepare\x20for\x20re-approval.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-secondary\x20btn-small\x22\x20id=\x22'+_0x161ba2+'conflict-new-branch\x22>Create\x20a\x20new\x20branch\x20instead</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22>Avoids\x20the\x20conflict\x20by\x20committing\x20to\x20a\x20separate\x20branch.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-secondary\x20btn-small\x22\x20id=\x22'+_0x161ba2+'conflict-cancel\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\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=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-info\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x161ba2+'approve-repo-name\x22\x20class=\x22modal-repo\x22>Repository</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x161ba2+'approve-stats\x22\x20class=\x22modal-stats\x22>0\x20files\x20changed</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x161ba2+'approve-branches\x22\x20class=\x22modal-branches\x22\x20hidden></div>\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=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x161ba2+'commit-message-input\x22>Commit\x20message:</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<textarea\x20id=\x22'+_0x161ba2+'commit-message-input\x22\x20class=\x22commit-message-input\x22\x20rows=\x226\x22\x20placeholder=\x22Enter\x20commit\x20message...\x22></textarea>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20id=\x22'+_0x161ba2+'multi-repo-note\x22\x20class=\x22field-hint\x22\x20hidden>This\x20commit\x20message\x20will\x20be\x20used\x20for\x20all\x20repositories\x20listed\x20above.</p>\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=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x161ba2+'pull-before-commit\x22\x20checked>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Pull\x20from\x20remote\x20after\x20commit</span>\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=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x161ba2+'push-after-commit\x22\x20checked>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Push\x20to\x20remote\x20after\x20commit</span>\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=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x161ba2+'create-new-branch\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Create\x20new\x20branch</span>\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<div\x20id=\x22'+_0x161ba2+'new-branch-input-container\x22\x20class=\x22new-branch-container\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x161ba2+'new-branch-name\x22\x20class=\x22new-branch-input\x22\x20placeholder=\x22Enter\x20new\x20branch\x20name...\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22>A\x20new\x20branch\x20will\x20be\x20created\x20from\x20the\x20current\x20branch\x20before\x20committing.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x161ba2+'pr-option-section\x22\x20class=\x22modal-section\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x161ba2+'create-pull-request\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Create\x20pull\x20request</span>\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<p\x20class=\x22field-hint\x22\x20id=\x22'+_0x161ba2+'pr-hint\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20A\x20new\x20branch\x20will\x20be\x20created,\x20pushed,\x20and\x20a\x20pull\x20request\x20opened.\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x161ba2+'ibmi-sync-section\x22\x20class=\x22modal-section\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22approve-divider\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x161ba2+'sync-to-ibmi\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Sync\x20to\x20IBM\x20i</span>\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<div\x20id=\x22'+_0x161ba2+'ibmi-sync-fields\x22\x20class=\x22new-branch-container\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x161ba2+'ibmi-sync-library\x22>Library\x20name</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x161ba2+'ibmi-sync-library\x22\x20class=\x22new-branch-input\x20code-font\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20maxlength=\x2210\x22\x20placeholder=\x22e.g.,\x20MYLIB\x22\x20style=\x22width:\x20160px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x161ba2+'ibmi-sync-credentials-row\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x161ba2+'ibmi-sync-user\x22\x20style=\x22margin-top:\x208px;\x20display:\x20block;\x22>User\x20profile</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x161ba2+'ibmi-sync-user\x22\x20class=\x22new-branch-input\x20code-font\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20maxlength=\x2210\x22\x20placeholder=\x22e.g.,\x20MYUSER\x22\x20style=\x22width:\x20160px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x161ba2+'ibmi-sync-password\x22\x20style=\x22margin-top:\x208px;\x20display:\x20block;\x22>Password</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22password\x22\x20id=\x22'+_0x161ba2+'ibmi-sync-password\x22\x20class=\x22new-branch-input\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20placeholder=\x22Enter\x20password\x22\x20style=\x22width:\x20160px;\x22\x20autocomplete=\x22off\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x161ba2+'ibmi-sync-files-section\x22\x20style=\x22margin-top:\x2010px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20style=\x22display:\x20block;\x20margin-bottom:\x204px;\x22>Files\x20to\x20sync</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x161ba2+'ibmi-sync-file-tree\x22\x20class=\x22file-selection-tree-container\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20style=\x22max-height:\x20250px;\x20overflow-y:\x20auto;\x20border:\x201px\x20solid\x20var(--border-color,\x20var(--color-border));\x20border-radius:\x204px;\x20padding:\x208px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-selection-summary\x22\x20id=\x22'+_0x161ba2+'ibmi-sync-files-summary\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-ghost\x22\x20id=\x22'+_0x161ba2+'cancel-approve\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x22\x20id=\x22'+_0x161ba2+'confirm-approve\x22>Commit\x20Changes</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20</div>\x0a\x20\x20';}export class ApproveDialog{constructor(_0x1f6158={}){this['prefix']=_0x1f6158['prefix']||'',this['onApprove']=_0x1f6158['onApprove'],this['onSync']=_0x1f6158['onSync'],this['onSuccess']=_0x1f6158['onSuccess'],this['onError']=_0x1f6158['onError'],this['onCreatePR']=_0x1f6158['onCreatePR'],this['showToast']=_0x1f6158['showToast']||(()=>{}),this['container']=_0x1f6158['container']||document['body'],this['useTaskPageStyles']=_0x1f6158['useTaskPageStyles']||![],this['baseUrl']=_0x1f6158['baseUrl']||'',this['coderflowAttribution']=_0x1f6158['coderflowAttribution'],this['onConflictFollowUp']=_0x1f6158['onConflictFollowUp']||null,this['onSyncToIbmi']=_0x1f6158['onSyncToIbmi']||null,this['onGetSyncFiles']=_0x1f6158['onGetSyncFiles']||null,this['taskData']=null,this['initialized']=![],this['isSyncing']=![],this['_createPR']=![],this['_attributionRequestId']=0x0,this['_syncFileTree']=null,this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null,this['_transientWarning']='';}['init'](){if(this['initialized'])return;const _0x2d8732=document['createElement']('div');_0x2d8732['innerHTML']=createApproveDialogHTML(this['prefix'],{'useTaskPageStyles':this['useTaskPageStyles']}),this['container']['appendChild'](_0x2d8732['firstElementChild']),this['_bindEvents'](),this['initialized']=!![];}['_el'](_0x174f85){return document['getElementById'](''+this['prefix']+_0x174f85);}['_bindEvents'](){const _0x3cbe12=this['_el']('approve-modal'),_0x44454a=this['_el']('close-approve-modal'),_0x3b4e8b=this['_el']('cancel-approve'),_0x1bc202=this['_el']('confirm-approve'),_0x132b72=_0x3cbe12?.['querySelector']('.modal-overlay'),_0x49d252=this['_el']('pull-before-commit'),_0xf8fba4=this['_el']('create-new-branch'),_0x20217f=this['_el']('new-branch-input-container'),_0x12fd05=this['_el']('new-branch-name'),_0x5d0348=this['_el']('push-after-commit'),_0x2435e8=this['_el']('create-pull-request'),_0x3ed241=this['_el']('pr-hint'),_0x5c62b6=()=>{this['_refreshWarningBanner']();};_0x44454a?.['addEventListener']('click',()=>this['hide']()),_0x3b4e8b?.['addEventListener']('click',()=>this['hide']()),_0x132b72?.['addEventListener']('click',()=>this['hide']()),_0x1bc202?.['addEventListener']('click',()=>this['_handleApprove']());_0xf8fba4&&_0xf8fba4['addEventListener']('change',()=>{_0x20217f&&(_0x20217f['hidden']=!_0xf8fba4['checked']),_0xf8fba4['checked']&&_0x12fd05&&_0x12fd05['focus'](),_0x5c62b6();});_0x49d252?.['addEventListener']('change',()=>{_0x5c62b6();});_0x2435e8&&_0x5d0348&&_0xf8fba4&&(_0x2435e8['addEventListener']('change',()=>{this['_createPR']=_0x2435e8['checked'];if(_0x2435e8['checked']){_0x5d0348['checked']=!![],_0x5d0348['disabled']=!![],_0xf8fba4['checked']=!![],_0xf8fba4['disabled']=!![];_0x20217f&&(_0x20217f['hidden']=![]);if(_0x3ed241)_0x3ed241['hidden']=![];}else{_0x5d0348['disabled']=![],_0xf8fba4['disabled']=![];if(_0x3ed241)_0x3ed241['hidden']=!![];}_0x5c62b6();}),_0x5d0348['addEventListener']('change',()=>{if(!_0x5d0348['checked']&&_0x2435e8['checked']){_0x2435e8['checked']=![],this['_createPR']=![],_0x5d0348['disabled']=![],_0xf8fba4['disabled']=![];if(_0x3ed241)_0x3ed241['hidden']=!![];}}));_0x5c62b6();const _0x2d76cb=this['_el']('sync-to-ibmi');_0x2d76cb&&_0x2d76cb['addEventListener']('change',async _0x213288=>{const _0x989c4c=this['_el']('ibmi-sync-fields');if(_0x989c4c)_0x989c4c['hidden']=!_0x213288['target']['checked'];if(_0x213288['target']['checked']){const _0x1f5bf1=this['_el']('ibmi-sync-library'),_0x43e363=localStorage['getItem']('coderflow_ibmi_sync_library');_0x43e363&&_0x1f5bf1&&!_0x1f5bf1['value']&&(_0x1f5bf1['value']=_0x43e363);const _0x51cf68=this['_el']('ibmi-sync-user');if(_0x51cf68&&!_0x51cf68['value']){const _0x56c332=localStorage['getItem']('coderflow_ibmi_sync_user');if(_0x56c332)_0x51cf68['value']=_0x56c332;}const _0x5c26e7=this['_el']('ibmi-sync-password');if(_0x5c26e7)_0x5c26e7['value']='';!this['_syncFileTree']&&this['onGetSyncFiles']&&this['taskData']?.['taskId']&&await this['_loadSyncFileTree']();}}),this['_el']('conflict-agent-resolve')?.['addEventListener']('click',()=>{this['onConflictFollowUp']&&this['onConflictFollowUp'](this['taskData']['taskId']),this['hide'](),this['showToast']('Agent\x20is\x20resolving\x20conflicts.\x20Re-approve\x20when\x20it\x20finishes.','info');}),this['_el']('conflict-new-branch')?.['addEventListener']('click',()=>{this['_hideConflictResolution']();const _0x5b4cd1=this['_el']('create-new-branch'),_0x4b198f=this['_el']('new-branch-input-container'),_0x580246=this['_el']('new-branch-name');if(_0x5b4cd1)_0x5b4cd1['checked']=!![];if(_0x4b198f)_0x4b198f['hidden']=![];if(_0x580246)_0x580246['focus']();_0x5c62b6();}),this['_el']('conflict-cancel')?.['addEventListener']('click',()=>this['hide']()),document['addEventListener']('keydown',_0x26b5c2=>{_0x26b5c2['key']==='Escape'&&_0x3cbe12&&!_0x3cbe12['hidden']&&this['hide']();});}async['_loadSyncFileTree'](){const _0x257a57=this['_el']('ibmi-sync-file-tree'),_0x141d87=this['_el']('ibmi-sync-files-summary');if(!_0x257a57)return;_0x257a57['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>Loading\x20files...</span>';if(_0x141d87)_0x141d87['textContent']='';try{const {files:_0xf4af11,absolutePaths:_0x1dc323}=await this['onGetSyncFiles'](this['taskData']['taskId']);this['_syncRelativeFiles']=_0xf4af11,this['_syncAbsolutePaths']=_0x1dc323;if(_0xf4af11['length']===0x0){_0x257a57['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>No\x20changed\x20files\x20found.</span>';return;}const {FileSelectionTree:_0x338e26}=await import('./file-selection-tree.js'),{validateIbmiFile:_0x46d61b,hasKnownIbmiExtension:_0x14a5a8}=await import('./ibmi-file-filter.js');this['_syncFileTree']=new _0x338e26({'container':_0x257a57,'files':_0xf4af11,'isPreselected':_0xb538a=>{const {valid:_0x549f7a}=_0x46d61b(_0xb538a);return _0x549f7a&&_0x14a5a8(_0xb538a);},'isDisabled':_0x419d39=>{const {valid:_0x26765c,reason:_0x278b94}=_0x46d61b(_0x419d39);return{'disabled':!_0x26765c,'reason':_0x278b94};},'isAutoCheckEligible':_0x153441=>{const {valid:_0x3ef907}=_0x46d61b(_0x153441);return _0x3ef907&&_0x14a5a8(_0x153441);},'onChange':_0x211dfb=>{_0x141d87&&(_0x141d87['textContent']=_0x211dfb['length']+'\x20of\x20'+_0xf4af11['length']+'\x20file'+(_0xf4af11['length']!==0x1?'s':'')+'\x20selected');}}),this['_syncFileTree']['render']();}catch(_0x1c81c0){_0x257a57['innerHTML']='<span\x20style=\x22color:\x20var(--color-danger,\x20#e55368);\x20font-size:\x2013px;\x22>Failed\x20to\x20load\x20files</span>';}}['showError'](_0x1b42bc){const _0x90e1e1=this['_el']('approve-error'),_0x581c8c=this['_el']('approve-error-text');_0x90e1e1&&_0x581c8c&&(_0x581c8c['textContent']=_0x1b42bc,_0x90e1e1['hidden']=![],_0x90e1e1['scrollIntoView']({'behavior':'smooth','block':'nearest'}));}['hideError'](){const _0x9cc6fc=this['_el']('approve-error'),_0x2c6de4=this['_el']('approve-error-text');_0x9cc6fc&&_0x2c6de4&&(_0x9cc6fc['hidden']=!![],_0x2c6de4['textContent']='');}['_displayBranchInfo'](_0x44cc54,_0x3eb387={}){const _0x5d6fdf=this['_el']('approve-branches');if(!_0x5d6fdf)return;const _0x392b38=[];for(const _0x329232 of _0x44cc54){_0x3eb387[_0x329232['name']]&&_0x392b38['push']({'repo':_0x329232['name'],'branch':_0x3eb387[_0x329232['name']]});}if(_0x392b38['length']>0x0){_0x5d6fdf['hidden']=![];if(_0x392b38['length']===0x1)_0x5d6fdf['innerHTML']='<div\x20class=\x22branch-info\x22>Branch:\x20<code>'+_0x392b38[0x0]['branch']+'</code></div>';else{const _0xa5ae8c=_0x392b38['map'](_0x194d43=>'<div\x20class=\x22branch-item\x22><strong>'+_0x194d43['repo']+':</strong>\x20<code>'+_0x194d43['branch']+'</code></div>')['join']('');_0x5d6fdf['innerHTML']='<div\x20class=\x22branch-info\x22>Branches:<div\x20class=\x22branch-list\x22>'+_0xa5ae8c+'</div></div>';}}else _0x5d6fdf['hidden']=!![],_0x5d6fdf['innerHTML']='';}['showWarning'](_0x6ee667){const _0x76580c=this['_el']('approve-warning'),_0x3844e3=this['_el']('approve-warning-text');_0x76580c&&_0x3844e3&&(_0x3844e3['textContent']=_0x6ee667,_0x76580c['hidden']=![]);}['hideWarning'](){const _0x23028c=this['_el']('approve-warning'),_0x347141=this['_el']('approve-warning-text');_0x23028c&&_0x347141&&(_0x23028c['hidden']=!![],_0x347141['textContent']='');}['_showConflictResolution'](){const _0x5d6966=this['_el']('conflict-resolution'),_0x2efa3e=this['_el']('confirm-approve'),_0x570356=this['_el']('cancel-approve'),_0x423304=this['_el']('conflict-agent-resolve');if(_0x5d6966)_0x5d6966['hidden']=![];if(_0x2efa3e)_0x2efa3e['hidden']=!![];if(_0x570356)_0x570356['hidden']=!![];const _0xa3321b=this['_el']('approve-modal');if(_0xa3321b){this['_sectionsHiddenBeforeConflict']=new Set();for(const _0x1cdc37 of _0xa3321b['querySelectorAll']('.modal-section')){_0x1cdc37['hidden']&&this['_sectionsHiddenBeforeConflict']['add'](_0x1cdc37),_0x1cdc37['hidden']=!![];}}if(_0x423304){const _0x3d9131=!!this['onConflictFollowUp'];_0x423304['hidden']=!_0x3d9131,_0x423304['nextElementSibling']?.['classList']['contains']('field-hint')&&(_0x423304['nextElementSibling']['hidden']=!_0x3d9131);}}['_hideConflictResolution'](){const _0xcf24e5=this['_el']('conflict-resolution'),_0x1d7646=this['_el']('confirm-approve'),_0x3ad70c=this['_el']('cancel-approve');if(_0xcf24e5)_0xcf24e5['hidden']=!![];if(_0x1d7646)_0x1d7646['hidden']=![];if(_0x3ad70c)_0x3ad70c['hidden']=![];const _0x194e82=this['_el']('approve-modal');if(_0x194e82){const _0x4c72cd=this['_sectionsHiddenBeforeConflict']||new Set();for(const _0x3c1012 of _0x194e82['querySelectorAll']('.modal-section')){!_0x4c72cd['has'](_0x3c1012)&&(_0x3c1012['hidden']=![]);}this['_sectionsHiddenBeforeConflict']=null;}}['_getRemoteConflictWarning'](){const _0x5282f6=this['taskData']?.['reposChanged']||[],_0xc10eb7=this['_el']('pull-before-commit')?.['checked']??!![],_0x4a8730=this['_el']('create-new-branch')?.['checked']||![];if(!_0xc10eb7||_0x4a8730||_0x5282f6['length']===0x0)return'';const _0x12c57f=_0x5282f6['filter'](_0x5ed6b4=>_0x5ed6b4?.['upstream_status']==='behind'||_0x5ed6b4?.['upstream_status']==='diverged');if(_0x12c57f['length']===0x0)return'';const _0x1a8ef4=_0x12c57f['map'](_0x35eeb2=>{const _0x2d131a=Number(_0x35eeb2?.['upstream_behind'])||0x0,_0x5e2fa8=_0x2d131a+'\x20commit'+(_0x2d131a===0x1?'':'s')+'\x20ahead';if(_0x35eeb2['upstream_status']==='diverged')return _0x35eeb2['name']+':\x20remote\x20is\x20'+_0x5e2fa8+'\x20and\x20the\x20tracked\x20branch\x20has\x20local\x20commits';return _0x35eeb2['name']+':\x20remote\x20is\x20'+_0x5e2fa8;})['join'](';\x20');return'Remote\x20has\x20new\x20changes\x20('+_0x1a8ef4+').\x20If\x20there\x20are\x20conflicts,\x20you\x27ll\x20be\x20given\x20options\x20to\x20resolve\x20them.';}['_refreshWarningBanner'](){const _0x5b0c5a=[this['taskData']?.['warning']||'',this['_getRemoteConflictWarning'](),this['_transientWarning']||'']['filter'](Boolean);if(_0x5b0c5a['length']>0x0){this['showWarning'](_0x5b0c5a['join']('\x20'));return;}this['hideWarning']();}['_stripCoAuthoredByLines'](_0xf7a549){return _0xf7a549['replace'](/^Co-Authored-By:.*$/gmi,'')['replace'](/^Learn more: https:\/\/coderflow\.ai\s*$/gm,'')['replace'](/\n{3,}/g,'\x0a\x0a')['trim']();}async['_addAttributionIfEnabled'](_0x19f572){try{let _0x4081ba;try{const _0x8451ba=await fetch(this['baseUrl']+'/settings');if(_0x8451ba['ok']){const _0x15ff3c=await _0x8451ba['json']();_0x4081ba=_0x15ff3c['coderflow_attribution']!==![];}}catch(_0x1a53f5){}_0x4081ba===undefined&&(this['coderflowAttribution']!==undefined?_0x4081ba=this['coderflowAttribution']!==![]:_0x4081ba=!![]);const _0x218bb4=this['_stripCoAuthoredByLines'](_0x19f572);if(!_0x4081ba)return _0x218bb4;const _0x3d5cc1='\x0a\x0aCo-Authored-By:\x20CoderFlow\x20<ai@coderflow.ai>\x0aLearn\x20more:\x20https://coderflow.ai';return _0x218bb4+_0x3d5cc1;}catch(_0x2841a9){return console['warn']('Failed\x20to\x20add\x20CoderFlow\x20attribution:',_0x2841a9),_0x19f572;}}['show'](_0x3a8778){!this['initialized']&&this['init']();this['taskData']=_0x3a8778;const _0x461a51=this['_el']('approve-modal'),_0x5286f1=this['_el']('commit-message-input'),_0x2d80f0=this['_el']('pull-before-commit'),_0x3048eb=this['_el']('push-after-commit'),_0x254b58=this['_el']('create-new-branch'),_0x54e326=this['_el']('new-branch-input-container'),_0x4401ea=this['_el']('new-branch-name');if(!_0x461a51)return;this['hideError'](),this['hideWarning'](),this['_hideConflictResolution'](),this['_transientWarning']='';const _0x5767a2=_0x3a8778['reposChanged']||[];if(_0x5767a2['length']===0x0&&!_0x3a8778['syncFirst']){this['showToast']('No\x20changes\x20to\x20approve','error');return;}this['_updateDisplay'](_0x5767a2,_0x3a8778);const _0x2f5886=_0x3a8778['commitMessage']||'',_0xd7f718=this['_stripCoAuthoredByLines'](_0x2f5886);_0x5286f1['value']=_0xd7f718;if(_0x2d80f0)_0x2d80f0['checked']=!![];if(_0x3048eb)_0x3048eb['checked']=!![];_0x254b58&&(_0x254b58['checked']=![]);_0x54e326&&(_0x54e326['hidden']=!![]);_0x4401ea&&(_0x4401ea['value']='');if(_0x3048eb)_0x3048eb['disabled']=![];if(_0x254b58)_0x254b58['disabled']=![];this['_refreshWarningBanner'](),this['updatePRSupport'](_0x3a8778['prSupported']===!![]);const _0x3ae6ee=this['_el']('ibmi-sync-section');if(_0x3ae6ee){_0x3ae6ee['hidden']=!_0x3a8778['ibmiSyncAvailable'];const _0x5508e1=this['_el']('sync-to-ibmi'),_0x434efe=this['_el']('ibmi-sync-fields'),_0x208b37=this['_el']('ibmi-sync-library');if(_0x5508e1)_0x5508e1['checked']=![];if(_0x434efe)_0x434efe['hidden']=!![];if(_0x208b37)_0x208b37['value']='';const _0x3a6eae=this['_el']('ibmi-sync-credentials-row');_0x3a6eae&&(_0x3a6eae['hidden']=!(_0x3a8778['ibmiSyncAvailable']&&_0x3a8778['syncCredentials']==='prompt'));}const _0xb211ac=this['_el']('confirm-approve');_0x3a8778['syncFirst']&&this['onSync']?(_0xb211ac&&(_0xb211ac['disabled']=!![],_0xb211ac['textContent']='Syncing...'),this['_performSync']()):_0xb211ac&&(_0xb211ac['disabled']=![],_0xb211ac['textContent']='Commit\x20Changes');_0x461a51['hidden']=![];const _0xc3c27=++this['_attributionRequestId'];void this['_applyAttributionAsync']({'requestId':_0xc3c27,'taskId':_0x3a8778['taskId'],'originalCommitMessage':_0xd7f718}),setTimeout(()=>{_0x5286f1['focus'](),_0x5286f1['setSelectionRange'](0x0,_0x5286f1['value']['length']);},0x64);}['updatePRSupport'](_0x142d08){const _0x14ad9f=this['_el']('pr-option-section'),_0x55a2f6=this['_el']('create-pull-request'),_0x24518d=this['_el']('pr-hint'),_0x1aee8d=this['_el']('push-after-commit'),_0x346bd9=this['_el']('create-new-branch');if(!_0x14ad9f)return;if(_0x142d08){_0x14ad9f['hidden']=![];_0x55a2f6&&!_0x55a2f6['disabled']&&(_0x55a2f6['checked']=![]);if(_0x24518d)_0x24518d['hidden']=!![];this['_createPR']=![];return;}_0x55a2f6?.['checked']&&(_0x55a2f6['checked']=![]);if(_0x24518d)_0x24518d['hidden']=!![];if(_0x1aee8d)_0x1aee8d['disabled']=![];if(_0x346bd9)_0x346bd9['disabled']=![];this['_createPR']=![],_0x14ad9f['hidden']=!![];}async['_applyAttributionAsync']({requestId:_0x347344,taskId:_0x58b43c,originalCommitMessage:_0x5a640b}){const _0x1bc9dd=this['_el']('commit-message-input');if(!_0x1bc9dd)return;const _0x42591b=await this['_addAttributionIfEnabled'](_0x5a640b);if(_0x347344!==this['_attributionRequestId'])return;if(!this['taskData']||this['taskData']['taskId']!==_0x58b43c)return;if(!this['isVisible']())return;const _0x4fb708=_0x4d4c14=>_0x4d4c14['replace'](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a');if(_0x4fb708(_0x1bc9dd['value'])!==_0x4fb708(_0x5a640b))return;_0x1bc9dd['value']=_0x42591b;}['_updateDisplay'](_0x45c477,_0x28822d){const _0x9b5c81=this['_el']('approve-repo-name'),_0x37b08a=this['_el']('approve-stats'),_0x4d883d=this['_el']('multi-repo-note');if(_0x45c477['length']===0x0){if(_0x9b5c81)_0x9b5c81['textContent']='Syncing...';if(_0x37b08a)_0x37b08a['textContent']='';if(_0x4d883d)_0x4d883d['hidden']=!![];return;}const _0x37d134=_0x45c477['reduce']((_0x307589,_0x36c374)=>_0x307589+(_0x36c374['files_changed']||0x0),0x0),_0x3b2660=_0x45c477['reduce']((_0x587ee9,_0x56698f)=>_0x587ee9+(_0x56698f['lines_added']||0x0),0x0),_0x29c783=_0x45c477['reduce']((_0x431d4c,_0x2886aa)=>_0x431d4c+(_0x2886aa['lines_deleted']||0x0),0x0);if(_0x45c477['length']===0x1){if(_0x9b5c81)_0x9b5c81['textContent']=_0x45c477[0x0]?.['name']||'repository';if(_0x4d883d)_0x4d883d['hidden']=!![];}else{const _0xd81d94=_0x45c477['map'](_0x1ac6e7=>_0x1ac6e7['name'])['join'](',\x20');if(_0x9b5c81)_0x9b5c81['textContent']=_0x45c477['length']+'\x20repositories:\x20'+_0xd81d94;if(_0x4d883d)_0x4d883d['hidden']=![];}_0x37b08a&&(_0x37b08a['textContent']=_0x37d134+'\x20file'+(_0x37d134===0x1?'':'s')+'\x20changed\x20(+'+_0x3b2660+'\x20-'+_0x29c783+')'),this['_displayBranchInfo'](_0x45c477,_0x28822d?.['branches']||{});}async['_performSync'](){if(!this['onSync']||this['isSyncing'])return;this['isSyncing']=!![];const _0xa73209=this['_el']('confirm-approve');try{const _0x46056c=await this['onSync'](this['taskData']['taskId']);if(!this['isVisible']()){this['isSyncing']=![];return;}if(_0x46056c['repos_changed']){const _0x1e54d6=this['taskData']['reposChanged']?.['length']||0x0,_0x1c10ab=this['taskData']['reposChanged']?.['reduce']((_0x206f3a,_0x3c3b6b)=>_0x206f3a+(_0x3c3b6b['files_changed']||0x0),0x0)||0x0;this['taskData']['reposChanged']=_0x46056c['repos_changed'];if(_0x46056c['current_branches']){const _0x5e4510={...this['taskData']['branches']||{}};for(const [_0x335a4a,_0xd04912]of Object['entries'](_0x46056c['current_branches'])){_0xd04912?_0x5e4510[_0x335a4a]=_0xd04912:delete _0x5e4510[_0x335a4a];}this['taskData']['branches']=_0x5e4510;}this['_updateDisplay'](_0x46056c['repos_changed'],this['taskData']);const _0x20355e=_0x46056c['repos_changed']['length'],_0x26d0a5=_0x46056c['repos_changed']['reduce']((_0x47b80a,_0x433148)=>_0x47b80a+(_0x433148['files_changed']||0x0),0x0);(_0x26d0a5>_0x1c10ab||_0x20355e>_0x1e54d6)&&(this['_transientWarning']='Additional\x20changes\x20detected\x20since\x20last\x20sync.\x20Review\x20the\x20updated\x20file\x20list.'),this['_refreshWarningBanner']();}_0xa73209&&(!this['taskData']['reposChanged']||this['taskData']['reposChanged']['length']===0x0?(_0xa73209['disabled']=!![],_0xa73209['textContent']='No\x20Changes',this['showError']('No\x20changes\x20to\x20approve\x20after\x20sync')):(_0xa73209['disabled']=![],_0xa73209['textContent']='Commit\x20Changes'));}catch(_0x466b0e){console['error']('Failed\x20to\x20sync\x20repos\x20before\x20approve:',_0x466b0e);if(!this['isVisible']()){this['isSyncing']=![];return;}this['showError']('Sync\x20failed:\x20'+_0x466b0e['message']+'.\x20You\x20can\x20still\x20commit\x20with\x20existing\x20staged\x20changes.'),_0xa73209&&(this['taskData']['reposChanged']&&this['taskData']['reposChanged']['length']>0x0?(_0xa73209['disabled']=![],_0xa73209['textContent']='Commit\x20Changes'):(_0xa73209['disabled']=!![],_0xa73209['textContent']='No\x20Changes'));}finally{this['isSyncing']=![];}}['hide'](){const _0x3d3e14=this['_el']('approve-modal');_0x3d3e14&&(_0x3d3e14['hidden']=!![]),this['_syncFileTree']&&(this['_syncFileTree']['destroy'](),this['_syncFileTree']=null),this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}async['_handleApprove'](){const _0x1b7786=this['_el']('commit-message-input'),_0x12b01d=this['_el']('pull-before-commit'),_0x2203b0=this['_el']('push-after-commit'),_0x278131=this['_el']('create-new-branch'),_0x2808e0=this['_el']('new-branch-name'),_0x58fffc=this['_el']('confirm-approve'),_0x3be8f6=_0x1b7786['value']['trim'](),_0x5c87ce=_0x12b01d?.['checked']??!![],_0x35e1fa=_0x2203b0?.['checked']??!![],_0x121e59=_0x278131?.['checked']||![],_0x11279b=_0x2808e0?.['value']['trim']()||'';this['hideError']();if(!_0x3be8f6){this['showError']('Commit\x20message\x20is\x20required'),_0x1b7786['focus']();return;}if(_0x121e59&&!_0x11279b){this['showError']('Branch\x20name\x20is\x20required\x20when\x20creating\x20a\x20new\x20branch'),_0x2808e0?.['focus']();return;}if(_0x121e59&&_0x11279b){const _0x4f897a=/[\s~^:?*\[\\]/;if(_0x4f897a['test'](_0x11279b)){this['showError']('Invalid\x20branch\x20name.\x20Avoid\x20spaces\x20and\x20special\x20characters\x20like\x20~\x20^\x20:\x20?\x20*\x20[\x20\x5c'),_0x2808e0?.['focus']();return;}}const _0x3b0398=this['_el']('sync-to-ibmi')?.['checked'];if(_0x3b0398){const _0x23147c=this['_el']('ibmi-sync-library')?.['value']?.['trim']();if(!_0x23147c){this['showError']('IBM\x20i\x20library\x20name\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-library')?.['focus']();return;}if(this['_syncFileTree']){const _0x356890=this['_syncFileTree']['getSelectedFiles']();if(_0x356890['length']===0x0){this['showError']('Select\x20at\x20least\x20one\x20file\x20to\x20sync');return;}}if(this['taskData']?.['syncCredentials']==='prompt'){const _0x11872d=this['_el']('ibmi-sync-user')?.['value']?.['trim']();if(!_0x11872d){this['showError']('User\x20profile\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-user')?.['focus']();return;}const _0x5afed1=this['_el']('ibmi-sync-password')?.['value'];if(!_0x5afed1){this['showError']('Password\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-password')?.['focus']();return;}}}const _0x21a64f=_0x58fffc?.['textContent']||'Commit\x20Changes';_0x58fffc&&(_0x58fffc['disabled']=!![],_0x121e59?_0x58fffc['textContent']='Creating\x20branch\x20&\x20committing...':_0x58fffc['textContent']=_0x5c87ce?'Pulling\x20&\x20Committing...':'Committing...');try{const _0x1ec871={'commit_message':_0x3be8f6,'pull':_0x5c87ce,'push':_0x35e1fa,'conflict_strategy':'rebase'};_0x121e59&&_0x11279b&&(_0x1ec871['new_branch']=_0x11279b);let _0x45cb81=null;this['onApprove']&&(_0x45cb81=await this['onApprove'](this['taskData']['taskId'],_0x1ec871));let _0x5c447e='Changes\x20committed';if(_0x121e59)_0x5c447e='Changes\x20committed\x20to\x20new\x20branch\x20\x27'+_0x11279b+'\x27',_0x35e1fa&&(_0x5c447e+='\x20and\x20pushed');else{if(_0x5c87ce&&_0x35e1fa)_0x5c447e='Changes\x20pulled,\x20committed,\x20and\x20pushed';else{if(_0x5c87ce)_0x5c447e='Changes\x20pulled\x20and\x20committed';else _0x35e1fa&&(_0x5c447e='Changes\x20committed\x20and\x20pushed');}}const _0x8be1d9=this['_el']('sync-to-ibmi')?.['checked'];let _0x583a33=null,_0x54bcdf=null,_0x715b92=null,_0x320f46=null;if(_0x8be1d9&&this['onSyncToIbmi']){_0x583a33=this['_el']('ibmi-sync-library')?.['value']?.['trim']()?.['toUpperCase'](),_0x54bcdf=this['_el']('ibmi-sync-user')?.['value']?.['trim']()?.['toUpperCase']()||null,_0x715b92=this['_el']('ibmi-sync-password')?.['value']||null;if(this['_syncFileTree']&&this['_syncRelativeFiles']&&this['_syncAbsolutePaths']){const _0x3d5770=this['_syncFileTree']['getSelectedFiles']();_0x320f46=_0x3d5770['map'](_0x4d2ba2=>{const _0x367db8=this['_syncRelativeFiles']['indexOf'](_0x4d2ba2);return _0x367db8>=0x0?this['_syncAbsolutePaths'][_0x367db8]:_0x4d2ba2;});}}this['showToast'](_0x5c447e,'success'),this['hide']();if(this['_createPR']&&this['onCreatePR'])try{await this['onCreatePR'](this['taskData']['taskId'],_0x45cb81||{});}catch(_0x823705){console['warn']('PR\x20creation\x20failed\x20or\x20cancelled:',_0x823705);}if(_0x8be1d9&&this['onSyncToIbmi']&&_0x583a33){localStorage['setItem']('coderflow_ibmi_sync_library',_0x583a33);if(_0x54bcdf)localStorage['setItem']('coderflow_ibmi_sync_user',_0x54bcdf);try{await this['onSyncToIbmi'](this['taskData']['taskId'],_0x583a33,_0x54bcdf,_0x715b92,_0x320f46);}catch(_0x1238c6){this['showToast']('Sync\x20failed:\x20'+_0x1238c6['message'],'error');}}this['onSuccess']&&this['onSuccess'](this['taskData']);}catch(_0xfcfb3b){console['error']('Failed\x20to\x20approve\x20changes',_0xfcfb3b),_0xfcfb3b['hasConflicts']?this['_showConflictResolution']():this['showError']('Failed\x20to\x20commit:\x20'+_0xfcfb3b['message']),_0x58fffc&&(_0x58fffc['disabled']=![],_0x58fffc['textContent']=_0x21a64f),this['onError']&&this['onError'](_0xfcfb3b);}}['isVisible'](){const _0x5f0cda=this['_el']('approve-modal');return _0x5f0cda&&!_0x5f0cda['hidden'];}['destroy'](){const _0x303602=this['_el']('approve-modal');_0x303602&&_0x303602['remove'](),this['initialized']=![];}}export function getApproveState(_0x5ad695,_0x3a733b){if(!_0x5ad695)return{'canApprove':![],'reason':'No\x20task\x20data'};if(isLogOnlyTaskType(_0x5ad695['taskType']))return{'canApprove':![],'reason':(_0x5ad695['taskType']==='test'?'Test':'Deploy')+'\x20tasks\x20cannot\x20be\x20approved'};const _0x44171a=_0x3a733b?.['repos_changed']?.['length']>0x0,_0xc7e6db=_0x5ad695['status']==='completed'||_0x5ad695['status']==='failed'||_0x5ad695['status']==='interrupted',_0x5d45ab=_0x5ad695['containerState']==='running',_0x124a8a=_0x5ad695['approvedBy']!==undefined&&_0x5ad695['approvedBy']!==null;if(_0x124a8a){const _0x3275a3=_0x5ad695['approvedBy']['name']||_0x5ad695['approvedBy']['username']||'user';return{'canApprove':![],'reason':'Already\x20approved\x20by\x20'+_0x3275a3};}if(!_0x44171a)return{'canApprove':![],'reason':'No\x20changes\x20to\x20approve'};if(!_0xc7e6db)return{'canApprove':![],'reason':'Task\x20must\x20complete\x20first'};if(!_0x5ad695['containerId'])return{'canApprove':![],'reason':'Container\x20no\x20longer\x20available'};if(!_0x5d45ab)return{'canApprove':![],'reason':'Container\x20is\x20not\x20running'};return{'canApprove':!![],'reason':'Ready\x20to\x20approve'};}
1
+ function isLogOnlyTaskType(_0x4f0fd3){return _0x4f0fd3==='test'||_0x4f0fd3==='deploy';}export function createApproveDialogHTML(_0x1d23ae='',_0x544cda={}){const _0x22d81a=_0x1d23ae,_0x2b28e0=_0x544cda['useTaskPageStyles']?'modal\x20profound-approve-modal':'profound-feedback-modal\x20profound-approve-modal',_0x52dee0=_0x544cda['useTaskPageStyles']?'modal-warning':'approve-modal-warning',_0x30adf5=_0x544cda['useTaskPageStyles']?'modal-error':'approve-modal-error';return'\x0a\x20\x20\x20\x20<div\x20id=\x22'+_0x22d81a+'approve-modal\x22\x20class=\x22'+_0x2b28e0+'\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-overlay\x22></div>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-content\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h2>Approve\x20Changes</h2>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22modal-close\x22\x20id=\x22'+_0x22d81a+'close-approve-modal\x22>&times;</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-body\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x22d81a+'approve-warning\x22\x20class=\x22'+_0x52dee0+'\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22warning-icon\x22>!</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x22d81a+'approve-warning-text\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x22d81a+'approve-error\x22\x20class=\x22'+_0x30adf5+'\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22error-icon\x22>!</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x22d81a+'approve-error-text\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x22d81a+'conflict-resolution\x22\x20class=\x22conflict-resolution-panel\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22conflict-resolution-message\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22warning-icon\x22>!</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Remote\x20has\x20conflicting\x20changes\x20that\x20couldn\x27t\x20be\x20merged\x20automatically.</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22conflict-resolution-options\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x20btn-small\x22\x20id=\x22'+_0x22d81a+'conflict-agent-resolve\x22>Let\x20the\x20agent\x20resolve\x20conflicts</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22>The\x20agent\x20will\x20pull\x20remote\x20changes,\x20resolve\x20conflicts,\x20and\x20prepare\x20for\x20re-approval.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-secondary\x20btn-small\x22\x20id=\x22'+_0x22d81a+'conflict-new-branch\x22>Create\x20a\x20new\x20branch\x20instead</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22>Avoids\x20the\x20conflict\x20by\x20committing\x20to\x20a\x20separate\x20branch.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-secondary\x20btn-small\x22\x20id=\x22'+_0x22d81a+'conflict-cancel\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\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=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-info\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x22d81a+'approve-repo-name\x22\x20class=\x22modal-repo\x22>Repository</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x22d81a+'approve-stats\x22\x20class=\x22modal-stats\x22>0\x20files\x20changed</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x22d81a+'approve-branches\x22\x20class=\x22modal-branches\x22\x20hidden></div>\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=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x22d81a+'commit-message-input\x22>Commit\x20message:</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<textarea\x20id=\x22'+_0x22d81a+'commit-message-input\x22\x20class=\x22commit-message-input\x22\x20rows=\x226\x22\x20placeholder=\x22Enter\x20commit\x20message...\x22></textarea>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20id=\x22'+_0x22d81a+'multi-repo-note\x22\x20class=\x22field-hint\x22\x20hidden>This\x20commit\x20message\x20will\x20be\x20used\x20for\x20all\x20repositories\x20listed\x20above.</p>\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=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x22d81a+'pull-before-commit\x22\x20checked>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Pull\x20from\x20remote\x20after\x20commit</span>\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=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x22d81a+'push-after-commit\x22\x20checked>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Push\x20to\x20remote\x20after\x20commit</span>\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=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x22d81a+'create-new-branch\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Create\x20new\x20branch</span>\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<div\x20id=\x22'+_0x22d81a+'new-branch-input-container\x22\x20class=\x22new-branch-container\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x22d81a+'new-branch-name\x22\x20class=\x22new-branch-input\x22\x20placeholder=\x22Enter\x20new\x20branch\x20name...\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22>A\x20new\x20branch\x20will\x20be\x20created\x20from\x20the\x20current\x20branch\x20before\x20committing.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x22d81a+'pr-option-section\x22\x20class=\x22modal-section\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x22d81a+'create-pull-request\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Create\x20pull\x20request</span>\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<p\x20class=\x22field-hint\x22\x20id=\x22'+_0x22d81a+'pr-hint\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20A\x20new\x20branch\x20will\x20be\x20created,\x20pushed,\x20and\x20a\x20pull\x20request\x20opened.\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x22d81a+'ibmi-sync-section\x22\x20class=\x22modal-section\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22approve-divider\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x22d81a+'sync-to-ibmi\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Sync\x20to\x20IBM\x20i</span>\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<div\x20id=\x22'+_0x22d81a+'ibmi-sync-fields\x22\x20class=\x22new-branch-container\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x22d81a+'ibmi-sync-library\x22>Library\x20name</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x22d81a+'ibmi-sync-library\x22\x20class=\x22new-branch-input\x20code-font\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20maxlength=\x2210\x22\x20placeholder=\x22e.g.,\x20MYLIB\x22\x20style=\x22width:\x20160px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x22d81a+'ibmi-sync-credentials-row\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x22d81a+'ibmi-sync-user\x22\x20style=\x22margin-top:\x208px;\x20display:\x20block;\x22>User\x20profile</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x22d81a+'ibmi-sync-user\x22\x20class=\x22new-branch-input\x20code-font\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20maxlength=\x2210\x22\x20placeholder=\x22e.g.,\x20MYUSER\x22\x20style=\x22width:\x20160px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x22d81a+'ibmi-sync-password\x22\x20style=\x22margin-top:\x208px;\x20display:\x20block;\x22>Password</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22password\x22\x20id=\x22'+_0x22d81a+'ibmi-sync-password\x22\x20class=\x22new-branch-input\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20placeholder=\x22Enter\x20password\x22\x20style=\x22width:\x20160px;\x22\x20autocomplete=\x22off\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x22d81a+'ibmi-sync-files-section\x22\x20style=\x22margin-top:\x2010px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20style=\x22display:\x20block;\x20margin-bottom:\x204px;\x22>Files\x20to\x20sync</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x22d81a+'ibmi-sync-file-tree\x22\x20class=\x22file-selection-tree-container\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20style=\x22max-height:\x20250px;\x20overflow-y:\x20auto;\x20border:\x201px\x20solid\x20var(--border-color,\x20var(--color-border));\x20border-radius:\x204px;\x20padding:\x208px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-selection-summary\x22\x20id=\x22'+_0x22d81a+'ibmi-sync-files-summary\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-ghost\x22\x20id=\x22'+_0x22d81a+'cancel-approve\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x22\x20id=\x22'+_0x22d81a+'confirm-approve\x22>Commit\x20Changes</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20</div>\x0a\x20\x20';}export class ApproveDialog{constructor(_0xb6e546={}){this['prefix']=_0xb6e546['prefix']||'',this['onApprove']=_0xb6e546['onApprove'],this['onSync']=_0xb6e546['onSync'],this['onSuccess']=_0xb6e546['onSuccess'],this['onError']=_0xb6e546['onError'],this['onCreatePR']=_0xb6e546['onCreatePR'],this['showToast']=_0xb6e546['showToast']||(()=>{}),this['container']=_0xb6e546['container']||document['body'],this['useTaskPageStyles']=_0xb6e546['useTaskPageStyles']||![],this['baseUrl']=_0xb6e546['baseUrl']||'',this['coderflowAttribution']=_0xb6e546['coderflowAttribution'],this['onConflictFollowUp']=_0xb6e546['onConflictFollowUp']||null,this['onSyncToIbmi']=_0xb6e546['onSyncToIbmi']||null,this['onGetSyncFiles']=_0xb6e546['onGetSyncFiles']||null,this['taskData']=null,this['initialized']=![],this['isSyncing']=![],this['_createPR']=![],this['_attributionRequestId']=0x0,this['_syncFileTree']=null,this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null,this['_transientWarning']='';}['init'](){if(this['initialized'])return;const _0x48f891=document['createElement']('div');_0x48f891['innerHTML']=createApproveDialogHTML(this['prefix'],{'useTaskPageStyles':this['useTaskPageStyles']}),this['container']['appendChild'](_0x48f891['firstElementChild']),this['_bindEvents'](),this['initialized']=!![];}['_el'](_0x515b84){return document['getElementById'](''+this['prefix']+_0x515b84);}['_bindEvents'](){const _0x55ca48=this['_el']('approve-modal'),_0x2da68c=this['_el']('close-approve-modal'),_0x57c64d=this['_el']('cancel-approve'),_0x311b1a=this['_el']('confirm-approve'),_0x4bb9b3=_0x55ca48?.['querySelector']('.modal-overlay'),_0x33737d=this['_el']('pull-before-commit'),_0x4f302f=this['_el']('create-new-branch'),_0x5a3c10=this['_el']('new-branch-input-container'),_0x3db67e=this['_el']('new-branch-name'),_0x3d5bea=this['_el']('push-after-commit'),_0x34e6df=this['_el']('create-pull-request'),_0x3bfee3=this['_el']('pr-hint'),_0x3a698d=()=>{this['_refreshWarningBanner']();};_0x2da68c?.['addEventListener']('click',()=>this['hide']()),_0x57c64d?.['addEventListener']('click',()=>this['hide']()),_0x4bb9b3?.['addEventListener']('click',()=>this['hide']()),_0x311b1a?.['addEventListener']('click',()=>this['_handleApprove']());_0x4f302f&&_0x4f302f['addEventListener']('change',()=>{_0x5a3c10&&(_0x5a3c10['hidden']=!_0x4f302f['checked']),_0x4f302f['checked']&&_0x3db67e&&_0x3db67e['focus'](),_0x3a698d();});_0x33737d?.['addEventListener']('change',()=>{_0x3a698d();});_0x34e6df&&_0x3d5bea&&_0x4f302f&&(_0x34e6df['addEventListener']('change',()=>{this['_createPR']=_0x34e6df['checked'];if(_0x34e6df['checked']){_0x3d5bea['checked']=!![],_0x3d5bea['disabled']=!![],_0x4f302f['checked']=!![],_0x4f302f['disabled']=!![];_0x5a3c10&&(_0x5a3c10['hidden']=![]);if(_0x3bfee3)_0x3bfee3['hidden']=![];}else{_0x3d5bea['disabled']=![],_0x4f302f['disabled']=![];if(_0x3bfee3)_0x3bfee3['hidden']=!![];}_0x3a698d();}),_0x3d5bea['addEventListener']('change',()=>{if(!_0x3d5bea['checked']&&_0x34e6df['checked']){_0x34e6df['checked']=![],this['_createPR']=![],_0x3d5bea['disabled']=![],_0x4f302f['disabled']=![];if(_0x3bfee3)_0x3bfee3['hidden']=!![];}}));_0x3a698d();const _0x58a23d=this['_el']('sync-to-ibmi');_0x58a23d&&_0x58a23d['addEventListener']('change',async _0x1c6258=>{const _0x3d2f6c=this['_el']('ibmi-sync-fields');if(_0x3d2f6c)_0x3d2f6c['hidden']=!_0x1c6258['target']['checked'];if(_0x1c6258['target']['checked']){const _0xdc6e4=this['_el']('ibmi-sync-library'),_0x540d0e=localStorage['getItem']('coderflow_ibmi_sync_library');_0x540d0e&&_0xdc6e4&&!_0xdc6e4['value']&&(_0xdc6e4['value']=_0x540d0e);const _0xd5da98=this['_el']('ibmi-sync-user');if(_0xd5da98&&!_0xd5da98['value']){const _0xef1a19=localStorage['getItem']('coderflow_ibmi_sync_user');if(_0xef1a19)_0xd5da98['value']=_0xef1a19;}const _0x1c984f=this['_el']('ibmi-sync-password');if(_0x1c984f)_0x1c984f['value']='';!this['_syncFileTree']&&this['onGetSyncFiles']&&this['taskData']?.['taskId']&&await this['_loadSyncFileTree']();}}),this['_el']('conflict-agent-resolve')?.['addEventListener']('click',()=>{this['onConflictFollowUp']&&this['onConflictFollowUp'](this['taskData']['taskId']),this['hide'](),this['showToast']('Agent\x20is\x20resolving\x20conflicts.\x20Re-approve\x20when\x20it\x20finishes.','info');}),this['_el']('conflict-new-branch')?.['addEventListener']('click',()=>{this['_hideConflictResolution']();const _0x441122=this['_el']('create-new-branch'),_0x504825=this['_el']('new-branch-input-container'),_0x3fb944=this['_el']('new-branch-name');if(_0x441122)_0x441122['checked']=!![];if(_0x504825)_0x504825['hidden']=![];if(_0x3fb944)_0x3fb944['focus']();_0x3a698d();}),this['_el']('conflict-cancel')?.['addEventListener']('click',()=>this['hide']()),document['addEventListener']('keydown',_0x4fa6ea=>{_0x4fa6ea['key']==='Escape'&&_0x55ca48&&!_0x55ca48['hidden']&&this['hide']();});}async['_loadSyncFileTree'](){const _0x10052e=this['_el']('ibmi-sync-file-tree'),_0x26e754=this['_el']('ibmi-sync-files-summary');if(!_0x10052e)return;_0x10052e['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>Loading\x20files...</span>';if(_0x26e754)_0x26e754['textContent']='';try{const {files:_0x45ef63,absolutePaths:_0x236ab1}=await this['onGetSyncFiles'](this['taskData']['taskId']);this['_syncRelativeFiles']=_0x45ef63,this['_syncAbsolutePaths']=_0x236ab1;if(_0x45ef63['length']===0x0){_0x10052e['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>No\x20changed\x20files\x20found.</span>';return;}const {FileSelectionTree:_0x2a616e}=await import('./file-selection-tree.js'),{validateIbmiFile:_0x42a63c,hasKnownIbmiExtension:_0x11a11f}=await import('./ibmi-file-filter.js');this['_syncFileTree']=new _0x2a616e({'container':_0x10052e,'files':_0x45ef63,'isPreselected':_0x3a275b=>{const {valid:_0x17416f}=_0x42a63c(_0x3a275b);return _0x17416f&&_0x11a11f(_0x3a275b);},'isDisabled':_0x53a3ab=>{const {valid:_0x16b085,reason:_0x13c8d5}=_0x42a63c(_0x53a3ab);return{'disabled':!_0x16b085,'reason':_0x13c8d5};},'isAutoCheckEligible':_0x5c1cd1=>{const {valid:_0x192544}=_0x42a63c(_0x5c1cd1);return _0x192544&&_0x11a11f(_0x5c1cd1);},'onChange':_0x58e713=>{_0x26e754&&(_0x26e754['textContent']=_0x58e713['length']+'\x20of\x20'+_0x45ef63['length']+'\x20file'+(_0x45ef63['length']!==0x1?'s':'')+'\x20selected');}}),this['_syncFileTree']['render']();}catch(_0x6756a6){_0x10052e['innerHTML']='<span\x20style=\x22color:\x20var(--color-danger,\x20#e55368);\x20font-size:\x2013px;\x22>Failed\x20to\x20load\x20files</span>';}}['showError'](_0x3caacb){const _0x3b3190=this['_el']('approve-error'),_0x3959a6=this['_el']('approve-error-text');_0x3b3190&&_0x3959a6&&(_0x3959a6['textContent']=_0x3caacb,_0x3b3190['hidden']=![],_0x3b3190['scrollIntoView']({'behavior':'smooth','block':'nearest'}));}['hideError'](){const _0x39d8a5=this['_el']('approve-error'),_0x4adace=this['_el']('approve-error-text');_0x39d8a5&&_0x4adace&&(_0x39d8a5['hidden']=!![],_0x4adace['textContent']='');}['_displayBranchInfo'](_0x329831,_0x3de5f5={}){const _0x244ef9=this['_el']('approve-branches');if(!_0x244ef9)return;const _0x3e7f0e=[];for(const _0x22c347 of _0x329831){_0x3de5f5[_0x22c347['name']]&&_0x3e7f0e['push']({'repo':_0x22c347['name'],'branch':_0x3de5f5[_0x22c347['name']]});}if(_0x3e7f0e['length']>0x0){_0x244ef9['hidden']=![];if(_0x3e7f0e['length']===0x1)_0x244ef9['innerHTML']='<div\x20class=\x22branch-info\x22>Branch:\x20<code>'+_0x3e7f0e[0x0]['branch']+'</code></div>';else{const _0x2a6938=_0x3e7f0e['map'](_0x3ff173=>'<div\x20class=\x22branch-item\x22><strong>'+_0x3ff173['repo']+':</strong>\x20<code>'+_0x3ff173['branch']+'</code></div>')['join']('');_0x244ef9['innerHTML']='<div\x20class=\x22branch-info\x22>Branches:<div\x20class=\x22branch-list\x22>'+_0x2a6938+'</div></div>';}}else _0x244ef9['hidden']=!![],_0x244ef9['innerHTML']='';}['showWarning'](_0x3469c6){const _0x315cb0=this['_el']('approve-warning'),_0x3aa3eb=this['_el']('approve-warning-text');_0x315cb0&&_0x3aa3eb&&(_0x3aa3eb['textContent']=_0x3469c6,_0x315cb0['hidden']=![]);}['hideWarning'](){const _0x1bd56d=this['_el']('approve-warning'),_0x1e0c3f=this['_el']('approve-warning-text');_0x1bd56d&&_0x1e0c3f&&(_0x1bd56d['hidden']=!![],_0x1e0c3f['textContent']='');}['_showConflictResolution'](){const _0x5add58=this['_el']('conflict-resolution'),_0x754fd2=this['_el']('confirm-approve'),_0x69c23c=this['_el']('cancel-approve'),_0x326617=this['_el']('conflict-agent-resolve');if(_0x5add58)_0x5add58['hidden']=![];if(_0x754fd2)_0x754fd2['hidden']=!![];if(_0x69c23c)_0x69c23c['hidden']=!![];const _0x265902=this['_el']('approve-modal');if(_0x265902){this['_sectionsHiddenBeforeConflict']=new Set();for(const _0x1c0e7b of _0x265902['querySelectorAll']('.modal-section')){_0x1c0e7b['hidden']&&this['_sectionsHiddenBeforeConflict']['add'](_0x1c0e7b),_0x1c0e7b['hidden']=!![];}}if(_0x326617){const _0x3301fd=!!this['onConflictFollowUp'];_0x326617['hidden']=!_0x3301fd,_0x326617['nextElementSibling']?.['classList']['contains']('field-hint')&&(_0x326617['nextElementSibling']['hidden']=!_0x3301fd);}}['_hideConflictResolution'](){const _0x54287c=this['_el']('conflict-resolution'),_0xf2005f=this['_el']('confirm-approve'),_0x251394=this['_el']('cancel-approve');if(_0x54287c)_0x54287c['hidden']=!![];if(_0xf2005f)_0xf2005f['hidden']=![];if(_0x251394)_0x251394['hidden']=![];const _0x299a42=this['_el']('approve-modal');if(_0x299a42){const _0x374306=this['_sectionsHiddenBeforeConflict']||new Set();for(const _0x199522 of _0x299a42['querySelectorAll']('.modal-section')){!_0x374306['has'](_0x199522)&&(_0x199522['hidden']=![]);}this['_sectionsHiddenBeforeConflict']=null;}}['_getRemoteConflictWarning'](){const _0x12440f=this['taskData']?.['reposChanged']||[],_0x462be4=this['_el']('pull-before-commit')?.['checked']??!![],_0x3f8b5d=this['_el']('create-new-branch')?.['checked']||![];if(!_0x462be4||_0x3f8b5d||_0x12440f['length']===0x0)return'';const _0x1c1d48=_0x12440f['filter'](_0xc89c41=>_0xc89c41?.['upstream_status']==='behind'||_0xc89c41?.['upstream_status']==='diverged');if(_0x1c1d48['length']===0x0)return'';const _0x43676b=_0x1c1d48['map'](_0x7e17e3=>{const _0x8adc60=Number(_0x7e17e3?.['upstream_behind'])||0x0,_0x238441=_0x8adc60+'\x20commit'+(_0x8adc60===0x1?'':'s')+'\x20ahead';if(_0x7e17e3['upstream_status']==='diverged')return _0x7e17e3['name']+':\x20remote\x20is\x20'+_0x238441+'\x20and\x20the\x20tracked\x20branch\x20has\x20local\x20commits';return _0x7e17e3['name']+':\x20remote\x20is\x20'+_0x238441;})['join'](';\x20');return'Remote\x20has\x20new\x20changes\x20('+_0x43676b+').\x20If\x20there\x20are\x20conflicts,\x20you\x27ll\x20be\x20given\x20options\x20to\x20resolve\x20them.';}['_refreshWarningBanner'](){const _0x103883=[this['taskData']?.['warning']||'',this['_getRemoteConflictWarning'](),this['_transientWarning']||'']['filter'](Boolean);if(_0x103883['length']>0x0){this['showWarning'](_0x103883['join']('\x20'));return;}this['hideWarning']();}['_stripCoAuthoredByLines'](_0x568474){return _0x568474['replace'](/^Co-Authored-By:.*$/gmi,'')['replace'](/^Learn more: https:\/\/coderflow\.ai\s*$/gm,'')['replace'](/\n{3,}/g,'\x0a\x0a')['trim']();}async['_addAttributionIfEnabled'](_0x48acf3){try{let _0x1bdcbe;try{const _0x180fc8=await fetch(this['baseUrl']+'/settings');if(_0x180fc8['ok']){const _0x3399d1=await _0x180fc8['json']();_0x1bdcbe=_0x3399d1['coderflow_attribution']!==![];}}catch(_0x245a40){}_0x1bdcbe===undefined&&(this['coderflowAttribution']!==undefined?_0x1bdcbe=this['coderflowAttribution']!==![]:_0x1bdcbe=!![]);const _0x1f83fa=this['_stripCoAuthoredByLines'](_0x48acf3);if(!_0x1bdcbe)return _0x1f83fa;const _0x4d7b08='\x0a\x0aCo-Authored-By:\x20CoderFlow\x20<ai@coderflow.ai>\x0aLearn\x20more:\x20https://coderflow.ai';return _0x1f83fa+_0x4d7b08;}catch(_0x4dbfc1){return console['warn']('Failed\x20to\x20add\x20CoderFlow\x20attribution:',_0x4dbfc1),_0x48acf3;}}['show'](_0x2e6c98){!this['initialized']&&this['init']();this['taskData']=_0x2e6c98;const _0x432125=this['_el']('approve-modal'),_0x4beb11=this['_el']('commit-message-input'),_0x249fca=this['_el']('pull-before-commit'),_0x1122a5=this['_el']('push-after-commit'),_0x3b3b49=this['_el']('create-new-branch'),_0x5df372=this['_el']('new-branch-input-container'),_0x327b63=this['_el']('new-branch-name');if(!_0x432125)return;this['hideError'](),this['hideWarning'](),this['_hideConflictResolution'](),this['_transientWarning']='';const _0x2f2117=_0x2e6c98['reposChanged']||[];if(_0x2f2117['length']===0x0&&!_0x2e6c98['syncFirst']){this['showToast']('No\x20changes\x20to\x20approve','error');return;}this['_updateDisplay'](_0x2f2117,_0x2e6c98);const _0x1fd009=_0x2e6c98['commitMessage']||'',_0x1bf4bd=this['_stripCoAuthoredByLines'](_0x1fd009);_0x4beb11['value']=_0x1bf4bd;if(_0x249fca)_0x249fca['checked']=!![];if(_0x1122a5)_0x1122a5['checked']=!![];_0x3b3b49&&(_0x3b3b49['checked']=![]);_0x5df372&&(_0x5df372['hidden']=!![]);_0x327b63&&(_0x327b63['value']='');if(_0x1122a5)_0x1122a5['disabled']=![];if(_0x3b3b49)_0x3b3b49['disabled']=![];this['_refreshWarningBanner'](),this['updatePRSupport'](_0x2e6c98['prSupported']===!![]);const _0x5d6e01=this['_el']('ibmi-sync-section');if(_0x5d6e01){_0x5d6e01['hidden']=!_0x2e6c98['ibmiSyncAvailable'];const _0x15eebc=this['_el']('sync-to-ibmi'),_0x36db8e=this['_el']('ibmi-sync-fields'),_0x2511fe=this['_el']('ibmi-sync-library');if(_0x15eebc)_0x15eebc['checked']=![];if(_0x36db8e)_0x36db8e['hidden']=!![];if(_0x2511fe)_0x2511fe['value']='';const _0x1695cc=this['_el']('ibmi-sync-credentials-row');_0x1695cc&&(_0x1695cc['hidden']=!(_0x2e6c98['ibmiSyncAvailable']&&_0x2e6c98['syncCredentials']==='prompt'));}const _0x943373=this['_el']('confirm-approve');_0x2e6c98['syncFirst']&&this['onSync']?(_0x943373&&(_0x943373['disabled']=!![],_0x943373['textContent']='Syncing...'),this['_performSync']()):_0x943373&&(_0x943373['disabled']=![],_0x943373['textContent']='Commit\x20Changes');_0x432125['hidden']=![];const _0x495966=++this['_attributionRequestId'];void this['_applyAttributionAsync']({'requestId':_0x495966,'taskId':_0x2e6c98['taskId'],'originalCommitMessage':_0x1bf4bd}),setTimeout(()=>{_0x4beb11['focus'](),_0x4beb11['setSelectionRange'](0x0,_0x4beb11['value']['length']);},0x64);}['updatePRSupport'](_0x127bd6){const _0x5e6bd1=this['_el']('pr-option-section'),_0x5de18d=this['_el']('create-pull-request'),_0x1a8c05=this['_el']('pr-hint'),_0xee59e0=this['_el']('push-after-commit'),_0x393926=this['_el']('create-new-branch');if(!_0x5e6bd1)return;if(_0x127bd6){_0x5e6bd1['hidden']=![];_0x5de18d&&!_0x5de18d['disabled']&&(_0x5de18d['checked']=![]);if(_0x1a8c05)_0x1a8c05['hidden']=!![];this['_createPR']=![];return;}_0x5de18d?.['checked']&&(_0x5de18d['checked']=![]);if(_0x1a8c05)_0x1a8c05['hidden']=!![];if(_0xee59e0)_0xee59e0['disabled']=![];if(_0x393926)_0x393926['disabled']=![];this['_createPR']=![],_0x5e6bd1['hidden']=!![];}async['_applyAttributionAsync']({requestId:_0x5ce70f,taskId:_0x46a1c3,originalCommitMessage:_0x59de2f}){const _0x586e52=this['_el']('commit-message-input');if(!_0x586e52)return;const _0x952766=await this['_addAttributionIfEnabled'](_0x59de2f);if(_0x5ce70f!==this['_attributionRequestId'])return;if(!this['taskData']||this['taskData']['taskId']!==_0x46a1c3)return;if(!this['isVisible']())return;const _0x16439e=_0x4aa084=>_0x4aa084['replace'](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a');if(_0x16439e(_0x586e52['value'])!==_0x16439e(_0x59de2f))return;_0x586e52['value']=_0x952766;}['_updateDisplay'](_0x231840,_0x99306b){const _0x43a241=this['_el']('approve-repo-name'),_0x437065=this['_el']('approve-stats'),_0x2071e4=this['_el']('multi-repo-note');if(_0x231840['length']===0x0){if(_0x43a241)_0x43a241['textContent']='Syncing...';if(_0x437065)_0x437065['textContent']='';if(_0x2071e4)_0x2071e4['hidden']=!![];return;}const _0x1397d9=_0x231840['reduce']((_0x1d4c44,_0x48fe8f)=>_0x1d4c44+(_0x48fe8f['files_changed']||0x0),0x0),_0xd591f5=_0x231840['reduce']((_0x17636a,_0x3ed1a4)=>_0x17636a+(_0x3ed1a4['lines_added']||0x0),0x0),_0xcfb320=_0x231840['reduce']((_0x1a49c1,_0x778983)=>_0x1a49c1+(_0x778983['lines_deleted']||0x0),0x0);if(_0x231840['length']===0x1){if(_0x43a241)_0x43a241['textContent']=_0x231840[0x0]?.['name']||'repository';if(_0x2071e4)_0x2071e4['hidden']=!![];}else{const _0x44f643=_0x231840['map'](_0xbe0346=>_0xbe0346['name'])['join'](',\x20');if(_0x43a241)_0x43a241['textContent']=_0x231840['length']+'\x20repositories:\x20'+_0x44f643;if(_0x2071e4)_0x2071e4['hidden']=![];}_0x437065&&(_0x437065['textContent']=_0x1397d9+'\x20file'+(_0x1397d9===0x1?'':'s')+'\x20changed\x20(+'+_0xd591f5+'\x20-'+_0xcfb320+')'),this['_displayBranchInfo'](_0x231840,_0x99306b?.['branches']||{});}async['_performSync'](){if(!this['onSync']||this['isSyncing'])return;this['isSyncing']=!![];const _0x22d3bc=this['_el']('confirm-approve');try{const _0x201a27=await this['onSync'](this['taskData']['taskId']);if(!this['isVisible']()){this['isSyncing']=![];return;}if(_0x201a27['repos_changed']){const _0x40b72d=this['taskData']['reposChanged']?.['length']||0x0,_0x2f7e9d=this['taskData']['reposChanged']?.['reduce']((_0x8b473f,_0x20e388)=>_0x8b473f+(_0x20e388['files_changed']||0x0),0x0)||0x0;this['taskData']['reposChanged']=_0x201a27['repos_changed'];if(_0x201a27['current_branches']){const _0x34e28e={...this['taskData']['branches']||{}};for(const [_0x2fd470,_0x2d091c]of Object['entries'](_0x201a27['current_branches'])){_0x2d091c?_0x34e28e[_0x2fd470]=_0x2d091c:delete _0x34e28e[_0x2fd470];}this['taskData']['branches']=_0x34e28e;}this['_updateDisplay'](_0x201a27['repos_changed'],this['taskData']);const _0x2bb726=_0x201a27['repos_changed']['length'],_0x2639b3=_0x201a27['repos_changed']['reduce']((_0x4a9e5a,_0x166ba3)=>_0x4a9e5a+(_0x166ba3['files_changed']||0x0),0x0);(_0x2639b3>_0x2f7e9d||_0x2bb726>_0x40b72d)&&(this['_transientWarning']='Additional\x20changes\x20detected\x20since\x20last\x20sync.\x20Review\x20the\x20updated\x20file\x20list.'),this['_refreshWarningBanner']();}_0x22d3bc&&(!this['taskData']['reposChanged']||this['taskData']['reposChanged']['length']===0x0?(_0x22d3bc['disabled']=!![],_0x22d3bc['textContent']='No\x20Changes',this['showError']('No\x20changes\x20to\x20approve\x20after\x20sync')):(_0x22d3bc['disabled']=![],_0x22d3bc['textContent']='Commit\x20Changes'));}catch(_0x4917e8){console['error']('Failed\x20to\x20sync\x20repos\x20before\x20approve:',_0x4917e8);if(!this['isVisible']()){this['isSyncing']=![];return;}this['showError']('Sync\x20failed:\x20'+_0x4917e8['message']+'.\x20You\x20can\x20still\x20commit\x20with\x20existing\x20staged\x20changes.'),_0x22d3bc&&(this['taskData']['reposChanged']&&this['taskData']['reposChanged']['length']>0x0?(_0x22d3bc['disabled']=![],_0x22d3bc['textContent']='Commit\x20Changes'):(_0x22d3bc['disabled']=!![],_0x22d3bc['textContent']='No\x20Changes'));}finally{this['isSyncing']=![];}}['hide'](){const _0x22879d=this['_el']('approve-modal');_0x22879d&&(_0x22879d['hidden']=!![]),this['_syncFileTree']&&(this['_syncFileTree']['destroy'](),this['_syncFileTree']=null),this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}async['_handleApprove'](){const _0x29d2c8=this['_el']('commit-message-input'),_0x59b6ac=this['_el']('pull-before-commit'),_0x199c7e=this['_el']('push-after-commit'),_0x45c3a3=this['_el']('create-new-branch'),_0x304496=this['_el']('new-branch-name'),_0x45538f=this['_el']('confirm-approve'),_0x3d1e9b=_0x29d2c8['value']['trim'](),_0x5322d0=_0x59b6ac?.['checked']??!![],_0x97004=_0x199c7e?.['checked']??!![],_0x2456a6=_0x45c3a3?.['checked']||![],_0x4737cf=_0x304496?.['value']['trim']()||'';this['hideError']();if(!_0x3d1e9b){this['showError']('Commit\x20message\x20is\x20required'),_0x29d2c8['focus']();return;}if(_0x2456a6&&!_0x4737cf){this['showError']('Branch\x20name\x20is\x20required\x20when\x20creating\x20a\x20new\x20branch'),_0x304496?.['focus']();return;}if(_0x2456a6&&_0x4737cf){const _0x2c3289=/[\s~^:?*\[\\]/;if(_0x2c3289['test'](_0x4737cf)){this['showError']('Invalid\x20branch\x20name.\x20Avoid\x20spaces\x20and\x20special\x20characters\x20like\x20~\x20^\x20:\x20?\x20*\x20[\x20\x5c'),_0x304496?.['focus']();return;}}const _0x51944e=this['_el']('sync-to-ibmi')?.['checked'];if(_0x51944e){const _0x1af36c=this['_el']('ibmi-sync-library')?.['value']?.['trim']();if(!_0x1af36c){this['showError']('IBM\x20i\x20library\x20name\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-library')?.['focus']();return;}if(this['_syncFileTree']){const _0x5c39dc=this['_syncFileTree']['getSelectedFiles']();if(_0x5c39dc['length']===0x0){this['showError']('Select\x20at\x20least\x20one\x20file\x20to\x20sync');return;}}if(this['taskData']?.['syncCredentials']==='prompt'){const _0x1c2846=this['_el']('ibmi-sync-user')?.['value']?.['trim']();if(!_0x1c2846){this['showError']('User\x20profile\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-user')?.['focus']();return;}const _0x1f2ee9=this['_el']('ibmi-sync-password')?.['value'];if(!_0x1f2ee9){this['showError']('Password\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-password')?.['focus']();return;}}}const _0xd64b2f=_0x45538f?.['textContent']||'Commit\x20Changes';_0x45538f&&(_0x45538f['disabled']=!![],_0x2456a6?_0x45538f['textContent']='Creating\x20branch\x20&\x20committing...':_0x45538f['textContent']=_0x5322d0?'Pulling\x20&\x20Committing...':'Committing...');try{const _0x1f64e7={'commit_message':_0x3d1e9b,'pull':_0x5322d0,'push':_0x97004,'conflict_strategy':'rebase'};_0x2456a6&&_0x4737cf&&(_0x1f64e7['new_branch']=_0x4737cf);let _0xd5acb=null;this['onApprove']&&(_0xd5acb=await this['onApprove'](this['taskData']['taskId'],_0x1f64e7));let _0x8738aa='Changes\x20committed';if(_0x2456a6)_0x8738aa='Changes\x20committed\x20to\x20new\x20branch\x20\x27'+_0x4737cf+'\x27',_0x97004&&(_0x8738aa+='\x20and\x20pushed');else{if(_0x5322d0&&_0x97004)_0x8738aa='Changes\x20pulled,\x20committed,\x20and\x20pushed';else{if(_0x5322d0)_0x8738aa='Changes\x20pulled\x20and\x20committed';else _0x97004&&(_0x8738aa='Changes\x20committed\x20and\x20pushed');}}const _0x2e48ff=this['_el']('sync-to-ibmi')?.['checked'];let _0x488dc6=null,_0x3a3bed=null,_0x231886=null,_0xdeca41=null;if(_0x2e48ff&&this['onSyncToIbmi']){_0x488dc6=this['_el']('ibmi-sync-library')?.['value']?.['trim']()?.['toUpperCase'](),_0x3a3bed=this['_el']('ibmi-sync-user')?.['value']?.['trim']()?.['toUpperCase']()||null,_0x231886=this['_el']('ibmi-sync-password')?.['value']||null;if(this['_syncFileTree']&&this['_syncRelativeFiles']&&this['_syncAbsolutePaths']){const _0x186f71=this['_syncFileTree']['getSelectedFiles']();_0xdeca41=_0x186f71['map'](_0x21f8fc=>{const _0x335740=this['_syncRelativeFiles']['indexOf'](_0x21f8fc);return _0x335740>=0x0?this['_syncAbsolutePaths'][_0x335740]:_0x21f8fc;});}}this['showToast'](_0x8738aa,'success'),this['hide']();if(this['_createPR']&&this['onCreatePR'])try{await this['onCreatePR'](this['taskData']['taskId'],_0xd5acb||{});}catch(_0x26c82a){console['warn']('PR\x20creation\x20failed\x20or\x20cancelled:',_0x26c82a);}if(_0x2e48ff&&this['onSyncToIbmi']&&_0x488dc6){localStorage['setItem']('coderflow_ibmi_sync_library',_0x488dc6);if(_0x3a3bed)localStorage['setItem']('coderflow_ibmi_sync_user',_0x3a3bed);try{await this['onSyncToIbmi'](this['taskData']['taskId'],_0x488dc6,_0x3a3bed,_0x231886,_0xdeca41);}catch(_0x4b7b08){this['showToast']('Sync\x20failed:\x20'+_0x4b7b08['message'],'error');}}this['onSuccess']&&this['onSuccess'](this['taskData']);}catch(_0x4ec7e2){console['error']('Failed\x20to\x20approve\x20changes',_0x4ec7e2),_0x4ec7e2['hasConflicts']?this['_showConflictResolution']():this['showError']('Failed\x20to\x20commit:\x20'+_0x4ec7e2['message']),_0x45538f&&(_0x45538f['disabled']=![],_0x45538f['textContent']=_0xd64b2f),this['onError']&&this['onError'](_0x4ec7e2);}}['isVisible'](){const _0x1bbead=this['_el']('approve-modal');return _0x1bbead&&!_0x1bbead['hidden'];}['destroy'](){const _0x52d33d=this['_el']('approve-modal');_0x52d33d&&_0x52d33d['remove'](),this['initialized']=![];}}export function getApproveState(_0x3bb6d2,_0x31cbe1){if(!_0x3bb6d2)return{'canApprove':![],'reason':'No\x20task\x20data'};if(isLogOnlyTaskType(_0x3bb6d2['taskType']))return{'canApprove':![],'reason':(_0x3bb6d2['taskType']==='test'?'Test':'Deploy')+'\x20tasks\x20cannot\x20be\x20approved'};const _0x259df3=_0x31cbe1?.['repos_changed']?.['length']>0x0,_0x2dab75=_0x3bb6d2['status']==='completed'||_0x3bb6d2['status']==='failed'||_0x3bb6d2['status']==='interrupted',_0x1876f9=_0x3bb6d2['containerState']==='running',_0x38aac1=_0x3bb6d2['approvedBy']!==undefined&&_0x3bb6d2['approvedBy']!==null;if(_0x38aac1){const _0x59c75f=_0x3bb6d2['approvedBy']['name']||_0x3bb6d2['approvedBy']['username']||'user';return{'canApprove':![],'reason':'Already\x20approved\x20by\x20'+_0x59c75f};}if(!_0x259df3)return{'canApprove':![],'reason':'No\x20changes\x20to\x20approve'};if(!_0x2dab75)return{'canApprove':![],'reason':'Task\x20must\x20complete\x20first'};if(!_0x3bb6d2['containerId'])return{'canApprove':![],'reason':'Container\x20no\x20longer\x20available'};if(!_0x1876f9)return{'canApprove':![],'reason':'Container\x20is\x20not\x20running'};return{'canApprove':!![],'reason':'Ready\x20to\x20approve'};}
@@ -1 +1 @@
1
- export function buildAutomationEnvironmentHref(_0xc6437e,_0x1e0960){const _0x1217c5=new URLSearchParams();_0xc6437e&&_0x1217c5['set']('env',String(_0xc6437e));_0x1217c5['set']('tab','automations');_0x1e0960&&_0x1217c5['set']('automation',String(_0x1e0960));const _0x2e049b=_0x1217c5['toString']();return'environments.html'+(_0x2e049b?'?'+_0x2e049b:'');}export function buildAutomationTaskFilterHref(_0x1e46a3){const _0x18b3ac=new URLSearchParams();_0x1e46a3&&_0x18b3ac['set']('automation',String(_0x1e46a3));const _0x5d7f7c=_0x18b3ac['toString']();return'index.html'+(_0x5d7f7c?'?'+_0x5d7f7c:'');}export function parseAutomationDeepLinkParams(_0xf4a5d4=''){const _0x427f62=new URLSearchParams(_0xf4a5d4||'');return{'env':_0x427f62['get']('env'),'tab':_0x427f62['get']('tab'),'automation':_0x427f62['get']('automation')};}
1
+ export function buildAutomationEnvironmentHref(_0x5ec373,_0x2b32d7){const _0x5dd185=new URLSearchParams();_0x5ec373&&_0x5dd185['set']('env',String(_0x5ec373));_0x5dd185['set']('tab','automations');_0x2b32d7&&_0x5dd185['set']('automation',String(_0x2b32d7));const _0xa0f4ca=_0x5dd185['toString']();return'environments.html'+(_0xa0f4ca?'?'+_0xa0f4ca:'');}export function buildAutomationTaskFilterHref(_0x2b025f){const _0x5bf4c2=new URLSearchParams();_0x2b025f&&_0x5bf4c2['set']('automation',String(_0x2b025f));const _0x54abb0=_0x5bf4c2['toString']();return'index.html'+(_0x54abb0?'?'+_0x54abb0:'');}export function parseAutomationDeepLinkParams(_0x4f5420=''){const _0xf7da58=new URLSearchParams(_0x4f5420||'');return{'env':_0xf7da58['get']('env'),'tab':_0xf7da58['get']('tab'),'automation':_0xf7da58['get']('automation')};}
@@ -1 +1 @@
1
- export const AUTOMATION_MONTHLY_DAY_MIN=0x1;export const AUTOMATION_MONTHLY_DAY_MAX=0x1c;const DEFAULT_SCHEDULE_FORM_STATE=Object['freeze']({'frequency':'daily','dailyHour':'2','dailyMinute':'0','weeklyDay':'1','weeklyHour':'9','weeklyMinute':'0','monthlyDay':'1','monthlyHour':'0','monthlyMinute':'0','recurringInterval':'*/30\x20*\x20*\x20*\x20*','recurringStartHour':'','recurringEndHour':'','recurringDayToken':'*','customCron':''}),RECURRING_INTERVAL_STEPS=['2','4','6','8','12'];function createDefaultScheduleFormState(){return{...DEFAULT_SCHEDULE_FORM_STATE};}function parseBoundedInteger(_0x4850a0,_0x3fa246,_0x3eb230){const _0x376ef7=Number['parseInt'](_0x4850a0,0xa);if(!Number['isInteger'](_0x376ef7)||_0x376ef7<_0x3fa246||_0x376ef7>_0x3eb230)return null;return _0x376ef7;}function inferRecurringInterval(_0x36a5a3,_0x1cbd41){if(_0x36a5a3==='*/15')return'*/15\x20*\x20*\x20*\x20*';if(_0x36a5a3==='*/30')return'*/30\x20*\x20*\x20*\x20*';if(_0x36a5a3!=='0')return'*/30\x20*\x20*\x20*\x20*';if(_0x1cbd41==='*'||/^\d{1,2}-\d{1,2}$/['test'](_0x1cbd41))return'0\x20*\x20*\x20*\x20*';for(const _0x7da670 of RECURRING_INTERVAL_STEPS){if(_0x1cbd41['startsWith']('*/'+_0x7da670)||_0x1cbd41['includes']('/'+_0x7da670))return'0\x20*/'+_0x7da670+'\x20*\x20*\x20*';}return'*/30\x20*\x20*\x20*\x20*';}function parseRecurringHourRange(_0x30d909){const _0x3a6310=String(_0x30d909||'')['trim']()['match'](/^(\d{1,2})-(\d{1,2})(?:\/\d+)?$/);if(!_0x3a6310)return{'start':'','end':''};const _0x5974fc=parseBoundedInteger(_0x3a6310[0x1],0x0,0x17),_0x5d5b0b=parseBoundedInteger(_0x3a6310[0x2],0x0,0x17);if(_0x5974fc===null||_0x5d5b0b===null||_0x5974fc>_0x5d5b0b)return{'start':'','end':''};return{'start':String(_0x5974fc),'end':String(_0x5d5b0b)};}export function parseAutomationScheduleToFormState(_0x499196){const _0x2d4629=String(_0x499196||'')['trim'](),_0x469244=createDefaultScheduleFormState(),_0x4d9050=_0x2d4629['match'](/^(\d{1,2}) (\d{1,2}) \* \* \*$/);if(_0x4d9050){const _0x729bd9=parseBoundedInteger(_0x4d9050[0x1],0x0,0x3b),_0x373e6d=parseBoundedInteger(_0x4d9050[0x2],0x0,0x17);if(_0x729bd9!==null&&_0x373e6d!==null)return _0x469244['frequency']='daily',_0x469244['dailyMinute']=String(_0x729bd9),_0x469244['dailyHour']=String(_0x373e6d),_0x469244;}const _0x3cc4be=_0x2d4629['match'](/^(\d{1,2}) (\d{1,2}) \* \* ([0-7])$/);if(_0x3cc4be){const _0xa9a4e1=parseBoundedInteger(_0x3cc4be[0x1],0x0,0x3b),_0x5c1d2b=parseBoundedInteger(_0x3cc4be[0x2],0x0,0x17),_0x47107e=parseBoundedInteger(_0x3cc4be[0x3],0x0,0x7);if(_0xa9a4e1!==null&&_0x5c1d2b!==null&&_0x47107e!==null)return _0x469244['frequency']='weekly',_0x469244['weeklyMinute']=String(_0xa9a4e1),_0x469244['weeklyHour']=String(_0x5c1d2b),_0x469244['weeklyDay']=String(_0x47107e===0x7?0x0:_0x47107e),_0x469244;}const _0x52f652=_0x2d4629['match'](/^(\d{1,2}) (\d{1,2}) (\d{1,2}) \* \*$/);if(_0x52f652){const _0x42f6b4=parseBoundedInteger(_0x52f652[0x1],0x0,0x3b),_0x46fb93=parseBoundedInteger(_0x52f652[0x2],0x0,0x17),_0x39c35f=parseBoundedInteger(_0x52f652[0x3],AUTOMATION_MONTHLY_DAY_MIN,AUTOMATION_MONTHLY_DAY_MAX);if(_0x42f6b4!==null&&_0x46fb93!==null&&_0x39c35f!==null)return _0x469244['frequency']='monthly',_0x469244['monthlyMinute']=String(_0x42f6b4),_0x469244['monthlyHour']=String(_0x46fb93),_0x469244['monthlyDay']=String(_0x39c35f),_0x469244;}const _0xc51493=_0x2d4629['match'](/^(\*\/15|\*\/30|0) ([^\s]+) \* \* ([^\s]+)$/);if(_0xc51493){const [,_0x4898f0,_0x27c5e7,_0x3132bc]=_0xc51493;_0x469244['frequency']='recurring',_0x469244['recurringInterval']=inferRecurringInterval(_0x4898f0,_0x27c5e7),_0x469244['recurringDayToken']=String(_0x3132bc||'')['trim']()||'*';const _0x4ef4ec=parseRecurringHourRange(_0x27c5e7);return _0x469244['recurringStartHour']=_0x4ef4ec['start'],_0x469244['recurringEndHour']=_0x4ef4ec['end'],_0x469244;}return _0x469244['frequency']='custom',_0x469244['customCron']=_0x2d4629,_0x469244;}export function buildAutomationCronFromFormState(_0x5f5ac8={}){const _0x16bf9c=String(_0x5f5ac8['frequency']||'daily');if(_0x16bf9c==='custom')return String(_0x5f5ac8['customCron']||'')['trim']();if(_0x16bf9c==='daily'){const _0x6782d9=String(_0x5f5ac8['dailyHour']??'2'),_0x15d22b=String(_0x5f5ac8['dailyMinute']??'0');return _0x15d22b+'\x20'+_0x6782d9+'\x20*\x20*\x20*';}if(_0x16bf9c==='weekly'){const _0x5369e1=String(_0x5f5ac8['weeklyDay']??'1'),_0x1cb028=String(_0x5f5ac8['weeklyHour']??'9'),_0x5db728=String(_0x5f5ac8['weeklyMinute']??'0');return _0x5db728+'\x20'+_0x1cb028+'\x20*\x20*\x20'+_0x5369e1;}if(_0x16bf9c==='monthly'){const _0x2d577c=String(_0x5f5ac8['monthlyDay']??'1'),_0x267386=String(_0x5f5ac8['monthlyHour']??'0'),_0x5db73d=String(_0x5f5ac8['monthlyMinute']??'0');return _0x5db73d+'\x20'+_0x267386+'\x20'+_0x2d577c+'\x20*\x20*';}const _0x58615a=String(_0x5f5ac8['recurringInterval']||'*/30\x20*\x20*\x20*\x20*')['trim'](),[_0x45a009='*/30',_0x48120c='*']=_0x58615a['split'](/\s+/);let _0x1f2c28=_0x48120c;const _0x2d3d39=String(_0x5f5ac8['recurringStartHour']??'')['trim'](),_0x2a1537=String(_0x5f5ac8['recurringEndHour']??'')['trim']();if(_0x2d3d39!==''&&_0x2a1537!==''){const _0x354820=Number['parseInt'](_0x2d3d39,0xa),_0x128743=Number['parseInt'](_0x2a1537,0xa);if(Number['isInteger'](_0x354820)&&Number['isInteger'](_0x128743)&&_0x354820<=_0x128743){const _0x3e1769=_0x48120c['match'](/^\*\/(\d+)$/);_0x3e1769?_0x1f2c28=_0x354820+'-'+_0x128743+'/'+_0x3e1769[0x1]:_0x1f2c28=_0x354820+'-'+_0x128743;}}const _0x19422b=String(_0x5f5ac8['recurringDayToken']??'*')['trim']()||'*';return _0x45a009+'\x20'+_0x1f2c28+'\x20*\x20*\x20'+_0x19422b;}
1
+ export const AUTOMATION_MONTHLY_DAY_MIN=0x1;export const AUTOMATION_MONTHLY_DAY_MAX=0x1c;const DEFAULT_SCHEDULE_FORM_STATE=Object['freeze']({'frequency':'daily','dailyHour':'2','dailyMinute':'0','weeklyDay':'1','weeklyHour':'9','weeklyMinute':'0','monthlyDay':'1','monthlyHour':'0','monthlyMinute':'0','recurringInterval':'*/30\x20*\x20*\x20*\x20*','recurringStartHour':'','recurringEndHour':'','recurringDayToken':'*','customCron':''}),RECURRING_INTERVAL_STEPS=['2','4','6','8','12'];function createDefaultScheduleFormState(){return{...DEFAULT_SCHEDULE_FORM_STATE};}function parseBoundedInteger(_0x53432c,_0x18bd66,_0x22850e){const _0x17b26e=Number['parseInt'](_0x53432c,0xa);if(!Number['isInteger'](_0x17b26e)||_0x17b26e<_0x18bd66||_0x17b26e>_0x22850e)return null;return _0x17b26e;}function inferRecurringInterval(_0x523960,_0x110b0d){if(_0x523960==='*/15')return'*/15\x20*\x20*\x20*\x20*';if(_0x523960==='*/30')return'*/30\x20*\x20*\x20*\x20*';if(_0x523960!=='0')return'*/30\x20*\x20*\x20*\x20*';if(_0x110b0d==='*'||/^\d{1,2}-\d{1,2}$/['test'](_0x110b0d))return'0\x20*\x20*\x20*\x20*';for(const _0x2ab348 of RECURRING_INTERVAL_STEPS){if(_0x110b0d['startsWith']('*/'+_0x2ab348)||_0x110b0d['includes']('/'+_0x2ab348))return'0\x20*/'+_0x2ab348+'\x20*\x20*\x20*';}return'*/30\x20*\x20*\x20*\x20*';}function parseRecurringHourRange(_0x40cb4e){const _0x20fb05=String(_0x40cb4e||'')['trim']()['match'](/^(\d{1,2})-(\d{1,2})(?:\/\d+)?$/);if(!_0x20fb05)return{'start':'','end':''};const _0x522283=parseBoundedInteger(_0x20fb05[0x1],0x0,0x17),_0x4b150e=parseBoundedInteger(_0x20fb05[0x2],0x0,0x17);if(_0x522283===null||_0x4b150e===null||_0x522283>_0x4b150e)return{'start':'','end':''};return{'start':String(_0x522283),'end':String(_0x4b150e)};}export function parseAutomationScheduleToFormState(_0x9bd553){const _0x51ad4c=String(_0x9bd553||'')['trim'](),_0x436ffd=createDefaultScheduleFormState(),_0x434082=_0x51ad4c['match'](/^(\d{1,2}) (\d{1,2}) \* \* \*$/);if(_0x434082){const _0xa49236=parseBoundedInteger(_0x434082[0x1],0x0,0x3b),_0xff4e25=parseBoundedInteger(_0x434082[0x2],0x0,0x17);if(_0xa49236!==null&&_0xff4e25!==null)return _0x436ffd['frequency']='daily',_0x436ffd['dailyMinute']=String(_0xa49236),_0x436ffd['dailyHour']=String(_0xff4e25),_0x436ffd;}const _0x1a2180=_0x51ad4c['match'](/^(\d{1,2}) (\d{1,2}) \* \* ([0-7])$/);if(_0x1a2180){const _0x20b1f4=parseBoundedInteger(_0x1a2180[0x1],0x0,0x3b),_0x368f63=parseBoundedInteger(_0x1a2180[0x2],0x0,0x17),_0x1892b4=parseBoundedInteger(_0x1a2180[0x3],0x0,0x7);if(_0x20b1f4!==null&&_0x368f63!==null&&_0x1892b4!==null)return _0x436ffd['frequency']='weekly',_0x436ffd['weeklyMinute']=String(_0x20b1f4),_0x436ffd['weeklyHour']=String(_0x368f63),_0x436ffd['weeklyDay']=String(_0x1892b4===0x7?0x0:_0x1892b4),_0x436ffd;}const _0x3bdeb7=_0x51ad4c['match'](/^(\d{1,2}) (\d{1,2}) (\d{1,2}) \* \*$/);if(_0x3bdeb7){const _0x38438a=parseBoundedInteger(_0x3bdeb7[0x1],0x0,0x3b),_0x46b9fe=parseBoundedInteger(_0x3bdeb7[0x2],0x0,0x17),_0x2e0369=parseBoundedInteger(_0x3bdeb7[0x3],AUTOMATION_MONTHLY_DAY_MIN,AUTOMATION_MONTHLY_DAY_MAX);if(_0x38438a!==null&&_0x46b9fe!==null&&_0x2e0369!==null)return _0x436ffd['frequency']='monthly',_0x436ffd['monthlyMinute']=String(_0x38438a),_0x436ffd['monthlyHour']=String(_0x46b9fe),_0x436ffd['monthlyDay']=String(_0x2e0369),_0x436ffd;}const _0x4ddedf=_0x51ad4c['match'](/^(\*\/15|\*\/30|0) ([^\s]+) \* \* ([^\s]+)$/);if(_0x4ddedf){const [,_0x4a53e7,_0x3d7377,_0x10da33]=_0x4ddedf;_0x436ffd['frequency']='recurring',_0x436ffd['recurringInterval']=inferRecurringInterval(_0x4a53e7,_0x3d7377),_0x436ffd['recurringDayToken']=String(_0x10da33||'')['trim']()||'*';const _0x5233e7=parseRecurringHourRange(_0x3d7377);return _0x436ffd['recurringStartHour']=_0x5233e7['start'],_0x436ffd['recurringEndHour']=_0x5233e7['end'],_0x436ffd;}return _0x436ffd['frequency']='custom',_0x436ffd['customCron']=_0x51ad4c,_0x436ffd;}export function buildAutomationCronFromFormState(_0x3c525e={}){const _0x156cac=String(_0x3c525e['frequency']||'daily');if(_0x156cac==='custom')return String(_0x3c525e['customCron']||'')['trim']();if(_0x156cac==='daily'){const _0x48fbcd=String(_0x3c525e['dailyHour']??'2'),_0x32f991=String(_0x3c525e['dailyMinute']??'0');return _0x32f991+'\x20'+_0x48fbcd+'\x20*\x20*\x20*';}if(_0x156cac==='weekly'){const _0x42eefa=String(_0x3c525e['weeklyDay']??'1'),_0x392980=String(_0x3c525e['weeklyHour']??'9'),_0x48a664=String(_0x3c525e['weeklyMinute']??'0');return _0x48a664+'\x20'+_0x392980+'\x20*\x20*\x20'+_0x42eefa;}if(_0x156cac==='monthly'){const _0x1a26a2=String(_0x3c525e['monthlyDay']??'1'),_0x2f0faa=String(_0x3c525e['monthlyHour']??'0'),_0x55a344=String(_0x3c525e['monthlyMinute']??'0');return _0x55a344+'\x20'+_0x2f0faa+'\x20'+_0x1a26a2+'\x20*\x20*';}const _0x1dcb54=String(_0x3c525e['recurringInterval']||'*/30\x20*\x20*\x20*\x20*')['trim'](),[_0x5197c2='*/30',_0x1f3cac='*']=_0x1dcb54['split'](/\s+/);let _0xfa5758=_0x1f3cac;const _0x42eaee=String(_0x3c525e['recurringStartHour']??'')['trim'](),_0x370203=String(_0x3c525e['recurringEndHour']??'')['trim']();if(_0x42eaee!==''&&_0x370203!==''){const _0x4ccb02=Number['parseInt'](_0x42eaee,0xa),_0x40891f=Number['parseInt'](_0x370203,0xa);if(Number['isInteger'](_0x4ccb02)&&Number['isInteger'](_0x40891f)&&_0x4ccb02<=_0x40891f){const _0x209d9=_0x1f3cac['match'](/^\*\/(\d+)$/);_0x209d9?_0xfa5758=_0x4ccb02+'-'+_0x40891f+'/'+_0x209d9[0x1]:_0xfa5758=_0x4ccb02+'-'+_0x40891f;}}const _0xd6b257=String(_0x3c525e['recurringDayToken']??'*')['trim']()||'*';return _0x5197c2+'\x20'+_0xfa5758+'\x20*\x20*\x20'+_0xd6b257;}
@@ -1 +1 @@
1
- export class CommentsWidget{constructor(_0x324709,_0x5570e8={}){this['container']=_0x324709,this['options']={'taskId':_0x5570e8['taskId']||null,'currentUserId':_0x5570e8['currentUserId']||null,'compact':_0x5570e8['compact']||![],'skipHeader':_0x5570e8['skipHeader']||![],'onCommentsLoaded':_0x5570e8['onCommentsLoaded']||null,'onCommentsChanged':_0x5570e8['onCommentsChanged']||null,'enableAttachments':_0x5570e8['enableAttachments']||![],'getAPI':_0x5570e8['getAPI']||(()=>window['API'])},this['comments']=[],this['editor']=null,this['editingCommentId']=null,this['isLoading']=![],this['pendingAttachments']=[],this['existingAttachments']=[],this['init']();}['init'](){this['container']['innerHTML']='',this['container']['className']='comments-widget\x20'+(this['options']['compact']?'comments-widget-compact':''),this['createHeader'](),this['createCommentsList'](),this['createInputSection'](),this['options']['taskId']&&(this['loadComments'](),this['options']['enableAttachments']&&this['loadExistingAttachments']());}async['loadExistingAttachments'](){try{const _0xb7b3ee=this['options']['getAPI'](),_0x40da51=await _0xb7b3ee['getTaskAttachments'](this['options']['taskId']);this['existingAttachments']=_0x40da51['attachments']||[];}catch(_0x4bce46){console['warn']('Failed\x20to\x20load\x20existing\x20attachments:',_0x4bce46),this['existingAttachments']=[];}}['createHeader'](){if(this['options']['skipHeader']){this['header']=null,this['isExpanded']=!![];return;}if(this['options']['compact']){this['header']=document['createElement']('div'),this['header']['className']='comments-header\x20comments-header-compact',this['header']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22comments-toggle-btn\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22comments-toggle-icon\x22\x20width=\x2214\x22\x20height=\x2214\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<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>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comments-count-label\x22>Comments</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comments-count-badge\x22\x20id=\x22comments-count-badge\x22>0</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22comments-chevron\x22\x20width=\x2212\x22\x20height=\x2212\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<polyline\x20points=\x226\x209\x2012\x2015\x2018\x209\x22></polyline>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20',this['container']['appendChild'](this['header']);const _0x40fcb6=this['header']['querySelector']('.comments-toggle-btn');_0x40fcb6['addEventListener']('click',()=>this['toggleExpanded']()),this['isExpanded']=![];}else this['header']=document['createElement']('div'),this['header']['className']='comments-header',this['header']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<h3\x20class=\x22comments-title\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20width=\x2218\x22\x20height=\x2218\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<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>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Comments\x20<span\x20class=\x22comments-count\x22\x20id=\x22comments-count\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</h3>\x0a\x20\x20\x20\x20\x20\x20',this['container']['appendChild'](this['header']),this['isExpanded']=!![];}['createCommentsList'](){this['commentsListWrapper']=document['createElement']('div'),this['commentsListWrapper']['className']='comments-list-wrapper',this['options']['compact']&&!this['isExpanded']&&(this['commentsListWrapper']['hidden']=!![]),this['commentsList']=document['createElement']('div'),this['commentsList']['className']='comments-list',this['commentsListWrapper']['appendChild'](this['commentsList']),this['container']['appendChild'](this['commentsListWrapper']);}['createInputSection'](){this['inputSection']=document['createElement']('div'),this['inputSection']['className']='comments-input-section';this['options']['compact']&&!this['isExpanded']&&(this['inputSection']['hidden']=!![]);const _0x2aa8b4=document['createElement']('div');_0x2aa8b4['className']='comments-editor-wrapper',this['toolbar']=document['createElement']('div'),this['toolbar']['className']='comments-toolbar\x20comments-toolbar-hidden',_0x2aa8b4['appendChild'](this['toolbar']);const _0x54b51c=document['createElement']('div');_0x54b51c['className']='comments-editor-placeholder',_0x2aa8b4['appendChild'](_0x54b51c);const _0x26c8b5=document['createElement']('div');_0x26c8b5['className']='comments-input-actions',_0x26c8b5['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-ghost\x20btn-small\x20comments-cancel-btn\x22\x20hidden>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-primary\x20btn-small\x20comments-submit-btn\x22\x20disabled>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22btn-text\x22>Add\x20Comment</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22btn-loading\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22spinner\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2214\x22\x20height=\x2214\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<circle\x20cx=\x2212\x22\x20cy=\x2212\x22\x20r=\x2210\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x223\x22\x20stroke-dasharray=\x2231.4\x2031.4\x22\x20stroke-linecap=\x22round\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</span>\x0a\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20',this['inputSection']['appendChild'](_0x2aa8b4),this['inputSection']['appendChild'](_0x26c8b5),this['container']['appendChild'](this['inputSection']),this['initEditor'](_0x54b51c),this['submitBtn']=_0x26c8b5['querySelector']('.comments-submit-btn'),this['cancelBtn']=_0x26c8b5['querySelector']('.comments-cancel-btn'),this['submitBtn']['addEventListener']('click',()=>this['handleSubmit']()),this['cancelBtn']['addEventListener']('click',()=>this['cancelEdit']());}['initEditor'](_0x2aa249){const _0x57aca0=document['createElement']('textarea');_0x57aca0['placeholder']='Add\x20a\x20comment...',_0x57aca0['className']='comments-textarea',_0x2aa249['appendChild'](_0x57aca0);const _0x411525=window['MarkdownEditor'];if(!_0x411525){console['error']('MarkdownEditor\x20not\x20loaded');return;}const _0x1fe6d0={'placeholder':'Add\x20a\x20comment...','editable':!![],'toolbar':!![],'minHeight':this['options']['compact']?'60px':'80px','onChange':_0x3054eb=>{const _0x5c6a26=_0x3054eb&&_0x3054eb['trim']()['length']>0x0||this['pendingAttachments']['length']>0x0;this['submitBtn']['disabled']=!_0x5c6a26;},'fetchUsers':async()=>{const _0x46183e=this['options']['getAPI']();return _0x46183e['getUsers']();}};this['options']['enableAttachments']&&this['options']['taskId']&&(_0x1fe6d0['onAddAttachments']=_0x1f29ec=>{this['pendingAttachments']['push'](..._0x1f29ec),this['submitBtn']['disabled']=![];},_0x1fe6d0['resolveAttachmentUrl']=_0x454fb0=>{const _0x3d716e=this['options']['getAPI']();return _0x3d716e['getBaseUrl']()+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x454fb0);},_0x1fe6d0['isAttachmentNameTaken']=_0x466753=>{return this['pendingAttachments']['some'](_0x6a49c8=>_0x6a49c8['name']===_0x466753)||this['existingAttachments']['some'](_0x5f0e0d=>_0x5f0e0d['name']===_0x466753);});this['editor']=new _0x411525(_0x57aca0,_0x1fe6d0);const _0x551767=this['editor']['editor'],_0x44570a=this['editor']['toolbar'];_0x44570a&&(_0x44570a['classList']['add']('comments-toolbar-hidden'),_0x551767['addEventListener']('focus',()=>{_0x44570a['classList']['remove']('comments-toolbar-hidden');}),_0x551767['addEventListener']('blur',_0x27898b=>{setTimeout(()=>{!this['editor']['container']?.['contains'](document['activeElement'])&&!_0x44570a['contains'](document['activeElement'])&&(!this['editor']['getValue']()?.['trim']()&&!this['editingCommentId']&&_0x44570a['classList']['add']('comments-toolbar-hidden'));},0x64);}));}['toggleExpanded'](){this['isExpanded']=!this['isExpanded'],this['commentsListWrapper']['hidden']=!this['isExpanded'],this['inputSection']['hidden']=!this['isExpanded'];const _0x33b8ff=this['header']['querySelector']('.comments-chevron');_0x33b8ff&&(_0x33b8ff['style']['transform']=this['isExpanded']?'rotate(180deg)':''),this['isExpanded']&&this['comments']['length']===0x0&&this['options']['taskId']&&this['loadComments']();}['setTaskId'](_0x105bf2){this['options']['taskId']=_0x105bf2,this['comments']=[],this['renderComments'](),_0x105bf2&&this['loadComments']();}async['loadComments'](){if(!this['options']['taskId']||this['isLoading'])return;this['isLoading']=!![],this['commentsList']['innerHTML']='<div\x20class=\x22comments-loading\x22>Loading\x20comments...</div>';try{const _0x2796fc=this['options']['getAPI'](),_0x3f9cc0=await _0x2796fc['getComments'](this['options']['taskId']);this['comments']=_0x3f9cc0['comments']||[],this['renderComments'](),this['updateCount'](),this['options']['onCommentsLoaded']&&this['options']['onCommentsLoaded'](this['comments']);}catch(_0x35a3bb){console['error']('Failed\x20to\x20load\x20comments:',_0x35a3bb),this['commentsList']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-error\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Failed\x20to\x20load\x20comments\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-ghost\x20btn-small\x22\x20onclick=\x22this.parentElement.parentElement.closest(\x27.comments-widget\x27).__widget.loadComments()\x22>Retry</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20';}finally{this['isLoading']=![];}}['renderComments'](){if(this['comments']['length']===0x0){this['commentsList']['innerHTML']='<div\x20class=\x22comments-empty\x22>No\x20comments\x20yet</div>';return;}this['commentsList']['innerHTML']='',this['comments']['forEach'](_0x1aae3e=>{const _0x3ce8c6=this['createCommentElement'](_0x1aae3e);this['commentsList']['appendChild'](_0x3ce8c6);});}['createCommentElement'](_0x1e9dd2){const _0x1fd75a=document['createElement']('div');_0x1fd75a['className']='comment-item',_0x1fd75a['dataset']['commentId']=_0x1e9dd2['id'];const _0xfa8a9=this['options']['currentUserId']&&_0x1e9dd2['author']?.['userId']===this['options']['currentUserId'],_0x5ad90d=this['formatDate'](_0x1e9dd2['createdAt']),_0x5760cf=_0x1e9dd2['updatedAt']!==_0x1e9dd2['createdAt'],_0x27d533=this['resolveAttachmentUrls'](_0x1e9dd2['content']);let _0x571adb=window['marked']?window['marked']['parse'](_0x27d533):_0x27d533;_0x571adb=this['renderMentions'](_0x571adb),_0x1fd75a['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-author\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-author-name\x22>'+this['escapeHtml'](_0x1e9dd2['author']?.['name']||'Anonymous')+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-timestamp\x22\x20title=\x22'+new Date(_0x1e9dd2['createdAt'])['toLocaleString']()+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x5ad90d+(_0x5760cf?'\x20(edited)':'')+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+(_0xfa8a9?'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-actions\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-icon-mini\x20comment-edit-btn\x22\x20title=\x22Edit\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20width=\x2212\x22\x20height=\x2212\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M11\x204H4a2\x202\x200\x200\x200-2\x202v14a2\x202\x200\x200\x200\x202\x202h14a2\x202\x200\x200\x200\x202-2v-7\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M18.5\x202.5a2.121\x202.121\x200\x200\x201\x203\x203L12\x2015l-4\x201\x201-4\x209.5-9.5z\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-icon-mini\x20comment-delete-btn\x22\x20title=\x22Delete\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20width=\x2212\x22\x20height=\x2212\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<polyline\x20points=\x223\x206\x205\x206\x2021\x206\x22></polyline>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M19\x206v14a2\x202\x200\x200\x201-2\x202H7a2\x202\x200\x200\x201-2-2V6m3\x200V4a2\x202\x200\x200\x201\x202-2h4a2\x202\x200\x200\x201\x202\x202v2\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20':'')+'\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-content\x22>'+_0x571adb+'</div>\x0a\x20\x20\x20\x20';if(_0xfa8a9){const _0x173ce4=_0x1fd75a['querySelector']('.comment-edit-btn'),_0x172b5b=_0x1fd75a['querySelector']('.comment-delete-btn');_0x173ce4?.['addEventListener']('click',()=>this['startEdit'](_0x1e9dd2)),_0x172b5b?.['addEventListener']('click',()=>this['deleteComment'](_0x1e9dd2['id']));}return _0x1fd75a;}['formatDate'](_0x2ebf3c){const _0x3a23c4=new Date(_0x2ebf3c),_0x408df6=new Date(),_0x19a9e2=_0x408df6-_0x3a23c4,_0x3430b9=Math['floor'](_0x19a9e2/0xea60),_0x3d46ff=Math['floor'](_0x19a9e2/0x36ee80),_0x2c50f1=Math['floor'](_0x19a9e2/0x5265c00);if(_0x3430b9<0x1)return'just\x20now';if(_0x3430b9<0x3c)return _0x3430b9+'m\x20ago';if(_0x3d46ff<0x18)return _0x3d46ff+'h\x20ago';if(_0x2c50f1<0x7)return _0x2c50f1+'d\x20ago';return _0x3a23c4['toLocaleDateString']();}['escapeHtml'](_0x28fa78){const _0x5d1daa=document['createElement']('div');return _0x5d1daa['textContent']=_0x28fa78,_0x5d1daa['innerHTML'];}['resolveAttachmentUrls'](_0x211130){if(!_0x211130||!this['options']['taskId'])return _0x211130;const _0xaf612=this['options']['getAPI'](),_0x347455=_0xaf612['getBaseUrl']();let _0x47a689=String(_0x211130)['replace'](/\]\(attachment:(?:\/\/)?([^)]+)\)/g,(_0xe3d48b,_0x2ccb72)=>{const _0x2a13b7=String(_0x2ccb72||'')['trim']();if(!_0x2a13b7)return _0xe3d48b;let _0x3703d6=_0x2a13b7;try{_0x3703d6=decodeURIComponent(_0x2a13b7);}catch{}return']('+_0x347455+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x3703d6)+')';});return _0x47a689;}['renderMentions'](_0x1d75b6){if(!_0x1d75b6)return _0x1d75b6;return String(_0x1d75b6)['replace'](/@?<a\s+href="mention:([^"]+)"[^>]*>([^<]+)<\/a>/g,(_0x3681d0,_0xda70e9,_0x3c63e7)=>{const _0x37850f=this['escapeHtml'](_0x3c63e7),_0x52dd23=this['escapeHtml'](_0xda70e9);return'<span\x20class=\x22mention\x22\x20data-mention-user-id=\x22'+_0x52dd23+'\x22>@'+_0x37850f+'</span>';});}['startEdit'](_0x402073){this['editingCommentId']=_0x402073['id'],this['editor']['setValue'](_0x402073['content']),this['editor']['focus'](),this['cancelBtn']['hidden']=![],this['submitBtn']['querySelector']('.btn-text')['textContent']='Save',this['editor']['toolbar']&&this['editor']['toolbar']['classList']['remove']('comments-toolbar-hidden'),this['inputSection']['scrollIntoView']({'behavior':'smooth','block':'nearest'});}['cancelEdit'](){this['editingCommentId']=null,this['editor']['clear'](),this['cancelBtn']['hidden']=!![],this['submitBtn']['querySelector']('.btn-text')['textContent']='Add\x20Comment',this['submitBtn']['disabled']=!![],this['editor']['toolbar']&&!this['editor']['getValue']()?.['trim']()&&this['editor']['toolbar']['classList']['add']('comments-toolbar-hidden');}async['handleSubmit'](){const _0x43fea0=this['editor']['getValue']()?.['trim']();if(!_0x43fea0&&this['pendingAttachments']['length']===0x0||!this['options']['taskId'])return;this['setLoading'](!![]);try{const _0x3edf9b=this['options']['getAPI']();this['pendingAttachments']['length']>0x0&&this['options']['enableAttachments']&&(await _0x3edf9b['uploadAttachments'](this['options']['taskId'],this['pendingAttachments']),this['existingAttachments']['push'](...this['pendingAttachments']['map'](_0x895a29=>({'name':_0x895a29['name']}))),this['pendingAttachments']=[]);if(this['editingCommentId']){const _0x1d87ac=await _0x3edf9b['updateComment'](this['options']['taskId'],this['editingCommentId'],_0x43fea0),_0xe9c5bf=this['comments']['findIndex'](_0x189281=>_0x189281['id']===this['editingCommentId']);_0xe9c5bf!==-0x1&&(this['comments'][_0xe9c5bf]=_0x1d87ac['comment']);}else{const _0x20c181=await _0x3edf9b['addComment'](this['options']['taskId'],_0x43fea0);this['comments']['push'](_0x20c181['comment']);}this['renderComments'](),this['updateCount'](),this['cancelEdit'](),this['editor']['clear']();}catch(_0x5ea7f6){console['error']('Failed\x20to\x20save\x20comment:',_0x5ea7f6),alert('Failed\x20to\x20save\x20comment:\x20'+_0x5ea7f6['message']);}finally{this['setLoading'](![]);}}async['deleteComment'](_0x42da6c){const _0x50b1c7=await this['showDeleteConfirmModal']();if(!_0x50b1c7)return;try{const _0x4a0ff4=this['options']['getAPI']();await _0x4a0ff4['deleteComment'](this['options']['taskId'],_0x42da6c),this['comments']=this['comments']['filter'](_0x5dfcb9=>_0x5dfcb9['id']!==_0x42da6c),this['renderComments'](),this['updateCount']();}catch(_0x5b7c77){console['error']('Failed\x20to\x20delete\x20comment:',_0x5b7c77),alert('Failed\x20to\x20delete\x20comment:\x20'+_0x5b7c77['message']);}}['showDeleteConfirmModal'](){return new Promise(_0x290530=>{const _0x104527=document['createElement']('div');_0x104527['className']='comments-confirm-modal',_0x104527['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-backdrop\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-dialog\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h3>Delete\x20Comment</h3>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-icon\x20comments-confirm-close\x22\x20title=\x22Close\x22>×</button>\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=\x22comments-confirm-body\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p>Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20this\x20comment?\x20This\x20action\x20cannot\x20be\x20undone.</p>\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=\x22comments-confirm-footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-ghost\x20btn-small\x20comments-confirm-cancel\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-danger\x20btn-small\x20comments-confirm-delete\x22>Delete</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20',document['body']['appendChild'](_0x104527);const _0x4c1888=_0x46b721=>{document['removeEventListener']('keydown',_0x3bcee6),_0x104527['remove'](),_0x290530(_0x46b721);},_0x3bcee6=_0x27f83b=>{if(_0x27f83b['key']==='Escape')_0x4c1888(![]);};document['addEventListener']('keydown',_0x3bcee6),_0x104527['querySelector']('.comments-confirm-backdrop')['addEventListener']('click',()=>_0x4c1888(![])),_0x104527['querySelector']('.comments-confirm-close')['addEventListener']('click',()=>_0x4c1888(![])),_0x104527['querySelector']('.comments-confirm-cancel')['addEventListener']('click',()=>_0x4c1888(![])),_0x104527['querySelector']('.comments-confirm-delete')['addEventListener']('click',()=>_0x4c1888(!![])),_0x104527['querySelector']('.comments-confirm-cancel')['focus']();});}['setLoading'](_0x2350a1){this['submitBtn']['disabled']=_0x2350a1,this['submitBtn']['querySelector']('.btn-text')['hidden']=_0x2350a1,this['submitBtn']['querySelector']('.btn-loading')['hidden']=!_0x2350a1;}['updateCount'](){const _0x449371=this['comments']['length'],_0x30604f=this['container']['querySelector']('#comments-count-badge');_0x30604f&&(_0x30604f['textContent']=_0x449371,_0x30604f['hidden']=_0x449371===0x0);const _0x1755ee=this['container']['querySelector']('#comments-count');_0x1755ee&&(_0x1755ee['textContent']=_0x449371>0x0?'('+_0x449371+')':''),this['options']['onCommentsChanged']&&this['options']['onCommentsChanged'](this['comments']);}['getCommentCount'](){return this['comments']['length'];}['destroy'](){this['editor']&&this['editor']['destroy'](),this['container']['innerHTML']='';}}CommentsWidget['prototype']['_attachToContainer']=function(){this['container']['__widget']=this;};typeof window!=='undefined'&&(window['CommentsWidget']=CommentsWidget);
1
+ export class CommentsWidget{constructor(_0xf29b08,_0x37aee8={}){this['container']=_0xf29b08,this['options']={'taskId':_0x37aee8['taskId']||null,'currentUserId':_0x37aee8['currentUserId']||null,'compact':_0x37aee8['compact']||![],'skipHeader':_0x37aee8['skipHeader']||![],'onCommentsLoaded':_0x37aee8['onCommentsLoaded']||null,'onCommentsChanged':_0x37aee8['onCommentsChanged']||null,'enableAttachments':_0x37aee8['enableAttachments']||![],'getAPI':_0x37aee8['getAPI']||(()=>window['API'])},this['comments']=[],this['editor']=null,this['editingCommentId']=null,this['isLoading']=![],this['pendingAttachments']=[],this['existingAttachments']=[],this['init']();}['init'](){this['container']['innerHTML']='',this['container']['className']='comments-widget\x20'+(this['options']['compact']?'comments-widget-compact':''),this['createHeader'](),this['createCommentsList'](),this['createInputSection'](),this['options']['taskId']&&(this['loadComments'](),this['options']['enableAttachments']&&this['loadExistingAttachments']());}async['loadExistingAttachments'](){try{const _0x27c329=this['options']['getAPI'](),_0x376387=await _0x27c329['getTaskAttachments'](this['options']['taskId']);this['existingAttachments']=_0x376387['attachments']||[];}catch(_0x15af5c){console['warn']('Failed\x20to\x20load\x20existing\x20attachments:',_0x15af5c),this['existingAttachments']=[];}}['createHeader'](){if(this['options']['skipHeader']){this['header']=null,this['isExpanded']=!![];return;}if(this['options']['compact']){this['header']=document['createElement']('div'),this['header']['className']='comments-header\x20comments-header-compact',this['header']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22comments-toggle-btn\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22comments-toggle-icon\x22\x20width=\x2214\x22\x20height=\x2214\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<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>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comments-count-label\x22>Comments</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comments-count-badge\x22\x20id=\x22comments-count-badge\x22>0</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22comments-chevron\x22\x20width=\x2212\x22\x20height=\x2212\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<polyline\x20points=\x226\x209\x2012\x2015\x2018\x209\x22></polyline>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20',this['container']['appendChild'](this['header']);const _0x41727e=this['header']['querySelector']('.comments-toggle-btn');_0x41727e['addEventListener']('click',()=>this['toggleExpanded']()),this['isExpanded']=![];}else this['header']=document['createElement']('div'),this['header']['className']='comments-header',this['header']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<h3\x20class=\x22comments-title\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20width=\x2218\x22\x20height=\x2218\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<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>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Comments\x20<span\x20class=\x22comments-count\x22\x20id=\x22comments-count\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</h3>\x0a\x20\x20\x20\x20\x20\x20',this['container']['appendChild'](this['header']),this['isExpanded']=!![];}['createCommentsList'](){this['commentsListWrapper']=document['createElement']('div'),this['commentsListWrapper']['className']='comments-list-wrapper',this['options']['compact']&&!this['isExpanded']&&(this['commentsListWrapper']['hidden']=!![]),this['commentsList']=document['createElement']('div'),this['commentsList']['className']='comments-list',this['commentsListWrapper']['appendChild'](this['commentsList']),this['container']['appendChild'](this['commentsListWrapper']);}['createInputSection'](){this['inputSection']=document['createElement']('div'),this['inputSection']['className']='comments-input-section';this['options']['compact']&&!this['isExpanded']&&(this['inputSection']['hidden']=!![]);const _0x396784=document['createElement']('div');_0x396784['className']='comments-editor-wrapper',this['toolbar']=document['createElement']('div'),this['toolbar']['className']='comments-toolbar\x20comments-toolbar-hidden',_0x396784['appendChild'](this['toolbar']);const _0xa01176=document['createElement']('div');_0xa01176['className']='comments-editor-placeholder',_0x396784['appendChild'](_0xa01176);const _0x2bb79f=document['createElement']('div');_0x2bb79f['className']='comments-input-actions',_0x2bb79f['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-ghost\x20btn-small\x20comments-cancel-btn\x22\x20hidden>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-primary\x20btn-small\x20comments-submit-btn\x22\x20disabled>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22btn-text\x22>Add\x20Comment</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22btn-loading\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20class=\x22spinner\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20width=\x2214\x22\x20height=\x2214\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<circle\x20cx=\x2212\x22\x20cy=\x2212\x22\x20r=\x2210\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x223\x22\x20stroke-dasharray=\x2231.4\x2031.4\x22\x20stroke-linecap=\x22round\x22/>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</span>\x0a\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20',this['inputSection']['appendChild'](_0x396784),this['inputSection']['appendChild'](_0x2bb79f),this['container']['appendChild'](this['inputSection']),this['initEditor'](_0xa01176),this['submitBtn']=_0x2bb79f['querySelector']('.comments-submit-btn'),this['cancelBtn']=_0x2bb79f['querySelector']('.comments-cancel-btn'),this['submitBtn']['addEventListener']('click',()=>this['handleSubmit']()),this['cancelBtn']['addEventListener']('click',()=>this['cancelEdit']());}['initEditor'](_0x43162e){const _0x3ebc58=document['createElement']('textarea');_0x3ebc58['placeholder']='Add\x20a\x20comment...',_0x3ebc58['className']='comments-textarea',_0x43162e['appendChild'](_0x3ebc58);const _0x4fc2a8=window['MarkdownEditor'];if(!_0x4fc2a8){console['error']('MarkdownEditor\x20not\x20loaded');return;}const _0x12030e={'placeholder':'Add\x20a\x20comment...','editable':!![],'toolbar':!![],'minHeight':this['options']['compact']?'60px':'80px','onChange':_0x5208f1=>{const _0x5be247=_0x5208f1&&_0x5208f1['trim']()['length']>0x0||this['pendingAttachments']['length']>0x0;this['submitBtn']['disabled']=!_0x5be247;},'fetchUsers':async()=>{const _0x3b9e5c=this['options']['getAPI']();return _0x3b9e5c['getUsers']();}};this['options']['enableAttachments']&&this['options']['taskId']&&(_0x12030e['onAddAttachments']=_0x5c27cb=>{this['pendingAttachments']['push'](..._0x5c27cb),this['submitBtn']['disabled']=![];},_0x12030e['resolveAttachmentUrl']=_0x5e0b37=>{const _0x263e9c=this['options']['getAPI']();return _0x263e9c['getBaseUrl']()+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x5e0b37);},_0x12030e['isAttachmentNameTaken']=_0x3f0289=>{return this['pendingAttachments']['some'](_0x1de7d5=>_0x1de7d5['name']===_0x3f0289)||this['existingAttachments']['some'](_0x58190f=>_0x58190f['name']===_0x3f0289);});this['editor']=new _0x4fc2a8(_0x3ebc58,_0x12030e);const _0x3d9633=this['editor']['editor'],_0x3aff14=this['editor']['toolbar'];_0x3aff14&&(_0x3aff14['classList']['add']('comments-toolbar-hidden'),_0x3d9633['addEventListener']('focus',()=>{_0x3aff14['classList']['remove']('comments-toolbar-hidden');}),_0x3d9633['addEventListener']('blur',_0x547a08=>{setTimeout(()=>{!this['editor']['container']?.['contains'](document['activeElement'])&&!_0x3aff14['contains'](document['activeElement'])&&(!this['editor']['getValue']()?.['trim']()&&!this['editingCommentId']&&_0x3aff14['classList']['add']('comments-toolbar-hidden'));},0x64);}));}['toggleExpanded'](){this['isExpanded']=!this['isExpanded'],this['commentsListWrapper']['hidden']=!this['isExpanded'],this['inputSection']['hidden']=!this['isExpanded'];const _0x1f0ccb=this['header']['querySelector']('.comments-chevron');_0x1f0ccb&&(_0x1f0ccb['style']['transform']=this['isExpanded']?'rotate(180deg)':''),this['isExpanded']&&this['comments']['length']===0x0&&this['options']['taskId']&&this['loadComments']();}['setTaskId'](_0x3ade6c){this['options']['taskId']=_0x3ade6c,this['comments']=[],this['renderComments'](),_0x3ade6c&&this['loadComments']();}async['loadComments'](){if(!this['options']['taskId']||this['isLoading'])return;this['isLoading']=!![],this['commentsList']['innerHTML']='<div\x20class=\x22comments-loading\x22>Loading\x20comments...</div>';try{const _0xdf0701=this['options']['getAPI'](),_0xe6e0e8=await _0xdf0701['getComments'](this['options']['taskId']);this['comments']=_0xe6e0e8['comments']||[],this['renderComments'](),this['updateCount'](),this['options']['onCommentsLoaded']&&this['options']['onCommentsLoaded'](this['comments']);}catch(_0x5ee26f){console['error']('Failed\x20to\x20load\x20comments:',_0x5ee26f),this['commentsList']['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-error\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Failed\x20to\x20load\x20comments\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-ghost\x20btn-small\x22\x20onclick=\x22this.parentElement.parentElement.closest(\x27.comments-widget\x27).__widget.loadComments()\x22>Retry</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20';}finally{this['isLoading']=![];}}['renderComments'](){if(this['comments']['length']===0x0){this['commentsList']['innerHTML']='<div\x20class=\x22comments-empty\x22>No\x20comments\x20yet</div>';return;}this['commentsList']['innerHTML']='',this['comments']['forEach'](_0x59ff06=>{const _0x45eb69=this['createCommentElement'](_0x59ff06);this['commentsList']['appendChild'](_0x45eb69);});}['createCommentElement'](_0x58543f){const _0x1d13ee=document['createElement']('div');_0x1d13ee['className']='comment-item',_0x1d13ee['dataset']['commentId']=_0x58543f['id'];const _0x565838=this['options']['currentUserId']&&_0x58543f['author']?.['userId']===this['options']['currentUserId'],_0x2c7469=this['formatDate'](_0x58543f['createdAt']),_0xd81d56=_0x58543f['updatedAt']!==_0x58543f['createdAt'],_0x6b72a7=this['resolveAttachmentUrls'](_0x58543f['content']);let _0x3610c2=window['marked']?window['marked']['parse'](_0x6b72a7):_0x6b72a7;_0x3610c2=this['renderMentions'](_0x3610c2),_0x1d13ee['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-author\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-author-name\x22>'+this['escapeHtml'](_0x58543f['author']?.['name']||'Anonymous')+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-timestamp\x22\x20title=\x22'+new Date(_0x58543f['createdAt'])['toLocaleString']()+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x2c7469+(_0xd81d56?'\x20(edited)':'')+'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x565838?'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-actions\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-icon-mini\x20comment-edit-btn\x22\x20title=\x22Edit\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20width=\x2212\x22\x20height=\x2212\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M11\x204H4a2\x202\x200\x200\x200-2\x202v14a2\x202\x200\x200\x200\x202\x202h14a2\x202\x200\x200\x200\x202-2v-7\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M18.5\x202.5a2.121\x202.121\x200\x200\x201\x203\x203L12\x2015l-4\x201\x201-4\x209.5-9.5z\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-icon-mini\x20comment-delete-btn\x22\x20title=\x22Delete\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<svg\x20width=\x2212\x22\x20height=\x2212\x22\x20viewBox=\x220\x200\x2024\x2024\x22\x20fill=\x22none\x22\x20stroke=\x22currentColor\x22\x20stroke-width=\x222\x22\x20stroke-linecap=\x22round\x22\x20stroke-linejoin=\x22round\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<polyline\x20points=\x223\x206\x205\x206\x2021\x206\x22></polyline>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<path\x20d=\x22M19\x206v14a2\x202\x200\x200\x201-2\x202H7a2\x202\x200\x200\x201-2-2V6m3\x200V4a2\x202\x200\x200\x201\x202-2h4a2\x202\x200\x200\x201\x202\x202v2\x22></path>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</svg>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20':'')+'\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22comment-content\x22>'+_0x3610c2+'</div>\x0a\x20\x20\x20\x20';if(_0x565838){const _0x1daabb=_0x1d13ee['querySelector']('.comment-edit-btn'),_0x5f00a6=_0x1d13ee['querySelector']('.comment-delete-btn');_0x1daabb?.['addEventListener']('click',()=>this['startEdit'](_0x58543f)),_0x5f00a6?.['addEventListener']('click',()=>this['deleteComment'](_0x58543f['id']));}return _0x1d13ee;}['formatDate'](_0x452a74){const _0xab90f3=new Date(_0x452a74),_0x2d0b3c=new Date(),_0x411bf1=_0x2d0b3c-_0xab90f3,_0x5d529c=Math['floor'](_0x411bf1/0xea60),_0xd2f5f6=Math['floor'](_0x411bf1/0x36ee80),_0x8ffa4a=Math['floor'](_0x411bf1/0x5265c00);if(_0x5d529c<0x1)return'just\x20now';if(_0x5d529c<0x3c)return _0x5d529c+'m\x20ago';if(_0xd2f5f6<0x18)return _0xd2f5f6+'h\x20ago';if(_0x8ffa4a<0x7)return _0x8ffa4a+'d\x20ago';return _0xab90f3['toLocaleDateString']();}['escapeHtml'](_0x6362d6){const _0x5268bb=document['createElement']('div');return _0x5268bb['textContent']=_0x6362d6,_0x5268bb['innerHTML'];}['resolveAttachmentUrls'](_0x51b028){if(!_0x51b028||!this['options']['taskId'])return _0x51b028;const _0xbf537d=this['options']['getAPI'](),_0x3f0284=_0xbf537d['getBaseUrl']();let _0x2464e4=String(_0x51b028)['replace'](/\]\(attachment:(?:\/\/)?([^)]+)\)/g,(_0x4c27cc,_0x1887ef)=>{const _0x3ac0f6=String(_0x1887ef||'')['trim']();if(!_0x3ac0f6)return _0x4c27cc;let _0x362d17=_0x3ac0f6;try{_0x362d17=decodeURIComponent(_0x3ac0f6);}catch{}return']('+_0x3f0284+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x362d17)+')';});return _0x2464e4;}['renderMentions'](_0x363d24){if(!_0x363d24)return _0x363d24;return String(_0x363d24)['replace'](/@?<a\s+href="mention:([^"]+)"[^>]*>([^<]+)<\/a>/g,(_0x52e562,_0x2f0dd1,_0x3a0394)=>{const _0x1e6c94=this['escapeHtml'](_0x3a0394),_0x47185b=this['escapeHtml'](_0x2f0dd1);return'<span\x20class=\x22mention\x22\x20data-mention-user-id=\x22'+_0x47185b+'\x22>@'+_0x1e6c94+'</span>';});}['startEdit'](_0x2d2be7){this['editingCommentId']=_0x2d2be7['id'],this['editor']['setValue'](_0x2d2be7['content']),this['editor']['focus'](),this['cancelBtn']['hidden']=![],this['submitBtn']['querySelector']('.btn-text')['textContent']='Save',this['editor']['toolbar']&&this['editor']['toolbar']['classList']['remove']('comments-toolbar-hidden'),this['inputSection']['scrollIntoView']({'behavior':'smooth','block':'nearest'});}['cancelEdit'](){this['editingCommentId']=null,this['editor']['clear'](),this['cancelBtn']['hidden']=!![],this['submitBtn']['querySelector']('.btn-text')['textContent']='Add\x20Comment',this['submitBtn']['disabled']=!![],this['editor']['toolbar']&&!this['editor']['getValue']()?.['trim']()&&this['editor']['toolbar']['classList']['add']('comments-toolbar-hidden');}async['handleSubmit'](){const _0x4bb334=this['editor']['getValue']()?.['trim']();if(!_0x4bb334&&this['pendingAttachments']['length']===0x0||!this['options']['taskId'])return;this['setLoading'](!![]);try{const _0x1a75e1=this['options']['getAPI']();this['pendingAttachments']['length']>0x0&&this['options']['enableAttachments']&&(await _0x1a75e1['uploadAttachments'](this['options']['taskId'],this['pendingAttachments']),this['existingAttachments']['push'](...this['pendingAttachments']['map'](_0x3a4863=>({'name':_0x3a4863['name']}))),this['pendingAttachments']=[]);if(this['editingCommentId']){const _0x4829b7=await _0x1a75e1['updateComment'](this['options']['taskId'],this['editingCommentId'],_0x4bb334),_0x47d05b=this['comments']['findIndex'](_0x5eae49=>_0x5eae49['id']===this['editingCommentId']);_0x47d05b!==-0x1&&(this['comments'][_0x47d05b]=_0x4829b7['comment']);}else{const _0x575ff1=await _0x1a75e1['addComment'](this['options']['taskId'],_0x4bb334);this['comments']['push'](_0x575ff1['comment']);}this['renderComments'](),this['updateCount'](),this['cancelEdit'](),this['editor']['clear']();}catch(_0x4836b4){console['error']('Failed\x20to\x20save\x20comment:',_0x4836b4),alert('Failed\x20to\x20save\x20comment:\x20'+_0x4836b4['message']);}finally{this['setLoading'](![]);}}async['deleteComment'](_0x20280d){const _0x37c4aa=await this['showDeleteConfirmModal']();if(!_0x37c4aa)return;try{const _0x14b3d0=this['options']['getAPI']();await _0x14b3d0['deleteComment'](this['options']['taskId'],_0x20280d),this['comments']=this['comments']['filter'](_0x3b6a7b=>_0x3b6a7b['id']!==_0x20280d),this['renderComments'](),this['updateCount']();}catch(_0x550c99){console['error']('Failed\x20to\x20delete\x20comment:',_0x550c99),alert('Failed\x20to\x20delete\x20comment:\x20'+_0x550c99['message']);}}['showDeleteConfirmModal'](){return new Promise(_0x22ae3=>{const _0x3c422f=document['createElement']('div');_0x3c422f['className']='comments-confirm-modal',_0x3c422f['innerHTML']='\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-backdrop\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-dialog\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22comments-confirm-header\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h3>Delete\x20Comment</h3>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-icon\x20comments-confirm-close\x22\x20title=\x22Close\x22>×</button>\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=\x22comments-confirm-body\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p>Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20this\x20comment?\x20This\x20action\x20cannot\x20be\x20undone.</p>\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=\x22comments-confirm-footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-ghost\x20btn-small\x20comments-confirm-cancel\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20type=\x22button\x22\x20class=\x22btn-danger\x20btn-small\x20comments-confirm-delete\x22>Delete</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20',document['body']['appendChild'](_0x3c422f);const _0x3a5239=_0x382978=>{document['removeEventListener']('keydown',_0x1a6ee4),_0x3c422f['remove'](),_0x22ae3(_0x382978);},_0x1a6ee4=_0x524684=>{if(_0x524684['key']==='Escape')_0x3a5239(![]);};document['addEventListener']('keydown',_0x1a6ee4),_0x3c422f['querySelector']('.comments-confirm-backdrop')['addEventListener']('click',()=>_0x3a5239(![])),_0x3c422f['querySelector']('.comments-confirm-close')['addEventListener']('click',()=>_0x3a5239(![])),_0x3c422f['querySelector']('.comments-confirm-cancel')['addEventListener']('click',()=>_0x3a5239(![])),_0x3c422f['querySelector']('.comments-confirm-delete')['addEventListener']('click',()=>_0x3a5239(!![])),_0x3c422f['querySelector']('.comments-confirm-cancel')['focus']();});}['setLoading'](_0x413c6f){this['submitBtn']['disabled']=_0x413c6f,this['submitBtn']['querySelector']('.btn-text')['hidden']=_0x413c6f,this['submitBtn']['querySelector']('.btn-loading')['hidden']=!_0x413c6f;}['updateCount'](){const _0x27f471=this['comments']['length'],_0x3fa86f=this['container']['querySelector']('#comments-count-badge');_0x3fa86f&&(_0x3fa86f['textContent']=_0x27f471,_0x3fa86f['hidden']=_0x27f471===0x0);const _0x211123=this['container']['querySelector']('#comments-count');_0x211123&&(_0x211123['textContent']=_0x27f471>0x0?'('+_0x27f471+')':''),this['options']['onCommentsChanged']&&this['options']['onCommentsChanged'](this['comments']);}['getCommentCount'](){return this['comments']['length'];}['destroy'](){this['editor']&&this['editor']['destroy'](),this['container']['innerHTML']='';}}CommentsWidget['prototype']['_attachToContainer']=function(){this['container']['__widget']=this;};typeof window!=='undefined'&&(window['CommentsWidget']=CommentsWidget);
@@ -1 +1 @@
1
- import{Utils}from'./app.js';export function parsePatchContent(_0x1fb268){const _0x3270a8=[],_0x2ec25b=_0x1fb268['split']('\x0a');let _0xb80194=null,_0x271f20=null;for(const _0x2b5515 of _0x2ec25b){if(_0x2b5515['startsWith']('diff\x20--git')){_0xb80194&&_0x271f20&&_0xb80194['hunks']['push'](_0x271f20);_0xb80194&&_0x3270a8['push'](_0xb80194);const _0x3bba74=_0x2b5515['match'](/diff --git a\/(.+?) b\/(.+)/);_0xb80194={'oldPath':_0x3bba74?_0x3bba74[0x1]:'','newPath':_0x3bba74?_0x3bba74[0x2]:'','hunks':[],'isDeleted':![]},_0x271f20=null;}else{if(_0x2b5515['startsWith']('deleted\x20file\x20mode')&&_0xb80194)_0xb80194['isDeleted']=!![];else{if(_0x2b5515['startsWith']('@@'))_0x271f20&&_0xb80194&&_0xb80194['hunks']['push'](_0x271f20),_0x271f20={'header':_0x2b5515,'lines':[]};else _0x271f20&&_0x271f20['lines']['push'](_0x2b5515);}}}return _0xb80194&&_0x271f20&&_0xb80194['hunks']['push'](_0x271f20),_0xb80194&&_0x3270a8['push'](_0xb80194),_0x3270a8;}export function parseHunkHeader(_0x4503e1){const _0x3704a2=_0x4503e1['match'](/@@ -(\d+),?\d* \+(\d+),?\d* @@/);if(_0x3704a2)return{'oldStart':parseInt(_0x3704a2[0x1],0xa),'newStart':parseInt(_0x3704a2[0x2],0xa)};return{'oldStart':0x1,'newStart':0x1};}export function highlightDiffLine(_0x5e89a7,_0x27ff94){const _0x1d3633=window['hljs']||(typeof hljs!=='undefined'?hljs:null);if(_0x1d3633&&_0x27ff94)try{const _0x5807ac=_0x1d3633['getLanguage'](_0x27ff94)?_0x27ff94:null;if(_0x5807ac)return _0x1d3633['highlight'](_0x5e89a7,{'language':_0x5807ac})['value'];}catch(_0x4ef0fc){console['error']('Diff\x20syntax\x20highlighting\x20error:',_0x4ef0fc);}return Utils['escapeHtml'](_0x5e89a7);}export function getFileLanguage(_0x5e1ff8){const _0x26c2e0=_0x5e1ff8['split']('.')['pop']()['toLowerCase'](),_0x1fb812={'js':'javascript','jsx':'javascript','ts':'typescript','tsx':'typescript','py':'python','java':'java','c':'c','cpp':'cpp','cs':'csharp','go':'go','rs':'rust','php':'php','rb':'ruby','html':'xml','css':'css','json':'json','yml':'yaml','yaml':'yaml','md':'markdown','sh':'bash','bash':'bash'};return _0x1fb812[_0x26c2e0]||null;}export function computeWordDiff(_0x498615,_0x576a0d){const _0x2ccb7b=_0x354385=>{const _0x1211a0=[];let _0x2d848c='',_0x249921=![];for(let _0x1692f1=0x0;_0x1692f1<_0x354385['length'];_0x1692f1++){const _0x85c7dd=_0x354385[_0x1692f1],_0x507957=/\s/['test'](_0x85c7dd);if(_0x2d848c==='')_0x2d848c=_0x85c7dd,_0x249921=_0x507957;else _0x507957===_0x249921?_0x2d848c+=_0x85c7dd:(_0x1211a0['push'](_0x2d848c),_0x2d848c=_0x85c7dd,_0x249921=_0x507957);}return _0x2d848c&&_0x1211a0['push'](_0x2d848c),_0x1211a0;},_0x265790=_0x2ccb7b(_0x498615),_0x5ad435=_0x2ccb7b(_0x576a0d),_0x2508bb=_0x265790['length'],_0x1b1a25=_0x5ad435['length'],_0x1d7f29=Array(_0x2508bb+0x1)['fill'](null)['map'](()=>Array(_0x1b1a25+0x1)['fill'](0x0));for(let _0x422278=0x1;_0x422278<=_0x2508bb;_0x422278++){for(let _0x4f157f=0x1;_0x4f157f<=_0x1b1a25;_0x4f157f++){_0x265790[_0x422278-0x1]===_0x5ad435[_0x4f157f-0x1]?_0x1d7f29[_0x422278][_0x4f157f]=_0x1d7f29[_0x422278-0x1][_0x4f157f-0x1]+0x1:_0x1d7f29[_0x422278][_0x4f157f]=Math['max'](_0x1d7f29[_0x422278-0x1][_0x4f157f],_0x1d7f29[_0x422278][_0x4f157f-0x1]);}}const _0x2631d3={'old':[],'new':[]};let _0x3b576e=_0x2508bb,_0x4d1906=_0x1b1a25;const _0x4b968e=[],_0x5f3c0f=[];while(_0x3b576e>0x0||_0x4d1906>0x0){if(_0x3b576e>0x0&&_0x4d1906>0x0&&_0x265790[_0x3b576e-0x1]===_0x5ad435[_0x4d1906-0x1])_0x4b968e['unshift']({'type':'equal','text':_0x265790[_0x3b576e-0x1]}),_0x5f3c0f['unshift']({'type':'equal','text':_0x5ad435[_0x4d1906-0x1]}),_0x3b576e--,_0x4d1906--;else{if(_0x4d1906>0x0&&(_0x3b576e===0x0||_0x1d7f29[_0x3b576e][_0x4d1906-0x1]>=_0x1d7f29[_0x3b576e-0x1][_0x4d1906]))_0x5f3c0f['unshift']({'type':'insert','text':_0x5ad435[_0x4d1906-0x1]}),_0x4d1906--;else _0x3b576e>0x0&&(_0x4b968e['unshift']({'type':'delete','text':_0x265790[_0x3b576e-0x1]}),_0x3b576e--);}}return _0x2631d3['old']=_0x4b968e,_0x2631d3['new']=_0x5f3c0f,_0x2631d3;}export function renderDiffLineWithWordHighlight(_0x3a0053,_0x17f4c2,_0x54aeb7,_0x590dd5){if(!_0x17f4c2||_0x17f4c2['length']===0x0)return highlightDiffLine(_0x3a0053,_0x590dd5);let _0x2aa496='';const _0x241ab4=_0x54aeb7==='add'?'diff-word-add':'diff-word-remove',_0x576f72=_0x54aeb7==='add'?'insert':'delete';for(const _0x4fba98 of _0x17f4c2){const _0x11292b=Utils['escapeHtml'](_0x4fba98['text']);_0x4fba98['type']===_0x576f72?_0x2aa496+='<span\x20class=\x22'+_0x241ab4+'\x22>'+_0x11292b+'</span>':_0x2aa496+=_0x11292b;}return _0x2aa496;}export function calculateDiffStats(_0x4c812a){let _0x488873=0x0,_0x31a1df=0x0,_0x1ab589=0x0;return _0x4c812a['forEach'](_0x16f5c2=>{let _0x481f10=0x0,_0x3a48f1=0x0;_0x16f5c2['hunks']['forEach'](_0x520265=>{_0x520265['lines']['forEach'](_0xfc8e84=>{if(_0xfc8e84['startsWith']('+'))_0x481f10+=0x1;else{if(_0xfc8e84['startsWith']('-'))_0x3a48f1+=0x1;}});}),(_0x481f10+_0x3a48f1>0x0||_0x16f5c2['isDeleted'])&&(_0x1ab589+=0x1),_0x488873+=_0x481f10,_0x31a1df+=_0x3a48f1;}),{'additions':_0x488873,'deletions':_0x31a1df,'files':_0x1ab589};}export function getFileStatus(_0x44c32c,_0x664da2,_0x4b406a){if(_0x44c32c['isDeleted'])return'deleted';if(_0x664da2>0x0&&_0x4b406a===0x0)return'added';return'modified';}export function safeBase64(_0x3411f2){try{return btoa(unescape(encodeURIComponent(_0x3411f2)));}catch(_0x4e34e1){return btoa(_0x3411f2);}}export function getStorageKey(_0x36fe75,_0xbeb371){return _0x36fe75+'-'+safeBase64(_0xbeb371);}export function getCollapsedState(_0x4f7f64,_0x177b4e){const _0x2ab365=localStorage['getItem'](getStorageKey(_0x4f7f64,_0x177b4e));return _0x2ab365==='true';}export function renderUnifiedDiff(_0x33d59b,_0x3cfe24){return _0x33d59b['map']((_0x231782,_0x3c66d3)=>{const _0x7d7f9b=_0x231782['newPath']||_0x231782['oldPath']||'unknown',_0x41cef3='diff-'+_0x3cfe24+'-'+_0x3c66d3,_0x435fd8=getFileLanguage(_0x7d7f9b),{additions:_0x181a6a,deletions:_0x3b1624}=calculateDiffStats([_0x231782]),_0x2a079d=getCollapsedState(_0x3cfe24,_0x7d7f9b),_0x8d22c4=getFileStatus(_0x231782,_0x181a6a,_0x3b1624),_0x4c713b=_0x8d22c4==='added'?'A':_0x8d22c4==='deleted'?'D':'M',_0x418388=_0x231782['hunks']['map'](_0x49b869=>{const {oldStart:_0x9f8d0e,newStart:_0x19c030}=parseHunkHeader(_0x49b869['header']);let _0x45ecaa=_0x9f8d0e,_0x55a4b9=_0x19c030;const _0x5a9c6a=_0x49b869['lines']['map'](_0x1d01a5=>({'line':_0x1d01a5,'type':_0x1d01a5['startsWith']('+')?'add':_0x1d01a5['startsWith']('-')?'remove':_0x1d01a5['startsWith']('\x5c')?'meta':'context'}));let _0x54023e=0x0;while(_0x54023e<_0x5a9c6a['length']){if(_0x5a9c6a[_0x54023e]['type']==='remove'){let _0x31d0c0=_0x54023e,_0x52ecf6=_0x54023e;while(_0x52ecf6<_0x5a9c6a['length']&&_0x5a9c6a[_0x52ecf6]['type']==='remove')_0x52ecf6++;let _0x3e950b=_0x52ecf6,_0x536bf0=_0x3e950b;while(_0x536bf0<_0x5a9c6a['length']&&_0x5a9c6a[_0x536bf0]['type']==='add')_0x536bf0++;const _0x56f5d2=_0x52ecf6-_0x31d0c0,_0x17c8dc=_0x536bf0-_0x3e950b,_0x135c72=Math['min'](_0x56f5d2,_0x17c8dc);for(let _0x37f4bc=0x0;_0x37f4bc<_0x135c72;_0x37f4bc++){const _0xf16a19=_0x5a9c6a[_0x31d0c0+_0x37f4bc]['line']['substring'](0x1),_0x23dc15=_0x5a9c6a[_0x3e950b+_0x37f4bc]['line']['substring'](0x1),_0x4f40a4=computeWordDiff(_0xf16a19,_0x23dc15);_0x5a9c6a[_0x31d0c0+_0x37f4bc]['wordDiff']=_0x4f40a4['old'],_0x5a9c6a[_0x3e950b+_0x37f4bc]['wordDiff']=_0x4f40a4['new'];}_0x54023e=_0x536bf0;}else _0x54023e++;}const _0x32d849=_0x5a9c6a['map'](_0x26a231=>{const _0x5c85b0=_0x26a231['line'];if(_0x5c85b0['startsWith']('+')){const _0x35e91b=_0x5c85b0['substring'](0x1),_0x5e0cdc=_0x26a231['wordDiff']?renderDiffLineWithWordHighlight(_0x35e91b,_0x26a231['wordDiff'],'add',_0x435fd8):highlightDiffLine(_0x35e91b,_0x435fd8),_0x2a98d0='<div\x20class=\x22diff-line\x20diff-add\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22></span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x55a4b9+'</span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>+</span>'+_0x5e0cdc+'</span></div>';return _0x55a4b9+=0x1,_0x2a98d0;}if(_0x5c85b0['startsWith']('-')){const _0x427534=_0x5c85b0['substring'](0x1),_0x549422=_0x26a231['wordDiff']?renderDiffLineWithWordHighlight(_0x427534,_0x26a231['wordDiff'],'remove',_0x435fd8):highlightDiffLine(_0x427534,_0x435fd8),_0x483a60='<div\x20class=\x22diff-line\x20diff-remove\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x45ecaa+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>-</span>'+_0x549422+'</span></div>';return _0x45ecaa+=0x1,_0x483a60;}if(_0x5c85b0['startsWith']('\x5c'))return'<div\x20class=\x22diff-line\x20diff-meta\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22></span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22>'+Utils['escapeHtml'](_0x5c85b0)+'</span></div>';const _0x3b3d8c=_0x5c85b0['startsWith']('\x20')?_0x5c85b0['substring'](0x1):_0x5c85b0,_0x1e3bb5=highlightDiffLine(_0x3b3d8c,_0x435fd8),_0x21722a='<div\x20class=\x22diff-line\x20diff-context\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x45ecaa+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x55a4b9+'</span><span\x20class=\x22diff-line-content\x22>\x20'+_0x1e3bb5+'</span></div>';return _0x45ecaa+=0x1,_0x55a4b9+=0x1,_0x21722a;})['join']('');return'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>'+Utils['escapeHtml'](_0x49b869['header'])+'</div>'+_0x32d849+'</div>';})['join'](''),_0x2567a7=_0x418388||'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>No\x20textual\x20diff\x20available</div></div>';return'\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff\x22\x20id=\x22file-'+_0x41cef3+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-header\x22\x20data-diff-id=\x22'+_0x41cef3+'\x22\x20data-file-name=\x22'+Utils['escapeHtml'](_0x7d7f9b)+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-title\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-status-badge\x20'+_0x8d22c4+'\x22>'+_0x4c713b+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-name\x22>'+Utils['escapeHtml'](_0x7d7f9b)+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-stat\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-add\x22>+'+_0x181a6a+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-del\x22>-'+_0x3b1624+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22file-diff-toggle-btn\x22\x20data-diff-id=\x22'+_0x41cef3+'\x22\x20data-collapsed=\x22'+_0x2a079d+'\x22\x20type=\x22button\x22\x20aria-label=\x22'+(_0x2a079d?'Expand':'Collapse')+'\x22></button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-content\x20'+(_0x2a079d?'collapsed':'')+'\x22\x20id=\x22'+_0x41cef3+'\x22>'+_0x2567a7+'</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20';})['join']('');}
1
+ import{Utils}from'./app.js';export function parsePatchContent(_0x2e4d96){const _0x148ff2=[],_0x5a63ea=_0x2e4d96['split']('\x0a');let _0x441822=null,_0x50a74a=null;for(const _0x480fe2 of _0x5a63ea){if(_0x480fe2['startsWith']('diff\x20--git')){_0x441822&&_0x50a74a&&_0x441822['hunks']['push'](_0x50a74a);_0x441822&&_0x148ff2['push'](_0x441822);const _0x324862=_0x480fe2['match'](/diff --git a\/(.+?) b\/(.+)/);_0x441822={'oldPath':_0x324862?_0x324862[0x1]:'','newPath':_0x324862?_0x324862[0x2]:'','hunks':[],'isDeleted':![]},_0x50a74a=null;}else{if(_0x480fe2['startsWith']('deleted\x20file\x20mode')&&_0x441822)_0x441822['isDeleted']=!![];else{if(_0x480fe2['startsWith']('@@'))_0x50a74a&&_0x441822&&_0x441822['hunks']['push'](_0x50a74a),_0x50a74a={'header':_0x480fe2,'lines':[]};else _0x50a74a&&_0x50a74a['lines']['push'](_0x480fe2);}}}return _0x441822&&_0x50a74a&&_0x441822['hunks']['push'](_0x50a74a),_0x441822&&_0x148ff2['push'](_0x441822),_0x148ff2;}export function parseHunkHeader(_0x3c9c0f){const _0x59bfee=_0x3c9c0f['match'](/@@ -(\d+),?\d* \+(\d+),?\d* @@/);if(_0x59bfee)return{'oldStart':parseInt(_0x59bfee[0x1],0xa),'newStart':parseInt(_0x59bfee[0x2],0xa)};return{'oldStart':0x1,'newStart':0x1};}export function highlightDiffLine(_0x4b9bc5,_0x26b215){const _0x22b655=window['hljs']||(typeof hljs!=='undefined'?hljs:null);if(_0x22b655&&_0x26b215)try{const _0x3f2ae4=_0x22b655['getLanguage'](_0x26b215)?_0x26b215:null;if(_0x3f2ae4)return _0x22b655['highlight'](_0x4b9bc5,{'language':_0x3f2ae4})['value'];}catch(_0x51c3fc){console['error']('Diff\x20syntax\x20highlighting\x20error:',_0x51c3fc);}return Utils['escapeHtml'](_0x4b9bc5);}export function getFileLanguage(_0x1056bc){const _0x1a065f=_0x1056bc['split']('.')['pop']()['toLowerCase'](),_0x435770={'js':'javascript','jsx':'javascript','ts':'typescript','tsx':'typescript','py':'python','java':'java','c':'c','cpp':'cpp','cs':'csharp','go':'go','rs':'rust','php':'php','rb':'ruby','html':'xml','css':'css','json':'json','yml':'yaml','yaml':'yaml','md':'markdown','sh':'bash','bash':'bash'};return _0x435770[_0x1a065f]||null;}export function computeWordDiff(_0x22b76b,_0x17576c){const _0x1423e2=_0x16256f=>{const _0x43bee7=[];let _0x32e369='',_0x50f469=![];for(let _0x31757a=0x0;_0x31757a<_0x16256f['length'];_0x31757a++){const _0x593d6b=_0x16256f[_0x31757a],_0xe6927c=/\s/['test'](_0x593d6b);if(_0x32e369==='')_0x32e369=_0x593d6b,_0x50f469=_0xe6927c;else _0xe6927c===_0x50f469?_0x32e369+=_0x593d6b:(_0x43bee7['push'](_0x32e369),_0x32e369=_0x593d6b,_0x50f469=_0xe6927c);}return _0x32e369&&_0x43bee7['push'](_0x32e369),_0x43bee7;},_0xf54268=_0x1423e2(_0x22b76b),_0x472996=_0x1423e2(_0x17576c),_0x118047=_0xf54268['length'],_0x21018e=_0x472996['length'],_0x20f53e=Array(_0x118047+0x1)['fill'](null)['map'](()=>Array(_0x21018e+0x1)['fill'](0x0));for(let _0x1a79c5=0x1;_0x1a79c5<=_0x118047;_0x1a79c5++){for(let _0x17fd99=0x1;_0x17fd99<=_0x21018e;_0x17fd99++){_0xf54268[_0x1a79c5-0x1]===_0x472996[_0x17fd99-0x1]?_0x20f53e[_0x1a79c5][_0x17fd99]=_0x20f53e[_0x1a79c5-0x1][_0x17fd99-0x1]+0x1:_0x20f53e[_0x1a79c5][_0x17fd99]=Math['max'](_0x20f53e[_0x1a79c5-0x1][_0x17fd99],_0x20f53e[_0x1a79c5][_0x17fd99-0x1]);}}const _0x51d6b9={'old':[],'new':[]};let _0xc48ec0=_0x118047,_0x960377=_0x21018e;const _0x49ab55=[],_0x59a707=[];while(_0xc48ec0>0x0||_0x960377>0x0){if(_0xc48ec0>0x0&&_0x960377>0x0&&_0xf54268[_0xc48ec0-0x1]===_0x472996[_0x960377-0x1])_0x49ab55['unshift']({'type':'equal','text':_0xf54268[_0xc48ec0-0x1]}),_0x59a707['unshift']({'type':'equal','text':_0x472996[_0x960377-0x1]}),_0xc48ec0--,_0x960377--;else{if(_0x960377>0x0&&(_0xc48ec0===0x0||_0x20f53e[_0xc48ec0][_0x960377-0x1]>=_0x20f53e[_0xc48ec0-0x1][_0x960377]))_0x59a707['unshift']({'type':'insert','text':_0x472996[_0x960377-0x1]}),_0x960377--;else _0xc48ec0>0x0&&(_0x49ab55['unshift']({'type':'delete','text':_0xf54268[_0xc48ec0-0x1]}),_0xc48ec0--);}}return _0x51d6b9['old']=_0x49ab55,_0x51d6b9['new']=_0x59a707,_0x51d6b9;}export function renderDiffLineWithWordHighlight(_0x2aeaef,_0x33a66a,_0x5669be,_0x112103){if(!_0x33a66a||_0x33a66a['length']===0x0)return highlightDiffLine(_0x2aeaef,_0x112103);let _0xb45600='';const _0x41f42d=_0x5669be==='add'?'diff-word-add':'diff-word-remove',_0x32ea5e=_0x5669be==='add'?'insert':'delete';for(const _0x17ffd5 of _0x33a66a){const _0x3f78f3=Utils['escapeHtml'](_0x17ffd5['text']);_0x17ffd5['type']===_0x32ea5e?_0xb45600+='<span\x20class=\x22'+_0x41f42d+'\x22>'+_0x3f78f3+'</span>':_0xb45600+=_0x3f78f3;}return _0xb45600;}export function calculateDiffStats(_0xe8db8e){let _0x58e6db=0x0,_0x3e6793=0x0,_0x16b03b=0x0;return _0xe8db8e['forEach'](_0xb3c45d=>{let _0x67dc92=0x0,_0x4bb977=0x0;_0xb3c45d['hunks']['forEach'](_0x5cfabe=>{_0x5cfabe['lines']['forEach'](_0x4c4ef1=>{if(_0x4c4ef1['startsWith']('+'))_0x67dc92+=0x1;else{if(_0x4c4ef1['startsWith']('-'))_0x4bb977+=0x1;}});}),(_0x67dc92+_0x4bb977>0x0||_0xb3c45d['isDeleted'])&&(_0x16b03b+=0x1),_0x58e6db+=_0x67dc92,_0x3e6793+=_0x4bb977;}),{'additions':_0x58e6db,'deletions':_0x3e6793,'files':_0x16b03b};}export function getFileStatus(_0xd29ea3,_0x503793,_0xe59016){if(_0xd29ea3['isDeleted'])return'deleted';if(_0x503793>0x0&&_0xe59016===0x0)return'added';return'modified';}export function safeBase64(_0x4fbcbb){try{return btoa(unescape(encodeURIComponent(_0x4fbcbb)));}catch(_0x25f2f7){return btoa(_0x4fbcbb);}}export function getStorageKey(_0x3b4857,_0x2fbc26){return _0x3b4857+'-'+safeBase64(_0x2fbc26);}export function getCollapsedState(_0x947670,_0x2514e0){const _0xed723d=localStorage['getItem'](getStorageKey(_0x947670,_0x2514e0));return _0xed723d==='true';}export function renderUnifiedDiff(_0x192e14,_0x2d0abb){return _0x192e14['map']((_0x190f51,_0x4cd75a)=>{const _0x20173a=_0x190f51['newPath']||_0x190f51['oldPath']||'unknown',_0x9d1021='diff-'+_0x2d0abb+'-'+_0x4cd75a,_0x4beede=getFileLanguage(_0x20173a),{additions:_0x33af69,deletions:_0x29f48b}=calculateDiffStats([_0x190f51]),_0x41e8c8=getCollapsedState(_0x2d0abb,_0x20173a),_0x54c872=getFileStatus(_0x190f51,_0x33af69,_0x29f48b),_0x14cc31=_0x54c872==='added'?'A':_0x54c872==='deleted'?'D':'M',_0x5e1446=_0x190f51['hunks']['map'](_0x2f2890=>{const {oldStart:_0x388479,newStart:_0x1cedf5}=parseHunkHeader(_0x2f2890['header']);let _0xb76183=_0x388479,_0x559669=_0x1cedf5;const _0x30289a=_0x2f2890['lines']['map'](_0x1c8c61=>({'line':_0x1c8c61,'type':_0x1c8c61['startsWith']('+')?'add':_0x1c8c61['startsWith']('-')?'remove':_0x1c8c61['startsWith']('\x5c')?'meta':'context'}));let _0x323252=0x0;while(_0x323252<_0x30289a['length']){if(_0x30289a[_0x323252]['type']==='remove'){let _0x22cbc2=_0x323252,_0x59713d=_0x323252;while(_0x59713d<_0x30289a['length']&&_0x30289a[_0x59713d]['type']==='remove')_0x59713d++;let _0x2829bd=_0x59713d,_0xe66ddd=_0x2829bd;while(_0xe66ddd<_0x30289a['length']&&_0x30289a[_0xe66ddd]['type']==='add')_0xe66ddd++;const _0x5e34c1=_0x59713d-_0x22cbc2,_0x58e25f=_0xe66ddd-_0x2829bd,_0x3f4cc1=Math['min'](_0x5e34c1,_0x58e25f);for(let _0x16d0d8=0x0;_0x16d0d8<_0x3f4cc1;_0x16d0d8++){const _0x285487=_0x30289a[_0x22cbc2+_0x16d0d8]['line']['substring'](0x1),_0x44c427=_0x30289a[_0x2829bd+_0x16d0d8]['line']['substring'](0x1),_0x5651ab=computeWordDiff(_0x285487,_0x44c427);_0x30289a[_0x22cbc2+_0x16d0d8]['wordDiff']=_0x5651ab['old'],_0x30289a[_0x2829bd+_0x16d0d8]['wordDiff']=_0x5651ab['new'];}_0x323252=_0xe66ddd;}else _0x323252++;}const _0x36d9e4=_0x30289a['map'](_0x4ec4da=>{const _0x55b34a=_0x4ec4da['line'];if(_0x55b34a['startsWith']('+')){const _0x5a01c4=_0x55b34a['substring'](0x1),_0x44a2c8=_0x4ec4da['wordDiff']?renderDiffLineWithWordHighlight(_0x5a01c4,_0x4ec4da['wordDiff'],'add',_0x4beede):highlightDiffLine(_0x5a01c4,_0x4beede),_0x328f34='<div\x20class=\x22diff-line\x20diff-add\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22></span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x559669+'</span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>+</span>'+_0x44a2c8+'</span></div>';return _0x559669+=0x1,_0x328f34;}if(_0x55b34a['startsWith']('-')){const _0x30dc03=_0x55b34a['substring'](0x1),_0x38ddff=_0x4ec4da['wordDiff']?renderDiffLineWithWordHighlight(_0x30dc03,_0x4ec4da['wordDiff'],'remove',_0x4beede):highlightDiffLine(_0x30dc03,_0x4beede),_0x377d67='<div\x20class=\x22diff-line\x20diff-remove\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0xb76183+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>-</span>'+_0x38ddff+'</span></div>';return _0xb76183+=0x1,_0x377d67;}if(_0x55b34a['startsWith']('\x5c'))return'<div\x20class=\x22diff-line\x20diff-meta\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22></span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22>'+Utils['escapeHtml'](_0x55b34a)+'</span></div>';const _0x147c7b=_0x55b34a['startsWith']('\x20')?_0x55b34a['substring'](0x1):_0x55b34a,_0x689ff2=highlightDiffLine(_0x147c7b,_0x4beede),_0x5574a2='<div\x20class=\x22diff-line\x20diff-context\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0xb76183+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x559669+'</span><span\x20class=\x22diff-line-content\x22>\x20'+_0x689ff2+'</span></div>';return _0xb76183+=0x1,_0x559669+=0x1,_0x5574a2;})['join']('');return'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>'+Utils['escapeHtml'](_0x2f2890['header'])+'</div>'+_0x36d9e4+'</div>';})['join'](''),_0xa2a3f2=_0x5e1446||'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>No\x20textual\x20diff\x20available</div></div>';return'\x0a\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff\x22\x20id=\x22file-'+_0x9d1021+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-header\x22\x20data-diff-id=\x22'+_0x9d1021+'\x22\x20data-file-name=\x22'+Utils['escapeHtml'](_0x20173a)+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-title\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-status-badge\x20'+_0x54c872+'\x22>'+_0x14cc31+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-name\x22>'+Utils['escapeHtml'](_0x20173a)+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-stat\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-add\x22>+'+_0x33af69+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-del\x22>-'+_0x29f48b+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22file-diff-toggle-btn\x22\x20data-diff-id=\x22'+_0x9d1021+'\x22\x20data-collapsed=\x22'+_0x41e8c8+'\x22\x20type=\x22button\x22\x20aria-label=\x22'+(_0x41e8c8?'Expand':'Collapse')+'\x22></button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-content\x20'+(_0x41e8c8?'collapsed':'')+'\x22\x20id=\x22'+_0x9d1021+'\x22>'+_0xa2a3f2+'</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20';})['join']('');}