@profoundlogic/coderflow-server 0.6.0 → 0.6.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/.claude/settings.local.json +15 -2
- package/dist/coder-server.js +1 -1
- package/dist/config.js +1 -1
- package/dist/lib/agent-keepalive.js +1 -1
- package/dist/lib/agent-models.js +1 -1
- package/dist/lib/api-keys.js +1 -1
- package/dist/lib/apiKeys.js +1 -1
- package/dist/lib/app-server-ports.js +1 -1
- package/dist/lib/auto-judge.js +1 -1
- package/dist/lib/automation-service.js +1 -1
- package/dist/lib/basic-auth.js +1 -1
- package/dist/lib/bindings.js +1 -1
- package/dist/lib/build-history.js +1 -1
- package/dist/lib/build-output-service.js +1 -1
- package/dist/lib/build-scheduler.js +1 -1
- package/dist/lib/build-service.js +1 -1
- package/dist/lib/ca-certificates.js +1 -1
- package/dist/lib/claude-oauth-refresh.js +1 -1
- package/dist/lib/cli/build.js +1 -1
- package/dist/lib/cli/cleanup-users.js +1 -1
- package/dist/lib/cli/config-command.js +1 -1
- package/dist/lib/cli/config.js +1 -1
- package/dist/lib/cli/create-user.js +1 -1
- package/dist/lib/cli/grant-admin.js +1 -1
- package/dist/lib/cli/init.js +1 -1
- package/dist/lib/cli/jira.js +1 -1
- package/dist/lib/cli/license.js +1 -1
- package/dist/lib/cli/list-roles.js +1 -1
- package/dist/lib/cli/list-users.js +1 -1
- package/dist/lib/cli/server-manager.js +1 -1
- package/dist/lib/cli/set-password.js +1 -1
- package/dist/lib/config-migration.js +1 -1
- package/dist/lib/container-credential-sync.js +1 -1
- package/dist/lib/container-tokens.js +1 -1
- package/dist/lib/data-dir.js +1 -1
- package/dist/lib/deployment-history.js +1 -1
- package/dist/lib/deployment-service.js +1 -1
- package/dist/lib/docker-utils.js +1 -1
- package/dist/lib/email.js +1 -1
- package/dist/lib/emailTemplates.js +1 -1
- package/dist/lib/entitlement.js +1 -1
- package/dist/lib/external-connections.js +1 -1
- package/dist/lib/fetch-utils.js +1 -1
- package/dist/lib/git-commit-details-route.js +1 -1
- package/dist/lib/git-history-diff-guardrails.js +1 -1
- package/dist/lib/git-provider-service.js +1 -1
- package/dist/lib/git-provider-setup/github-setup-handler.js +1 -1
- package/dist/lib/git-provider-setup/index.js +1 -1
- package/dist/lib/git-provider-setup/setup-factory.js +1 -1
- package/dist/lib/git-provider-setup/setup-interface.js +1 -1
- package/dist/lib/git-providers/azure-devops-provider.js +1 -1
- package/dist/lib/git-providers/github-app-provider.js +1 -1
- package/dist/lib/git-providers/index.js +1 -1
- package/dist/lib/git-providers/provider-factory.js +1 -1
- package/dist/lib/git-providers/provider-interface.js +1 -1
- package/dist/lib/github-urls.js +1 -1
- package/dist/lib/group-objective-linking.js +1 -1
- package/dist/lib/ibmi-sync.js +1 -1
- package/dist/lib/jira-client.js +1 -1
- package/dist/lib/judge-blinding.js +1 -1
- package/dist/lib/logger.js +1 -1
- package/dist/lib/migration-to-scoped-rbac.js +1 -1
- package/dist/lib/model-fetcher.js +1 -1
- package/dist/lib/notifications.js +1 -1
- package/dist/lib/objective-context.js +1 -1
- package/dist/lib/oidc-auth.js +1 -1
- package/dist/lib/oidc-device-flow.js +1 -1
- package/dist/lib/passwordTokens.js +1 -1
- package/dist/lib/permission-resolver.js +1 -1
- package/dist/lib/pin-cascade.js +1 -1
- package/dist/lib/provider-accounts.js +1 -1
- package/dist/lib/provider-oauth.js +1 -1
- package/dist/lib/provider-profile.js +1 -1
- package/dist/lib/provider-token-refresh.js +1 -1
- package/dist/lib/rbac-user-state.js +1 -1
- package/dist/lib/request-url.js +1 -1
- package/dist/lib/rewind.js +1 -1
- package/dist/lib/role-definitions.js +1 -1
- package/dist/lib/roles.js +1 -1
- package/dist/lib/secrets.js +1 -1
- package/dist/lib/setup-repo-git-auth.js +1 -1
- package/dist/lib/state-capture.js +1 -1
- package/dist/lib/static-files.js +1 -1
- package/dist/lib/task-name-format.js +1 -1
- package/dist/lib/task-name-generator.js +1 -1
- package/dist/lib/task-source-metadata.js +1 -1
- package/dist/lib/teams.js +1 -1
- package/dist/lib/user-git-oauth.js +1 -1
- package/dist/lib/user-git-tokens.js +1 -1
- package/dist/lib/users.js +1 -1
- package/dist/middleware/requireAuth.js +1 -1
- package/dist/middleware/requireInit.js +1 -1
- package/dist/middleware/requirePermission.js +1 -1
- package/dist/package.json +1 -1
- package/dist/playwright-test-results/.last-run.json +52 -2
- 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/objective-management.js +1 -1
- package/dist/routes/password.js +1 -1
- package/dist/routes/prompt.js +1 -1
- package/dist/routes/provider-auth.js +1 -1
- package/dist/routes/qa.js +1 -1
- package/dist/routes/roles.js +1 -1
- package/dist/routes/settings.js +1 -1
- package/dist/routes/skill-management.js +1 -1
- package/dist/routes/skills.js +1 -1
- package/dist/routes/tasks.js +1 -1
- package/dist/routes/teams.js +1 -1
- package/dist/routes/templates.js +1 -1
- package/dist/routes/test-task.js +1 -1
- package/dist/routes/test.js +1 -1
- package/dist/routes/users.js +1 -1
- package/dist/routes/visualizations.js +1 -1
- package/dist/scripts/create-user.js +1 -1
- package/dist/scripts/migrate-config-to-data-dir.js +1 -1
- package/dist/start.js +1 -1
- package/dist/web-ui/public/activity-detail-modal.js +1 -1
- package/dist/web-ui/public/activity-feed.js +1 -1
- package/dist/web-ui/public/activity-formatters.js +1 -1
- package/dist/web-ui/public/agent-event-parser.js +1 -1
- package/dist/web-ui/public/app.js +1 -1
- package/dist/web-ui/public/approve-dialog.js +1 -1
- package/dist/web-ui/public/automation-links.js +1 -1
- package/dist/web-ui/public/automation-schedule.js +1 -1
- package/dist/web-ui/public/comments-widget.js +1 -1
- package/dist/web-ui/public/diff-utils.js +1 -1
- package/dist/web-ui/public/environments.html +0 -61
- package/dist/web-ui/public/environments.js +1 -1
- 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/server-health.js +1 -1
- package/dist/web-ui/public/settings.js +1 -1
- package/dist/web-ui/public/setup-password.js +1 -1
- package/dist/web-ui/public/skills.js +1 -1
- package/dist/web-ui/public/sse-client.js +1 -1
- package/dist/web-ui/public/sse-shared-worker.js +1 -1
- package/dist/web-ui/public/styles.css +8 -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
- package/dist/playwright-test-results/result-screenshot.png +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
function isLogOnlyTaskType(_0x21391e){return _0x21391e==='test'||_0x21391e==='deploy';}export function createApproveDialogHTML(_0x294e56='',_0x3cd901={}){const _0x52fd49=_0x294e56,_0x450efa=_0x3cd901['useTaskPageStyles']?'modal\x20profound-approve-modal':'profound-feedback-modal\x20profound-approve-modal',_0x29b37e=_0x3cd901['useTaskPageStyles']?'modal-warning':'approve-modal-warning',_0x553eb9=_0x3cd901['useTaskPageStyles']?'modal-error':'approve-modal-error';return'\x0a\x20\x20\x20\x20<div\x20id=\x22'+_0x52fd49+'approve-modal\x22\x20class=\x22'+_0x450efa+'\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'+_0x52fd49+'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'+_0x52fd49+'approve-warning\x22\x20class=\x22'+_0x29b37e+'\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'+_0x52fd49+'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'+_0x52fd49+'approve-error\x22\x20class=\x22'+_0x553eb9+'\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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'commit-message-input\x22>Commit\x20message:</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<textarea\x20id=\x22'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'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'+_0x52fd49+'cancel-approve\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x22\x20id=\x22'+_0x52fd49+'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(_0x37999b={}){this['prefix']=_0x37999b['prefix']||'',this['onApprove']=_0x37999b['onApprove'],this['onSync']=_0x37999b['onSync'],this['onSuccess']=_0x37999b['onSuccess'],this['onError']=_0x37999b['onError'],this['onCreatePR']=_0x37999b['onCreatePR'],this['showToast']=_0x37999b['showToast']||(()=>{}),this['container']=_0x37999b['container']||document['body'],this['useTaskPageStyles']=_0x37999b['useTaskPageStyles']||![],this['baseUrl']=_0x37999b['baseUrl']||'',this['coderflowAttribution']=_0x37999b['coderflowAttribution'],this['onSyncToIbmi']=_0x37999b['onSyncToIbmi']||null,this['onGetSyncFiles']=_0x37999b['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 _0x40023a=document['createElement']('div');_0x40023a['innerHTML']=createApproveDialogHTML(this['prefix'],{'useTaskPageStyles':this['useTaskPageStyles']}),this['container']['appendChild'](_0x40023a['firstElementChild']),this['_bindEvents'](),this['initialized']=!![];}['_el'](_0xc8218a){return document['getElementById'](''+this['prefix']+_0xc8218a);}['_bindEvents'](){const _0x22ad9c=this['_el']('approve-modal'),_0x20222a=this['_el']('close-approve-modal'),_0x16229d=this['_el']('cancel-approve'),_0x39b647=this['_el']('confirm-approve'),_0x2fb30a=_0x22ad9c?.['querySelector']('.modal-overlay'),_0x14e1a1=this['_el']('create-new-branch'),_0x77b2b6=this['_el']('new-branch-input-container'),_0x7e123=this['_el']('new-branch-name'),_0x12b42d=this['_el']('push-after-commit'),_0x986aa8=this['_el']('create-pull-request'),_0x4cdd3e=this['_el']('pr-hint');_0x20222a?.['addEventListener']('click',()=>this['hide']()),_0x16229d?.['addEventListener']('click',()=>this['hide']()),_0x2fb30a?.['addEventListener']('click',()=>this['hide']()),_0x39b647?.['addEventListener']('click',()=>this['_handleApprove']());_0x14e1a1&&_0x14e1a1['addEventListener']('change',()=>{_0x77b2b6&&(_0x77b2b6['hidden']=!_0x14e1a1['checked']),_0x14e1a1['checked']&&_0x7e123&&_0x7e123['focus']();});_0x986aa8&&_0x12b42d&&_0x14e1a1&&(_0x986aa8['addEventListener']('change',()=>{this['_createPR']=_0x986aa8['checked'];if(_0x986aa8['checked']){_0x12b42d['checked']=!![],_0x12b42d['disabled']=!![],_0x14e1a1['checked']=!![],_0x14e1a1['disabled']=!![];_0x77b2b6&&(_0x77b2b6['hidden']=![]);if(_0x4cdd3e)_0x4cdd3e['hidden']=![];}else{_0x12b42d['disabled']=![],_0x14e1a1['disabled']=![];if(_0x4cdd3e)_0x4cdd3e['hidden']=!![];}}),_0x12b42d['addEventListener']('change',()=>{if(!_0x12b42d['checked']&&_0x986aa8['checked']){_0x986aa8['checked']=![],this['_createPR']=![],_0x12b42d['disabled']=![],_0x14e1a1['disabled']=![];if(_0x4cdd3e)_0x4cdd3e['hidden']=!![];}}));const _0x55c750=this['_el']('sync-to-ibmi');_0x55c750&&_0x55c750['addEventListener']('change',async _0x48f301=>{const _0x48ec10=this['_el']('ibmi-sync-fields');if(_0x48ec10)_0x48ec10['hidden']=!_0x48f301['target']['checked'];if(_0x48f301['target']['checked']){const _0x565849=this['_el']('ibmi-sync-library'),_0xec9e36=localStorage['getItem']('coderflow_ibmi_sync_library');_0xec9e36&&_0x565849&&!_0x565849['value']&&(_0x565849['value']=_0xec9e36);const _0x4e4b8a=this['_el']('ibmi-sync-user');if(_0x4e4b8a&&!_0x4e4b8a['value']){const _0x4ddede=localStorage['getItem']('coderflow_ibmi_sync_user');if(_0x4ddede)_0x4e4b8a['value']=_0x4ddede;}const _0x102385=this['_el']('ibmi-sync-password');if(_0x102385)_0x102385['value']='';!this['_syncFileTree']&&this['onGetSyncFiles']&&this['taskData']?.['taskId']&&await this['_loadSyncFileTree']();}}),document['addEventListener']('keydown',_0x4b2a70=>{_0x4b2a70['key']==='Escape'&&_0x22ad9c&&!_0x22ad9c['hidden']&&this['hide']();});}async['_loadSyncFileTree'](){const _0x131272=this['_el']('ibmi-sync-file-tree'),_0x296d29=this['_el']('ibmi-sync-files-summary');if(!_0x131272)return;_0x131272['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>Loading\x20files...</span>';if(_0x296d29)_0x296d29['textContent']='';try{const {files:_0x615c58,absolutePaths:_0x5749f9}=await this['onGetSyncFiles'](this['taskData']['taskId']);this['_syncRelativeFiles']=_0x615c58,this['_syncAbsolutePaths']=_0x5749f9;if(_0x615c58['length']===0x0){_0x131272['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>No\x20changed\x20files\x20found.</span>';return;}const {FileSelectionTree:_0x4b8420}=await import('./file-selection-tree.js'),{validateIbmiFile:_0x363cac,hasKnownIbmiExtension:_0x3056e8}=await import('./ibmi-file-filter.js');this['_syncFileTree']=new _0x4b8420({'container':_0x131272,'files':_0x615c58,'isPreselected':_0x176699=>{const {valid:_0x5046e6}=_0x363cac(_0x176699);return _0x5046e6&&_0x3056e8(_0x176699);},'isDisabled':_0x3a4ecb=>{const {valid:_0x3444ad,reason:_0x526f3a}=_0x363cac(_0x3a4ecb);return{'disabled':!_0x3444ad,'reason':_0x526f3a};},'isAutoCheckEligible':_0x442ec9=>{const {valid:_0x34c1d6}=_0x363cac(_0x442ec9);return _0x34c1d6&&_0x3056e8(_0x442ec9);},'onChange':_0x2f37cf=>{_0x296d29&&(_0x296d29['textContent']=_0x2f37cf['length']+'\x20of\x20'+_0x615c58['length']+'\x20file'+(_0x615c58['length']!==0x1?'s':'')+'\x20selected');}}),this['_syncFileTree']['render']();}catch(_0x425ef4){_0x131272['innerHTML']='<span\x20style=\x22color:\x20var(--color-danger,\x20#e55368);\x20font-size:\x2013px;\x22>Failed\x20to\x20load\x20files</span>';}}['showError'](_0x93a975){const _0x25cdad=this['_el']('approve-error'),_0x25962a=this['_el']('approve-error-text');_0x25cdad&&_0x25962a&&(_0x25962a['textContent']=_0x93a975,_0x25cdad['hidden']=![],_0x25cdad['scrollIntoView']({'behavior':'smooth','block':'nearest'}));}['hideError'](){const _0x53c866=this['_el']('approve-error'),_0x13fc34=this['_el']('approve-error-text');_0x53c866&&_0x13fc34&&(_0x53c866['hidden']=!![],_0x13fc34['textContent']='');}['_displayBranchInfo'](_0xb51679,_0x1558de={}){const _0x259be4=this['_el']('approve-branches');if(!_0x259be4)return;const _0x5a1bf5=[];for(const _0x253b99 of _0xb51679){_0x1558de[_0x253b99['name']]&&_0x5a1bf5['push']({'repo':_0x253b99['name'],'branch':_0x1558de[_0x253b99['name']]});}if(_0x5a1bf5['length']>0x0){_0x259be4['hidden']=![];if(_0x5a1bf5['length']===0x1)_0x259be4['innerHTML']='<div\x20class=\x22branch-info\x22>Branch:\x20<code>'+_0x5a1bf5[0x0]['branch']+'</code></div>';else{const _0x333347=_0x5a1bf5['map'](_0x5d04ff=>'<div\x20class=\x22branch-item\x22><strong>'+_0x5d04ff['repo']+':</strong>\x20<code>'+_0x5d04ff['branch']+'</code></div>')['join']('');_0x259be4['innerHTML']='<div\x20class=\x22branch-info\x22>Branches:<div\x20class=\x22branch-list\x22>'+_0x333347+'</div></div>';}}else _0x259be4['hidden']=!![],_0x259be4['innerHTML']='';}['showWarning'](_0x1f23eb){const _0x5a6409=this['_el']('approve-warning'),_0x4c7122=this['_el']('approve-warning-text');_0x5a6409&&_0x4c7122&&(_0x4c7122['textContent']=_0x1f23eb,_0x5a6409['hidden']=![]);}['hideWarning'](){const _0xc3af88=this['_el']('approve-warning'),_0x5f5a5f=this['_el']('approve-warning-text');_0xc3af88&&_0x5f5a5f&&(_0xc3af88['hidden']=!![],_0x5f5a5f['textContent']='');}['_stripCoAuthoredByLines'](_0x5b1ad7){return _0x5b1ad7['replace'](/^Co-Authored-By:.*$/gmi,'')['replace'](/^Learn more: https:\/\/coderflow\.ai\s*$/gm,'')['replace'](/\n{3,}/g,'\x0a\x0a')['trim']();}async['_addAttributionIfEnabled'](_0x3cdbdf){try{let _0x30dff5;try{const _0x5f2190=await fetch(this['baseUrl']+'/settings');if(_0x5f2190['ok']){const _0x522261=await _0x5f2190['json']();_0x30dff5=_0x522261['coderflow_attribution']!==![];}}catch(_0x3b1843){}_0x30dff5===undefined&&(this['coderflowAttribution']!==undefined?_0x30dff5=this['coderflowAttribution']!==![]:_0x30dff5=!![]);const _0x24e8e4=this['_stripCoAuthoredByLines'](_0x3cdbdf);if(!_0x30dff5)return _0x24e8e4;const _0x37283e='\x0a\x0aCo-Authored-By:\x20CoderFlow\x20<ai@coderflow.ai>\x0aLearn\x20more:\x20https://coderflow.ai';return _0x24e8e4+_0x37283e;}catch(_0xe36190){return console['warn']('Failed\x20to\x20add\x20CoderFlow\x20attribution:',_0xe36190),_0x3cdbdf;}}['show'](_0x3d59c4){!this['initialized']&&this['init']();this['taskData']=_0x3d59c4;const _0x578eb4=this['_el']('approve-modal'),_0x4f2cc3=this['_el']('commit-message-input'),_0x6cb1f6=this['_el']('pull-before-commit'),_0x2f3d52=this['_el']('push-after-commit'),_0x4248b3=this['_el']('create-new-branch'),_0x191359=this['_el']('new-branch-input-container'),_0x560e44=this['_el']('new-branch-name'),_0xc213f5=this['_el']('approve-repo-name'),_0x1f2f4b=this['_el']('approve-stats'),_0x150a2c=this['_el']('multi-repo-note');if(!_0x578eb4)return;this['hideError'](),this['hideWarning']();_0x3d59c4['warning']&&this['showWarning'](_0x3d59c4['warning']);const _0x2cea16=_0x3d59c4['reposChanged']||[];if(_0x2cea16['length']===0x0&&!_0x3d59c4['syncFirst']){this['showToast']('No\x20changes\x20to\x20approve','error');return;}this['_updateDisplay'](_0x2cea16,_0x3d59c4);const _0x1494ed=_0x3d59c4['commitMessage']||'',_0x1a45a0=this['_stripCoAuthoredByLines'](_0x1494ed);_0x4f2cc3['value']=_0x1a45a0;if(_0x6cb1f6)_0x6cb1f6['checked']=!![];if(_0x2f3d52)_0x2f3d52['checked']=!![];_0x4248b3&&(_0x4248b3['checked']=![]);_0x191359&&(_0x191359['hidden']=!![]);_0x560e44&&(_0x560e44['value']='');if(_0x2f3d52)_0x2f3d52['disabled']=![];if(_0x4248b3)_0x4248b3['disabled']=![];this['updatePRSupport'](_0x3d59c4['prSupported']===!![]);const _0x498a79=this['_el']('ibmi-sync-section');if(_0x498a79){_0x498a79['hidden']=!_0x3d59c4['ibmiSyncAvailable'];const _0xb7bbb2=this['_el']('sync-to-ibmi'),_0x76dcd0=this['_el']('ibmi-sync-fields'),_0x21bef2=this['_el']('ibmi-sync-library');if(_0xb7bbb2)_0xb7bbb2['checked']=![];if(_0x76dcd0)_0x76dcd0['hidden']=!![];if(_0x21bef2)_0x21bef2['value']='';const _0x19313f=this['_el']('ibmi-sync-credentials-row');_0x19313f&&(_0x19313f['hidden']=!(_0x3d59c4['ibmiSyncAvailable']&&_0x3d59c4['syncCredentials']==='prompt'));}const _0x3cfd15=this['_el']('confirm-approve');_0x3d59c4['syncFirst']&&this['onSync']?(_0x3cfd15&&(_0x3cfd15['disabled']=!![],_0x3cfd15['textContent']='Syncing...'),this['_performSync']()):_0x3cfd15&&(_0x3cfd15['disabled']=![],_0x3cfd15['textContent']='Commit\x20Changes');_0x578eb4['hidden']=![];const _0x9d3ee3=++this['_attributionRequestId'];void this['_applyAttributionAsync']({'requestId':_0x9d3ee3,'taskId':_0x3d59c4['taskId'],'originalCommitMessage':_0x1a45a0}),setTimeout(()=>{_0x4f2cc3['focus'](),_0x4f2cc3['setSelectionRange'](0x0,_0x4f2cc3['value']['length']);},0x64);}['updatePRSupport'](_0x1989b1){const _0xd129a1=this['_el']('pr-option-section'),_0x276389=this['_el']('create-pull-request'),_0x5a847f=this['_el']('pr-hint'),_0x246ad5=this['_el']('push-after-commit'),_0x1eb337=this['_el']('create-new-branch');if(!_0xd129a1)return;if(_0x1989b1){_0xd129a1['hidden']=![];_0x276389&&!_0x276389['disabled']&&(_0x276389['checked']=![]);if(_0x5a847f)_0x5a847f['hidden']=!![];this['_createPR']=![];return;}_0x276389?.['checked']&&(_0x276389['checked']=![]);if(_0x5a847f)_0x5a847f['hidden']=!![];if(_0x246ad5)_0x246ad5['disabled']=![];if(_0x1eb337)_0x1eb337['disabled']=![];this['_createPR']=![],_0xd129a1['hidden']=!![];}async['_applyAttributionAsync']({requestId:_0x239135,taskId:_0x12fdf9,originalCommitMessage:_0x1e5525}){const _0x1b2ab4=this['_el']('commit-message-input');if(!_0x1b2ab4)return;const _0x36494b=await this['_addAttributionIfEnabled'](_0x1e5525);if(_0x239135!==this['_attributionRequestId'])return;if(!this['taskData']||this['taskData']['taskId']!==_0x12fdf9)return;if(!this['isVisible']())return;const _0x33619b=_0x3fcaa7=>_0x3fcaa7['replace'](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a');if(_0x33619b(_0x1b2ab4['value'])!==_0x33619b(_0x1e5525))return;_0x1b2ab4['value']=_0x36494b;}['_updateDisplay'](_0x1ed80a,_0x342b1c){const _0x1c8cac=this['_el']('approve-repo-name'),_0x25e5d4=this['_el']('approve-stats'),_0x5e986a=this['_el']('multi-repo-note');if(_0x1ed80a['length']===0x0){if(_0x1c8cac)_0x1c8cac['textContent']='Syncing...';if(_0x25e5d4)_0x25e5d4['textContent']='';if(_0x5e986a)_0x5e986a['hidden']=!![];return;}const _0x534cf1=_0x1ed80a['reduce']((_0x4a2cc,_0x3c27bb)=>_0x4a2cc+(_0x3c27bb['files_changed']||0x0),0x0),_0x2cd124=_0x1ed80a['reduce']((_0x24044f,_0x400563)=>_0x24044f+(_0x400563['lines_added']||0x0),0x0),_0x2f4389=_0x1ed80a['reduce']((_0x25f136,_0xd1f008)=>_0x25f136+(_0xd1f008['lines_deleted']||0x0),0x0);if(_0x1ed80a['length']===0x1){if(_0x1c8cac)_0x1c8cac['textContent']=_0x1ed80a[0x0]?.['name']||'repository';if(_0x5e986a)_0x5e986a['hidden']=!![];}else{const _0x576bee=_0x1ed80a['map'](_0x31efe6=>_0x31efe6['name'])['join'](',\x20');if(_0x1c8cac)_0x1c8cac['textContent']=_0x1ed80a['length']+'\x20repositories:\x20'+_0x576bee;if(_0x5e986a)_0x5e986a['hidden']=![];}_0x25e5d4&&(_0x25e5d4['textContent']=_0x534cf1+'\x20file'+(_0x534cf1===0x1?'':'s')+'\x20changed\x20(+'+_0x2cd124+'\x20-'+_0x2f4389+')'),this['_displayBranchInfo'](_0x1ed80a,_0x342b1c?.['branches']||{});}async['_performSync'](){if(!this['onSync']||this['isSyncing'])return;this['isSyncing']=!![];const _0x3f48b9=this['_el']('confirm-approve');try{const _0x4d4c3c=await this['onSync'](this['taskData']['taskId']);if(!this['isVisible']()){this['isSyncing']=![];return;}if(_0x4d4c3c['repos_changed']){const _0x247c29=this['taskData']['reposChanged']?.['length']||0x0,_0x4adcfc=this['taskData']['reposChanged']?.['reduce']((_0x1ff1e2,_0x48294b)=>_0x1ff1e2+(_0x48294b['files_changed']||0x0),0x0)||0x0;this['taskData']['reposChanged']=_0x4d4c3c['repos_changed'],this['_updateDisplay'](_0x4d4c3c['repos_changed'],this['taskData']);const _0x3ed020=_0x4d4c3c['repos_changed']['length'],_0x59a7f7=_0x4d4c3c['repos_changed']['reduce']((_0x30f1b6,_0x271515)=>_0x30f1b6+(_0x271515['files_changed']||0x0),0x0);(_0x59a7f7>_0x4adcfc||_0x3ed020>_0x247c29)&&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.');}_0x3f48b9&&(!this['taskData']['reposChanged']||this['taskData']['reposChanged']['length']===0x0?(_0x3f48b9['disabled']=!![],_0x3f48b9['textContent']='No\x20Changes',this['showError']('No\x20changes\x20to\x20approve\x20after\x20sync')):(_0x3f48b9['disabled']=![],_0x3f48b9['textContent']='Commit\x20Changes'));}catch(_0x2c0559){console['error']('Failed\x20to\x20sync\x20repos\x20before\x20approve:',_0x2c0559);if(!this['isVisible']()){this['isSyncing']=![];return;}this['showError']('Sync\x20failed:\x20'+_0x2c0559['message']+'.\x20You\x20can\x20still\x20commit\x20with\x20existing\x20staged\x20changes.'),_0x3f48b9&&(this['taskData']['reposChanged']&&this['taskData']['reposChanged']['length']>0x0?(_0x3f48b9['disabled']=![],_0x3f48b9['textContent']='Commit\x20Changes'):(_0x3f48b9['disabled']=!![],_0x3f48b9['textContent']='No\x20Changes'));}finally{this['isSyncing']=![];}}['hide'](){const _0x427a6d=this['_el']('approve-modal');_0x427a6d&&(_0x427a6d['hidden']=!![]),this['_syncFileTree']&&(this['_syncFileTree']['destroy'](),this['_syncFileTree']=null),this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}async['_handleApprove'](){const _0x25360d=this['_el']('commit-message-input'),_0x1c2aaf=this['_el']('pull-before-commit'),_0x31f4bc=this['_el']('push-after-commit'),_0x59d4c0=this['_el']('create-new-branch'),_0x29f615=this['_el']('new-branch-name'),_0x213f3d=this['_el']('confirm-approve'),_0x1d632f=_0x25360d['value']['trim'](),_0x132b54=_0x1c2aaf?.['checked']??!![],_0x20f1cd=_0x31f4bc?.['checked']??!![],_0x246c47=_0x59d4c0?.['checked']||![],_0xe65340=_0x29f615?.['value']['trim']()||'';this['hideError']();if(!_0x1d632f){this['showError']('Commit\x20message\x20is\x20required'),_0x25360d['focus']();return;}if(_0x246c47&&!_0xe65340){this['showError']('Branch\x20name\x20is\x20required\x20when\x20creating\x20a\x20new\x20branch'),_0x29f615?.['focus']();return;}if(_0x246c47&&_0xe65340){const _0x332339=/[\s~^:?*\[\\]/;if(_0x332339['test'](_0xe65340)){this['showError']('Invalid\x20branch\x20name.\x20Avoid\x20spaces\x20and\x20special\x20characters\x20like\x20~\x20^\x20:\x20?\x20*\x20[\x20\x5c'),_0x29f615?.['focus']();return;}}const _0x5e4172=this['_el']('sync-to-ibmi')?.['checked'];if(_0x5e4172){const _0x39d712=this['_el']('ibmi-sync-library')?.['value']?.['trim']();if(!_0x39d712){this['showError']('IBM\x20i\x20library\x20name\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-library')?.['focus']();return;}if(this['_syncFileTree']){const _0xafe571=this['_syncFileTree']['getSelectedFiles']();if(_0xafe571['length']===0x0){this['showError']('Select\x20at\x20least\x20one\x20file\x20to\x20sync');return;}}if(this['taskData']?.['syncCredentials']==='prompt'){const _0x29998f=this['_el']('ibmi-sync-user')?.['value']?.['trim']();if(!_0x29998f){this['showError']('User\x20profile\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-user')?.['focus']();return;}const _0x49c997=this['_el']('ibmi-sync-password')?.['value'];if(!_0x49c997){this['showError']('Password\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-password')?.['focus']();return;}}}const _0x487949=_0x213f3d?.['textContent']||'Commit\x20Changes';_0x213f3d&&(_0x213f3d['disabled']=!![],_0x246c47?_0x213f3d['textContent']='Creating\x20branch\x20&\x20committing...':_0x213f3d['textContent']=_0x132b54?'Pulling\x20&\x20Committing...':'Committing...');try{const _0x4b3b89={'commit_message':_0x1d632f,'pull':_0x132b54,'push':_0x20f1cd};_0x246c47&&_0xe65340&&(_0x4b3b89['new_branch']=_0xe65340);let _0x2b0497=null;this['onApprove']&&(_0x2b0497=await this['onApprove'](this['taskData']['taskId'],_0x4b3b89));let _0x428448='Changes\x20committed';if(_0x246c47)_0x428448='Changes\x20committed\x20to\x20new\x20branch\x20\x27'+_0xe65340+'\x27',_0x20f1cd&&(_0x428448+='\x20and\x20pushed');else{if(_0x132b54&&_0x20f1cd)_0x428448='Changes\x20pulled,\x20committed,\x20and\x20pushed';else{if(_0x132b54)_0x428448='Changes\x20pulled\x20and\x20committed';else _0x20f1cd&&(_0x428448='Changes\x20committed\x20and\x20pushed');}}const _0x1f99cf=this['_el']('sync-to-ibmi')?.['checked'];let _0x4cb775=null,_0x1899d0=null,_0x1b379d=null,_0x386754=null;if(_0x1f99cf&&this['onSyncToIbmi']){_0x4cb775=this['_el']('ibmi-sync-library')?.['value']?.['trim']()?.['toUpperCase'](),_0x1899d0=this['_el']('ibmi-sync-user')?.['value']?.['trim']()?.['toUpperCase']()||null,_0x1b379d=this['_el']('ibmi-sync-password')?.['value']||null;if(this['_syncFileTree']&&this['_syncRelativeFiles']&&this['_syncAbsolutePaths']){const _0x2016b7=this['_syncFileTree']['getSelectedFiles']();_0x386754=_0x2016b7['map'](_0x3e29d6=>{const _0x13eb52=this['_syncRelativeFiles']['indexOf'](_0x3e29d6);return _0x13eb52>=0x0?this['_syncAbsolutePaths'][_0x13eb52]:_0x3e29d6;});}}this['showToast'](_0x428448,'success'),this['hide']();if(this['_createPR']&&this['onCreatePR'])try{await this['onCreatePR'](this['taskData']['taskId'],_0x2b0497||{});}catch(_0x5c42e3){console['warn']('PR\x20creation\x20failed\x20or\x20cancelled:',_0x5c42e3);}if(_0x1f99cf&&this['onSyncToIbmi']&&_0x4cb775){localStorage['setItem']('coderflow_ibmi_sync_library',_0x4cb775);if(_0x1899d0)localStorage['setItem']('coderflow_ibmi_sync_user',_0x1899d0);try{await this['onSyncToIbmi'](this['taskData']['taskId'],_0x4cb775,_0x1899d0,_0x1b379d,_0x386754);}catch(_0x4352ea){this['showToast']('Sync\x20failed:\x20'+_0x4352ea['message'],'error');}}this['onSuccess']&&this['onSuccess'](this['taskData']);}catch(_0x59d7d7){console['error']('Failed\x20to\x20approve\x20changes',_0x59d7d7),this['showError']('Failed\x20to\x20commit:\x20'+_0x59d7d7['message']),_0x213f3d&&(_0x213f3d['disabled']=![],_0x213f3d['textContent']=_0x487949),this['onError']&&this['onError'](_0x59d7d7);}}['isVisible'](){const _0x40ea00=this['_el']('approve-modal');return _0x40ea00&&!_0x40ea00['hidden'];}['destroy'](){const _0x11a736=this['_el']('approve-modal');_0x11a736&&_0x11a736['remove'](),this['initialized']=![];}}export function getApproveState(_0x24062b,_0x44969e){if(!_0x24062b)return{'canApprove':![],'reason':'No\x20task\x20data'};if(isLogOnlyTaskType(_0x24062b['taskType']))return{'canApprove':![],'reason':(_0x24062b['taskType']==='test'?'Test':'Deploy')+'\x20tasks\x20cannot\x20be\x20approved'};const _0x5e3b90=_0x44969e?.['repos_changed']?.['length']>0x0,_0x188e7e=_0x24062b['status']==='completed'||_0x24062b['status']==='failed'||_0x24062b['status']==='interrupted',_0x110c32=_0x24062b['containerState']==='running',_0x440c47=_0x24062b['approvedBy']!==undefined&&_0x24062b['approvedBy']!==null;if(_0x440c47){const _0x3598fe=_0x24062b['approvedBy']['name']||_0x24062b['approvedBy']['username']||'user';return{'canApprove':![],'reason':'Already\x20approved\x20by\x20'+_0x3598fe};}if(!_0x5e3b90)return{'canApprove':![],'reason':'No\x20changes\x20to\x20approve'};if(!_0x188e7e)return{'canApprove':![],'reason':'Task\x20must\x20complete\x20first'};if(!_0x24062b['containerId'])return{'canApprove':![],'reason':'Container\x20no\x20longer\x20available'};if(!_0x110c32)return{'canApprove':![],'reason':'Container\x20is\x20not\x20running'};return{'canApprove':!![],'reason':'Ready\x20to\x20approve'};}
|
|
1
|
+
function isLogOnlyTaskType(_0x2c08f5){return _0x2c08f5==='test'||_0x2c08f5==='deploy';}export function createApproveDialogHTML(_0x287d88='',_0x5bf9a2={}){const _0x241098=_0x287d88,_0x17d7bb=_0x5bf9a2['useTaskPageStyles']?'modal\x20profound-approve-modal':'profound-feedback-modal\x20profound-approve-modal',_0x547674=_0x5bf9a2['useTaskPageStyles']?'modal-warning':'approve-modal-warning',_0x137b86=_0x5bf9a2['useTaskPageStyles']?'modal-error':'approve-modal-error';return'\x0a\x20\x20\x20\x20<div\x20id=\x22'+_0x241098+'approve-modal\x22\x20class=\x22'+_0x17d7bb+'\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'+_0x241098+'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'+_0x241098+'approve-warning\x22\x20class=\x22'+_0x547674+'\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'+_0x241098+'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'+_0x241098+'approve-error\x22\x20class=\x22'+_0x137b86+'\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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'commit-message-input\x22>Commit\x20message:</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<textarea\x20id=\x22'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'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'+_0x241098+'cancel-approve\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x22\x20id=\x22'+_0x241098+'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(_0x4f6b9d={}){this['prefix']=_0x4f6b9d['prefix']||'',this['onApprove']=_0x4f6b9d['onApprove'],this['onSync']=_0x4f6b9d['onSync'],this['onSuccess']=_0x4f6b9d['onSuccess'],this['onError']=_0x4f6b9d['onError'],this['onCreatePR']=_0x4f6b9d['onCreatePR'],this['showToast']=_0x4f6b9d['showToast']||(()=>{}),this['container']=_0x4f6b9d['container']||document['body'],this['useTaskPageStyles']=_0x4f6b9d['useTaskPageStyles']||![],this['baseUrl']=_0x4f6b9d['baseUrl']||'',this['coderflowAttribution']=_0x4f6b9d['coderflowAttribution'],this['onSyncToIbmi']=_0x4f6b9d['onSyncToIbmi']||null,this['onGetSyncFiles']=_0x4f6b9d['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 _0x33316d=document['createElement']('div');_0x33316d['innerHTML']=createApproveDialogHTML(this['prefix'],{'useTaskPageStyles':this['useTaskPageStyles']}),this['container']['appendChild'](_0x33316d['firstElementChild']),this['_bindEvents'](),this['initialized']=!![];}['_el'](_0x16ac9d){return document['getElementById'](''+this['prefix']+_0x16ac9d);}['_bindEvents'](){const _0x26e052=this['_el']('approve-modal'),_0x2d9f6f=this['_el']('close-approve-modal'),_0x2ccb96=this['_el']('cancel-approve'),_0x28fb3c=this['_el']('confirm-approve'),_0x10c0dc=_0x26e052?.['querySelector']('.modal-overlay'),_0x4d4051=this['_el']('create-new-branch'),_0x3330b4=this['_el']('new-branch-input-container'),_0x1974d1=this['_el']('new-branch-name'),_0x140304=this['_el']('push-after-commit'),_0x515523=this['_el']('create-pull-request'),_0x3bc471=this['_el']('pr-hint');_0x2d9f6f?.['addEventListener']('click',()=>this['hide']()),_0x2ccb96?.['addEventListener']('click',()=>this['hide']()),_0x10c0dc?.['addEventListener']('click',()=>this['hide']()),_0x28fb3c?.['addEventListener']('click',()=>this['_handleApprove']());_0x4d4051&&_0x4d4051['addEventListener']('change',()=>{_0x3330b4&&(_0x3330b4['hidden']=!_0x4d4051['checked']),_0x4d4051['checked']&&_0x1974d1&&_0x1974d1['focus']();});_0x515523&&_0x140304&&_0x4d4051&&(_0x515523['addEventListener']('change',()=>{this['_createPR']=_0x515523['checked'];if(_0x515523['checked']){_0x140304['checked']=!![],_0x140304['disabled']=!![],_0x4d4051['checked']=!![],_0x4d4051['disabled']=!![];_0x3330b4&&(_0x3330b4['hidden']=![]);if(_0x3bc471)_0x3bc471['hidden']=![];}else{_0x140304['disabled']=![],_0x4d4051['disabled']=![];if(_0x3bc471)_0x3bc471['hidden']=!![];}}),_0x140304['addEventListener']('change',()=>{if(!_0x140304['checked']&&_0x515523['checked']){_0x515523['checked']=![],this['_createPR']=![],_0x140304['disabled']=![],_0x4d4051['disabled']=![];if(_0x3bc471)_0x3bc471['hidden']=!![];}}));const _0x54f8c8=this['_el']('sync-to-ibmi');_0x54f8c8&&_0x54f8c8['addEventListener']('change',async _0x4bb212=>{const _0x1af069=this['_el']('ibmi-sync-fields');if(_0x1af069)_0x1af069['hidden']=!_0x4bb212['target']['checked'];if(_0x4bb212['target']['checked']){const _0x593d98=this['_el']('ibmi-sync-library'),_0x39cd54=localStorage['getItem']('coderflow_ibmi_sync_library');_0x39cd54&&_0x593d98&&!_0x593d98['value']&&(_0x593d98['value']=_0x39cd54);const _0xfa3781=this['_el']('ibmi-sync-user');if(_0xfa3781&&!_0xfa3781['value']){const _0x47e505=localStorage['getItem']('coderflow_ibmi_sync_user');if(_0x47e505)_0xfa3781['value']=_0x47e505;}const _0x130f7f=this['_el']('ibmi-sync-password');if(_0x130f7f)_0x130f7f['value']='';!this['_syncFileTree']&&this['onGetSyncFiles']&&this['taskData']?.['taskId']&&await this['_loadSyncFileTree']();}}),document['addEventListener']('keydown',_0x28ae13=>{_0x28ae13['key']==='Escape'&&_0x26e052&&!_0x26e052['hidden']&&this['hide']();});}async['_loadSyncFileTree'](){const _0x13a490=this['_el']('ibmi-sync-file-tree'),_0x4ea241=this['_el']('ibmi-sync-files-summary');if(!_0x13a490)return;_0x13a490['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>Loading\x20files...</span>';if(_0x4ea241)_0x4ea241['textContent']='';try{const {files:_0x350b75,absolutePaths:_0x5df57a}=await this['onGetSyncFiles'](this['taskData']['taskId']);this['_syncRelativeFiles']=_0x350b75,this['_syncAbsolutePaths']=_0x5df57a;if(_0x350b75['length']===0x0){_0x13a490['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>No\x20changed\x20files\x20found.</span>';return;}const {FileSelectionTree:_0x4d5662}=await import('./file-selection-tree.js'),{validateIbmiFile:_0xc1977e,hasKnownIbmiExtension:_0x514ec9}=await import('./ibmi-file-filter.js');this['_syncFileTree']=new _0x4d5662({'container':_0x13a490,'files':_0x350b75,'isPreselected':_0x53f142=>{const {valid:_0x22b9ea}=_0xc1977e(_0x53f142);return _0x22b9ea&&_0x514ec9(_0x53f142);},'isDisabled':_0x3bd110=>{const {valid:_0x1eb3a2,reason:_0x11d8f7}=_0xc1977e(_0x3bd110);return{'disabled':!_0x1eb3a2,'reason':_0x11d8f7};},'isAutoCheckEligible':_0x16d288=>{const {valid:_0x3780c2}=_0xc1977e(_0x16d288);return _0x3780c2&&_0x514ec9(_0x16d288);},'onChange':_0x476b68=>{_0x4ea241&&(_0x4ea241['textContent']=_0x476b68['length']+'\x20of\x20'+_0x350b75['length']+'\x20file'+(_0x350b75['length']!==0x1?'s':'')+'\x20selected');}}),this['_syncFileTree']['render']();}catch(_0x4c6878){_0x13a490['innerHTML']='<span\x20style=\x22color:\x20var(--color-danger,\x20#e55368);\x20font-size:\x2013px;\x22>Failed\x20to\x20load\x20files</span>';}}['showError'](_0x32c86e){const _0x92b00c=this['_el']('approve-error'),_0x5d307a=this['_el']('approve-error-text');_0x92b00c&&_0x5d307a&&(_0x5d307a['textContent']=_0x32c86e,_0x92b00c['hidden']=![],_0x92b00c['scrollIntoView']({'behavior':'smooth','block':'nearest'}));}['hideError'](){const _0x4169b8=this['_el']('approve-error'),_0x4427d1=this['_el']('approve-error-text');_0x4169b8&&_0x4427d1&&(_0x4169b8['hidden']=!![],_0x4427d1['textContent']='');}['_displayBranchInfo'](_0x5b2415,_0x167194={}){const _0x2cb245=this['_el']('approve-branches');if(!_0x2cb245)return;const _0x53d05c=[];for(const _0x4bbe8e of _0x5b2415){_0x167194[_0x4bbe8e['name']]&&_0x53d05c['push']({'repo':_0x4bbe8e['name'],'branch':_0x167194[_0x4bbe8e['name']]});}if(_0x53d05c['length']>0x0){_0x2cb245['hidden']=![];if(_0x53d05c['length']===0x1)_0x2cb245['innerHTML']='<div\x20class=\x22branch-info\x22>Branch:\x20<code>'+_0x53d05c[0x0]['branch']+'</code></div>';else{const _0x5997a8=_0x53d05c['map'](_0xfc47f4=>'<div\x20class=\x22branch-item\x22><strong>'+_0xfc47f4['repo']+':</strong>\x20<code>'+_0xfc47f4['branch']+'</code></div>')['join']('');_0x2cb245['innerHTML']='<div\x20class=\x22branch-info\x22>Branches:<div\x20class=\x22branch-list\x22>'+_0x5997a8+'</div></div>';}}else _0x2cb245['hidden']=!![],_0x2cb245['innerHTML']='';}['showWarning'](_0x152d80){const _0x5364c3=this['_el']('approve-warning'),_0x508254=this['_el']('approve-warning-text');_0x5364c3&&_0x508254&&(_0x508254['textContent']=_0x152d80,_0x5364c3['hidden']=![]);}['hideWarning'](){const _0x4c1098=this['_el']('approve-warning'),_0x39f946=this['_el']('approve-warning-text');_0x4c1098&&_0x39f946&&(_0x4c1098['hidden']=!![],_0x39f946['textContent']='');}['_stripCoAuthoredByLines'](_0x1c4618){return _0x1c4618['replace'](/^Co-Authored-By:.*$/gmi,'')['replace'](/^Learn more: https:\/\/coderflow\.ai\s*$/gm,'')['replace'](/\n{3,}/g,'\x0a\x0a')['trim']();}async['_addAttributionIfEnabled'](_0x19267d){try{let _0x4ea6bc;try{const _0x2c4bd3=await fetch(this['baseUrl']+'/settings');if(_0x2c4bd3['ok']){const _0x5355e6=await _0x2c4bd3['json']();_0x4ea6bc=_0x5355e6['coderflow_attribution']!==![];}}catch(_0x4f7027){}_0x4ea6bc===undefined&&(this['coderflowAttribution']!==undefined?_0x4ea6bc=this['coderflowAttribution']!==![]:_0x4ea6bc=!![]);const _0x12f61d=this['_stripCoAuthoredByLines'](_0x19267d);if(!_0x4ea6bc)return _0x12f61d;const _0xe6d910='\x0a\x0aCo-Authored-By:\x20CoderFlow\x20<ai@coderflow.ai>\x0aLearn\x20more:\x20https://coderflow.ai';return _0x12f61d+_0xe6d910;}catch(_0x50dda3){return console['warn']('Failed\x20to\x20add\x20CoderFlow\x20attribution:',_0x50dda3),_0x19267d;}}['show'](_0x3c25a7){!this['initialized']&&this['init']();this['taskData']=_0x3c25a7;const _0x11437e=this['_el']('approve-modal'),_0x4da68e=this['_el']('commit-message-input'),_0x4898a8=this['_el']('pull-before-commit'),_0x24c741=this['_el']('push-after-commit'),_0x119f48=this['_el']('create-new-branch'),_0x36316a=this['_el']('new-branch-input-container'),_0x2efa1b=this['_el']('new-branch-name'),_0x396649=this['_el']('approve-repo-name'),_0x498150=this['_el']('approve-stats'),_0x4e7bfe=this['_el']('multi-repo-note');if(!_0x11437e)return;this['hideError'](),this['hideWarning']();_0x3c25a7['warning']&&this['showWarning'](_0x3c25a7['warning']);const _0x5e5924=_0x3c25a7['reposChanged']||[];if(_0x5e5924['length']===0x0&&!_0x3c25a7['syncFirst']){this['showToast']('No\x20changes\x20to\x20approve','error');return;}this['_updateDisplay'](_0x5e5924,_0x3c25a7);const _0x586606=_0x3c25a7['commitMessage']||'',_0x412a0a=this['_stripCoAuthoredByLines'](_0x586606);_0x4da68e['value']=_0x412a0a;if(_0x4898a8)_0x4898a8['checked']=!![];if(_0x24c741)_0x24c741['checked']=!![];_0x119f48&&(_0x119f48['checked']=![]);_0x36316a&&(_0x36316a['hidden']=!![]);_0x2efa1b&&(_0x2efa1b['value']='');if(_0x24c741)_0x24c741['disabled']=![];if(_0x119f48)_0x119f48['disabled']=![];this['updatePRSupport'](_0x3c25a7['prSupported']===!![]);const _0x257d1f=this['_el']('ibmi-sync-section');if(_0x257d1f){_0x257d1f['hidden']=!_0x3c25a7['ibmiSyncAvailable'];const _0x566334=this['_el']('sync-to-ibmi'),_0x2ed5f3=this['_el']('ibmi-sync-fields'),_0x4fad17=this['_el']('ibmi-sync-library');if(_0x566334)_0x566334['checked']=![];if(_0x2ed5f3)_0x2ed5f3['hidden']=!![];if(_0x4fad17)_0x4fad17['value']='';const _0x191f1d=this['_el']('ibmi-sync-credentials-row');_0x191f1d&&(_0x191f1d['hidden']=!(_0x3c25a7['ibmiSyncAvailable']&&_0x3c25a7['syncCredentials']==='prompt'));}const _0x18abde=this['_el']('confirm-approve');_0x3c25a7['syncFirst']&&this['onSync']?(_0x18abde&&(_0x18abde['disabled']=!![],_0x18abde['textContent']='Syncing...'),this['_performSync']()):_0x18abde&&(_0x18abde['disabled']=![],_0x18abde['textContent']='Commit\x20Changes');_0x11437e['hidden']=![];const _0x3a7328=++this['_attributionRequestId'];void this['_applyAttributionAsync']({'requestId':_0x3a7328,'taskId':_0x3c25a7['taskId'],'originalCommitMessage':_0x412a0a}),setTimeout(()=>{_0x4da68e['focus'](),_0x4da68e['setSelectionRange'](0x0,_0x4da68e['value']['length']);},0x64);}['updatePRSupport'](_0x504685){const _0x314858=this['_el']('pr-option-section'),_0x1e5963=this['_el']('create-pull-request'),_0x3b4cea=this['_el']('pr-hint'),_0x240c03=this['_el']('push-after-commit'),_0xbd7bdf=this['_el']('create-new-branch');if(!_0x314858)return;if(_0x504685){_0x314858['hidden']=![];_0x1e5963&&!_0x1e5963['disabled']&&(_0x1e5963['checked']=![]);if(_0x3b4cea)_0x3b4cea['hidden']=!![];this['_createPR']=![];return;}_0x1e5963?.['checked']&&(_0x1e5963['checked']=![]);if(_0x3b4cea)_0x3b4cea['hidden']=!![];if(_0x240c03)_0x240c03['disabled']=![];if(_0xbd7bdf)_0xbd7bdf['disabled']=![];this['_createPR']=![],_0x314858['hidden']=!![];}async['_applyAttributionAsync']({requestId:_0x3e6731,taskId:_0x4fd9a5,originalCommitMessage:_0x20c676}){const _0x5488a1=this['_el']('commit-message-input');if(!_0x5488a1)return;const _0x9b84d6=await this['_addAttributionIfEnabled'](_0x20c676);if(_0x3e6731!==this['_attributionRequestId'])return;if(!this['taskData']||this['taskData']['taskId']!==_0x4fd9a5)return;if(!this['isVisible']())return;const _0x5eaa06=_0x18f02c=>_0x18f02c['replace'](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a');if(_0x5eaa06(_0x5488a1['value'])!==_0x5eaa06(_0x20c676))return;_0x5488a1['value']=_0x9b84d6;}['_updateDisplay'](_0x5cc6be,_0x1f4bf3){const _0x59824b=this['_el']('approve-repo-name'),_0x41430a=this['_el']('approve-stats'),_0x2fa287=this['_el']('multi-repo-note');if(_0x5cc6be['length']===0x0){if(_0x59824b)_0x59824b['textContent']='Syncing...';if(_0x41430a)_0x41430a['textContent']='';if(_0x2fa287)_0x2fa287['hidden']=!![];return;}const _0x1ffd16=_0x5cc6be['reduce']((_0x430f18,_0x56e776)=>_0x430f18+(_0x56e776['files_changed']||0x0),0x0),_0x3f74a1=_0x5cc6be['reduce']((_0x2669e7,_0xddcb8e)=>_0x2669e7+(_0xddcb8e['lines_added']||0x0),0x0),_0x451549=_0x5cc6be['reduce']((_0x534b21,_0x2bcd71)=>_0x534b21+(_0x2bcd71['lines_deleted']||0x0),0x0);if(_0x5cc6be['length']===0x1){if(_0x59824b)_0x59824b['textContent']=_0x5cc6be[0x0]?.['name']||'repository';if(_0x2fa287)_0x2fa287['hidden']=!![];}else{const _0x490719=_0x5cc6be['map'](_0x94ebfb=>_0x94ebfb['name'])['join'](',\x20');if(_0x59824b)_0x59824b['textContent']=_0x5cc6be['length']+'\x20repositories:\x20'+_0x490719;if(_0x2fa287)_0x2fa287['hidden']=![];}_0x41430a&&(_0x41430a['textContent']=_0x1ffd16+'\x20file'+(_0x1ffd16===0x1?'':'s')+'\x20changed\x20(+'+_0x3f74a1+'\x20-'+_0x451549+')'),this['_displayBranchInfo'](_0x5cc6be,_0x1f4bf3?.['branches']||{});}async['_performSync'](){if(!this['onSync']||this['isSyncing'])return;this['isSyncing']=!![];const _0x2fcb16=this['_el']('confirm-approve');try{const _0x38c4d8=await this['onSync'](this['taskData']['taskId']);if(!this['isVisible']()){this['isSyncing']=![];return;}if(_0x38c4d8['repos_changed']){const _0x2b1fb8=this['taskData']['reposChanged']?.['length']||0x0,_0x1a3a64=this['taskData']['reposChanged']?.['reduce']((_0x3a7780,_0x3123fb)=>_0x3a7780+(_0x3123fb['files_changed']||0x0),0x0)||0x0;this['taskData']['reposChanged']=_0x38c4d8['repos_changed'],this['_updateDisplay'](_0x38c4d8['repos_changed'],this['taskData']);const _0x3260cd=_0x38c4d8['repos_changed']['length'],_0x1a470a=_0x38c4d8['repos_changed']['reduce']((_0x4aabd3,_0x398b6c)=>_0x4aabd3+(_0x398b6c['files_changed']||0x0),0x0);(_0x1a470a>_0x1a3a64||_0x3260cd>_0x2b1fb8)&&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.');}_0x2fcb16&&(!this['taskData']['reposChanged']||this['taskData']['reposChanged']['length']===0x0?(_0x2fcb16['disabled']=!![],_0x2fcb16['textContent']='No\x20Changes',this['showError']('No\x20changes\x20to\x20approve\x20after\x20sync')):(_0x2fcb16['disabled']=![],_0x2fcb16['textContent']='Commit\x20Changes'));}catch(_0x15ce9f){console['error']('Failed\x20to\x20sync\x20repos\x20before\x20approve:',_0x15ce9f);if(!this['isVisible']()){this['isSyncing']=![];return;}this['showError']('Sync\x20failed:\x20'+_0x15ce9f['message']+'.\x20You\x20can\x20still\x20commit\x20with\x20existing\x20staged\x20changes.'),_0x2fcb16&&(this['taskData']['reposChanged']&&this['taskData']['reposChanged']['length']>0x0?(_0x2fcb16['disabled']=![],_0x2fcb16['textContent']='Commit\x20Changes'):(_0x2fcb16['disabled']=!![],_0x2fcb16['textContent']='No\x20Changes'));}finally{this['isSyncing']=![];}}['hide'](){const _0x4c4c10=this['_el']('approve-modal');_0x4c4c10&&(_0x4c4c10['hidden']=!![]),this['_syncFileTree']&&(this['_syncFileTree']['destroy'](),this['_syncFileTree']=null),this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}async['_handleApprove'](){const _0x47db4e=this['_el']('commit-message-input'),_0x502e13=this['_el']('pull-before-commit'),_0x2da34a=this['_el']('push-after-commit'),_0x331b39=this['_el']('create-new-branch'),_0x4245df=this['_el']('new-branch-name'),_0x55f786=this['_el']('confirm-approve'),_0x5c0870=_0x47db4e['value']['trim'](),_0x557499=_0x502e13?.['checked']??!![],_0x49b17c=_0x2da34a?.['checked']??!![],_0x24cb0f=_0x331b39?.['checked']||![],_0x531138=_0x4245df?.['value']['trim']()||'';this['hideError']();if(!_0x5c0870){this['showError']('Commit\x20message\x20is\x20required'),_0x47db4e['focus']();return;}if(_0x24cb0f&&!_0x531138){this['showError']('Branch\x20name\x20is\x20required\x20when\x20creating\x20a\x20new\x20branch'),_0x4245df?.['focus']();return;}if(_0x24cb0f&&_0x531138){const _0x479c47=/[\s~^:?*\[\\]/;if(_0x479c47['test'](_0x531138)){this['showError']('Invalid\x20branch\x20name.\x20Avoid\x20spaces\x20and\x20special\x20characters\x20like\x20~\x20^\x20:\x20?\x20*\x20[\x20\x5c'),_0x4245df?.['focus']();return;}}const _0x34d824=this['_el']('sync-to-ibmi')?.['checked'];if(_0x34d824){const _0x323080=this['_el']('ibmi-sync-library')?.['value']?.['trim']();if(!_0x323080){this['showError']('IBM\x20i\x20library\x20name\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-library')?.['focus']();return;}if(this['_syncFileTree']){const _0x2b8622=this['_syncFileTree']['getSelectedFiles']();if(_0x2b8622['length']===0x0){this['showError']('Select\x20at\x20least\x20one\x20file\x20to\x20sync');return;}}if(this['taskData']?.['syncCredentials']==='prompt'){const _0x5a3d00=this['_el']('ibmi-sync-user')?.['value']?.['trim']();if(!_0x5a3d00){this['showError']('User\x20profile\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-user')?.['focus']();return;}const _0xa15e59=this['_el']('ibmi-sync-password')?.['value'];if(!_0xa15e59){this['showError']('Password\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-password')?.['focus']();return;}}}const _0x58a709=_0x55f786?.['textContent']||'Commit\x20Changes';_0x55f786&&(_0x55f786['disabled']=!![],_0x24cb0f?_0x55f786['textContent']='Creating\x20branch\x20&\x20committing...':_0x55f786['textContent']=_0x557499?'Pulling\x20&\x20Committing...':'Committing...');try{const _0x29ff8d={'commit_message':_0x5c0870,'pull':_0x557499,'push':_0x49b17c};_0x24cb0f&&_0x531138&&(_0x29ff8d['new_branch']=_0x531138);let _0x867877=null;this['onApprove']&&(_0x867877=await this['onApprove'](this['taskData']['taskId'],_0x29ff8d));let _0xb3bad='Changes\x20committed';if(_0x24cb0f)_0xb3bad='Changes\x20committed\x20to\x20new\x20branch\x20\x27'+_0x531138+'\x27',_0x49b17c&&(_0xb3bad+='\x20and\x20pushed');else{if(_0x557499&&_0x49b17c)_0xb3bad='Changes\x20pulled,\x20committed,\x20and\x20pushed';else{if(_0x557499)_0xb3bad='Changes\x20pulled\x20and\x20committed';else _0x49b17c&&(_0xb3bad='Changes\x20committed\x20and\x20pushed');}}const _0x4c014d=this['_el']('sync-to-ibmi')?.['checked'];let _0x1ab352=null,_0x25a733=null,_0x4ce516=null,_0x4f3e8f=null;if(_0x4c014d&&this['onSyncToIbmi']){_0x1ab352=this['_el']('ibmi-sync-library')?.['value']?.['trim']()?.['toUpperCase'](),_0x25a733=this['_el']('ibmi-sync-user')?.['value']?.['trim']()?.['toUpperCase']()||null,_0x4ce516=this['_el']('ibmi-sync-password')?.['value']||null;if(this['_syncFileTree']&&this['_syncRelativeFiles']&&this['_syncAbsolutePaths']){const _0x4b3b0e=this['_syncFileTree']['getSelectedFiles']();_0x4f3e8f=_0x4b3b0e['map'](_0x55d4fd=>{const _0x4b54cf=this['_syncRelativeFiles']['indexOf'](_0x55d4fd);return _0x4b54cf>=0x0?this['_syncAbsolutePaths'][_0x4b54cf]:_0x55d4fd;});}}this['showToast'](_0xb3bad,'success'),this['hide']();if(this['_createPR']&&this['onCreatePR'])try{await this['onCreatePR'](this['taskData']['taskId'],_0x867877||{});}catch(_0xc0c4f1){console['warn']('PR\x20creation\x20failed\x20or\x20cancelled:',_0xc0c4f1);}if(_0x4c014d&&this['onSyncToIbmi']&&_0x1ab352){localStorage['setItem']('coderflow_ibmi_sync_library',_0x1ab352);if(_0x25a733)localStorage['setItem']('coderflow_ibmi_sync_user',_0x25a733);try{await this['onSyncToIbmi'](this['taskData']['taskId'],_0x1ab352,_0x25a733,_0x4ce516,_0x4f3e8f);}catch(_0x4e3d33){this['showToast']('Sync\x20failed:\x20'+_0x4e3d33['message'],'error');}}this['onSuccess']&&this['onSuccess'](this['taskData']);}catch(_0x4e151d){console['error']('Failed\x20to\x20approve\x20changes',_0x4e151d),this['showError']('Failed\x20to\x20commit:\x20'+_0x4e151d['message']),_0x55f786&&(_0x55f786['disabled']=![],_0x55f786['textContent']=_0x58a709),this['onError']&&this['onError'](_0x4e151d);}}['isVisible'](){const _0x58ee42=this['_el']('approve-modal');return _0x58ee42&&!_0x58ee42['hidden'];}['destroy'](){const _0x51bcd8=this['_el']('approve-modal');_0x51bcd8&&_0x51bcd8['remove'](),this['initialized']=![];}}export function getApproveState(_0x380f4d,_0x35449b){if(!_0x380f4d)return{'canApprove':![],'reason':'No\x20task\x20data'};if(isLogOnlyTaskType(_0x380f4d['taskType']))return{'canApprove':![],'reason':(_0x380f4d['taskType']==='test'?'Test':'Deploy')+'\x20tasks\x20cannot\x20be\x20approved'};const _0x45b878=_0x35449b?.['repos_changed']?.['length']>0x0,_0x591f2b=_0x380f4d['status']==='completed'||_0x380f4d['status']==='failed'||_0x380f4d['status']==='interrupted',_0x4096ea=_0x380f4d['containerState']==='running',_0x14962b=_0x380f4d['approvedBy']!==undefined&&_0x380f4d['approvedBy']!==null;if(_0x14962b){const _0x9a4ea1=_0x380f4d['approvedBy']['name']||_0x380f4d['approvedBy']['username']||'user';return{'canApprove':![],'reason':'Already\x20approved\x20by\x20'+_0x9a4ea1};}if(!_0x45b878)return{'canApprove':![],'reason':'No\x20changes\x20to\x20approve'};if(!_0x591f2b)return{'canApprove':![],'reason':'Task\x20must\x20complete\x20first'};if(!_0x380f4d['containerId'])return{'canApprove':![],'reason':'Container\x20no\x20longer\x20available'};if(!_0x4096ea)return{'canApprove':![],'reason':'Container\x20is\x20not\x20running'};return{'canApprove':!![],'reason':'Ready\x20to\x20approve'};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function buildAutomationEnvironmentHref(
|
|
1
|
+
export function buildAutomationEnvironmentHref(_0x7dcb4a,_0x3e6529){const _0xcfb6cf=new URLSearchParams();_0x7dcb4a&&_0xcfb6cf['set']('env',String(_0x7dcb4a));_0xcfb6cf['set']('tab','automations');_0x3e6529&&_0xcfb6cf['set']('automation',String(_0x3e6529));const _0x5361aa=_0xcfb6cf['toString']();return'environments.html'+(_0x5361aa?'?'+_0x5361aa:'');}export function buildAutomationTaskFilterHref(_0x1f8859){const _0x38f153=new URLSearchParams();_0x1f8859&&_0x38f153['set']('automation',String(_0x1f8859));const _0xfa1ef1=_0x38f153['toString']();return'index.html'+(_0xfa1ef1?'?'+_0xfa1ef1:'');}export function parseAutomationDeepLinkParams(_0x4e50e2=''){const _0x4aa145=new URLSearchParams(_0x4e50e2||'');return{'env':_0x4aa145['get']('env'),'tab':_0x4aa145['get']('tab'),'automation':_0x4aa145['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(_0x9fc290,_0x55442e,_0x54954a){const _0x575b37=Number['parseInt'](_0x9fc290,0xa);if(!Number['isInteger'](_0x575b37)||_0x575b37<_0x55442e||_0x575b37>_0x54954a)return null;return _0x575b37;}function inferRecurringInterval(_0x316c6f,_0x428f15){if(_0x316c6f==='*/15')return'*/15\x20*\x20*\x20*\x20*';if(_0x316c6f==='*/30')return'*/30\x20*\x20*\x20*\x20*';if(_0x316c6f!=='0')return'*/30\x20*\x20*\x20*\x20*';if(_0x428f15==='*'||/^\d{1,2}-\d{1,2}$/['test'](_0x428f15))return'0\x20*\x20*\x20*\x20*';for(const _0x16082e of RECURRING_INTERVAL_STEPS){if(_0x428f15['startsWith']('*/'+_0x16082e)||_0x428f15['includes']('/'+_0x16082e))return'0\x20*/'+_0x16082e+'\x20*\x20*\x20*';}return'*/30\x20*\x20*\x20*\x20*';}function parseRecurringHourRange(_0x228bdd){const _0x544383=String(_0x228bdd||'')['trim']()['match'](/^(\d{1,2})-(\d{1,2})(?:\/\d+)?$/);if(!_0x544383)return{'start':'','end':''};const _0x4bd4bd=parseBoundedInteger(_0x544383[0x1],0x0,0x17),_0x24aae9=parseBoundedInteger(_0x544383[0x2],0x0,0x17);if(_0x4bd4bd===null||_0x24aae9===null||_0x4bd4bd>_0x24aae9)return{'start':'','end':''};return{'start':String(_0x4bd4bd),'end':String(_0x24aae9)};}export function parseAutomationScheduleToFormState(_0x30ebea){const _0xbc1c0b=String(_0x30ebea||'')['trim'](),_0x423bc8=createDefaultScheduleFormState(),_0xdb2112=_0xbc1c0b['match'](/^(\d{1,2}) (\d{1,2}) \* \* \*$/);if(_0xdb2112){const _0x2c29c5=parseBoundedInteger(_0xdb2112[0x1],0x0,0x3b),_0x435f43=parseBoundedInteger(_0xdb2112[0x2],0x0,0x17);if(_0x2c29c5!==null&&_0x435f43!==null)return _0x423bc8['frequency']='daily',_0x423bc8['dailyMinute']=String(_0x2c29c5),_0x423bc8['dailyHour']=String(_0x435f43),_0x423bc8;}const _0x422650=_0xbc1c0b['match'](/^(\d{1,2}) (\d{1,2}) \* \* ([0-7])$/);if(_0x422650){const _0x2b8456=parseBoundedInteger(_0x422650[0x1],0x0,0x3b),_0x3661c2=parseBoundedInteger(_0x422650[0x2],0x0,0x17),_0x30e0eb=parseBoundedInteger(_0x422650[0x3],0x0,0x7);if(_0x2b8456!==null&&_0x3661c2!==null&&_0x30e0eb!==null)return _0x423bc8['frequency']='weekly',_0x423bc8['weeklyMinute']=String(_0x2b8456),_0x423bc8['weeklyHour']=String(_0x3661c2),_0x423bc8['weeklyDay']=String(_0x30e0eb===0x7?0x0:_0x30e0eb),_0x423bc8;}const _0x102a32=_0xbc1c0b['match'](/^(\d{1,2}) (\d{1,2}) (\d{1,2}) \* \*$/);if(_0x102a32){const _0xefc18b=parseBoundedInteger(_0x102a32[0x1],0x0,0x3b),_0x92bf9f=parseBoundedInteger(_0x102a32[0x2],0x0,0x17),_0x5aaaf1=parseBoundedInteger(_0x102a32[0x3],AUTOMATION_MONTHLY_DAY_MIN,AUTOMATION_MONTHLY_DAY_MAX);if(_0xefc18b!==null&&_0x92bf9f!==null&&_0x5aaaf1!==null)return _0x423bc8['frequency']='monthly',_0x423bc8['monthlyMinute']=String(_0xefc18b),_0x423bc8['monthlyHour']=String(_0x92bf9f),_0x423bc8['monthlyDay']=String(_0x5aaaf1),_0x423bc8;}const _0x4062f1=_0xbc1c0b['match'](/^(\*\/15|\*\/30|0) ([^\s]+) \* \* ([^\s]+)$/);if(_0x4062f1){const [,_0x47afb2,_0x3ef3c4,_0x6e36e1]=_0x4062f1;_0x423bc8['frequency']='recurring',_0x423bc8['recurringInterval']=inferRecurringInterval(_0x47afb2,_0x3ef3c4),_0x423bc8['recurringDayToken']=String(_0x6e36e1||'')['trim']()||'*';const _0x44a1a6=parseRecurringHourRange(_0x3ef3c4);return _0x423bc8['recurringStartHour']=_0x44a1a6['start'],_0x423bc8['recurringEndHour']=_0x44a1a6['end'],_0x423bc8;}return _0x423bc8['frequency']='custom',_0x423bc8['customCron']=_0xbc1c0b,_0x423bc8;}export function buildAutomationCronFromFormState(_0x10c079={}){const _0x46e047=String(_0x10c079['frequency']||'daily');if(_0x46e047==='custom')return String(_0x10c079['customCron']||'')['trim']();if(_0x46e047==='daily'){const _0x34f564=String(_0x10c079['dailyHour']??'2'),_0x192837=String(_0x10c079['dailyMinute']??'0');return _0x192837+'\x20'+_0x34f564+'\x20*\x20*\x20*';}if(_0x46e047==='weekly'){const _0x132d29=String(_0x10c079['weeklyDay']??'1'),_0x5ba7ec=String(_0x10c079['weeklyHour']??'9'),_0x191cfe=String(_0x10c079['weeklyMinute']??'0');return _0x191cfe+'\x20'+_0x5ba7ec+'\x20*\x20*\x20'+_0x132d29;}if(_0x46e047==='monthly'){const _0x63ab6b=String(_0x10c079['monthlyDay']??'1'),_0x42bf0b=String(_0x10c079['monthlyHour']??'0'),_0x38a44f=String(_0x10c079['monthlyMinute']??'0');return _0x38a44f+'\x20'+_0x42bf0b+'\x20'+_0x63ab6b+'\x20*\x20*';}const _0x291e03=String(_0x10c079['recurringInterval']||'*/30\x20*\x20*\x20*\x20*')['trim'](),[_0x53364e='*/30',_0xd187c='*']=_0x291e03['split'](/\s+/);let _0x20c294=_0xd187c;const _0x16185b=String(_0x10c079['recurringStartHour']??'')['trim'](),_0x16c4bd=String(_0x10c079['recurringEndHour']??'')['trim']();if(_0x16185b!==''&&_0x16c4bd!==''){const _0x5876a8=Number['parseInt'](_0x16185b,0xa),_0x5a6aaa=Number['parseInt'](_0x16c4bd,0xa);if(Number['isInteger'](_0x5876a8)&&Number['isInteger'](_0x5a6aaa)&&_0x5876a8<=_0x5a6aaa){const _0x4e7b42=_0xd187c['match'](/^\*\/(\d+)$/);_0x4e7b42?_0x20c294=_0x5876a8+'-'+_0x5a6aaa+'/'+_0x4e7b42[0x1]:_0x20c294=_0x5876a8+'-'+_0x5a6aaa;}}const _0x1e4675=String(_0x10c079['recurringDayToken']??'*')['trim']()||'*';return _0x53364e+'\x20'+_0x20c294+'\x20*\x20*\x20'+_0x1e4675;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export class CommentsWidget{constructor(_0x4fdf56,_0x315b29={}){this['container']=_0x4fdf56,this['options']={'taskId':_0x315b29['taskId']||null,'currentUserId':_0x315b29['currentUserId']||null,'compact':_0x315b29['compact']||![],'skipHeader':_0x315b29['skipHeader']||![],'onCommentsLoaded':_0x315b29['onCommentsLoaded']||null,'onCommentsChanged':_0x315b29['onCommentsChanged']||null,'enableAttachments':_0x315b29['enableAttachments']||![],'getAPI':_0x315b29['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 _0x367a49=this['options']['getAPI'](),_0x1aa60d=await _0x367a49['getTaskAttachments'](this['options']['taskId']);this['existingAttachments']=_0x1aa60d['attachments']||[];}catch(_0x18b47a){console['warn']('Failed\x20to\x20load\x20existing\x20attachments:',_0x18b47a),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 _0x429bce=this['header']['querySelector']('.comments-toggle-btn');_0x429bce['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 _0x5318d6=document['createElement']('div');_0x5318d6['className']='comments-editor-wrapper',this['toolbar']=document['createElement']('div'),this['toolbar']['className']='comments-toolbar\x20comments-toolbar-hidden',_0x5318d6['appendChild'](this['toolbar']);const _0x5738b4=document['createElement']('div');_0x5738b4['className']='comments-editor-placeholder',_0x5318d6['appendChild'](_0x5738b4);const _0x2669f1=document['createElement']('div');_0x2669f1['className']='comments-input-actions',_0x2669f1['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'](_0x5318d6),this['inputSection']['appendChild'](_0x2669f1),this['container']['appendChild'](this['inputSection']),this['initEditor'](_0x5738b4),this['submitBtn']=_0x2669f1['querySelector']('.comments-submit-btn'),this['cancelBtn']=_0x2669f1['querySelector']('.comments-cancel-btn'),this['submitBtn']['addEventListener']('click',()=>this['handleSubmit']()),this['cancelBtn']['addEventListener']('click',()=>this['cancelEdit']());}['initEditor'](_0x1dfd25){const _0x278b3e=document['createElement']('textarea');_0x278b3e['placeholder']='Add\x20a\x20comment...',_0x278b3e['className']='comments-textarea',_0x1dfd25['appendChild'](_0x278b3e);const _0x42653c=window['MarkdownEditor'];if(!_0x42653c){console['error']('MarkdownEditor\x20not\x20loaded');return;}const _0x3f10d0={'placeholder':'Add\x20a\x20comment...','editable':!![],'toolbar':!![],'minHeight':this['options']['compact']?'60px':'80px','onChange':_0x12e1d4=>{const _0xf768a9=_0x12e1d4&&_0x12e1d4['trim']()['length']>0x0||this['pendingAttachments']['length']>0x0;this['submitBtn']['disabled']=!_0xf768a9;},'fetchUsers':async()=>{const _0x2d071b=this['options']['getAPI']();return _0x2d071b['getUsers']();}};this['options']['enableAttachments']&&this['options']['taskId']&&(_0x3f10d0['onAddAttachments']=_0x433004=>{this['pendingAttachments']['push'](..._0x433004),this['submitBtn']['disabled']=![];},_0x3f10d0['resolveAttachmentUrl']=_0x16fd78=>{const _0x49edca=this['options']['getAPI']();return _0x49edca['getBaseUrl']()+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x16fd78);},_0x3f10d0['isAttachmentNameTaken']=_0x511a57=>{return this['pendingAttachments']['some'](_0x5697bc=>_0x5697bc['name']===_0x511a57)||this['existingAttachments']['some'](_0x1d389d=>_0x1d389d['name']===_0x511a57);});this['editor']=new _0x42653c(_0x278b3e,_0x3f10d0);const _0x10d96c=this['editor']['editor'],_0x5382b5=this['editor']['toolbar'];_0x5382b5&&(_0x5382b5['classList']['add']('comments-toolbar-hidden'),_0x10d96c['addEventListener']('focus',()=>{_0x5382b5['classList']['remove']('comments-toolbar-hidden');}),_0x10d96c['addEventListener']('blur',_0x447cfc=>{setTimeout(()=>{!this['editor']['container']?.['contains'](document['activeElement'])&&!_0x5382b5['contains'](document['activeElement'])&&(!this['editor']['getValue']()?.['trim']()&&!this['editingCommentId']&&_0x5382b5['classList']['add']('comments-toolbar-hidden'));},0x64);}));}['toggleExpanded'](){this['isExpanded']=!this['isExpanded'],this['commentsListWrapper']['hidden']=!this['isExpanded'],this['inputSection']['hidden']=!this['isExpanded'];const _0x79c22b=this['header']['querySelector']('.comments-chevron');_0x79c22b&&(_0x79c22b['style']['transform']=this['isExpanded']?'rotate(180deg)':''),this['isExpanded']&&this['comments']['length']===0x0&&this['options']['taskId']&&this['loadComments']();}['setTaskId'](_0x470d2c){this['options']['taskId']=_0x470d2c,this['comments']=[],this['renderComments'](),_0x470d2c&&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 _0x29acf5=this['options']['getAPI'](),_0x312ea6=await _0x29acf5['getComments'](this['options']['taskId']);this['comments']=_0x312ea6['comments']||[],this['renderComments'](),this['updateCount'](),this['options']['onCommentsLoaded']&&this['options']['onCommentsLoaded'](this['comments']);}catch(_0x15ac99){console['error']('Failed\x20to\x20load\x20comments:',_0x15ac99),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'](_0x52e387=>{const _0x50ab69=this['createCommentElement'](_0x52e387);this['commentsList']['appendChild'](_0x50ab69);});}['createCommentElement'](_0x544f14){const _0x7084c2=document['createElement']('div');_0x7084c2['className']='comment-item',_0x7084c2['dataset']['commentId']=_0x544f14['id'];const _0x52ac98=this['options']['currentUserId']&&_0x544f14['author']?.['userId']===this['options']['currentUserId'],_0x3cdc3d=this['formatDate'](_0x544f14['createdAt']),_0x42f527=_0x544f14['updatedAt']!==_0x544f14['createdAt'],_0x32bc05=this['resolveAttachmentUrls'](_0x544f14['content']);let _0x13afc9=window['marked']?window['marked']['parse'](_0x32bc05):_0x32bc05;_0x13afc9=this['renderMentions'](_0x13afc9),_0x7084c2['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'](_0x544f14['author']?.['name']||'Anonymous')+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-timestamp\x22\x20title=\x22'+new Date(_0x544f14['createdAt'])['toLocaleString']()+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x3cdc3d+(_0x42f527?'\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'+(_0x52ac98?'\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>'+_0x13afc9+'</div>\x0a\x20\x20\x20\x20';if(_0x52ac98){const _0x5f5d9c=_0x7084c2['querySelector']('.comment-edit-btn'),_0xa45dff=_0x7084c2['querySelector']('.comment-delete-btn');_0x5f5d9c?.['addEventListener']('click',()=>this['startEdit'](_0x544f14)),_0xa45dff?.['addEventListener']('click',()=>this['deleteComment'](_0x544f14['id']));}return _0x7084c2;}['formatDate'](_0x28c69c){const _0x3c31b0=new Date(_0x28c69c),_0x2ee59d=new Date(),_0xc26d5a=_0x2ee59d-_0x3c31b0,_0x2ca405=Math['floor'](_0xc26d5a/0xea60),_0x165c76=Math['floor'](_0xc26d5a/0x36ee80),_0x34e0ef=Math['floor'](_0xc26d5a/0x5265c00);if(_0x2ca405<0x1)return'just\x20now';if(_0x2ca405<0x3c)return _0x2ca405+'m\x20ago';if(_0x165c76<0x18)return _0x165c76+'h\x20ago';if(_0x34e0ef<0x7)return _0x34e0ef+'d\x20ago';return _0x3c31b0['toLocaleDateString']();}['escapeHtml'](_0x140893){const _0x1b242c=document['createElement']('div');return _0x1b242c['textContent']=_0x140893,_0x1b242c['innerHTML'];}['resolveAttachmentUrls'](_0x14b597){if(!_0x14b597||!this['options']['taskId'])return _0x14b597;const _0x5e72dd=this['options']['getAPI'](),_0x654917=_0x5e72dd['getBaseUrl']();let _0x2e4616=String(_0x14b597)['replace'](/\]\(attachment:(?:\/\/)?([^)]+)\)/g,(_0x9d398b,_0x1f8295)=>{const _0xe0557d=String(_0x1f8295||'')['trim']();if(!_0xe0557d)return _0x9d398b;let _0x3d01e4=_0xe0557d;try{_0x3d01e4=decodeURIComponent(_0xe0557d);}catch{}return']('+_0x654917+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x3d01e4)+')';});return _0x2e4616;}['renderMentions'](_0x48b6f5){if(!_0x48b6f5)return _0x48b6f5;return String(_0x48b6f5)['replace'](/@?<a\s+href="mention:([^"]+)"[^>]*>([^<]+)<\/a>/g,(_0x18b2c3,_0x36b718,_0x243587)=>{const _0x300964=this['escapeHtml'](_0x243587),_0x494b43=this['escapeHtml'](_0x36b718);return'<span\x20class=\x22mention\x22\x20data-mention-user-id=\x22'+_0x494b43+'\x22>@'+_0x300964+'</span>';});}['startEdit'](_0x1453f6){this['editingCommentId']=_0x1453f6['id'],this['editor']['setValue'](_0x1453f6['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 _0x5b7343=this['editor']['getValue']()?.['trim']();if(!_0x5b7343&&this['pendingAttachments']['length']===0x0||!this['options']['taskId'])return;this['setLoading'](!![]);try{const _0x1ec98b=this['options']['getAPI']();this['pendingAttachments']['length']>0x0&&this['options']['enableAttachments']&&(await _0x1ec98b['uploadAttachments'](this['options']['taskId'],this['pendingAttachments']),this['existingAttachments']['push'](...this['pendingAttachments']['map'](_0x2496a8=>({'name':_0x2496a8['name']}))),this['pendingAttachments']=[]);if(this['editingCommentId']){const _0x81369=await _0x1ec98b['updateComment'](this['options']['taskId'],this['editingCommentId'],_0x5b7343),_0x263d8b=this['comments']['findIndex'](_0x45de46=>_0x45de46['id']===this['editingCommentId']);_0x263d8b!==-0x1&&(this['comments'][_0x263d8b]=_0x81369['comment']);}else{const _0x5db1d0=await _0x1ec98b['addComment'](this['options']['taskId'],_0x5b7343);this['comments']['push'](_0x5db1d0['comment']);}this['renderComments'](),this['updateCount'](),this['cancelEdit'](),this['editor']['clear']();}catch(_0x269ce){console['error']('Failed\x20to\x20save\x20comment:',_0x269ce),alert('Failed\x20to\x20save\x20comment:\x20'+_0x269ce['message']);}finally{this['setLoading'](![]);}}async['deleteComment'](_0x22eaca){const _0xbd09c1=await this['showDeleteConfirmModal']();if(!_0xbd09c1)return;try{const _0x1902a7=this['options']['getAPI']();await _0x1902a7['deleteComment'](this['options']['taskId'],_0x22eaca),this['comments']=this['comments']['filter'](_0x4565e9=>_0x4565e9['id']!==_0x22eaca),this['renderComments'](),this['updateCount']();}catch(_0x45e5e4){console['error']('Failed\x20to\x20delete\x20comment:',_0x45e5e4),alert('Failed\x20to\x20delete\x20comment:\x20'+_0x45e5e4['message']);}}['showDeleteConfirmModal'](){return new Promise(_0x510d47=>{const _0x1feb4a=document['createElement']('div');_0x1feb4a['className']='comments-confirm-modal',_0x1feb4a['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'](_0x1feb4a);const _0x3d3ba3=_0x488d56=>{document['removeEventListener']('keydown',_0x934b62),_0x1feb4a['remove'](),_0x510d47(_0x488d56);},_0x934b62=_0x1a6167=>{if(_0x1a6167['key']==='Escape')_0x3d3ba3(![]);};document['addEventListener']('keydown',_0x934b62),_0x1feb4a['querySelector']('.comments-confirm-backdrop')['addEventListener']('click',()=>_0x3d3ba3(![])),_0x1feb4a['querySelector']('.comments-confirm-close')['addEventListener']('click',()=>_0x3d3ba3(![])),_0x1feb4a['querySelector']('.comments-confirm-cancel')['addEventListener']('click',()=>_0x3d3ba3(![])),_0x1feb4a['querySelector']('.comments-confirm-delete')['addEventListener']('click',()=>_0x3d3ba3(!![])),_0x1feb4a['querySelector']('.comments-confirm-cancel')['focus']();});}['setLoading'](_0x18ffce){this['submitBtn']['disabled']=_0x18ffce,this['submitBtn']['querySelector']('.btn-text')['hidden']=_0x18ffce,this['submitBtn']['querySelector']('.btn-loading')['hidden']=!_0x18ffce;}['updateCount'](){const _0x977feb=this['comments']['length'],_0x53fd2b=this['container']['querySelector']('#comments-count-badge');_0x53fd2b&&(_0x53fd2b['textContent']=_0x977feb,_0x53fd2b['hidden']=_0x977feb===0x0);const _0x468a32=this['container']['querySelector']('#comments-count');_0x468a32&&(_0x468a32['textContent']=_0x977feb>0x0?'('+_0x977feb+')':''),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(_0x13e56e,_0x2e071a={}){this['container']=_0x13e56e,this['options']={'taskId':_0x2e071a['taskId']||null,'currentUserId':_0x2e071a['currentUserId']||null,'compact':_0x2e071a['compact']||![],'skipHeader':_0x2e071a['skipHeader']||![],'onCommentsLoaded':_0x2e071a['onCommentsLoaded']||null,'onCommentsChanged':_0x2e071a['onCommentsChanged']||null,'enableAttachments':_0x2e071a['enableAttachments']||![],'getAPI':_0x2e071a['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 _0x50d908=this['options']['getAPI'](),_0x20d857=await _0x50d908['getTaskAttachments'](this['options']['taskId']);this['existingAttachments']=_0x20d857['attachments']||[];}catch(_0x459752){console['warn']('Failed\x20to\x20load\x20existing\x20attachments:',_0x459752),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 _0x486d6a=this['header']['querySelector']('.comments-toggle-btn');_0x486d6a['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 _0x230cc3=document['createElement']('div');_0x230cc3['className']='comments-editor-wrapper',this['toolbar']=document['createElement']('div'),this['toolbar']['className']='comments-toolbar\x20comments-toolbar-hidden',_0x230cc3['appendChild'](this['toolbar']);const _0x10404c=document['createElement']('div');_0x10404c['className']='comments-editor-placeholder',_0x230cc3['appendChild'](_0x10404c);const _0x5713cf=document['createElement']('div');_0x5713cf['className']='comments-input-actions',_0x5713cf['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'](_0x230cc3),this['inputSection']['appendChild'](_0x5713cf),this['container']['appendChild'](this['inputSection']),this['initEditor'](_0x10404c),this['submitBtn']=_0x5713cf['querySelector']('.comments-submit-btn'),this['cancelBtn']=_0x5713cf['querySelector']('.comments-cancel-btn'),this['submitBtn']['addEventListener']('click',()=>this['handleSubmit']()),this['cancelBtn']['addEventListener']('click',()=>this['cancelEdit']());}['initEditor'](_0x308641){const _0x2fa0eb=document['createElement']('textarea');_0x2fa0eb['placeholder']='Add\x20a\x20comment...',_0x2fa0eb['className']='comments-textarea',_0x308641['appendChild'](_0x2fa0eb);const _0x354820=window['MarkdownEditor'];if(!_0x354820){console['error']('MarkdownEditor\x20not\x20loaded');return;}const _0x2d6d6a={'placeholder':'Add\x20a\x20comment...','editable':!![],'toolbar':!![],'minHeight':this['options']['compact']?'60px':'80px','onChange':_0x55d22e=>{const _0x415524=_0x55d22e&&_0x55d22e['trim']()['length']>0x0||this['pendingAttachments']['length']>0x0;this['submitBtn']['disabled']=!_0x415524;},'fetchUsers':async()=>{const _0x5d289b=this['options']['getAPI']();return _0x5d289b['getUsers']();}};this['options']['enableAttachments']&&this['options']['taskId']&&(_0x2d6d6a['onAddAttachments']=_0x9c2101=>{this['pendingAttachments']['push'](..._0x9c2101),this['submitBtn']['disabled']=![];},_0x2d6d6a['resolveAttachmentUrl']=_0x25f752=>{const _0x41dc56=this['options']['getAPI']();return _0x41dc56['getBaseUrl']()+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x25f752);},_0x2d6d6a['isAttachmentNameTaken']=_0x6258d3=>{return this['pendingAttachments']['some'](_0x4d7f49=>_0x4d7f49['name']===_0x6258d3)||this['existingAttachments']['some'](_0x5e8e65=>_0x5e8e65['name']===_0x6258d3);});this['editor']=new _0x354820(_0x2fa0eb,_0x2d6d6a);const _0x1fb80c=this['editor']['editor'],_0x3a82c8=this['editor']['toolbar'];_0x3a82c8&&(_0x3a82c8['classList']['add']('comments-toolbar-hidden'),_0x1fb80c['addEventListener']('focus',()=>{_0x3a82c8['classList']['remove']('comments-toolbar-hidden');}),_0x1fb80c['addEventListener']('blur',_0x2da80f=>{setTimeout(()=>{!this['editor']['container']?.['contains'](document['activeElement'])&&!_0x3a82c8['contains'](document['activeElement'])&&(!this['editor']['getValue']()?.['trim']()&&!this['editingCommentId']&&_0x3a82c8['classList']['add']('comments-toolbar-hidden'));},0x64);}));}['toggleExpanded'](){this['isExpanded']=!this['isExpanded'],this['commentsListWrapper']['hidden']=!this['isExpanded'],this['inputSection']['hidden']=!this['isExpanded'];const _0x55510d=this['header']['querySelector']('.comments-chevron');_0x55510d&&(_0x55510d['style']['transform']=this['isExpanded']?'rotate(180deg)':''),this['isExpanded']&&this['comments']['length']===0x0&&this['options']['taskId']&&this['loadComments']();}['setTaskId'](_0xdb1e08){this['options']['taskId']=_0xdb1e08,this['comments']=[],this['renderComments'](),_0xdb1e08&&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 _0x549fb8=this['options']['getAPI'](),_0x2139fe=await _0x549fb8['getComments'](this['options']['taskId']);this['comments']=_0x2139fe['comments']||[],this['renderComments'](),this['updateCount'](),this['options']['onCommentsLoaded']&&this['options']['onCommentsLoaded'](this['comments']);}catch(_0x5cb8df){console['error']('Failed\x20to\x20load\x20comments:',_0x5cb8df),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'](_0x567bbe=>{const _0x34f296=this['createCommentElement'](_0x567bbe);this['commentsList']['appendChild'](_0x34f296);});}['createCommentElement'](_0x5b5466){const _0x4e559a=document['createElement']('div');_0x4e559a['className']='comment-item',_0x4e559a['dataset']['commentId']=_0x5b5466['id'];const _0x448a43=this['options']['currentUserId']&&_0x5b5466['author']?.['userId']===this['options']['currentUserId'],_0x20152f=this['formatDate'](_0x5b5466['createdAt']),_0x3e2feb=_0x5b5466['updatedAt']!==_0x5b5466['createdAt'],_0x38b0c6=this['resolveAttachmentUrls'](_0x5b5466['content']);let _0x1c5ffe=window['marked']?window['marked']['parse'](_0x38b0c6):_0x38b0c6;_0x1c5ffe=this['renderMentions'](_0x1c5ffe),_0x4e559a['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'](_0x5b5466['author']?.['name']||'Anonymous')+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-timestamp\x22\x20title=\x22'+new Date(_0x5b5466['createdAt'])['toLocaleString']()+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x20152f+(_0x3e2feb?'\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'+(_0x448a43?'\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>'+_0x1c5ffe+'</div>\x0a\x20\x20\x20\x20';if(_0x448a43){const _0x2aa426=_0x4e559a['querySelector']('.comment-edit-btn'),_0x3386c6=_0x4e559a['querySelector']('.comment-delete-btn');_0x2aa426?.['addEventListener']('click',()=>this['startEdit'](_0x5b5466)),_0x3386c6?.['addEventListener']('click',()=>this['deleteComment'](_0x5b5466['id']));}return _0x4e559a;}['formatDate'](_0x145f09){const _0x6af0c4=new Date(_0x145f09),_0x54b939=new Date(),_0x3ad686=_0x54b939-_0x6af0c4,_0x53cebc=Math['floor'](_0x3ad686/0xea60),_0x20d0d2=Math['floor'](_0x3ad686/0x36ee80),_0x2390bb=Math['floor'](_0x3ad686/0x5265c00);if(_0x53cebc<0x1)return'just\x20now';if(_0x53cebc<0x3c)return _0x53cebc+'m\x20ago';if(_0x20d0d2<0x18)return _0x20d0d2+'h\x20ago';if(_0x2390bb<0x7)return _0x2390bb+'d\x20ago';return _0x6af0c4['toLocaleDateString']();}['escapeHtml'](_0x19ae5d){const _0x2d6e8c=document['createElement']('div');return _0x2d6e8c['textContent']=_0x19ae5d,_0x2d6e8c['innerHTML'];}['resolveAttachmentUrls'](_0x60cd00){if(!_0x60cd00||!this['options']['taskId'])return _0x60cd00;const _0x4097e8=this['options']['getAPI'](),_0xa49555=_0x4097e8['getBaseUrl']();let _0x1a25c0=String(_0x60cd00)['replace'](/\]\(attachment:(?:\/\/)?([^)]+)\)/g,(_0x4f2729,_0x130734)=>{const _0x2e03f8=String(_0x130734||'')['trim']();if(!_0x2e03f8)return _0x4f2729;let _0x46f399=_0x2e03f8;try{_0x46f399=decodeURIComponent(_0x2e03f8);}catch{}return']('+_0xa49555+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x46f399)+')';});return _0x1a25c0;}['renderMentions'](_0x425d26){if(!_0x425d26)return _0x425d26;return String(_0x425d26)['replace'](/@?<a\s+href="mention:([^"]+)"[^>]*>([^<]+)<\/a>/g,(_0xd82bdf,_0x3563e7,_0x4096e9)=>{const _0x51f5ae=this['escapeHtml'](_0x4096e9),_0x263e6d=this['escapeHtml'](_0x3563e7);return'<span\x20class=\x22mention\x22\x20data-mention-user-id=\x22'+_0x263e6d+'\x22>@'+_0x51f5ae+'</span>';});}['startEdit'](_0x8a17b7){this['editingCommentId']=_0x8a17b7['id'],this['editor']['setValue'](_0x8a17b7['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 _0x48e234=this['editor']['getValue']()?.['trim']();if(!_0x48e234&&this['pendingAttachments']['length']===0x0||!this['options']['taskId'])return;this['setLoading'](!![]);try{const _0x4a6a30=this['options']['getAPI']();this['pendingAttachments']['length']>0x0&&this['options']['enableAttachments']&&(await _0x4a6a30['uploadAttachments'](this['options']['taskId'],this['pendingAttachments']),this['existingAttachments']['push'](...this['pendingAttachments']['map'](_0x453b77=>({'name':_0x453b77['name']}))),this['pendingAttachments']=[]);if(this['editingCommentId']){const _0x1c2356=await _0x4a6a30['updateComment'](this['options']['taskId'],this['editingCommentId'],_0x48e234),_0x106c43=this['comments']['findIndex'](_0x2a85c3=>_0x2a85c3['id']===this['editingCommentId']);_0x106c43!==-0x1&&(this['comments'][_0x106c43]=_0x1c2356['comment']);}else{const _0x5d5039=await _0x4a6a30['addComment'](this['options']['taskId'],_0x48e234);this['comments']['push'](_0x5d5039['comment']);}this['renderComments'](),this['updateCount'](),this['cancelEdit'](),this['editor']['clear']();}catch(_0x5db92d){console['error']('Failed\x20to\x20save\x20comment:',_0x5db92d),alert('Failed\x20to\x20save\x20comment:\x20'+_0x5db92d['message']);}finally{this['setLoading'](![]);}}async['deleteComment'](_0x12830b){const _0x2fd52a=await this['showDeleteConfirmModal']();if(!_0x2fd52a)return;try{const _0x3380cd=this['options']['getAPI']();await _0x3380cd['deleteComment'](this['options']['taskId'],_0x12830b),this['comments']=this['comments']['filter'](_0x1e4dcc=>_0x1e4dcc['id']!==_0x12830b),this['renderComments'](),this['updateCount']();}catch(_0xea4ef9){console['error']('Failed\x20to\x20delete\x20comment:',_0xea4ef9),alert('Failed\x20to\x20delete\x20comment:\x20'+_0xea4ef9['message']);}}['showDeleteConfirmModal'](){return new Promise(_0x16d177=>{const _0x2469ae=document['createElement']('div');_0x2469ae['className']='comments-confirm-modal',_0x2469ae['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'](_0x2469ae);const _0x21660f=_0xb18a4b=>{document['removeEventListener']('keydown',_0x20b9b7),_0x2469ae['remove'](),_0x16d177(_0xb18a4b);},_0x20b9b7=_0x343064=>{if(_0x343064['key']==='Escape')_0x21660f(![]);};document['addEventListener']('keydown',_0x20b9b7),_0x2469ae['querySelector']('.comments-confirm-backdrop')['addEventListener']('click',()=>_0x21660f(![])),_0x2469ae['querySelector']('.comments-confirm-close')['addEventListener']('click',()=>_0x21660f(![])),_0x2469ae['querySelector']('.comments-confirm-cancel')['addEventListener']('click',()=>_0x21660f(![])),_0x2469ae['querySelector']('.comments-confirm-delete')['addEventListener']('click',()=>_0x21660f(!![])),_0x2469ae['querySelector']('.comments-confirm-cancel')['focus']();});}['setLoading'](_0x159d34){this['submitBtn']['disabled']=_0x159d34,this['submitBtn']['querySelector']('.btn-text')['hidden']=_0x159d34,this['submitBtn']['querySelector']('.btn-loading')['hidden']=!_0x159d34;}['updateCount'](){const _0x4285fe=this['comments']['length'],_0x38d3c3=this['container']['querySelector']('#comments-count-badge');_0x38d3c3&&(_0x38d3c3['textContent']=_0x4285fe,_0x38d3c3['hidden']=_0x4285fe===0x0);const _0x3cec6b=this['container']['querySelector']('#comments-count');_0x3cec6b&&(_0x3cec6b['textContent']=_0x4285fe>0x0?'('+_0x4285fe+')':''),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(_0x35baf2){const _0x1fe101=[],_0x25c381=_0x35baf2['split']('\x0a');let _0x26f64b=null,_0x478b71=null;for(const _0x21ceff of _0x25c381){if(_0x21ceff['startsWith']('diff\x20--git')){_0x26f64b&&_0x478b71&&_0x26f64b['hunks']['push'](_0x478b71);_0x26f64b&&_0x1fe101['push'](_0x26f64b);const _0x1572a4=_0x21ceff['match'](/diff --git a\/(.+?) b\/(.+)/);_0x26f64b={'oldPath':_0x1572a4?_0x1572a4[0x1]:'','newPath':_0x1572a4?_0x1572a4[0x2]:'','hunks':[],'isDeleted':![]},_0x478b71=null;}else{if(_0x21ceff['startsWith']('deleted\x20file\x20mode')&&_0x26f64b)_0x26f64b['isDeleted']=!![];else{if(_0x21ceff['startsWith']('@@'))_0x478b71&&_0x26f64b&&_0x26f64b['hunks']['push'](_0x478b71),_0x478b71={'header':_0x21ceff,'lines':[]};else _0x478b71&&_0x478b71['lines']['push'](_0x21ceff);}}}return _0x26f64b&&_0x478b71&&_0x26f64b['hunks']['push'](_0x478b71),_0x26f64b&&_0x1fe101['push'](_0x26f64b),_0x1fe101;}export function parseHunkHeader(_0x1e7924){const _0x38f220=_0x1e7924['match'](/@@ -(\d+),?\d* \+(\d+),?\d* @@/);if(_0x38f220)return{'oldStart':parseInt(_0x38f220[0x1],0xa),'newStart':parseInt(_0x38f220[0x2],0xa)};return{'oldStart':0x1,'newStart':0x1};}export function highlightDiffLine(_0x11998c,_0x54b4e9){const _0x58dd70=window['hljs']||(typeof hljs!=='undefined'?hljs:null);if(_0x58dd70&&_0x54b4e9)try{const _0x355c9e=_0x58dd70['getLanguage'](_0x54b4e9)?_0x54b4e9:null;if(_0x355c9e)return _0x58dd70['highlight'](_0x11998c,{'language':_0x355c9e})['value'];}catch(_0x18f103){console['error']('Diff\x20syntax\x20highlighting\x20error:',_0x18f103);}return Utils['escapeHtml'](_0x11998c);}export function getFileLanguage(_0x24a54a){const _0x421244=_0x24a54a['split']('.')['pop']()['toLowerCase'](),_0x3d5c6e={'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 _0x3d5c6e[_0x421244]||null;}export function computeWordDiff(_0x2bf90f,_0x5b08f6){const _0x2c4ade=_0x4c1e01=>{const _0x48c524=[];let _0x1f7726='',_0x305f66=![];for(let _0x36cd54=0x0;_0x36cd54<_0x4c1e01['length'];_0x36cd54++){const _0xfb03f1=_0x4c1e01[_0x36cd54],_0x53ac7e=/\s/['test'](_0xfb03f1);if(_0x1f7726==='')_0x1f7726=_0xfb03f1,_0x305f66=_0x53ac7e;else _0x53ac7e===_0x305f66?_0x1f7726+=_0xfb03f1:(_0x48c524['push'](_0x1f7726),_0x1f7726=_0xfb03f1,_0x305f66=_0x53ac7e);}return _0x1f7726&&_0x48c524['push'](_0x1f7726),_0x48c524;},_0x1fc2a9=_0x2c4ade(_0x2bf90f),_0x4e5b1a=_0x2c4ade(_0x5b08f6),_0x3d4c56=_0x1fc2a9['length'],_0x17b608=_0x4e5b1a['length'],_0x59d1d9=Array(_0x3d4c56+0x1)['fill'](null)['map'](()=>Array(_0x17b608+0x1)['fill'](0x0));for(let _0x5c6aa9=0x1;_0x5c6aa9<=_0x3d4c56;_0x5c6aa9++){for(let _0x48a90a=0x1;_0x48a90a<=_0x17b608;_0x48a90a++){_0x1fc2a9[_0x5c6aa9-0x1]===_0x4e5b1a[_0x48a90a-0x1]?_0x59d1d9[_0x5c6aa9][_0x48a90a]=_0x59d1d9[_0x5c6aa9-0x1][_0x48a90a-0x1]+0x1:_0x59d1d9[_0x5c6aa9][_0x48a90a]=Math['max'](_0x59d1d9[_0x5c6aa9-0x1][_0x48a90a],_0x59d1d9[_0x5c6aa9][_0x48a90a-0x1]);}}const _0x507d3f={'old':[],'new':[]};let _0xfe2098=_0x3d4c56,_0x4bd271=_0x17b608;const _0x533397=[],_0x33ee3c=[];while(_0xfe2098>0x0||_0x4bd271>0x0){if(_0xfe2098>0x0&&_0x4bd271>0x0&&_0x1fc2a9[_0xfe2098-0x1]===_0x4e5b1a[_0x4bd271-0x1])_0x533397['unshift']({'type':'equal','text':_0x1fc2a9[_0xfe2098-0x1]}),_0x33ee3c['unshift']({'type':'equal','text':_0x4e5b1a[_0x4bd271-0x1]}),_0xfe2098--,_0x4bd271--;else{if(_0x4bd271>0x0&&(_0xfe2098===0x0||_0x59d1d9[_0xfe2098][_0x4bd271-0x1]>=_0x59d1d9[_0xfe2098-0x1][_0x4bd271]))_0x33ee3c['unshift']({'type':'insert','text':_0x4e5b1a[_0x4bd271-0x1]}),_0x4bd271--;else _0xfe2098>0x0&&(_0x533397['unshift']({'type':'delete','text':_0x1fc2a9[_0xfe2098-0x1]}),_0xfe2098--);}}return _0x507d3f['old']=_0x533397,_0x507d3f['new']=_0x33ee3c,_0x507d3f;}export function renderDiffLineWithWordHighlight(_0x1ae9cc,_0xda1ac8,_0x39c314,_0xb2af3b){if(!_0xda1ac8||_0xda1ac8['length']===0x0)return highlightDiffLine(_0x1ae9cc,_0xb2af3b);let _0x3120c8='';const _0x1a6308=_0x39c314==='add'?'diff-word-add':'diff-word-remove',_0x443bbc=_0x39c314==='add'?'insert':'delete';for(const _0x3f6c34 of _0xda1ac8){const _0x5c94da=Utils['escapeHtml'](_0x3f6c34['text']);_0x3f6c34['type']===_0x443bbc?_0x3120c8+='<span\x20class=\x22'+_0x1a6308+'\x22>'+_0x5c94da+'</span>':_0x3120c8+=_0x5c94da;}return _0x3120c8;}export function calculateDiffStats(_0x23a973){let _0x9b8dcc=0x0,_0x5b76e0=0x0,_0x8173da=0x0;return _0x23a973['forEach'](_0x36f696=>{let _0x1321d4=0x0,_0xaddfb9=0x0;_0x36f696['hunks']['forEach'](_0xd11937=>{_0xd11937['lines']['forEach'](_0x412007=>{if(_0x412007['startsWith']('+'))_0x1321d4+=0x1;else{if(_0x412007['startsWith']('-'))_0xaddfb9+=0x1;}});}),(_0x1321d4+_0xaddfb9>0x0||_0x36f696['isDeleted'])&&(_0x8173da+=0x1),_0x9b8dcc+=_0x1321d4,_0x5b76e0+=_0xaddfb9;}),{'additions':_0x9b8dcc,'deletions':_0x5b76e0,'files':_0x8173da};}export function getFileStatus(_0x3c541c,_0x334085,_0x2a2e39){if(_0x3c541c['isDeleted'])return'deleted';if(_0x334085>0x0&&_0x2a2e39===0x0)return'added';return'modified';}export function safeBase64(_0x484e2e){try{return btoa(unescape(encodeURIComponent(_0x484e2e)));}catch(_0x3202d2){return btoa(_0x484e2e);}}export function getStorageKey(_0x576894,_0x2cbd9f){return _0x576894+'-'+safeBase64(_0x2cbd9f);}export function getCollapsedState(_0x1880ac,_0x3e858b){const _0x4e869a=localStorage['getItem'](getStorageKey(_0x1880ac,_0x3e858b));return _0x4e869a==='true';}export function renderUnifiedDiff(_0x77101,_0x4a33e6){return _0x77101['map']((_0x2f806d,_0x3f416f)=>{const _0x331c12=_0x2f806d['newPath']||_0x2f806d['oldPath']||'unknown',_0x4ab040='diff-'+_0x4a33e6+'-'+_0x3f416f,_0x1ad51f=getFileLanguage(_0x331c12),{additions:_0x1cb24c,deletions:_0x28d25f}=calculateDiffStats([_0x2f806d]),_0x490a3f=getCollapsedState(_0x4a33e6,_0x331c12),_0x513b28=getFileStatus(_0x2f806d,_0x1cb24c,_0x28d25f),_0x2de716=_0x513b28==='added'?'A':_0x513b28==='deleted'?'D':'M',_0x3cea43=_0x2f806d['hunks']['map'](_0xb8e882=>{const {oldStart:_0x5a5bbc,newStart:_0x3ec917}=parseHunkHeader(_0xb8e882['header']);let _0xe16c7b=_0x5a5bbc,_0x29bd12=_0x3ec917;const _0x564ddc=_0xb8e882['lines']['map'](_0x1254f3=>({'line':_0x1254f3,'type':_0x1254f3['startsWith']('+')?'add':_0x1254f3['startsWith']('-')?'remove':_0x1254f3['startsWith']('\x5c')?'meta':'context'}));let _0x5ca029=0x0;while(_0x5ca029<_0x564ddc['length']){if(_0x564ddc[_0x5ca029]['type']==='remove'){let _0x3b58d0=_0x5ca029,_0x56412e=_0x5ca029;while(_0x56412e<_0x564ddc['length']&&_0x564ddc[_0x56412e]['type']==='remove')_0x56412e++;let _0x31a877=_0x56412e,_0x5955bd=_0x31a877;while(_0x5955bd<_0x564ddc['length']&&_0x564ddc[_0x5955bd]['type']==='add')_0x5955bd++;const _0x543e95=_0x56412e-_0x3b58d0,_0x378ef3=_0x5955bd-_0x31a877,_0x545fbc=Math['min'](_0x543e95,_0x378ef3);for(let _0x2137d5=0x0;_0x2137d5<_0x545fbc;_0x2137d5++){const _0x99c60b=_0x564ddc[_0x3b58d0+_0x2137d5]['line']['substring'](0x1),_0x2e8724=_0x564ddc[_0x31a877+_0x2137d5]['line']['substring'](0x1),_0x49ac50=computeWordDiff(_0x99c60b,_0x2e8724);_0x564ddc[_0x3b58d0+_0x2137d5]['wordDiff']=_0x49ac50['old'],_0x564ddc[_0x31a877+_0x2137d5]['wordDiff']=_0x49ac50['new'];}_0x5ca029=_0x5955bd;}else _0x5ca029++;}const _0x182fee=_0x564ddc['map'](_0x1163df=>{const _0x26c0c2=_0x1163df['line'];if(_0x26c0c2['startsWith']('+')){const _0x3a1920=_0x26c0c2['substring'](0x1),_0x236507=_0x1163df['wordDiff']?renderDiffLineWithWordHighlight(_0x3a1920,_0x1163df['wordDiff'],'add',_0x1ad51f):highlightDiffLine(_0x3a1920,_0x1ad51f),_0x4f6243='<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>'+_0x29bd12+'</span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>+</span>'+_0x236507+'</span></div>';return _0x29bd12+=0x1,_0x4f6243;}if(_0x26c0c2['startsWith']('-')){const _0x4fd646=_0x26c0c2['substring'](0x1),_0x3d2f90=_0x1163df['wordDiff']?renderDiffLineWithWordHighlight(_0x4fd646,_0x1163df['wordDiff'],'remove',_0x1ad51f):highlightDiffLine(_0x4fd646,_0x1ad51f),_0xc8afcf='<div\x20class=\x22diff-line\x20diff-remove\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0xe16c7b+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>-</span>'+_0x3d2f90+'</span></div>';return _0xe16c7b+=0x1,_0xc8afcf;}if(_0x26c0c2['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'](_0x26c0c2)+'</span></div>';const _0x4868e1=_0x26c0c2['startsWith']('\x20')?_0x26c0c2['substring'](0x1):_0x26c0c2,_0x59f6d6=highlightDiffLine(_0x4868e1,_0x1ad51f),_0x3515cd='<div\x20class=\x22diff-line\x20diff-context\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0xe16c7b+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x29bd12+'</span><span\x20class=\x22diff-line-content\x22>\x20'+_0x59f6d6+'</span></div>';return _0xe16c7b+=0x1,_0x29bd12+=0x1,_0x3515cd;})['join']('');return'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>'+Utils['escapeHtml'](_0xb8e882['header'])+'</div>'+_0x182fee+'</div>';})['join'](''),_0x3cb677=_0x3cea43||'<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-'+_0x4ab040+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-header\x22\x20data-diff-id=\x22'+_0x4ab040+'\x22\x20data-file-name=\x22'+Utils['escapeHtml'](_0x331c12)+'\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'+_0x513b28+'\x22>'+_0x2de716+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-name\x22>'+Utils['escapeHtml'](_0x331c12)+'</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>+'+_0x1cb24c+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-del\x22>-'+_0x28d25f+'</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'+_0x4ab040+'\x22\x20data-collapsed=\x22'+_0x490a3f+'\x22\x20type=\x22button\x22\x20aria-label=\x22'+(_0x490a3f?'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'+(_0x490a3f?'collapsed':'')+'\x22\x20id=\x22'+_0x4ab040+'\x22>'+_0x3cb677+'</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20';})['join']('');}
|
|
1
|
+
import{Utils}from'./app.js';export function parsePatchContent(_0x5c6a5c){const _0x3232c4=[],_0x2ff36a=_0x5c6a5c['split']('\x0a');let _0x58aff5=null,_0x22c00d=null;for(const _0x4ebcd5 of _0x2ff36a){if(_0x4ebcd5['startsWith']('diff\x20--git')){_0x58aff5&&_0x22c00d&&_0x58aff5['hunks']['push'](_0x22c00d);_0x58aff5&&_0x3232c4['push'](_0x58aff5);const _0x27f80b=_0x4ebcd5['match'](/diff --git a\/(.+?) b\/(.+)/);_0x58aff5={'oldPath':_0x27f80b?_0x27f80b[0x1]:'','newPath':_0x27f80b?_0x27f80b[0x2]:'','hunks':[],'isDeleted':![]},_0x22c00d=null;}else{if(_0x4ebcd5['startsWith']('deleted\x20file\x20mode')&&_0x58aff5)_0x58aff5['isDeleted']=!![];else{if(_0x4ebcd5['startsWith']('@@'))_0x22c00d&&_0x58aff5&&_0x58aff5['hunks']['push'](_0x22c00d),_0x22c00d={'header':_0x4ebcd5,'lines':[]};else _0x22c00d&&_0x22c00d['lines']['push'](_0x4ebcd5);}}}return _0x58aff5&&_0x22c00d&&_0x58aff5['hunks']['push'](_0x22c00d),_0x58aff5&&_0x3232c4['push'](_0x58aff5),_0x3232c4;}export function parseHunkHeader(_0x760075){const _0x2012b9=_0x760075['match'](/@@ -(\d+),?\d* \+(\d+),?\d* @@/);if(_0x2012b9)return{'oldStart':parseInt(_0x2012b9[0x1],0xa),'newStart':parseInt(_0x2012b9[0x2],0xa)};return{'oldStart':0x1,'newStart':0x1};}export function highlightDiffLine(_0x2d8071,_0x56ebd6){const _0x5ad674=window['hljs']||(typeof hljs!=='undefined'?hljs:null);if(_0x5ad674&&_0x56ebd6)try{const _0x3c2ac5=_0x5ad674['getLanguage'](_0x56ebd6)?_0x56ebd6:null;if(_0x3c2ac5)return _0x5ad674['highlight'](_0x2d8071,{'language':_0x3c2ac5})['value'];}catch(_0x2503cd){console['error']('Diff\x20syntax\x20highlighting\x20error:',_0x2503cd);}return Utils['escapeHtml'](_0x2d8071);}export function getFileLanguage(_0x2ac361){const _0x47b043=_0x2ac361['split']('.')['pop']()['toLowerCase'](),_0x5d54c1={'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 _0x5d54c1[_0x47b043]||null;}export function computeWordDiff(_0x22b4f9,_0x24287b){const _0x1d8fb0=_0x247ee9=>{const _0x24d644=[];let _0x20ce69='',_0x5976b2=![];for(let _0x4be04f=0x0;_0x4be04f<_0x247ee9['length'];_0x4be04f++){const _0x2d4ce0=_0x247ee9[_0x4be04f],_0x2a5820=/\s/['test'](_0x2d4ce0);if(_0x20ce69==='')_0x20ce69=_0x2d4ce0,_0x5976b2=_0x2a5820;else _0x2a5820===_0x5976b2?_0x20ce69+=_0x2d4ce0:(_0x24d644['push'](_0x20ce69),_0x20ce69=_0x2d4ce0,_0x5976b2=_0x2a5820);}return _0x20ce69&&_0x24d644['push'](_0x20ce69),_0x24d644;},_0x500266=_0x1d8fb0(_0x22b4f9),_0x188bbc=_0x1d8fb0(_0x24287b),_0x565241=_0x500266['length'],_0x551e0a=_0x188bbc['length'],_0x302ed0=Array(_0x565241+0x1)['fill'](null)['map'](()=>Array(_0x551e0a+0x1)['fill'](0x0));for(let _0x383ba6=0x1;_0x383ba6<=_0x565241;_0x383ba6++){for(let _0x50d681=0x1;_0x50d681<=_0x551e0a;_0x50d681++){_0x500266[_0x383ba6-0x1]===_0x188bbc[_0x50d681-0x1]?_0x302ed0[_0x383ba6][_0x50d681]=_0x302ed0[_0x383ba6-0x1][_0x50d681-0x1]+0x1:_0x302ed0[_0x383ba6][_0x50d681]=Math['max'](_0x302ed0[_0x383ba6-0x1][_0x50d681],_0x302ed0[_0x383ba6][_0x50d681-0x1]);}}const _0x1cb122={'old':[],'new':[]};let _0x50997f=_0x565241,_0x5b7678=_0x551e0a;const _0x3db7dd=[],_0xc9554a=[];while(_0x50997f>0x0||_0x5b7678>0x0){if(_0x50997f>0x0&&_0x5b7678>0x0&&_0x500266[_0x50997f-0x1]===_0x188bbc[_0x5b7678-0x1])_0x3db7dd['unshift']({'type':'equal','text':_0x500266[_0x50997f-0x1]}),_0xc9554a['unshift']({'type':'equal','text':_0x188bbc[_0x5b7678-0x1]}),_0x50997f--,_0x5b7678--;else{if(_0x5b7678>0x0&&(_0x50997f===0x0||_0x302ed0[_0x50997f][_0x5b7678-0x1]>=_0x302ed0[_0x50997f-0x1][_0x5b7678]))_0xc9554a['unshift']({'type':'insert','text':_0x188bbc[_0x5b7678-0x1]}),_0x5b7678--;else _0x50997f>0x0&&(_0x3db7dd['unshift']({'type':'delete','text':_0x500266[_0x50997f-0x1]}),_0x50997f--);}}return _0x1cb122['old']=_0x3db7dd,_0x1cb122['new']=_0xc9554a,_0x1cb122;}export function renderDiffLineWithWordHighlight(_0x30888b,_0x3b949f,_0x3d9f73,_0xe088ab){if(!_0x3b949f||_0x3b949f['length']===0x0)return highlightDiffLine(_0x30888b,_0xe088ab);let _0x203946='';const _0x164a52=_0x3d9f73==='add'?'diff-word-add':'diff-word-remove',_0x29de40=_0x3d9f73==='add'?'insert':'delete';for(const _0x2360da of _0x3b949f){const _0x5888a1=Utils['escapeHtml'](_0x2360da['text']);_0x2360da['type']===_0x29de40?_0x203946+='<span\x20class=\x22'+_0x164a52+'\x22>'+_0x5888a1+'</span>':_0x203946+=_0x5888a1;}return _0x203946;}export function calculateDiffStats(_0x4a00b4){let _0x536277=0x0,_0x4b3ef1=0x0,_0x1f213c=0x0;return _0x4a00b4['forEach'](_0x5c4d89=>{let _0x3f46ea=0x0,_0x5a20e8=0x0;_0x5c4d89['hunks']['forEach'](_0x1a91c7=>{_0x1a91c7['lines']['forEach'](_0x20d20b=>{if(_0x20d20b['startsWith']('+'))_0x3f46ea+=0x1;else{if(_0x20d20b['startsWith']('-'))_0x5a20e8+=0x1;}});}),(_0x3f46ea+_0x5a20e8>0x0||_0x5c4d89['isDeleted'])&&(_0x1f213c+=0x1),_0x536277+=_0x3f46ea,_0x4b3ef1+=_0x5a20e8;}),{'additions':_0x536277,'deletions':_0x4b3ef1,'files':_0x1f213c};}export function getFileStatus(_0x23d3d8,_0x5cc7eb,_0x398d1a){if(_0x23d3d8['isDeleted'])return'deleted';if(_0x5cc7eb>0x0&&_0x398d1a===0x0)return'added';return'modified';}export function safeBase64(_0x4a0f12){try{return btoa(unescape(encodeURIComponent(_0x4a0f12)));}catch(_0x59c993){return btoa(_0x4a0f12);}}export function getStorageKey(_0x1e3186,_0x4d56c0){return _0x1e3186+'-'+safeBase64(_0x4d56c0);}export function getCollapsedState(_0x56d74e,_0x3030ce){const _0x476845=localStorage['getItem'](getStorageKey(_0x56d74e,_0x3030ce));return _0x476845==='true';}export function renderUnifiedDiff(_0x2c5fb7,_0x178b81){return _0x2c5fb7['map']((_0xfd67c3,_0x53664b)=>{const _0x5834a6=_0xfd67c3['newPath']||_0xfd67c3['oldPath']||'unknown',_0x3e97d7='diff-'+_0x178b81+'-'+_0x53664b,_0x1984e0=getFileLanguage(_0x5834a6),{additions:_0xa86d85,deletions:_0x1ddbdd}=calculateDiffStats([_0xfd67c3]),_0x13c3d2=getCollapsedState(_0x178b81,_0x5834a6),_0x59d37c=getFileStatus(_0xfd67c3,_0xa86d85,_0x1ddbdd),_0x29ff47=_0x59d37c==='added'?'A':_0x59d37c==='deleted'?'D':'M',_0x4d0307=_0xfd67c3['hunks']['map'](_0x30891c=>{const {oldStart:_0x1a9fc7,newStart:_0x5136e6}=parseHunkHeader(_0x30891c['header']);let _0x58e22c=_0x1a9fc7,_0x26b96a=_0x5136e6;const _0x5b97bb=_0x30891c['lines']['map'](_0x399d56=>({'line':_0x399d56,'type':_0x399d56['startsWith']('+')?'add':_0x399d56['startsWith']('-')?'remove':_0x399d56['startsWith']('\x5c')?'meta':'context'}));let _0x5c7f28=0x0;while(_0x5c7f28<_0x5b97bb['length']){if(_0x5b97bb[_0x5c7f28]['type']==='remove'){let _0x39e340=_0x5c7f28,_0x1d0a45=_0x5c7f28;while(_0x1d0a45<_0x5b97bb['length']&&_0x5b97bb[_0x1d0a45]['type']==='remove')_0x1d0a45++;let _0x4dc1a4=_0x1d0a45,_0x475757=_0x4dc1a4;while(_0x475757<_0x5b97bb['length']&&_0x5b97bb[_0x475757]['type']==='add')_0x475757++;const _0x2dc628=_0x1d0a45-_0x39e340,_0x15f616=_0x475757-_0x4dc1a4,_0xb0783b=Math['min'](_0x2dc628,_0x15f616);for(let _0x12c38b=0x0;_0x12c38b<_0xb0783b;_0x12c38b++){const _0x3d6cc2=_0x5b97bb[_0x39e340+_0x12c38b]['line']['substring'](0x1),_0x41a4f7=_0x5b97bb[_0x4dc1a4+_0x12c38b]['line']['substring'](0x1),_0x17e031=computeWordDiff(_0x3d6cc2,_0x41a4f7);_0x5b97bb[_0x39e340+_0x12c38b]['wordDiff']=_0x17e031['old'],_0x5b97bb[_0x4dc1a4+_0x12c38b]['wordDiff']=_0x17e031['new'];}_0x5c7f28=_0x475757;}else _0x5c7f28++;}const _0x1969f5=_0x5b97bb['map'](_0x1a16a5=>{const _0x36f2d1=_0x1a16a5['line'];if(_0x36f2d1['startsWith']('+')){const _0x128df5=_0x36f2d1['substring'](0x1),_0xca419b=_0x1a16a5['wordDiff']?renderDiffLineWithWordHighlight(_0x128df5,_0x1a16a5['wordDiff'],'add',_0x1984e0):highlightDiffLine(_0x128df5,_0x1984e0),_0x1c6493='<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>'+_0x26b96a+'</span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>+</span>'+_0xca419b+'</span></div>';return _0x26b96a+=0x1,_0x1c6493;}if(_0x36f2d1['startsWith']('-')){const _0x32d392=_0x36f2d1['substring'](0x1),_0xbd9f4d=_0x1a16a5['wordDiff']?renderDiffLineWithWordHighlight(_0x32d392,_0x1a16a5['wordDiff'],'remove',_0x1984e0):highlightDiffLine(_0x32d392,_0x1984e0),_0x5d68e7='<div\x20class=\x22diff-line\x20diff-remove\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x58e22c+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>-</span>'+_0xbd9f4d+'</span></div>';return _0x58e22c+=0x1,_0x5d68e7;}if(_0x36f2d1['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'](_0x36f2d1)+'</span></div>';const _0x343508=_0x36f2d1['startsWith']('\x20')?_0x36f2d1['substring'](0x1):_0x36f2d1,_0x43e69d=highlightDiffLine(_0x343508,_0x1984e0),_0x360352='<div\x20class=\x22diff-line\x20diff-context\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x58e22c+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x26b96a+'</span><span\x20class=\x22diff-line-content\x22>\x20'+_0x43e69d+'</span></div>';return _0x58e22c+=0x1,_0x26b96a+=0x1,_0x360352;})['join']('');return'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>'+Utils['escapeHtml'](_0x30891c['header'])+'</div>'+_0x1969f5+'</div>';})['join'](''),_0x20fcdc=_0x4d0307||'<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-'+_0x3e97d7+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-header\x22\x20data-diff-id=\x22'+_0x3e97d7+'\x22\x20data-file-name=\x22'+Utils['escapeHtml'](_0x5834a6)+'\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'+_0x59d37c+'\x22>'+_0x29ff47+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-name\x22>'+Utils['escapeHtml'](_0x5834a6)+'</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>+'+_0xa86d85+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-del\x22>-'+_0x1ddbdd+'</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'+_0x3e97d7+'\x22\x20data-collapsed=\x22'+_0x13c3d2+'\x22\x20type=\x22button\x22\x20aria-label=\x22'+(_0x13c3d2?'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'+(_0x13c3d2?'collapsed':'')+'\x22\x20id=\x22'+_0x3e97d7+'\x22>'+_0x20fcdc+'</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20';})['join']('');}
|
|
@@ -320,13 +320,6 @@
|
|
|
320
320
|
Automations
|
|
321
321
|
<span class="content-tab-badge" id="badge-automations" hidden></span>
|
|
322
322
|
</button>
|
|
323
|
-
<button class="content-tab" data-tab="access" role="tab">
|
|
324
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="margin-right: 4px; vertical-align: text-bottom;">
|
|
325
|
-
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path>
|
|
326
|
-
</svg>
|
|
327
|
-
Access
|
|
328
|
-
<span class="content-tab-badge" id="badge-access" hidden></span>
|
|
329
|
-
</button>
|
|
330
323
|
</nav>
|
|
331
324
|
<button class="content-nav-scroll-btn content-nav-scroll-right" id="content-nav-scroll-right" aria-label="Scroll tabs right">
|
|
332
325
|
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
@@ -985,60 +978,6 @@
|
|
|
985
978
|
</div>
|
|
986
979
|
</div>
|
|
987
980
|
|
|
988
|
-
<!-- Access Tab -->
|
|
989
|
-
<div id="tab-access" class="tab-panel" role="tabpanel" hidden>
|
|
990
|
-
<div class="content-card">
|
|
991
|
-
<div class="card-header" style="display: flex; align-items: center; justify-content: space-between;">
|
|
992
|
-
<h3>Environment Access</h3>
|
|
993
|
-
<button class="btn-secondary btn-small" id="access-add-binding-btn" hidden>+ Add Binding</button>
|
|
994
|
-
</div>
|
|
995
|
-
<div class="card-body">
|
|
996
|
-
<div id="access-loading" class="loading" hidden>Loading bindings…</div>
|
|
997
|
-
<div id="access-empty" hidden style="padding: 1rem 0; color: var(--color-text-secondary); font-size: 0.9rem;">
|
|
998
|
-
No access bindings for this environment.
|
|
999
|
-
</div>
|
|
1000
|
-
<div id="access-bindings-container">
|
|
1001
|
-
<table class="users-table" id="access-bindings-table">
|
|
1002
|
-
<thead>
|
|
1003
|
-
<tr>
|
|
1004
|
-
<th>Subject</th>
|
|
1005
|
-
<th>Type</th>
|
|
1006
|
-
<th>Role</th>
|
|
1007
|
-
<th>Granted By</th>
|
|
1008
|
-
<th>Date</th>
|
|
1009
|
-
<th>Actions</th>
|
|
1010
|
-
</tr>
|
|
1011
|
-
</thead>
|
|
1012
|
-
<tbody id="access-bindings-body"></tbody>
|
|
1013
|
-
</table>
|
|
1014
|
-
</div>
|
|
1015
|
-
<!-- Add Binding inline form -->
|
|
1016
|
-
<div id="access-add-form" hidden style="margin-top: 1rem; padding: 1rem; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface-elevated);">
|
|
1017
|
-
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; margin-bottom: 0.75rem;">
|
|
1018
|
-
<div>
|
|
1019
|
-
<label style="font-size: 0.8rem; display: block; margin-bottom: 0.25rem;">Type</label>
|
|
1020
|
-
<select id="access-subject-type" class="form-input" style="font-size: 0.875rem;">
|
|
1021
|
-
<option value="team">Team</option>
|
|
1022
|
-
<option value="user">User</option>
|
|
1023
|
-
</select>
|
|
1024
|
-
</div>
|
|
1025
|
-
<div>
|
|
1026
|
-
<label style="font-size: 0.8rem; display: block; margin-bottom: 0.25rem;">Team / User</label>
|
|
1027
|
-
<select id="access-subject-id" class="form-input" style="font-size: 0.875rem;"></select>
|
|
1028
|
-
</div>
|
|
1029
|
-
<div>
|
|
1030
|
-
<label style="font-size: 0.8rem; display: block; margin-bottom: 0.25rem;">Role</label>
|
|
1031
|
-
<select id="access-role-id" class="form-input" style="font-size: 0.875rem;"></select>
|
|
1032
|
-
</div>
|
|
1033
|
-
</div>
|
|
1034
|
-
<div style="display: flex; gap: 0.5rem;">
|
|
1035
|
-
<button type="button" class="btn-primary btn-small" id="access-save-binding-btn">Add Binding</button>
|
|
1036
|
-
<button type="button" class="btn-ghost btn-small" id="access-cancel-binding-btn">Cancel</button>
|
|
1037
|
-
</div>
|
|
1038
|
-
</div>
|
|
1039
|
-
</div>
|
|
1040
|
-
</div>
|
|
1041
|
-
</div>
|
|
1042
981
|
|
|
1043
982
|
</div>
|
|
1044
983
|
</section>
|