@profoundlogic/coderflow-server 0.9.1 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/coder-server.js +1 -1
- package/dist/config/skill-catalog.json +1 -1
- package/dist/config.js +1 -1
- package/dist/lib/agent-keepalive.js +1 -1
- package/dist/lib/agent-models.js +1 -1
- package/dist/lib/api-keys.js +1 -1
- package/dist/lib/apiKeys.js +1 -1
- package/dist/lib/app-server-ports.js +1 -1
- package/dist/lib/auto-judge.js +1 -1
- package/dist/lib/automation-service.js +1 -1
- package/dist/lib/basic-auth.js +1 -1
- package/dist/lib/bindings.js +1 -1
- package/dist/lib/build-history.js +1 -1
- package/dist/lib/build-output-service.js +1 -1
- package/dist/lib/build-scheduler.js +1 -1
- package/dist/lib/build-service.js +1 -1
- package/dist/lib/ca-certificates.js +1 -1
- package/dist/lib/claude-oauth-refresh.js +1 -1
- package/dist/lib/cli/build.js +1 -1
- package/dist/lib/cli/cleanup-users.js +1 -1
- package/dist/lib/cli/config-command.js +1 -1
- package/dist/lib/cli/config.js +1 -1
- package/dist/lib/cli/create-user.js +1 -1
- package/dist/lib/cli/grant-admin.js +1 -1
- package/dist/lib/cli/init.js +1 -1
- package/dist/lib/cli/jira.js +1 -1
- package/dist/lib/cli/license.js +1 -1
- package/dist/lib/cli/list-roles.js +1 -1
- package/dist/lib/cli/list-users.js +1 -1
- package/dist/lib/cli/server-manager.js +1 -1
- package/dist/lib/cli/set-password.js +1 -1
- package/dist/lib/compression-filter.js +1 -1
- package/dist/lib/config-migration.js +1 -1
- package/dist/lib/container-credential-sync.js +1 -1
- package/dist/lib/container-tokens.js +1 -1
- package/dist/lib/data-dir.js +1 -1
- package/dist/lib/deployment-history.js +1 -1
- package/dist/lib/deployment-service.js +1 -1
- package/dist/lib/docker-utils.js +1 -1
- package/dist/lib/email.js +1 -1
- package/dist/lib/emailTemplates.js +1 -1
- package/dist/lib/entitlement.js +1 -1
- package/dist/lib/external-connections.js +1 -1
- package/dist/lib/fetch-utils.js +1 -1
- package/dist/lib/git-commit-details-route.js +1 -1
- package/dist/lib/git-history-diff-guardrails.js +1 -1
- package/dist/lib/git-provider-service.js +1 -1
- package/dist/lib/git-provider-setup/github-setup-handler.js +1 -1
- package/dist/lib/git-provider-setup/index.js +1 -1
- package/dist/lib/git-provider-setup/setup-factory.js +1 -1
- package/dist/lib/git-provider-setup/setup-interface.js +1 -1
- package/dist/lib/git-providers/azure-devops-provider.js +1 -1
- package/dist/lib/git-providers/github-app-provider.js +1 -1
- package/dist/lib/git-providers/index.js +1 -1
- package/dist/lib/git-providers/provider-factory.js +1 -1
- package/dist/lib/git-providers/provider-interface.js +1 -1
- package/dist/lib/github-urls.js +1 -1
- package/dist/lib/group-objective-linking.js +1 -1
- package/dist/lib/ibmi-sync.js +1 -1
- package/dist/lib/jira-client.js +1 -1
- package/dist/lib/judge-blinding.js +1 -1
- package/dist/lib/logger.js +1 -1
- package/dist/lib/memory-utils.js +1 -1
- package/dist/lib/migration-to-scoped-rbac.js +1 -1
- package/dist/lib/model-fetcher.js +1 -1
- package/dist/lib/notifications.js +1 -1
- package/dist/lib/objective-context.js +1 -1
- package/dist/lib/oidc-auth.js +1 -1
- package/dist/lib/oidc-device-flow.js +1 -1
- package/dist/lib/passwordTokens.js +1 -1
- package/dist/lib/permission-resolver.js +1 -1
- package/dist/lib/pin-cascade.js +1 -1
- package/dist/lib/provider-accounts.js +1 -1
- package/dist/lib/provider-oauth.js +1 -1
- package/dist/lib/provider-profile.js +1 -1
- package/dist/lib/provider-token-refresh.js +1 -1
- package/dist/lib/rbac-user-state.js +1 -1
- package/dist/lib/request-url.js +1 -1
- package/dist/lib/rewind.js +1 -1
- package/dist/lib/role-definitions.js +1 -1
- package/dist/lib/roles.js +1 -1
- package/dist/lib/secrets.js +1 -1
- package/dist/lib/session-file-store.js +1 -0
- package/dist/lib/setup-repo-git-auth.js +1 -1
- package/dist/lib/slack-service.js +1 -1
- package/dist/lib/state-capture.js +1 -1
- package/dist/lib/static-files.js +1 -1
- package/dist/lib/task-aliases.js +1 -1
- package/dist/lib/task-container-init.js +1 -1
- package/dist/lib/task-context-usage.js +1 -1
- package/dist/lib/task-git-auth-errors.js +1 -1
- package/dist/lib/task-name-format.js +1 -1
- package/dist/lib/task-name-generator.js +1 -1
- package/dist/lib/task-source-metadata.js +1 -1
- package/dist/lib/teams.js +1 -1
- package/dist/lib/user-git-oauth.js +1 -1
- package/dist/lib/user-git-tokens.js +1 -1
- package/dist/lib/users.js +1 -1
- package/dist/middleware/requireAuth.js +1 -1
- package/dist/middleware/requireInit.js +1 -1
- package/dist/middleware/requirePermission.js +1 -1
- package/dist/package.json +1 -1
- package/dist/playwright.config.js +1 -1
- package/dist/playwright.task-terminal.config.js +1 -1
- package/dist/routes/apiKeys.js +1 -1
- package/dist/routes/auth-oidc.js +1 -1
- package/dist/routes/auth.js +1 -1
- package/dist/routes/automations.js +1 -1
- package/dist/routes/bindings.js +1 -1
- package/dist/routes/build.js +1 -1
- package/dist/routes/containers.js +1 -1
- package/dist/routes/deploy-task.js +1 -1
- package/dist/routes/environment-management.js +1 -1
- package/dist/routes/environments.js +1 -1
- package/dist/routes/external-skills.js +1 -1
- package/dist/routes/git-credentials.js +1 -1
- package/dist/routes/git-oauth.js +1 -1
- package/dist/routes/git-provider-setup.js +1 -1
- package/dist/routes/health.js +1 -1
- package/dist/routes/jira.js +1 -1
- package/dist/routes/logs.js +1 -1
- package/dist/routes/objective-management.js +1 -1
- package/dist/routes/password.js +1 -1
- package/dist/routes/prompt.js +1 -1
- package/dist/routes/provider-auth.js +1 -1
- package/dist/routes/qa.js +1 -1
- package/dist/routes/roles.js +1 -1
- package/dist/routes/settings.js +1 -1
- package/dist/routes/skill-management.js +1 -1
- package/dist/routes/skills.js +1 -1
- package/dist/routes/slack.js +1 -1
- package/dist/routes/stats.js +1 -1
- package/dist/routes/tasks.js +1 -1
- package/dist/routes/teams.js +1 -1
- package/dist/routes/templates.js +1 -1
- package/dist/routes/test-task.js +1 -1
- package/dist/routes/test.js +1 -1
- package/dist/routes/users.js +1 -1
- package/dist/routes/visualizations.js +1 -1
- package/dist/scripts/create-user.js +1 -1
- package/dist/scripts/migrate-config-to-data-dir.js +1 -1
- package/dist/start.js +1 -1
- package/dist/web-ui/public/activity-detail-modal.js +1 -1
- package/dist/web-ui/public/activity-feed.js +1 -1
- package/dist/web-ui/public/activity-formatters.js +1 -1
- package/dist/web-ui/public/admin.html +6 -6
- package/dist/web-ui/public/admin.js +1 -1
- package/dist/web-ui/public/agent-event-parser.js +1 -1
- package/dist/web-ui/public/app.js +1 -1
- package/dist/web-ui/public/approve-dialog.js +1 -1
- package/dist/web-ui/public/automation-links.js +1 -1
- package/dist/web-ui/public/automation-schedule.js +1 -1
- package/dist/web-ui/public/comments-widget.js +1 -1
- package/dist/web-ui/public/diff-utils.js +1 -1
- package/dist/web-ui/public/docs/admin/automations.md +2 -1
- package/dist/web-ui/public/docs/admin/environments.md +2 -0
- package/dist/web-ui/public/docs/code/files-and-editing.md +1 -4
- package/dist/web-ui/public/docs/docsify-proxy-helper.js +1 -1
- package/dist/web-ui/public/environments.css +28 -0
- package/dist/web-ui/public/environments.html +33 -7
- 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.html +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.html +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.html +1 -1
- package/dist/web-ui/public/roles.js +1 -1
- package/dist/web-ui/public/settings.html +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.html +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-client.transport-warning.js +1 -1
- package/dist/web-ui/public/sse-shared-worker.js +1 -1
- package/dist/web-ui/public/task-judging-helpers.js +1 -1
- package/dist/web-ui/public/task.js +1 -1
- package/dist/web-ui/public/teams.html +2 -2
- 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.html +2 -2
- package/dist/web-ui/public/users.js +1 -1
- package/dist/web-ui/public/variant-grouping.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function isLogOnlyTaskType(_0x1e1dde){return _0x1e1dde==='test'||_0x1e1dde==='deploy';}export function createApproveDialogHTML(_0x53d3d6='',_0x2d9541={}){const _0x2028ad=_0x53d3d6,_0x38d2e4=_0x2d9541['useTaskPageStyles']?'modal\x20profound-approve-modal':'profound-feedback-modal\x20profound-approve-modal',_0x5aad5f=_0x2d9541['useTaskPageStyles']?'modal-warning':'approve-modal-warning',_0x3db62d=_0x2d9541['useTaskPageStyles']?'modal-error':'approve-modal-error';return'\x0a\x20\x20\x20\x20<div\x20id=\x22'+_0x2028ad+'approve-modal\x22\x20class=\x22'+_0x38d2e4+'\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'+_0x2028ad+'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'+_0x2028ad+'approve-warning\x22\x20class=\x22'+_0x5aad5f+'\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'+_0x2028ad+'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'+_0x2028ad+'approve-error\x22\x20class=\x22'+_0x3db62d+'\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'+_0x2028ad+'approve-error-text\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x2028ad+'conflict-resolution\x22\x20class=\x22conflict-resolution-panel\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22conflict-resolution-message\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22warning-icon\x22>!</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Remote\x20has\x20conflicting\x20changes\x20that\x20couldn\x27t\x20be\x20merged\x20automatically.</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22conflict-resolution-options\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x20btn-small\x22\x20id=\x22'+_0x2028ad+'conflict-agent-resolve\x22>Let\x20the\x20agent\x20resolve\x20conflicts</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22>The\x20agent\x20will\x20pull\x20remote\x20changes,\x20resolve\x20conflicts,\x20and\x20prepare\x20for\x20re-approval.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-secondary\x20btn-small\x22\x20id=\x22'+_0x2028ad+'conflict-new-branch\x22>Create\x20a\x20new\x20branch\x20instead</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22>Avoids\x20the\x20conflict\x20by\x20committing\x20to\x20a\x20separate\x20branch.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-secondary\x20btn-small\x22\x20id=\x22'+_0x2028ad+'conflict-cancel\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-info\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'commit-message-input\x22>Commit\x20message:</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<textarea\x20id=\x22'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'pull-before-commit\x22\x20checked>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Pull\x20from\x20remote\x20after\x20commit</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'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'+_0x2028ad+'cancel-approve\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x22\x20id=\x22'+_0x2028ad+'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(_0x4a7866={}){this['prefix']=_0x4a7866['prefix']||'',this['onApprove']=_0x4a7866['onApprove'],this['onSync']=_0x4a7866['onSync'],this['onSuccess']=_0x4a7866['onSuccess'],this['onError']=_0x4a7866['onError'],this['onCreatePR']=_0x4a7866['onCreatePR'],this['showToast']=_0x4a7866['showToast']||(()=>{}),this['container']=_0x4a7866['container']||document['body'],this['useTaskPageStyles']=_0x4a7866['useTaskPageStyles']||![],this['baseUrl']=_0x4a7866['baseUrl']||'',this['coderflowAttribution']=_0x4a7866['coderflowAttribution'],this['onConflictFollowUp']=_0x4a7866['onConflictFollowUp']||null,this['onSyncToIbmi']=_0x4a7866['onSyncToIbmi']||null,this['onGetSyncFiles']=_0x4a7866['onGetSyncFiles']||null,this['taskData']=null,this['initialized']=![],this['isSyncing']=![],this['_createPR']=![],this['_attributionRequestId']=0x0,this['_syncFileTree']=null,this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null,this['_transientWarning']='';}['init'](){if(this['initialized'])return;const _0x11391a=document['createElement']('div');_0x11391a['innerHTML']=createApproveDialogHTML(this['prefix'],{'useTaskPageStyles':this['useTaskPageStyles']}),this['container']['appendChild'](_0x11391a['firstElementChild']),this['_bindEvents'](),this['initialized']=!![];}['_el'](_0x182b1c){return document['getElementById'](''+this['prefix']+_0x182b1c);}['_bindEvents'](){const _0x5a26bb=this['_el']('approve-modal'),_0x194ba1=this['_el']('close-approve-modal'),_0x363f79=this['_el']('cancel-approve'),_0x523ede=this['_el']('confirm-approve'),_0x25a9f5=_0x5a26bb?.['querySelector']('.modal-overlay'),_0x17050b=this['_el']('pull-before-commit'),_0x3a750d=this['_el']('create-new-branch'),_0x5cec80=this['_el']('new-branch-input-container'),_0x463cee=this['_el']('new-branch-name'),_0x276c18=this['_el']('push-after-commit'),_0x25a6a1=this['_el']('create-pull-request'),_0x452b3a=this['_el']('pr-hint'),_0x1cd1c6=()=>{this['_refreshWarningBanner']();};_0x194ba1?.['addEventListener']('click',()=>this['hide']()),_0x363f79?.['addEventListener']('click',()=>this['hide']()),_0x25a9f5?.['addEventListener']('click',()=>this['hide']()),_0x523ede?.['addEventListener']('click',()=>this['_handleApprove']());_0x3a750d&&_0x3a750d['addEventListener']('change',()=>{_0x5cec80&&(_0x5cec80['hidden']=!_0x3a750d['checked']),_0x3a750d['checked']&&_0x463cee&&_0x463cee['focus'](),_0x1cd1c6();});_0x17050b?.['addEventListener']('change',()=>{_0x1cd1c6();});_0x25a6a1&&_0x276c18&&_0x3a750d&&(_0x25a6a1['addEventListener']('change',()=>{this['_createPR']=_0x25a6a1['checked'];if(_0x25a6a1['checked']){_0x276c18['checked']=!![],_0x276c18['disabled']=!![],_0x3a750d['checked']=!![],_0x3a750d['disabled']=!![];_0x5cec80&&(_0x5cec80['hidden']=![]);if(_0x452b3a)_0x452b3a['hidden']=![];}else{_0x276c18['disabled']=![],_0x3a750d['disabled']=![];if(_0x452b3a)_0x452b3a['hidden']=!![];}_0x1cd1c6();}),_0x276c18['addEventListener']('change',()=>{if(!_0x276c18['checked']&&_0x25a6a1['checked']){_0x25a6a1['checked']=![],this['_createPR']=![],_0x276c18['disabled']=![],_0x3a750d['disabled']=![];if(_0x452b3a)_0x452b3a['hidden']=!![];}}));_0x1cd1c6();const _0x1fa8d7=this['_el']('sync-to-ibmi');_0x1fa8d7&&_0x1fa8d7['addEventListener']('change',async _0x493d0e=>{const _0x1777f1=this['_el']('ibmi-sync-fields');if(_0x1777f1)_0x1777f1['hidden']=!_0x493d0e['target']['checked'];if(_0x493d0e['target']['checked']){const _0x1da70f=this['_el']('ibmi-sync-library'),_0x215911=localStorage['getItem']('coderflow_ibmi_sync_library');_0x215911&&_0x1da70f&&!_0x1da70f['value']&&(_0x1da70f['value']=_0x215911);const _0x2945a9=this['_el']('ibmi-sync-user');if(_0x2945a9&&!_0x2945a9['value']){const _0x3016a8=localStorage['getItem']('coderflow_ibmi_sync_user');if(_0x3016a8)_0x2945a9['value']=_0x3016a8;}const _0x29db89=this['_el']('ibmi-sync-password');if(_0x29db89)_0x29db89['value']='';!this['_syncFileTree']&&this['onGetSyncFiles']&&this['taskData']?.['taskId']&&await this['_loadSyncFileTree']();}}),this['_el']('conflict-agent-resolve')?.['addEventListener']('click',()=>{this['onConflictFollowUp']&&this['onConflictFollowUp'](this['taskData']['taskId']),this['hide'](),this['showToast']('Agent\x20is\x20resolving\x20conflicts.\x20Re-approve\x20when\x20it\x20finishes.','info');}),this['_el']('conflict-new-branch')?.['addEventListener']('click',()=>{this['_hideConflictResolution']();const _0x2ac817=this['_el']('create-new-branch'),_0xb3b4fc=this['_el']('new-branch-input-container'),_0x351b64=this['_el']('new-branch-name');if(_0x2ac817)_0x2ac817['checked']=!![];if(_0xb3b4fc)_0xb3b4fc['hidden']=![];if(_0x351b64)_0x351b64['focus']();_0x1cd1c6();}),this['_el']('conflict-cancel')?.['addEventListener']('click',()=>this['hide']()),document['addEventListener']('keydown',_0x59a56e=>{_0x59a56e['key']==='Escape'&&_0x5a26bb&&!_0x5a26bb['hidden']&&this['hide']();});}async['_loadSyncFileTree'](){const _0x4e66a8=this['_el']('ibmi-sync-file-tree'),_0x1d776d=this['_el']('ibmi-sync-files-summary');if(!_0x4e66a8)return;_0x4e66a8['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>Loading\x20files...</span>';if(_0x1d776d)_0x1d776d['textContent']='';try{const {files:_0x2c754b,absolutePaths:_0x1ec58b}=await this['onGetSyncFiles'](this['taskData']['taskId']);this['_syncRelativeFiles']=_0x2c754b,this['_syncAbsolutePaths']=_0x1ec58b;if(_0x2c754b['length']===0x0){_0x4e66a8['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>No\x20changed\x20files\x20found.</span>';return;}const {FileSelectionTree:_0x3d4e8d}=await import('./file-selection-tree.js'),{validateIbmiFile:_0x4e7ee0,hasKnownIbmiExtension:_0x452ebb}=await import('./ibmi-file-filter.js');this['_syncFileTree']=new _0x3d4e8d({'container':_0x4e66a8,'files':_0x2c754b,'isPreselected':_0x338e68=>{const {valid:_0x447472}=_0x4e7ee0(_0x338e68);return _0x447472&&_0x452ebb(_0x338e68);},'isDisabled':_0x23384c=>{const {valid:_0x308f85,reason:_0x2fc18f}=_0x4e7ee0(_0x23384c);return{'disabled':!_0x308f85,'reason':_0x2fc18f};},'isAutoCheckEligible':_0x1302a0=>{const {valid:_0x527eaa}=_0x4e7ee0(_0x1302a0);return _0x527eaa&&_0x452ebb(_0x1302a0);},'onChange':_0x29ef14=>{_0x1d776d&&(_0x1d776d['textContent']=_0x29ef14['length']+'\x20of\x20'+_0x2c754b['length']+'\x20file'+(_0x2c754b['length']!==0x1?'s':'')+'\x20selected');}}),this['_syncFileTree']['render']();}catch(_0x2fd8ca){_0x4e66a8['innerHTML']='<span\x20style=\x22color:\x20var(--color-danger,\x20#e55368);\x20font-size:\x2013px;\x22>Failed\x20to\x20load\x20files</span>';}}['showError'](_0xb593cd){const _0xfb5124=this['_el']('approve-error'),_0x7f3a36=this['_el']('approve-error-text');_0xfb5124&&_0x7f3a36&&(_0x7f3a36['textContent']=_0xb593cd,_0xfb5124['hidden']=![],_0xfb5124['scrollIntoView']({'behavior':'smooth','block':'nearest'}));}['hideError'](){const _0x413f77=this['_el']('approve-error'),_0x14a081=this['_el']('approve-error-text');_0x413f77&&_0x14a081&&(_0x413f77['hidden']=!![],_0x14a081['textContent']='');}['_displayBranchInfo'](_0x489d88,_0x1938bd={}){const _0x3c41eb=this['_el']('approve-branches');if(!_0x3c41eb)return;const _0x2dc060=[];for(const _0x404241 of _0x489d88){_0x1938bd[_0x404241['name']]&&_0x2dc060['push']({'repo':_0x404241['name'],'branch':_0x1938bd[_0x404241['name']]});}if(_0x2dc060['length']>0x0){_0x3c41eb['hidden']=![];if(_0x2dc060['length']===0x1)_0x3c41eb['innerHTML']='<div\x20class=\x22branch-info\x22>Branch:\x20<code>'+_0x2dc060[0x0]['branch']+'</code></div>';else{const _0x41a920=_0x2dc060['map'](_0x24761a=>'<div\x20class=\x22branch-item\x22><strong>'+_0x24761a['repo']+':</strong>\x20<code>'+_0x24761a['branch']+'</code></div>')['join']('');_0x3c41eb['innerHTML']='<div\x20class=\x22branch-info\x22>Branches:<div\x20class=\x22branch-list\x22>'+_0x41a920+'</div></div>';}}else _0x3c41eb['hidden']=!![],_0x3c41eb['innerHTML']='';}['showWarning'](_0x16ea8d){const _0x333306=this['_el']('approve-warning'),_0x367739=this['_el']('approve-warning-text');_0x333306&&_0x367739&&(_0x367739['textContent']=_0x16ea8d,_0x333306['hidden']=![]);}['hideWarning'](){const _0x4f08d2=this['_el']('approve-warning'),_0x19a89e=this['_el']('approve-warning-text');_0x4f08d2&&_0x19a89e&&(_0x4f08d2['hidden']=!![],_0x19a89e['textContent']='');}['_showConflictResolution'](){const _0x4daa07=this['_el']('conflict-resolution'),_0xa79ddb=this['_el']('confirm-approve'),_0xb03893=this['_el']('cancel-approve'),_0x2bb111=this['_el']('conflict-agent-resolve');if(_0x4daa07)_0x4daa07['hidden']=![];if(_0xa79ddb)_0xa79ddb['hidden']=!![];if(_0xb03893)_0xb03893['hidden']=!![];const _0x578061=this['_el']('approve-modal');if(_0x578061){this['_sectionsHiddenBeforeConflict']=new Set();for(const _0x33f618 of _0x578061['querySelectorAll']('.modal-section')){_0x33f618['hidden']&&this['_sectionsHiddenBeforeConflict']['add'](_0x33f618),_0x33f618['hidden']=!![];}}if(_0x2bb111){const _0x2528ae=!!this['onConflictFollowUp'];_0x2bb111['hidden']=!_0x2528ae,_0x2bb111['nextElementSibling']?.['classList']['contains']('field-hint')&&(_0x2bb111['nextElementSibling']['hidden']=!_0x2528ae);}}['_hideConflictResolution'](){const _0x5ba225=this['_el']('conflict-resolution'),_0x3d66ca=this['_el']('confirm-approve'),_0x4b5abf=this['_el']('cancel-approve');if(_0x5ba225)_0x5ba225['hidden']=!![];if(_0x3d66ca)_0x3d66ca['hidden']=![];if(_0x4b5abf)_0x4b5abf['hidden']=![];const _0x47b6f1=this['_el']('approve-modal');if(_0x47b6f1){const _0x56d72c=this['_sectionsHiddenBeforeConflict']||new Set();for(const _0x5eaa9c of _0x47b6f1['querySelectorAll']('.modal-section')){!_0x56d72c['has'](_0x5eaa9c)&&(_0x5eaa9c['hidden']=![]);}this['_sectionsHiddenBeforeConflict']=null;}}['_getRemoteConflictWarning'](){const _0x394d70=this['taskData']?.['reposChanged']||[],_0x58e2d8=this['_el']('pull-before-commit')?.['checked']??!![],_0x3cc52d=this['_el']('create-new-branch')?.['checked']||![];if(!_0x58e2d8||_0x3cc52d||_0x394d70['length']===0x0)return'';const _0x18d0d7=_0x394d70['filter'](_0x1671fd=>_0x1671fd?.['upstream_status']==='behind'||_0x1671fd?.['upstream_status']==='diverged');if(_0x18d0d7['length']===0x0)return'';const _0x50a4bc=_0x18d0d7['map'](_0x3695f6=>{const _0x14ab7e=Number(_0x3695f6?.['upstream_behind'])||0x0,_0x58dd76=_0x14ab7e+'\x20commit'+(_0x14ab7e===0x1?'':'s')+'\x20ahead';if(_0x3695f6['upstream_status']==='diverged')return _0x3695f6['name']+':\x20remote\x20is\x20'+_0x58dd76+'\x20and\x20the\x20tracked\x20branch\x20has\x20local\x20commits';return _0x3695f6['name']+':\x20remote\x20is\x20'+_0x58dd76;})['join'](';\x20');return'Remote\x20has\x20new\x20changes\x20('+_0x50a4bc+').\x20If\x20there\x20are\x20conflicts,\x20you\x27ll\x20be\x20given\x20options\x20to\x20resolve\x20them.';}['_refreshWarningBanner'](){const _0x5ccd96=[this['taskData']?.['warning']||'',this['_getRemoteConflictWarning'](),this['_transientWarning']||'']['filter'](Boolean);if(_0x5ccd96['length']>0x0){this['showWarning'](_0x5ccd96['join']('\x20'));return;}this['hideWarning']();}['_stripCoAuthoredByLines'](_0x12086a){return _0x12086a['replace'](/^Co-Authored-By:.*$/gmi,'')['replace'](/^Learn more: https:\/\/coderflow\.ai\s*$/gm,'')['replace'](/\n{3,}/g,'\x0a\x0a')['trim']();}async['_addAttributionIfEnabled'](_0x2ebe0c){try{let _0x1071b2;try{const _0x14cc70=await fetch(this['baseUrl']+'/settings');if(_0x14cc70['ok']){const _0x2405e9=await _0x14cc70['json']();_0x1071b2=_0x2405e9['coderflow_attribution']!==![];}}catch(_0x269afb){}_0x1071b2===undefined&&(this['coderflowAttribution']!==undefined?_0x1071b2=this['coderflowAttribution']!==![]:_0x1071b2=!![]);const _0x5c2797=this['_stripCoAuthoredByLines'](_0x2ebe0c);if(!_0x1071b2)return _0x5c2797;const _0x575184='\x0a\x0aCo-Authored-By:\x20CoderFlow\x20<ai@coderflow.ai>\x0aLearn\x20more:\x20https://coderflow.ai';return _0x5c2797+_0x575184;}catch(_0x47244e){return console['warn']('Failed\x20to\x20add\x20CoderFlow\x20attribution:',_0x47244e),_0x2ebe0c;}}['show'](_0x1598cf){!this['initialized']&&this['init']();this['taskData']=_0x1598cf;const _0x1d3613=this['_el']('approve-modal'),_0x34b7e6=this['_el']('commit-message-input'),_0x5e488b=this['_el']('pull-before-commit'),_0x5e9e9c=this['_el']('push-after-commit'),_0x35d072=this['_el']('create-new-branch'),_0x4932e7=this['_el']('new-branch-input-container'),_0x201ee6=this['_el']('new-branch-name');if(!_0x1d3613)return;this['hideError'](),this['hideWarning'](),this['_hideConflictResolution'](),this['_transientWarning']='';const _0x52c0d4=_0x1598cf['reposChanged']||[];if(_0x52c0d4['length']===0x0&&!_0x1598cf['syncFirst']){this['showToast']('No\x20changes\x20to\x20approve','error');return;}this['_updateDisplay'](_0x52c0d4,_0x1598cf);const _0x56824f=_0x1598cf['commitMessage']||'',_0x420c2f=this['_stripCoAuthoredByLines'](_0x56824f);_0x34b7e6['value']=_0x420c2f;if(_0x5e488b)_0x5e488b['checked']=!![];if(_0x5e9e9c)_0x5e9e9c['checked']=!![];_0x35d072&&(_0x35d072['checked']=![]);_0x4932e7&&(_0x4932e7['hidden']=!![]);_0x201ee6&&(_0x201ee6['value']='');if(_0x5e9e9c)_0x5e9e9c['disabled']=![];if(_0x35d072)_0x35d072['disabled']=![];this['_refreshWarningBanner'](),this['updatePRSupport'](_0x1598cf['prSupported']===!![]);const _0xd301ee=this['_el']('ibmi-sync-section');if(_0xd301ee){_0xd301ee['hidden']=!_0x1598cf['ibmiSyncAvailable'];const _0x48c019=this['_el']('sync-to-ibmi'),_0xb9b830=this['_el']('ibmi-sync-fields'),_0xa316b6=this['_el']('ibmi-sync-library');if(_0x48c019)_0x48c019['checked']=![];if(_0xb9b830)_0xb9b830['hidden']=!![];if(_0xa316b6)_0xa316b6['value']='';const _0x29e386=this['_el']('ibmi-sync-credentials-row');_0x29e386&&(_0x29e386['hidden']=!(_0x1598cf['ibmiSyncAvailable']&&_0x1598cf['syncCredentials']==='prompt'));}const _0x32c52c=this['_el']('confirm-approve');_0x1598cf['syncFirst']&&this['onSync']?(_0x32c52c&&(_0x32c52c['disabled']=!![],_0x32c52c['textContent']='Syncing...'),this['_performSync']()):_0x32c52c&&(_0x32c52c['disabled']=![],_0x32c52c['textContent']='Commit\x20Changes');_0x1d3613['hidden']=![];const _0x39e1fb=++this['_attributionRequestId'];void this['_applyAttributionAsync']({'requestId':_0x39e1fb,'taskId':_0x1598cf['taskId'],'originalCommitMessage':_0x420c2f}),setTimeout(()=>{_0x34b7e6['focus'](),_0x34b7e6['setSelectionRange'](0x0,_0x34b7e6['value']['length']);},0x64);}['updatePRSupport'](_0x4b972d){const _0x2e6b27=this['_el']('pr-option-section'),_0xa14e3b=this['_el']('create-pull-request'),_0x586976=this['_el']('pr-hint'),_0x3025f6=this['_el']('push-after-commit'),_0x3454cf=this['_el']('create-new-branch');if(!_0x2e6b27)return;if(_0x4b972d){_0x2e6b27['hidden']=![];_0xa14e3b&&!_0xa14e3b['disabled']&&(_0xa14e3b['checked']=![]);if(_0x586976)_0x586976['hidden']=!![];this['_createPR']=![];return;}_0xa14e3b?.['checked']&&(_0xa14e3b['checked']=![]);if(_0x586976)_0x586976['hidden']=!![];if(_0x3025f6)_0x3025f6['disabled']=![];if(_0x3454cf)_0x3454cf['disabled']=![];this['_createPR']=![],_0x2e6b27['hidden']=!![];}async['_applyAttributionAsync']({requestId:_0x37f245,taskId:_0x97436d,originalCommitMessage:_0x1b3497}){const _0xaa8cf2=this['_el']('commit-message-input');if(!_0xaa8cf2)return;const _0xe3f8b2=await this['_addAttributionIfEnabled'](_0x1b3497);if(_0x37f245!==this['_attributionRequestId'])return;if(!this['taskData']||this['taskData']['taskId']!==_0x97436d)return;if(!this['isVisible']())return;const _0x3dd913=_0x4e10a8=>_0x4e10a8['replace'](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a');if(_0x3dd913(_0xaa8cf2['value'])!==_0x3dd913(_0x1b3497))return;_0xaa8cf2['value']=_0xe3f8b2;}['_updateDisplay'](_0x5ab85f,_0x23c086){const _0x2ae912=this['_el']('approve-repo-name'),_0x3d0c29=this['_el']('approve-stats'),_0x49b602=this['_el']('multi-repo-note');if(_0x5ab85f['length']===0x0){if(_0x2ae912)_0x2ae912['textContent']='Syncing...';if(_0x3d0c29)_0x3d0c29['textContent']='';if(_0x49b602)_0x49b602['hidden']=!![];return;}const _0x14cbc5=_0x5ab85f['reduce']((_0x4a3957,_0x36b31e)=>_0x4a3957+(_0x36b31e['files_changed']||0x0),0x0),_0x4142eb=_0x5ab85f['reduce']((_0x2515b2,_0x4b9812)=>_0x2515b2+(_0x4b9812['lines_added']||0x0),0x0),_0x4a7e42=_0x5ab85f['reduce']((_0x2dc400,_0x21cf15)=>_0x2dc400+(_0x21cf15['lines_deleted']||0x0),0x0);if(_0x5ab85f['length']===0x1){if(_0x2ae912)_0x2ae912['textContent']=_0x5ab85f[0x0]?.['name']||'repository';if(_0x49b602)_0x49b602['hidden']=!![];}else{const _0x35d620=_0x5ab85f['map'](_0x5a643f=>_0x5a643f['name'])['join'](',\x20');if(_0x2ae912)_0x2ae912['textContent']=_0x5ab85f['length']+'\x20repositories:\x20'+_0x35d620;if(_0x49b602)_0x49b602['hidden']=![];}_0x3d0c29&&(_0x3d0c29['textContent']=_0x14cbc5+'\x20file'+(_0x14cbc5===0x1?'':'s')+'\x20changed\x20(+'+_0x4142eb+'\x20-'+_0x4a7e42+')'),this['_displayBranchInfo'](_0x5ab85f,_0x23c086?.['branches']||{});}async['_performSync'](){if(!this['onSync']||this['isSyncing'])return;this['isSyncing']=!![];const _0x464074=this['_el']('confirm-approve');try{const _0x4358ce=await this['onSync'](this['taskData']['taskId']);if(!this['isVisible']()){this['isSyncing']=![];return;}if(_0x4358ce['repos_changed']){const _0x1f0379=this['taskData']['reposChanged']?.['length']||0x0,_0x4d3909=this['taskData']['reposChanged']?.['reduce']((_0x162540,_0x1bb44a)=>_0x162540+(_0x1bb44a['files_changed']||0x0),0x0)||0x0;this['taskData']['reposChanged']=_0x4358ce['repos_changed'];if(_0x4358ce['current_branches']){const _0x4479ed={...this['taskData']['branches']||{}};for(const [_0xaacde1,_0x492451]of Object['entries'](_0x4358ce['current_branches'])){_0x492451?_0x4479ed[_0xaacde1]=_0x492451:delete _0x4479ed[_0xaacde1];}this['taskData']['branches']=_0x4479ed;}this['_updateDisplay'](_0x4358ce['repos_changed'],this['taskData']);const _0x146329=_0x4358ce['repos_changed']['length'],_0x3401b5=_0x4358ce['repos_changed']['reduce']((_0x440b09,_0x1730ce)=>_0x440b09+(_0x1730ce['files_changed']||0x0),0x0);(_0x3401b5>_0x4d3909||_0x146329>_0x1f0379)&&(this['_transientWarning']='Additional\x20changes\x20detected\x20since\x20last\x20sync.\x20Review\x20the\x20updated\x20file\x20list.'),this['_refreshWarningBanner']();}_0x464074&&(!this['taskData']['reposChanged']||this['taskData']['reposChanged']['length']===0x0?(_0x464074['disabled']=!![],_0x464074['textContent']='No\x20Changes',this['showError']('No\x20changes\x20to\x20approve\x20after\x20sync')):(_0x464074['disabled']=![],_0x464074['textContent']='Commit\x20Changes'));}catch(_0x5868d1){console['error']('Failed\x20to\x20sync\x20repos\x20before\x20approve:',_0x5868d1);if(!this['isVisible']()){this['isSyncing']=![];return;}this['showError']('Sync\x20failed:\x20'+_0x5868d1['message']+'.\x20You\x20can\x20still\x20commit\x20with\x20existing\x20staged\x20changes.'),_0x464074&&(this['taskData']['reposChanged']&&this['taskData']['reposChanged']['length']>0x0?(_0x464074['disabled']=![],_0x464074['textContent']='Commit\x20Changes'):(_0x464074['disabled']=!![],_0x464074['textContent']='No\x20Changes'));}finally{this['isSyncing']=![];}}['hide'](){const _0x539c38=this['_el']('approve-modal');_0x539c38&&(_0x539c38['hidden']=!![]),this['_syncFileTree']&&(this['_syncFileTree']['destroy'](),this['_syncFileTree']=null),this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}async['_handleApprove'](){const _0x59f19b=this['_el']('commit-message-input'),_0x2cc5b3=this['_el']('pull-before-commit'),_0x2459a8=this['_el']('push-after-commit'),_0xd4fec0=this['_el']('create-new-branch'),_0x160258=this['_el']('new-branch-name'),_0x7bbba9=this['_el']('confirm-approve'),_0x528e8c=_0x59f19b['value']['trim'](),_0x2f8d8d=_0x2cc5b3?.['checked']??!![],_0x3d5c80=_0x2459a8?.['checked']??!![],_0x55ce68=_0xd4fec0?.['checked']||![],_0x349d32=_0x160258?.['value']['trim']()||'';this['hideError']();if(!_0x528e8c){this['showError']('Commit\x20message\x20is\x20required'),_0x59f19b['focus']();return;}if(_0x55ce68&&!_0x349d32){this['showError']('Branch\x20name\x20is\x20required\x20when\x20creating\x20a\x20new\x20branch'),_0x160258?.['focus']();return;}if(_0x55ce68&&_0x349d32){const _0x4ed376=/[\s~^:?*\[\\]/;if(_0x4ed376['test'](_0x349d32)){this['showError']('Invalid\x20branch\x20name.\x20Avoid\x20spaces\x20and\x20special\x20characters\x20like\x20~\x20^\x20:\x20?\x20*\x20[\x20\x5c'),_0x160258?.['focus']();return;}}const _0x149c6c=this['_el']('sync-to-ibmi')?.['checked'];if(_0x149c6c){const _0x10df5c=this['_el']('ibmi-sync-library')?.['value']?.['trim']();if(!_0x10df5c){this['showError']('IBM\x20i\x20library\x20name\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-library')?.['focus']();return;}if(this['_syncFileTree']){const _0x8fa339=this['_syncFileTree']['getSelectedFiles']();if(_0x8fa339['length']===0x0){this['showError']('Select\x20at\x20least\x20one\x20file\x20to\x20sync');return;}}if(this['taskData']?.['syncCredentials']==='prompt'){const _0x556e02=this['_el']('ibmi-sync-user')?.['value']?.['trim']();if(!_0x556e02){this['showError']('User\x20profile\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-user')?.['focus']();return;}const _0x26c088=this['_el']('ibmi-sync-password')?.['value'];if(!_0x26c088){this['showError']('Password\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-password')?.['focus']();return;}}}const _0x61fe2e=_0x7bbba9?.['textContent']||'Commit\x20Changes';_0x7bbba9&&(_0x7bbba9['disabled']=!![],_0x55ce68?_0x7bbba9['textContent']='Creating\x20branch\x20&\x20committing...':_0x7bbba9['textContent']=_0x2f8d8d?'Pulling\x20&\x20Committing...':'Committing...');try{const _0x570bce={'commit_message':_0x528e8c,'pull':_0x2f8d8d,'push':_0x3d5c80,'conflict_strategy':'rebase'};_0x55ce68&&_0x349d32&&(_0x570bce['new_branch']=_0x349d32);let _0x8073ee=null;this['onApprove']&&(_0x8073ee=await this['onApprove'](this['taskData']['taskId'],_0x570bce));let _0x89ea3a='Changes\x20committed';if(_0x55ce68)_0x89ea3a='Changes\x20committed\x20to\x20new\x20branch\x20\x27'+_0x349d32+'\x27',_0x3d5c80&&(_0x89ea3a+='\x20and\x20pushed');else{if(_0x2f8d8d&&_0x3d5c80)_0x89ea3a='Changes\x20pulled,\x20committed,\x20and\x20pushed';else{if(_0x2f8d8d)_0x89ea3a='Changes\x20pulled\x20and\x20committed';else _0x3d5c80&&(_0x89ea3a='Changes\x20committed\x20and\x20pushed');}}const _0x1396ff=this['_el']('sync-to-ibmi')?.['checked'];let _0x1362ec=null,_0x538b56=null,_0x27f825=null,_0x15a1f7=null;if(_0x1396ff&&this['onSyncToIbmi']){_0x1362ec=this['_el']('ibmi-sync-library')?.['value']?.['trim']()?.['toUpperCase'](),_0x538b56=this['_el']('ibmi-sync-user')?.['value']?.['trim']()?.['toUpperCase']()||null,_0x27f825=this['_el']('ibmi-sync-password')?.['value']||null;if(this['_syncFileTree']&&this['_syncRelativeFiles']&&this['_syncAbsolutePaths']){const _0x5d09a1=this['_syncFileTree']['getSelectedFiles']();_0x15a1f7=_0x5d09a1['map'](_0x40c478=>{const _0x11c6b7=this['_syncRelativeFiles']['indexOf'](_0x40c478);return _0x11c6b7>=0x0?this['_syncAbsolutePaths'][_0x11c6b7]:_0x40c478;});}}this['showToast'](_0x89ea3a,'success'),this['hide']();if(this['_createPR']&&this['onCreatePR'])try{await this['onCreatePR'](this['taskData']['taskId'],_0x8073ee||{});}catch(_0x4bc9cb){console['warn']('PR\x20creation\x20failed\x20or\x20cancelled:',_0x4bc9cb);}if(_0x1396ff&&this['onSyncToIbmi']&&_0x1362ec){localStorage['setItem']('coderflow_ibmi_sync_library',_0x1362ec);if(_0x538b56)localStorage['setItem']('coderflow_ibmi_sync_user',_0x538b56);try{await this['onSyncToIbmi'](this['taskData']['taskId'],_0x1362ec,_0x538b56,_0x27f825,_0x15a1f7);}catch(_0x1b3d38){this['showToast']('Sync\x20failed:\x20'+_0x1b3d38['message'],'error');}}this['onSuccess']&&this['onSuccess'](this['taskData']);}catch(_0x764007){console['error']('Failed\x20to\x20approve\x20changes',_0x764007);if(_0x764007['hasConflicts'])this['_showConflictResolution']();else _0x764007['code']==='container_token_expired'?this['showError'](_0x764007['message']||'This\x20task\x27s\x20Git\x20credentials\x20have\x20expired.\x20Start\x20a\x20new\x20task\x20to\x20continue\x20making\x20changes.'):this['showError']('Failed\x20to\x20commit:\x20'+_0x764007['message']);_0x7bbba9&&(_0x7bbba9['disabled']=![],_0x7bbba9['textContent']=_0x61fe2e),this['onError']&&this['onError'](_0x764007);}}['isVisible'](){const _0x1fd6b3=this['_el']('approve-modal');return _0x1fd6b3&&!_0x1fd6b3['hidden'];}['destroy'](){const _0x1502ca=this['_el']('approve-modal');_0x1502ca&&_0x1502ca['remove'](),this['initialized']=![];}}export function getApproveState(_0x9a86d9,_0x67524e){if(!_0x9a86d9)return{'canApprove':![],'reason':'No\x20task\x20data'};if(isLogOnlyTaskType(_0x9a86d9['taskType']))return{'canApprove':![],'reason':(_0x9a86d9['taskType']==='test'?'Test':'Deploy')+'\x20tasks\x20cannot\x20be\x20approved'};const _0x54bf22=_0x67524e?.['repos_changed']?.['length']>0x0,_0x37ceb5=_0x9a86d9['status']==='completed'||_0x9a86d9['status']==='failed'||_0x9a86d9['status']==='interrupted',_0x13122a=_0x9a86d9['containerState']==='running',_0x57ab1e=_0x9a86d9['approvedBy']!==undefined&&_0x9a86d9['approvedBy']!==null;if(_0x57ab1e){const _0x3a7b3c=_0x9a86d9['approvedBy']['name']||_0x9a86d9['approvedBy']['username']||'user';return{'canApprove':![],'reason':'Already\x20approved\x20by\x20'+_0x3a7b3c};}if(!_0x54bf22)return{'canApprove':![],'reason':'No\x20changes\x20to\x20approve'};if(!_0x37ceb5)return{'canApprove':![],'reason':'Task\x20must\x20complete\x20first'};if(!_0x9a86d9['containerId'])return{'canApprove':![],'reason':'Container\x20no\x20longer\x20available'};if(!_0x13122a)return{'canApprove':![],'reason':'Container\x20is\x20not\x20running'};return{'canApprove':!![],'reason':'Ready\x20to\x20approve'};}
|
|
1
|
+
function isLogOnlyTaskType(_0x7d992d){return _0x7d992d==='test'||_0x7d992d==='deploy';}export function createApproveDialogHTML(_0x5b0f63='',_0x15596a={}){const _0x2acb71=_0x5b0f63,_0x3334f0=_0x15596a['useTaskPageStyles']?'modal\x20profound-approve-modal':'profound-feedback-modal\x20profound-approve-modal',_0x5d52ac=_0x15596a['useTaskPageStyles']?'modal-warning':'approve-modal-warning',_0x20ed93=_0x15596a['useTaskPageStyles']?'modal-error':'approve-modal-error';return'\x0a\x20\x20\x20\x20<div\x20id=\x22'+_0x2acb71+'approve-modal\x22\x20class=\x22'+_0x3334f0+'\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'+_0x2acb71+'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'+_0x2acb71+'approve-warning\x22\x20class=\x22'+_0x5d52ac+'\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'+_0x2acb71+'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'+_0x2acb71+'approve-error\x22\x20class=\x22'+_0x20ed93+'\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'+_0x2acb71+'approve-error-text\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20id=\x22'+_0x2acb71+'conflict-resolution\x22\x20class=\x22conflict-resolution-panel\x22\x20hidden>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22conflict-resolution-message\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22warning-icon\x22>!</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Remote\x20has\x20conflicting\x20changes\x20that\x20couldn\x27t\x20be\x20merged\x20automatically.</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22conflict-resolution-options\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x20btn-small\x22\x20id=\x22'+_0x2acb71+'conflict-agent-resolve\x22>Let\x20the\x20agent\x20resolve\x20conflicts</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22>The\x20agent\x20will\x20pull\x20remote\x20changes,\x20resolve\x20conflicts,\x20and\x20prepare\x20for\x20re-approval.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-secondary\x20btn-small\x22\x20id=\x22'+_0x2acb71+'conflict-new-branch\x22>Create\x20a\x20new\x20branch\x20instead</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20class=\x22field-hint\x22>Avoids\x20the\x20conflict\x20by\x20committing\x20to\x20a\x20separate\x20branch.</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-secondary\x20btn-small\x22\x20id=\x22'+_0x2acb71+'conflict-cancel\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-info\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'commit-message-input\x22>Commit\x20message:</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<textarea\x20id=\x22'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'pull-before-commit\x22\x20checked>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Pull\x20from\x20remote\x20after\x20commit</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'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'+_0x2acb71+'cancel-approve\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x22\x20id=\x22'+_0x2acb71+'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(_0x194ee8={}){this['prefix']=_0x194ee8['prefix']||'',this['onApprove']=_0x194ee8['onApprove'],this['onSync']=_0x194ee8['onSync'],this['onSuccess']=_0x194ee8['onSuccess'],this['onError']=_0x194ee8['onError'],this['onCreatePR']=_0x194ee8['onCreatePR'],this['showToast']=_0x194ee8['showToast']||(()=>{}),this['container']=_0x194ee8['container']||document['body'],this['useTaskPageStyles']=_0x194ee8['useTaskPageStyles']||![],this['baseUrl']=_0x194ee8['baseUrl']||'',this['coderflowAttribution']=_0x194ee8['coderflowAttribution'],this['onConflictFollowUp']=_0x194ee8['onConflictFollowUp']||null,this['onSyncToIbmi']=_0x194ee8['onSyncToIbmi']||null,this['onGetSyncFiles']=_0x194ee8['onGetSyncFiles']||null,this['taskData']=null,this['initialized']=![],this['isSyncing']=![],this['_createPR']=![],this['_attributionRequestId']=0x0,this['_syncFileTree']=null,this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null,this['_transientWarning']='';}['init'](){if(this['initialized'])return;const _0x34ea08=document['createElement']('div');_0x34ea08['innerHTML']=createApproveDialogHTML(this['prefix'],{'useTaskPageStyles':this['useTaskPageStyles']}),this['container']['appendChild'](_0x34ea08['firstElementChild']),this['_bindEvents'](),this['initialized']=!![];}['_el'](_0x317c8b){return document['getElementById'](''+this['prefix']+_0x317c8b);}['_bindEvents'](){const _0xd00a66=this['_el']('approve-modal'),_0x341209=this['_el']('close-approve-modal'),_0x240231=this['_el']('cancel-approve'),_0x18c73b=this['_el']('confirm-approve'),_0x2c84c2=_0xd00a66?.['querySelector']('.modal-overlay'),_0x3d0632=this['_el']('pull-before-commit'),_0x4659dd=this['_el']('create-new-branch'),_0x4955f1=this['_el']('new-branch-input-container'),_0x177b7f=this['_el']('new-branch-name'),_0x26e8ac=this['_el']('push-after-commit'),_0x1200c7=this['_el']('create-pull-request'),_0x2bf49d=this['_el']('pr-hint'),_0x3c843b=()=>{this['_refreshWarningBanner']();};_0x341209?.['addEventListener']('click',()=>this['hide']()),_0x240231?.['addEventListener']('click',()=>this['hide']()),_0x2c84c2?.['addEventListener']('click',()=>this['hide']()),_0x18c73b?.['addEventListener']('click',()=>this['_handleApprove']());_0x4659dd&&_0x4659dd['addEventListener']('change',()=>{_0x4955f1&&(_0x4955f1['hidden']=!_0x4659dd['checked']),_0x4659dd['checked']&&_0x177b7f&&_0x177b7f['focus'](),_0x3c843b();});_0x3d0632?.['addEventListener']('change',()=>{_0x3c843b();});_0x1200c7&&_0x26e8ac&&_0x4659dd&&(_0x1200c7['addEventListener']('change',()=>{this['_createPR']=_0x1200c7['checked'];if(_0x1200c7['checked']){_0x26e8ac['checked']=!![],_0x26e8ac['disabled']=!![],_0x4659dd['checked']=!![],_0x4659dd['disabled']=!![];_0x4955f1&&(_0x4955f1['hidden']=![]);if(_0x2bf49d)_0x2bf49d['hidden']=![];}else{_0x26e8ac['disabled']=![],_0x4659dd['disabled']=![];if(_0x2bf49d)_0x2bf49d['hidden']=!![];}_0x3c843b();}),_0x26e8ac['addEventListener']('change',()=>{if(!_0x26e8ac['checked']&&_0x1200c7['checked']){_0x1200c7['checked']=![],this['_createPR']=![],_0x26e8ac['disabled']=![],_0x4659dd['disabled']=![];if(_0x2bf49d)_0x2bf49d['hidden']=!![];}}));_0x3c843b();const _0x466ae9=this['_el']('sync-to-ibmi');_0x466ae9&&_0x466ae9['addEventListener']('change',async _0x231119=>{const _0x515495=this['_el']('ibmi-sync-fields');if(_0x515495)_0x515495['hidden']=!_0x231119['target']['checked'];if(_0x231119['target']['checked']){const _0x5aa9f5=this['_el']('ibmi-sync-library'),_0x5422ec=localStorage['getItem']('coderflow_ibmi_sync_library');_0x5422ec&&_0x5aa9f5&&!_0x5aa9f5['value']&&(_0x5aa9f5['value']=_0x5422ec);const _0x3bcefc=this['_el']('ibmi-sync-user');if(_0x3bcefc&&!_0x3bcefc['value']){const _0x191a81=localStorage['getItem']('coderflow_ibmi_sync_user');if(_0x191a81)_0x3bcefc['value']=_0x191a81;}const _0x2f8434=this['_el']('ibmi-sync-password');if(_0x2f8434)_0x2f8434['value']='';!this['_syncFileTree']&&this['onGetSyncFiles']&&this['taskData']?.['taskId']&&await this['_loadSyncFileTree']();}}),this['_el']('conflict-agent-resolve')?.['addEventListener']('click',()=>{this['onConflictFollowUp']&&this['onConflictFollowUp'](this['taskData']['taskId']),this['hide'](),this['showToast']('Agent\x20is\x20resolving\x20conflicts.\x20Re-approve\x20when\x20it\x20finishes.','info');}),this['_el']('conflict-new-branch')?.['addEventListener']('click',()=>{this['_hideConflictResolution']();const _0x243526=this['_el']('create-new-branch'),_0x5ec8a3=this['_el']('new-branch-input-container'),_0x30e3ea=this['_el']('new-branch-name');if(_0x243526)_0x243526['checked']=!![];if(_0x5ec8a3)_0x5ec8a3['hidden']=![];if(_0x30e3ea)_0x30e3ea['focus']();_0x3c843b();}),this['_el']('conflict-cancel')?.['addEventListener']('click',()=>this['hide']()),document['addEventListener']('keydown',_0x144f7d=>{_0x144f7d['key']==='Escape'&&_0xd00a66&&!_0xd00a66['hidden']&&this['hide']();});}async['_loadSyncFileTree'](){const _0x4a1bae=this['_el']('ibmi-sync-file-tree'),_0x5cf365=this['_el']('ibmi-sync-files-summary');if(!_0x4a1bae)return;_0x4a1bae['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>Loading\x20files...</span>';if(_0x5cf365)_0x5cf365['textContent']='';try{const {files:_0x5f1fbc,absolutePaths:_0xf11ca6}=await this['onGetSyncFiles'](this['taskData']['taskId']);this['_syncRelativeFiles']=_0x5f1fbc,this['_syncAbsolutePaths']=_0xf11ca6;if(_0x5f1fbc['length']===0x0){_0x4a1bae['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>No\x20changed\x20files\x20found.</span>';return;}const {FileSelectionTree:_0x10c425}=await import('./file-selection-tree.js'),{validateIbmiFile:_0x482d22,hasKnownIbmiExtension:_0x4ee12d}=await import('./ibmi-file-filter.js');this['_syncFileTree']=new _0x10c425({'container':_0x4a1bae,'files':_0x5f1fbc,'isPreselected':_0x29c50f=>{const {valid:_0x100404}=_0x482d22(_0x29c50f);return _0x100404&&_0x4ee12d(_0x29c50f);},'isDisabled':_0x47c044=>{const {valid:_0x2e7ec3,reason:_0x366b9a}=_0x482d22(_0x47c044);return{'disabled':!_0x2e7ec3,'reason':_0x366b9a};},'isAutoCheckEligible':_0x44aff5=>{const {valid:_0x1e0fb8}=_0x482d22(_0x44aff5);return _0x1e0fb8&&_0x4ee12d(_0x44aff5);},'onChange':_0x4b06bb=>{_0x5cf365&&(_0x5cf365['textContent']=_0x4b06bb['length']+'\x20of\x20'+_0x5f1fbc['length']+'\x20file'+(_0x5f1fbc['length']!==0x1?'s':'')+'\x20selected');}}),this['_syncFileTree']['render']();}catch(_0x37fe8c){_0x4a1bae['innerHTML']='<span\x20style=\x22color:\x20var(--color-danger,\x20#e55368);\x20font-size:\x2013px;\x22>Failed\x20to\x20load\x20files</span>';}}['showError'](_0x5b2be3){const _0x30deed=this['_el']('approve-error'),_0x545145=this['_el']('approve-error-text');_0x30deed&&_0x545145&&(_0x545145['textContent']=_0x5b2be3,_0x30deed['hidden']=![],_0x30deed['scrollIntoView']({'behavior':'smooth','block':'nearest'}));}['hideError'](){const _0x12e6a7=this['_el']('approve-error'),_0x508e92=this['_el']('approve-error-text');_0x12e6a7&&_0x508e92&&(_0x12e6a7['hidden']=!![],_0x508e92['textContent']='');}['_displayBranchInfo'](_0x2ea0d9,_0xdd19a5={}){const _0x10e623=this['_el']('approve-branches');if(!_0x10e623)return;const _0x549c6a=[];for(const _0x27a34e of _0x2ea0d9){_0xdd19a5[_0x27a34e['name']]&&_0x549c6a['push']({'repo':_0x27a34e['name'],'branch':_0xdd19a5[_0x27a34e['name']]});}if(_0x549c6a['length']>0x0){_0x10e623['hidden']=![];if(_0x549c6a['length']===0x1)_0x10e623['innerHTML']='<div\x20class=\x22branch-info\x22>Branch:\x20<code>'+_0x549c6a[0x0]['branch']+'</code></div>';else{const _0x146b18=_0x549c6a['map'](_0x42ba75=>'<div\x20class=\x22branch-item\x22><strong>'+_0x42ba75['repo']+':</strong>\x20<code>'+_0x42ba75['branch']+'</code></div>')['join']('');_0x10e623['innerHTML']='<div\x20class=\x22branch-info\x22>Branches:<div\x20class=\x22branch-list\x22>'+_0x146b18+'</div></div>';}}else _0x10e623['hidden']=!![],_0x10e623['innerHTML']='';}['showWarning'](_0xd86db1){const _0x3dde7d=this['_el']('approve-warning'),_0x350d7a=this['_el']('approve-warning-text');_0x3dde7d&&_0x350d7a&&(_0x350d7a['textContent']=_0xd86db1,_0x3dde7d['hidden']=![]);}['hideWarning'](){const _0x919861=this['_el']('approve-warning'),_0x2c019b=this['_el']('approve-warning-text');_0x919861&&_0x2c019b&&(_0x919861['hidden']=!![],_0x2c019b['textContent']='');}['_showConflictResolution'](){const _0x7d3266=this['_el']('conflict-resolution'),_0xa8863=this['_el']('confirm-approve'),_0x2e2afb=this['_el']('cancel-approve'),_0x13c40c=this['_el']('conflict-agent-resolve');if(_0x7d3266)_0x7d3266['hidden']=![];if(_0xa8863)_0xa8863['hidden']=!![];if(_0x2e2afb)_0x2e2afb['hidden']=!![];const _0x1921ea=this['_el']('approve-modal');if(_0x1921ea){this['_sectionsHiddenBeforeConflict']=new Set();for(const _0x5275cb of _0x1921ea['querySelectorAll']('.modal-section')){_0x5275cb['hidden']&&this['_sectionsHiddenBeforeConflict']['add'](_0x5275cb),_0x5275cb['hidden']=!![];}}if(_0x13c40c){const _0x290bc2=!!this['onConflictFollowUp'];_0x13c40c['hidden']=!_0x290bc2,_0x13c40c['nextElementSibling']?.['classList']['contains']('field-hint')&&(_0x13c40c['nextElementSibling']['hidden']=!_0x290bc2);}}['_hideConflictResolution'](){const _0x1cd426=this['_el']('conflict-resolution'),_0x1d4321=this['_el']('confirm-approve'),_0x3c2975=this['_el']('cancel-approve');if(_0x1cd426)_0x1cd426['hidden']=!![];if(_0x1d4321)_0x1d4321['hidden']=![];if(_0x3c2975)_0x3c2975['hidden']=![];const _0x237379=this['_el']('approve-modal');if(_0x237379){const _0x2ba110=this['_sectionsHiddenBeforeConflict']||new Set();for(const _0x52734c of _0x237379['querySelectorAll']('.modal-section')){!_0x2ba110['has'](_0x52734c)&&(_0x52734c['hidden']=![]);}this['_sectionsHiddenBeforeConflict']=null;}}['_getRemoteConflictWarning'](){const _0x2003f6=this['taskData']?.['reposChanged']||[],_0xae05a1=this['_el']('pull-before-commit')?.['checked']??!![],_0x4416e5=this['_el']('create-new-branch')?.['checked']||![];if(!_0xae05a1||_0x4416e5||_0x2003f6['length']===0x0)return'';const _0x3abdf0=_0x2003f6['filter'](_0x315b46=>_0x315b46?.['upstream_status']==='behind'||_0x315b46?.['upstream_status']==='diverged');if(_0x3abdf0['length']===0x0)return'';const _0x5f2b9a=_0x3abdf0['map'](_0x457b13=>{const _0x41aea7=Number(_0x457b13?.['upstream_behind'])||0x0,_0x41348b=_0x41aea7+'\x20commit'+(_0x41aea7===0x1?'':'s')+'\x20ahead';if(_0x457b13['upstream_status']==='diverged')return _0x457b13['name']+':\x20remote\x20is\x20'+_0x41348b+'\x20and\x20the\x20tracked\x20branch\x20has\x20local\x20commits';return _0x457b13['name']+':\x20remote\x20is\x20'+_0x41348b;})['join'](';\x20');return'Remote\x20has\x20new\x20changes\x20('+_0x5f2b9a+').\x20If\x20there\x20are\x20conflicts,\x20you\x27ll\x20be\x20given\x20options\x20to\x20resolve\x20them.';}['_refreshWarningBanner'](){const _0x50a988=[this['taskData']?.['warning']||'',this['_getRemoteConflictWarning'](),this['_transientWarning']||'']['filter'](Boolean);if(_0x50a988['length']>0x0){this['showWarning'](_0x50a988['join']('\x20'));return;}this['hideWarning']();}['_stripCoAuthoredByLines'](_0x3c0169){return _0x3c0169['replace'](/^Co-Authored-By:.*$/gmi,'')['replace'](/^Learn more: https:\/\/coderflow\.ai\s*$/gm,'')['replace'](/\n{3,}/g,'\x0a\x0a')['trim']();}async['_addAttributionIfEnabled'](_0x37b6e8){try{let _0x4b1216;try{const _0x2f45fa=await fetch(this['baseUrl']+'/settings');if(_0x2f45fa['ok']){const _0x594ac8=await _0x2f45fa['json']();_0x4b1216=_0x594ac8['coderflow_attribution']!==![];}}catch(_0x676a62){}_0x4b1216===undefined&&(this['coderflowAttribution']!==undefined?_0x4b1216=this['coderflowAttribution']!==![]:_0x4b1216=!![]);const _0x4679d1=this['_stripCoAuthoredByLines'](_0x37b6e8);if(!_0x4b1216)return _0x4679d1;const _0x14609b='\x0a\x0aCo-Authored-By:\x20CoderFlow\x20<ai@coderflow.ai>\x0aLearn\x20more:\x20https://coderflow.ai';return _0x4679d1+_0x14609b;}catch(_0x3475a3){return console['warn']('Failed\x20to\x20add\x20CoderFlow\x20attribution:',_0x3475a3),_0x37b6e8;}}['show'](_0xe716a2){!this['initialized']&&this['init']();this['taskData']=_0xe716a2;const _0x233905=this['_el']('approve-modal'),_0x308597=this['_el']('commit-message-input'),_0x5ad54a=this['_el']('pull-before-commit'),_0x414a88=this['_el']('push-after-commit'),_0x598d6a=this['_el']('create-new-branch'),_0x5ea925=this['_el']('new-branch-input-container'),_0x5caee7=this['_el']('new-branch-name');if(!_0x233905)return;this['hideError'](),this['hideWarning'](),this['_hideConflictResolution'](),this['_transientWarning']='';const _0x4f4ec3=_0xe716a2['reposChanged']||[];if(_0x4f4ec3['length']===0x0&&!_0xe716a2['syncFirst']){this['showToast']('No\x20changes\x20to\x20approve','error');return;}this['_updateDisplay'](_0x4f4ec3,_0xe716a2);const _0x3cb85b=_0xe716a2['commitMessage']||'',_0x4d0f6e=this['_stripCoAuthoredByLines'](_0x3cb85b);_0x308597['value']=_0x4d0f6e;if(_0x5ad54a)_0x5ad54a['checked']=!![];if(_0x414a88)_0x414a88['checked']=!![];_0x598d6a&&(_0x598d6a['checked']=![]);_0x5ea925&&(_0x5ea925['hidden']=!![]);_0x5caee7&&(_0x5caee7['value']='');if(_0x414a88)_0x414a88['disabled']=![];if(_0x598d6a)_0x598d6a['disabled']=![];this['_refreshWarningBanner'](),this['updatePRSupport'](_0xe716a2['prSupported']===!![]);const _0x168150=this['_el']('ibmi-sync-section');if(_0x168150){_0x168150['hidden']=!_0xe716a2['ibmiSyncAvailable'];const _0x3823c4=this['_el']('sync-to-ibmi'),_0x39fb4b=this['_el']('ibmi-sync-fields'),_0x4d3845=this['_el']('ibmi-sync-library');if(_0x3823c4)_0x3823c4['checked']=![];if(_0x39fb4b)_0x39fb4b['hidden']=!![];if(_0x4d3845)_0x4d3845['value']='';const _0x11718c=this['_el']('ibmi-sync-credentials-row');_0x11718c&&(_0x11718c['hidden']=!(_0xe716a2['ibmiSyncAvailable']&&_0xe716a2['syncCredentials']==='prompt'));}const _0x5e5847=this['_el']('confirm-approve');_0xe716a2['syncFirst']&&this['onSync']?(_0x5e5847&&(_0x5e5847['disabled']=!![],_0x5e5847['textContent']='Syncing...'),this['_performSync']()):_0x5e5847&&(_0x5e5847['disabled']=![],_0x5e5847['textContent']='Commit\x20Changes');_0x233905['hidden']=![];const _0x5bc209=++this['_attributionRequestId'];void this['_applyAttributionAsync']({'requestId':_0x5bc209,'taskId':_0xe716a2['taskId'],'originalCommitMessage':_0x4d0f6e}),setTimeout(()=>{_0x308597['focus'](),_0x308597['setSelectionRange'](0x0,_0x308597['value']['length']);},0x64);}['updatePRSupport'](_0x4e1139){const _0x133df9=this['_el']('pr-option-section'),_0x15a9b1=this['_el']('create-pull-request'),_0x511066=this['_el']('pr-hint'),_0x32cfd7=this['_el']('push-after-commit'),_0x24ea23=this['_el']('create-new-branch');if(!_0x133df9)return;if(_0x4e1139){_0x133df9['hidden']=![];_0x15a9b1&&!_0x15a9b1['disabled']&&(_0x15a9b1['checked']=![]);if(_0x511066)_0x511066['hidden']=!![];this['_createPR']=![];return;}_0x15a9b1?.['checked']&&(_0x15a9b1['checked']=![]);if(_0x511066)_0x511066['hidden']=!![];if(_0x32cfd7)_0x32cfd7['disabled']=![];if(_0x24ea23)_0x24ea23['disabled']=![];this['_createPR']=![],_0x133df9['hidden']=!![];}async['_applyAttributionAsync']({requestId:_0x8aa117,taskId:_0x4bb59a,originalCommitMessage:_0x14fbe2}){const _0x462e28=this['_el']('commit-message-input');if(!_0x462e28)return;const _0x5ed8ea=await this['_addAttributionIfEnabled'](_0x14fbe2);if(_0x8aa117!==this['_attributionRequestId'])return;if(!this['taskData']||this['taskData']['taskId']!==_0x4bb59a)return;if(!this['isVisible']())return;const _0x532e21=_0x28b889=>_0x28b889['replace'](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a');if(_0x532e21(_0x462e28['value'])!==_0x532e21(_0x14fbe2))return;_0x462e28['value']=_0x5ed8ea;}['_updateDisplay'](_0x529d74,_0x1d0980){const _0x1f8abc=this['_el']('approve-repo-name'),_0x54cf10=this['_el']('approve-stats'),_0x1145eb=this['_el']('multi-repo-note');if(_0x529d74['length']===0x0){if(_0x1f8abc)_0x1f8abc['textContent']='Syncing...';if(_0x54cf10)_0x54cf10['textContent']='';if(_0x1145eb)_0x1145eb['hidden']=!![];return;}const _0x3cbeb4=_0x529d74['reduce']((_0x1ea025,_0x2e443e)=>_0x1ea025+(_0x2e443e['files_changed']||0x0),0x0),_0x13e8d3=_0x529d74['reduce']((_0x3679ba,_0x537d2b)=>_0x3679ba+(_0x537d2b['lines_added']||0x0),0x0),_0x579672=_0x529d74['reduce']((_0x1347a2,_0x56fafd)=>_0x1347a2+(_0x56fafd['lines_deleted']||0x0),0x0);if(_0x529d74['length']===0x1){if(_0x1f8abc)_0x1f8abc['textContent']=_0x529d74[0x0]?.['name']||'repository';if(_0x1145eb)_0x1145eb['hidden']=!![];}else{const _0x202d85=_0x529d74['map'](_0x2c6454=>_0x2c6454['name'])['join'](',\x20');if(_0x1f8abc)_0x1f8abc['textContent']=_0x529d74['length']+'\x20repositories:\x20'+_0x202d85;if(_0x1145eb)_0x1145eb['hidden']=![];}_0x54cf10&&(_0x54cf10['textContent']=_0x3cbeb4+'\x20file'+(_0x3cbeb4===0x1?'':'s')+'\x20changed\x20(+'+_0x13e8d3+'\x20-'+_0x579672+')'),this['_displayBranchInfo'](_0x529d74,_0x1d0980?.['branches']||{});}async['_performSync'](){if(!this['onSync']||this['isSyncing'])return;this['isSyncing']=!![];const _0x2a8bc1=this['_el']('confirm-approve');try{const _0x3b4756=await this['onSync'](this['taskData']['taskId']);if(!this['isVisible']()){this['isSyncing']=![];return;}if(_0x3b4756['repos_changed']){const _0x2e43b4=this['taskData']['reposChanged']?.['length']||0x0,_0x463376=this['taskData']['reposChanged']?.['reduce']((_0x31bf87,_0x3b6faa)=>_0x31bf87+(_0x3b6faa['files_changed']||0x0),0x0)||0x0;this['taskData']['reposChanged']=_0x3b4756['repos_changed'];if(_0x3b4756['current_branches']){const _0x873b69={...this['taskData']['branches']||{}};for(const [_0x27414,_0x35b6c8]of Object['entries'](_0x3b4756['current_branches'])){_0x35b6c8?_0x873b69[_0x27414]=_0x35b6c8:delete _0x873b69[_0x27414];}this['taskData']['branches']=_0x873b69;}this['_updateDisplay'](_0x3b4756['repos_changed'],this['taskData']);const _0x15ae31=_0x3b4756['repos_changed']['length'],_0x2e2bdf=_0x3b4756['repos_changed']['reduce']((_0x5bd8f6,_0x5dd624)=>_0x5bd8f6+(_0x5dd624['files_changed']||0x0),0x0);(_0x2e2bdf>_0x463376||_0x15ae31>_0x2e43b4)&&(this['_transientWarning']='Additional\x20changes\x20detected\x20since\x20last\x20sync.\x20Review\x20the\x20updated\x20file\x20list.'),this['_refreshWarningBanner']();}_0x2a8bc1&&(!this['taskData']['reposChanged']||this['taskData']['reposChanged']['length']===0x0?(_0x2a8bc1['disabled']=!![],_0x2a8bc1['textContent']='No\x20Changes',this['showError']('No\x20changes\x20to\x20approve\x20after\x20sync')):(_0x2a8bc1['disabled']=![],_0x2a8bc1['textContent']='Commit\x20Changes'));}catch(_0x461981){console['error']('Failed\x20to\x20sync\x20repos\x20before\x20approve:',_0x461981);if(!this['isVisible']()){this['isSyncing']=![];return;}this['showError']('Sync\x20failed:\x20'+_0x461981['message']+'.\x20You\x20can\x20still\x20commit\x20with\x20existing\x20staged\x20changes.'),_0x2a8bc1&&(this['taskData']['reposChanged']&&this['taskData']['reposChanged']['length']>0x0?(_0x2a8bc1['disabled']=![],_0x2a8bc1['textContent']='Commit\x20Changes'):(_0x2a8bc1['disabled']=!![],_0x2a8bc1['textContent']='No\x20Changes'));}finally{this['isSyncing']=![];}}['hide'](){const _0x5420ae=this['_el']('approve-modal');_0x5420ae&&(_0x5420ae['hidden']=!![]),this['_syncFileTree']&&(this['_syncFileTree']['destroy'](),this['_syncFileTree']=null),this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}async['_handleApprove'](){const _0x1d638e=this['_el']('commit-message-input'),_0x5be449=this['_el']('pull-before-commit'),_0x3081d9=this['_el']('push-after-commit'),_0x1a4369=this['_el']('create-new-branch'),_0x193306=this['_el']('new-branch-name'),_0x942704=this['_el']('confirm-approve'),_0x2eb575=_0x1d638e['value']['trim'](),_0x4d9c50=_0x5be449?.['checked']??!![],_0x274d65=_0x3081d9?.['checked']??!![],_0x5506c9=_0x1a4369?.['checked']||![],_0x47b3dc=_0x193306?.['value']['trim']()||'';this['hideError']();if(!_0x2eb575){this['showError']('Commit\x20message\x20is\x20required'),_0x1d638e['focus']();return;}if(_0x5506c9&&!_0x47b3dc){this['showError']('Branch\x20name\x20is\x20required\x20when\x20creating\x20a\x20new\x20branch'),_0x193306?.['focus']();return;}if(_0x5506c9&&_0x47b3dc){const _0x1bae04=/[\s~^:?*\[\\]/;if(_0x1bae04['test'](_0x47b3dc)){this['showError']('Invalid\x20branch\x20name.\x20Avoid\x20spaces\x20and\x20special\x20characters\x20like\x20~\x20^\x20:\x20?\x20*\x20[\x20\x5c'),_0x193306?.['focus']();return;}}const _0x5e4cdf=this['_el']('sync-to-ibmi')?.['checked'];if(_0x5e4cdf){const _0x24abe8=this['_el']('ibmi-sync-library')?.['value']?.['trim']();if(!_0x24abe8){this['showError']('IBM\x20i\x20library\x20name\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-library')?.['focus']();return;}if(this['_syncFileTree']){const _0x1da147=this['_syncFileTree']['getSelectedFiles']();if(_0x1da147['length']===0x0){this['showError']('Select\x20at\x20least\x20one\x20file\x20to\x20sync');return;}}if(this['taskData']?.['syncCredentials']==='prompt'){const _0x430307=this['_el']('ibmi-sync-user')?.['value']?.['trim']();if(!_0x430307){this['showError']('User\x20profile\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-user')?.['focus']();return;}const _0x2e92cc=this['_el']('ibmi-sync-password')?.['value'];if(!_0x2e92cc){this['showError']('Password\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-password')?.['focus']();return;}}}const _0x35ee54=_0x942704?.['textContent']||'Commit\x20Changes';_0x942704&&(_0x942704['disabled']=!![],_0x5506c9?_0x942704['textContent']='Creating\x20branch\x20&\x20committing...':_0x942704['textContent']=_0x4d9c50?'Pulling\x20&\x20Committing...':'Committing...');try{const _0xc98c54={'commit_message':_0x2eb575,'pull':_0x4d9c50,'push':_0x274d65,'conflict_strategy':'rebase'};_0x5506c9&&_0x47b3dc&&(_0xc98c54['new_branch']=_0x47b3dc);let _0x3c0856=null;this['onApprove']&&(_0x3c0856=await this['onApprove'](this['taskData']['taskId'],_0xc98c54));let _0x200b8f='Changes\x20committed';if(_0x5506c9)_0x200b8f='Changes\x20committed\x20to\x20new\x20branch\x20\x27'+_0x47b3dc+'\x27',_0x274d65&&(_0x200b8f+='\x20and\x20pushed');else{if(_0x4d9c50&&_0x274d65)_0x200b8f='Changes\x20pulled,\x20committed,\x20and\x20pushed';else{if(_0x4d9c50)_0x200b8f='Changes\x20pulled\x20and\x20committed';else _0x274d65&&(_0x200b8f='Changes\x20committed\x20and\x20pushed');}}const _0x3b2662=this['_el']('sync-to-ibmi')?.['checked'];let _0x1c1889=null,_0x1d036c=null,_0xed055c=null,_0x422ab0=null;if(_0x3b2662&&this['onSyncToIbmi']){_0x1c1889=this['_el']('ibmi-sync-library')?.['value']?.['trim']()?.['toUpperCase'](),_0x1d036c=this['_el']('ibmi-sync-user')?.['value']?.['trim']()?.['toUpperCase']()||null,_0xed055c=this['_el']('ibmi-sync-password')?.['value']||null;if(this['_syncFileTree']&&this['_syncRelativeFiles']&&this['_syncAbsolutePaths']){const _0x35c037=this['_syncFileTree']['getSelectedFiles']();_0x422ab0=_0x35c037['map'](_0x53ce34=>{const _0x10dafe=this['_syncRelativeFiles']['indexOf'](_0x53ce34);return _0x10dafe>=0x0?this['_syncAbsolutePaths'][_0x10dafe]:_0x53ce34;});}}this['showToast'](_0x200b8f,'success'),this['hide']();if(this['_createPR']&&this['onCreatePR'])try{await this['onCreatePR'](this['taskData']['taskId'],_0x3c0856||{});}catch(_0x398687){console['warn']('PR\x20creation\x20failed\x20or\x20cancelled:',_0x398687);}if(_0x3b2662&&this['onSyncToIbmi']&&_0x1c1889){localStorage['setItem']('coderflow_ibmi_sync_library',_0x1c1889);if(_0x1d036c)localStorage['setItem']('coderflow_ibmi_sync_user',_0x1d036c);try{await this['onSyncToIbmi'](this['taskData']['taskId'],_0x1c1889,_0x1d036c,_0xed055c,_0x422ab0);}catch(_0x559e97){this['showToast']('Sync\x20failed:\x20'+_0x559e97['message'],'error');}}this['onSuccess']&&this['onSuccess'](this['taskData']);}catch(_0x4aee6c){console['error']('Failed\x20to\x20approve\x20changes',_0x4aee6c);if(_0x4aee6c['hasConflicts'])this['_showConflictResolution']();else _0x4aee6c['code']==='container_token_expired'?this['showError'](_0x4aee6c['message']||'This\x20task\x27s\x20Git\x20credentials\x20have\x20expired.\x20Start\x20a\x20new\x20task\x20to\x20continue\x20making\x20changes.'):this['showError']('Failed\x20to\x20commit:\x20'+_0x4aee6c['message']);_0x942704&&(_0x942704['disabled']=![],_0x942704['textContent']=_0x35ee54),this['onError']&&this['onError'](_0x4aee6c);}}['isVisible'](){const _0x186034=this['_el']('approve-modal');return _0x186034&&!_0x186034['hidden'];}['destroy'](){const _0x2c5807=this['_el']('approve-modal');_0x2c5807&&_0x2c5807['remove'](),this['initialized']=![];}}export function getApproveState(_0x6934e5,_0x259ff6){if(!_0x6934e5)return{'canApprove':![],'reason':'No\x20task\x20data'};if(isLogOnlyTaskType(_0x6934e5['taskType']))return{'canApprove':![],'reason':(_0x6934e5['taskType']==='test'?'Test':'Deploy')+'\x20tasks\x20cannot\x20be\x20approved'};const _0x32e80d=_0x259ff6?.['repos_changed']?.['length']>0x0,_0x3f3279=_0x6934e5['status']==='completed'||_0x6934e5['status']==='failed'||_0x6934e5['status']==='interrupted',_0x55b8b9=_0x6934e5['containerState']==='running',_0x1b9697=_0x6934e5['approvedBy']!==undefined&&_0x6934e5['approvedBy']!==null;if(_0x1b9697){const _0xdec803=_0x6934e5['approvedBy']['name']||_0x6934e5['approvedBy']['username']||'user';return{'canApprove':![],'reason':'Already\x20approved\x20by\x20'+_0xdec803};}if(!_0x32e80d)return{'canApprove':![],'reason':'No\x20changes\x20to\x20approve'};if(!_0x3f3279)return{'canApprove':![],'reason':'Task\x20must\x20complete\x20first'};if(!_0x6934e5['containerId'])return{'canApprove':![],'reason':'Container\x20no\x20longer\x20available'};if(!_0x55b8b9)return{'canApprove':![],'reason':'Container\x20is\x20not\x20running'};return{'canApprove':!![],'reason':'Ready\x20to\x20approve'};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function buildAutomationEnvironmentHref(
|
|
1
|
+
export function buildAutomationEnvironmentHref(_0x36c52e,_0x193b03){const _0x46f962=new URLSearchParams();_0x36c52e&&_0x46f962['set']('env',String(_0x36c52e));_0x46f962['set']('tab','automations');_0x193b03&&_0x46f962['set']('automation',String(_0x193b03));const _0x9a25fe=_0x46f962['toString']();return'environments.html'+(_0x9a25fe?'?'+_0x9a25fe:'');}export function buildAutomationTaskFilterHref(_0x20e858){const _0x13837e=new URLSearchParams();_0x20e858&&_0x13837e['set']('automation',String(_0x20e858));const _0x28e77f=_0x13837e['toString']();return'index.html'+(_0x28e77f?'?'+_0x28e77f:'');}export function buildAutomationDeploymentHistoryHref(_0x237f2f,_0x2752fc,_0x56df72=null){const _0x2dab23=new URLSearchParams();_0x237f2f&&_0x2dab23['set']('env',String(_0x237f2f));_0x2dab23['set']('tab','deploy');_0x2752fc&&_0x2dab23['set']('profile',String(_0x2752fc));_0x56df72&&_0x2dab23['set']('deployment',String(_0x56df72));const _0x3ee813=_0x2dab23['toString']();return'environments.html'+(_0x3ee813?'?'+_0x3ee813:'');}export function parseAutomationDeepLinkParams(_0x5ae2d9=''){const _0x4639a1=new URLSearchParams(_0x5ae2d9||''),_0x5843db={'env':_0x4639a1['get']('env'),'tab':_0x4639a1['get']('tab'),'automation':_0x4639a1['get']('automation')},_0x57c926=_0x4639a1['get']('profile'),_0x18a1ce=_0x4639a1['get']('deployment');return _0x57c926!==null&&(_0x5843db['profile']=_0x57c926),_0x18a1ce!==null&&(_0x5843db['deployment']=_0x18a1ce),_0x5843db;}
|
|
@@ -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
|
+
export const AUTOMATION_MONTHLY_DAY_MIN=0x1;export const AUTOMATION_MONTHLY_DAY_MAX=0x1c;const DEFAULT_MONTHLY_DAY_TOKEN='1',DEFAULT_SCHEDULE_FORM_STATE=Object['freeze']({'frequency':'daily','dailyHour':'2','dailyMinute':'0','weeklyDay':'1','weeklyHour':'9','weeklyMinute':'0','monthlyDay':DEFAULT_MONTHLY_DAY_TOKEN,'monthlyDayToken':DEFAULT_MONTHLY_DAY_TOKEN,'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(_0x1ea1de,_0xa67c2d,_0x47c910){const _0x497f2a=Number['parseInt'](_0x1ea1de,0xa);if(!Number['isInteger'](_0x497f2a)||_0x497f2a<_0xa67c2d||_0x497f2a>_0x47c910)return null;return _0x497f2a;}export function parseAutomationMonthlyDayToken(_0x334e28){const _0xadadb4=Array['isArray'](_0x334e28)?_0x334e28['join'](','):String(_0x334e28??'')['trim']();if(!_0xadadb4)return null;const _0x4b35ef=new Set();for(const _0x516893 of _0xadadb4['split'](',')){const _0x39ad78=_0x516893['trim']();if(!_0x39ad78||!/^\d{1,2}$/['test'](_0x39ad78))return null;const _0x19d419=parseBoundedInteger(_0x39ad78,AUTOMATION_MONTHLY_DAY_MIN,AUTOMATION_MONTHLY_DAY_MAX);if(_0x19d419===null)return null;_0x4b35ef['add'](_0x19d419);}if(_0x4b35ef['size']===0x0)return null;return[..._0x4b35ef]['sort']((_0x1386a3,_0x108b5e)=>_0x1386a3-_0x108b5e)['map'](String);}function normalizeAutomationMonthlyDayToken(_0x512fa5,_0x4dea7c=DEFAULT_MONTHLY_DAY_TOKEN){const _0x56ec6a=parseAutomationMonthlyDayToken(_0x512fa5);return _0x56ec6a?_0x56ec6a['join'](','):_0x4dea7c;}function inferRecurringInterval(_0x3fad20,_0xeed59f){if(_0x3fad20==='*/15')return'*/15\x20*\x20*\x20*\x20*';if(_0x3fad20==='*/30')return'*/30\x20*\x20*\x20*\x20*';if(_0x3fad20!=='0')return'*/30\x20*\x20*\x20*\x20*';if(_0xeed59f==='*'||/^\d{1,2}-\d{1,2}$/['test'](_0xeed59f))return'0\x20*\x20*\x20*\x20*';for(const _0x426510 of RECURRING_INTERVAL_STEPS){if(_0xeed59f['startsWith']('*/'+_0x426510)||_0xeed59f['includes']('/'+_0x426510))return'0\x20*/'+_0x426510+'\x20*\x20*\x20*';}return'*/30\x20*\x20*\x20*\x20*';}function parseRecurringHourRange(_0x1257e5){const _0x436bed=String(_0x1257e5||'')['trim']()['match'](/^(\d{1,2})-(\d{1,2})(?:\/\d+)?$/);if(!_0x436bed)return{'start':'','end':''};const _0x225092=parseBoundedInteger(_0x436bed[0x1],0x0,0x17),_0x55af81=parseBoundedInteger(_0x436bed[0x2],0x0,0x17);if(_0x225092===null||_0x55af81===null||_0x225092>_0x55af81)return{'start':'','end':''};return{'start':String(_0x225092),'end':String(_0x55af81)};}export function parseAutomationScheduleToFormState(_0x1319e3){const _0x1ba7fe=String(_0x1319e3||'')['trim'](),_0x56240c=createDefaultScheduleFormState(),_0x430942=_0x1ba7fe['match'](/^(\d{1,2}) (\d{1,2}) \* \* \*$/);if(_0x430942){const _0xf8f832=parseBoundedInteger(_0x430942[0x1],0x0,0x3b),_0x3350df=parseBoundedInteger(_0x430942[0x2],0x0,0x17);if(_0xf8f832!==null&&_0x3350df!==null)return _0x56240c['frequency']='daily',_0x56240c['dailyMinute']=String(_0xf8f832),_0x56240c['dailyHour']=String(_0x3350df),_0x56240c;}const _0x51e354=_0x1ba7fe['match'](/^(\d{1,2}) (\d{1,2}) \* \* ([0-7])$/);if(_0x51e354){const _0x1a7e44=parseBoundedInteger(_0x51e354[0x1],0x0,0x3b),_0x209c4c=parseBoundedInteger(_0x51e354[0x2],0x0,0x17),_0x6941f6=parseBoundedInteger(_0x51e354[0x3],0x0,0x7);if(_0x1a7e44!==null&&_0x209c4c!==null&&_0x6941f6!==null)return _0x56240c['frequency']='weekly',_0x56240c['weeklyMinute']=String(_0x1a7e44),_0x56240c['weeklyHour']=String(_0x209c4c),_0x56240c['weeklyDay']=String(_0x6941f6===0x7?0x0:_0x6941f6),_0x56240c;}const _0x58725c=_0x1ba7fe['match'](/^(\d{1,2}) (\d{1,2}) ([^\s]+) \* \*$/);if(_0x58725c){const _0x3d32fc=parseBoundedInteger(_0x58725c[0x1],0x0,0x3b),_0x4c88dd=parseBoundedInteger(_0x58725c[0x2],0x0,0x17),_0x118dc3=parseAutomationMonthlyDayToken(_0x58725c[0x3]);if(_0x3d32fc!==null&&_0x4c88dd!==null&&_0x118dc3)return _0x56240c['frequency']='monthly',_0x56240c['monthlyMinute']=String(_0x3d32fc),_0x56240c['monthlyHour']=String(_0x4c88dd),_0x56240c['monthlyDay']=_0x118dc3[0x0],_0x56240c['monthlyDayToken']=_0x118dc3['join'](','),_0x56240c;}const _0x2c6f59=_0x1ba7fe['match'](/^(\*\/15|\*\/30|0) ([^\s]+) \* \* ([^\s]+)$/);if(_0x2c6f59){const [,_0x5377cf,_0x2ea3f8,_0x1ee077]=_0x2c6f59;_0x56240c['frequency']='recurring',_0x56240c['recurringInterval']=inferRecurringInterval(_0x5377cf,_0x2ea3f8),_0x56240c['recurringDayToken']=String(_0x1ee077||'')['trim']()||'*';const _0x1ecff6=parseRecurringHourRange(_0x2ea3f8);return _0x56240c['recurringStartHour']=_0x1ecff6['start'],_0x56240c['recurringEndHour']=_0x1ecff6['end'],_0x56240c;}return _0x56240c['frequency']='custom',_0x56240c['customCron']=_0x1ba7fe,_0x56240c;}export function buildAutomationCronFromFormState(_0x4b852b={}){const _0x4456b7=String(_0x4b852b['frequency']||'daily');if(_0x4456b7==='custom')return String(_0x4b852b['customCron']||'')['trim']();if(_0x4456b7==='daily'){const _0x3b7bfa=String(_0x4b852b['dailyHour']??'2'),_0x52571c=String(_0x4b852b['dailyMinute']??'0');return _0x52571c+'\x20'+_0x3b7bfa+'\x20*\x20*\x20*';}if(_0x4456b7==='weekly'){const _0x2dd8d0=String(_0x4b852b['weeklyDay']??'1'),_0x25ce8e=String(_0x4b852b['weeklyHour']??'9'),_0x15d1c3=String(_0x4b852b['weeklyMinute']??'0');return _0x15d1c3+'\x20'+_0x25ce8e+'\x20*\x20*\x20'+_0x2dd8d0;}if(_0x4456b7==='monthly'){const _0x43b16d=normalizeAutomationMonthlyDayToken(_0x4b852b['monthlyDayToken']??_0x4b852b['monthlyDay'],DEFAULT_MONTHLY_DAY_TOKEN),_0xf3d844=String(_0x4b852b['monthlyHour']??'0'),_0x75e35e=String(_0x4b852b['monthlyMinute']??'0');return _0x75e35e+'\x20'+_0xf3d844+'\x20'+_0x43b16d+'\x20*\x20*';}const _0x243302=String(_0x4b852b['recurringInterval']||'*/30\x20*\x20*\x20*\x20*')['trim'](),[_0x19a592='*/30',_0xc093e0='*']=_0x243302['split'](/\s+/);let _0x87326e=_0xc093e0;const _0x35e087=String(_0x4b852b['recurringStartHour']??'')['trim'](),_0x39c839=String(_0x4b852b['recurringEndHour']??'')['trim']();if(_0x35e087!==''&&_0x39c839!==''){const _0x719750=Number['parseInt'](_0x35e087,0xa),_0x4ccef2=Number['parseInt'](_0x39c839,0xa);if(Number['isInteger'](_0x719750)&&Number['isInteger'](_0x4ccef2)&&_0x719750<=_0x4ccef2){const _0x339f6e=_0xc093e0['match'](/^\*\/(\d+)$/);_0x339f6e?_0x87326e=_0x719750+'-'+_0x4ccef2+'/'+_0x339f6e[0x1]:_0x87326e=_0x719750+'-'+_0x4ccef2;}}const _0x5399a0=String(_0x4b852b['recurringDayToken']??'*')['trim']()||'*';return _0x19a592+'\x20'+_0x87326e+'\x20*\x20*\x20'+_0x5399a0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export class CommentsWidget{constructor(_0x4ffaf0,_0x32fdb3={}){this['container']=_0x4ffaf0,this['options']={'taskId':_0x32fdb3['taskId']||null,'currentUserId':_0x32fdb3['currentUserId']||null,'compact':_0x32fdb3['compact']||![],'skipHeader':_0x32fdb3['skipHeader']||![],'onCommentsLoaded':_0x32fdb3['onCommentsLoaded']||null,'onCommentsChanged':_0x32fdb3['onCommentsChanged']||null,'enableAttachments':_0x32fdb3['enableAttachments']||![],'getAPI':_0x32fdb3['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 _0x3015e6=this['options']['getAPI'](),_0x8eed4e=await _0x3015e6['getTaskAttachments'](this['options']['taskId']);this['existingAttachments']=_0x8eed4e['attachments']||[];}catch(_0x40ec24){console['warn']('Failed\x20to\x20load\x20existing\x20attachments:',_0x40ec24),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 _0x543e72=this['header']['querySelector']('.comments-toggle-btn');_0x543e72['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 _0x546503=document['createElement']('div');_0x546503['className']='comments-editor-wrapper',this['toolbar']=document['createElement']('div'),this['toolbar']['className']='comments-toolbar\x20comments-toolbar-hidden',_0x546503['appendChild'](this['toolbar']);const _0x212b54=document['createElement']('div');_0x212b54['className']='comments-editor-placeholder',_0x546503['appendChild'](_0x212b54);const _0x32f752=document['createElement']('div');_0x32f752['className']='comments-input-actions',_0x32f752['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'](_0x546503),this['inputSection']['appendChild'](_0x32f752),this['container']['appendChild'](this['inputSection']),this['initEditor'](_0x212b54),this['submitBtn']=_0x32f752['querySelector']('.comments-submit-btn'),this['cancelBtn']=_0x32f752['querySelector']('.comments-cancel-btn'),this['submitBtn']['addEventListener']('click',()=>this['handleSubmit']()),this['cancelBtn']['addEventListener']('click',()=>this['cancelEdit']());}['initEditor'](_0x2fd7c1){const _0x55e3fd=document['createElement']('textarea');_0x55e3fd['placeholder']='Add\x20a\x20comment...',_0x55e3fd['className']='comments-textarea',_0x2fd7c1['appendChild'](_0x55e3fd);const _0x4ef6e1=window['MarkdownEditor'];if(!_0x4ef6e1){console['error']('MarkdownEditor\x20not\x20loaded');return;}const _0x26ca58={'placeholder':'Add\x20a\x20comment...','editable':!![],'toolbar':!![],'minHeight':this['options']['compact']?'60px':'80px','onChange':_0x35dd63=>{const _0x4f2c25=_0x35dd63&&_0x35dd63['trim']()['length']>0x0||this['pendingAttachments']['length']>0x0;this['submitBtn']['disabled']=!_0x4f2c25;},'fetchUsers':async()=>{const _0x311fb2=this['options']['getAPI']();return _0x311fb2['getUsers']();}};this['options']['enableAttachments']&&this['options']['taskId']&&(_0x26ca58['onAddAttachments']=_0x321453=>{this['pendingAttachments']['push'](..._0x321453),this['submitBtn']['disabled']=![];},_0x26ca58['resolveAttachmentUrl']=_0x288338=>{const _0x3fbcbb=this['options']['getAPI']();return _0x3fbcbb['getBaseUrl']()+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x288338);},_0x26ca58['isAttachmentNameTaken']=_0x417a31=>{return this['pendingAttachments']['some'](_0x4b334f=>_0x4b334f['name']===_0x417a31)||this['existingAttachments']['some'](_0x317209=>_0x317209['name']===_0x417a31);});this['editor']=new _0x4ef6e1(_0x55e3fd,_0x26ca58);const _0x14cbdf=this['editor']['editor'],_0x29cb80=this['editor']['toolbar'];_0x29cb80&&(_0x29cb80['classList']['add']('comments-toolbar-hidden'),_0x14cbdf['addEventListener']('focus',()=>{_0x29cb80['classList']['remove']('comments-toolbar-hidden');}),_0x14cbdf['addEventListener']('blur',_0x1973b4=>{setTimeout(()=>{!this['editor']['container']?.['contains'](document['activeElement'])&&!_0x29cb80['contains'](document['activeElement'])&&(!this['editor']['getValue']()?.['trim']()&&!this['editingCommentId']&&_0x29cb80['classList']['add']('comments-toolbar-hidden'));},0x64);}));}['toggleExpanded'](){this['isExpanded']=!this['isExpanded'],this['commentsListWrapper']['hidden']=!this['isExpanded'],this['inputSection']['hidden']=!this['isExpanded'];const _0x2d802d=this['header']['querySelector']('.comments-chevron');_0x2d802d&&(_0x2d802d['style']['transform']=this['isExpanded']?'rotate(180deg)':''),this['isExpanded']&&this['comments']['length']===0x0&&this['options']['taskId']&&this['loadComments']();}['setTaskId'](_0x10791d){this['options']['taskId']=_0x10791d,this['comments']=[],this['renderComments'](),_0x10791d&&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 _0x2e09cc=this['options']['getAPI'](),_0x4d1d91=await _0x2e09cc['getComments'](this['options']['taskId']);this['comments']=_0x4d1d91['comments']||[],this['renderComments'](),this['updateCount'](),this['options']['onCommentsLoaded']&&this['options']['onCommentsLoaded'](this['comments']);}catch(_0x552d74){console['error']('Failed\x20to\x20load\x20comments:',_0x552d74),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'](_0x201fa7=>{const _0x4e9373=this['createCommentElement'](_0x201fa7);this['commentsList']['appendChild'](_0x4e9373);});}['createCommentElement'](_0x248890){const _0x1dd376=document['createElement']('div');_0x1dd376['className']='comment-item',_0x1dd376['dataset']['commentId']=_0x248890['id'];const _0x141182=this['options']['currentUserId']&&_0x248890['author']?.['userId']===this['options']['currentUserId'],_0xdddb69=this['formatDate'](_0x248890['createdAt']),_0x5b31f1=_0x248890['updatedAt']!==_0x248890['createdAt'],_0x54c767=this['resolveAttachmentUrls'](_0x248890['content']);let _0xc71f9=window['marked']?window['marked']['parse'](_0x54c767):_0x54c767;_0xc71f9=this['renderMentions'](_0xc71f9),_0x1dd376['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'](_0x248890['author']?.['name']||'Anonymous')+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-timestamp\x22\x20title=\x22'+new Date(_0x248890['createdAt'])['toLocaleString']()+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0xdddb69+(_0x5b31f1?'\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'+(_0x141182?'\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>'+_0xc71f9+'</div>\x0a\x20\x20\x20\x20';if(_0x141182){const _0x41653b=_0x1dd376['querySelector']('.comment-edit-btn'),_0x511d26=_0x1dd376['querySelector']('.comment-delete-btn');_0x41653b?.['addEventListener']('click',()=>this['startEdit'](_0x248890)),_0x511d26?.['addEventListener']('click',()=>this['deleteComment'](_0x248890['id']));}return _0x1dd376;}['formatDate'](_0x5a448e){const _0x4292f5=new Date(_0x5a448e),_0x242e28=new Date(),_0x63c64f=_0x242e28-_0x4292f5,_0x4f59f3=Math['floor'](_0x63c64f/0xea60),_0x1a7d7a=Math['floor'](_0x63c64f/0x36ee80),_0x254f63=Math['floor'](_0x63c64f/0x5265c00);if(_0x4f59f3<0x1)return'just\x20now';if(_0x4f59f3<0x3c)return _0x4f59f3+'m\x20ago';if(_0x1a7d7a<0x18)return _0x1a7d7a+'h\x20ago';if(_0x254f63<0x7)return _0x254f63+'d\x20ago';return _0x4292f5['toLocaleDateString']();}['escapeHtml'](_0x531d54){const _0x1f071d=document['createElement']('div');return _0x1f071d['textContent']=_0x531d54,_0x1f071d['innerHTML'];}['resolveAttachmentUrls'](_0x15c165){if(!_0x15c165||!this['options']['taskId'])return _0x15c165;const _0x362c9a=this['options']['getAPI'](),_0x368237=_0x362c9a['getBaseUrl']();let _0xc17193=String(_0x15c165)['replace'](/\]\(attachment:(?:\/\/)?([^)]+)\)/g,(_0x12144b,_0xf56345)=>{const _0x182bab=String(_0xf56345||'')['trim']();if(!_0x182bab)return _0x12144b;let _0x3581af=_0x182bab;try{_0x3581af=decodeURIComponent(_0x182bab);}catch{}return']('+_0x368237+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x3581af)+')';});return _0xc17193;}['renderMentions'](_0x165938){if(!_0x165938)return _0x165938;return String(_0x165938)['replace'](/@?<a\s+href="mention:([^"]+)"[^>]*>([^<]+)<\/a>/g,(_0x3e3180,_0x3f29ea,_0x17442e)=>{const _0x4c9346=this['escapeHtml'](_0x17442e),_0x487c5e=this['escapeHtml'](_0x3f29ea);return'<span\x20class=\x22mention\x22\x20data-mention-user-id=\x22'+_0x487c5e+'\x22>@'+_0x4c9346+'</span>';});}['startEdit'](_0x14e640){this['editingCommentId']=_0x14e640['id'],this['editor']['setValue'](_0x14e640['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 _0x28d861=this['editor']['getValue']()?.['trim']();if(!_0x28d861&&this['pendingAttachments']['length']===0x0||!this['options']['taskId'])return;this['setLoading'](!![]);try{const _0x485e0e=this['options']['getAPI']();this['pendingAttachments']['length']>0x0&&this['options']['enableAttachments']&&(await _0x485e0e['uploadAttachments'](this['options']['taskId'],this['pendingAttachments']),this['existingAttachments']['push'](...this['pendingAttachments']['map'](_0x15873b=>({'name':_0x15873b['name']}))),this['pendingAttachments']=[]);if(this['editingCommentId']){const _0x2ec806=await _0x485e0e['updateComment'](this['options']['taskId'],this['editingCommentId'],_0x28d861),_0x38f621=this['comments']['findIndex'](_0x4fe2a2=>_0x4fe2a2['id']===this['editingCommentId']);_0x38f621!==-0x1&&(this['comments'][_0x38f621]=_0x2ec806['comment']);}else{const _0x51422b=await _0x485e0e['addComment'](this['options']['taskId'],_0x28d861);this['comments']['push'](_0x51422b['comment']);}this['renderComments'](),this['updateCount'](),this['cancelEdit'](),this['editor']['clear']();}catch(_0x21fa0a){console['error']('Failed\x20to\x20save\x20comment:',_0x21fa0a),alert('Failed\x20to\x20save\x20comment:\x20'+_0x21fa0a['message']);}finally{this['setLoading'](![]);}}async['deleteComment'](_0x589f27){const _0x326f14=await this['showDeleteConfirmModal']();if(!_0x326f14)return;try{const _0x4b9805=this['options']['getAPI']();await _0x4b9805['deleteComment'](this['options']['taskId'],_0x589f27),this['comments']=this['comments']['filter'](_0x5e00bd=>_0x5e00bd['id']!==_0x589f27),this['renderComments'](),this['updateCount']();}catch(_0x569175){console['error']('Failed\x20to\x20delete\x20comment:',_0x569175),alert('Failed\x20to\x20delete\x20comment:\x20'+_0x569175['message']);}}['showDeleteConfirmModal'](){return new Promise(_0x4304c5=>{const _0x3c8a18=document['createElement']('div');_0x3c8a18['className']='comments-confirm-modal',_0x3c8a18['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'](_0x3c8a18);const _0x4f392b=_0x4eddb0=>{document['removeEventListener']('keydown',_0x1cf017),_0x3c8a18['remove'](),_0x4304c5(_0x4eddb0);},_0x1cf017=_0x1bcd0a=>{if(_0x1bcd0a['key']==='Escape')_0x4f392b(![]);};document['addEventListener']('keydown',_0x1cf017),_0x3c8a18['querySelector']('.comments-confirm-backdrop')['addEventListener']('click',()=>_0x4f392b(![])),_0x3c8a18['querySelector']('.comments-confirm-close')['addEventListener']('click',()=>_0x4f392b(![])),_0x3c8a18['querySelector']('.comments-confirm-cancel')['addEventListener']('click',()=>_0x4f392b(![])),_0x3c8a18['querySelector']('.comments-confirm-delete')['addEventListener']('click',()=>_0x4f392b(!![])),_0x3c8a18['querySelector']('.comments-confirm-cancel')['focus']();});}['setLoading'](_0x59328f){this['submitBtn']['disabled']=_0x59328f,this['submitBtn']['querySelector']('.btn-text')['hidden']=_0x59328f,this['submitBtn']['querySelector']('.btn-loading')['hidden']=!_0x59328f;}['updateCount'](){const _0x3fa7be=this['comments']['length'],_0x3ea8a9=this['container']['querySelector']('#comments-count-badge');_0x3ea8a9&&(_0x3ea8a9['textContent']=_0x3fa7be,_0x3ea8a9['hidden']=_0x3fa7be===0x0);const _0x5165f2=this['container']['querySelector']('#comments-count');_0x5165f2&&(_0x5165f2['textContent']=_0x3fa7be>0x0?'('+_0x3fa7be+')':''),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(_0x2948c4,_0x3ed8a6={}){this['container']=_0x2948c4,this['options']={'taskId':_0x3ed8a6['taskId']||null,'currentUserId':_0x3ed8a6['currentUserId']||null,'compact':_0x3ed8a6['compact']||![],'skipHeader':_0x3ed8a6['skipHeader']||![],'onCommentsLoaded':_0x3ed8a6['onCommentsLoaded']||null,'onCommentsChanged':_0x3ed8a6['onCommentsChanged']||null,'enableAttachments':_0x3ed8a6['enableAttachments']||![],'getAPI':_0x3ed8a6['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 _0x8a19dd=this['options']['getAPI'](),_0x2e6cb6=await _0x8a19dd['getTaskAttachments'](this['options']['taskId']);this['existingAttachments']=_0x2e6cb6['attachments']||[];}catch(_0x15e879){console['warn']('Failed\x20to\x20load\x20existing\x20attachments:',_0x15e879),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 _0x28783e=this['header']['querySelector']('.comments-toggle-btn');_0x28783e['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 _0x2242af=document['createElement']('div');_0x2242af['className']='comments-editor-wrapper',this['toolbar']=document['createElement']('div'),this['toolbar']['className']='comments-toolbar\x20comments-toolbar-hidden',_0x2242af['appendChild'](this['toolbar']);const _0x366025=document['createElement']('div');_0x366025['className']='comments-editor-placeholder',_0x2242af['appendChild'](_0x366025);const _0x273be1=document['createElement']('div');_0x273be1['className']='comments-input-actions',_0x273be1['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'](_0x2242af),this['inputSection']['appendChild'](_0x273be1),this['container']['appendChild'](this['inputSection']),this['initEditor'](_0x366025),this['submitBtn']=_0x273be1['querySelector']('.comments-submit-btn'),this['cancelBtn']=_0x273be1['querySelector']('.comments-cancel-btn'),this['submitBtn']['addEventListener']('click',()=>this['handleSubmit']()),this['cancelBtn']['addEventListener']('click',()=>this['cancelEdit']());}['initEditor'](_0x47bd34){const _0x2b4e77=document['createElement']('textarea');_0x2b4e77['placeholder']='Add\x20a\x20comment...',_0x2b4e77['className']='comments-textarea',_0x47bd34['appendChild'](_0x2b4e77);const _0x1476e8=window['MarkdownEditor'];if(!_0x1476e8){console['error']('MarkdownEditor\x20not\x20loaded');return;}const _0x129c44={'placeholder':'Add\x20a\x20comment...','editable':!![],'toolbar':!![],'minHeight':this['options']['compact']?'60px':'80px','onChange':_0x33b2aa=>{const _0x4df15a=_0x33b2aa&&_0x33b2aa['trim']()['length']>0x0||this['pendingAttachments']['length']>0x0;this['submitBtn']['disabled']=!_0x4df15a;},'fetchUsers':async()=>{const _0x240e6c=this['options']['getAPI']();return _0x240e6c['getUsers']();}};this['options']['enableAttachments']&&this['options']['taskId']&&(_0x129c44['onAddAttachments']=_0x372513=>{this['pendingAttachments']['push'](..._0x372513),this['submitBtn']['disabled']=![];},_0x129c44['resolveAttachmentUrl']=_0x585a82=>{const _0x12ac13=this['options']['getAPI']();return _0x12ac13['getBaseUrl']()+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x585a82);},_0x129c44['isAttachmentNameTaken']=_0x19e399=>{return this['pendingAttachments']['some'](_0x23a75a=>_0x23a75a['name']===_0x19e399)||this['existingAttachments']['some'](_0x23e426=>_0x23e426['name']===_0x19e399);});this['editor']=new _0x1476e8(_0x2b4e77,_0x129c44);const _0xc68075=this['editor']['editor'],_0x24381e=this['editor']['toolbar'];_0x24381e&&(_0x24381e['classList']['add']('comments-toolbar-hidden'),_0xc68075['addEventListener']('focus',()=>{_0x24381e['classList']['remove']('comments-toolbar-hidden');}),_0xc68075['addEventListener']('blur',_0x4f315f=>{setTimeout(()=>{!this['editor']['container']?.['contains'](document['activeElement'])&&!_0x24381e['contains'](document['activeElement'])&&(!this['editor']['getValue']()?.['trim']()&&!this['editingCommentId']&&_0x24381e['classList']['add']('comments-toolbar-hidden'));},0x64);}));}['toggleExpanded'](){this['isExpanded']=!this['isExpanded'],this['commentsListWrapper']['hidden']=!this['isExpanded'],this['inputSection']['hidden']=!this['isExpanded'];const _0x1cc71c=this['header']['querySelector']('.comments-chevron');_0x1cc71c&&(_0x1cc71c['style']['transform']=this['isExpanded']?'rotate(180deg)':''),this['isExpanded']&&this['comments']['length']===0x0&&this['options']['taskId']&&this['loadComments']();}['setTaskId'](_0x10cc90){this['options']['taskId']=_0x10cc90,this['comments']=[],this['renderComments'](),_0x10cc90&&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 _0x26c709=this['options']['getAPI'](),_0x211017=await _0x26c709['getComments'](this['options']['taskId']);this['comments']=_0x211017['comments']||[],this['renderComments'](),this['updateCount'](),this['options']['onCommentsLoaded']&&this['options']['onCommentsLoaded'](this['comments']);}catch(_0x17ab15){console['error']('Failed\x20to\x20load\x20comments:',_0x17ab15),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'](_0x2a2ec2=>{const _0x2a3959=this['createCommentElement'](_0x2a2ec2);this['commentsList']['appendChild'](_0x2a3959);});}['createCommentElement'](_0x4d6f8c){const _0x26469f=document['createElement']('div');_0x26469f['className']='comment-item',_0x26469f['dataset']['commentId']=_0x4d6f8c['id'];const _0x3b04e0=this['options']['currentUserId']&&_0x4d6f8c['author']?.['userId']===this['options']['currentUserId'],_0x2ec032=this['formatDate'](_0x4d6f8c['createdAt']),_0x597d8c=_0x4d6f8c['updatedAt']!==_0x4d6f8c['createdAt'],_0x5990df=this['resolveAttachmentUrls'](_0x4d6f8c['content']);let _0x23654e=window['marked']?window['marked']['parse'](_0x5990df):_0x5990df;_0x23654e=this['renderMentions'](_0x23654e),_0x26469f['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'](_0x4d6f8c['author']?.['name']||'Anonymous')+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-timestamp\x22\x20title=\x22'+new Date(_0x4d6f8c['createdAt'])['toLocaleString']()+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x2ec032+(_0x597d8c?'\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'+(_0x3b04e0?'\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>'+_0x23654e+'</div>\x0a\x20\x20\x20\x20';if(_0x3b04e0){const _0x12bc5b=_0x26469f['querySelector']('.comment-edit-btn'),_0x2c63a7=_0x26469f['querySelector']('.comment-delete-btn');_0x12bc5b?.['addEventListener']('click',()=>this['startEdit'](_0x4d6f8c)),_0x2c63a7?.['addEventListener']('click',()=>this['deleteComment'](_0x4d6f8c['id']));}return _0x26469f;}['formatDate'](_0x1ae707){const _0x2b4507=new Date(_0x1ae707),_0x271449=new Date(),_0x4d5c4f=_0x271449-_0x2b4507,_0x155919=Math['floor'](_0x4d5c4f/0xea60),_0xdc7cc6=Math['floor'](_0x4d5c4f/0x36ee80),_0x39698f=Math['floor'](_0x4d5c4f/0x5265c00);if(_0x155919<0x1)return'just\x20now';if(_0x155919<0x3c)return _0x155919+'m\x20ago';if(_0xdc7cc6<0x18)return _0xdc7cc6+'h\x20ago';if(_0x39698f<0x7)return _0x39698f+'d\x20ago';return _0x2b4507['toLocaleDateString']();}['escapeHtml'](_0x80d3fc){const _0x26ab97=document['createElement']('div');return _0x26ab97['textContent']=_0x80d3fc,_0x26ab97['innerHTML'];}['resolveAttachmentUrls'](_0x54e5a2){if(!_0x54e5a2||!this['options']['taskId'])return _0x54e5a2;const _0x8b28ff=this['options']['getAPI'](),_0x5f05bf=_0x8b28ff['getBaseUrl']();let _0x3e44bc=String(_0x54e5a2)['replace'](/\]\(attachment:(?:\/\/)?([^)]+)\)/g,(_0x30e7cb,_0x2bd56b)=>{const _0x4eaada=String(_0x2bd56b||'')['trim']();if(!_0x4eaada)return _0x30e7cb;let _0x18b967=_0x4eaada;try{_0x18b967=decodeURIComponent(_0x4eaada);}catch{}return']('+_0x5f05bf+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x18b967)+')';});return _0x3e44bc;}['renderMentions'](_0x474dd6){if(!_0x474dd6)return _0x474dd6;return String(_0x474dd6)['replace'](/@?<a\s+href="mention:([^"]+)"[^>]*>([^<]+)<\/a>/g,(_0x432355,_0x995df0,_0x85c708)=>{const _0x58ddd4=this['escapeHtml'](_0x85c708),_0xa1afaf=this['escapeHtml'](_0x995df0);return'<span\x20class=\x22mention\x22\x20data-mention-user-id=\x22'+_0xa1afaf+'\x22>@'+_0x58ddd4+'</span>';});}['startEdit'](_0x4932e0){this['editingCommentId']=_0x4932e0['id'],this['editor']['setValue'](_0x4932e0['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 _0x45efd3=this['editor']['getValue']()?.['trim']();if(!_0x45efd3&&this['pendingAttachments']['length']===0x0||!this['options']['taskId'])return;this['setLoading'](!![]);try{const _0x3ab2dc=this['options']['getAPI']();this['pendingAttachments']['length']>0x0&&this['options']['enableAttachments']&&(await _0x3ab2dc['uploadAttachments'](this['options']['taskId'],this['pendingAttachments']),this['existingAttachments']['push'](...this['pendingAttachments']['map'](_0x233365=>({'name':_0x233365['name']}))),this['pendingAttachments']=[]);if(this['editingCommentId']){const _0x6168c1=await _0x3ab2dc['updateComment'](this['options']['taskId'],this['editingCommentId'],_0x45efd3),_0x438094=this['comments']['findIndex'](_0x253a12=>_0x253a12['id']===this['editingCommentId']);_0x438094!==-0x1&&(this['comments'][_0x438094]=_0x6168c1['comment']);}else{const _0x1695a0=await _0x3ab2dc['addComment'](this['options']['taskId'],_0x45efd3);this['comments']['push'](_0x1695a0['comment']);}this['renderComments'](),this['updateCount'](),this['cancelEdit'](),this['editor']['clear']();}catch(_0x341ff7){console['error']('Failed\x20to\x20save\x20comment:',_0x341ff7),alert('Failed\x20to\x20save\x20comment:\x20'+_0x341ff7['message']);}finally{this['setLoading'](![]);}}async['deleteComment'](_0x365794){const _0x483574=await this['showDeleteConfirmModal']();if(!_0x483574)return;try{const _0x13585f=this['options']['getAPI']();await _0x13585f['deleteComment'](this['options']['taskId'],_0x365794),this['comments']=this['comments']['filter'](_0x583d8b=>_0x583d8b['id']!==_0x365794),this['renderComments'](),this['updateCount']();}catch(_0x124aa9){console['error']('Failed\x20to\x20delete\x20comment:',_0x124aa9),alert('Failed\x20to\x20delete\x20comment:\x20'+_0x124aa9['message']);}}['showDeleteConfirmModal'](){return new Promise(_0x4641f8=>{const _0x4a751e=document['createElement']('div');_0x4a751e['className']='comments-confirm-modal',_0x4a751e['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'](_0x4a751e);const _0x5692bd=_0x2fdc91=>{document['removeEventListener']('keydown',_0x445043),_0x4a751e['remove'](),_0x4641f8(_0x2fdc91);},_0x445043=_0x3d91e4=>{if(_0x3d91e4['key']==='Escape')_0x5692bd(![]);};document['addEventListener']('keydown',_0x445043),_0x4a751e['querySelector']('.comments-confirm-backdrop')['addEventListener']('click',()=>_0x5692bd(![])),_0x4a751e['querySelector']('.comments-confirm-close')['addEventListener']('click',()=>_0x5692bd(![])),_0x4a751e['querySelector']('.comments-confirm-cancel')['addEventListener']('click',()=>_0x5692bd(![])),_0x4a751e['querySelector']('.comments-confirm-delete')['addEventListener']('click',()=>_0x5692bd(!![])),_0x4a751e['querySelector']('.comments-confirm-cancel')['focus']();});}['setLoading'](_0x2274c0){this['submitBtn']['disabled']=_0x2274c0,this['submitBtn']['querySelector']('.btn-text')['hidden']=_0x2274c0,this['submitBtn']['querySelector']('.btn-loading')['hidden']=!_0x2274c0;}['updateCount'](){const _0xe5676f=this['comments']['length'],_0x110065=this['container']['querySelector']('#comments-count-badge');_0x110065&&(_0x110065['textContent']=_0xe5676f,_0x110065['hidden']=_0xe5676f===0x0);const _0x5cfb33=this['container']['querySelector']('#comments-count');_0x5cfb33&&(_0x5cfb33['textContent']=_0xe5676f>0x0?'('+_0xe5676f+')':''),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(_0x39b97d){const _0x2bf4f2=[],_0x1f2950=_0x39b97d['split']('\x0a');let _0x41cf66=null,_0xdaec2d=null;for(const _0xafb1c of _0x1f2950){if(_0xafb1c['startsWith']('diff\x20--git')){_0x41cf66&&_0xdaec2d&&_0x41cf66['hunks']['push'](_0xdaec2d);_0x41cf66&&_0x2bf4f2['push'](_0x41cf66);const _0x4c08ca=_0xafb1c['match'](/diff --git a\/(.+?) b\/(.+)/);_0x41cf66={'oldPath':_0x4c08ca?_0x4c08ca[0x1]:'','newPath':_0x4c08ca?_0x4c08ca[0x2]:'','hunks':[],'isDeleted':![]},_0xdaec2d=null;}else{if(_0xafb1c['startsWith']('deleted\x20file\x20mode')&&_0x41cf66)_0x41cf66['isDeleted']=!![];else{if(_0xafb1c['startsWith']('@@'))_0xdaec2d&&_0x41cf66&&_0x41cf66['hunks']['push'](_0xdaec2d),_0xdaec2d={'header':_0xafb1c,'lines':[]};else _0xdaec2d&&_0xdaec2d['lines']['push'](_0xafb1c);}}}return _0x41cf66&&_0xdaec2d&&_0x41cf66['hunks']['push'](_0xdaec2d),_0x41cf66&&_0x2bf4f2['push'](_0x41cf66),_0x2bf4f2;}export function parseHunkHeader(_0x39019){const _0x16bed3=_0x39019['match'](/@@ -(\d+),?\d* \+(\d+),?\d* @@/);if(_0x16bed3)return{'oldStart':parseInt(_0x16bed3[0x1],0xa),'newStart':parseInt(_0x16bed3[0x2],0xa)};return{'oldStart':0x1,'newStart':0x1};}export function highlightDiffLine(_0x2c2503,_0x55f5f5){const _0x39ee79=window['hljs']||(typeof hljs!=='undefined'?hljs:null);if(_0x39ee79&&_0x55f5f5)try{const _0x73d7f6=_0x39ee79['getLanguage'](_0x55f5f5)?_0x55f5f5:null;if(_0x73d7f6)return _0x39ee79['highlight'](_0x2c2503,{'language':_0x73d7f6})['value'];}catch(_0x4c45a8){console['error']('Diff\x20syntax\x20highlighting\x20error:',_0x4c45a8);}return Utils['escapeHtml'](_0x2c2503);}export function getFileLanguage(_0x5f0a7d){const _0x157407=_0x5f0a7d['split']('.')['pop']()['toLowerCase'](),_0x17e396={'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 _0x17e396[_0x157407]||null;}export function computeWordDiff(_0x1a5a35,_0x2b661d){const _0x3d1b9a=_0x34ef7d=>{const _0x5e232f=[];let _0x421071='',_0x27b363=![];for(let _0x1376d4=0x0;_0x1376d4<_0x34ef7d['length'];_0x1376d4++){const _0xa3143f=_0x34ef7d[_0x1376d4],_0x4d81fd=/\s/['test'](_0xa3143f);if(_0x421071==='')_0x421071=_0xa3143f,_0x27b363=_0x4d81fd;else _0x4d81fd===_0x27b363?_0x421071+=_0xa3143f:(_0x5e232f['push'](_0x421071),_0x421071=_0xa3143f,_0x27b363=_0x4d81fd);}return _0x421071&&_0x5e232f['push'](_0x421071),_0x5e232f;},_0x4e7043=_0x3d1b9a(_0x1a5a35),_0x4bfe62=_0x3d1b9a(_0x2b661d),_0x1eb0c1=_0x4e7043['length'],_0x445e25=_0x4bfe62['length'],_0x4fb12e=Array(_0x1eb0c1+0x1)['fill'](null)['map'](()=>Array(_0x445e25+0x1)['fill'](0x0));for(let _0x3ff048=0x1;_0x3ff048<=_0x1eb0c1;_0x3ff048++){for(let _0x1d61d3=0x1;_0x1d61d3<=_0x445e25;_0x1d61d3++){_0x4e7043[_0x3ff048-0x1]===_0x4bfe62[_0x1d61d3-0x1]?_0x4fb12e[_0x3ff048][_0x1d61d3]=_0x4fb12e[_0x3ff048-0x1][_0x1d61d3-0x1]+0x1:_0x4fb12e[_0x3ff048][_0x1d61d3]=Math['max'](_0x4fb12e[_0x3ff048-0x1][_0x1d61d3],_0x4fb12e[_0x3ff048][_0x1d61d3-0x1]);}}const _0x523dfb={'old':[],'new':[]};let _0x436237=_0x1eb0c1,_0x3a0c27=_0x445e25;const _0x2a8b41=[],_0x2b3c84=[];while(_0x436237>0x0||_0x3a0c27>0x0){if(_0x436237>0x0&&_0x3a0c27>0x0&&_0x4e7043[_0x436237-0x1]===_0x4bfe62[_0x3a0c27-0x1])_0x2a8b41['unshift']({'type':'equal','text':_0x4e7043[_0x436237-0x1]}),_0x2b3c84['unshift']({'type':'equal','text':_0x4bfe62[_0x3a0c27-0x1]}),_0x436237--,_0x3a0c27--;else{if(_0x3a0c27>0x0&&(_0x436237===0x0||_0x4fb12e[_0x436237][_0x3a0c27-0x1]>=_0x4fb12e[_0x436237-0x1][_0x3a0c27]))_0x2b3c84['unshift']({'type':'insert','text':_0x4bfe62[_0x3a0c27-0x1]}),_0x3a0c27--;else _0x436237>0x0&&(_0x2a8b41['unshift']({'type':'delete','text':_0x4e7043[_0x436237-0x1]}),_0x436237--);}}return _0x523dfb['old']=_0x2a8b41,_0x523dfb['new']=_0x2b3c84,_0x523dfb;}export function renderDiffLineWithWordHighlight(_0x5a1a49,_0x28fef3,_0x5cbf80,_0x2e18cc){if(!_0x28fef3||_0x28fef3['length']===0x0)return highlightDiffLine(_0x5a1a49,_0x2e18cc);let _0x3bba34='';const _0x3ccfdc=_0x5cbf80==='add'?'diff-word-add':'diff-word-remove',_0x40606a=_0x5cbf80==='add'?'insert':'delete';for(const _0x3d7ec1 of _0x28fef3){const _0x41b061=Utils['escapeHtml'](_0x3d7ec1['text']);_0x3d7ec1['type']===_0x40606a?_0x3bba34+='<span\x20class=\x22'+_0x3ccfdc+'\x22>'+_0x41b061+'</span>':_0x3bba34+=_0x41b061;}return _0x3bba34;}export function calculateDiffStats(_0x205fac){let _0xe85008=0x0,_0x23bb15=0x0,_0x1dfa41=0x0;return _0x205fac['forEach'](_0x3b84aa=>{let _0x16f997=0x0,_0x1a411f=0x0;_0x3b84aa['hunks']['forEach'](_0x4d6ac1=>{_0x4d6ac1['lines']['forEach'](_0x290ccf=>{if(_0x290ccf['startsWith']('+'))_0x16f997+=0x1;else{if(_0x290ccf['startsWith']('-'))_0x1a411f+=0x1;}});}),(_0x16f997+_0x1a411f>0x0||_0x3b84aa['isDeleted'])&&(_0x1dfa41+=0x1),_0xe85008+=_0x16f997,_0x23bb15+=_0x1a411f;}),{'additions':_0xe85008,'deletions':_0x23bb15,'files':_0x1dfa41};}export function getFileStatus(_0x3984ba,_0x1ac5ee,_0x504668){if(_0x3984ba['isDeleted'])return'deleted';if(_0x1ac5ee>0x0&&_0x504668===0x0)return'added';return'modified';}export function safeBase64(_0x2d24b8){try{return btoa(unescape(encodeURIComponent(_0x2d24b8)));}catch(_0x212767){return btoa(_0x2d24b8);}}export function getStorageKey(_0x1bda40,_0x4ffb57){return _0x1bda40+'-'+safeBase64(_0x4ffb57);}export function getCollapsedState(_0x4c3538,_0x2baf38){const _0x4febf0=localStorage['getItem'](getStorageKey(_0x4c3538,_0x2baf38));return _0x4febf0==='true';}export function renderUnifiedDiff(_0x28c293,_0x46182e){return _0x28c293['map']((_0x3ca6b1,_0x39d7b7)=>{const _0x32a54d=_0x3ca6b1['newPath']||_0x3ca6b1['oldPath']||'unknown',_0x2c3d4a='diff-'+_0x46182e+'-'+_0x39d7b7,_0x293f7d=getFileLanguage(_0x32a54d),{additions:_0x3cb2b7,deletions:_0x442748}=calculateDiffStats([_0x3ca6b1]),_0x18297d=getCollapsedState(_0x46182e,_0x32a54d),_0x516ade=getFileStatus(_0x3ca6b1,_0x3cb2b7,_0x442748),_0x5cf415=_0x516ade==='added'?'A':_0x516ade==='deleted'?'D':'M',_0x4fe30c=_0x3ca6b1['hunks']['map'](_0x15d488=>{const {oldStart:_0x2185cb,newStart:_0x4f5c90}=parseHunkHeader(_0x15d488['header']);let _0x453e0a=_0x2185cb,_0x1714a0=_0x4f5c90;const _0x2a7e3b=_0x15d488['lines']['map'](_0xac495c=>({'line':_0xac495c,'type':_0xac495c['startsWith']('+')?'add':_0xac495c['startsWith']('-')?'remove':_0xac495c['startsWith']('\x5c')?'meta':'context'}));let _0x1d61f2=0x0;while(_0x1d61f2<_0x2a7e3b['length']){if(_0x2a7e3b[_0x1d61f2]['type']==='remove'){let _0x1ee9f9=_0x1d61f2,_0x7597cf=_0x1d61f2;while(_0x7597cf<_0x2a7e3b['length']&&_0x2a7e3b[_0x7597cf]['type']==='remove')_0x7597cf++;let _0x54442e=_0x7597cf,_0x36bb3d=_0x54442e;while(_0x36bb3d<_0x2a7e3b['length']&&_0x2a7e3b[_0x36bb3d]['type']==='add')_0x36bb3d++;const _0x1dd0dc=_0x7597cf-_0x1ee9f9,_0x21c671=_0x36bb3d-_0x54442e,_0x2cc251=Math['min'](_0x1dd0dc,_0x21c671);for(let _0x43afbb=0x0;_0x43afbb<_0x2cc251;_0x43afbb++){const _0x3c6683=_0x2a7e3b[_0x1ee9f9+_0x43afbb]['line']['substring'](0x1),_0x38ed52=_0x2a7e3b[_0x54442e+_0x43afbb]['line']['substring'](0x1),_0x138b1a=computeWordDiff(_0x3c6683,_0x38ed52);_0x2a7e3b[_0x1ee9f9+_0x43afbb]['wordDiff']=_0x138b1a['old'],_0x2a7e3b[_0x54442e+_0x43afbb]['wordDiff']=_0x138b1a['new'];}_0x1d61f2=_0x36bb3d;}else _0x1d61f2++;}const _0x3c90d3=_0x2a7e3b['map'](_0x45de74=>{const _0x21a157=_0x45de74['line'];if(_0x21a157['startsWith']('+')){const _0x1657d1=_0x21a157['substring'](0x1),_0x1455e5=_0x45de74['wordDiff']?renderDiffLineWithWordHighlight(_0x1657d1,_0x45de74['wordDiff'],'add',_0x293f7d):highlightDiffLine(_0x1657d1,_0x293f7d),_0x5733cb='<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>'+_0x1714a0+'</span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>+</span>'+_0x1455e5+'</span></div>';return _0x1714a0+=0x1,_0x5733cb;}if(_0x21a157['startsWith']('-')){const _0x476315=_0x21a157['substring'](0x1),_0x1cec73=_0x45de74['wordDiff']?renderDiffLineWithWordHighlight(_0x476315,_0x45de74['wordDiff'],'remove',_0x293f7d):highlightDiffLine(_0x476315,_0x293f7d),_0x56308e='<div\x20class=\x22diff-line\x20diff-remove\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x453e0a+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>-</span>'+_0x1cec73+'</span></div>';return _0x453e0a+=0x1,_0x56308e;}if(_0x21a157['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'](_0x21a157)+'</span></div>';const _0x307a07=_0x21a157['startsWith']('\x20')?_0x21a157['substring'](0x1):_0x21a157,_0x140849=highlightDiffLine(_0x307a07,_0x293f7d),_0x2690a4='<div\x20class=\x22diff-line\x20diff-context\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x453e0a+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x1714a0+'</span><span\x20class=\x22diff-line-content\x22>\x20'+_0x140849+'</span></div>';return _0x453e0a+=0x1,_0x1714a0+=0x1,_0x2690a4;})['join']('');return'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>'+Utils['escapeHtml'](_0x15d488['header'])+'</div>'+_0x3c90d3+'</div>';})['join'](''),_0x5eb1a7=_0x4fe30c||'<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-'+_0x2c3d4a+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-header\x22\x20data-diff-id=\x22'+_0x2c3d4a+'\x22\x20data-file-name=\x22'+Utils['escapeHtml'](_0x32a54d)+'\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'+_0x516ade+'\x22>'+_0x5cf415+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-name\x22>'+Utils['escapeHtml'](_0x32a54d)+'</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>+'+_0x3cb2b7+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-del\x22>-'+_0x442748+'</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'+_0x2c3d4a+'\x22\x20data-collapsed=\x22'+_0x18297d+'\x22\x20type=\x22button\x22\x20aria-label=\x22'+(_0x18297d?'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'+(_0x18297d?'collapsed':'')+'\x22\x20id=\x22'+_0x2c3d4a+'\x22>'+_0x5eb1a7+'</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20';})['join']('');}
|
|
1
|
+
import{Utils}from'./app.js';export function parsePatchContent(_0x46415d){const _0x3c4589=[],_0x2bcd80=_0x46415d['split']('\x0a');let _0x4723be=null,_0x70eda2=null;for(const _0x3df1d6 of _0x2bcd80){if(_0x3df1d6['startsWith']('diff\x20--git')){_0x4723be&&_0x70eda2&&_0x4723be['hunks']['push'](_0x70eda2);_0x4723be&&_0x3c4589['push'](_0x4723be);const _0x575dff=_0x3df1d6['match'](/diff --git a\/(.+?) b\/(.+)/);_0x4723be={'oldPath':_0x575dff?_0x575dff[0x1]:'','newPath':_0x575dff?_0x575dff[0x2]:'','hunks':[],'isDeleted':![]},_0x70eda2=null;}else{if(_0x3df1d6['startsWith']('deleted\x20file\x20mode')&&_0x4723be)_0x4723be['isDeleted']=!![];else{if(_0x3df1d6['startsWith']('@@'))_0x70eda2&&_0x4723be&&_0x4723be['hunks']['push'](_0x70eda2),_0x70eda2={'header':_0x3df1d6,'lines':[]};else _0x70eda2&&_0x70eda2['lines']['push'](_0x3df1d6);}}}return _0x4723be&&_0x70eda2&&_0x4723be['hunks']['push'](_0x70eda2),_0x4723be&&_0x3c4589['push'](_0x4723be),_0x3c4589;}export function parseHunkHeader(_0x1b9fe2){const _0x5d3487=_0x1b9fe2['match'](/@@ -(\d+),?\d* \+(\d+),?\d* @@/);if(_0x5d3487)return{'oldStart':parseInt(_0x5d3487[0x1],0xa),'newStart':parseInt(_0x5d3487[0x2],0xa)};return{'oldStart':0x1,'newStart':0x1};}export function highlightDiffLine(_0x2b872f,_0x57f732){const _0x3ce8f0=window['hljs']||(typeof hljs!=='undefined'?hljs:null);if(_0x3ce8f0&&_0x57f732)try{const _0x4bfa83=_0x3ce8f0['getLanguage'](_0x57f732)?_0x57f732:null;if(_0x4bfa83)return _0x3ce8f0['highlight'](_0x2b872f,{'language':_0x4bfa83})['value'];}catch(_0x4bd071){console['error']('Diff\x20syntax\x20highlighting\x20error:',_0x4bd071);}return Utils['escapeHtml'](_0x2b872f);}export function getFileLanguage(_0x591812){const _0x3918f4=_0x591812['split']('.')['pop']()['toLowerCase'](),_0x1714d0={'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 _0x1714d0[_0x3918f4]||null;}export function computeWordDiff(_0x333448,_0x29dba4){const _0xd18db0=_0x268eed=>{const _0x85d96d=[];let _0x11fe1d='',_0x2e492a=![];for(let _0xaaf189=0x0;_0xaaf189<_0x268eed['length'];_0xaaf189++){const _0x313876=_0x268eed[_0xaaf189],_0x5e0623=/\s/['test'](_0x313876);if(_0x11fe1d==='')_0x11fe1d=_0x313876,_0x2e492a=_0x5e0623;else _0x5e0623===_0x2e492a?_0x11fe1d+=_0x313876:(_0x85d96d['push'](_0x11fe1d),_0x11fe1d=_0x313876,_0x2e492a=_0x5e0623);}return _0x11fe1d&&_0x85d96d['push'](_0x11fe1d),_0x85d96d;},_0x434067=_0xd18db0(_0x333448),_0x5861e8=_0xd18db0(_0x29dba4),_0x3d834b=_0x434067['length'],_0x1db67f=_0x5861e8['length'],_0x2424f8=Array(_0x3d834b+0x1)['fill'](null)['map'](()=>Array(_0x1db67f+0x1)['fill'](0x0));for(let _0x5010f9=0x1;_0x5010f9<=_0x3d834b;_0x5010f9++){for(let _0xfa3ee=0x1;_0xfa3ee<=_0x1db67f;_0xfa3ee++){_0x434067[_0x5010f9-0x1]===_0x5861e8[_0xfa3ee-0x1]?_0x2424f8[_0x5010f9][_0xfa3ee]=_0x2424f8[_0x5010f9-0x1][_0xfa3ee-0x1]+0x1:_0x2424f8[_0x5010f9][_0xfa3ee]=Math['max'](_0x2424f8[_0x5010f9-0x1][_0xfa3ee],_0x2424f8[_0x5010f9][_0xfa3ee-0x1]);}}const _0x20e208={'old':[],'new':[]};let _0x1c663a=_0x3d834b,_0x13c00b=_0x1db67f;const _0x1bcb4c=[],_0xe7d738=[];while(_0x1c663a>0x0||_0x13c00b>0x0){if(_0x1c663a>0x0&&_0x13c00b>0x0&&_0x434067[_0x1c663a-0x1]===_0x5861e8[_0x13c00b-0x1])_0x1bcb4c['unshift']({'type':'equal','text':_0x434067[_0x1c663a-0x1]}),_0xe7d738['unshift']({'type':'equal','text':_0x5861e8[_0x13c00b-0x1]}),_0x1c663a--,_0x13c00b--;else{if(_0x13c00b>0x0&&(_0x1c663a===0x0||_0x2424f8[_0x1c663a][_0x13c00b-0x1]>=_0x2424f8[_0x1c663a-0x1][_0x13c00b]))_0xe7d738['unshift']({'type':'insert','text':_0x5861e8[_0x13c00b-0x1]}),_0x13c00b--;else _0x1c663a>0x0&&(_0x1bcb4c['unshift']({'type':'delete','text':_0x434067[_0x1c663a-0x1]}),_0x1c663a--);}}return _0x20e208['old']=_0x1bcb4c,_0x20e208['new']=_0xe7d738,_0x20e208;}export function renderDiffLineWithWordHighlight(_0xf493c0,_0x4ef43c,_0x559b08,_0x3dfb56){if(!_0x4ef43c||_0x4ef43c['length']===0x0)return highlightDiffLine(_0xf493c0,_0x3dfb56);let _0x4efb8a='';const _0x3f0524=_0x559b08==='add'?'diff-word-add':'diff-word-remove',_0x3dfae8=_0x559b08==='add'?'insert':'delete';for(const _0x550d04 of _0x4ef43c){const _0x8e2e84=Utils['escapeHtml'](_0x550d04['text']);_0x550d04['type']===_0x3dfae8?_0x4efb8a+='<span\x20class=\x22'+_0x3f0524+'\x22>'+_0x8e2e84+'</span>':_0x4efb8a+=_0x8e2e84;}return _0x4efb8a;}export function calculateDiffStats(_0x40472f){let _0x31d977=0x0,_0x57dd43=0x0,_0x10bcd0=0x0;return _0x40472f['forEach'](_0x2f26e2=>{let _0x431ace=0x0,_0x45d17e=0x0;_0x2f26e2['hunks']['forEach'](_0x11e4f0=>{_0x11e4f0['lines']['forEach'](_0x58d2b2=>{if(_0x58d2b2['startsWith']('+'))_0x431ace+=0x1;else{if(_0x58d2b2['startsWith']('-'))_0x45d17e+=0x1;}});}),(_0x431ace+_0x45d17e>0x0||_0x2f26e2['isDeleted'])&&(_0x10bcd0+=0x1),_0x31d977+=_0x431ace,_0x57dd43+=_0x45d17e;}),{'additions':_0x31d977,'deletions':_0x57dd43,'files':_0x10bcd0};}export function getFileStatus(_0x43f879,_0x42dba5,_0x35a0b7){if(_0x43f879['isDeleted'])return'deleted';if(_0x42dba5>0x0&&_0x35a0b7===0x0)return'added';return'modified';}export function safeBase64(_0x54092e){try{return btoa(unescape(encodeURIComponent(_0x54092e)));}catch(_0x22c7ba){return btoa(_0x54092e);}}export function getStorageKey(_0xedd309,_0x3e88a2){return _0xedd309+'-'+safeBase64(_0x3e88a2);}export function getCollapsedState(_0x13b6bd,_0x25c370){const _0x6f3311=localStorage['getItem'](getStorageKey(_0x13b6bd,_0x25c370));return _0x6f3311==='true';}export function renderUnifiedDiff(_0x2e0994,_0x1d7251){return _0x2e0994['map']((_0x41b7d5,_0x168f62)=>{const _0x38595c=_0x41b7d5['newPath']||_0x41b7d5['oldPath']||'unknown',_0x20d586='diff-'+_0x1d7251+'-'+_0x168f62,_0x5df090=getFileLanguage(_0x38595c),{additions:_0x4febd8,deletions:_0x1ac272}=calculateDiffStats([_0x41b7d5]),_0x51fada=getCollapsedState(_0x1d7251,_0x38595c),_0x529f56=getFileStatus(_0x41b7d5,_0x4febd8,_0x1ac272),_0x27fbe8=_0x529f56==='added'?'A':_0x529f56==='deleted'?'D':'M',_0x155f5e=_0x41b7d5['hunks']['map'](_0x46b9c4=>{const {oldStart:_0x449463,newStart:_0x520cec}=parseHunkHeader(_0x46b9c4['header']);let _0x117958=_0x449463,_0x2a9892=_0x520cec;const _0x2379b0=_0x46b9c4['lines']['map'](_0x4964f8=>({'line':_0x4964f8,'type':_0x4964f8['startsWith']('+')?'add':_0x4964f8['startsWith']('-')?'remove':_0x4964f8['startsWith']('\x5c')?'meta':'context'}));let _0x22c99f=0x0;while(_0x22c99f<_0x2379b0['length']){if(_0x2379b0[_0x22c99f]['type']==='remove'){let _0x144567=_0x22c99f,_0x1d2841=_0x22c99f;while(_0x1d2841<_0x2379b0['length']&&_0x2379b0[_0x1d2841]['type']==='remove')_0x1d2841++;let _0x429728=_0x1d2841,_0x1b5fd7=_0x429728;while(_0x1b5fd7<_0x2379b0['length']&&_0x2379b0[_0x1b5fd7]['type']==='add')_0x1b5fd7++;const _0xa129fa=_0x1d2841-_0x144567,_0x4b94d4=_0x1b5fd7-_0x429728,_0x489584=Math['min'](_0xa129fa,_0x4b94d4);for(let _0x368a52=0x0;_0x368a52<_0x489584;_0x368a52++){const _0x1cf8ec=_0x2379b0[_0x144567+_0x368a52]['line']['substring'](0x1),_0x369022=_0x2379b0[_0x429728+_0x368a52]['line']['substring'](0x1),_0x406f80=computeWordDiff(_0x1cf8ec,_0x369022);_0x2379b0[_0x144567+_0x368a52]['wordDiff']=_0x406f80['old'],_0x2379b0[_0x429728+_0x368a52]['wordDiff']=_0x406f80['new'];}_0x22c99f=_0x1b5fd7;}else _0x22c99f++;}const _0x5a5595=_0x2379b0['map'](_0x52248d=>{const _0x2321e0=_0x52248d['line'];if(_0x2321e0['startsWith']('+')){const _0x52d5c7=_0x2321e0['substring'](0x1),_0x34845d=_0x52248d['wordDiff']?renderDiffLineWithWordHighlight(_0x52d5c7,_0x52248d['wordDiff'],'add',_0x5df090):highlightDiffLine(_0x52d5c7,_0x5df090),_0x2f8296='<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>'+_0x2a9892+'</span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>+</span>'+_0x34845d+'</span></div>';return _0x2a9892+=0x1,_0x2f8296;}if(_0x2321e0['startsWith']('-')){const _0x4943d8=_0x2321e0['substring'](0x1),_0x2b8303=_0x52248d['wordDiff']?renderDiffLineWithWordHighlight(_0x4943d8,_0x52248d['wordDiff'],'remove',_0x5df090):highlightDiffLine(_0x4943d8,_0x5df090),_0x1e9cab='<div\x20class=\x22diff-line\x20diff-remove\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x117958+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>-</span>'+_0x2b8303+'</span></div>';return _0x117958+=0x1,_0x1e9cab;}if(_0x2321e0['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'](_0x2321e0)+'</span></div>';const _0x4884c0=_0x2321e0['startsWith']('\x20')?_0x2321e0['substring'](0x1):_0x2321e0,_0x1c9b37=highlightDiffLine(_0x4884c0,_0x5df090),_0x728a19='<div\x20class=\x22diff-line\x20diff-context\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x117958+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x2a9892+'</span><span\x20class=\x22diff-line-content\x22>\x20'+_0x1c9b37+'</span></div>';return _0x117958+=0x1,_0x2a9892+=0x1,_0x728a19;})['join']('');return'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>'+Utils['escapeHtml'](_0x46b9c4['header'])+'</div>'+_0x5a5595+'</div>';})['join'](''),_0x2b088d=_0x155f5e||'<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-'+_0x20d586+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-header\x22\x20data-diff-id=\x22'+_0x20d586+'\x22\x20data-file-name=\x22'+Utils['escapeHtml'](_0x38595c)+'\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'+_0x529f56+'\x22>'+_0x27fbe8+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-name\x22>'+Utils['escapeHtml'](_0x38595c)+'</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>+'+_0x4febd8+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-del\x22>-'+_0x1ac272+'</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'+_0x20d586+'\x22\x20data-collapsed=\x22'+_0x51fada+'\x22\x20type=\x22button\x22\x20aria-label=\x22'+(_0x51fada?'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'+(_0x51fada?'collapsed':'')+'\x22\x20id=\x22'+_0x20d586+'\x22>'+_0x2b088d+'</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20';})['join']('');}
|
|
@@ -18,7 +18,7 @@ Click **Add Automation** and configure:
|
|
|
18
18
|
- **Schedule** using the picker:
|
|
19
19
|
- Daily
|
|
20
20
|
- Weekly
|
|
21
|
-
- Monthly
|
|
21
|
+
- Monthly (one or more days, 1-28)
|
|
22
22
|
- Recurring (interval + optional time window + optional days)
|
|
23
23
|
- Custom cron expression
|
|
24
24
|
- **Run Target**:
|
|
@@ -43,6 +43,7 @@ Examples:
|
|
|
43
43
|
- Daily at 2:00 AM -> `0 2 * * *`
|
|
44
44
|
- Weekly Monday 9:00 AM -> `0 9 * * 1`
|
|
45
45
|
- Monthly 1st at midnight -> `0 0 1 * *`
|
|
46
|
+
- Monthly 1st and 16th at midnight -> `0 0 1,16 * *`
|
|
46
47
|
- Every 30 minutes -> `*/30 * * * *`
|
|
47
48
|
- Every 30 minutes, 9 AM-5 PM, weekdays -> `*/30 9-17 * * 1,2,3,4,5`
|
|
48
49
|
|
|
@@ -182,6 +182,7 @@ When creating an IBM i connection, select one or more features:
|
|
|
182
182
|
- **Connection** — Sync uses the SSH user and key configured on the connection. Requires the SSH feature to be enabled.
|
|
183
183
|
|
|
184
184
|
See [IBM i Sync](tasks/approval-and-deployment.md#ibm-i-sync) for usage details.
|
|
185
|
+
- **EJS Display Files** — Enables task-scoped Profound UI EJS screen overlays for RPG Open Access applications. Requests for `/profoundui/userdata/ui/*` can be served from files inside the task workspace instead of the IBM i IFS, so developers can preview EJS templates, CSS, and JavaScript without changing the shared system. Requires **PUI htdocs Path** (the base IBM i htdocs directory, for example `/www/myinstance/htdocs`) and the Tasks availability scope.
|
|
185
186
|
- **SSH** — SSH shell access to the IBM i system. Agents use the `ibmi-clcmd` skill to run CL commands remotely. Requires an SSH key.
|
|
186
187
|
- **Interactive Sessions** — Agent-driven interactive testing through Profound UI. Agents can operate 5250 terminal and Rich Display sessions, with recordings visible in task visualizations. Requires a password. Additional fields appear for **PUI Base URL**, **PUI Render Path**, and **PUI Launch Path**. This feature requires the Tasks availability scope.
|
|
187
188
|
|
|
@@ -213,6 +214,7 @@ When you save a connection, CoderFlow automatically imports and assigns the skil
|
|
|
213
214
|
| SQL Server | — | `sql` |
|
|
214
215
|
| IBM i | SQL | `sql` |
|
|
215
216
|
| IBM i | Build | `codermake` |
|
|
217
|
+
| IBM i | EJS Display Files | `ejs-screen-designer` |
|
|
216
218
|
| IBM i | SSH | `ibmi-clcmd` |
|
|
217
219
|
| IBM i | Interactive Sessions | `ibmi-interactive-session` |
|
|
218
220
|
| SSH | — | *(none)* |
|
|
@@ -21,10 +21,7 @@ You can edit files directly in the container using the built-in Monaco code edit
|
|
|
21
21
|
1. Click the **Edit** button next to any file in the Changed Files section
|
|
22
22
|
2. The editor opens with the current file content from the container
|
|
23
23
|
3. Make your edits in the editor
|
|
24
|
-
4. Click **Save
|
|
25
|
-
- Write your changes to the file in the container
|
|
26
|
-
- Sync the repository to update the diff view
|
|
27
|
-
- Refresh the Changed Files display with your new changes
|
|
24
|
+
4. Click **Save** to write your changes to the file in the container and refresh Changed Files with your new changes
|
|
28
25
|
|
|
29
26
|
The editor supports:
|
|
30
27
|
- Syntax highlighting for hundreds of languages (automatically detected from file extension)
|