@profoundlogic/coderflow-server 0.5.6 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/coder-server.js +1 -1
- package/dist/config.js +1 -1
- package/dist/lib/agent-keepalive.js +1 -1
- package/dist/lib/agent-models.js +1 -1
- package/dist/lib/api-keys.js +1 -1
- package/dist/lib/apiKeys.js +1 -1
- package/dist/lib/app-server-ports.js +1 -1
- package/dist/lib/auto-judge.js +1 -1
- package/dist/lib/automation-service.js +1 -1
- package/dist/lib/basic-auth.js +1 -1
- package/dist/lib/bindings.js +1 -1
- package/dist/lib/build-history.js +1 -1
- package/dist/lib/build-output-service.js +1 -1
- package/dist/lib/build-scheduler.js +1 -1
- package/dist/lib/build-service.js +1 -1
- package/dist/lib/ca-certificates.js +1 -1
- package/dist/lib/claude-oauth-refresh.js +1 -1
- package/dist/lib/cli/build.js +1 -1
- package/dist/lib/cli/cleanup-users.js +1 -1
- package/dist/lib/cli/config-command.js +1 -1
- package/dist/lib/cli/config.js +1 -1
- package/dist/lib/cli/create-user.js +1 -1
- package/dist/lib/cli/grant-admin.js +1 -1
- package/dist/lib/cli/init.js +1 -1
- package/dist/lib/cli/jira.js +1 -1
- package/dist/lib/cli/license.js +1 -1
- package/dist/lib/cli/list-roles.js +1 -1
- package/dist/lib/cli/list-users.js +1 -1
- package/dist/lib/cli/server-manager.js +1 -1
- package/dist/lib/cli/set-password.js +1 -1
- package/dist/lib/config-migration.js +1 -1
- package/dist/lib/container-credential-sync.js +1 -1
- package/dist/lib/container-tokens.js +1 -1
- package/dist/lib/data-dir.js +1 -1
- package/dist/lib/deployment-history.js +1 -1
- package/dist/lib/deployment-service.js +1 -1
- package/dist/lib/docker-utils.js +1 -1
- package/dist/lib/email.js +1 -1
- package/dist/lib/emailTemplates.js +1 -1
- package/dist/lib/entitlement.js +1 -1
- package/dist/lib/external-connections.js +1 -1
- package/dist/lib/fetch-utils.js +1 -1
- package/dist/lib/git-commit-details-route.js +1 -1
- package/dist/lib/git-history-diff-guardrails.js +1 -1
- package/dist/lib/git-provider-service.js +1 -1
- package/dist/lib/git-provider-setup/github-setup-handler.js +1 -1
- package/dist/lib/git-provider-setup/index.js +1 -1
- package/dist/lib/git-provider-setup/setup-factory.js +1 -1
- package/dist/lib/git-provider-setup/setup-interface.js +1 -1
- package/dist/lib/git-providers/azure-devops-provider.js +1 -1
- package/dist/lib/git-providers/github-app-provider.js +1 -1
- package/dist/lib/git-providers/index.js +1 -1
- package/dist/lib/git-providers/provider-factory.js +1 -1
- package/dist/lib/git-providers/provider-interface.js +1 -1
- package/dist/lib/github-urls.js +1 -1
- package/dist/lib/group-objective-linking.js +1 -1
- package/dist/lib/ibmi-sync.js +1 -1
- package/dist/lib/jira-client.js +1 -1
- package/dist/lib/judge-blinding.js +1 -1
- package/dist/lib/logger.js +1 -1
- package/dist/lib/migration-to-scoped-rbac.js +1 -1
- package/dist/lib/model-fetcher.js +1 -1
- package/dist/lib/notifications.js +1 -1
- package/dist/lib/objective-context.js +1 -1
- package/dist/lib/oidc-auth.js +1 -1
- package/dist/lib/oidc-device-flow.js +1 -1
- package/dist/lib/passwordTokens.js +1 -1
- package/dist/lib/permission-resolver.js +1 -1
- package/dist/lib/pin-cascade.js +1 -1
- package/dist/lib/provider-accounts.js +1 -1
- package/dist/lib/provider-oauth.js +1 -1
- package/dist/lib/provider-profile.js +1 -1
- package/dist/lib/provider-token-refresh.js +1 -1
- package/dist/lib/rbac-user-state.js +1 -1
- package/dist/lib/request-url.js +1 -1
- package/dist/lib/rewind.js +1 -1
- package/dist/lib/role-definitions.js +1 -1
- package/dist/lib/roles.js +1 -1
- package/dist/lib/secrets.js +1 -1
- package/dist/lib/setup-repo-git-auth.js +1 -1
- package/dist/lib/state-capture.js +1 -1
- package/dist/lib/static-files.js +1 -1
- package/dist/lib/task-name-format.js +1 -1
- package/dist/lib/task-name-generator.js +1 -1
- package/dist/lib/task-source-metadata.js +1 -1
- package/dist/lib/teams.js +1 -1
- package/dist/lib/user-git-oauth.js +1 -1
- package/dist/lib/user-git-tokens.js +1 -1
- package/dist/lib/users.js +1 -1
- package/dist/middleware/requireAuth.js +1 -1
- package/dist/middleware/requireInit.js +1 -1
- package/dist/middleware/requirePermission.js +1 -1
- package/dist/package.json +1 -1
- package/dist/playwright.config.js +1 -1
- package/dist/routes/apiKeys.js +1 -1
- package/dist/routes/auth-oidc.js +1 -1
- package/dist/routes/auth.js +1 -1
- package/dist/routes/automations.js +1 -1
- package/dist/routes/bindings.js +1 -1
- package/dist/routes/build.js +1 -1
- package/dist/routes/containers.js +1 -1
- package/dist/routes/deploy-task.js +1 -1
- package/dist/routes/environment-management.js +1 -1
- package/dist/routes/environments.js +1 -1
- package/dist/routes/external-skills.js +1 -1
- package/dist/routes/git-credentials.js +1 -1
- package/dist/routes/git-oauth.js +1 -1
- package/dist/routes/git-provider-setup.js +1 -1
- package/dist/routes/health.js +1 -1
- package/dist/routes/jira.js +1 -1
- package/dist/routes/objective-management.js +1 -1
- package/dist/routes/password.js +1 -1
- package/dist/routes/prompt.js +1 -1
- package/dist/routes/provider-auth.js +1 -1
- package/dist/routes/qa.js +1 -1
- package/dist/routes/roles.js +1 -1
- package/dist/routes/settings.js +1 -1
- package/dist/routes/skill-management.js +1 -1
- package/dist/routes/skills.js +1 -1
- package/dist/routes/tasks.js +1 -1
- package/dist/routes/teams.js +1 -1
- package/dist/routes/templates.js +1 -1
- package/dist/routes/test-task.js +1 -1
- package/dist/routes/test.js +1 -1
- package/dist/routes/users.js +1 -1
- package/dist/routes/visualizations.js +1 -1
- package/dist/scripts/create-user.js +1 -1
- package/dist/scripts/migrate-config-to-data-dir.js +1 -1
- package/dist/start.js +1 -1
- package/dist/web-ui/public/activity-detail-modal.js +1 -1
- package/dist/web-ui/public/activity-feed.js +1 -1
- package/dist/web-ui/public/activity-formatters.js +1 -1
- package/dist/web-ui/public/agent-event-parser.js +1 -1
- package/dist/web-ui/public/app.js +1 -1
- package/dist/web-ui/public/approve-dialog.js +1 -1
- package/dist/web-ui/public/automation-links.js +1 -1
- package/dist/web-ui/public/automation-schedule.js +1 -1
- package/dist/web-ui/public/comments-widget.js +1 -1
- package/dist/web-ui/public/diff-utils.js +1 -1
- package/dist/web-ui/public/environments.js +1 -1
- package/dist/web-ui/public/feedback-widget.css +6 -4
- package/dist/web-ui/public/feedback-widget.js +1 -1
- package/dist/web-ui/public/git-history-lazy-utils.js +1 -1
- package/dist/web-ui/public/git-history.js +1 -1
- package/dist/web-ui/public/git-status.js +1 -1
- package/dist/web-ui/public/index.js +1 -1
- package/dist/web-ui/public/login.js +1 -1
- package/dist/web-ui/public/markdown-editor.js +1 -1
- package/dist/web-ui/public/markdown-file-editor.js +1 -1
- package/dist/web-ui/public/modal-maximize.js +1 -1
- package/dist/web-ui/public/notifications.js +1 -1
- package/dist/web-ui/public/pr-dialog.js +1 -1
- package/dist/web-ui/public/roles.js +1 -1
- package/dist/web-ui/public/server-health.js +1 -1
- package/dist/web-ui/public/settings.js +1 -1
- package/dist/web-ui/public/setup-password.js +1 -1
- package/dist/web-ui/public/skills.js +1 -1
- package/dist/web-ui/public/sse-client.js +1 -1
- package/dist/web-ui/public/sse-shared-worker.js +1 -1
- package/dist/web-ui/public/styles.css +34 -4
- package/dist/web-ui/public/task.js +1 -1
- package/dist/web-ui/public/teams.js +1 -1
- package/dist/web-ui/public/terminal.js +1 -1
- package/dist/web-ui/public/theme.js +1 -1
- package/dist/web-ui/public/users.js +1 -1
- package/dist/web-ui/public/variant-grouping.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function isLogOnlyTaskType(_0x82ec37){return _0x82ec37==='test'||_0x82ec37==='deploy';}export function createApproveDialogHTML(_0x57c074='',_0x2db3d4={}){const _0x2bdbf0=_0x57c074,_0x342b27=_0x2db3d4['useTaskPageStyles']?'modal\x20profound-approve-modal':'profound-feedback-modal\x20profound-approve-modal',_0x52bf27=_0x2db3d4['useTaskPageStyles']?'modal-warning':'approve-modal-warning',_0x169321=_0x2db3d4['useTaskPageStyles']?'modal-error':'approve-modal-error';return'\x0a\x20\x20\x20\x20<div\x20id=\x22'+_0x2bdbf0+'approve-modal\x22\x20class=\x22'+_0x342b27+'\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'+_0x2bdbf0+'close-approve-modal\x22>×</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'+_0x2bdbf0+'approve-warning\x22\x20class=\x22'+_0x52bf27+'\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'+_0x2bdbf0+'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'+_0x2bdbf0+'approve-error\x22\x20class=\x22'+_0x169321+'\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'+_0x2bdbf0+'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\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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'commit-message-input\x22>Commit\x20message:</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<textarea\x20id=\x22'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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\x20(rebase)</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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'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'+_0x2bdbf0+'ibmi-sync-library-row\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'+_0x2bdbf0+'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'+_0x2bdbf0+'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</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'+_0x2bdbf0+'cancel-approve\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x22\x20id=\x22'+_0x2bdbf0+'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(_0x411a81={}){this['prefix']=_0x411a81['prefix']||'',this['onApprove']=_0x411a81['onApprove'],this['onSync']=_0x411a81['onSync'],this['onSuccess']=_0x411a81['onSuccess'],this['onError']=_0x411a81['onError'],this['onCreatePR']=_0x411a81['onCreatePR'],this['showToast']=_0x411a81['showToast']||(()=>{}),this['container']=_0x411a81['container']||document['body'],this['useTaskPageStyles']=_0x411a81['useTaskPageStyles']||![],this['baseUrl']=_0x411a81['baseUrl']||'',this['coderflowAttribution']=_0x411a81['coderflowAttribution'],this['onSyncToIbmi']=_0x411a81['onSyncToIbmi']||null,this['taskData']=null,this['initialized']=![],this['isSyncing']=![],this['_createPR']=![],this['_attributionRequestId']=0x0;}['init'](){if(this['initialized'])return;const _0x39d8c0=document['createElement']('div');_0x39d8c0['innerHTML']=createApproveDialogHTML(this['prefix'],{'useTaskPageStyles':this['useTaskPageStyles']}),this['container']['appendChild'](_0x39d8c0['firstElementChild']),this['_bindEvents'](),this['initialized']=!![];}['_el'](_0x525b41){return document['getElementById'](''+this['prefix']+_0x525b41);}['_bindEvents'](){const _0x4fc892=this['_el']('approve-modal'),_0x32546c=this['_el']('close-approve-modal'),_0x27d5cb=this['_el']('cancel-approve'),_0x1daa20=this['_el']('confirm-approve'),_0x4e5c4e=_0x4fc892?.['querySelector']('.modal-overlay'),_0x238af7=this['_el']('create-new-branch'),_0x293545=this['_el']('new-branch-input-container'),_0x2650b8=this['_el']('new-branch-name'),_0x42c500=this['_el']('push-after-commit'),_0x10f503=this['_el']('create-pull-request'),_0x51ac49=this['_el']('pr-hint');_0x32546c?.['addEventListener']('click',()=>this['hide']()),_0x27d5cb?.['addEventListener']('click',()=>this['hide']()),_0x4e5c4e?.['addEventListener']('click',()=>this['hide']()),_0x1daa20?.['addEventListener']('click',()=>this['_handleApprove']());_0x238af7&&_0x238af7['addEventListener']('change',()=>{_0x293545&&(_0x293545['hidden']=!_0x238af7['checked']),_0x238af7['checked']&&_0x2650b8&&_0x2650b8['focus']();});_0x10f503&&_0x42c500&&_0x238af7&&(_0x10f503['addEventListener']('change',()=>{this['_createPR']=_0x10f503['checked'];if(_0x10f503['checked']){_0x42c500['checked']=!![],_0x42c500['disabled']=!![],_0x238af7['checked']=!![],_0x238af7['disabled']=!![];_0x293545&&(_0x293545['hidden']=![]);if(_0x51ac49)_0x51ac49['hidden']=![];}else{_0x42c500['disabled']=![],_0x238af7['disabled']=![];if(_0x51ac49)_0x51ac49['hidden']=!![];}}),_0x42c500['addEventListener']('change',()=>{if(!_0x42c500['checked']&&_0x10f503['checked']){_0x10f503['checked']=![],this['_createPR']=![],_0x42c500['disabled']=![],_0x238af7['disabled']=![];if(_0x51ac49)_0x51ac49['hidden']=!![];}}));const _0x5d8f21=this['_el']('sync-to-ibmi');_0x5d8f21&&_0x5d8f21['addEventListener']('change',_0x4748d3=>{const _0x4485d1=this['_el']('ibmi-sync-library-row');if(_0x4485d1)_0x4485d1['hidden']=!_0x4748d3['target']['checked'];if(_0x4748d3['target']['checked']){const _0x62d24d=this['_el']('ibmi-sync-library'),_0xcf557e=localStorage['getItem']('coderflow_ibmi_sync_library');_0xcf557e&&_0x62d24d&&!_0x62d24d['value']&&(_0x62d24d['value']=_0xcf557e);}}),document['addEventListener']('keydown',_0x1bc4f9=>{_0x1bc4f9['key']==='Escape'&&_0x4fc892&&!_0x4fc892['hidden']&&this['hide']();});}['showError'](_0x366b0a){const _0xbddb91=this['_el']('approve-error'),_0x477722=this['_el']('approve-error-text');_0xbddb91&&_0x477722&&(_0x477722['textContent']=_0x366b0a,_0xbddb91['hidden']=![],_0xbddb91['scrollIntoView']({'behavior':'smooth','block':'nearest'}));}['hideError'](){const _0x42bf7b=this['_el']('approve-error'),_0xb287e1=this['_el']('approve-error-text');_0x42bf7b&&_0xb287e1&&(_0x42bf7b['hidden']=!![],_0xb287e1['textContent']='');}['_displayBranchInfo'](_0x4c61fb,_0x34fa62={}){const _0x1f577e=this['_el']('approve-branches');if(!_0x1f577e)return;const _0x33f61e=[];for(const _0x18dedd of _0x4c61fb){_0x34fa62[_0x18dedd['name']]&&_0x33f61e['push']({'repo':_0x18dedd['name'],'branch':_0x34fa62[_0x18dedd['name']]});}if(_0x33f61e['length']>0x0){_0x1f577e['hidden']=![];if(_0x33f61e['length']===0x1)_0x1f577e['innerHTML']='<div\x20class=\x22branch-info\x22>Branch:\x20<code>'+_0x33f61e[0x0]['branch']+'</code></div>';else{const _0x42944b=_0x33f61e['map'](_0x50a253=>'<div\x20class=\x22branch-item\x22><strong>'+_0x50a253['repo']+':</strong>\x20<code>'+_0x50a253['branch']+'</code></div>')['join']('');_0x1f577e['innerHTML']='<div\x20class=\x22branch-info\x22>Branches:<div\x20class=\x22branch-list\x22>'+_0x42944b+'</div></div>';}}else _0x1f577e['hidden']=!![],_0x1f577e['innerHTML']='';}['showWarning'](_0x247988){const _0x181b15=this['_el']('approve-warning'),_0x2bc9ee=this['_el']('approve-warning-text');_0x181b15&&_0x2bc9ee&&(_0x2bc9ee['textContent']=_0x247988,_0x181b15['hidden']=![]);}['hideWarning'](){const _0x32aa83=this['_el']('approve-warning'),_0x17129b=this['_el']('approve-warning-text');_0x32aa83&&_0x17129b&&(_0x32aa83['hidden']=!![],_0x17129b['textContent']='');}['_stripCoAuthoredByLines'](_0x480836){return _0x480836['replace'](/^Co-Authored-By:.*$/gmi,'')['replace'](/^Learn more: https:\/\/coderflow\.ai\s*$/gm,'')['replace'](/\n{3,}/g,'\x0a\x0a')['trim']();}async['_addAttributionIfEnabled'](_0x447266){try{let _0x3d7550;try{const _0x4b2d14=await fetch(this['baseUrl']+'/settings');if(_0x4b2d14['ok']){const _0x3d5025=await _0x4b2d14['json']();_0x3d7550=_0x3d5025['coderflow_attribution']!==![];}}catch(_0x46fab0){}_0x3d7550===undefined&&(this['coderflowAttribution']!==undefined?_0x3d7550=this['coderflowAttribution']!==![]:_0x3d7550=!![]);const _0xa96fe9=this['_stripCoAuthoredByLines'](_0x447266);if(!_0x3d7550)return _0xa96fe9;const _0x57c021='\x0a\x0aCo-Authored-By:\x20CoderFlow\x20<ai@coderflow.ai>\x0aLearn\x20more:\x20https://coderflow.ai';return _0xa96fe9+_0x57c021;}catch(_0x111448){return console['warn']('Failed\x20to\x20add\x20CoderFlow\x20attribution:',_0x111448),_0x447266;}}['show'](_0x4e9471){!this['initialized']&&this['init']();this['taskData']=_0x4e9471;const _0x190b9a=this['_el']('approve-modal'),_0x24ee19=this['_el']('commit-message-input'),_0x5a6324=this['_el']('pull-before-commit'),_0x4ef27a=this['_el']('push-after-commit'),_0x73676c=this['_el']('create-new-branch'),_0x2679f1=this['_el']('new-branch-input-container'),_0x599ced=this['_el']('new-branch-name'),_0x4e47a1=this['_el']('approve-repo-name'),_0x1c98c3=this['_el']('approve-stats'),_0x395ca4=this['_el']('multi-repo-note');if(!_0x190b9a)return;this['hideError'](),this['hideWarning']();_0x4e9471['warning']&&this['showWarning'](_0x4e9471['warning']);const _0x187ba4=_0x4e9471['reposChanged']||[];if(_0x187ba4['length']===0x0&&!_0x4e9471['syncFirst']){this['showToast']('No\x20changes\x20to\x20approve','error');return;}this['_updateDisplay'](_0x187ba4,_0x4e9471);const _0x2505d1=_0x4e9471['commitMessage']||'',_0x4a11c9=this['_stripCoAuthoredByLines'](_0x2505d1);_0x24ee19['value']=_0x4a11c9;if(_0x5a6324)_0x5a6324['checked']=!![];if(_0x4ef27a)_0x4ef27a['checked']=!![];_0x73676c&&(_0x73676c['checked']=![]);_0x2679f1&&(_0x2679f1['hidden']=!![]);_0x599ced&&(_0x599ced['value']='');if(_0x4ef27a)_0x4ef27a['disabled']=![];if(_0x73676c)_0x73676c['disabled']=![];this['updatePRSupport'](_0x4e9471['prSupported']===!![]);const _0x1288de=this['_el']('ibmi-sync-section');if(_0x1288de){_0x1288de['hidden']=!_0x4e9471['ibmiSyncAvailable'];const _0x188f61=this['_el']('sync-to-ibmi'),_0x14efc8=this['_el']('ibmi-sync-library-row'),_0x24233e=this['_el']('ibmi-sync-library');if(_0x188f61)_0x188f61['checked']=![];if(_0x14efc8)_0x14efc8['hidden']=!![];if(_0x24233e)_0x24233e['value']='';}const _0x251474=this['_el']('confirm-approve');_0x4e9471['syncFirst']&&this['onSync']?(_0x251474&&(_0x251474['disabled']=!![],_0x251474['textContent']='Syncing...'),this['_performSync']()):_0x251474&&(_0x251474['disabled']=![],_0x251474['textContent']='Commit\x20Changes');_0x190b9a['hidden']=![];const _0x3b264f=++this['_attributionRequestId'];void this['_applyAttributionAsync']({'requestId':_0x3b264f,'taskId':_0x4e9471['taskId'],'originalCommitMessage':_0x4a11c9}),setTimeout(()=>{_0x24ee19['focus'](),_0x24ee19['setSelectionRange'](0x0,_0x24ee19['value']['length']);},0x64);}['updatePRSupport'](_0x569fbd){const _0x4c8563=this['_el']('pr-option-section'),_0xe1ad21=this['_el']('create-pull-request'),_0x2245da=this['_el']('pr-hint'),_0x5c085d=this['_el']('push-after-commit'),_0x48ab49=this['_el']('create-new-branch');if(!_0x4c8563)return;if(_0x569fbd){_0x4c8563['hidden']=![];_0xe1ad21&&!_0xe1ad21['disabled']&&(_0xe1ad21['checked']=![]);if(_0x2245da)_0x2245da['hidden']=!![];this['_createPR']=![];return;}_0xe1ad21?.['checked']&&(_0xe1ad21['checked']=![]);if(_0x2245da)_0x2245da['hidden']=!![];if(_0x5c085d)_0x5c085d['disabled']=![];if(_0x48ab49)_0x48ab49['disabled']=![];this['_createPR']=![],_0x4c8563['hidden']=!![];}async['_applyAttributionAsync']({requestId:_0x595e15,taskId:_0x23d927,originalCommitMessage:_0x1179fe}){const _0x30834d=this['_el']('commit-message-input');if(!_0x30834d)return;const _0x4ceff0=await this['_addAttributionIfEnabled'](_0x1179fe);if(_0x595e15!==this['_attributionRequestId'])return;if(!this['taskData']||this['taskData']['taskId']!==_0x23d927)return;if(!this['isVisible']())return;const _0x216f5e=_0x3248f5=>_0x3248f5['replace'](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a');if(_0x216f5e(_0x30834d['value'])!==_0x216f5e(_0x1179fe))return;_0x30834d['value']=_0x4ceff0;}['_updateDisplay'](_0x24bba1,_0x32bdaa){const _0x5e587a=this['_el']('approve-repo-name'),_0x1f3d25=this['_el']('approve-stats'),_0x19898c=this['_el']('multi-repo-note');if(_0x24bba1['length']===0x0){if(_0x5e587a)_0x5e587a['textContent']='Syncing...';if(_0x1f3d25)_0x1f3d25['textContent']='';if(_0x19898c)_0x19898c['hidden']=!![];return;}const _0x46c187=_0x24bba1['reduce']((_0x4bb14f,_0x24c55e)=>_0x4bb14f+(_0x24c55e['files_changed']||0x0),0x0),_0x354966=_0x24bba1['reduce']((_0x495eeb,_0x8c41fc)=>_0x495eeb+(_0x8c41fc['lines_added']||0x0),0x0),_0x3bf256=_0x24bba1['reduce']((_0x27255e,_0x460e96)=>_0x27255e+(_0x460e96['lines_deleted']||0x0),0x0);if(_0x24bba1['length']===0x1){if(_0x5e587a)_0x5e587a['textContent']=_0x24bba1[0x0]?.['name']||'repository';if(_0x19898c)_0x19898c['hidden']=!![];}else{const _0x599b36=_0x24bba1['map'](_0x5e5ce8=>_0x5e5ce8['name'])['join'](',\x20');if(_0x5e587a)_0x5e587a['textContent']=_0x24bba1['length']+'\x20repositories:\x20'+_0x599b36;if(_0x19898c)_0x19898c['hidden']=![];}_0x1f3d25&&(_0x1f3d25['textContent']=_0x46c187+'\x20file'+(_0x46c187===0x1?'':'s')+'\x20changed\x20(+'+_0x354966+'\x20-'+_0x3bf256+')'),this['_displayBranchInfo'](_0x24bba1,_0x32bdaa?.['branches']||{});}async['_performSync'](){if(!this['onSync']||this['isSyncing'])return;this['isSyncing']=!![];const _0x44d0b2=this['_el']('confirm-approve');try{const _0x511445=await this['onSync'](this['taskData']['taskId']);if(!this['isVisible']()){this['isSyncing']=![];return;}if(_0x511445['repos_changed']){const _0x5cf7f=this['taskData']['reposChanged']?.['length']||0x0,_0x3f8e4a=this['taskData']['reposChanged']?.['reduce']((_0x1951d8,_0x326e34)=>_0x1951d8+(_0x326e34['files_changed']||0x0),0x0)||0x0;this['taskData']['reposChanged']=_0x511445['repos_changed'],this['_updateDisplay'](_0x511445['repos_changed'],this['taskData']);const _0x181c9b=_0x511445['repos_changed']['length'],_0x56702b=_0x511445['repos_changed']['reduce']((_0x2da276,_0x5a65f4)=>_0x2da276+(_0x5a65f4['files_changed']||0x0),0x0);(_0x56702b>_0x3f8e4a||_0x181c9b>_0x5cf7f)&&this['showWarning'](this['taskData']['warning']?this['taskData']['warning']+'\x20Additional\x20changes\x20detected\x20since\x20last\x20sync.':'Additional\x20changes\x20detected\x20since\x20last\x20sync.\x20Review\x20the\x20updated\x20file\x20list.');}_0x44d0b2&&(!this['taskData']['reposChanged']||this['taskData']['reposChanged']['length']===0x0?(_0x44d0b2['disabled']=!![],_0x44d0b2['textContent']='No\x20Changes',this['showError']('No\x20changes\x20to\x20approve\x20after\x20sync')):(_0x44d0b2['disabled']=![],_0x44d0b2['textContent']='Commit\x20Changes'));}catch(_0x4f5b8f){console['error']('Failed\x20to\x20sync\x20repos\x20before\x20approve:',_0x4f5b8f);if(!this['isVisible']()){this['isSyncing']=![];return;}this['showError']('Sync\x20failed:\x20'+_0x4f5b8f['message']+'.\x20You\x20can\x20still\x20commit\x20with\x20existing\x20staged\x20changes.'),_0x44d0b2&&(this['taskData']['reposChanged']&&this['taskData']['reposChanged']['length']>0x0?(_0x44d0b2['disabled']=![],_0x44d0b2['textContent']='Commit\x20Changes'):(_0x44d0b2['disabled']=!![],_0x44d0b2['textContent']='No\x20Changes'));}finally{this['isSyncing']=![];}}['hide'](){const _0x12250f=this['_el']('approve-modal');_0x12250f&&(_0x12250f['hidden']=!![]);}async['_handleApprove'](){const _0x5ad562=this['_el']('commit-message-input'),_0x243bb1=this['_el']('pull-before-commit'),_0x2a7e9a=this['_el']('push-after-commit'),_0x33706e=this['_el']('create-new-branch'),_0x21a63e=this['_el']('new-branch-name'),_0x7d30a9=this['_el']('confirm-approve'),_0xeb5ec7=_0x5ad562['value']['trim'](),_0x39130f=_0x243bb1?.['checked']??!![],_0x92288b=_0x2a7e9a?.['checked']??!![],_0x5d8782=_0x33706e?.['checked']||![],_0x572e4f=_0x21a63e?.['value']['trim']()||'';this['hideError']();if(!_0xeb5ec7){this['showError']('Commit\x20message\x20is\x20required'),_0x5ad562['focus']();return;}if(_0x5d8782&&!_0x572e4f){this['showError']('Branch\x20name\x20is\x20required\x20when\x20creating\x20a\x20new\x20branch'),_0x21a63e?.['focus']();return;}if(_0x5d8782&&_0x572e4f){const _0x50b632=/[\s~^:?*\[\\]/;if(_0x50b632['test'](_0x572e4f)){this['showError']('Invalid\x20branch\x20name.\x20Avoid\x20spaces\x20and\x20special\x20characters\x20like\x20~\x20^\x20:\x20?\x20*\x20[\x20\x5c'),_0x21a63e?.['focus']();return;}}const _0x482e6d=this['_el']('sync-to-ibmi')?.['checked'];if(_0x482e6d){const _0x1ab691=this['_el']('ibmi-sync-library')?.['value']?.['trim']();if(!_0x1ab691){this['showError']('IBM\x20i\x20library\x20name\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-library')?.['focus']();return;}}const _0x27f7a6=_0x7d30a9?.['textContent']||'Commit\x20Changes';_0x7d30a9&&(_0x7d30a9['disabled']=!![],_0x5d8782?_0x7d30a9['textContent']='Creating\x20branch\x20&\x20committing...':_0x7d30a9['textContent']=_0x39130f?'Pulling\x20&\x20Committing...':'Committing...');try{const _0x102079={'commit_message':_0xeb5ec7,'pull':_0x39130f,'push':_0x92288b};_0x5d8782&&_0x572e4f&&(_0x102079['new_branch']=_0x572e4f);let _0x3fdceb=null;this['onApprove']&&(_0x3fdceb=await this['onApprove'](this['taskData']['taskId'],_0x102079));let _0x2700ea='Changes\x20committed';if(_0x5d8782)_0x2700ea='Changes\x20committed\x20to\x20new\x20branch\x20\x27'+_0x572e4f+'\x27',_0x92288b&&(_0x2700ea+='\x20and\x20pushed');else{if(_0x39130f&&_0x92288b)_0x2700ea='Changes\x20pulled,\x20committed,\x20and\x20pushed';else{if(_0x39130f)_0x2700ea='Changes\x20pulled\x20and\x20committed';else _0x92288b&&(_0x2700ea='Changes\x20committed\x20and\x20pushed');}}this['showToast'](_0x2700ea,'success'),this['hide']();this['_createPR']&&this['onCreatePR']&&this['onCreatePR'](this['taskData']['taskId'],_0x3fdceb||{});const _0x330305=this['_el']('sync-to-ibmi')?.['checked'];if(_0x330305&&this['onSyncToIbmi']){const _0x282c02=this['_el']('ibmi-sync-library')?.['value']?.['trim']()?.['toUpperCase']();if(_0x282c02){localStorage['setItem']('coderflow_ibmi_sync_library',_0x282c02);try{await this['onSyncToIbmi'](this['taskData']['taskId'],_0x282c02);}catch(_0x347b88){this['showToast']('Sync\x20failed:\x20'+_0x347b88['message'],'error');}}}this['onSuccess']&&this['onSuccess'](this['taskData']);}catch(_0x6eb039){console['error']('Failed\x20to\x20approve\x20changes',_0x6eb039),this['showError']('Failed\x20to\x20commit:\x20'+_0x6eb039['message']),_0x7d30a9&&(_0x7d30a9['disabled']=![],_0x7d30a9['textContent']=_0x27f7a6),this['onError']&&this['onError'](_0x6eb039);}}['isVisible'](){const _0x538cc8=this['_el']('approve-modal');return _0x538cc8&&!_0x538cc8['hidden'];}['destroy'](){const _0x153190=this['_el']('approve-modal');_0x153190&&_0x153190['remove'](),this['initialized']=![];}}export function getApproveState(_0x1337f1,_0x5807b3){if(!_0x1337f1)return{'canApprove':![],'reason':'No\x20task\x20data'};if(isLogOnlyTaskType(_0x1337f1['taskType']))return{'canApprove':![],'reason':(_0x1337f1['taskType']==='test'?'Test':'Deploy')+'\x20tasks\x20cannot\x20be\x20approved'};const _0xd096c4=_0x5807b3?.['repos_changed']?.['length']>0x0,_0xdcd068=_0x1337f1['status']==='completed'||_0x1337f1['status']==='failed'||_0x1337f1['status']==='interrupted',_0x1aad0d=_0x1337f1['containerState']==='running',_0x3b11b6=_0x1337f1['approvedBy']!==undefined&&_0x1337f1['approvedBy']!==null;if(_0x3b11b6){const _0x5da413=_0x1337f1['approvedBy']['name']||_0x1337f1['approvedBy']['username']||'user';return{'canApprove':![],'reason':'Already\x20approved\x20by\x20'+_0x5da413};}if(!_0xd096c4)return{'canApprove':![],'reason':'No\x20changes\x20to\x20approve'};if(!_0xdcd068)return{'canApprove':![],'reason':'Task\x20must\x20complete\x20first'};if(!_0x1337f1['containerId'])return{'canApprove':![],'reason':'Container\x20no\x20longer\x20available'};if(!_0x1aad0d)return{'canApprove':![],'reason':'Container\x20is\x20not\x20running'};return{'canApprove':!![],'reason':'Ready\x20to\x20approve'};}
|
|
1
|
+
function isLogOnlyTaskType(_0x4ad367){return _0x4ad367==='test'||_0x4ad367==='deploy';}export function createApproveDialogHTML(_0x2467de='',_0x2ac310={}){const _0x141467=_0x2467de,_0x217c5d=_0x2ac310['useTaskPageStyles']?'modal\x20profound-approve-modal':'profound-feedback-modal\x20profound-approve-modal',_0x3d1696=_0x2ac310['useTaskPageStyles']?'modal-warning':'approve-modal-warning',_0x51deb2=_0x2ac310['useTaskPageStyles']?'modal-error':'approve-modal-error';return'\x0a\x20\x20\x20\x20<div\x20id=\x22'+_0x141467+'approve-modal\x22\x20class=\x22'+_0x217c5d+'\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'+_0x141467+'close-approve-modal\x22>×</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'+_0x141467+'approve-warning\x22\x20class=\x22'+_0x3d1696+'\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'+_0x141467+'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'+_0x141467+'approve-error\x22\x20class=\x22'+_0x51deb2+'\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'+_0x141467+'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\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'+_0x141467+'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'+_0x141467+'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'+_0x141467+'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'+_0x141467+'commit-message-input\x22>Commit\x20message:</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<textarea\x20id=\x22'+_0x141467+'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'+_0x141467+'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'+_0x141467+'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\x20(rebase)</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'+_0x141467+'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'+_0x141467+'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'+_0x141467+'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'+_0x141467+'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'+_0x141467+'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'+_0x141467+'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'+_0x141467+'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'+_0x141467+'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'+_0x141467+'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'+_0x141467+'ibmi-sync-library-row\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'+_0x141467+'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'+_0x141467+'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</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'+_0x141467+'cancel-approve\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x22\x20id=\x22'+_0x141467+'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(_0x662c9f={}){this['prefix']=_0x662c9f['prefix']||'',this['onApprove']=_0x662c9f['onApprove'],this['onSync']=_0x662c9f['onSync'],this['onSuccess']=_0x662c9f['onSuccess'],this['onError']=_0x662c9f['onError'],this['onCreatePR']=_0x662c9f['onCreatePR'],this['showToast']=_0x662c9f['showToast']||(()=>{}),this['container']=_0x662c9f['container']||document['body'],this['useTaskPageStyles']=_0x662c9f['useTaskPageStyles']||![],this['baseUrl']=_0x662c9f['baseUrl']||'',this['coderflowAttribution']=_0x662c9f['coderflowAttribution'],this['onSyncToIbmi']=_0x662c9f['onSyncToIbmi']||null,this['taskData']=null,this['initialized']=![],this['isSyncing']=![],this['_createPR']=![],this['_attributionRequestId']=0x0;}['init'](){if(this['initialized'])return;const _0x34ea08=document['createElement']('div');_0x34ea08['innerHTML']=createApproveDialogHTML(this['prefix'],{'useTaskPageStyles':this['useTaskPageStyles']}),this['container']['appendChild'](_0x34ea08['firstElementChild']),this['_bindEvents'](),this['initialized']=!![];}['_el'](_0x4c7718){return document['getElementById'](''+this['prefix']+_0x4c7718);}['_bindEvents'](){const _0x5edaba=this['_el']('approve-modal'),_0x44ef8d=this['_el']('close-approve-modal'),_0x1325ba=this['_el']('cancel-approve'),_0x3d395c=this['_el']('confirm-approve'),_0x1aedf7=_0x5edaba?.['querySelector']('.modal-overlay'),_0x2ce572=this['_el']('create-new-branch'),_0x21fb0b=this['_el']('new-branch-input-container'),_0x5db4d7=this['_el']('new-branch-name'),_0x257af0=this['_el']('push-after-commit'),_0x37906b=this['_el']('create-pull-request'),_0x443e49=this['_el']('pr-hint');_0x44ef8d?.['addEventListener']('click',()=>this['hide']()),_0x1325ba?.['addEventListener']('click',()=>this['hide']()),_0x1aedf7?.['addEventListener']('click',()=>this['hide']()),_0x3d395c?.['addEventListener']('click',()=>this['_handleApprove']());_0x2ce572&&_0x2ce572['addEventListener']('change',()=>{_0x21fb0b&&(_0x21fb0b['hidden']=!_0x2ce572['checked']),_0x2ce572['checked']&&_0x5db4d7&&_0x5db4d7['focus']();});_0x37906b&&_0x257af0&&_0x2ce572&&(_0x37906b['addEventListener']('change',()=>{this['_createPR']=_0x37906b['checked'];if(_0x37906b['checked']){_0x257af0['checked']=!![],_0x257af0['disabled']=!![],_0x2ce572['checked']=!![],_0x2ce572['disabled']=!![];_0x21fb0b&&(_0x21fb0b['hidden']=![]);if(_0x443e49)_0x443e49['hidden']=![];}else{_0x257af0['disabled']=![],_0x2ce572['disabled']=![];if(_0x443e49)_0x443e49['hidden']=!![];}}),_0x257af0['addEventListener']('change',()=>{if(!_0x257af0['checked']&&_0x37906b['checked']){_0x37906b['checked']=![],this['_createPR']=![],_0x257af0['disabled']=![],_0x2ce572['disabled']=![];if(_0x443e49)_0x443e49['hidden']=!![];}}));const _0x32e680=this['_el']('sync-to-ibmi');_0x32e680&&_0x32e680['addEventListener']('change',_0x3d20ff=>{const _0x8db57d=this['_el']('ibmi-sync-library-row');if(_0x8db57d)_0x8db57d['hidden']=!_0x3d20ff['target']['checked'];if(_0x3d20ff['target']['checked']){const _0x7e4c6f=this['_el']('ibmi-sync-library'),_0x5356ef=localStorage['getItem']('coderflow_ibmi_sync_library');_0x5356ef&&_0x7e4c6f&&!_0x7e4c6f['value']&&(_0x7e4c6f['value']=_0x5356ef);}}),document['addEventListener']('keydown',_0x9ac6cc=>{_0x9ac6cc['key']==='Escape'&&_0x5edaba&&!_0x5edaba['hidden']&&this['hide']();});}['showError'](_0x397a05){const _0x127fd9=this['_el']('approve-error'),_0xef3447=this['_el']('approve-error-text');_0x127fd9&&_0xef3447&&(_0xef3447['textContent']=_0x397a05,_0x127fd9['hidden']=![],_0x127fd9['scrollIntoView']({'behavior':'smooth','block':'nearest'}));}['hideError'](){const _0x10fd24=this['_el']('approve-error'),_0x407b05=this['_el']('approve-error-text');_0x10fd24&&_0x407b05&&(_0x10fd24['hidden']=!![],_0x407b05['textContent']='');}['_displayBranchInfo'](_0x3c34c2,_0x5c1f91={}){const _0x122259=this['_el']('approve-branches');if(!_0x122259)return;const _0x4e5442=[];for(const _0x5f440b of _0x3c34c2){_0x5c1f91[_0x5f440b['name']]&&_0x4e5442['push']({'repo':_0x5f440b['name'],'branch':_0x5c1f91[_0x5f440b['name']]});}if(_0x4e5442['length']>0x0){_0x122259['hidden']=![];if(_0x4e5442['length']===0x1)_0x122259['innerHTML']='<div\x20class=\x22branch-info\x22>Branch:\x20<code>'+_0x4e5442[0x0]['branch']+'</code></div>';else{const _0x4ca5ca=_0x4e5442['map'](_0x109296=>'<div\x20class=\x22branch-item\x22><strong>'+_0x109296['repo']+':</strong>\x20<code>'+_0x109296['branch']+'</code></div>')['join']('');_0x122259['innerHTML']='<div\x20class=\x22branch-info\x22>Branches:<div\x20class=\x22branch-list\x22>'+_0x4ca5ca+'</div></div>';}}else _0x122259['hidden']=!![],_0x122259['innerHTML']='';}['showWarning'](_0x2ed012){const _0x460f90=this['_el']('approve-warning'),_0x451b2c=this['_el']('approve-warning-text');_0x460f90&&_0x451b2c&&(_0x451b2c['textContent']=_0x2ed012,_0x460f90['hidden']=![]);}['hideWarning'](){const _0x38bac6=this['_el']('approve-warning'),_0xc006ee=this['_el']('approve-warning-text');_0x38bac6&&_0xc006ee&&(_0x38bac6['hidden']=!![],_0xc006ee['textContent']='');}['_stripCoAuthoredByLines'](_0x51cbfd){return _0x51cbfd['replace'](/^Co-Authored-By:.*$/gmi,'')['replace'](/^Learn more: https:\/\/coderflow\.ai\s*$/gm,'')['replace'](/\n{3,}/g,'\x0a\x0a')['trim']();}async['_addAttributionIfEnabled'](_0x444999){try{let _0x68fd18;try{const _0x28fadf=await fetch(this['baseUrl']+'/settings');if(_0x28fadf['ok']){const _0x3543b1=await _0x28fadf['json']();_0x68fd18=_0x3543b1['coderflow_attribution']!==![];}}catch(_0x538999){}_0x68fd18===undefined&&(this['coderflowAttribution']!==undefined?_0x68fd18=this['coderflowAttribution']!==![]:_0x68fd18=!![]);const _0x5241a4=this['_stripCoAuthoredByLines'](_0x444999);if(!_0x68fd18)return _0x5241a4;const _0x3c7b01='\x0a\x0aCo-Authored-By:\x20CoderFlow\x20<ai@coderflow.ai>\x0aLearn\x20more:\x20https://coderflow.ai';return _0x5241a4+_0x3c7b01;}catch(_0x49a502){return console['warn']('Failed\x20to\x20add\x20CoderFlow\x20attribution:',_0x49a502),_0x444999;}}['show'](_0x447548){!this['initialized']&&this['init']();this['taskData']=_0x447548;const _0x4d1b0f=this['_el']('approve-modal'),_0x5126c0=this['_el']('commit-message-input'),_0x4b7009=this['_el']('pull-before-commit'),_0x42887e=this['_el']('push-after-commit'),_0x21f127=this['_el']('create-new-branch'),_0x112292=this['_el']('new-branch-input-container'),_0x54276d=this['_el']('new-branch-name'),_0x171a4a=this['_el']('approve-repo-name'),_0x54f5dc=this['_el']('approve-stats'),_0x252809=this['_el']('multi-repo-note');if(!_0x4d1b0f)return;this['hideError'](),this['hideWarning']();_0x447548['warning']&&this['showWarning'](_0x447548['warning']);const _0x403ce8=_0x447548['reposChanged']||[];if(_0x403ce8['length']===0x0&&!_0x447548['syncFirst']){this['showToast']('No\x20changes\x20to\x20approve','error');return;}this['_updateDisplay'](_0x403ce8,_0x447548);const _0x31082b=_0x447548['commitMessage']||'',_0x2091e9=this['_stripCoAuthoredByLines'](_0x31082b);_0x5126c0['value']=_0x2091e9;if(_0x4b7009)_0x4b7009['checked']=!![];if(_0x42887e)_0x42887e['checked']=!![];_0x21f127&&(_0x21f127['checked']=![]);_0x112292&&(_0x112292['hidden']=!![]);_0x54276d&&(_0x54276d['value']='');if(_0x42887e)_0x42887e['disabled']=![];if(_0x21f127)_0x21f127['disabled']=![];this['updatePRSupport'](_0x447548['prSupported']===!![]);const _0xc4768c=this['_el']('ibmi-sync-section');if(_0xc4768c){_0xc4768c['hidden']=!_0x447548['ibmiSyncAvailable'];const _0x439776=this['_el']('sync-to-ibmi'),_0x12c75c=this['_el']('ibmi-sync-library-row'),_0x16c921=this['_el']('ibmi-sync-library');if(_0x439776)_0x439776['checked']=![];if(_0x12c75c)_0x12c75c['hidden']=!![];if(_0x16c921)_0x16c921['value']='';}const _0x40fe55=this['_el']('confirm-approve');_0x447548['syncFirst']&&this['onSync']?(_0x40fe55&&(_0x40fe55['disabled']=!![],_0x40fe55['textContent']='Syncing...'),this['_performSync']()):_0x40fe55&&(_0x40fe55['disabled']=![],_0x40fe55['textContent']='Commit\x20Changes');_0x4d1b0f['hidden']=![];const _0xbde455=++this['_attributionRequestId'];void this['_applyAttributionAsync']({'requestId':_0xbde455,'taskId':_0x447548['taskId'],'originalCommitMessage':_0x2091e9}),setTimeout(()=>{_0x5126c0['focus'](),_0x5126c0['setSelectionRange'](0x0,_0x5126c0['value']['length']);},0x64);}['updatePRSupport'](_0x1de91a){const _0x4f136e=this['_el']('pr-option-section'),_0x43c8ee=this['_el']('create-pull-request'),_0x329420=this['_el']('pr-hint'),_0x8b28df=this['_el']('push-after-commit'),_0x309cb2=this['_el']('create-new-branch');if(!_0x4f136e)return;if(_0x1de91a){_0x4f136e['hidden']=![];_0x43c8ee&&!_0x43c8ee['disabled']&&(_0x43c8ee['checked']=![]);if(_0x329420)_0x329420['hidden']=!![];this['_createPR']=![];return;}_0x43c8ee?.['checked']&&(_0x43c8ee['checked']=![]);if(_0x329420)_0x329420['hidden']=!![];if(_0x8b28df)_0x8b28df['disabled']=![];if(_0x309cb2)_0x309cb2['disabled']=![];this['_createPR']=![],_0x4f136e['hidden']=!![];}async['_applyAttributionAsync']({requestId:_0x18cf69,taskId:_0x2be6fe,originalCommitMessage:_0xe185b}){const _0x57a304=this['_el']('commit-message-input');if(!_0x57a304)return;const _0x2271b3=await this['_addAttributionIfEnabled'](_0xe185b);if(_0x18cf69!==this['_attributionRequestId'])return;if(!this['taskData']||this['taskData']['taskId']!==_0x2be6fe)return;if(!this['isVisible']())return;const _0x188b51=_0x3dd489=>_0x3dd489['replace'](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a');if(_0x188b51(_0x57a304['value'])!==_0x188b51(_0xe185b))return;_0x57a304['value']=_0x2271b3;}['_updateDisplay'](_0x311ae9,_0x3e71ed){const _0xddf20e=this['_el']('approve-repo-name'),_0x50f0cb=this['_el']('approve-stats'),_0x2e29bb=this['_el']('multi-repo-note');if(_0x311ae9['length']===0x0){if(_0xddf20e)_0xddf20e['textContent']='Syncing...';if(_0x50f0cb)_0x50f0cb['textContent']='';if(_0x2e29bb)_0x2e29bb['hidden']=!![];return;}const _0x4158ad=_0x311ae9['reduce']((_0x1b7a7a,_0x51b87b)=>_0x1b7a7a+(_0x51b87b['files_changed']||0x0),0x0),_0x64244c=_0x311ae9['reduce']((_0x39e81f,_0x4462c5)=>_0x39e81f+(_0x4462c5['lines_added']||0x0),0x0),_0x37ee69=_0x311ae9['reduce']((_0x33f161,_0x50195a)=>_0x33f161+(_0x50195a['lines_deleted']||0x0),0x0);if(_0x311ae9['length']===0x1){if(_0xddf20e)_0xddf20e['textContent']=_0x311ae9[0x0]?.['name']||'repository';if(_0x2e29bb)_0x2e29bb['hidden']=!![];}else{const _0x53533a=_0x311ae9['map'](_0x178515=>_0x178515['name'])['join'](',\x20');if(_0xddf20e)_0xddf20e['textContent']=_0x311ae9['length']+'\x20repositories:\x20'+_0x53533a;if(_0x2e29bb)_0x2e29bb['hidden']=![];}_0x50f0cb&&(_0x50f0cb['textContent']=_0x4158ad+'\x20file'+(_0x4158ad===0x1?'':'s')+'\x20changed\x20(+'+_0x64244c+'\x20-'+_0x37ee69+')'),this['_displayBranchInfo'](_0x311ae9,_0x3e71ed?.['branches']||{});}async['_performSync'](){if(!this['onSync']||this['isSyncing'])return;this['isSyncing']=!![];const _0x15e69e=this['_el']('confirm-approve');try{const _0xff5339=await this['onSync'](this['taskData']['taskId']);if(!this['isVisible']()){this['isSyncing']=![];return;}if(_0xff5339['repos_changed']){const _0x3b05d3=this['taskData']['reposChanged']?.['length']||0x0,_0x1310fe=this['taskData']['reposChanged']?.['reduce']((_0x138fc1,_0x3e8265)=>_0x138fc1+(_0x3e8265['files_changed']||0x0),0x0)||0x0;this['taskData']['reposChanged']=_0xff5339['repos_changed'],this['_updateDisplay'](_0xff5339['repos_changed'],this['taskData']);const _0x25eec5=_0xff5339['repos_changed']['length'],_0x298287=_0xff5339['repos_changed']['reduce']((_0x28efad,_0x353adb)=>_0x28efad+(_0x353adb['files_changed']||0x0),0x0);(_0x298287>_0x1310fe||_0x25eec5>_0x3b05d3)&&this['showWarning'](this['taskData']['warning']?this['taskData']['warning']+'\x20Additional\x20changes\x20detected\x20since\x20last\x20sync.':'Additional\x20changes\x20detected\x20since\x20last\x20sync.\x20Review\x20the\x20updated\x20file\x20list.');}_0x15e69e&&(!this['taskData']['reposChanged']||this['taskData']['reposChanged']['length']===0x0?(_0x15e69e['disabled']=!![],_0x15e69e['textContent']='No\x20Changes',this['showError']('No\x20changes\x20to\x20approve\x20after\x20sync')):(_0x15e69e['disabled']=![],_0x15e69e['textContent']='Commit\x20Changes'));}catch(_0x27a482){console['error']('Failed\x20to\x20sync\x20repos\x20before\x20approve:',_0x27a482);if(!this['isVisible']()){this['isSyncing']=![];return;}this['showError']('Sync\x20failed:\x20'+_0x27a482['message']+'.\x20You\x20can\x20still\x20commit\x20with\x20existing\x20staged\x20changes.'),_0x15e69e&&(this['taskData']['reposChanged']&&this['taskData']['reposChanged']['length']>0x0?(_0x15e69e['disabled']=![],_0x15e69e['textContent']='Commit\x20Changes'):(_0x15e69e['disabled']=!![],_0x15e69e['textContent']='No\x20Changes'));}finally{this['isSyncing']=![];}}['hide'](){const _0x5d9f39=this['_el']('approve-modal');_0x5d9f39&&(_0x5d9f39['hidden']=!![]);}async['_handleApprove'](){const _0x5a8827=this['_el']('commit-message-input'),_0x2f9b31=this['_el']('pull-before-commit'),_0x423c54=this['_el']('push-after-commit'),_0x5ca1a4=this['_el']('create-new-branch'),_0x2c6722=this['_el']('new-branch-name'),_0x1ff085=this['_el']('confirm-approve'),_0x4f91c3=_0x5a8827['value']['trim'](),_0x5a093f=_0x2f9b31?.['checked']??!![],_0x3a452f=_0x423c54?.['checked']??!![],_0x2debed=_0x5ca1a4?.['checked']||![],_0x5649db=_0x2c6722?.['value']['trim']()||'';this['hideError']();if(!_0x4f91c3){this['showError']('Commit\x20message\x20is\x20required'),_0x5a8827['focus']();return;}if(_0x2debed&&!_0x5649db){this['showError']('Branch\x20name\x20is\x20required\x20when\x20creating\x20a\x20new\x20branch'),_0x2c6722?.['focus']();return;}if(_0x2debed&&_0x5649db){const _0x15f4a6=/[\s~^:?*\[\\]/;if(_0x15f4a6['test'](_0x5649db)){this['showError']('Invalid\x20branch\x20name.\x20Avoid\x20spaces\x20and\x20special\x20characters\x20like\x20~\x20^\x20:\x20?\x20*\x20[\x20\x5c'),_0x2c6722?.['focus']();return;}}const _0x15b0a8=this['_el']('sync-to-ibmi')?.['checked'];if(_0x15b0a8){const _0x4f2f20=this['_el']('ibmi-sync-library')?.['value']?.['trim']();if(!_0x4f2f20){this['showError']('IBM\x20i\x20library\x20name\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-library')?.['focus']();return;}}const _0x5a8eab=_0x1ff085?.['textContent']||'Commit\x20Changes';_0x1ff085&&(_0x1ff085['disabled']=!![],_0x2debed?_0x1ff085['textContent']='Creating\x20branch\x20&\x20committing...':_0x1ff085['textContent']=_0x5a093f?'Pulling\x20&\x20Committing...':'Committing...');try{const _0x2ed6a8={'commit_message':_0x4f91c3,'pull':_0x5a093f,'push':_0x3a452f};_0x2debed&&_0x5649db&&(_0x2ed6a8['new_branch']=_0x5649db);let _0x2d877f=null;this['onApprove']&&(_0x2d877f=await this['onApprove'](this['taskData']['taskId'],_0x2ed6a8));let _0x42172c='Changes\x20committed';if(_0x2debed)_0x42172c='Changes\x20committed\x20to\x20new\x20branch\x20\x27'+_0x5649db+'\x27',_0x3a452f&&(_0x42172c+='\x20and\x20pushed');else{if(_0x5a093f&&_0x3a452f)_0x42172c='Changes\x20pulled,\x20committed,\x20and\x20pushed';else{if(_0x5a093f)_0x42172c='Changes\x20pulled\x20and\x20committed';else _0x3a452f&&(_0x42172c='Changes\x20committed\x20and\x20pushed');}}this['showToast'](_0x42172c,'success'),this['hide']();this['_createPR']&&this['onCreatePR']&&this['onCreatePR'](this['taskData']['taskId'],_0x2d877f||{});const _0xe7be56=this['_el']('sync-to-ibmi')?.['checked'];if(_0xe7be56&&this['onSyncToIbmi']){const _0x2c4b22=this['_el']('ibmi-sync-library')?.['value']?.['trim']()?.['toUpperCase']();if(_0x2c4b22){localStorage['setItem']('coderflow_ibmi_sync_library',_0x2c4b22);try{await this['onSyncToIbmi'](this['taskData']['taskId'],_0x2c4b22);}catch(_0x53ecd4){this['showToast']('Sync\x20failed:\x20'+_0x53ecd4['message'],'error');}}}this['onSuccess']&&this['onSuccess'](this['taskData']);}catch(_0x3fb89e){console['error']('Failed\x20to\x20approve\x20changes',_0x3fb89e),this['showError']('Failed\x20to\x20commit:\x20'+_0x3fb89e['message']),_0x1ff085&&(_0x1ff085['disabled']=![],_0x1ff085['textContent']=_0x5a8eab),this['onError']&&this['onError'](_0x3fb89e);}}['isVisible'](){const _0x388037=this['_el']('approve-modal');return _0x388037&&!_0x388037['hidden'];}['destroy'](){const _0x58cb26=this['_el']('approve-modal');_0x58cb26&&_0x58cb26['remove'](),this['initialized']=![];}}export function getApproveState(_0x267030,_0x3ada9a){if(!_0x267030)return{'canApprove':![],'reason':'No\x20task\x20data'};if(isLogOnlyTaskType(_0x267030['taskType']))return{'canApprove':![],'reason':(_0x267030['taskType']==='test'?'Test':'Deploy')+'\x20tasks\x20cannot\x20be\x20approved'};const _0x4c0312=_0x3ada9a?.['repos_changed']?.['length']>0x0,_0x2fc85d=_0x267030['status']==='completed'||_0x267030['status']==='failed'||_0x267030['status']==='interrupted',_0x2f524e=_0x267030['containerState']==='running',_0x570275=_0x267030['approvedBy']!==undefined&&_0x267030['approvedBy']!==null;if(_0x570275){const _0x2109fb=_0x267030['approvedBy']['name']||_0x267030['approvedBy']['username']||'user';return{'canApprove':![],'reason':'Already\x20approved\x20by\x20'+_0x2109fb};}if(!_0x4c0312)return{'canApprove':![],'reason':'No\x20changes\x20to\x20approve'};if(!_0x2fc85d)return{'canApprove':![],'reason':'Task\x20must\x20complete\x20first'};if(!_0x267030['containerId'])return{'canApprove':![],'reason':'Container\x20no\x20longer\x20available'};if(!_0x2f524e)return{'canApprove':![],'reason':'Container\x20is\x20not\x20running'};return{'canApprove':!![],'reason':'Ready\x20to\x20approve'};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function buildAutomationEnvironmentHref(
|
|
1
|
+
export function buildAutomationEnvironmentHref(_0x520488,_0x232e65){const _0x3544c1=new URLSearchParams();_0x520488&&_0x3544c1['set']('env',String(_0x520488));_0x3544c1['set']('tab','automations');_0x232e65&&_0x3544c1['set']('automation',String(_0x232e65));const _0x40e31c=_0x3544c1['toString']();return'environments.html'+(_0x40e31c?'?'+_0x40e31c:'');}export function buildAutomationTaskFilterHref(_0x2fdcd3){const _0xeca569=new URLSearchParams();_0x2fdcd3&&_0xeca569['set']('automation',String(_0x2fdcd3));const _0x399d06=_0xeca569['toString']();return'index.html'+(_0x399d06?'?'+_0x399d06:'');}export function parseAutomationDeepLinkParams(_0x3530e1=''){const _0x350804=new URLSearchParams(_0x3530e1||'');return{'env':_0x350804['get']('env'),'tab':_0x350804['get']('tab'),'automation':_0x350804['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(
|
|
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(_0x496824,_0x3e903c,_0x2c52ec){const _0x22bcae=Number['parseInt'](_0x496824,0xa);if(!Number['isInteger'](_0x22bcae)||_0x22bcae<_0x3e903c||_0x22bcae>_0x2c52ec)return null;return _0x22bcae;}function inferRecurringInterval(_0x25075b,_0x3650fb){if(_0x25075b==='*/15')return'*/15\x20*\x20*\x20*\x20*';if(_0x25075b==='*/30')return'*/30\x20*\x20*\x20*\x20*';if(_0x25075b!=='0')return'*/30\x20*\x20*\x20*\x20*';if(_0x3650fb==='*'||/^\d{1,2}-\d{1,2}$/['test'](_0x3650fb))return'0\x20*\x20*\x20*\x20*';for(const _0xadfe8a of RECURRING_INTERVAL_STEPS){if(_0x3650fb['startsWith']('*/'+_0xadfe8a)||_0x3650fb['includes']('/'+_0xadfe8a))return'0\x20*/'+_0xadfe8a+'\x20*\x20*\x20*';}return'*/30\x20*\x20*\x20*\x20*';}function parseRecurringHourRange(_0x4d2e0b){const _0x2b8076=String(_0x4d2e0b||'')['trim']()['match'](/^(\d{1,2})-(\d{1,2})(?:\/\d+)?$/);if(!_0x2b8076)return{'start':'','end':''};const _0x450adf=parseBoundedInteger(_0x2b8076[0x1],0x0,0x17),_0x5d768f=parseBoundedInteger(_0x2b8076[0x2],0x0,0x17);if(_0x450adf===null||_0x5d768f===null||_0x450adf>_0x5d768f)return{'start':'','end':''};return{'start':String(_0x450adf),'end':String(_0x5d768f)};}export function parseAutomationScheduleToFormState(_0x19d649){const _0xc0ad54=String(_0x19d649||'')['trim'](),_0x586aa9=createDefaultScheduleFormState(),_0x27d068=_0xc0ad54['match'](/^(\d{1,2}) (\d{1,2}) \* \* \*$/);if(_0x27d068){const _0x2f54f9=parseBoundedInteger(_0x27d068[0x1],0x0,0x3b),_0x3253c8=parseBoundedInteger(_0x27d068[0x2],0x0,0x17);if(_0x2f54f9!==null&&_0x3253c8!==null)return _0x586aa9['frequency']='daily',_0x586aa9['dailyMinute']=String(_0x2f54f9),_0x586aa9['dailyHour']=String(_0x3253c8),_0x586aa9;}const _0x5278d3=_0xc0ad54['match'](/^(\d{1,2}) (\d{1,2}) \* \* ([0-7])$/);if(_0x5278d3){const _0x16f85e=parseBoundedInteger(_0x5278d3[0x1],0x0,0x3b),_0x529d30=parseBoundedInteger(_0x5278d3[0x2],0x0,0x17),_0x55f116=parseBoundedInteger(_0x5278d3[0x3],0x0,0x7);if(_0x16f85e!==null&&_0x529d30!==null&&_0x55f116!==null)return _0x586aa9['frequency']='weekly',_0x586aa9['weeklyMinute']=String(_0x16f85e),_0x586aa9['weeklyHour']=String(_0x529d30),_0x586aa9['weeklyDay']=String(_0x55f116===0x7?0x0:_0x55f116),_0x586aa9;}const _0xc55438=_0xc0ad54['match'](/^(\d{1,2}) (\d{1,2}) (\d{1,2}) \* \*$/);if(_0xc55438){const _0x5a4706=parseBoundedInteger(_0xc55438[0x1],0x0,0x3b),_0x28bc11=parseBoundedInteger(_0xc55438[0x2],0x0,0x17),_0x450751=parseBoundedInteger(_0xc55438[0x3],AUTOMATION_MONTHLY_DAY_MIN,AUTOMATION_MONTHLY_DAY_MAX);if(_0x5a4706!==null&&_0x28bc11!==null&&_0x450751!==null)return _0x586aa9['frequency']='monthly',_0x586aa9['monthlyMinute']=String(_0x5a4706),_0x586aa9['monthlyHour']=String(_0x28bc11),_0x586aa9['monthlyDay']=String(_0x450751),_0x586aa9;}const _0x1915e0=_0xc0ad54['match'](/^(\*\/15|\*\/30|0) ([^\s]+) \* \* ([^\s]+)$/);if(_0x1915e0){const [,_0x79867c,_0x22e3fb,_0x2e33e9]=_0x1915e0;_0x586aa9['frequency']='recurring',_0x586aa9['recurringInterval']=inferRecurringInterval(_0x79867c,_0x22e3fb),_0x586aa9['recurringDayToken']=String(_0x2e33e9||'')['trim']()||'*';const _0x4de3fd=parseRecurringHourRange(_0x22e3fb);return _0x586aa9['recurringStartHour']=_0x4de3fd['start'],_0x586aa9['recurringEndHour']=_0x4de3fd['end'],_0x586aa9;}return _0x586aa9['frequency']='custom',_0x586aa9['customCron']=_0xc0ad54,_0x586aa9;}export function buildAutomationCronFromFormState(_0x30f1dd={}){const _0x31a7dc=String(_0x30f1dd['frequency']||'daily');if(_0x31a7dc==='custom')return String(_0x30f1dd['customCron']||'')['trim']();if(_0x31a7dc==='daily'){const _0xf7c3bd=String(_0x30f1dd['dailyHour']??'2'),_0x5499df=String(_0x30f1dd['dailyMinute']??'0');return _0x5499df+'\x20'+_0xf7c3bd+'\x20*\x20*\x20*';}if(_0x31a7dc==='weekly'){const _0x5ac7c0=String(_0x30f1dd['weeklyDay']??'1'),_0x19168d=String(_0x30f1dd['weeklyHour']??'9'),_0x22a35e=String(_0x30f1dd['weeklyMinute']??'0');return _0x22a35e+'\x20'+_0x19168d+'\x20*\x20*\x20'+_0x5ac7c0;}if(_0x31a7dc==='monthly'){const _0x52e0e2=String(_0x30f1dd['monthlyDay']??'1'),_0x50a77=String(_0x30f1dd['monthlyHour']??'0'),_0x8d3c00=String(_0x30f1dd['monthlyMinute']??'0');return _0x8d3c00+'\x20'+_0x50a77+'\x20'+_0x52e0e2+'\x20*\x20*';}const _0x54e7e7=String(_0x30f1dd['recurringInterval']||'*/30\x20*\x20*\x20*\x20*')['trim'](),[_0x324fea='*/30',_0x1a1efc='*']=_0x54e7e7['split'](/\s+/);let _0x3c9210=_0x1a1efc;const _0x3598a8=String(_0x30f1dd['recurringStartHour']??'')['trim'](),_0x197817=String(_0x30f1dd['recurringEndHour']??'')['trim']();if(_0x3598a8!==''&&_0x197817!==''){const _0x115d39=Number['parseInt'](_0x3598a8,0xa),_0x553210=Number['parseInt'](_0x197817,0xa);if(Number['isInteger'](_0x115d39)&&Number['isInteger'](_0x553210)&&_0x115d39<=_0x553210){const _0x3f580d=_0x1a1efc['match'](/^\*\/(\d+)$/);_0x3f580d?_0x3c9210=_0x115d39+'-'+_0x553210+'/'+_0x3f580d[0x1]:_0x3c9210=_0x115d39+'-'+_0x553210;}}const _0xf86b0d=String(_0x30f1dd['recurringDayToken']??'*')['trim']()||'*';return _0x324fea+'\x20'+_0x3c9210+'\x20*\x20*\x20'+_0xf86b0d;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export class CommentsWidget{constructor(_0x2cbf71,_0xcec66e={}){this['container']=_0x2cbf71,this['options']={'taskId':_0xcec66e['taskId']||null,'currentUserId':_0xcec66e['currentUserId']||null,'compact':_0xcec66e['compact']||![],'skipHeader':_0xcec66e['skipHeader']||![],'onCommentsLoaded':_0xcec66e['onCommentsLoaded']||null,'onCommentsChanged':_0xcec66e['onCommentsChanged']||null,'enableAttachments':_0xcec66e['enableAttachments']||![],'getAPI':_0xcec66e['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 _0x527780=this['options']['getAPI'](),_0x367f36=await _0x527780['getTaskAttachments'](this['options']['taskId']);this['existingAttachments']=_0x367f36['attachments']||[];}catch(_0x741bc7){console['warn']('Failed\x20to\x20load\x20existing\x20attachments:',_0x741bc7),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 _0x40cde4=this['header']['querySelector']('.comments-toggle-btn');_0x40cde4['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 _0x2a1783=document['createElement']('div');_0x2a1783['className']='comments-editor-wrapper',this['toolbar']=document['createElement']('div'),this['toolbar']['className']='comments-toolbar\x20comments-toolbar-hidden',_0x2a1783['appendChild'](this['toolbar']);const _0x2ec9ad=document['createElement']('div');_0x2ec9ad['className']='comments-editor-placeholder',_0x2a1783['appendChild'](_0x2ec9ad);const _0xbc0c2b=document['createElement']('div');_0xbc0c2b['className']='comments-input-actions',_0xbc0c2b['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'](_0x2a1783),this['inputSection']['appendChild'](_0xbc0c2b),this['container']['appendChild'](this['inputSection']),this['initEditor'](_0x2ec9ad),this['submitBtn']=_0xbc0c2b['querySelector']('.comments-submit-btn'),this['cancelBtn']=_0xbc0c2b['querySelector']('.comments-cancel-btn'),this['submitBtn']['addEventListener']('click',()=>this['handleSubmit']()),this['cancelBtn']['addEventListener']('click',()=>this['cancelEdit']());}['initEditor'](_0x1a4dfb){const _0x1e40d3=document['createElement']('textarea');_0x1e40d3['placeholder']='Add\x20a\x20comment...',_0x1e40d3['className']='comments-textarea',_0x1a4dfb['appendChild'](_0x1e40d3);const _0x49362a=window['MarkdownEditor'];if(!_0x49362a){console['error']('MarkdownEditor\x20not\x20loaded');return;}const _0x4628f2={'placeholder':'Add\x20a\x20comment...','editable':!![],'toolbar':!![],'minHeight':this['options']['compact']?'60px':'80px','onChange':_0x5e9057=>{const _0x142255=_0x5e9057&&_0x5e9057['trim']()['length']>0x0||this['pendingAttachments']['length']>0x0;this['submitBtn']['disabled']=!_0x142255;},'fetchUsers':async()=>{const _0x4928d0=this['options']['getAPI']();return _0x4928d0['getUsers']();}};this['options']['enableAttachments']&&this['options']['taskId']&&(_0x4628f2['onAddAttachments']=_0x266685=>{this['pendingAttachments']['push'](..._0x266685),this['submitBtn']['disabled']=![];},_0x4628f2['resolveAttachmentUrl']=_0x4ff25e=>{const _0xb504c7=this['options']['getAPI']();return _0xb504c7['getBaseUrl']()+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x4ff25e);},_0x4628f2['isAttachmentNameTaken']=_0x2ae39f=>{return this['pendingAttachments']['some'](_0x39c370=>_0x39c370['name']===_0x2ae39f)||this['existingAttachments']['some'](_0x492ce6=>_0x492ce6['name']===_0x2ae39f);});this['editor']=new _0x49362a(_0x1e40d3,_0x4628f2);const _0x452d95=this['editor']['editor'],_0x325ce8=this['editor']['toolbar'];_0x325ce8&&(_0x325ce8['classList']['add']('comments-toolbar-hidden'),_0x452d95['addEventListener']('focus',()=>{_0x325ce8['classList']['remove']('comments-toolbar-hidden');}),_0x452d95['addEventListener']('blur',_0xbbc898=>{setTimeout(()=>{!this['editor']['container']?.['contains'](document['activeElement'])&&!_0x325ce8['contains'](document['activeElement'])&&(!this['editor']['getValue']()?.['trim']()&&!this['editingCommentId']&&_0x325ce8['classList']['add']('comments-toolbar-hidden'));},0x64);}));}['toggleExpanded'](){this['isExpanded']=!this['isExpanded'],this['commentsListWrapper']['hidden']=!this['isExpanded'],this['inputSection']['hidden']=!this['isExpanded'];const _0xc87ef2=this['header']['querySelector']('.comments-chevron');_0xc87ef2&&(_0xc87ef2['style']['transform']=this['isExpanded']?'rotate(180deg)':''),this['isExpanded']&&this['comments']['length']===0x0&&this['options']['taskId']&&this['loadComments']();}['setTaskId'](_0x41bc75){this['options']['taskId']=_0x41bc75,this['comments']=[],this['renderComments'](),_0x41bc75&&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 _0xa5fb5c=this['options']['getAPI'](),_0xb707ec=await _0xa5fb5c['getComments'](this['options']['taskId']);this['comments']=_0xb707ec['comments']||[],this['renderComments'](),this['updateCount'](),this['options']['onCommentsLoaded']&&this['options']['onCommentsLoaded'](this['comments']);}catch(_0x34fb00){console['error']('Failed\x20to\x20load\x20comments:',_0x34fb00),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'](_0x208287=>{const _0x350088=this['createCommentElement'](_0x208287);this['commentsList']['appendChild'](_0x350088);});}['createCommentElement'](_0x241424){const _0x5a7c05=document['createElement']('div');_0x5a7c05['className']='comment-item',_0x5a7c05['dataset']['commentId']=_0x241424['id'];const _0x444190=this['options']['currentUserId']&&_0x241424['author']?.['userId']===this['options']['currentUserId'],_0xbb7bb3=this['formatDate'](_0x241424['createdAt']),_0x2f09b7=_0x241424['updatedAt']!==_0x241424['createdAt'],_0x406e3d=this['resolveAttachmentUrls'](_0x241424['content']);let _0x2b4db0=window['marked']?window['marked']['parse'](_0x406e3d):_0x406e3d;_0x2b4db0=this['renderMentions'](_0x2b4db0),_0x5a7c05['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'](_0x241424['author']?.['name']||'Anonymous')+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-timestamp\x22\x20title=\x22'+new Date(_0x241424['createdAt'])['toLocaleString']()+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0xbb7bb3+(_0x2f09b7?'\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'+(_0x444190?'\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>'+_0x2b4db0+'</div>\x0a\x20\x20\x20\x20';if(_0x444190){const _0x59a0c6=_0x5a7c05['querySelector']('.comment-edit-btn'),_0x260856=_0x5a7c05['querySelector']('.comment-delete-btn');_0x59a0c6?.['addEventListener']('click',()=>this['startEdit'](_0x241424)),_0x260856?.['addEventListener']('click',()=>this['deleteComment'](_0x241424['id']));}return _0x5a7c05;}['formatDate'](_0x3fa594){const _0x5697e5=new Date(_0x3fa594),_0x506fca=new Date(),_0x2eab3e=_0x506fca-_0x5697e5,_0x593154=Math['floor'](_0x2eab3e/0xea60),_0x596060=Math['floor'](_0x2eab3e/0x36ee80),_0x4acaa6=Math['floor'](_0x2eab3e/0x5265c00);if(_0x593154<0x1)return'just\x20now';if(_0x593154<0x3c)return _0x593154+'m\x20ago';if(_0x596060<0x18)return _0x596060+'h\x20ago';if(_0x4acaa6<0x7)return _0x4acaa6+'d\x20ago';return _0x5697e5['toLocaleDateString']();}['escapeHtml'](_0x3b8012){const _0x5d9b70=document['createElement']('div');return _0x5d9b70['textContent']=_0x3b8012,_0x5d9b70['innerHTML'];}['resolveAttachmentUrls'](_0xbdbf9a){if(!_0xbdbf9a||!this['options']['taskId'])return _0xbdbf9a;const _0x4fff4b=this['options']['getAPI'](),_0x1998b0=_0x4fff4b['getBaseUrl']();let _0x15ed82=String(_0xbdbf9a)['replace'](/\]\(attachment:(?:\/\/)?([^)]+)\)/g,(_0x4d85be,_0x33d367)=>{const _0x1a2f10=String(_0x33d367||'')['trim']();if(!_0x1a2f10)return _0x4d85be;let _0x4e2860=_0x1a2f10;try{_0x4e2860=decodeURIComponent(_0x1a2f10);}catch{}return']('+_0x1998b0+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x4e2860)+')';});return _0x15ed82;}['renderMentions'](_0x5a806f){if(!_0x5a806f)return _0x5a806f;return String(_0x5a806f)['replace'](/@?<a\s+href="mention:([^"]+)"[^>]*>([^<]+)<\/a>/g,(_0x1d96a0,_0x57f15e,_0x50ecd4)=>{const _0x4c147f=this['escapeHtml'](_0x50ecd4),_0x39c66a=this['escapeHtml'](_0x57f15e);return'<span\x20class=\x22mention\x22\x20data-mention-user-id=\x22'+_0x39c66a+'\x22>@'+_0x4c147f+'</span>';});}['startEdit'](_0x5dc479){this['editingCommentId']=_0x5dc479['id'],this['editor']['setValue'](_0x5dc479['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 _0x1bbe86=this['editor']['getValue']()?.['trim']();if(!_0x1bbe86&&this['pendingAttachments']['length']===0x0||!this['options']['taskId'])return;this['setLoading'](!![]);try{const _0x154f04=this['options']['getAPI']();this['pendingAttachments']['length']>0x0&&this['options']['enableAttachments']&&(await _0x154f04['uploadAttachments'](this['options']['taskId'],this['pendingAttachments']),this['existingAttachments']['push'](...this['pendingAttachments']['map'](_0x38d4d8=>({'name':_0x38d4d8['name']}))),this['pendingAttachments']=[]);if(this['editingCommentId']){const _0xa4918d=await _0x154f04['updateComment'](this['options']['taskId'],this['editingCommentId'],_0x1bbe86),_0x2e7e20=this['comments']['findIndex'](_0x5ed65b=>_0x5ed65b['id']===this['editingCommentId']);_0x2e7e20!==-0x1&&(this['comments'][_0x2e7e20]=_0xa4918d['comment']);}else{const _0x332942=await _0x154f04['addComment'](this['options']['taskId'],_0x1bbe86);this['comments']['push'](_0x332942['comment']);}this['renderComments'](),this['updateCount'](),this['cancelEdit'](),this['editor']['clear']();}catch(_0x538472){console['error']('Failed\x20to\x20save\x20comment:',_0x538472),alert('Failed\x20to\x20save\x20comment:\x20'+_0x538472['message']);}finally{this['setLoading'](![]);}}async['deleteComment'](_0x3b6561){const _0x579d2d=await this['showDeleteConfirmModal']();if(!_0x579d2d)return;try{const _0x5853a9=this['options']['getAPI']();await _0x5853a9['deleteComment'](this['options']['taskId'],_0x3b6561),this['comments']=this['comments']['filter'](_0x290395=>_0x290395['id']!==_0x3b6561),this['renderComments'](),this['updateCount']();}catch(_0x302510){console['error']('Failed\x20to\x20delete\x20comment:',_0x302510),alert('Failed\x20to\x20delete\x20comment:\x20'+_0x302510['message']);}}['showDeleteConfirmModal'](){return new Promise(_0x51692f=>{const _0x110ae0=document['createElement']('div');_0x110ae0['className']='comments-confirm-modal',_0x110ae0['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'](_0x110ae0);const _0x1caed8=_0x2e7c29=>{document['removeEventListener']('keydown',_0x15a087),_0x110ae0['remove'](),_0x51692f(_0x2e7c29);},_0x15a087=_0x11d79e=>{if(_0x11d79e['key']==='Escape')_0x1caed8(![]);};document['addEventListener']('keydown',_0x15a087),_0x110ae0['querySelector']('.comments-confirm-backdrop')['addEventListener']('click',()=>_0x1caed8(![])),_0x110ae0['querySelector']('.comments-confirm-close')['addEventListener']('click',()=>_0x1caed8(![])),_0x110ae0['querySelector']('.comments-confirm-cancel')['addEventListener']('click',()=>_0x1caed8(![])),_0x110ae0['querySelector']('.comments-confirm-delete')['addEventListener']('click',()=>_0x1caed8(!![])),_0x110ae0['querySelector']('.comments-confirm-cancel')['focus']();});}['setLoading'](_0x135e96){this['submitBtn']['disabled']=_0x135e96,this['submitBtn']['querySelector']('.btn-text')['hidden']=_0x135e96,this['submitBtn']['querySelector']('.btn-loading')['hidden']=!_0x135e96;}['updateCount'](){const _0x1e8570=this['comments']['length'],_0x553a02=this['container']['querySelector']('#comments-count-badge');_0x553a02&&(_0x553a02['textContent']=_0x1e8570,_0x553a02['hidden']=_0x1e8570===0x0);const _0x2f1836=this['container']['querySelector']('#comments-count');_0x2f1836&&(_0x2f1836['textContent']=_0x1e8570>0x0?'('+_0x1e8570+')':''),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(_0x114e2d,_0x450015={}){this['container']=_0x114e2d,this['options']={'taskId':_0x450015['taskId']||null,'currentUserId':_0x450015['currentUserId']||null,'compact':_0x450015['compact']||![],'skipHeader':_0x450015['skipHeader']||![],'onCommentsLoaded':_0x450015['onCommentsLoaded']||null,'onCommentsChanged':_0x450015['onCommentsChanged']||null,'enableAttachments':_0x450015['enableAttachments']||![],'getAPI':_0x450015['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 _0x2f46a5=this['options']['getAPI'](),_0x213445=await _0x2f46a5['getTaskAttachments'](this['options']['taskId']);this['existingAttachments']=_0x213445['attachments']||[];}catch(_0xf6e381){console['warn']('Failed\x20to\x20load\x20existing\x20attachments:',_0xf6e381),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 _0x4948fe=this['header']['querySelector']('.comments-toggle-btn');_0x4948fe['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 _0x41adad=document['createElement']('div');_0x41adad['className']='comments-editor-wrapper',this['toolbar']=document['createElement']('div'),this['toolbar']['className']='comments-toolbar\x20comments-toolbar-hidden',_0x41adad['appendChild'](this['toolbar']);const _0x432ab2=document['createElement']('div');_0x432ab2['className']='comments-editor-placeholder',_0x41adad['appendChild'](_0x432ab2);const _0x10cfd0=document['createElement']('div');_0x10cfd0['className']='comments-input-actions',_0x10cfd0['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'](_0x41adad),this['inputSection']['appendChild'](_0x10cfd0),this['container']['appendChild'](this['inputSection']),this['initEditor'](_0x432ab2),this['submitBtn']=_0x10cfd0['querySelector']('.comments-submit-btn'),this['cancelBtn']=_0x10cfd0['querySelector']('.comments-cancel-btn'),this['submitBtn']['addEventListener']('click',()=>this['handleSubmit']()),this['cancelBtn']['addEventListener']('click',()=>this['cancelEdit']());}['initEditor'](_0x47b2f1){const _0x24d8cf=document['createElement']('textarea');_0x24d8cf['placeholder']='Add\x20a\x20comment...',_0x24d8cf['className']='comments-textarea',_0x47b2f1['appendChild'](_0x24d8cf);const _0x4592f1=window['MarkdownEditor'];if(!_0x4592f1){console['error']('MarkdownEditor\x20not\x20loaded');return;}const _0x5ab04c={'placeholder':'Add\x20a\x20comment...','editable':!![],'toolbar':!![],'minHeight':this['options']['compact']?'60px':'80px','onChange':_0x2bc971=>{const _0x184910=_0x2bc971&&_0x2bc971['trim']()['length']>0x0||this['pendingAttachments']['length']>0x0;this['submitBtn']['disabled']=!_0x184910;},'fetchUsers':async()=>{const _0x2a0b3e=this['options']['getAPI']();return _0x2a0b3e['getUsers']();}};this['options']['enableAttachments']&&this['options']['taskId']&&(_0x5ab04c['onAddAttachments']=_0x402ebd=>{this['pendingAttachments']['push'](..._0x402ebd),this['submitBtn']['disabled']=![];},_0x5ab04c['resolveAttachmentUrl']=_0x13272b=>{const _0x3d170e=this['options']['getAPI']();return _0x3d170e['getBaseUrl']()+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x13272b);},_0x5ab04c['isAttachmentNameTaken']=_0x5165bc=>{return this['pendingAttachments']['some'](_0x31ba33=>_0x31ba33['name']===_0x5165bc)||this['existingAttachments']['some'](_0x57fe26=>_0x57fe26['name']===_0x5165bc);});this['editor']=new _0x4592f1(_0x24d8cf,_0x5ab04c);const _0xc6fce2=this['editor']['editor'],_0xa18496=this['editor']['toolbar'];_0xa18496&&(_0xa18496['classList']['add']('comments-toolbar-hidden'),_0xc6fce2['addEventListener']('focus',()=>{_0xa18496['classList']['remove']('comments-toolbar-hidden');}),_0xc6fce2['addEventListener']('blur',_0x2b2c6a=>{setTimeout(()=>{!this['editor']['container']?.['contains'](document['activeElement'])&&!_0xa18496['contains'](document['activeElement'])&&(!this['editor']['getValue']()?.['trim']()&&!this['editingCommentId']&&_0xa18496['classList']['add']('comments-toolbar-hidden'));},0x64);}));}['toggleExpanded'](){this['isExpanded']=!this['isExpanded'],this['commentsListWrapper']['hidden']=!this['isExpanded'],this['inputSection']['hidden']=!this['isExpanded'];const _0x113f3d=this['header']['querySelector']('.comments-chevron');_0x113f3d&&(_0x113f3d['style']['transform']=this['isExpanded']?'rotate(180deg)':''),this['isExpanded']&&this['comments']['length']===0x0&&this['options']['taskId']&&this['loadComments']();}['setTaskId'](_0x4d8fa8){this['options']['taskId']=_0x4d8fa8,this['comments']=[],this['renderComments'](),_0x4d8fa8&&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 _0x367787=this['options']['getAPI'](),_0xcc6b94=await _0x367787['getComments'](this['options']['taskId']);this['comments']=_0xcc6b94['comments']||[],this['renderComments'](),this['updateCount'](),this['options']['onCommentsLoaded']&&this['options']['onCommentsLoaded'](this['comments']);}catch(_0x16d06e){console['error']('Failed\x20to\x20load\x20comments:',_0x16d06e),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'](_0x2c6056=>{const _0x294fc6=this['createCommentElement'](_0x2c6056);this['commentsList']['appendChild'](_0x294fc6);});}['createCommentElement'](_0x512a87){const _0x5da536=document['createElement']('div');_0x5da536['className']='comment-item',_0x5da536['dataset']['commentId']=_0x512a87['id'];const _0xd0e8ad=this['options']['currentUserId']&&_0x512a87['author']?.['userId']===this['options']['currentUserId'],_0x58f0c5=this['formatDate'](_0x512a87['createdAt']),_0x1344bb=_0x512a87['updatedAt']!==_0x512a87['createdAt'],_0x1ebb43=this['resolveAttachmentUrls'](_0x512a87['content']);let _0x375b57=window['marked']?window['marked']['parse'](_0x1ebb43):_0x1ebb43;_0x375b57=this['renderMentions'](_0x375b57),_0x5da536['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'](_0x512a87['author']?.['name']||'Anonymous')+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-timestamp\x22\x20title=\x22'+new Date(_0x512a87['createdAt'])['toLocaleString']()+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x58f0c5+(_0x1344bb?'\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'+(_0xd0e8ad?'\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>'+_0x375b57+'</div>\x0a\x20\x20\x20\x20';if(_0xd0e8ad){const _0x26fb87=_0x5da536['querySelector']('.comment-edit-btn'),_0x56a46e=_0x5da536['querySelector']('.comment-delete-btn');_0x26fb87?.['addEventListener']('click',()=>this['startEdit'](_0x512a87)),_0x56a46e?.['addEventListener']('click',()=>this['deleteComment'](_0x512a87['id']));}return _0x5da536;}['formatDate'](_0x56bf16){const _0x32ac06=new Date(_0x56bf16),_0x20ded0=new Date(),_0x5cc69d=_0x20ded0-_0x32ac06,_0x28ff54=Math['floor'](_0x5cc69d/0xea60),_0x546d43=Math['floor'](_0x5cc69d/0x36ee80),_0x20bad4=Math['floor'](_0x5cc69d/0x5265c00);if(_0x28ff54<0x1)return'just\x20now';if(_0x28ff54<0x3c)return _0x28ff54+'m\x20ago';if(_0x546d43<0x18)return _0x546d43+'h\x20ago';if(_0x20bad4<0x7)return _0x20bad4+'d\x20ago';return _0x32ac06['toLocaleDateString']();}['escapeHtml'](_0x395667){const _0x547d42=document['createElement']('div');return _0x547d42['textContent']=_0x395667,_0x547d42['innerHTML'];}['resolveAttachmentUrls'](_0x339cf2){if(!_0x339cf2||!this['options']['taskId'])return _0x339cf2;const _0x4810fd=this['options']['getAPI'](),_0x5bcbff=_0x4810fd['getBaseUrl']();let _0x1a0f5b=String(_0x339cf2)['replace'](/\]\(attachment:(?:\/\/)?([^)]+)\)/g,(_0x5324d9,_0x13002c)=>{const _0x34c9b1=String(_0x13002c||'')['trim']();if(!_0x34c9b1)return _0x5324d9;let _0x471b5b=_0x34c9b1;try{_0x471b5b=decodeURIComponent(_0x34c9b1);}catch{}return']('+_0x5bcbff+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x471b5b)+')';});return _0x1a0f5b;}['renderMentions'](_0x2a753c){if(!_0x2a753c)return _0x2a753c;return String(_0x2a753c)['replace'](/@?<a\s+href="mention:([^"]+)"[^>]*>([^<]+)<\/a>/g,(_0x1f7cf2,_0x44daa4,_0x581937)=>{const _0x136455=this['escapeHtml'](_0x581937),_0x4be34c=this['escapeHtml'](_0x44daa4);return'<span\x20class=\x22mention\x22\x20data-mention-user-id=\x22'+_0x4be34c+'\x22>@'+_0x136455+'</span>';});}['startEdit'](_0x742541){this['editingCommentId']=_0x742541['id'],this['editor']['setValue'](_0x742541['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 _0x59a1a3=this['editor']['getValue']()?.['trim']();if(!_0x59a1a3&&this['pendingAttachments']['length']===0x0||!this['options']['taskId'])return;this['setLoading'](!![]);try{const _0x510d87=this['options']['getAPI']();this['pendingAttachments']['length']>0x0&&this['options']['enableAttachments']&&(await _0x510d87['uploadAttachments'](this['options']['taskId'],this['pendingAttachments']),this['existingAttachments']['push'](...this['pendingAttachments']['map'](_0x5ccc12=>({'name':_0x5ccc12['name']}))),this['pendingAttachments']=[]);if(this['editingCommentId']){const _0xbe4f24=await _0x510d87['updateComment'](this['options']['taskId'],this['editingCommentId'],_0x59a1a3),_0x3d794e=this['comments']['findIndex'](_0x1ddc84=>_0x1ddc84['id']===this['editingCommentId']);_0x3d794e!==-0x1&&(this['comments'][_0x3d794e]=_0xbe4f24['comment']);}else{const _0x13994f=await _0x510d87['addComment'](this['options']['taskId'],_0x59a1a3);this['comments']['push'](_0x13994f['comment']);}this['renderComments'](),this['updateCount'](),this['cancelEdit'](),this['editor']['clear']();}catch(_0x44e3fa){console['error']('Failed\x20to\x20save\x20comment:',_0x44e3fa),alert('Failed\x20to\x20save\x20comment:\x20'+_0x44e3fa['message']);}finally{this['setLoading'](![]);}}async['deleteComment'](_0xa13a86){const _0x56cad2=await this['showDeleteConfirmModal']();if(!_0x56cad2)return;try{const _0x3f7f23=this['options']['getAPI']();await _0x3f7f23['deleteComment'](this['options']['taskId'],_0xa13a86),this['comments']=this['comments']['filter'](_0x2e81e0=>_0x2e81e0['id']!==_0xa13a86),this['renderComments'](),this['updateCount']();}catch(_0x31167a){console['error']('Failed\x20to\x20delete\x20comment:',_0x31167a),alert('Failed\x20to\x20delete\x20comment:\x20'+_0x31167a['message']);}}['showDeleteConfirmModal'](){return new Promise(_0x263bd4=>{const _0x39b19a=document['createElement']('div');_0x39b19a['className']='comments-confirm-modal',_0x39b19a['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'](_0x39b19a);const _0x39bcd8=_0x23ca8e=>{document['removeEventListener']('keydown',_0x254905),_0x39b19a['remove'](),_0x263bd4(_0x23ca8e);},_0x254905=_0x24e50c=>{if(_0x24e50c['key']==='Escape')_0x39bcd8(![]);};document['addEventListener']('keydown',_0x254905),_0x39b19a['querySelector']('.comments-confirm-backdrop')['addEventListener']('click',()=>_0x39bcd8(![])),_0x39b19a['querySelector']('.comments-confirm-close')['addEventListener']('click',()=>_0x39bcd8(![])),_0x39b19a['querySelector']('.comments-confirm-cancel')['addEventListener']('click',()=>_0x39bcd8(![])),_0x39b19a['querySelector']('.comments-confirm-delete')['addEventListener']('click',()=>_0x39bcd8(!![])),_0x39b19a['querySelector']('.comments-confirm-cancel')['focus']();});}['setLoading'](_0x53fbd6){this['submitBtn']['disabled']=_0x53fbd6,this['submitBtn']['querySelector']('.btn-text')['hidden']=_0x53fbd6,this['submitBtn']['querySelector']('.btn-loading')['hidden']=!_0x53fbd6;}['updateCount'](){const _0x2b826a=this['comments']['length'],_0x3ce7d1=this['container']['querySelector']('#comments-count-badge');_0x3ce7d1&&(_0x3ce7d1['textContent']=_0x2b826a,_0x3ce7d1['hidden']=_0x2b826a===0x0);const _0x1234dd=this['container']['querySelector']('#comments-count');_0x1234dd&&(_0x1234dd['textContent']=_0x2b826a>0x0?'('+_0x2b826a+')':''),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(_0x31b005){const _0x2f9d74=[],_0x51f138=_0x31b005['split']('\x0a');let _0x2a0147=null,_0x558572=null;for(const _0x5b5d00 of _0x51f138){if(_0x5b5d00['startsWith']('diff\x20--git')){_0x2a0147&&_0x558572&&_0x2a0147['hunks']['push'](_0x558572);_0x2a0147&&_0x2f9d74['push'](_0x2a0147);const _0x10c04d=_0x5b5d00['match'](/diff --git a\/(.+?) b\/(.+)/);_0x2a0147={'oldPath':_0x10c04d?_0x10c04d[0x1]:'','newPath':_0x10c04d?_0x10c04d[0x2]:'','hunks':[],'isDeleted':![]},_0x558572=null;}else{if(_0x5b5d00['startsWith']('deleted\x20file\x20mode')&&_0x2a0147)_0x2a0147['isDeleted']=!![];else{if(_0x5b5d00['startsWith']('@@'))_0x558572&&_0x2a0147&&_0x2a0147['hunks']['push'](_0x558572),_0x558572={'header':_0x5b5d00,'lines':[]};else _0x558572&&_0x558572['lines']['push'](_0x5b5d00);}}}return _0x2a0147&&_0x558572&&_0x2a0147['hunks']['push'](_0x558572),_0x2a0147&&_0x2f9d74['push'](_0x2a0147),_0x2f9d74;}export function parseHunkHeader(_0x462b76){const _0x3b8fa7=_0x462b76['match'](/@@ -(\d+),?\d* \+(\d+),?\d* @@/);if(_0x3b8fa7)return{'oldStart':parseInt(_0x3b8fa7[0x1],0xa),'newStart':parseInt(_0x3b8fa7[0x2],0xa)};return{'oldStart':0x1,'newStart':0x1};}export function highlightDiffLine(_0x26586d,_0x426f7d){const _0x513d0e=window['hljs']||(typeof hljs!=='undefined'?hljs:null);if(_0x513d0e&&_0x426f7d)try{const _0x519151=_0x513d0e['getLanguage'](_0x426f7d)?_0x426f7d:null;if(_0x519151)return _0x513d0e['highlight'](_0x26586d,{'language':_0x519151})['value'];}catch(_0x12379c){console['error']('Diff\x20syntax\x20highlighting\x20error:',_0x12379c);}return Utils['escapeHtml'](_0x26586d);}export function getFileLanguage(_0x23323b){const _0x2a6c25=_0x23323b['split']('.')['pop']()['toLowerCase'](),_0x18b772={'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 _0x18b772[_0x2a6c25]||null;}export function computeWordDiff(_0x3d4d83,_0x247441){const _0xfba2ec=_0x3d2f25=>{const _0x4a35d0=[];let _0x390650='',_0x5535fb=![];for(let _0xf6f6d4=0x0;_0xf6f6d4<_0x3d2f25['length'];_0xf6f6d4++){const _0x16ed33=_0x3d2f25[_0xf6f6d4],_0x169280=/\s/['test'](_0x16ed33);if(_0x390650==='')_0x390650=_0x16ed33,_0x5535fb=_0x169280;else _0x169280===_0x5535fb?_0x390650+=_0x16ed33:(_0x4a35d0['push'](_0x390650),_0x390650=_0x16ed33,_0x5535fb=_0x169280);}return _0x390650&&_0x4a35d0['push'](_0x390650),_0x4a35d0;},_0x2b117a=_0xfba2ec(_0x3d4d83),_0x26e408=_0xfba2ec(_0x247441),_0x4461d0=_0x2b117a['length'],_0x4702c5=_0x26e408['length'],_0x592de0=Array(_0x4461d0+0x1)['fill'](null)['map'](()=>Array(_0x4702c5+0x1)['fill'](0x0));for(let _0x1fe8b4=0x1;_0x1fe8b4<=_0x4461d0;_0x1fe8b4++){for(let _0x1f4bea=0x1;_0x1f4bea<=_0x4702c5;_0x1f4bea++){_0x2b117a[_0x1fe8b4-0x1]===_0x26e408[_0x1f4bea-0x1]?_0x592de0[_0x1fe8b4][_0x1f4bea]=_0x592de0[_0x1fe8b4-0x1][_0x1f4bea-0x1]+0x1:_0x592de0[_0x1fe8b4][_0x1f4bea]=Math['max'](_0x592de0[_0x1fe8b4-0x1][_0x1f4bea],_0x592de0[_0x1fe8b4][_0x1f4bea-0x1]);}}const _0x2c3c3e={'old':[],'new':[]};let _0x323f46=_0x4461d0,_0x49612c=_0x4702c5;const _0x18b544=[],_0x26578c=[];while(_0x323f46>0x0||_0x49612c>0x0){if(_0x323f46>0x0&&_0x49612c>0x0&&_0x2b117a[_0x323f46-0x1]===_0x26e408[_0x49612c-0x1])_0x18b544['unshift']({'type':'equal','text':_0x2b117a[_0x323f46-0x1]}),_0x26578c['unshift']({'type':'equal','text':_0x26e408[_0x49612c-0x1]}),_0x323f46--,_0x49612c--;else{if(_0x49612c>0x0&&(_0x323f46===0x0||_0x592de0[_0x323f46][_0x49612c-0x1]>=_0x592de0[_0x323f46-0x1][_0x49612c]))_0x26578c['unshift']({'type':'insert','text':_0x26e408[_0x49612c-0x1]}),_0x49612c--;else _0x323f46>0x0&&(_0x18b544['unshift']({'type':'delete','text':_0x2b117a[_0x323f46-0x1]}),_0x323f46--);}}return _0x2c3c3e['old']=_0x18b544,_0x2c3c3e['new']=_0x26578c,_0x2c3c3e;}export function renderDiffLineWithWordHighlight(_0x238e18,_0x4490d5,_0x2009c7,_0x5deed1){if(!_0x4490d5||_0x4490d5['length']===0x0)return highlightDiffLine(_0x238e18,_0x5deed1);let _0x576f6e='';const _0x455296=_0x2009c7==='add'?'diff-word-add':'diff-word-remove',_0x4a26d5=_0x2009c7==='add'?'insert':'delete';for(const _0x1b9c22 of _0x4490d5){const _0x1ef294=Utils['escapeHtml'](_0x1b9c22['text']);_0x1b9c22['type']===_0x4a26d5?_0x576f6e+='<span\x20class=\x22'+_0x455296+'\x22>'+_0x1ef294+'</span>':_0x576f6e+=_0x1ef294;}return _0x576f6e;}export function calculateDiffStats(_0x8bdf1c){let _0x356f11=0x0,_0x13727c=0x0,_0xdea4c8=0x0;return _0x8bdf1c['forEach'](_0x4f111f=>{let _0xdb27c6=0x0,_0x4c518e=0x0;_0x4f111f['hunks']['forEach'](_0x2f9cac=>{_0x2f9cac['lines']['forEach'](_0x5b234b=>{if(_0x5b234b['startsWith']('+'))_0xdb27c6+=0x1;else{if(_0x5b234b['startsWith']('-'))_0x4c518e+=0x1;}});}),(_0xdb27c6+_0x4c518e>0x0||_0x4f111f['isDeleted'])&&(_0xdea4c8+=0x1),_0x356f11+=_0xdb27c6,_0x13727c+=_0x4c518e;}),{'additions':_0x356f11,'deletions':_0x13727c,'files':_0xdea4c8};}export function getFileStatus(_0x49c978,_0x7a501a,_0x3b2191){if(_0x49c978['isDeleted'])return'deleted';if(_0x7a501a>0x0&&_0x3b2191===0x0)return'added';return'modified';}export function safeBase64(_0x197cf9){try{return btoa(unescape(encodeURIComponent(_0x197cf9)));}catch(_0xdebf49){return btoa(_0x197cf9);}}export function getStorageKey(_0x204af9,_0x54f1b7){return _0x204af9+'-'+safeBase64(_0x54f1b7);}export function getCollapsedState(_0x2fb978,_0x4259c6){const _0x19b28c=localStorage['getItem'](getStorageKey(_0x2fb978,_0x4259c6));return _0x19b28c==='true';}export function renderUnifiedDiff(_0x335087,_0x59b16e){return _0x335087['map']((_0x42b271,_0x46087a)=>{const _0x4e1946=_0x42b271['newPath']||_0x42b271['oldPath']||'unknown',_0xe9d8da='diff-'+_0x59b16e+'-'+_0x46087a,_0x449788=getFileLanguage(_0x4e1946),{additions:_0x4819c8,deletions:_0x454ad3}=calculateDiffStats([_0x42b271]),_0x3c379e=getCollapsedState(_0x59b16e,_0x4e1946),_0x3b3931=getFileStatus(_0x42b271,_0x4819c8,_0x454ad3),_0x578182=_0x3b3931==='added'?'A':_0x3b3931==='deleted'?'D':'M',_0x316ee8=_0x42b271['hunks']['map'](_0x5dec1f=>{const {oldStart:_0x20bf73,newStart:_0x3a7d39}=parseHunkHeader(_0x5dec1f['header']);let _0x35b509=_0x20bf73,_0xb98b47=_0x3a7d39;const _0x1b8ccb=_0x5dec1f['lines']['map'](_0x3bcb0b=>({'line':_0x3bcb0b,'type':_0x3bcb0b['startsWith']('+')?'add':_0x3bcb0b['startsWith']('-')?'remove':_0x3bcb0b['startsWith']('\x5c')?'meta':'context'}));let _0xa22516=0x0;while(_0xa22516<_0x1b8ccb['length']){if(_0x1b8ccb[_0xa22516]['type']==='remove'){let _0x24e247=_0xa22516,_0x4240c7=_0xa22516;while(_0x4240c7<_0x1b8ccb['length']&&_0x1b8ccb[_0x4240c7]['type']==='remove')_0x4240c7++;let _0x5566bf=_0x4240c7,_0x375cba=_0x5566bf;while(_0x375cba<_0x1b8ccb['length']&&_0x1b8ccb[_0x375cba]['type']==='add')_0x375cba++;const _0x5b8e31=_0x4240c7-_0x24e247,_0x3d92b1=_0x375cba-_0x5566bf,_0x140139=Math['min'](_0x5b8e31,_0x3d92b1);for(let _0x2a5b34=0x0;_0x2a5b34<_0x140139;_0x2a5b34++){const _0x5041d6=_0x1b8ccb[_0x24e247+_0x2a5b34]['line']['substring'](0x1),_0xa44c19=_0x1b8ccb[_0x5566bf+_0x2a5b34]['line']['substring'](0x1),_0x3563fb=computeWordDiff(_0x5041d6,_0xa44c19);_0x1b8ccb[_0x24e247+_0x2a5b34]['wordDiff']=_0x3563fb['old'],_0x1b8ccb[_0x5566bf+_0x2a5b34]['wordDiff']=_0x3563fb['new'];}_0xa22516=_0x375cba;}else _0xa22516++;}const _0x8a35f5=_0x1b8ccb['map'](_0x11d47c=>{const _0x286996=_0x11d47c['line'];if(_0x286996['startsWith']('+')){const _0xedebea=_0x286996['substring'](0x1),_0x455bda=_0x11d47c['wordDiff']?renderDiffLineWithWordHighlight(_0xedebea,_0x11d47c['wordDiff'],'add',_0x449788):highlightDiffLine(_0xedebea,_0x449788),_0x26346d='<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>'+_0xb98b47+'</span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>+</span>'+_0x455bda+'</span></div>';return _0xb98b47+=0x1,_0x26346d;}if(_0x286996['startsWith']('-')){const _0x5576a4=_0x286996['substring'](0x1),_0x1dbfa2=_0x11d47c['wordDiff']?renderDiffLineWithWordHighlight(_0x5576a4,_0x11d47c['wordDiff'],'remove',_0x449788):highlightDiffLine(_0x5576a4,_0x449788),_0x117513='<div\x20class=\x22diff-line\x20diff-remove\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x35b509+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>-</span>'+_0x1dbfa2+'</span></div>';return _0x35b509+=0x1,_0x117513;}if(_0x286996['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'](_0x286996)+'</span></div>';const _0x9dc6e8=_0x286996['startsWith']('\x20')?_0x286996['substring'](0x1):_0x286996,_0x479923=highlightDiffLine(_0x9dc6e8,_0x449788),_0x58845e='<div\x20class=\x22diff-line\x20diff-context\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x35b509+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0xb98b47+'</span><span\x20class=\x22diff-line-content\x22>\x20'+_0x479923+'</span></div>';return _0x35b509+=0x1,_0xb98b47+=0x1,_0x58845e;})['join']('');return'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>'+Utils['escapeHtml'](_0x5dec1f['header'])+'</div>'+_0x8a35f5+'</div>';})['join'](''),_0x318928=_0x316ee8||'<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-'+_0xe9d8da+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-header\x22\x20data-diff-id=\x22'+_0xe9d8da+'\x22\x20data-file-name=\x22'+Utils['escapeHtml'](_0x4e1946)+'\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'+_0x3b3931+'\x22>'+_0x578182+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-name\x22>'+Utils['escapeHtml'](_0x4e1946)+'</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>+'+_0x4819c8+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-del\x22>-'+_0x454ad3+'</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'+_0xe9d8da+'\x22\x20data-collapsed=\x22'+_0x3c379e+'\x22\x20type=\x22button\x22\x20aria-label=\x22'+(_0x3c379e?'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'+(_0x3c379e?'collapsed':'')+'\x22\x20id=\x22'+_0xe9d8da+'\x22>'+_0x318928+'</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20';})['join']('');}
|
|
1
|
+
import{Utils}from'./app.js';export function parsePatchContent(_0x480285){const _0x52ddb7=[],_0x80e3fe=_0x480285['split']('\x0a');let _0x5af917=null,_0x27cbce=null;for(const _0x3aaad2 of _0x80e3fe){if(_0x3aaad2['startsWith']('diff\x20--git')){_0x5af917&&_0x27cbce&&_0x5af917['hunks']['push'](_0x27cbce);_0x5af917&&_0x52ddb7['push'](_0x5af917);const _0x366d05=_0x3aaad2['match'](/diff --git a\/(.+?) b\/(.+)/);_0x5af917={'oldPath':_0x366d05?_0x366d05[0x1]:'','newPath':_0x366d05?_0x366d05[0x2]:'','hunks':[],'isDeleted':![]},_0x27cbce=null;}else{if(_0x3aaad2['startsWith']('deleted\x20file\x20mode')&&_0x5af917)_0x5af917['isDeleted']=!![];else{if(_0x3aaad2['startsWith']('@@'))_0x27cbce&&_0x5af917&&_0x5af917['hunks']['push'](_0x27cbce),_0x27cbce={'header':_0x3aaad2,'lines':[]};else _0x27cbce&&_0x27cbce['lines']['push'](_0x3aaad2);}}}return _0x5af917&&_0x27cbce&&_0x5af917['hunks']['push'](_0x27cbce),_0x5af917&&_0x52ddb7['push'](_0x5af917),_0x52ddb7;}export function parseHunkHeader(_0x125e9b){const _0x59674d=_0x125e9b['match'](/@@ -(\d+),?\d* \+(\d+),?\d* @@/);if(_0x59674d)return{'oldStart':parseInt(_0x59674d[0x1],0xa),'newStart':parseInt(_0x59674d[0x2],0xa)};return{'oldStart':0x1,'newStart':0x1};}export function highlightDiffLine(_0x542f9e,_0x4c14b4){const _0x64aaf7=window['hljs']||(typeof hljs!=='undefined'?hljs:null);if(_0x64aaf7&&_0x4c14b4)try{const _0x3f76da=_0x64aaf7['getLanguage'](_0x4c14b4)?_0x4c14b4:null;if(_0x3f76da)return _0x64aaf7['highlight'](_0x542f9e,{'language':_0x3f76da})['value'];}catch(_0x25d833){console['error']('Diff\x20syntax\x20highlighting\x20error:',_0x25d833);}return Utils['escapeHtml'](_0x542f9e);}export function getFileLanguage(_0x30d8b2){const _0xc40de7=_0x30d8b2['split']('.')['pop']()['toLowerCase'](),_0x1ff5b9={'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 _0x1ff5b9[_0xc40de7]||null;}export function computeWordDiff(_0xc1390e,_0x2bcbf0){const _0x235b31=_0xbb1d9c=>{const _0x42459e=[];let _0x678d36='',_0x38363b=![];for(let _0x3d5c24=0x0;_0x3d5c24<_0xbb1d9c['length'];_0x3d5c24++){const _0x23f8a6=_0xbb1d9c[_0x3d5c24],_0x2fe10d=/\s/['test'](_0x23f8a6);if(_0x678d36==='')_0x678d36=_0x23f8a6,_0x38363b=_0x2fe10d;else _0x2fe10d===_0x38363b?_0x678d36+=_0x23f8a6:(_0x42459e['push'](_0x678d36),_0x678d36=_0x23f8a6,_0x38363b=_0x2fe10d);}return _0x678d36&&_0x42459e['push'](_0x678d36),_0x42459e;},_0x34f537=_0x235b31(_0xc1390e),_0x327edc=_0x235b31(_0x2bcbf0),_0x21d790=_0x34f537['length'],_0x407b66=_0x327edc['length'],_0xdd1bdb=Array(_0x21d790+0x1)['fill'](null)['map'](()=>Array(_0x407b66+0x1)['fill'](0x0));for(let _0x1217f5=0x1;_0x1217f5<=_0x21d790;_0x1217f5++){for(let _0x232def=0x1;_0x232def<=_0x407b66;_0x232def++){_0x34f537[_0x1217f5-0x1]===_0x327edc[_0x232def-0x1]?_0xdd1bdb[_0x1217f5][_0x232def]=_0xdd1bdb[_0x1217f5-0x1][_0x232def-0x1]+0x1:_0xdd1bdb[_0x1217f5][_0x232def]=Math['max'](_0xdd1bdb[_0x1217f5-0x1][_0x232def],_0xdd1bdb[_0x1217f5][_0x232def-0x1]);}}const _0x4f4c9b={'old':[],'new':[]};let _0x55bde3=_0x21d790,_0xafb3c8=_0x407b66;const _0x564f9a=[],_0x3d4e09=[];while(_0x55bde3>0x0||_0xafb3c8>0x0){if(_0x55bde3>0x0&&_0xafb3c8>0x0&&_0x34f537[_0x55bde3-0x1]===_0x327edc[_0xafb3c8-0x1])_0x564f9a['unshift']({'type':'equal','text':_0x34f537[_0x55bde3-0x1]}),_0x3d4e09['unshift']({'type':'equal','text':_0x327edc[_0xafb3c8-0x1]}),_0x55bde3--,_0xafb3c8--;else{if(_0xafb3c8>0x0&&(_0x55bde3===0x0||_0xdd1bdb[_0x55bde3][_0xafb3c8-0x1]>=_0xdd1bdb[_0x55bde3-0x1][_0xafb3c8]))_0x3d4e09['unshift']({'type':'insert','text':_0x327edc[_0xafb3c8-0x1]}),_0xafb3c8--;else _0x55bde3>0x0&&(_0x564f9a['unshift']({'type':'delete','text':_0x34f537[_0x55bde3-0x1]}),_0x55bde3--);}}return _0x4f4c9b['old']=_0x564f9a,_0x4f4c9b['new']=_0x3d4e09,_0x4f4c9b;}export function renderDiffLineWithWordHighlight(_0x4a133b,_0x3df9c0,_0x502a32,_0x247517){if(!_0x3df9c0||_0x3df9c0['length']===0x0)return highlightDiffLine(_0x4a133b,_0x247517);let _0x3a911a='';const _0x4813c2=_0x502a32==='add'?'diff-word-add':'diff-word-remove',_0x39a1f4=_0x502a32==='add'?'insert':'delete';for(const _0x41c0a6 of _0x3df9c0){const _0x12e19b=Utils['escapeHtml'](_0x41c0a6['text']);_0x41c0a6['type']===_0x39a1f4?_0x3a911a+='<span\x20class=\x22'+_0x4813c2+'\x22>'+_0x12e19b+'</span>':_0x3a911a+=_0x12e19b;}return _0x3a911a;}export function calculateDiffStats(_0x4ce79b){let _0x35f005=0x0,_0x563c6e=0x0,_0x381758=0x0;return _0x4ce79b['forEach'](_0x2716f1=>{let _0x307b05=0x0,_0x15c2b8=0x0;_0x2716f1['hunks']['forEach'](_0xa5dc4d=>{_0xa5dc4d['lines']['forEach'](_0x1ae7a1=>{if(_0x1ae7a1['startsWith']('+'))_0x307b05+=0x1;else{if(_0x1ae7a1['startsWith']('-'))_0x15c2b8+=0x1;}});}),(_0x307b05+_0x15c2b8>0x0||_0x2716f1['isDeleted'])&&(_0x381758+=0x1),_0x35f005+=_0x307b05,_0x563c6e+=_0x15c2b8;}),{'additions':_0x35f005,'deletions':_0x563c6e,'files':_0x381758};}export function getFileStatus(_0x1988a1,_0x197b42,_0x34ad94){if(_0x1988a1['isDeleted'])return'deleted';if(_0x197b42>0x0&&_0x34ad94===0x0)return'added';return'modified';}export function safeBase64(_0x26a96d){try{return btoa(unescape(encodeURIComponent(_0x26a96d)));}catch(_0x49d570){return btoa(_0x26a96d);}}export function getStorageKey(_0x50cb68,_0x1d4e8f){return _0x50cb68+'-'+safeBase64(_0x1d4e8f);}export function getCollapsedState(_0x479140,_0xadbfa9){const _0x244af5=localStorage['getItem'](getStorageKey(_0x479140,_0xadbfa9));return _0x244af5==='true';}export function renderUnifiedDiff(_0x152fa3,_0x54c347){return _0x152fa3['map']((_0x2b497b,_0x95842)=>{const _0x20c221=_0x2b497b['newPath']||_0x2b497b['oldPath']||'unknown',_0x5313e4='diff-'+_0x54c347+'-'+_0x95842,_0x33f746=getFileLanguage(_0x20c221),{additions:_0x175f86,deletions:_0x5eb513}=calculateDiffStats([_0x2b497b]),_0x45d946=getCollapsedState(_0x54c347,_0x20c221),_0x51d46c=getFileStatus(_0x2b497b,_0x175f86,_0x5eb513),_0x249ae7=_0x51d46c==='added'?'A':_0x51d46c==='deleted'?'D':'M',_0x3d20aa=_0x2b497b['hunks']['map'](_0x21dc4f=>{const {oldStart:_0x2c17f9,newStart:_0x1d1def}=parseHunkHeader(_0x21dc4f['header']);let _0x13d223=_0x2c17f9,_0x48c172=_0x1d1def;const _0x2dde17=_0x21dc4f['lines']['map'](_0x14cfb0=>({'line':_0x14cfb0,'type':_0x14cfb0['startsWith']('+')?'add':_0x14cfb0['startsWith']('-')?'remove':_0x14cfb0['startsWith']('\x5c')?'meta':'context'}));let _0x4e3ca6=0x0;while(_0x4e3ca6<_0x2dde17['length']){if(_0x2dde17[_0x4e3ca6]['type']==='remove'){let _0x39d270=_0x4e3ca6,_0x55ce30=_0x4e3ca6;while(_0x55ce30<_0x2dde17['length']&&_0x2dde17[_0x55ce30]['type']==='remove')_0x55ce30++;let _0x2f7bc3=_0x55ce30,_0x51c64e=_0x2f7bc3;while(_0x51c64e<_0x2dde17['length']&&_0x2dde17[_0x51c64e]['type']==='add')_0x51c64e++;const _0x4a355b=_0x55ce30-_0x39d270,_0x57190b=_0x51c64e-_0x2f7bc3,_0x5eabf5=Math['min'](_0x4a355b,_0x57190b);for(let _0x291d97=0x0;_0x291d97<_0x5eabf5;_0x291d97++){const _0x5d4e8c=_0x2dde17[_0x39d270+_0x291d97]['line']['substring'](0x1),_0x1b9f9f=_0x2dde17[_0x2f7bc3+_0x291d97]['line']['substring'](0x1),_0xc323e9=computeWordDiff(_0x5d4e8c,_0x1b9f9f);_0x2dde17[_0x39d270+_0x291d97]['wordDiff']=_0xc323e9['old'],_0x2dde17[_0x2f7bc3+_0x291d97]['wordDiff']=_0xc323e9['new'];}_0x4e3ca6=_0x51c64e;}else _0x4e3ca6++;}const _0x200918=_0x2dde17['map'](_0x4a96bb=>{const _0x1731c8=_0x4a96bb['line'];if(_0x1731c8['startsWith']('+')){const _0x3144d9=_0x1731c8['substring'](0x1),_0x2d4c2b=_0x4a96bb['wordDiff']?renderDiffLineWithWordHighlight(_0x3144d9,_0x4a96bb['wordDiff'],'add',_0x33f746):highlightDiffLine(_0x3144d9,_0x33f746),_0x19873f='<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>'+_0x48c172+'</span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>+</span>'+_0x2d4c2b+'</span></div>';return _0x48c172+=0x1,_0x19873f;}if(_0x1731c8['startsWith']('-')){const _0x59c3ed=_0x1731c8['substring'](0x1),_0x260b8f=_0x4a96bb['wordDiff']?renderDiffLineWithWordHighlight(_0x59c3ed,_0x4a96bb['wordDiff'],'remove',_0x33f746):highlightDiffLine(_0x59c3ed,_0x33f746),_0x3503be='<div\x20class=\x22diff-line\x20diff-remove\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x13d223+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>-</span>'+_0x260b8f+'</span></div>';return _0x13d223+=0x1,_0x3503be;}if(_0x1731c8['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'](_0x1731c8)+'</span></div>';const _0x34ba00=_0x1731c8['startsWith']('\x20')?_0x1731c8['substring'](0x1):_0x1731c8,_0x578fa2=highlightDiffLine(_0x34ba00,_0x33f746),_0x10b78a='<div\x20class=\x22diff-line\x20diff-context\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x13d223+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x48c172+'</span><span\x20class=\x22diff-line-content\x22>\x20'+_0x578fa2+'</span></div>';return _0x13d223+=0x1,_0x48c172+=0x1,_0x10b78a;})['join']('');return'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>'+Utils['escapeHtml'](_0x21dc4f['header'])+'</div>'+_0x200918+'</div>';})['join'](''),_0xa5729c=_0x3d20aa||'<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-'+_0x5313e4+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-header\x22\x20data-diff-id=\x22'+_0x5313e4+'\x22\x20data-file-name=\x22'+Utils['escapeHtml'](_0x20c221)+'\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'+_0x51d46c+'\x22>'+_0x249ae7+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-name\x22>'+Utils['escapeHtml'](_0x20c221)+'</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>+'+_0x175f86+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-del\x22>-'+_0x5eb513+'</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'+_0x5313e4+'\x22\x20data-collapsed=\x22'+_0x45d946+'\x22\x20type=\x22button\x22\x20aria-label=\x22'+(_0x45d946?'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'+(_0x45d946?'collapsed':'')+'\x22\x20id=\x22'+_0x5313e4+'\x22>'+_0xa5729c+'</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20';})['join']('');}
|