@profoundlogic/coderflow-server 0.8.0 → 0.8.1
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/base-image/coder-git-credential-helper +16 -0
- package/dist/base-image/sync-repos.sh +30 -1
- 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/compression-filter.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/memory-utils.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-aliases.js +1 -1
- package/dist/lib/task-container-init.js +1 -1
- package/dist/lib/task-context-usage.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/playwright.task-terminal.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/logs.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/stats.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/admin.css +95 -1
- package/dist/web-ui/public/admin.html +29 -1
- package/dist/web-ui/public/admin.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 +45 -0
- package/dist/web-ui/public/feedback-widget.js +1 -1
- package/dist/web-ui/public/file-selection-tree.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/ibmi-file-filter.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/permissions.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/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 +45 -0
- package/dist/web-ui/public/task-judging-helpers.js +1 -1
- package/dist/web-ui/public/task.html +25 -2
- 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(_0x4ae3bd){return _0x4ae3bd==='test'||_0x4ae3bd==='deploy';}export function createApproveDialogHTML(_0x1f0991='',_0x46a59d={}){const _0x292708=_0x1f0991,_0x2e4108=_0x46a59d['useTaskPageStyles']?'modal\x20profound-approve-modal':'profound-feedback-modal\x20profound-approve-modal',_0x465f7f=_0x46a59d['useTaskPageStyles']?'modal-warning':'approve-modal-warning',_0x4433cf=_0x46a59d['useTaskPageStyles']?'modal-error':'approve-modal-error';return'\x0a\x20\x20\x20\x20<div\x20id=\x22'+_0x292708+'approve-modal\x22\x20class=\x22'+_0x2e4108+'\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'+_0x292708+'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'+_0x292708+'approve-warning\x22\x20class=\x22'+_0x465f7f+'\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'+_0x292708+'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'+_0x292708+'approve-error\x22\x20class=\x22'+_0x4433cf+'\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'+_0x292708+'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'+_0x292708+'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'+_0x292708+'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'+_0x292708+'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'+_0x292708+'commit-message-input\x22>Commit\x20message:</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<textarea\x20id=\x22'+_0x292708+'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'+_0x292708+'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'+_0x292708+'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'+_0x292708+'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'+_0x292708+'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'+_0x292708+'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'+_0x292708+'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'+_0x292708+'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'+_0x292708+'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'+_0x292708+'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'+_0x292708+'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'+_0x292708+'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'+_0x292708+'ibmi-sync-fields\x22\x20class=\x22new-branch-container\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x292708+'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'+_0x292708+'ibmi-sync-library\x22\x20class=\x22new-branch-input\x20code-font\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20maxlength=\x2210\x22\x20placeholder=\x22e.g.,\x20MYLIB\x22\x20style=\x22width:\x20160px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x292708+'ibmi-sync-credentials-row\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x292708+'ibmi-sync-user\x22\x20style=\x22margin-top:\x208px;\x20display:\x20block;\x22>User\x20profile</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0x292708+'ibmi-sync-user\x22\x20class=\x22new-branch-input\x20code-font\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20maxlength=\x2210\x22\x20placeholder=\x22e.g.,\x20MYUSER\x22\x20style=\x22width:\x20160px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0x292708+'ibmi-sync-password\x22\x20style=\x22margin-top:\x208px;\x20display:\x20block;\x22>Password</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22password\x22\x20id=\x22'+_0x292708+'ibmi-sync-password\x22\x20class=\x22new-branch-input\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20placeholder=\x22Enter\x20password\x22\x20style=\x22width:\x20160px;\x22\x20autocomplete=\x22off\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x292708+'ibmi-sync-files-section\x22\x20style=\x22margin-top:\x2010px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20style=\x22display:\x20block;\x20margin-bottom:\x204px;\x22>Files\x20to\x20sync</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x292708+'ibmi-sync-file-tree\x22\x20class=\x22file-selection-tree-container\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20style=\x22max-height:\x20250px;\x20overflow-y:\x20auto;\x20border:\x201px\x20solid\x20var(--border-color,\x20var(--color-border));\x20border-radius:\x204px;\x20padding:\x208px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-selection-summary\x22\x20id=\x22'+_0x292708+'ibmi-sync-files-summary\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-ghost\x22\x20id=\x22'+_0x292708+'cancel-approve\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x22\x20id=\x22'+_0x292708+'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(_0x831535={}){this['prefix']=_0x831535['prefix']||'',this['onApprove']=_0x831535['onApprove'],this['onSync']=_0x831535['onSync'],this['onSuccess']=_0x831535['onSuccess'],this['onError']=_0x831535['onError'],this['onCreatePR']=_0x831535['onCreatePR'],this['showToast']=_0x831535['showToast']||(()=>{}),this['container']=_0x831535['container']||document['body'],this['useTaskPageStyles']=_0x831535['useTaskPageStyles']||![],this['baseUrl']=_0x831535['baseUrl']||'',this['coderflowAttribution']=_0x831535['coderflowAttribution'],this['onSyncToIbmi']=_0x831535['onSyncToIbmi']||null,this['onGetSyncFiles']=_0x831535['onGetSyncFiles']||null,this['taskData']=null,this['initialized']=![],this['isSyncing']=![],this['_createPR']=![],this['_attributionRequestId']=0x0,this['_syncFileTree']=null,this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}['init'](){if(this['initialized'])return;const _0x495627=document['createElement']('div');_0x495627['innerHTML']=createApproveDialogHTML(this['prefix'],{'useTaskPageStyles':this['useTaskPageStyles']}),this['container']['appendChild'](_0x495627['firstElementChild']),this['_bindEvents'](),this['initialized']=!![];}['_el'](_0x17d9b0){return document['getElementById'](''+this['prefix']+_0x17d9b0);}['_bindEvents'](){const _0x616830=this['_el']('approve-modal'),_0x40073b=this['_el']('close-approve-modal'),_0x323657=this['_el']('cancel-approve'),_0x2ef3be=this['_el']('confirm-approve'),_0x40c32d=_0x616830?.['querySelector']('.modal-overlay'),_0x43c0cc=this['_el']('create-new-branch'),_0xbf8a2d=this['_el']('new-branch-input-container'),_0x57d461=this['_el']('new-branch-name'),_0x21cf8e=this['_el']('push-after-commit'),_0x444289=this['_el']('create-pull-request'),_0x271546=this['_el']('pr-hint');_0x40073b?.['addEventListener']('click',()=>this['hide']()),_0x323657?.['addEventListener']('click',()=>this['hide']()),_0x40c32d?.['addEventListener']('click',()=>this['hide']()),_0x2ef3be?.['addEventListener']('click',()=>this['_handleApprove']());_0x43c0cc&&_0x43c0cc['addEventListener']('change',()=>{_0xbf8a2d&&(_0xbf8a2d['hidden']=!_0x43c0cc['checked']),_0x43c0cc['checked']&&_0x57d461&&_0x57d461['focus']();});_0x444289&&_0x21cf8e&&_0x43c0cc&&(_0x444289['addEventListener']('change',()=>{this['_createPR']=_0x444289['checked'];if(_0x444289['checked']){_0x21cf8e['checked']=!![],_0x21cf8e['disabled']=!![],_0x43c0cc['checked']=!![],_0x43c0cc['disabled']=!![];_0xbf8a2d&&(_0xbf8a2d['hidden']=![]);if(_0x271546)_0x271546['hidden']=![];}else{_0x21cf8e['disabled']=![],_0x43c0cc['disabled']=![];if(_0x271546)_0x271546['hidden']=!![];}}),_0x21cf8e['addEventListener']('change',()=>{if(!_0x21cf8e['checked']&&_0x444289['checked']){_0x444289['checked']=![],this['_createPR']=![],_0x21cf8e['disabled']=![],_0x43c0cc['disabled']=![];if(_0x271546)_0x271546['hidden']=!![];}}));const _0x461f7a=this['_el']('sync-to-ibmi');_0x461f7a&&_0x461f7a['addEventListener']('change',async _0x1842d5=>{const _0x5a9b53=this['_el']('ibmi-sync-fields');if(_0x5a9b53)_0x5a9b53['hidden']=!_0x1842d5['target']['checked'];if(_0x1842d5['target']['checked']){const _0x9927b1=this['_el']('ibmi-sync-library'),_0x161d08=localStorage['getItem']('coderflow_ibmi_sync_library');_0x161d08&&_0x9927b1&&!_0x9927b1['value']&&(_0x9927b1['value']=_0x161d08);const _0x57773d=this['_el']('ibmi-sync-user');if(_0x57773d&&!_0x57773d['value']){const _0x102027=localStorage['getItem']('coderflow_ibmi_sync_user');if(_0x102027)_0x57773d['value']=_0x102027;}const _0x1d4346=this['_el']('ibmi-sync-password');if(_0x1d4346)_0x1d4346['value']='';!this['_syncFileTree']&&this['onGetSyncFiles']&&this['taskData']?.['taskId']&&await this['_loadSyncFileTree']();}}),document['addEventListener']('keydown',_0x51eafe=>{_0x51eafe['key']==='Escape'&&_0x616830&&!_0x616830['hidden']&&this['hide']();});}async['_loadSyncFileTree'](){const _0x55c964=this['_el']('ibmi-sync-file-tree'),_0x49fdd0=this['_el']('ibmi-sync-files-summary');if(!_0x55c964)return;_0x55c964['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>Loading\x20files...</span>';if(_0x49fdd0)_0x49fdd0['textContent']='';try{const {files:_0x127fc6,absolutePaths:_0x28f58b}=await this['onGetSyncFiles'](this['taskData']['taskId']);this['_syncRelativeFiles']=_0x127fc6,this['_syncAbsolutePaths']=_0x28f58b;if(_0x127fc6['length']===0x0){_0x55c964['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>No\x20changed\x20files\x20found.</span>';return;}const {FileSelectionTree:_0x4e9e7d}=await import('./file-selection-tree.js'),{validateIbmiFile:_0x5a695b,hasKnownIbmiExtension:_0x4fe1c3}=await import('./ibmi-file-filter.js');this['_syncFileTree']=new _0x4e9e7d({'container':_0x55c964,'files':_0x127fc6,'isPreselected':_0x2d94e1=>{const {valid:_0x37caab}=_0x5a695b(_0x2d94e1);return _0x37caab&&_0x4fe1c3(_0x2d94e1);},'isDisabled':_0x26275e=>{const {valid:_0x40d123,reason:_0x2ff64b}=_0x5a695b(_0x26275e);return{'disabled':!_0x40d123,'reason':_0x2ff64b};},'isAutoCheckEligible':_0x15fd77=>{const {valid:_0x15ec75}=_0x5a695b(_0x15fd77);return _0x15ec75&&_0x4fe1c3(_0x15fd77);},'onChange':_0x2ddf8f=>{_0x49fdd0&&(_0x49fdd0['textContent']=_0x2ddf8f['length']+'\x20of\x20'+_0x127fc6['length']+'\x20file'+(_0x127fc6['length']!==0x1?'s':'')+'\x20selected');}}),this['_syncFileTree']['render']();}catch(_0x399dc9){_0x55c964['innerHTML']='<span\x20style=\x22color:\x20var(--color-danger,\x20#e55368);\x20font-size:\x2013px;\x22>Failed\x20to\x20load\x20files</span>';}}['showError'](_0x407d31){const _0xf45f32=this['_el']('approve-error'),_0x39a8c=this['_el']('approve-error-text');_0xf45f32&&_0x39a8c&&(_0x39a8c['textContent']=_0x407d31,_0xf45f32['hidden']=![],_0xf45f32['scrollIntoView']({'behavior':'smooth','block':'nearest'}));}['hideError'](){const _0x44d241=this['_el']('approve-error'),_0xfd6daf=this['_el']('approve-error-text');_0x44d241&&_0xfd6daf&&(_0x44d241['hidden']=!![],_0xfd6daf['textContent']='');}['_displayBranchInfo'](_0x2c1399,_0x5d77c1={}){const _0x51bd1d=this['_el']('approve-branches');if(!_0x51bd1d)return;const _0x27623a=[];for(const _0x400a0f of _0x2c1399){_0x5d77c1[_0x400a0f['name']]&&_0x27623a['push']({'repo':_0x400a0f['name'],'branch':_0x5d77c1[_0x400a0f['name']]});}if(_0x27623a['length']>0x0){_0x51bd1d['hidden']=![];if(_0x27623a['length']===0x1)_0x51bd1d['innerHTML']='<div\x20class=\x22branch-info\x22>Branch:\x20<code>'+_0x27623a[0x0]['branch']+'</code></div>';else{const _0x3d7fa4=_0x27623a['map'](_0x1bda36=>'<div\x20class=\x22branch-item\x22><strong>'+_0x1bda36['repo']+':</strong>\x20<code>'+_0x1bda36['branch']+'</code></div>')['join']('');_0x51bd1d['innerHTML']='<div\x20class=\x22branch-info\x22>Branches:<div\x20class=\x22branch-list\x22>'+_0x3d7fa4+'</div></div>';}}else _0x51bd1d['hidden']=!![],_0x51bd1d['innerHTML']='';}['showWarning'](_0x4039a4){const _0x3032f5=this['_el']('approve-warning'),_0x4e659f=this['_el']('approve-warning-text');_0x3032f5&&_0x4e659f&&(_0x4e659f['textContent']=_0x4039a4,_0x3032f5['hidden']=![]);}['hideWarning'](){const _0x1b40a0=this['_el']('approve-warning'),_0x1c22db=this['_el']('approve-warning-text');_0x1b40a0&&_0x1c22db&&(_0x1b40a0['hidden']=!![],_0x1c22db['textContent']='');}['_stripCoAuthoredByLines'](_0x5c0182){return _0x5c0182['replace'](/^Co-Authored-By:.*$/gmi,'')['replace'](/^Learn more: https:\/\/coderflow\.ai\s*$/gm,'')['replace'](/\n{3,}/g,'\x0a\x0a')['trim']();}async['_addAttributionIfEnabled'](_0x265f1e){try{let _0x20f409;try{const _0x1494f1=await fetch(this['baseUrl']+'/settings');if(_0x1494f1['ok']){const _0x2a1837=await _0x1494f1['json']();_0x20f409=_0x2a1837['coderflow_attribution']!==![];}}catch(_0x63d745){}_0x20f409===undefined&&(this['coderflowAttribution']!==undefined?_0x20f409=this['coderflowAttribution']!==![]:_0x20f409=!![]);const _0x30b1f1=this['_stripCoAuthoredByLines'](_0x265f1e);if(!_0x20f409)return _0x30b1f1;const _0x18b2d4='\x0a\x0aCo-Authored-By:\x20CoderFlow\x20<ai@coderflow.ai>\x0aLearn\x20more:\x20https://coderflow.ai';return _0x30b1f1+_0x18b2d4;}catch(_0x4072fd){return console['warn']('Failed\x20to\x20add\x20CoderFlow\x20attribution:',_0x4072fd),_0x265f1e;}}['show'](_0x406eae){!this['initialized']&&this['init']();this['taskData']=_0x406eae;const _0x1b5c99=this['_el']('approve-modal'),_0x55ce44=this['_el']('commit-message-input'),_0x3f792f=this['_el']('pull-before-commit'),_0x270deb=this['_el']('push-after-commit'),_0x1d9714=this['_el']('create-new-branch'),_0x2113e3=this['_el']('new-branch-input-container'),_0x16f7eb=this['_el']('new-branch-name'),_0x327569=this['_el']('approve-repo-name'),_0x3f5077=this['_el']('approve-stats'),_0x4057ba=this['_el']('multi-repo-note');if(!_0x1b5c99)return;this['hideError'](),this['hideWarning']();_0x406eae['warning']&&this['showWarning'](_0x406eae['warning']);const _0x2e787b=_0x406eae['reposChanged']||[];if(_0x2e787b['length']===0x0&&!_0x406eae['syncFirst']){this['showToast']('No\x20changes\x20to\x20approve','error');return;}this['_updateDisplay'](_0x2e787b,_0x406eae);const _0x1cd248=_0x406eae['commitMessage']||'',_0x102ec6=this['_stripCoAuthoredByLines'](_0x1cd248);_0x55ce44['value']=_0x102ec6;if(_0x3f792f)_0x3f792f['checked']=!![];if(_0x270deb)_0x270deb['checked']=!![];_0x1d9714&&(_0x1d9714['checked']=![]);_0x2113e3&&(_0x2113e3['hidden']=!![]);_0x16f7eb&&(_0x16f7eb['value']='');if(_0x270deb)_0x270deb['disabled']=![];if(_0x1d9714)_0x1d9714['disabled']=![];this['updatePRSupport'](_0x406eae['prSupported']===!![]);const _0x148335=this['_el']('ibmi-sync-section');if(_0x148335){_0x148335['hidden']=!_0x406eae['ibmiSyncAvailable'];const _0x2cf5f8=this['_el']('sync-to-ibmi'),_0x7d1b23=this['_el']('ibmi-sync-fields'),_0x46feb4=this['_el']('ibmi-sync-library');if(_0x2cf5f8)_0x2cf5f8['checked']=![];if(_0x7d1b23)_0x7d1b23['hidden']=!![];if(_0x46feb4)_0x46feb4['value']='';const _0x437acc=this['_el']('ibmi-sync-credentials-row');_0x437acc&&(_0x437acc['hidden']=!(_0x406eae['ibmiSyncAvailable']&&_0x406eae['syncCredentials']==='prompt'));}const _0x4bed1d=this['_el']('confirm-approve');_0x406eae['syncFirst']&&this['onSync']?(_0x4bed1d&&(_0x4bed1d['disabled']=!![],_0x4bed1d['textContent']='Syncing...'),this['_performSync']()):_0x4bed1d&&(_0x4bed1d['disabled']=![],_0x4bed1d['textContent']='Commit\x20Changes');_0x1b5c99['hidden']=![];const _0x66de21=++this['_attributionRequestId'];void this['_applyAttributionAsync']({'requestId':_0x66de21,'taskId':_0x406eae['taskId'],'originalCommitMessage':_0x102ec6}),setTimeout(()=>{_0x55ce44['focus'](),_0x55ce44['setSelectionRange'](0x0,_0x55ce44['value']['length']);},0x64);}['updatePRSupport'](_0x73755c){const _0x31b57c=this['_el']('pr-option-section'),_0x627e5e=this['_el']('create-pull-request'),_0x3e8d6d=this['_el']('pr-hint'),_0x1230e1=this['_el']('push-after-commit'),_0x1ffe58=this['_el']('create-new-branch');if(!_0x31b57c)return;if(_0x73755c){_0x31b57c['hidden']=![];_0x627e5e&&!_0x627e5e['disabled']&&(_0x627e5e['checked']=![]);if(_0x3e8d6d)_0x3e8d6d['hidden']=!![];this['_createPR']=![];return;}_0x627e5e?.['checked']&&(_0x627e5e['checked']=![]);if(_0x3e8d6d)_0x3e8d6d['hidden']=!![];if(_0x1230e1)_0x1230e1['disabled']=![];if(_0x1ffe58)_0x1ffe58['disabled']=![];this['_createPR']=![],_0x31b57c['hidden']=!![];}async['_applyAttributionAsync']({requestId:_0x5db040,taskId:_0x47b26a,originalCommitMessage:_0x1e8d5e}){const _0x4de1ee=this['_el']('commit-message-input');if(!_0x4de1ee)return;const _0x5da257=await this['_addAttributionIfEnabled'](_0x1e8d5e);if(_0x5db040!==this['_attributionRequestId'])return;if(!this['taskData']||this['taskData']['taskId']!==_0x47b26a)return;if(!this['isVisible']())return;const _0x2aa289=_0x2b6bcd=>_0x2b6bcd['replace'](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a');if(_0x2aa289(_0x4de1ee['value'])!==_0x2aa289(_0x1e8d5e))return;_0x4de1ee['value']=_0x5da257;}['_updateDisplay'](_0x47037f,_0x18ff26){const _0x280570=this['_el']('approve-repo-name'),_0x1a628f=this['_el']('approve-stats'),_0x40c6ef=this['_el']('multi-repo-note');if(_0x47037f['length']===0x0){if(_0x280570)_0x280570['textContent']='Syncing...';if(_0x1a628f)_0x1a628f['textContent']='';if(_0x40c6ef)_0x40c6ef['hidden']=!![];return;}const _0x4d49ba=_0x47037f['reduce']((_0x4d44d6,_0x2b97c4)=>_0x4d44d6+(_0x2b97c4['files_changed']||0x0),0x0),_0x593a7c=_0x47037f['reduce']((_0x1df54f,_0x26dd53)=>_0x1df54f+(_0x26dd53['lines_added']||0x0),0x0),_0x59a3d6=_0x47037f['reduce']((_0x525aa8,_0x1362b8)=>_0x525aa8+(_0x1362b8['lines_deleted']||0x0),0x0);if(_0x47037f['length']===0x1){if(_0x280570)_0x280570['textContent']=_0x47037f[0x0]?.['name']||'repository';if(_0x40c6ef)_0x40c6ef['hidden']=!![];}else{const _0x169a75=_0x47037f['map'](_0x5f24d5=>_0x5f24d5['name'])['join'](',\x20');if(_0x280570)_0x280570['textContent']=_0x47037f['length']+'\x20repositories:\x20'+_0x169a75;if(_0x40c6ef)_0x40c6ef['hidden']=![];}_0x1a628f&&(_0x1a628f['textContent']=_0x4d49ba+'\x20file'+(_0x4d49ba===0x1?'':'s')+'\x20changed\x20(+'+_0x593a7c+'\x20-'+_0x59a3d6+')'),this['_displayBranchInfo'](_0x47037f,_0x18ff26?.['branches']||{});}async['_performSync'](){if(!this['onSync']||this['isSyncing'])return;this['isSyncing']=!![];const _0x559bf8=this['_el']('confirm-approve');try{const _0x4faf9b=await this['onSync'](this['taskData']['taskId']);if(!this['isVisible']()){this['isSyncing']=![];return;}if(_0x4faf9b['repos_changed']){const _0x49c7d2=this['taskData']['reposChanged']?.['length']||0x0,_0x31ce65=this['taskData']['reposChanged']?.['reduce']((_0x130c51,_0x8a3d51)=>_0x130c51+(_0x8a3d51['files_changed']||0x0),0x0)||0x0;this['taskData']['reposChanged']=_0x4faf9b['repos_changed'];if(_0x4faf9b['current_branches']){const _0x12a80b={...this['taskData']['branches']||{}};for(const [_0x44e4b1,_0x4cb5ea]of Object['entries'](_0x4faf9b['current_branches'])){_0x4cb5ea?_0x12a80b[_0x44e4b1]=_0x4cb5ea:delete _0x12a80b[_0x44e4b1];}this['taskData']['branches']=_0x12a80b;}this['_updateDisplay'](_0x4faf9b['repos_changed'],this['taskData']);const _0x372677=_0x4faf9b['repos_changed']['length'],_0x275da0=_0x4faf9b['repos_changed']['reduce']((_0x3b80e4,_0x3c17c4)=>_0x3b80e4+(_0x3c17c4['files_changed']||0x0),0x0);(_0x275da0>_0x31ce65||_0x372677>_0x49c7d2)&&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.');}_0x559bf8&&(!this['taskData']['reposChanged']||this['taskData']['reposChanged']['length']===0x0?(_0x559bf8['disabled']=!![],_0x559bf8['textContent']='No\x20Changes',this['showError']('No\x20changes\x20to\x20approve\x20after\x20sync')):(_0x559bf8['disabled']=![],_0x559bf8['textContent']='Commit\x20Changes'));}catch(_0x505dae){console['error']('Failed\x20to\x20sync\x20repos\x20before\x20approve:',_0x505dae);if(!this['isVisible']()){this['isSyncing']=![];return;}this['showError']('Sync\x20failed:\x20'+_0x505dae['message']+'.\x20You\x20can\x20still\x20commit\x20with\x20existing\x20staged\x20changes.'),_0x559bf8&&(this['taskData']['reposChanged']&&this['taskData']['reposChanged']['length']>0x0?(_0x559bf8['disabled']=![],_0x559bf8['textContent']='Commit\x20Changes'):(_0x559bf8['disabled']=!![],_0x559bf8['textContent']='No\x20Changes'));}finally{this['isSyncing']=![];}}['hide'](){const _0x19273=this['_el']('approve-modal');_0x19273&&(_0x19273['hidden']=!![]),this['_syncFileTree']&&(this['_syncFileTree']['destroy'](),this['_syncFileTree']=null),this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}async['_handleApprove'](){const _0x45cce7=this['_el']('commit-message-input'),_0x152b35=this['_el']('pull-before-commit'),_0x309622=this['_el']('push-after-commit'),_0x3572b0=this['_el']('create-new-branch'),_0x28951d=this['_el']('new-branch-name'),_0x2cb813=this['_el']('confirm-approve'),_0x3fec76=_0x45cce7['value']['trim'](),_0x318100=_0x152b35?.['checked']??!![],_0x5db964=_0x309622?.['checked']??!![],_0x369a14=_0x3572b0?.['checked']||![],_0x3b1356=_0x28951d?.['value']['trim']()||'';this['hideError']();if(!_0x3fec76){this['showError']('Commit\x20message\x20is\x20required'),_0x45cce7['focus']();return;}if(_0x369a14&&!_0x3b1356){this['showError']('Branch\x20name\x20is\x20required\x20when\x20creating\x20a\x20new\x20branch'),_0x28951d?.['focus']();return;}if(_0x369a14&&_0x3b1356){const _0x446ce7=/[\s~^:?*\[\\]/;if(_0x446ce7['test'](_0x3b1356)){this['showError']('Invalid\x20branch\x20name.\x20Avoid\x20spaces\x20and\x20special\x20characters\x20like\x20~\x20^\x20:\x20?\x20*\x20[\x20\x5c'),_0x28951d?.['focus']();return;}}const _0x15ef0f=this['_el']('sync-to-ibmi')?.['checked'];if(_0x15ef0f){const _0x4dad2d=this['_el']('ibmi-sync-library')?.['value']?.['trim']();if(!_0x4dad2d){this['showError']('IBM\x20i\x20library\x20name\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-library')?.['focus']();return;}if(this['_syncFileTree']){const _0x4716f8=this['_syncFileTree']['getSelectedFiles']();if(_0x4716f8['length']===0x0){this['showError']('Select\x20at\x20least\x20one\x20file\x20to\x20sync');return;}}if(this['taskData']?.['syncCredentials']==='prompt'){const _0x834e9e=this['_el']('ibmi-sync-user')?.['value']?.['trim']();if(!_0x834e9e){this['showError']('User\x20profile\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-user')?.['focus']();return;}const _0x18c2aa=this['_el']('ibmi-sync-password')?.['value'];if(!_0x18c2aa){this['showError']('Password\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-password')?.['focus']();return;}}}const _0x34f0dc=_0x2cb813?.['textContent']||'Commit\x20Changes';_0x2cb813&&(_0x2cb813['disabled']=!![],_0x369a14?_0x2cb813['textContent']='Creating\x20branch\x20&\x20committing...':_0x2cb813['textContent']=_0x318100?'Pulling\x20&\x20Committing...':'Committing...');try{const _0x2abac6={'commit_message':_0x3fec76,'pull':_0x318100,'push':_0x5db964};_0x369a14&&_0x3b1356&&(_0x2abac6['new_branch']=_0x3b1356);let _0x2f06f7=null;this['onApprove']&&(_0x2f06f7=await this['onApprove'](this['taskData']['taskId'],_0x2abac6));let _0x12b5e9='Changes\x20committed';if(_0x369a14)_0x12b5e9='Changes\x20committed\x20to\x20new\x20branch\x20\x27'+_0x3b1356+'\x27',_0x5db964&&(_0x12b5e9+='\x20and\x20pushed');else{if(_0x318100&&_0x5db964)_0x12b5e9='Changes\x20pulled,\x20committed,\x20and\x20pushed';else{if(_0x318100)_0x12b5e9='Changes\x20pulled\x20and\x20committed';else _0x5db964&&(_0x12b5e9='Changes\x20committed\x20and\x20pushed');}}const _0x1dd2c2=this['_el']('sync-to-ibmi')?.['checked'];let _0xf970f5=null,_0x53d65f=null,_0x5c63c9=null,_0x48cfb2=null;if(_0x1dd2c2&&this['onSyncToIbmi']){_0xf970f5=this['_el']('ibmi-sync-library')?.['value']?.['trim']()?.['toUpperCase'](),_0x53d65f=this['_el']('ibmi-sync-user')?.['value']?.['trim']()?.['toUpperCase']()||null,_0x5c63c9=this['_el']('ibmi-sync-password')?.['value']||null;if(this['_syncFileTree']&&this['_syncRelativeFiles']&&this['_syncAbsolutePaths']){const _0x3a3cae=this['_syncFileTree']['getSelectedFiles']();_0x48cfb2=_0x3a3cae['map'](_0x3003d4=>{const _0x48c089=this['_syncRelativeFiles']['indexOf'](_0x3003d4);return _0x48c089>=0x0?this['_syncAbsolutePaths'][_0x48c089]:_0x3003d4;});}}this['showToast'](_0x12b5e9,'success'),this['hide']();if(this['_createPR']&&this['onCreatePR'])try{await this['onCreatePR'](this['taskData']['taskId'],_0x2f06f7||{});}catch(_0x4625f8){console['warn']('PR\x20creation\x20failed\x20or\x20cancelled:',_0x4625f8);}if(_0x1dd2c2&&this['onSyncToIbmi']&&_0xf970f5){localStorage['setItem']('coderflow_ibmi_sync_library',_0xf970f5);if(_0x53d65f)localStorage['setItem']('coderflow_ibmi_sync_user',_0x53d65f);try{await this['onSyncToIbmi'](this['taskData']['taskId'],_0xf970f5,_0x53d65f,_0x5c63c9,_0x48cfb2);}catch(_0x22e1d0){this['showToast']('Sync\x20failed:\x20'+_0x22e1d0['message'],'error');}}this['onSuccess']&&this['onSuccess'](this['taskData']);}catch(_0x25d97a){console['error']('Failed\x20to\x20approve\x20changes',_0x25d97a),this['showError']('Failed\x20to\x20commit:\x20'+_0x25d97a['message']),_0x2cb813&&(_0x2cb813['disabled']=![],_0x2cb813['textContent']=_0x34f0dc),this['onError']&&this['onError'](_0x25d97a);}}['isVisible'](){const _0x1c29a8=this['_el']('approve-modal');return _0x1c29a8&&!_0x1c29a8['hidden'];}['destroy'](){const _0xceef1a=this['_el']('approve-modal');_0xceef1a&&_0xceef1a['remove'](),this['initialized']=![];}}export function getApproveState(_0x37ff46,_0x46561e){if(!_0x37ff46)return{'canApprove':![],'reason':'No\x20task\x20data'};if(isLogOnlyTaskType(_0x37ff46['taskType']))return{'canApprove':![],'reason':(_0x37ff46['taskType']==='test'?'Test':'Deploy')+'\x20tasks\x20cannot\x20be\x20approved'};const _0x13cdcc=_0x46561e?.['repos_changed']?.['length']>0x0,_0x1e4afa=_0x37ff46['status']==='completed'||_0x37ff46['status']==='failed'||_0x37ff46['status']==='interrupted',_0x599a12=_0x37ff46['containerState']==='running',_0x311b76=_0x37ff46['approvedBy']!==undefined&&_0x37ff46['approvedBy']!==null;if(_0x311b76){const _0x22f735=_0x37ff46['approvedBy']['name']||_0x37ff46['approvedBy']['username']||'user';return{'canApprove':![],'reason':'Already\x20approved\x20by\x20'+_0x22f735};}if(!_0x13cdcc)return{'canApprove':![],'reason':'No\x20changes\x20to\x20approve'};if(!_0x1e4afa)return{'canApprove':![],'reason':'Task\x20must\x20complete\x20first'};if(!_0x37ff46['containerId'])return{'canApprove':![],'reason':'Container\x20no\x20longer\x20available'};if(!_0x599a12)return{'canApprove':![],'reason':'Container\x20is\x20not\x20running'};return{'canApprove':!![],'reason':'Ready\x20to\x20approve'};}
|
|
1
|
+
function isLogOnlyTaskType(_0x5ef42b){return _0x5ef42b==='test'||_0x5ef42b==='deploy';}export function createApproveDialogHTML(_0x225422='',_0x2c84d8={}){const _0xb7849b=_0x225422,_0x110199=_0x2c84d8['useTaskPageStyles']?'modal\x20profound-approve-modal':'profound-feedback-modal\x20profound-approve-modal',_0x5324f3=_0x2c84d8['useTaskPageStyles']?'modal-warning':'approve-modal-warning',_0x3c5abe=_0x2c84d8['useTaskPageStyles']?'modal-error':'approve-modal-error';return'\x0a\x20\x20\x20\x20<div\x20id=\x22'+_0xb7849b+'approve-modal\x22\x20class=\x22'+_0x110199+'\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'+_0xb7849b+'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'+_0xb7849b+'approve-warning\x22\x20class=\x22'+_0x5324f3+'\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'+_0xb7849b+'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'+_0xb7849b+'approve-error\x22\x20class=\x22'+_0x3c5abe+'\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'+_0xb7849b+'approve-error-text\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0xb7849b+'conflict-resolution\x22\x20class=\x22conflict-resolution-panel\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22conflict-resolution-message\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22warning-icon\x22>!</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Remote\x20has\x20conflicting\x20changes\x20that\x20couldn\x27t\x20be\x20merged\x20automatically.</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22conflict-resolution-options\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x20btn-small\x22\x20id=\x22'+_0xb7849b+'conflict-agent-resolve\x22>Let\x20the\x20agent\x20resolve\x20conflicts</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22>The\x20agent\x20will\x20pull\x20remote\x20changes,\x20resolve\x20conflicts,\x20and\x20prepare\x20for\x20re-approval.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-secondary\x20btn-small\x22\x20id=\x22'+_0xb7849b+'conflict-new-branch\x22>Create\x20a\x20new\x20branch\x20instead</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22>Avoids\x20the\x20conflict\x20by\x20committing\x20to\x20a\x20separate\x20branch.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-secondary\x20btn-small\x22\x20id=\x22'+_0xb7849b+'conflict-cancel\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-info\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0xb7849b+'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'+_0xb7849b+'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'+_0xb7849b+'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'+_0xb7849b+'commit-message-input\x22>Commit\x20message:</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<textarea\x20id=\x22'+_0xb7849b+'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'+_0xb7849b+'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'+_0xb7849b+'pull-before-commit\x22\x20checked>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Pull\x20from\x20remote\x20after\x20commit</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0xb7849b+'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'+_0xb7849b+'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'+_0xb7849b+'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'+_0xb7849b+'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'+_0xb7849b+'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'+_0xb7849b+'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'+_0xb7849b+'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'+_0xb7849b+'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'+_0xb7849b+'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'+_0xb7849b+'ibmi-sync-fields\x22\x20class=\x22new-branch-container\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0xb7849b+'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'+_0xb7849b+'ibmi-sync-library\x22\x20class=\x22new-branch-input\x20code-font\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20maxlength=\x2210\x22\x20placeholder=\x22e.g.,\x20MYLIB\x22\x20style=\x22width:\x20160px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0xb7849b+'ibmi-sync-credentials-row\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0xb7849b+'ibmi-sync-user\x22\x20style=\x22margin-top:\x208px;\x20display:\x20block;\x22>User\x20profile</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22text\x22\x20id=\x22'+_0xb7849b+'ibmi-sync-user\x22\x20class=\x22new-branch-input\x20code-font\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20maxlength=\x2210\x22\x20placeholder=\x22e.g.,\x20MYUSER\x22\x20style=\x22width:\x20160px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20for=\x22'+_0xb7849b+'ibmi-sync-password\x22\x20style=\x22margin-top:\x208px;\x20display:\x20block;\x22>Password</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22password\x22\x20id=\x22'+_0xb7849b+'ibmi-sync-password\x22\x20class=\x22new-branch-input\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20placeholder=\x22Enter\x20password\x22\x20style=\x22width:\x20160px;\x22\x20autocomplete=\x22off\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0xb7849b+'ibmi-sync-files-section\x22\x20style=\x22margin-top:\x2010px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20style=\x22display:\x20block;\x20margin-bottom:\x204px;\x22>Files\x20to\x20sync</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0xb7849b+'ibmi-sync-file-tree\x22\x20class=\x22file-selection-tree-container\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20style=\x22max-height:\x20250px;\x20overflow-y:\x20auto;\x20border:\x201px\x20solid\x20var(--border-color,\x20var(--color-border));\x20border-radius:\x204px;\x20padding:\x208px;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-selection-summary\x22\x20id=\x22'+_0xb7849b+'ibmi-sync-files-summary\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-footer\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-ghost\x22\x20id=\x22'+_0xb7849b+'cancel-approve\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x22\x20id=\x22'+_0xb7849b+'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(_0x42303c={}){this['prefix']=_0x42303c['prefix']||'',this['onApprove']=_0x42303c['onApprove'],this['onSync']=_0x42303c['onSync'],this['onSuccess']=_0x42303c['onSuccess'],this['onError']=_0x42303c['onError'],this['onCreatePR']=_0x42303c['onCreatePR'],this['showToast']=_0x42303c['showToast']||(()=>{}),this['container']=_0x42303c['container']||document['body'],this['useTaskPageStyles']=_0x42303c['useTaskPageStyles']||![],this['baseUrl']=_0x42303c['baseUrl']||'',this['coderflowAttribution']=_0x42303c['coderflowAttribution'],this['onConflictFollowUp']=_0x42303c['onConflictFollowUp']||null,this['onSyncToIbmi']=_0x42303c['onSyncToIbmi']||null,this['onGetSyncFiles']=_0x42303c['onGetSyncFiles']||null,this['taskData']=null,this['initialized']=![],this['isSyncing']=![],this['_createPR']=![],this['_attributionRequestId']=0x0,this['_syncFileTree']=null,this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null,this['_transientWarning']='';}['init'](){if(this['initialized'])return;const _0x5be797=document['createElement']('div');_0x5be797['innerHTML']=createApproveDialogHTML(this['prefix'],{'useTaskPageStyles':this['useTaskPageStyles']}),this['container']['appendChild'](_0x5be797['firstElementChild']),this['_bindEvents'](),this['initialized']=!![];}['_el'](_0x281648){return document['getElementById'](''+this['prefix']+_0x281648);}['_bindEvents'](){const _0x59f759=this['_el']('approve-modal'),_0x225b94=this['_el']('close-approve-modal'),_0x45d206=this['_el']('cancel-approve'),_0x190560=this['_el']('confirm-approve'),_0x47bf39=_0x59f759?.['querySelector']('.modal-overlay'),_0x446388=this['_el']('pull-before-commit'),_0x24c065=this['_el']('create-new-branch'),_0x5e324f=this['_el']('new-branch-input-container'),_0x2c19d0=this['_el']('new-branch-name'),_0x3b0de0=this['_el']('push-after-commit'),_0x5a0309=this['_el']('create-pull-request'),_0x31b2d1=this['_el']('pr-hint'),_0x183e65=()=>{this['_refreshWarningBanner']();};_0x225b94?.['addEventListener']('click',()=>this['hide']()),_0x45d206?.['addEventListener']('click',()=>this['hide']()),_0x47bf39?.['addEventListener']('click',()=>this['hide']()),_0x190560?.['addEventListener']('click',()=>this['_handleApprove']());_0x24c065&&_0x24c065['addEventListener']('change',()=>{_0x5e324f&&(_0x5e324f['hidden']=!_0x24c065['checked']),_0x24c065['checked']&&_0x2c19d0&&_0x2c19d0['focus'](),_0x183e65();});_0x446388?.['addEventListener']('change',()=>{_0x183e65();});_0x5a0309&&_0x3b0de0&&_0x24c065&&(_0x5a0309['addEventListener']('change',()=>{this['_createPR']=_0x5a0309['checked'];if(_0x5a0309['checked']){_0x3b0de0['checked']=!![],_0x3b0de0['disabled']=!![],_0x24c065['checked']=!![],_0x24c065['disabled']=!![];_0x5e324f&&(_0x5e324f['hidden']=![]);if(_0x31b2d1)_0x31b2d1['hidden']=![];}else{_0x3b0de0['disabled']=![],_0x24c065['disabled']=![];if(_0x31b2d1)_0x31b2d1['hidden']=!![];}_0x183e65();}),_0x3b0de0['addEventListener']('change',()=>{if(!_0x3b0de0['checked']&&_0x5a0309['checked']){_0x5a0309['checked']=![],this['_createPR']=![],_0x3b0de0['disabled']=![],_0x24c065['disabled']=![];if(_0x31b2d1)_0x31b2d1['hidden']=!![];}}));_0x183e65();const _0x3219ad=this['_el']('sync-to-ibmi');_0x3219ad&&_0x3219ad['addEventListener']('change',async _0x2d3ed6=>{const _0xe10272=this['_el']('ibmi-sync-fields');if(_0xe10272)_0xe10272['hidden']=!_0x2d3ed6['target']['checked'];if(_0x2d3ed6['target']['checked']){const _0x386e19=this['_el']('ibmi-sync-library'),_0x19e1db=localStorage['getItem']('coderflow_ibmi_sync_library');_0x19e1db&&_0x386e19&&!_0x386e19['value']&&(_0x386e19['value']=_0x19e1db);const _0x3fb577=this['_el']('ibmi-sync-user');if(_0x3fb577&&!_0x3fb577['value']){const _0x43062b=localStorage['getItem']('coderflow_ibmi_sync_user');if(_0x43062b)_0x3fb577['value']=_0x43062b;}const _0x36fda0=this['_el']('ibmi-sync-password');if(_0x36fda0)_0x36fda0['value']='';!this['_syncFileTree']&&this['onGetSyncFiles']&&this['taskData']?.['taskId']&&await this['_loadSyncFileTree']();}}),this['_el']('conflict-agent-resolve')?.['addEventListener']('click',()=>{this['onConflictFollowUp']&&this['onConflictFollowUp'](this['taskData']['taskId']),this['hide'](),this['showToast']('Agent\x20is\x20resolving\x20conflicts.\x20Re-approve\x20when\x20it\x20finishes.','info');}),this['_el']('conflict-new-branch')?.['addEventListener']('click',()=>{this['_hideConflictResolution']();const _0x11564e=this['_el']('create-new-branch'),_0x91e394=this['_el']('new-branch-input-container'),_0x8e71e0=this['_el']('new-branch-name');if(_0x11564e)_0x11564e['checked']=!![];if(_0x91e394)_0x91e394['hidden']=![];if(_0x8e71e0)_0x8e71e0['focus']();_0x183e65();}),this['_el']('conflict-cancel')?.['addEventListener']('click',()=>this['hide']()),document['addEventListener']('keydown',_0x1da711=>{_0x1da711['key']==='Escape'&&_0x59f759&&!_0x59f759['hidden']&&this['hide']();});}async['_loadSyncFileTree'](){const _0x58cb77=this['_el']('ibmi-sync-file-tree'),_0x574492=this['_el']('ibmi-sync-files-summary');if(!_0x58cb77)return;_0x58cb77['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>Loading\x20files...</span>';if(_0x574492)_0x574492['textContent']='';try{const {files:_0x14adb7,absolutePaths:_0x34e8d1}=await this['onGetSyncFiles'](this['taskData']['taskId']);this['_syncRelativeFiles']=_0x14adb7,this['_syncAbsolutePaths']=_0x34e8d1;if(_0x14adb7['length']===0x0){_0x58cb77['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>No\x20changed\x20files\x20found.</span>';return;}const {FileSelectionTree:_0x15971c}=await import('./file-selection-tree.js'),{validateIbmiFile:_0x5f56bb,hasKnownIbmiExtension:_0x129eb3}=await import('./ibmi-file-filter.js');this['_syncFileTree']=new _0x15971c({'container':_0x58cb77,'files':_0x14adb7,'isPreselected':_0x44e6a1=>{const {valid:_0x4b901f}=_0x5f56bb(_0x44e6a1);return _0x4b901f&&_0x129eb3(_0x44e6a1);},'isDisabled':_0x197874=>{const {valid:_0x4494f6,reason:_0x502c26}=_0x5f56bb(_0x197874);return{'disabled':!_0x4494f6,'reason':_0x502c26};},'isAutoCheckEligible':_0x2f9d50=>{const {valid:_0x47ecf0}=_0x5f56bb(_0x2f9d50);return _0x47ecf0&&_0x129eb3(_0x2f9d50);},'onChange':_0x30fa2b=>{_0x574492&&(_0x574492['textContent']=_0x30fa2b['length']+'\x20of\x20'+_0x14adb7['length']+'\x20file'+(_0x14adb7['length']!==0x1?'s':'')+'\x20selected');}}),this['_syncFileTree']['render']();}catch(_0x2adf56){_0x58cb77['innerHTML']='<span\x20style=\x22color:\x20var(--color-danger,\x20#e55368);\x20font-size:\x2013px;\x22>Failed\x20to\x20load\x20files</span>';}}['showError'](_0x4b6629){const _0x5312b5=this['_el']('approve-error'),_0x1187dc=this['_el']('approve-error-text');_0x5312b5&&_0x1187dc&&(_0x1187dc['textContent']=_0x4b6629,_0x5312b5['hidden']=![],_0x5312b5['scrollIntoView']({'behavior':'smooth','block':'nearest'}));}['hideError'](){const _0x975064=this['_el']('approve-error'),_0x59a6ad=this['_el']('approve-error-text');_0x975064&&_0x59a6ad&&(_0x975064['hidden']=!![],_0x59a6ad['textContent']='');}['_displayBranchInfo'](_0x57d377,_0x591c0f={}){const _0x2443d2=this['_el']('approve-branches');if(!_0x2443d2)return;const _0x5b66f9=[];for(const _0x856ad8 of _0x57d377){_0x591c0f[_0x856ad8['name']]&&_0x5b66f9['push']({'repo':_0x856ad8['name'],'branch':_0x591c0f[_0x856ad8['name']]});}if(_0x5b66f9['length']>0x0){_0x2443d2['hidden']=![];if(_0x5b66f9['length']===0x1)_0x2443d2['innerHTML']='<div\x20class=\x22branch-info\x22>Branch:\x20<code>'+_0x5b66f9[0x0]['branch']+'</code></div>';else{const _0x1b192b=_0x5b66f9['map'](_0x4fb8d2=>'<div\x20class=\x22branch-item\x22><strong>'+_0x4fb8d2['repo']+':</strong>\x20<code>'+_0x4fb8d2['branch']+'</code></div>')['join']('');_0x2443d2['innerHTML']='<div\x20class=\x22branch-info\x22>Branches:<div\x20class=\x22branch-list\x22>'+_0x1b192b+'</div></div>';}}else _0x2443d2['hidden']=!![],_0x2443d2['innerHTML']='';}['showWarning'](_0x21319f){const _0x2e7cd1=this['_el']('approve-warning'),_0x57219c=this['_el']('approve-warning-text');_0x2e7cd1&&_0x57219c&&(_0x57219c['textContent']=_0x21319f,_0x2e7cd1['hidden']=![]);}['hideWarning'](){const _0x39aac8=this['_el']('approve-warning'),_0x4028be=this['_el']('approve-warning-text');_0x39aac8&&_0x4028be&&(_0x39aac8['hidden']=!![],_0x4028be['textContent']='');}['_showConflictResolution'](){const _0x48b0ae=this['_el']('conflict-resolution'),_0x1d532e=this['_el']('confirm-approve'),_0x4127dd=this['_el']('cancel-approve'),_0x3ed7be=this['_el']('conflict-agent-resolve');if(_0x48b0ae)_0x48b0ae['hidden']=![];if(_0x1d532e)_0x1d532e['hidden']=!![];if(_0x4127dd)_0x4127dd['hidden']=!![];const _0x5011bd=this['_el']('approve-modal');if(_0x5011bd){this['_sectionsHiddenBeforeConflict']=new Set();for(const _0x52b8f6 of _0x5011bd['querySelectorAll']('.modal-section')){_0x52b8f6['hidden']&&this['_sectionsHiddenBeforeConflict']['add'](_0x52b8f6),_0x52b8f6['hidden']=!![];}}if(_0x3ed7be){const _0x2cc7b5=!!this['onConflictFollowUp'];_0x3ed7be['hidden']=!_0x2cc7b5,_0x3ed7be['nextElementSibling']?.['classList']['contains']('field-hint')&&(_0x3ed7be['nextElementSibling']['hidden']=!_0x2cc7b5);}}['_hideConflictResolution'](){const _0x5f1613=this['_el']('conflict-resolution'),_0x15debd=this['_el']('confirm-approve'),_0x20c5db=this['_el']('cancel-approve');if(_0x5f1613)_0x5f1613['hidden']=!![];if(_0x15debd)_0x15debd['hidden']=![];if(_0x20c5db)_0x20c5db['hidden']=![];const _0x30a022=this['_el']('approve-modal');if(_0x30a022){const _0x3cf74f=this['_sectionsHiddenBeforeConflict']||new Set();for(const _0x33f3c7 of _0x30a022['querySelectorAll']('.modal-section')){!_0x3cf74f['has'](_0x33f3c7)&&(_0x33f3c7['hidden']=![]);}this['_sectionsHiddenBeforeConflict']=null;}}['_getRemoteConflictWarning'](){const _0x58df12=this['taskData']?.['reposChanged']||[],_0x223662=this['_el']('pull-before-commit')?.['checked']??!![],_0x59dd9a=this['_el']('create-new-branch')?.['checked']||![];if(!_0x223662||_0x59dd9a||_0x58df12['length']===0x0)return'';const _0x2e7ec4=_0x58df12['filter'](_0x13e5a4=>_0x13e5a4?.['upstream_status']==='behind'||_0x13e5a4?.['upstream_status']==='diverged');if(_0x2e7ec4['length']===0x0)return'';const _0x27547d=_0x2e7ec4['map'](_0xe3f48=>{const _0x2a55a4=Number(_0xe3f48?.['upstream_behind'])||0x0,_0x31ed5d=_0x2a55a4+'\x20commit'+(_0x2a55a4===0x1?'':'s')+'\x20ahead';if(_0xe3f48['upstream_status']==='diverged')return _0xe3f48['name']+':\x20remote\x20is\x20'+_0x31ed5d+'\x20and\x20the\x20tracked\x20branch\x20has\x20local\x20commits';return _0xe3f48['name']+':\x20remote\x20is\x20'+_0x31ed5d;})['join'](';\x20');return'Remote\x20has\x20new\x20changes\x20('+_0x27547d+').\x20If\x20there\x20are\x20conflicts,\x20you\x27ll\x20be\x20given\x20options\x20to\x20resolve\x20them.';}['_refreshWarningBanner'](){const _0x16ef45=[this['taskData']?.['warning']||'',this['_getRemoteConflictWarning'](),this['_transientWarning']||'']['filter'](Boolean);if(_0x16ef45['length']>0x0){this['showWarning'](_0x16ef45['join']('\x20'));return;}this['hideWarning']();}['_stripCoAuthoredByLines'](_0x3ac4ff){return _0x3ac4ff['replace'](/^Co-Authored-By:.*$/gmi,'')['replace'](/^Learn more: https:\/\/coderflow\.ai\s*$/gm,'')['replace'](/\n{3,}/g,'\x0a\x0a')['trim']();}async['_addAttributionIfEnabled'](_0x20ee13){try{let _0x1fc951;try{const _0x3e8897=await fetch(this['baseUrl']+'/settings');if(_0x3e8897['ok']){const _0x33b3da=await _0x3e8897['json']();_0x1fc951=_0x33b3da['coderflow_attribution']!==![];}}catch(_0xb79bf4){}_0x1fc951===undefined&&(this['coderflowAttribution']!==undefined?_0x1fc951=this['coderflowAttribution']!==![]:_0x1fc951=!![]);const _0x75d0f3=this['_stripCoAuthoredByLines'](_0x20ee13);if(!_0x1fc951)return _0x75d0f3;const _0x5ae48e='\x0a\x0aCo-Authored-By:\x20CoderFlow\x20<ai@coderflow.ai>\x0aLearn\x20more:\x20https://coderflow.ai';return _0x75d0f3+_0x5ae48e;}catch(_0x5e4315){return console['warn']('Failed\x20to\x20add\x20CoderFlow\x20attribution:',_0x5e4315),_0x20ee13;}}['show'](_0xb4172d){!this['initialized']&&this['init']();this['taskData']=_0xb4172d;const _0x61730e=this['_el']('approve-modal'),_0x98852e=this['_el']('commit-message-input'),_0x5504d6=this['_el']('pull-before-commit'),_0x24214a=this['_el']('push-after-commit'),_0x4cf613=this['_el']('create-new-branch'),_0x5e0ca5=this['_el']('new-branch-input-container'),_0x4a8cbf=this['_el']('new-branch-name');if(!_0x61730e)return;this['hideError'](),this['hideWarning'](),this['_hideConflictResolution'](),this['_transientWarning']='';const _0x43c73f=_0xb4172d['reposChanged']||[];if(_0x43c73f['length']===0x0&&!_0xb4172d['syncFirst']){this['showToast']('No\x20changes\x20to\x20approve','error');return;}this['_updateDisplay'](_0x43c73f,_0xb4172d);const _0x4330ac=_0xb4172d['commitMessage']||'',_0x54d341=this['_stripCoAuthoredByLines'](_0x4330ac);_0x98852e['value']=_0x54d341;if(_0x5504d6)_0x5504d6['checked']=!![];if(_0x24214a)_0x24214a['checked']=!![];_0x4cf613&&(_0x4cf613['checked']=![]);_0x5e0ca5&&(_0x5e0ca5['hidden']=!![]);_0x4a8cbf&&(_0x4a8cbf['value']='');if(_0x24214a)_0x24214a['disabled']=![];if(_0x4cf613)_0x4cf613['disabled']=![];this['_refreshWarningBanner'](),this['updatePRSupport'](_0xb4172d['prSupported']===!![]);const _0x4d4e3e=this['_el']('ibmi-sync-section');if(_0x4d4e3e){_0x4d4e3e['hidden']=!_0xb4172d['ibmiSyncAvailable'];const _0x3dab6e=this['_el']('sync-to-ibmi'),_0x589321=this['_el']('ibmi-sync-fields'),_0x599a80=this['_el']('ibmi-sync-library');if(_0x3dab6e)_0x3dab6e['checked']=![];if(_0x589321)_0x589321['hidden']=!![];if(_0x599a80)_0x599a80['value']='';const _0x14ac74=this['_el']('ibmi-sync-credentials-row');_0x14ac74&&(_0x14ac74['hidden']=!(_0xb4172d['ibmiSyncAvailable']&&_0xb4172d['syncCredentials']==='prompt'));}const _0x16d448=this['_el']('confirm-approve');_0xb4172d['syncFirst']&&this['onSync']?(_0x16d448&&(_0x16d448['disabled']=!![],_0x16d448['textContent']='Syncing...'),this['_performSync']()):_0x16d448&&(_0x16d448['disabled']=![],_0x16d448['textContent']='Commit\x20Changes');_0x61730e['hidden']=![];const _0x181aa9=++this['_attributionRequestId'];void this['_applyAttributionAsync']({'requestId':_0x181aa9,'taskId':_0xb4172d['taskId'],'originalCommitMessage':_0x54d341}),setTimeout(()=>{_0x98852e['focus'](),_0x98852e['setSelectionRange'](0x0,_0x98852e['value']['length']);},0x64);}['updatePRSupport'](_0x4b800f){const _0x193085=this['_el']('pr-option-section'),_0x26e30f=this['_el']('create-pull-request'),_0x59b296=this['_el']('pr-hint'),_0x4e3263=this['_el']('push-after-commit'),_0x5d85bd=this['_el']('create-new-branch');if(!_0x193085)return;if(_0x4b800f){_0x193085['hidden']=![];_0x26e30f&&!_0x26e30f['disabled']&&(_0x26e30f['checked']=![]);if(_0x59b296)_0x59b296['hidden']=!![];this['_createPR']=![];return;}_0x26e30f?.['checked']&&(_0x26e30f['checked']=![]);if(_0x59b296)_0x59b296['hidden']=!![];if(_0x4e3263)_0x4e3263['disabled']=![];if(_0x5d85bd)_0x5d85bd['disabled']=![];this['_createPR']=![],_0x193085['hidden']=!![];}async['_applyAttributionAsync']({requestId:_0x1e401d,taskId:_0x3c1aba,originalCommitMessage:_0x414392}){const _0xc0220c=this['_el']('commit-message-input');if(!_0xc0220c)return;const _0x2a4b44=await this['_addAttributionIfEnabled'](_0x414392);if(_0x1e401d!==this['_attributionRequestId'])return;if(!this['taskData']||this['taskData']['taskId']!==_0x3c1aba)return;if(!this['isVisible']())return;const _0x407fe3=_0x470ee1=>_0x470ee1['replace'](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a');if(_0x407fe3(_0xc0220c['value'])!==_0x407fe3(_0x414392))return;_0xc0220c['value']=_0x2a4b44;}['_updateDisplay'](_0x377b42,_0x41ef07){const _0xa1acc8=this['_el']('approve-repo-name'),_0x4ab38e=this['_el']('approve-stats'),_0x22b675=this['_el']('multi-repo-note');if(_0x377b42['length']===0x0){if(_0xa1acc8)_0xa1acc8['textContent']='Syncing...';if(_0x4ab38e)_0x4ab38e['textContent']='';if(_0x22b675)_0x22b675['hidden']=!![];return;}const _0x22d992=_0x377b42['reduce']((_0x5eeb95,_0x462e5a)=>_0x5eeb95+(_0x462e5a['files_changed']||0x0),0x0),_0x3c8386=_0x377b42['reduce']((_0x245779,_0x5d8291)=>_0x245779+(_0x5d8291['lines_added']||0x0),0x0),_0x28d4a4=_0x377b42['reduce']((_0x55cbd7,_0x2de61b)=>_0x55cbd7+(_0x2de61b['lines_deleted']||0x0),0x0);if(_0x377b42['length']===0x1){if(_0xa1acc8)_0xa1acc8['textContent']=_0x377b42[0x0]?.['name']||'repository';if(_0x22b675)_0x22b675['hidden']=!![];}else{const _0x418800=_0x377b42['map'](_0x5c35b4=>_0x5c35b4['name'])['join'](',\x20');if(_0xa1acc8)_0xa1acc8['textContent']=_0x377b42['length']+'\x20repositories:\x20'+_0x418800;if(_0x22b675)_0x22b675['hidden']=![];}_0x4ab38e&&(_0x4ab38e['textContent']=_0x22d992+'\x20file'+(_0x22d992===0x1?'':'s')+'\x20changed\x20(+'+_0x3c8386+'\x20-'+_0x28d4a4+')'),this['_displayBranchInfo'](_0x377b42,_0x41ef07?.['branches']||{});}async['_performSync'](){if(!this['onSync']||this['isSyncing'])return;this['isSyncing']=!![];const _0x432270=this['_el']('confirm-approve');try{const _0x26121b=await this['onSync'](this['taskData']['taskId']);if(!this['isVisible']()){this['isSyncing']=![];return;}if(_0x26121b['repos_changed']){const _0x28b4bf=this['taskData']['reposChanged']?.['length']||0x0,_0x26e726=this['taskData']['reposChanged']?.['reduce']((_0x4ef660,_0x336151)=>_0x4ef660+(_0x336151['files_changed']||0x0),0x0)||0x0;this['taskData']['reposChanged']=_0x26121b['repos_changed'];if(_0x26121b['current_branches']){const _0x18b562={...this['taskData']['branches']||{}};for(const [_0x2031b4,_0xc573ed]of Object['entries'](_0x26121b['current_branches'])){_0xc573ed?_0x18b562[_0x2031b4]=_0xc573ed:delete _0x18b562[_0x2031b4];}this['taskData']['branches']=_0x18b562;}this['_updateDisplay'](_0x26121b['repos_changed'],this['taskData']);const _0x44f278=_0x26121b['repos_changed']['length'],_0x27ece2=_0x26121b['repos_changed']['reduce']((_0x3863f2,_0x706aab)=>_0x3863f2+(_0x706aab['files_changed']||0x0),0x0);(_0x27ece2>_0x26e726||_0x44f278>_0x28b4bf)&&(this['_transientWarning']='Additional\x20changes\x20detected\x20since\x20last\x20sync.\x20Review\x20the\x20updated\x20file\x20list.'),this['_refreshWarningBanner']();}_0x432270&&(!this['taskData']['reposChanged']||this['taskData']['reposChanged']['length']===0x0?(_0x432270['disabled']=!![],_0x432270['textContent']='No\x20Changes',this['showError']('No\x20changes\x20to\x20approve\x20after\x20sync')):(_0x432270['disabled']=![],_0x432270['textContent']='Commit\x20Changes'));}catch(_0x1fc0e9){console['error']('Failed\x20to\x20sync\x20repos\x20before\x20approve:',_0x1fc0e9);if(!this['isVisible']()){this['isSyncing']=![];return;}this['showError']('Sync\x20failed:\x20'+_0x1fc0e9['message']+'.\x20You\x20can\x20still\x20commit\x20with\x20existing\x20staged\x20changes.'),_0x432270&&(this['taskData']['reposChanged']&&this['taskData']['reposChanged']['length']>0x0?(_0x432270['disabled']=![],_0x432270['textContent']='Commit\x20Changes'):(_0x432270['disabled']=!![],_0x432270['textContent']='No\x20Changes'));}finally{this['isSyncing']=![];}}['hide'](){const _0xa72667=this['_el']('approve-modal');_0xa72667&&(_0xa72667['hidden']=!![]),this['_syncFileTree']&&(this['_syncFileTree']['destroy'](),this['_syncFileTree']=null),this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}async['_handleApprove'](){const _0x418289=this['_el']('commit-message-input'),_0x1506a2=this['_el']('pull-before-commit'),_0x4b48bc=this['_el']('push-after-commit'),_0x59c5cd=this['_el']('create-new-branch'),_0x165dd1=this['_el']('new-branch-name'),_0x42c8fd=this['_el']('confirm-approve'),_0x3e2e33=_0x418289['value']['trim'](),_0x189be1=_0x1506a2?.['checked']??!![],_0x409122=_0x4b48bc?.['checked']??!![],_0x3d6244=_0x59c5cd?.['checked']||![],_0x29b00a=_0x165dd1?.['value']['trim']()||'';this['hideError']();if(!_0x3e2e33){this['showError']('Commit\x20message\x20is\x20required'),_0x418289['focus']();return;}if(_0x3d6244&&!_0x29b00a){this['showError']('Branch\x20name\x20is\x20required\x20when\x20creating\x20a\x20new\x20branch'),_0x165dd1?.['focus']();return;}if(_0x3d6244&&_0x29b00a){const _0x146163=/[\s~^:?*\[\\]/;if(_0x146163['test'](_0x29b00a)){this['showError']('Invalid\x20branch\x20name.\x20Avoid\x20spaces\x20and\x20special\x20characters\x20like\x20~\x20^\x20:\x20?\x20*\x20[\x20\x5c'),_0x165dd1?.['focus']();return;}}const _0x265eb5=this['_el']('sync-to-ibmi')?.['checked'];if(_0x265eb5){const _0x4e85e1=this['_el']('ibmi-sync-library')?.['value']?.['trim']();if(!_0x4e85e1){this['showError']('IBM\x20i\x20library\x20name\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-library')?.['focus']();return;}if(this['_syncFileTree']){const _0x30fc7c=this['_syncFileTree']['getSelectedFiles']();if(_0x30fc7c['length']===0x0){this['showError']('Select\x20at\x20least\x20one\x20file\x20to\x20sync');return;}}if(this['taskData']?.['syncCredentials']==='prompt'){const _0x20f8f2=this['_el']('ibmi-sync-user')?.['value']?.['trim']();if(!_0x20f8f2){this['showError']('User\x20profile\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-user')?.['focus']();return;}const _0x19f26b=this['_el']('ibmi-sync-password')?.['value'];if(!_0x19f26b){this['showError']('Password\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-password')?.['focus']();return;}}}const _0x2b1210=_0x42c8fd?.['textContent']||'Commit\x20Changes';_0x42c8fd&&(_0x42c8fd['disabled']=!![],_0x3d6244?_0x42c8fd['textContent']='Creating\x20branch\x20&\x20committing...':_0x42c8fd['textContent']=_0x189be1?'Pulling\x20&\x20Committing...':'Committing...');try{const _0x2dfcee={'commit_message':_0x3e2e33,'pull':_0x189be1,'push':_0x409122,'conflict_strategy':'rebase'};_0x3d6244&&_0x29b00a&&(_0x2dfcee['new_branch']=_0x29b00a);let _0x1bcfa7=null;this['onApprove']&&(_0x1bcfa7=await this['onApprove'](this['taskData']['taskId'],_0x2dfcee));let _0x500a6d='Changes\x20committed';if(_0x3d6244)_0x500a6d='Changes\x20committed\x20to\x20new\x20branch\x20\x27'+_0x29b00a+'\x27',_0x409122&&(_0x500a6d+='\x20and\x20pushed');else{if(_0x189be1&&_0x409122)_0x500a6d='Changes\x20pulled,\x20committed,\x20and\x20pushed';else{if(_0x189be1)_0x500a6d='Changes\x20pulled\x20and\x20committed';else _0x409122&&(_0x500a6d='Changes\x20committed\x20and\x20pushed');}}const _0x3f2854=this['_el']('sync-to-ibmi')?.['checked'];let _0x83537b=null,_0x1f934c=null,_0x125154=null,_0x1e3d98=null;if(_0x3f2854&&this['onSyncToIbmi']){_0x83537b=this['_el']('ibmi-sync-library')?.['value']?.['trim']()?.['toUpperCase'](),_0x1f934c=this['_el']('ibmi-sync-user')?.['value']?.['trim']()?.['toUpperCase']()||null,_0x125154=this['_el']('ibmi-sync-password')?.['value']||null;if(this['_syncFileTree']&&this['_syncRelativeFiles']&&this['_syncAbsolutePaths']){const _0x5707ff=this['_syncFileTree']['getSelectedFiles']();_0x1e3d98=_0x5707ff['map'](_0x4a7a09=>{const _0x528cf6=this['_syncRelativeFiles']['indexOf'](_0x4a7a09);return _0x528cf6>=0x0?this['_syncAbsolutePaths'][_0x528cf6]:_0x4a7a09;});}}this['showToast'](_0x500a6d,'success'),this['hide']();if(this['_createPR']&&this['onCreatePR'])try{await this['onCreatePR'](this['taskData']['taskId'],_0x1bcfa7||{});}catch(_0x146fc9){console['warn']('PR\x20creation\x20failed\x20or\x20cancelled:',_0x146fc9);}if(_0x3f2854&&this['onSyncToIbmi']&&_0x83537b){localStorage['setItem']('coderflow_ibmi_sync_library',_0x83537b);if(_0x1f934c)localStorage['setItem']('coderflow_ibmi_sync_user',_0x1f934c);try{await this['onSyncToIbmi'](this['taskData']['taskId'],_0x83537b,_0x1f934c,_0x125154,_0x1e3d98);}catch(_0x4be934){this['showToast']('Sync\x20failed:\x20'+_0x4be934['message'],'error');}}this['onSuccess']&&this['onSuccess'](this['taskData']);}catch(_0x4970d1){console['error']('Failed\x20to\x20approve\x20changes',_0x4970d1),_0x4970d1['hasConflicts']?this['_showConflictResolution']():this['showError']('Failed\x20to\x20commit:\x20'+_0x4970d1['message']),_0x42c8fd&&(_0x42c8fd['disabled']=![],_0x42c8fd['textContent']=_0x2b1210),this['onError']&&this['onError'](_0x4970d1);}}['isVisible'](){const _0x13bcf4=this['_el']('approve-modal');return _0x13bcf4&&!_0x13bcf4['hidden'];}['destroy'](){const _0x101ecc=this['_el']('approve-modal');_0x101ecc&&_0x101ecc['remove'](),this['initialized']=![];}}export function getApproveState(_0x3f6a9e,_0x514246){if(!_0x3f6a9e)return{'canApprove':![],'reason':'No\x20task\x20data'};if(isLogOnlyTaskType(_0x3f6a9e['taskType']))return{'canApprove':![],'reason':(_0x3f6a9e['taskType']==='test'?'Test':'Deploy')+'\x20tasks\x20cannot\x20be\x20approved'};const _0x59a25c=_0x514246?.['repos_changed']?.['length']>0x0,_0x15912a=_0x3f6a9e['status']==='completed'||_0x3f6a9e['status']==='failed'||_0x3f6a9e['status']==='interrupted',_0x45d8b8=_0x3f6a9e['containerState']==='running',_0x46249e=_0x3f6a9e['approvedBy']!==undefined&&_0x3f6a9e['approvedBy']!==null;if(_0x46249e){const _0x329c0e=_0x3f6a9e['approvedBy']['name']||_0x3f6a9e['approvedBy']['username']||'user';return{'canApprove':![],'reason':'Already\x20approved\x20by\x20'+_0x329c0e};}if(!_0x59a25c)return{'canApprove':![],'reason':'No\x20changes\x20to\x20approve'};if(!_0x15912a)return{'canApprove':![],'reason':'Task\x20must\x20complete\x20first'};if(!_0x3f6a9e['containerId'])return{'canApprove':![],'reason':'Container\x20no\x20longer\x20available'};if(!_0x45d8b8)return{'canApprove':![],'reason':'Container\x20is\x20not\x20running'};return{'canApprove':!![],'reason':'Ready\x20to\x20approve'};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function buildAutomationEnvironmentHref(
|
|
1
|
+
export function buildAutomationEnvironmentHref(_0x57caba,_0x46eba4){const _0x240be9=new URLSearchParams();_0x57caba&&_0x240be9['set']('env',String(_0x57caba));_0x240be9['set']('tab','automations');_0x46eba4&&_0x240be9['set']('automation',String(_0x46eba4));const _0x571fb7=_0x240be9['toString']();return'environments.html'+(_0x571fb7?'?'+_0x571fb7:'');}export function buildAutomationTaskFilterHref(_0x2ac35a){const _0x48707f=new URLSearchParams();_0x2ac35a&&_0x48707f['set']('automation',String(_0x2ac35a));const _0x4f872d=_0x48707f['toString']();return'index.html'+(_0x4f872d?'?'+_0x4f872d:'');}export function parseAutomationDeepLinkParams(_0x27691a=''){const _0x1c5e39=new URLSearchParams(_0x27691a||'');return{'env':_0x1c5e39['get']('env'),'tab':_0x1c5e39['get']('tab'),'automation':_0x1c5e39['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(_0x360f28,_0x40da78,_0x415477){const _0x181dba=Number['parseInt'](_0x360f28,0xa);if(!Number['isInteger'](_0x181dba)||_0x181dba<_0x40da78||_0x181dba>_0x415477)return null;return _0x181dba;}function inferRecurringInterval(_0x2891e1,_0x28c3e1){if(_0x2891e1==='*/15')return'*/15\x20*\x20*\x20*\x20*';if(_0x2891e1==='*/30')return'*/30\x20*\x20*\x20*\x20*';if(_0x2891e1!=='0')return'*/30\x20*\x20*\x20*\x20*';if(_0x28c3e1==='*'||/^\d{1,2}-\d{1,2}$/['test'](_0x28c3e1))return'0\x20*\x20*\x20*\x20*';for(const _0x541dd7 of RECURRING_INTERVAL_STEPS){if(_0x28c3e1['startsWith']('*/'+_0x541dd7)||_0x28c3e1['includes']('/'+_0x541dd7))return'0\x20*/'+_0x541dd7+'\x20*\x20*\x20*';}return'*/30\x20*\x20*\x20*\x20*';}function parseRecurringHourRange(_0x2aca17){const _0x5e81e7=String(_0x2aca17||'')['trim']()['match'](/^(\d{1,2})-(\d{1,2})(?:\/\d+)?$/);if(!_0x5e81e7)return{'start':'','end':''};const _0xfc805e=parseBoundedInteger(_0x5e81e7[0x1],0x0,0x17),_0x1681ff=parseBoundedInteger(_0x5e81e7[0x2],0x0,0x17);if(_0xfc805e===null||_0x1681ff===null||_0xfc805e>_0x1681ff)return{'start':'','end':''};return{'start':String(_0xfc805e),'end':String(_0x1681ff)};}export function parseAutomationScheduleToFormState(_0x35f9a2){const _0x2e6a03=String(_0x35f9a2||'')['trim'](),_0x1532d6=createDefaultScheduleFormState(),_0x3b2dd3=_0x2e6a03['match'](/^(\d{1,2}) (\d{1,2}) \* \* \*$/);if(_0x3b2dd3){const _0x3cd6e9=parseBoundedInteger(_0x3b2dd3[0x1],0x0,0x3b),_0x2d2856=parseBoundedInteger(_0x3b2dd3[0x2],0x0,0x17);if(_0x3cd6e9!==null&&_0x2d2856!==null)return _0x1532d6['frequency']='daily',_0x1532d6['dailyMinute']=String(_0x3cd6e9),_0x1532d6['dailyHour']=String(_0x2d2856),_0x1532d6;}const _0x2d2e1d=_0x2e6a03['match'](/^(\d{1,2}) (\d{1,2}) \* \* ([0-7])$/);if(_0x2d2e1d){const _0x3d8ce3=parseBoundedInteger(_0x2d2e1d[0x1],0x0,0x3b),_0x2577ca=parseBoundedInteger(_0x2d2e1d[0x2],0x0,0x17),_0x3f435c=parseBoundedInteger(_0x2d2e1d[0x3],0x0,0x7);if(_0x3d8ce3!==null&&_0x2577ca!==null&&_0x3f435c!==null)return _0x1532d6['frequency']='weekly',_0x1532d6['weeklyMinute']=String(_0x3d8ce3),_0x1532d6['weeklyHour']=String(_0x2577ca),_0x1532d6['weeklyDay']=String(_0x3f435c===0x7?0x0:_0x3f435c),_0x1532d6;}const _0xee3863=_0x2e6a03['match'](/^(\d{1,2}) (\d{1,2}) (\d{1,2}) \* \*$/);if(_0xee3863){const _0xae5957=parseBoundedInteger(_0xee3863[0x1],0x0,0x3b),_0x50bf08=parseBoundedInteger(_0xee3863[0x2],0x0,0x17),_0x4114b1=parseBoundedInteger(_0xee3863[0x3],AUTOMATION_MONTHLY_DAY_MIN,AUTOMATION_MONTHLY_DAY_MAX);if(_0xae5957!==null&&_0x50bf08!==null&&_0x4114b1!==null)return _0x1532d6['frequency']='monthly',_0x1532d6['monthlyMinute']=String(_0xae5957),_0x1532d6['monthlyHour']=String(_0x50bf08),_0x1532d6['monthlyDay']=String(_0x4114b1),_0x1532d6;}const _0x57ddc3=_0x2e6a03['match'](/^(\*\/15|\*\/30|0) ([^\s]+) \* \* ([^\s]+)$/);if(_0x57ddc3){const [,_0x4ab97b,_0x1fa747,_0x30ac72]=_0x57ddc3;_0x1532d6['frequency']='recurring',_0x1532d6['recurringInterval']=inferRecurringInterval(_0x4ab97b,_0x1fa747),_0x1532d6['recurringDayToken']=String(_0x30ac72||'')['trim']()||'*';const _0x5f2319=parseRecurringHourRange(_0x1fa747);return _0x1532d6['recurringStartHour']=_0x5f2319['start'],_0x1532d6['recurringEndHour']=_0x5f2319['end'],_0x1532d6;}return _0x1532d6['frequency']='custom',_0x1532d6['customCron']=_0x2e6a03,_0x1532d6;}export function buildAutomationCronFromFormState(_0x1bade0={}){const _0x1d002e=String(_0x1bade0['frequency']||'daily');if(_0x1d002e==='custom')return String(_0x1bade0['customCron']||'')['trim']();if(_0x1d002e==='daily'){const _0x5cdad5=String(_0x1bade0['dailyHour']??'2'),_0x128c48=String(_0x1bade0['dailyMinute']??'0');return _0x128c48+'\x20'+_0x5cdad5+'\x20*\x20*\x20*';}if(_0x1d002e==='weekly'){const _0x159b66=String(_0x1bade0['weeklyDay']??'1'),_0x2c2df2=String(_0x1bade0['weeklyHour']??'9'),_0x3e3c93=String(_0x1bade0['weeklyMinute']??'0');return _0x3e3c93+'\x20'+_0x2c2df2+'\x20*\x20*\x20'+_0x159b66;}if(_0x1d002e==='monthly'){const _0x5b2ddd=String(_0x1bade0['monthlyDay']??'1'),_0x30e81a=String(_0x1bade0['monthlyHour']??'0'),_0x3c0a5a=String(_0x1bade0['monthlyMinute']??'0');return _0x3c0a5a+'\x20'+_0x30e81a+'\x20'+_0x5b2ddd+'\x20*\x20*';}const _0x304d41=String(_0x1bade0['recurringInterval']||'*/30\x20*\x20*\x20*\x20*')['trim'](),[_0x21afac='*/30',_0x298357='*']=_0x304d41['split'](/\s+/);let _0x46cb53=_0x298357;const _0x1d7714=String(_0x1bade0['recurringStartHour']??'')['trim'](),_0x328054=String(_0x1bade0['recurringEndHour']??'')['trim']();if(_0x1d7714!==''&&_0x328054!==''){const _0x3b14ca=Number['parseInt'](_0x1d7714,0xa),_0x4c644e=Number['parseInt'](_0x328054,0xa);if(Number['isInteger'](_0x3b14ca)&&Number['isInteger'](_0x4c644e)&&_0x3b14ca<=_0x4c644e){const _0x307dae=_0x298357['match'](/^\*\/(\d+)$/);_0x307dae?_0x46cb53=_0x3b14ca+'-'+_0x4c644e+'/'+_0x307dae[0x1]:_0x46cb53=_0x3b14ca+'-'+_0x4c644e;}}const _0x12e6e5=String(_0x1bade0['recurringDayToken']??'*')['trim']()||'*';return _0x21afac+'\x20'+_0x46cb53+'\x20*\x20*\x20'+_0x12e6e5;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export class CommentsWidget{constructor(_0x15e3f3,_0x1ede95={}){this['container']=_0x15e3f3,this['options']={'taskId':_0x1ede95['taskId']||null,'currentUserId':_0x1ede95['currentUserId']||null,'compact':_0x1ede95['compact']||![],'skipHeader':_0x1ede95['skipHeader']||![],'onCommentsLoaded':_0x1ede95['onCommentsLoaded']||null,'onCommentsChanged':_0x1ede95['onCommentsChanged']||null,'enableAttachments':_0x1ede95['enableAttachments']||![],'getAPI':_0x1ede95['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 _0x1a3a03=this['options']['getAPI'](),_0x303c45=await _0x1a3a03['getTaskAttachments'](this['options']['taskId']);this['existingAttachments']=_0x303c45['attachments']||[];}catch(_0x30ae00){console['warn']('Failed\x20to\x20load\x20existing\x20attachments:',_0x30ae00),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 _0x379972=this['header']['querySelector']('.comments-toggle-btn');_0x379972['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 _0x18a475=document['createElement']('div');_0x18a475['className']='comments-editor-wrapper',this['toolbar']=document['createElement']('div'),this['toolbar']['className']='comments-toolbar\x20comments-toolbar-hidden',_0x18a475['appendChild'](this['toolbar']);const _0x5ba553=document['createElement']('div');_0x5ba553['className']='comments-editor-placeholder',_0x18a475['appendChild'](_0x5ba553);const _0x5034e4=document['createElement']('div');_0x5034e4['className']='comments-input-actions',_0x5034e4['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'](_0x18a475),this['inputSection']['appendChild'](_0x5034e4),this['container']['appendChild'](this['inputSection']),this['initEditor'](_0x5ba553),this['submitBtn']=_0x5034e4['querySelector']('.comments-submit-btn'),this['cancelBtn']=_0x5034e4['querySelector']('.comments-cancel-btn'),this['submitBtn']['addEventListener']('click',()=>this['handleSubmit']()),this['cancelBtn']['addEventListener']('click',()=>this['cancelEdit']());}['initEditor'](_0xdd935e){const _0x284ebe=document['createElement']('textarea');_0x284ebe['placeholder']='Add\x20a\x20comment...',_0x284ebe['className']='comments-textarea',_0xdd935e['appendChild'](_0x284ebe);const _0x1c62cb=window['MarkdownEditor'];if(!_0x1c62cb){console['error']('MarkdownEditor\x20not\x20loaded');return;}const _0x3e62e2={'placeholder':'Add\x20a\x20comment...','editable':!![],'toolbar':!![],'minHeight':this['options']['compact']?'60px':'80px','onChange':_0x58202b=>{const _0x44cdbc=_0x58202b&&_0x58202b['trim']()['length']>0x0||this['pendingAttachments']['length']>0x0;this['submitBtn']['disabled']=!_0x44cdbc;},'fetchUsers':async()=>{const _0x54ca3e=this['options']['getAPI']();return _0x54ca3e['getUsers']();}};this['options']['enableAttachments']&&this['options']['taskId']&&(_0x3e62e2['onAddAttachments']=_0x30fdb5=>{this['pendingAttachments']['push'](..._0x30fdb5),this['submitBtn']['disabled']=![];},_0x3e62e2['resolveAttachmentUrl']=_0x55af91=>{const _0x1d2280=this['options']['getAPI']();return _0x1d2280['getBaseUrl']()+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x55af91);},_0x3e62e2['isAttachmentNameTaken']=_0x5b480d=>{return this['pendingAttachments']['some'](_0x3c0a0e=>_0x3c0a0e['name']===_0x5b480d)||this['existingAttachments']['some'](_0x1f10c3=>_0x1f10c3['name']===_0x5b480d);});this['editor']=new _0x1c62cb(_0x284ebe,_0x3e62e2);const _0x83609d=this['editor']['editor'],_0x1779a3=this['editor']['toolbar'];_0x1779a3&&(_0x1779a3['classList']['add']('comments-toolbar-hidden'),_0x83609d['addEventListener']('focus',()=>{_0x1779a3['classList']['remove']('comments-toolbar-hidden');}),_0x83609d['addEventListener']('blur',_0x487f2b=>{setTimeout(()=>{!this['editor']['container']?.['contains'](document['activeElement'])&&!_0x1779a3['contains'](document['activeElement'])&&(!this['editor']['getValue']()?.['trim']()&&!this['editingCommentId']&&_0x1779a3['classList']['add']('comments-toolbar-hidden'));},0x64);}));}['toggleExpanded'](){this['isExpanded']=!this['isExpanded'],this['commentsListWrapper']['hidden']=!this['isExpanded'],this['inputSection']['hidden']=!this['isExpanded'];const _0x10d8d8=this['header']['querySelector']('.comments-chevron');_0x10d8d8&&(_0x10d8d8['style']['transform']=this['isExpanded']?'rotate(180deg)':''),this['isExpanded']&&this['comments']['length']===0x0&&this['options']['taskId']&&this['loadComments']();}['setTaskId'](_0x24ab27){this['options']['taskId']=_0x24ab27,this['comments']=[],this['renderComments'](),_0x24ab27&&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 _0x4cfc0c=this['options']['getAPI'](),_0x4f99d5=await _0x4cfc0c['getComments'](this['options']['taskId']);this['comments']=_0x4f99d5['comments']||[],this['renderComments'](),this['updateCount'](),this['options']['onCommentsLoaded']&&this['options']['onCommentsLoaded'](this['comments']);}catch(_0x2629ba){console['error']('Failed\x20to\x20load\x20comments:',_0x2629ba),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'](_0x4ceb00=>{const _0x1fc322=this['createCommentElement'](_0x4ceb00);this['commentsList']['appendChild'](_0x1fc322);});}['createCommentElement'](_0xe133ea){const _0x479262=document['createElement']('div');_0x479262['className']='comment-item',_0x479262['dataset']['commentId']=_0xe133ea['id'];const _0x1adfb3=this['options']['currentUserId']&&_0xe133ea['author']?.['userId']===this['options']['currentUserId'],_0x2fb1c1=this['formatDate'](_0xe133ea['createdAt']),_0x3ff2e4=_0xe133ea['updatedAt']!==_0xe133ea['createdAt'],_0x999770=this['resolveAttachmentUrls'](_0xe133ea['content']);let _0x296714=window['marked']?window['marked']['parse'](_0x999770):_0x999770;_0x296714=this['renderMentions'](_0x296714),_0x479262['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'](_0xe133ea['author']?.['name']||'Anonymous')+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-timestamp\x22\x20title=\x22'+new Date(_0xe133ea['createdAt'])['toLocaleString']()+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x2fb1c1+(_0x3ff2e4?'\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'+(_0x1adfb3?'\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>'+_0x296714+'</div>\x0a\x20\x20\x20\x20';if(_0x1adfb3){const _0x58aacc=_0x479262['querySelector']('.comment-edit-btn'),_0x551164=_0x479262['querySelector']('.comment-delete-btn');_0x58aacc?.['addEventListener']('click',()=>this['startEdit'](_0xe133ea)),_0x551164?.['addEventListener']('click',()=>this['deleteComment'](_0xe133ea['id']));}return _0x479262;}['formatDate'](_0x43092a){const _0x55e6eb=new Date(_0x43092a),_0x4d70c5=new Date(),_0x6769f8=_0x4d70c5-_0x55e6eb,_0xcf9e98=Math['floor'](_0x6769f8/0xea60),_0x509a69=Math['floor'](_0x6769f8/0x36ee80),_0x215773=Math['floor'](_0x6769f8/0x5265c00);if(_0xcf9e98<0x1)return'just\x20now';if(_0xcf9e98<0x3c)return _0xcf9e98+'m\x20ago';if(_0x509a69<0x18)return _0x509a69+'h\x20ago';if(_0x215773<0x7)return _0x215773+'d\x20ago';return _0x55e6eb['toLocaleDateString']();}['escapeHtml'](_0x341c82){const _0x251510=document['createElement']('div');return _0x251510['textContent']=_0x341c82,_0x251510['innerHTML'];}['resolveAttachmentUrls'](_0xcaf47){if(!_0xcaf47||!this['options']['taskId'])return _0xcaf47;const _0x3ff99e=this['options']['getAPI'](),_0x12c931=_0x3ff99e['getBaseUrl']();let _0x3e54e8=String(_0xcaf47)['replace'](/\]\(attachment:(?:\/\/)?([^)]+)\)/g,(_0x589d68,_0x587bc8)=>{const _0x41c11b=String(_0x587bc8||'')['trim']();if(!_0x41c11b)return _0x589d68;let _0x3e23e8=_0x41c11b;try{_0x3e23e8=decodeURIComponent(_0x41c11b);}catch{}return']('+_0x12c931+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x3e23e8)+')';});return _0x3e54e8;}['renderMentions'](_0x5eec19){if(!_0x5eec19)return _0x5eec19;return String(_0x5eec19)['replace'](/@?<a\s+href="mention:([^"]+)"[^>]*>([^<]+)<\/a>/g,(_0x37f5e6,_0x1a17f1,_0x3934be)=>{const _0x20b496=this['escapeHtml'](_0x3934be),_0x1becd7=this['escapeHtml'](_0x1a17f1);return'<span\x20class=\x22mention\x22\x20data-mention-user-id=\x22'+_0x1becd7+'\x22>@'+_0x20b496+'</span>';});}['startEdit'](_0xdff163){this['editingCommentId']=_0xdff163['id'],this['editor']['setValue'](_0xdff163['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 _0x534ebd=this['editor']['getValue']()?.['trim']();if(!_0x534ebd&&this['pendingAttachments']['length']===0x0||!this['options']['taskId'])return;this['setLoading'](!![]);try{const _0x3c55ba=this['options']['getAPI']();this['pendingAttachments']['length']>0x0&&this['options']['enableAttachments']&&(await _0x3c55ba['uploadAttachments'](this['options']['taskId'],this['pendingAttachments']),this['existingAttachments']['push'](...this['pendingAttachments']['map'](_0x4b9946=>({'name':_0x4b9946['name']}))),this['pendingAttachments']=[]);if(this['editingCommentId']){const _0x3063ea=await _0x3c55ba['updateComment'](this['options']['taskId'],this['editingCommentId'],_0x534ebd),_0x4cefa2=this['comments']['findIndex'](_0x21ba78=>_0x21ba78['id']===this['editingCommentId']);_0x4cefa2!==-0x1&&(this['comments'][_0x4cefa2]=_0x3063ea['comment']);}else{const _0x2de6c7=await _0x3c55ba['addComment'](this['options']['taskId'],_0x534ebd);this['comments']['push'](_0x2de6c7['comment']);}this['renderComments'](),this['updateCount'](),this['cancelEdit'](),this['editor']['clear']();}catch(_0x105537){console['error']('Failed\x20to\x20save\x20comment:',_0x105537),alert('Failed\x20to\x20save\x20comment:\x20'+_0x105537['message']);}finally{this['setLoading'](![]);}}async['deleteComment'](_0x1be895){const _0x1c5bcb=await this['showDeleteConfirmModal']();if(!_0x1c5bcb)return;try{const _0x7ab11c=this['options']['getAPI']();await _0x7ab11c['deleteComment'](this['options']['taskId'],_0x1be895),this['comments']=this['comments']['filter'](_0x27f9e3=>_0x27f9e3['id']!==_0x1be895),this['renderComments'](),this['updateCount']();}catch(_0x133dc3){console['error']('Failed\x20to\x20delete\x20comment:',_0x133dc3),alert('Failed\x20to\x20delete\x20comment:\x20'+_0x133dc3['message']);}}['showDeleteConfirmModal'](){return new Promise(_0x531060=>{const _0x10a209=document['createElement']('div');_0x10a209['className']='comments-confirm-modal',_0x10a209['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'](_0x10a209);const _0xb682fb=_0x1511dd=>{document['removeEventListener']('keydown',_0x3ff60c),_0x10a209['remove'](),_0x531060(_0x1511dd);},_0x3ff60c=_0x479e0c=>{if(_0x479e0c['key']==='Escape')_0xb682fb(![]);};document['addEventListener']('keydown',_0x3ff60c),_0x10a209['querySelector']('.comments-confirm-backdrop')['addEventListener']('click',()=>_0xb682fb(![])),_0x10a209['querySelector']('.comments-confirm-close')['addEventListener']('click',()=>_0xb682fb(![])),_0x10a209['querySelector']('.comments-confirm-cancel')['addEventListener']('click',()=>_0xb682fb(![])),_0x10a209['querySelector']('.comments-confirm-delete')['addEventListener']('click',()=>_0xb682fb(!![])),_0x10a209['querySelector']('.comments-confirm-cancel')['focus']();});}['setLoading'](_0x228da5){this['submitBtn']['disabled']=_0x228da5,this['submitBtn']['querySelector']('.btn-text')['hidden']=_0x228da5,this['submitBtn']['querySelector']('.btn-loading')['hidden']=!_0x228da5;}['updateCount'](){const _0x5c5fce=this['comments']['length'],_0x3b4670=this['container']['querySelector']('#comments-count-badge');_0x3b4670&&(_0x3b4670['textContent']=_0x5c5fce,_0x3b4670['hidden']=_0x5c5fce===0x0);const _0x2ebd4f=this['container']['querySelector']('#comments-count');_0x2ebd4f&&(_0x2ebd4f['textContent']=_0x5c5fce>0x0?'('+_0x5c5fce+')':''),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(_0x27804a,_0x2642f5={}){this['container']=_0x27804a,this['options']={'taskId':_0x2642f5['taskId']||null,'currentUserId':_0x2642f5['currentUserId']||null,'compact':_0x2642f5['compact']||![],'skipHeader':_0x2642f5['skipHeader']||![],'onCommentsLoaded':_0x2642f5['onCommentsLoaded']||null,'onCommentsChanged':_0x2642f5['onCommentsChanged']||null,'enableAttachments':_0x2642f5['enableAttachments']||![],'getAPI':_0x2642f5['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 _0x4ec6ba=this['options']['getAPI'](),_0x47b72c=await _0x4ec6ba['getTaskAttachments'](this['options']['taskId']);this['existingAttachments']=_0x47b72c['attachments']||[];}catch(_0x14d05e){console['warn']('Failed\x20to\x20load\x20existing\x20attachments:',_0x14d05e),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 _0x41faf3=this['header']['querySelector']('.comments-toggle-btn');_0x41faf3['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 _0x62b77=document['createElement']('div');_0x62b77['className']='comments-editor-wrapper',this['toolbar']=document['createElement']('div'),this['toolbar']['className']='comments-toolbar\x20comments-toolbar-hidden',_0x62b77['appendChild'](this['toolbar']);const _0x57342e=document['createElement']('div');_0x57342e['className']='comments-editor-placeholder',_0x62b77['appendChild'](_0x57342e);const _0x4dfffa=document['createElement']('div');_0x4dfffa['className']='comments-input-actions',_0x4dfffa['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'](_0x62b77),this['inputSection']['appendChild'](_0x4dfffa),this['container']['appendChild'](this['inputSection']),this['initEditor'](_0x57342e),this['submitBtn']=_0x4dfffa['querySelector']('.comments-submit-btn'),this['cancelBtn']=_0x4dfffa['querySelector']('.comments-cancel-btn'),this['submitBtn']['addEventListener']('click',()=>this['handleSubmit']()),this['cancelBtn']['addEventListener']('click',()=>this['cancelEdit']());}['initEditor'](_0xb21868){const _0x2a14a3=document['createElement']('textarea');_0x2a14a3['placeholder']='Add\x20a\x20comment...',_0x2a14a3['className']='comments-textarea',_0xb21868['appendChild'](_0x2a14a3);const _0x3c6076=window['MarkdownEditor'];if(!_0x3c6076){console['error']('MarkdownEditor\x20not\x20loaded');return;}const _0x2c33ac={'placeholder':'Add\x20a\x20comment...','editable':!![],'toolbar':!![],'minHeight':this['options']['compact']?'60px':'80px','onChange':_0x832c1=>{const _0x1b7df8=_0x832c1&&_0x832c1['trim']()['length']>0x0||this['pendingAttachments']['length']>0x0;this['submitBtn']['disabled']=!_0x1b7df8;},'fetchUsers':async()=>{const _0x37f504=this['options']['getAPI']();return _0x37f504['getUsers']();}};this['options']['enableAttachments']&&this['options']['taskId']&&(_0x2c33ac['onAddAttachments']=_0x4a58a0=>{this['pendingAttachments']['push'](..._0x4a58a0),this['submitBtn']['disabled']=![];},_0x2c33ac['resolveAttachmentUrl']=_0x36723b=>{const _0x52a969=this['options']['getAPI']();return _0x52a969['getBaseUrl']()+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x36723b);},_0x2c33ac['isAttachmentNameTaken']=_0x3861a3=>{return this['pendingAttachments']['some'](_0x5cfe4d=>_0x5cfe4d['name']===_0x3861a3)||this['existingAttachments']['some'](_0x65a1ed=>_0x65a1ed['name']===_0x3861a3);});this['editor']=new _0x3c6076(_0x2a14a3,_0x2c33ac);const _0xac582d=this['editor']['editor'],_0x1b52bd=this['editor']['toolbar'];_0x1b52bd&&(_0x1b52bd['classList']['add']('comments-toolbar-hidden'),_0xac582d['addEventListener']('focus',()=>{_0x1b52bd['classList']['remove']('comments-toolbar-hidden');}),_0xac582d['addEventListener']('blur',_0x518efd=>{setTimeout(()=>{!this['editor']['container']?.['contains'](document['activeElement'])&&!_0x1b52bd['contains'](document['activeElement'])&&(!this['editor']['getValue']()?.['trim']()&&!this['editingCommentId']&&_0x1b52bd['classList']['add']('comments-toolbar-hidden'));},0x64);}));}['toggleExpanded'](){this['isExpanded']=!this['isExpanded'],this['commentsListWrapper']['hidden']=!this['isExpanded'],this['inputSection']['hidden']=!this['isExpanded'];const _0x4b0a17=this['header']['querySelector']('.comments-chevron');_0x4b0a17&&(_0x4b0a17['style']['transform']=this['isExpanded']?'rotate(180deg)':''),this['isExpanded']&&this['comments']['length']===0x0&&this['options']['taskId']&&this['loadComments']();}['setTaskId'](_0x1cefb7){this['options']['taskId']=_0x1cefb7,this['comments']=[],this['renderComments'](),_0x1cefb7&&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 _0x20293f=this['options']['getAPI'](),_0x50fd5d=await _0x20293f['getComments'](this['options']['taskId']);this['comments']=_0x50fd5d['comments']||[],this['renderComments'](),this['updateCount'](),this['options']['onCommentsLoaded']&&this['options']['onCommentsLoaded'](this['comments']);}catch(_0x540e9b){console['error']('Failed\x20to\x20load\x20comments:',_0x540e9b),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'](_0x14d9f3=>{const _0x24371d=this['createCommentElement'](_0x14d9f3);this['commentsList']['appendChild'](_0x24371d);});}['createCommentElement'](_0x1cb97f){const _0xbbb304=document['createElement']('div');_0xbbb304['className']='comment-item',_0xbbb304['dataset']['commentId']=_0x1cb97f['id'];const _0x4579b7=this['options']['currentUserId']&&_0x1cb97f['author']?.['userId']===this['options']['currentUserId'],_0x3bf78c=this['formatDate'](_0x1cb97f['createdAt']),_0x13e5c9=_0x1cb97f['updatedAt']!==_0x1cb97f['createdAt'],_0x5dfbd6=this['resolveAttachmentUrls'](_0x1cb97f['content']);let _0x343b30=window['marked']?window['marked']['parse'](_0x5dfbd6):_0x5dfbd6;_0x343b30=this['renderMentions'](_0x343b30),_0xbbb304['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'](_0x1cb97f['author']?.['name']||'Anonymous')+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-timestamp\x22\x20title=\x22'+new Date(_0x1cb97f['createdAt'])['toLocaleString']()+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x3bf78c+(_0x13e5c9?'\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'+(_0x4579b7?'\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>'+_0x343b30+'</div>\x0a\x20\x20\x20\x20';if(_0x4579b7){const _0x52c8dd=_0xbbb304['querySelector']('.comment-edit-btn'),_0x23b279=_0xbbb304['querySelector']('.comment-delete-btn');_0x52c8dd?.['addEventListener']('click',()=>this['startEdit'](_0x1cb97f)),_0x23b279?.['addEventListener']('click',()=>this['deleteComment'](_0x1cb97f['id']));}return _0xbbb304;}['formatDate'](_0x3d6bf5){const _0xb0fc66=new Date(_0x3d6bf5),_0x337f54=new Date(),_0x3520f5=_0x337f54-_0xb0fc66,_0x279624=Math['floor'](_0x3520f5/0xea60),_0x52d429=Math['floor'](_0x3520f5/0x36ee80),_0x539916=Math['floor'](_0x3520f5/0x5265c00);if(_0x279624<0x1)return'just\x20now';if(_0x279624<0x3c)return _0x279624+'m\x20ago';if(_0x52d429<0x18)return _0x52d429+'h\x20ago';if(_0x539916<0x7)return _0x539916+'d\x20ago';return _0xb0fc66['toLocaleDateString']();}['escapeHtml'](_0x2a72a0){const _0x1de174=document['createElement']('div');return _0x1de174['textContent']=_0x2a72a0,_0x1de174['innerHTML'];}['resolveAttachmentUrls'](_0x54341d){if(!_0x54341d||!this['options']['taskId'])return _0x54341d;const _0x4115d2=this['options']['getAPI'](),_0x59e630=_0x4115d2['getBaseUrl']();let _0x30f057=String(_0x54341d)['replace'](/\]\(attachment:(?:\/\/)?([^)]+)\)/g,(_0x38d10c,_0x4c46b7)=>{const _0x12be44=String(_0x4c46b7||'')['trim']();if(!_0x12be44)return _0x38d10c;let _0x27aefa=_0x12be44;try{_0x27aefa=decodeURIComponent(_0x12be44);}catch{}return']('+_0x59e630+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x27aefa)+')';});return _0x30f057;}['renderMentions'](_0xeed446){if(!_0xeed446)return _0xeed446;return String(_0xeed446)['replace'](/@?<a\s+href="mention:([^"]+)"[^>]*>([^<]+)<\/a>/g,(_0x4fd58d,_0x523247,_0x74296)=>{const _0x27fb96=this['escapeHtml'](_0x74296),_0x46ae4d=this['escapeHtml'](_0x523247);return'<span\x20class=\x22mention\x22\x20data-mention-user-id=\x22'+_0x46ae4d+'\x22>@'+_0x27fb96+'</span>';});}['startEdit'](_0x598441){this['editingCommentId']=_0x598441['id'],this['editor']['setValue'](_0x598441['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 _0x4bf06f=this['editor']['getValue']()?.['trim']();if(!_0x4bf06f&&this['pendingAttachments']['length']===0x0||!this['options']['taskId'])return;this['setLoading'](!![]);try{const _0x3b33d3=this['options']['getAPI']();this['pendingAttachments']['length']>0x0&&this['options']['enableAttachments']&&(await _0x3b33d3['uploadAttachments'](this['options']['taskId'],this['pendingAttachments']),this['existingAttachments']['push'](...this['pendingAttachments']['map'](_0x168541=>({'name':_0x168541['name']}))),this['pendingAttachments']=[]);if(this['editingCommentId']){const _0x45df2f=await _0x3b33d3['updateComment'](this['options']['taskId'],this['editingCommentId'],_0x4bf06f),_0x4dcd0d=this['comments']['findIndex'](_0x3eb50a=>_0x3eb50a['id']===this['editingCommentId']);_0x4dcd0d!==-0x1&&(this['comments'][_0x4dcd0d]=_0x45df2f['comment']);}else{const _0xbab0d0=await _0x3b33d3['addComment'](this['options']['taskId'],_0x4bf06f);this['comments']['push'](_0xbab0d0['comment']);}this['renderComments'](),this['updateCount'](),this['cancelEdit'](),this['editor']['clear']();}catch(_0x158ee4){console['error']('Failed\x20to\x20save\x20comment:',_0x158ee4),alert('Failed\x20to\x20save\x20comment:\x20'+_0x158ee4['message']);}finally{this['setLoading'](![]);}}async['deleteComment'](_0x52b767){const _0x1b997f=await this['showDeleteConfirmModal']();if(!_0x1b997f)return;try{const _0x183510=this['options']['getAPI']();await _0x183510['deleteComment'](this['options']['taskId'],_0x52b767),this['comments']=this['comments']['filter'](_0x300837=>_0x300837['id']!==_0x52b767),this['renderComments'](),this['updateCount']();}catch(_0x4c2652){console['error']('Failed\x20to\x20delete\x20comment:',_0x4c2652),alert('Failed\x20to\x20delete\x20comment:\x20'+_0x4c2652['message']);}}['showDeleteConfirmModal'](){return new Promise(_0x3ceca2=>{const _0x3b2e4b=document['createElement']('div');_0x3b2e4b['className']='comments-confirm-modal',_0x3b2e4b['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'](_0x3b2e4b);const _0x305d46=_0x370af3=>{document['removeEventListener']('keydown',_0xbe71a3),_0x3b2e4b['remove'](),_0x3ceca2(_0x370af3);},_0xbe71a3=_0x3bc7ce=>{if(_0x3bc7ce['key']==='Escape')_0x305d46(![]);};document['addEventListener']('keydown',_0xbe71a3),_0x3b2e4b['querySelector']('.comments-confirm-backdrop')['addEventListener']('click',()=>_0x305d46(![])),_0x3b2e4b['querySelector']('.comments-confirm-close')['addEventListener']('click',()=>_0x305d46(![])),_0x3b2e4b['querySelector']('.comments-confirm-cancel')['addEventListener']('click',()=>_0x305d46(![])),_0x3b2e4b['querySelector']('.comments-confirm-delete')['addEventListener']('click',()=>_0x305d46(!![])),_0x3b2e4b['querySelector']('.comments-confirm-cancel')['focus']();});}['setLoading'](_0x1a378f){this['submitBtn']['disabled']=_0x1a378f,this['submitBtn']['querySelector']('.btn-text')['hidden']=_0x1a378f,this['submitBtn']['querySelector']('.btn-loading')['hidden']=!_0x1a378f;}['updateCount'](){const _0x4be26e=this['comments']['length'],_0x55aae9=this['container']['querySelector']('#comments-count-badge');_0x55aae9&&(_0x55aae9['textContent']=_0x4be26e,_0x55aae9['hidden']=_0x4be26e===0x0);const _0x36069a=this['container']['querySelector']('#comments-count');_0x36069a&&(_0x36069a['textContent']=_0x4be26e>0x0?'('+_0x4be26e+')':''),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(_0x3b8174){const _0x402149=[],_0x3bcb84=_0x3b8174['split']('\x0a');let _0x48d049=null,_0x2efa7d=null;for(const _0x38b0e5 of _0x3bcb84){if(_0x38b0e5['startsWith']('diff\x20--git')){_0x48d049&&_0x2efa7d&&_0x48d049['hunks']['push'](_0x2efa7d);_0x48d049&&_0x402149['push'](_0x48d049);const _0x255e99=_0x38b0e5['match'](/diff --git a\/(.+?) b\/(.+)/);_0x48d049={'oldPath':_0x255e99?_0x255e99[0x1]:'','newPath':_0x255e99?_0x255e99[0x2]:'','hunks':[],'isDeleted':![]},_0x2efa7d=null;}else{if(_0x38b0e5['startsWith']('deleted\x20file\x20mode')&&_0x48d049)_0x48d049['isDeleted']=!![];else{if(_0x38b0e5['startsWith']('@@'))_0x2efa7d&&_0x48d049&&_0x48d049['hunks']['push'](_0x2efa7d),_0x2efa7d={'header':_0x38b0e5,'lines':[]};else _0x2efa7d&&_0x2efa7d['lines']['push'](_0x38b0e5);}}}return _0x48d049&&_0x2efa7d&&_0x48d049['hunks']['push'](_0x2efa7d),_0x48d049&&_0x402149['push'](_0x48d049),_0x402149;}export function parseHunkHeader(_0xf906f9){const _0x1da987=_0xf906f9['match'](/@@ -(\d+),?\d* \+(\d+),?\d* @@/);if(_0x1da987)return{'oldStart':parseInt(_0x1da987[0x1],0xa),'newStart':parseInt(_0x1da987[0x2],0xa)};return{'oldStart':0x1,'newStart':0x1};}export function highlightDiffLine(_0x5e4722,_0x29531d){const _0x114998=window['hljs']||(typeof hljs!=='undefined'?hljs:null);if(_0x114998&&_0x29531d)try{const _0x5a9c84=_0x114998['getLanguage'](_0x29531d)?_0x29531d:null;if(_0x5a9c84)return _0x114998['highlight'](_0x5e4722,{'language':_0x5a9c84})['value'];}catch(_0x1b411e){console['error']('Diff\x20syntax\x20highlighting\x20error:',_0x1b411e);}return Utils['escapeHtml'](_0x5e4722);}export function getFileLanguage(_0x29336d){const _0x3d6269=_0x29336d['split']('.')['pop']()['toLowerCase'](),_0x14d1a0={'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 _0x14d1a0[_0x3d6269]||null;}export function computeWordDiff(_0x492e23,_0x489764){const _0x3186b=_0x4070ee=>{const _0x4c7375=[];let _0x3d522c='',_0xda7939=![];for(let _0x4de9e2=0x0;_0x4de9e2<_0x4070ee['length'];_0x4de9e2++){const _0x8e75a0=_0x4070ee[_0x4de9e2],_0x10c386=/\s/['test'](_0x8e75a0);if(_0x3d522c==='')_0x3d522c=_0x8e75a0,_0xda7939=_0x10c386;else _0x10c386===_0xda7939?_0x3d522c+=_0x8e75a0:(_0x4c7375['push'](_0x3d522c),_0x3d522c=_0x8e75a0,_0xda7939=_0x10c386);}return _0x3d522c&&_0x4c7375['push'](_0x3d522c),_0x4c7375;},_0x53fa04=_0x3186b(_0x492e23),_0x57d6c3=_0x3186b(_0x489764),_0x1b3f02=_0x53fa04['length'],_0x2d4e07=_0x57d6c3['length'],_0x5a3c32=Array(_0x1b3f02+0x1)['fill'](null)['map'](()=>Array(_0x2d4e07+0x1)['fill'](0x0));for(let _0x52973f=0x1;_0x52973f<=_0x1b3f02;_0x52973f++){for(let _0x3fc0fa=0x1;_0x3fc0fa<=_0x2d4e07;_0x3fc0fa++){_0x53fa04[_0x52973f-0x1]===_0x57d6c3[_0x3fc0fa-0x1]?_0x5a3c32[_0x52973f][_0x3fc0fa]=_0x5a3c32[_0x52973f-0x1][_0x3fc0fa-0x1]+0x1:_0x5a3c32[_0x52973f][_0x3fc0fa]=Math['max'](_0x5a3c32[_0x52973f-0x1][_0x3fc0fa],_0x5a3c32[_0x52973f][_0x3fc0fa-0x1]);}}const _0x1100bf={'old':[],'new':[]};let _0x16d4bb=_0x1b3f02,_0x3c1a66=_0x2d4e07;const _0x1655fe=[],_0x2320a5=[];while(_0x16d4bb>0x0||_0x3c1a66>0x0){if(_0x16d4bb>0x0&&_0x3c1a66>0x0&&_0x53fa04[_0x16d4bb-0x1]===_0x57d6c3[_0x3c1a66-0x1])_0x1655fe['unshift']({'type':'equal','text':_0x53fa04[_0x16d4bb-0x1]}),_0x2320a5['unshift']({'type':'equal','text':_0x57d6c3[_0x3c1a66-0x1]}),_0x16d4bb--,_0x3c1a66--;else{if(_0x3c1a66>0x0&&(_0x16d4bb===0x0||_0x5a3c32[_0x16d4bb][_0x3c1a66-0x1]>=_0x5a3c32[_0x16d4bb-0x1][_0x3c1a66]))_0x2320a5['unshift']({'type':'insert','text':_0x57d6c3[_0x3c1a66-0x1]}),_0x3c1a66--;else _0x16d4bb>0x0&&(_0x1655fe['unshift']({'type':'delete','text':_0x53fa04[_0x16d4bb-0x1]}),_0x16d4bb--);}}return _0x1100bf['old']=_0x1655fe,_0x1100bf['new']=_0x2320a5,_0x1100bf;}export function renderDiffLineWithWordHighlight(_0xd5bcca,_0x127780,_0x299613,_0x439a85){if(!_0x127780||_0x127780['length']===0x0)return highlightDiffLine(_0xd5bcca,_0x439a85);let _0x31e6e7='';const _0x5b6e53=_0x299613==='add'?'diff-word-add':'diff-word-remove',_0x36e805=_0x299613==='add'?'insert':'delete';for(const _0x2f5102 of _0x127780){const _0x5009e1=Utils['escapeHtml'](_0x2f5102['text']);_0x2f5102['type']===_0x36e805?_0x31e6e7+='<span\x20class=\x22'+_0x5b6e53+'\x22>'+_0x5009e1+'</span>':_0x31e6e7+=_0x5009e1;}return _0x31e6e7;}export function calculateDiffStats(_0x2e0bbe){let _0x6d405f=0x0,_0x300bd2=0x0,_0x45c9fc=0x0;return _0x2e0bbe['forEach'](_0x568021=>{let _0x5da7d9=0x0,_0x41a7ec=0x0;_0x568021['hunks']['forEach'](_0x230b5e=>{_0x230b5e['lines']['forEach'](_0x6126b9=>{if(_0x6126b9['startsWith']('+'))_0x5da7d9+=0x1;else{if(_0x6126b9['startsWith']('-'))_0x41a7ec+=0x1;}});}),(_0x5da7d9+_0x41a7ec>0x0||_0x568021['isDeleted'])&&(_0x45c9fc+=0x1),_0x6d405f+=_0x5da7d9,_0x300bd2+=_0x41a7ec;}),{'additions':_0x6d405f,'deletions':_0x300bd2,'files':_0x45c9fc};}export function getFileStatus(_0xa02032,_0x465ed1,_0x4d0290){if(_0xa02032['isDeleted'])return'deleted';if(_0x465ed1>0x0&&_0x4d0290===0x0)return'added';return'modified';}export function safeBase64(_0x1536b2){try{return btoa(unescape(encodeURIComponent(_0x1536b2)));}catch(_0x35ddb1){return btoa(_0x1536b2);}}export function getStorageKey(_0x3489a5,_0x4cfd1a){return _0x3489a5+'-'+safeBase64(_0x4cfd1a);}export function getCollapsedState(_0x3f96b2,_0x431af2){const _0x11cca9=localStorage['getItem'](getStorageKey(_0x3f96b2,_0x431af2));return _0x11cca9==='true';}export function renderUnifiedDiff(_0x35ea79,_0x7f11fa){return _0x35ea79['map']((_0x325b4c,_0x1e3d8b)=>{const _0x5446bf=_0x325b4c['newPath']||_0x325b4c['oldPath']||'unknown',_0x1fb608='diff-'+_0x7f11fa+'-'+_0x1e3d8b,_0x236c1c=getFileLanguage(_0x5446bf),{additions:_0x54a5c1,deletions:_0x5d8e20}=calculateDiffStats([_0x325b4c]),_0x19a4d2=getCollapsedState(_0x7f11fa,_0x5446bf),_0x32afc2=getFileStatus(_0x325b4c,_0x54a5c1,_0x5d8e20),_0x40499f=_0x32afc2==='added'?'A':_0x32afc2==='deleted'?'D':'M',_0x3b1921=_0x325b4c['hunks']['map'](_0x5da20b=>{const {oldStart:_0x5f0762,newStart:_0x3e9b95}=parseHunkHeader(_0x5da20b['header']);let _0x27f0da=_0x5f0762,_0x29ba7e=_0x3e9b95;const _0x18a304=_0x5da20b['lines']['map'](_0x5b8c40=>({'line':_0x5b8c40,'type':_0x5b8c40['startsWith']('+')?'add':_0x5b8c40['startsWith']('-')?'remove':_0x5b8c40['startsWith']('\x5c')?'meta':'context'}));let _0x146b79=0x0;while(_0x146b79<_0x18a304['length']){if(_0x18a304[_0x146b79]['type']==='remove'){let _0x2128a3=_0x146b79,_0x20a91e=_0x146b79;while(_0x20a91e<_0x18a304['length']&&_0x18a304[_0x20a91e]['type']==='remove')_0x20a91e++;let _0x2b9958=_0x20a91e,_0x59838f=_0x2b9958;while(_0x59838f<_0x18a304['length']&&_0x18a304[_0x59838f]['type']==='add')_0x59838f++;const _0x8ba7fa=_0x20a91e-_0x2128a3,_0x3747d1=_0x59838f-_0x2b9958,_0x2dca87=Math['min'](_0x8ba7fa,_0x3747d1);for(let _0xc918f=0x0;_0xc918f<_0x2dca87;_0xc918f++){const _0x467bfd=_0x18a304[_0x2128a3+_0xc918f]['line']['substring'](0x1),_0x5b313f=_0x18a304[_0x2b9958+_0xc918f]['line']['substring'](0x1),_0x1eecf2=computeWordDiff(_0x467bfd,_0x5b313f);_0x18a304[_0x2128a3+_0xc918f]['wordDiff']=_0x1eecf2['old'],_0x18a304[_0x2b9958+_0xc918f]['wordDiff']=_0x1eecf2['new'];}_0x146b79=_0x59838f;}else _0x146b79++;}const _0x2ce518=_0x18a304['map'](_0x59b956=>{const _0x367bff=_0x59b956['line'];if(_0x367bff['startsWith']('+')){const _0x366ab7=_0x367bff['substring'](0x1),_0x4091a7=_0x59b956['wordDiff']?renderDiffLineWithWordHighlight(_0x366ab7,_0x59b956['wordDiff'],'add',_0x236c1c):highlightDiffLine(_0x366ab7,_0x236c1c),_0x3c3354='<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>'+_0x29ba7e+'</span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>+</span>'+_0x4091a7+'</span></div>';return _0x29ba7e+=0x1,_0x3c3354;}if(_0x367bff['startsWith']('-')){const _0x1fa29f=_0x367bff['substring'](0x1),_0x4b4e40=_0x59b956['wordDiff']?renderDiffLineWithWordHighlight(_0x1fa29f,_0x59b956['wordDiff'],'remove',_0x236c1c):highlightDiffLine(_0x1fa29f,_0x236c1c),_0x15195d='<div\x20class=\x22diff-line\x20diff-remove\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x27f0da+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>-</span>'+_0x4b4e40+'</span></div>';return _0x27f0da+=0x1,_0x15195d;}if(_0x367bff['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'](_0x367bff)+'</span></div>';const _0x3034f0=_0x367bff['startsWith']('\x20')?_0x367bff['substring'](0x1):_0x367bff,_0x161f9b=highlightDiffLine(_0x3034f0,_0x236c1c),_0xe95112='<div\x20class=\x22diff-line\x20diff-context\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x27f0da+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x29ba7e+'</span><span\x20class=\x22diff-line-content\x22>\x20'+_0x161f9b+'</span></div>';return _0x27f0da+=0x1,_0x29ba7e+=0x1,_0xe95112;})['join']('');return'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>'+Utils['escapeHtml'](_0x5da20b['header'])+'</div>'+_0x2ce518+'</div>';})['join'](''),_0x125060=_0x3b1921||'<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-'+_0x1fb608+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-header\x22\x20data-diff-id=\x22'+_0x1fb608+'\x22\x20data-file-name=\x22'+Utils['escapeHtml'](_0x5446bf)+'\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'+_0x32afc2+'\x22>'+_0x40499f+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-name\x22>'+Utils['escapeHtml'](_0x5446bf)+'</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>+'+_0x54a5c1+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-del\x22>-'+_0x5d8e20+'</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'+_0x1fb608+'\x22\x20data-collapsed=\x22'+_0x19a4d2+'\x22\x20type=\x22button\x22\x20aria-label=\x22'+(_0x19a4d2?'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'+(_0x19a4d2?'collapsed':'')+'\x22\x20id=\x22'+_0x1fb608+'\x22>'+_0x125060+'</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20';})['join']('');}
|
|
1
|
+
import{Utils}from'./app.js';export function parsePatchContent(_0x456f54){const _0x8f0054=[],_0x292183=_0x456f54['split']('\x0a');let _0x4fbd57=null,_0x1881c2=null;for(const _0x558140 of _0x292183){if(_0x558140['startsWith']('diff\x20--git')){_0x4fbd57&&_0x1881c2&&_0x4fbd57['hunks']['push'](_0x1881c2);_0x4fbd57&&_0x8f0054['push'](_0x4fbd57);const _0x7a58dc=_0x558140['match'](/diff --git a\/(.+?) b\/(.+)/);_0x4fbd57={'oldPath':_0x7a58dc?_0x7a58dc[0x1]:'','newPath':_0x7a58dc?_0x7a58dc[0x2]:'','hunks':[],'isDeleted':![]},_0x1881c2=null;}else{if(_0x558140['startsWith']('deleted\x20file\x20mode')&&_0x4fbd57)_0x4fbd57['isDeleted']=!![];else{if(_0x558140['startsWith']('@@'))_0x1881c2&&_0x4fbd57&&_0x4fbd57['hunks']['push'](_0x1881c2),_0x1881c2={'header':_0x558140,'lines':[]};else _0x1881c2&&_0x1881c2['lines']['push'](_0x558140);}}}return _0x4fbd57&&_0x1881c2&&_0x4fbd57['hunks']['push'](_0x1881c2),_0x4fbd57&&_0x8f0054['push'](_0x4fbd57),_0x8f0054;}export function parseHunkHeader(_0x4907c1){const _0x358f9d=_0x4907c1['match'](/@@ -(\d+),?\d* \+(\d+),?\d* @@/);if(_0x358f9d)return{'oldStart':parseInt(_0x358f9d[0x1],0xa),'newStart':parseInt(_0x358f9d[0x2],0xa)};return{'oldStart':0x1,'newStart':0x1};}export function highlightDiffLine(_0x94ef5b,_0x288d5b){const _0x3a4dd4=window['hljs']||(typeof hljs!=='undefined'?hljs:null);if(_0x3a4dd4&&_0x288d5b)try{const _0x325eba=_0x3a4dd4['getLanguage'](_0x288d5b)?_0x288d5b:null;if(_0x325eba)return _0x3a4dd4['highlight'](_0x94ef5b,{'language':_0x325eba})['value'];}catch(_0x5bbab8){console['error']('Diff\x20syntax\x20highlighting\x20error:',_0x5bbab8);}return Utils['escapeHtml'](_0x94ef5b);}export function getFileLanguage(_0x2b1f22){const _0x41e782=_0x2b1f22['split']('.')['pop']()['toLowerCase'](),_0x33b830={'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 _0x33b830[_0x41e782]||null;}export function computeWordDiff(_0x4854b6,_0x3ea05c){const _0x29498e=_0x570c72=>{const _0x115889=[];let _0x5e34f6='',_0x26aa73=![];for(let _0x1018b3=0x0;_0x1018b3<_0x570c72['length'];_0x1018b3++){const _0xc21234=_0x570c72[_0x1018b3],_0x103389=/\s/['test'](_0xc21234);if(_0x5e34f6==='')_0x5e34f6=_0xc21234,_0x26aa73=_0x103389;else _0x103389===_0x26aa73?_0x5e34f6+=_0xc21234:(_0x115889['push'](_0x5e34f6),_0x5e34f6=_0xc21234,_0x26aa73=_0x103389);}return _0x5e34f6&&_0x115889['push'](_0x5e34f6),_0x115889;},_0xb37edc=_0x29498e(_0x4854b6),_0x365c03=_0x29498e(_0x3ea05c),_0x3383dd=_0xb37edc['length'],_0xa1f60=_0x365c03['length'],_0x1b4702=Array(_0x3383dd+0x1)['fill'](null)['map'](()=>Array(_0xa1f60+0x1)['fill'](0x0));for(let _0x440a76=0x1;_0x440a76<=_0x3383dd;_0x440a76++){for(let _0x39dd16=0x1;_0x39dd16<=_0xa1f60;_0x39dd16++){_0xb37edc[_0x440a76-0x1]===_0x365c03[_0x39dd16-0x1]?_0x1b4702[_0x440a76][_0x39dd16]=_0x1b4702[_0x440a76-0x1][_0x39dd16-0x1]+0x1:_0x1b4702[_0x440a76][_0x39dd16]=Math['max'](_0x1b4702[_0x440a76-0x1][_0x39dd16],_0x1b4702[_0x440a76][_0x39dd16-0x1]);}}const _0x4ad049={'old':[],'new':[]};let _0x55b3ac=_0x3383dd,_0x27bf31=_0xa1f60;const _0x69c3d0=[],_0x1927ac=[];while(_0x55b3ac>0x0||_0x27bf31>0x0){if(_0x55b3ac>0x0&&_0x27bf31>0x0&&_0xb37edc[_0x55b3ac-0x1]===_0x365c03[_0x27bf31-0x1])_0x69c3d0['unshift']({'type':'equal','text':_0xb37edc[_0x55b3ac-0x1]}),_0x1927ac['unshift']({'type':'equal','text':_0x365c03[_0x27bf31-0x1]}),_0x55b3ac--,_0x27bf31--;else{if(_0x27bf31>0x0&&(_0x55b3ac===0x0||_0x1b4702[_0x55b3ac][_0x27bf31-0x1]>=_0x1b4702[_0x55b3ac-0x1][_0x27bf31]))_0x1927ac['unshift']({'type':'insert','text':_0x365c03[_0x27bf31-0x1]}),_0x27bf31--;else _0x55b3ac>0x0&&(_0x69c3d0['unshift']({'type':'delete','text':_0xb37edc[_0x55b3ac-0x1]}),_0x55b3ac--);}}return _0x4ad049['old']=_0x69c3d0,_0x4ad049['new']=_0x1927ac,_0x4ad049;}export function renderDiffLineWithWordHighlight(_0x307136,_0x40b663,_0x54844d,_0x14c452){if(!_0x40b663||_0x40b663['length']===0x0)return highlightDiffLine(_0x307136,_0x14c452);let _0x35ba71='';const _0x3e3f0f=_0x54844d==='add'?'diff-word-add':'diff-word-remove',_0x2b8379=_0x54844d==='add'?'insert':'delete';for(const _0x1b29d7 of _0x40b663){const _0x25e31b=Utils['escapeHtml'](_0x1b29d7['text']);_0x1b29d7['type']===_0x2b8379?_0x35ba71+='<span\x20class=\x22'+_0x3e3f0f+'\x22>'+_0x25e31b+'</span>':_0x35ba71+=_0x25e31b;}return _0x35ba71;}export function calculateDiffStats(_0x109321){let _0xb0755c=0x0,_0xfe8647=0x0,_0x3d82fa=0x0;return _0x109321['forEach'](_0x3b2001=>{let _0xc774ed=0x0,_0x1e34a1=0x0;_0x3b2001['hunks']['forEach'](_0x5ce517=>{_0x5ce517['lines']['forEach'](_0x544f12=>{if(_0x544f12['startsWith']('+'))_0xc774ed+=0x1;else{if(_0x544f12['startsWith']('-'))_0x1e34a1+=0x1;}});}),(_0xc774ed+_0x1e34a1>0x0||_0x3b2001['isDeleted'])&&(_0x3d82fa+=0x1),_0xb0755c+=_0xc774ed,_0xfe8647+=_0x1e34a1;}),{'additions':_0xb0755c,'deletions':_0xfe8647,'files':_0x3d82fa};}export function getFileStatus(_0x36d226,_0x4d3637,_0x4c8f7f){if(_0x36d226['isDeleted'])return'deleted';if(_0x4d3637>0x0&&_0x4c8f7f===0x0)return'added';return'modified';}export function safeBase64(_0x47c391){try{return btoa(unescape(encodeURIComponent(_0x47c391)));}catch(_0x23e44c){return btoa(_0x47c391);}}export function getStorageKey(_0x4d1b83,_0xd5de3a){return _0x4d1b83+'-'+safeBase64(_0xd5de3a);}export function getCollapsedState(_0x449c7e,_0x3a3a89){const _0x27a36c=localStorage['getItem'](getStorageKey(_0x449c7e,_0x3a3a89));return _0x27a36c==='true';}export function renderUnifiedDiff(_0xf47d19,_0x3293dc){return _0xf47d19['map']((_0x3d2c11,_0x1c5a6c)=>{const _0x3854ef=_0x3d2c11['newPath']||_0x3d2c11['oldPath']||'unknown',_0x4a3530='diff-'+_0x3293dc+'-'+_0x1c5a6c,_0x285875=getFileLanguage(_0x3854ef),{additions:_0xe06007,deletions:_0x36fd8d}=calculateDiffStats([_0x3d2c11]),_0x34219e=getCollapsedState(_0x3293dc,_0x3854ef),_0x881bf7=getFileStatus(_0x3d2c11,_0xe06007,_0x36fd8d),_0x6ba956=_0x881bf7==='added'?'A':_0x881bf7==='deleted'?'D':'M',_0x2ae306=_0x3d2c11['hunks']['map'](_0xc7d995=>{const {oldStart:_0x4c2248,newStart:_0x512fcd}=parseHunkHeader(_0xc7d995['header']);let _0x53e1fa=_0x4c2248,_0x32d48f=_0x512fcd;const _0xe79fe4=_0xc7d995['lines']['map'](_0x4f6450=>({'line':_0x4f6450,'type':_0x4f6450['startsWith']('+')?'add':_0x4f6450['startsWith']('-')?'remove':_0x4f6450['startsWith']('\x5c')?'meta':'context'}));let _0x53a927=0x0;while(_0x53a927<_0xe79fe4['length']){if(_0xe79fe4[_0x53a927]['type']==='remove'){let _0x50ecb6=_0x53a927,_0x2f85ea=_0x53a927;while(_0x2f85ea<_0xe79fe4['length']&&_0xe79fe4[_0x2f85ea]['type']==='remove')_0x2f85ea++;let _0xa9948a=_0x2f85ea,_0x372714=_0xa9948a;while(_0x372714<_0xe79fe4['length']&&_0xe79fe4[_0x372714]['type']==='add')_0x372714++;const _0x1e2a0c=_0x2f85ea-_0x50ecb6,_0x5d8c4e=_0x372714-_0xa9948a,_0x147ce8=Math['min'](_0x1e2a0c,_0x5d8c4e);for(let _0x2d2eae=0x0;_0x2d2eae<_0x147ce8;_0x2d2eae++){const _0x985d31=_0xe79fe4[_0x50ecb6+_0x2d2eae]['line']['substring'](0x1),_0x280504=_0xe79fe4[_0xa9948a+_0x2d2eae]['line']['substring'](0x1),_0x1f963b=computeWordDiff(_0x985d31,_0x280504);_0xe79fe4[_0x50ecb6+_0x2d2eae]['wordDiff']=_0x1f963b['old'],_0xe79fe4[_0xa9948a+_0x2d2eae]['wordDiff']=_0x1f963b['new'];}_0x53a927=_0x372714;}else _0x53a927++;}const _0x1ad443=_0xe79fe4['map'](_0x545007=>{const _0x1fb144=_0x545007['line'];if(_0x1fb144['startsWith']('+')){const _0x3c083d=_0x1fb144['substring'](0x1),_0x23cf36=_0x545007['wordDiff']?renderDiffLineWithWordHighlight(_0x3c083d,_0x545007['wordDiff'],'add',_0x285875):highlightDiffLine(_0x3c083d,_0x285875),_0x22b7c3='<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>'+_0x32d48f+'</span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>+</span>'+_0x23cf36+'</span></div>';return _0x32d48f+=0x1,_0x22b7c3;}if(_0x1fb144['startsWith']('-')){const _0x10879a=_0x1fb144['substring'](0x1),_0x502eb5=_0x545007['wordDiff']?renderDiffLineWithWordHighlight(_0x10879a,_0x545007['wordDiff'],'remove',_0x285875):highlightDiffLine(_0x10879a,_0x285875),_0x1d899d='<div\x20class=\x22diff-line\x20diff-remove\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x53e1fa+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>-</span>'+_0x502eb5+'</span></div>';return _0x53e1fa+=0x1,_0x1d899d;}if(_0x1fb144['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'](_0x1fb144)+'</span></div>';const _0x40dba9=_0x1fb144['startsWith']('\x20')?_0x1fb144['substring'](0x1):_0x1fb144,_0x403767=highlightDiffLine(_0x40dba9,_0x285875),_0x374c90='<div\x20class=\x22diff-line\x20diff-context\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x53e1fa+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x32d48f+'</span><span\x20class=\x22diff-line-content\x22>\x20'+_0x403767+'</span></div>';return _0x53e1fa+=0x1,_0x32d48f+=0x1,_0x374c90;})['join']('');return'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>'+Utils['escapeHtml'](_0xc7d995['header'])+'</div>'+_0x1ad443+'</div>';})['join'](''),_0x4f522e=_0x2ae306||'<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-'+_0x4a3530+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-header\x22\x20data-diff-id=\x22'+_0x4a3530+'\x22\x20data-file-name=\x22'+Utils['escapeHtml'](_0x3854ef)+'\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'+_0x881bf7+'\x22>'+_0x6ba956+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-name\x22>'+Utils['escapeHtml'](_0x3854ef)+'</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>+'+_0xe06007+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-del\x22>-'+_0x36fd8d+'</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'+_0x4a3530+'\x22\x20data-collapsed=\x22'+_0x34219e+'\x22\x20type=\x22button\x22\x20aria-label=\x22'+(_0x34219e?'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'+(_0x34219e?'collapsed':'')+'\x22\x20id=\x22'+_0x4a3530+'\x22>'+_0x4f522e+'</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20';})['join']('');}
|