@profoundlogic/coderflow-server 0.6.8 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-image/Dockerfile +3 -0
- package/dist/base-image/entrypoint.sh +13 -0
- package/dist/base-image/standard-instructions/ibmi-database-sql.md +11 -0
- package/dist/base-image/standard-instructions/ibmi-exploratory-verification.md +38 -0
- package/dist/base-image/standard-instructions/ibmi-output-requirements.md +6 -0
- package/dist/base-image/standard-instructions/output-requirements.md +18 -0
- package/dist/base-image/standard-instructions/screenshot-guidelines.md +17 -0
- package/dist/coder-server.js +1 -1
- package/dist/config.js +1 -1
- package/dist/lib/agent-keepalive.js +1 -1
- package/dist/lib/agent-models.js +1 -1
- package/dist/lib/api-keys.js +1 -1
- package/dist/lib/apiKeys.js +1 -1
- package/dist/lib/app-server-ports.js +1 -1
- package/dist/lib/auto-judge.js +1 -1
- package/dist/lib/automation-service.js +1 -1
- package/dist/lib/basic-auth.js +1 -1
- package/dist/lib/bindings.js +1 -1
- package/dist/lib/build-history.js +1 -1
- package/dist/lib/build-output-service.js +1 -1
- package/dist/lib/build-scheduler.js +1 -1
- package/dist/lib/build-service.js +1 -1
- package/dist/lib/ca-certificates.js +1 -1
- package/dist/lib/claude-oauth-refresh.js +1 -1
- package/dist/lib/cli/build.js +1 -1
- package/dist/lib/cli/cleanup-users.js +1 -1
- package/dist/lib/cli/config-command.js +1 -1
- package/dist/lib/cli/config.js +1 -1
- package/dist/lib/cli/create-user.js +1 -1
- package/dist/lib/cli/grant-admin.js +1 -1
- package/dist/lib/cli/init.js +1 -1
- package/dist/lib/cli/jira.js +1 -1
- package/dist/lib/cli/license.js +1 -1
- package/dist/lib/cli/list-roles.js +1 -1
- package/dist/lib/cli/list-users.js +1 -1
- package/dist/lib/cli/server-manager.js +1 -1
- package/dist/lib/cli/set-password.js +1 -1
- package/dist/lib/config-migration.js +1 -1
- package/dist/lib/container-credential-sync.js +1 -1
- package/dist/lib/container-tokens.js +1 -1
- package/dist/lib/data-dir.js +1 -1
- package/dist/lib/deployment-history.js +1 -1
- package/dist/lib/deployment-service.js +1 -1
- package/dist/lib/docker-utils.js +1 -1
- package/dist/lib/email.js +1 -1
- package/dist/lib/emailTemplates.js +1 -1
- package/dist/lib/entitlement.js +1 -1
- package/dist/lib/external-connections.js +1 -1
- package/dist/lib/fetch-utils.js +1 -1
- package/dist/lib/git-commit-details-route.js +1 -1
- package/dist/lib/git-history-diff-guardrails.js +1 -1
- package/dist/lib/git-provider-service.js +1 -1
- package/dist/lib/git-provider-setup/github-setup-handler.js +1 -1
- package/dist/lib/git-provider-setup/index.js +1 -1
- package/dist/lib/git-provider-setup/setup-factory.js +1 -1
- package/dist/lib/git-provider-setup/setup-interface.js +1 -1
- package/dist/lib/git-providers/azure-devops-provider.js +1 -1
- package/dist/lib/git-providers/github-app-provider.js +1 -1
- package/dist/lib/git-providers/index.js +1 -1
- package/dist/lib/git-providers/provider-factory.js +1 -1
- package/dist/lib/git-providers/provider-interface.js +1 -1
- package/dist/lib/github-urls.js +1 -1
- package/dist/lib/group-objective-linking.js +1 -1
- package/dist/lib/ibmi-sync.js +1 -1
- package/dist/lib/jira-client.js +1 -1
- package/dist/lib/judge-blinding.js +1 -1
- package/dist/lib/logger.js +1 -1
- package/dist/lib/migration-to-scoped-rbac.js +1 -1
- package/dist/lib/model-fetcher.js +1 -1
- package/dist/lib/notifications.js +1 -1
- package/dist/lib/objective-context.js +1 -1
- package/dist/lib/oidc-auth.js +1 -1
- package/dist/lib/oidc-device-flow.js +1 -1
- package/dist/lib/passwordTokens.js +1 -1
- package/dist/lib/permission-resolver.js +1 -1
- package/dist/lib/pin-cascade.js +1 -1
- package/dist/lib/provider-accounts.js +1 -1
- package/dist/lib/provider-oauth.js +1 -1
- package/dist/lib/provider-profile.js +1 -1
- package/dist/lib/provider-token-refresh.js +1 -1
- package/dist/lib/rbac-user-state.js +1 -1
- package/dist/lib/request-url.js +1 -1
- package/dist/lib/rewind.js +1 -1
- package/dist/lib/role-definitions.js +1 -1
- package/dist/lib/roles.js +1 -1
- package/dist/lib/secrets.js +1 -1
- package/dist/lib/setup-repo-git-auth.js +1 -1
- package/dist/lib/state-capture.js +1 -1
- package/dist/lib/static-files.js +1 -1
- package/dist/lib/task-aliases.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/objective-management.js +1 -1
- package/dist/routes/password.js +1 -1
- package/dist/routes/prompt.js +1 -1
- package/dist/routes/provider-auth.js +1 -1
- package/dist/routes/qa.js +1 -1
- package/dist/routes/roles.js +1 -1
- package/dist/routes/settings.js +1 -1
- package/dist/routes/skill-management.js +1 -1
- package/dist/routes/skills.js +1 -1
- package/dist/routes/tasks.js +1 -1
- package/dist/routes/teams.js +1 -1
- package/dist/routes/templates.js +1 -1
- package/dist/routes/test-task.js +1 -1
- package/dist/routes/test.js +1 -1
- package/dist/routes/users.js +1 -1
- package/dist/routes/visualizations.js +1 -1
- package/dist/scripts/create-user.js +1 -1
- package/dist/scripts/migrate-config-to-data-dir.js +1 -1
- package/dist/start.js +1 -1
- package/dist/web-ui/public/activity-detail-modal.js +1 -1
- package/dist/web-ui/public/activity-feed.js +1 -1
- package/dist/web-ui/public/activity-formatters.js +1 -1
- package/dist/web-ui/public/agent-event-parser.js +1 -1
- package/dist/web-ui/public/app.js +1 -1
- package/dist/web-ui/public/approve-dialog.js +1 -1
- package/dist/web-ui/public/automation-links.js +1 -1
- package/dist/web-ui/public/automation-schedule.js +1 -1
- package/dist/web-ui/public/comments-widget.js +1 -1
- package/dist/web-ui/public/diff-utils.js +1 -1
- package/dist/web-ui/public/environments.css +21 -0
- package/dist/web-ui/public/environments.html +79 -9
- package/dist/web-ui/public/environments.js +1 -1
- package/dist/web-ui/public/feedback-widget.js +1 -1
- package/dist/web-ui/public/file-selection-tree.js +1 -1
- package/dist/web-ui/public/git-history-lazy-utils.js +1 -1
- package/dist/web-ui/public/git-history.js +1 -1
- package/dist/web-ui/public/git-status.js +1 -1
- package/dist/web-ui/public/ibmi-file-filter.js +1 -1
- package/dist/web-ui/public/index.js +1 -1
- package/dist/web-ui/public/login.js +1 -1
- package/dist/web-ui/public/markdown-editor.js +1 -1
- package/dist/web-ui/public/markdown-file-editor.js +1 -1
- package/dist/web-ui/public/modal-maximize.js +1 -1
- package/dist/web-ui/public/notifications.js +1 -1
- package/dist/web-ui/public/permissions.js +1 -1
- package/dist/web-ui/public/pr-dialog.js +1 -1
- package/dist/web-ui/public/roles.js +1 -1
- package/dist/web-ui/public/server-health.js +1 -1
- package/dist/web-ui/public/settings.js +1 -1
- package/dist/web-ui/public/setup-password.js +1 -1
- package/dist/web-ui/public/skills.js +1 -1
- package/dist/web-ui/public/sse-client.js +1 -1
- package/dist/web-ui/public/sse-shared-worker.js +1 -1
- package/dist/web-ui/public/styles.css +52 -1
- package/dist/web-ui/public/task-judging-helpers.js +1 -1
- package/dist/web-ui/public/task.html +43 -5
- package/dist/web-ui/public/task.js +1 -1
- package/dist/web-ui/public/teams.js +1 -1
- package/dist/web-ui/public/terminal.js +1 -1
- package/dist/web-ui/public/theme.js +1 -1
- package/dist/web-ui/public/users.js +1 -1
- package/dist/web-ui/public/variant-grouping.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function isLogOnlyTaskType(_0x40b4ce){return _0x40b4ce==='test'||_0x40b4ce==='deploy';}export function createApproveDialogHTML(_0x2a0420='',_0x22dde8={}){const _0x27c913=_0x2a0420,_0x267596=_0x22dde8['useTaskPageStyles']?'modal\x20profound-approve-modal':'profound-feedback-modal\x20profound-approve-modal',_0x2accd2=_0x22dde8['useTaskPageStyles']?'modal-warning':'approve-modal-warning',_0x40bd83=_0x22dde8['useTaskPageStyles']?'modal-error':'approve-modal-error';return'\x0a\x20\x20\x20\x20<div\x20id=\x22'+_0x27c913+'approve-modal\x22\x20class=\x22'+_0x267596+'\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'+_0x27c913+'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'+_0x27c913+'approve-warning\x22\x20class=\x22'+_0x2accd2+'\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'+_0x27c913+'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'+_0x27c913+'approve-error\x22\x20class=\x22'+_0x40bd83+'\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'+_0x27c913+'approve-error-text\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-info\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'commit-message-input\x22>Commit\x20message:</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<textarea\x20id=\x22'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'pull-before-commit\x22\x20checked>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Pull\x20from\x20remote\x20after\x20commit\x20(rebase)</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'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'+_0x27c913+'cancel-approve\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x22\x20id=\x22'+_0x27c913+'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(_0x105a35={}){this['prefix']=_0x105a35['prefix']||'',this['onApprove']=_0x105a35['onApprove'],this['onSync']=_0x105a35['onSync'],this['onSuccess']=_0x105a35['onSuccess'],this['onError']=_0x105a35['onError'],this['onCreatePR']=_0x105a35['onCreatePR'],this['showToast']=_0x105a35['showToast']||(()=>{}),this['container']=_0x105a35['container']||document['body'],this['useTaskPageStyles']=_0x105a35['useTaskPageStyles']||![],this['baseUrl']=_0x105a35['baseUrl']||'',this['coderflowAttribution']=_0x105a35['coderflowAttribution'],this['onSyncToIbmi']=_0x105a35['onSyncToIbmi']||null,this['onGetSyncFiles']=_0x105a35['onGetSyncFiles']||null,this['taskData']=null,this['initialized']=![],this['isSyncing']=![],this['_createPR']=![],this['_attributionRequestId']=0x0,this['_syncFileTree']=null,this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}['init'](){if(this['initialized'])return;const _0x161e66=document['createElement']('div');_0x161e66['innerHTML']=createApproveDialogHTML(this['prefix'],{'useTaskPageStyles':this['useTaskPageStyles']}),this['container']['appendChild'](_0x161e66['firstElementChild']),this['_bindEvents'](),this['initialized']=!![];}['_el'](_0x1ac6ae){return document['getElementById'](''+this['prefix']+_0x1ac6ae);}['_bindEvents'](){const _0x26feb7=this['_el']('approve-modal'),_0x1aa939=this['_el']('close-approve-modal'),_0x3c8b71=this['_el']('cancel-approve'),_0x133ad6=this['_el']('confirm-approve'),_0x10d221=_0x26feb7?.['querySelector']('.modal-overlay'),_0x5aa46c=this['_el']('create-new-branch'),_0x5690bc=this['_el']('new-branch-input-container'),_0xb15d58=this['_el']('new-branch-name'),_0x4a4ec6=this['_el']('push-after-commit'),_0xc475df=this['_el']('create-pull-request'),_0x26d15e=this['_el']('pr-hint');_0x1aa939?.['addEventListener']('click',()=>this['hide']()),_0x3c8b71?.['addEventListener']('click',()=>this['hide']()),_0x10d221?.['addEventListener']('click',()=>this['hide']()),_0x133ad6?.['addEventListener']('click',()=>this['_handleApprove']());_0x5aa46c&&_0x5aa46c['addEventListener']('change',()=>{_0x5690bc&&(_0x5690bc['hidden']=!_0x5aa46c['checked']),_0x5aa46c['checked']&&_0xb15d58&&_0xb15d58['focus']();});_0xc475df&&_0x4a4ec6&&_0x5aa46c&&(_0xc475df['addEventListener']('change',()=>{this['_createPR']=_0xc475df['checked'];if(_0xc475df['checked']){_0x4a4ec6['checked']=!![],_0x4a4ec6['disabled']=!![],_0x5aa46c['checked']=!![],_0x5aa46c['disabled']=!![];_0x5690bc&&(_0x5690bc['hidden']=![]);if(_0x26d15e)_0x26d15e['hidden']=![];}else{_0x4a4ec6['disabled']=![],_0x5aa46c['disabled']=![];if(_0x26d15e)_0x26d15e['hidden']=!![];}}),_0x4a4ec6['addEventListener']('change',()=>{if(!_0x4a4ec6['checked']&&_0xc475df['checked']){_0xc475df['checked']=![],this['_createPR']=![],_0x4a4ec6['disabled']=![],_0x5aa46c['disabled']=![];if(_0x26d15e)_0x26d15e['hidden']=!![];}}));const _0x57f252=this['_el']('sync-to-ibmi');_0x57f252&&_0x57f252['addEventListener']('change',async _0x282b51=>{const _0x5c5e47=this['_el']('ibmi-sync-fields');if(_0x5c5e47)_0x5c5e47['hidden']=!_0x282b51['target']['checked'];if(_0x282b51['target']['checked']){const _0x4cce70=this['_el']('ibmi-sync-library'),_0x2f0afb=localStorage['getItem']('coderflow_ibmi_sync_library');_0x2f0afb&&_0x4cce70&&!_0x4cce70['value']&&(_0x4cce70['value']=_0x2f0afb);const _0x242aad=this['_el']('ibmi-sync-user');if(_0x242aad&&!_0x242aad['value']){const _0x44944f=localStorage['getItem']('coderflow_ibmi_sync_user');if(_0x44944f)_0x242aad['value']=_0x44944f;}const _0x4a6234=this['_el']('ibmi-sync-password');if(_0x4a6234)_0x4a6234['value']='';!this['_syncFileTree']&&this['onGetSyncFiles']&&this['taskData']?.['taskId']&&await this['_loadSyncFileTree']();}}),document['addEventListener']('keydown',_0xcfe57a=>{_0xcfe57a['key']==='Escape'&&_0x26feb7&&!_0x26feb7['hidden']&&this['hide']();});}async['_loadSyncFileTree'](){const _0x4622d4=this['_el']('ibmi-sync-file-tree'),_0x2869fd=this['_el']('ibmi-sync-files-summary');if(!_0x4622d4)return;_0x4622d4['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>Loading\x20files...</span>';if(_0x2869fd)_0x2869fd['textContent']='';try{const {files:_0x3839c8,absolutePaths:_0x4063f2}=await this['onGetSyncFiles'](this['taskData']['taskId']);this['_syncRelativeFiles']=_0x3839c8,this['_syncAbsolutePaths']=_0x4063f2;if(_0x3839c8['length']===0x0){_0x4622d4['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>No\x20changed\x20files\x20found.</span>';return;}const {FileSelectionTree:_0x291bd2}=await import('./file-selection-tree.js'),{validateIbmiFile:_0x452fae,hasKnownIbmiExtension:_0x3fe0a7}=await import('./ibmi-file-filter.js');this['_syncFileTree']=new _0x291bd2({'container':_0x4622d4,'files':_0x3839c8,'isPreselected':_0x3cd822=>{const {valid:_0x5e1084}=_0x452fae(_0x3cd822);return _0x5e1084&&_0x3fe0a7(_0x3cd822);},'isDisabled':_0x5ce124=>{const {valid:_0x556dea,reason:_0x37db6d}=_0x452fae(_0x5ce124);return{'disabled':!_0x556dea,'reason':_0x37db6d};},'isAutoCheckEligible':_0x7d7813=>{const {valid:_0x2c9115}=_0x452fae(_0x7d7813);return _0x2c9115&&_0x3fe0a7(_0x7d7813);},'onChange':_0x132ba6=>{_0x2869fd&&(_0x2869fd['textContent']=_0x132ba6['length']+'\x20of\x20'+_0x3839c8['length']+'\x20file'+(_0x3839c8['length']!==0x1?'s':'')+'\x20selected');}}),this['_syncFileTree']['render']();}catch(_0x9186b3){_0x4622d4['innerHTML']='<span\x20style=\x22color:\x20var(--color-danger,\x20#e55368);\x20font-size:\x2013px;\x22>Failed\x20to\x20load\x20files</span>';}}['showError'](_0x42a3f1){const _0x268737=this['_el']('approve-error'),_0x3249ad=this['_el']('approve-error-text');_0x268737&&_0x3249ad&&(_0x3249ad['textContent']=_0x42a3f1,_0x268737['hidden']=![],_0x268737['scrollIntoView']({'behavior':'smooth','block':'nearest'}));}['hideError'](){const _0x26909c=this['_el']('approve-error'),_0x2b5fad=this['_el']('approve-error-text');_0x26909c&&_0x2b5fad&&(_0x26909c['hidden']=!![],_0x2b5fad['textContent']='');}['_displayBranchInfo'](_0x27e369,_0xbec836={}){const _0x1dfbdd=this['_el']('approve-branches');if(!_0x1dfbdd)return;const _0x23fa57=[];for(const _0xc92e of _0x27e369){_0xbec836[_0xc92e['name']]&&_0x23fa57['push']({'repo':_0xc92e['name'],'branch':_0xbec836[_0xc92e['name']]});}if(_0x23fa57['length']>0x0){_0x1dfbdd['hidden']=![];if(_0x23fa57['length']===0x1)_0x1dfbdd['innerHTML']='<div\x20class=\x22branch-info\x22>Branch:\x20<code>'+_0x23fa57[0x0]['branch']+'</code></div>';else{const _0x2860c4=_0x23fa57['map'](_0x3556ee=>'<div\x20class=\x22branch-item\x22><strong>'+_0x3556ee['repo']+':</strong>\x20<code>'+_0x3556ee['branch']+'</code></div>')['join']('');_0x1dfbdd['innerHTML']='<div\x20class=\x22branch-info\x22>Branches:<div\x20class=\x22branch-list\x22>'+_0x2860c4+'</div></div>';}}else _0x1dfbdd['hidden']=!![],_0x1dfbdd['innerHTML']='';}['showWarning'](_0x3d9f7a){const _0x2f87c2=this['_el']('approve-warning'),_0x2d79c0=this['_el']('approve-warning-text');_0x2f87c2&&_0x2d79c0&&(_0x2d79c0['textContent']=_0x3d9f7a,_0x2f87c2['hidden']=![]);}['hideWarning'](){const _0x1ce355=this['_el']('approve-warning'),_0x521b73=this['_el']('approve-warning-text');_0x1ce355&&_0x521b73&&(_0x1ce355['hidden']=!![],_0x521b73['textContent']='');}['_stripCoAuthoredByLines'](_0xad038d){return _0xad038d['replace'](/^Co-Authored-By:.*$/gmi,'')['replace'](/^Learn more: https:\/\/coderflow\.ai\s*$/gm,'')['replace'](/\n{3,}/g,'\x0a\x0a')['trim']();}async['_addAttributionIfEnabled'](_0x1a45a7){try{let _0x5decbd;try{const _0x719f6d=await fetch(this['baseUrl']+'/settings');if(_0x719f6d['ok']){const _0x497a8e=await _0x719f6d['json']();_0x5decbd=_0x497a8e['coderflow_attribution']!==![];}}catch(_0x4725cc){}_0x5decbd===undefined&&(this['coderflowAttribution']!==undefined?_0x5decbd=this['coderflowAttribution']!==![]:_0x5decbd=!![]);const _0x2919e8=this['_stripCoAuthoredByLines'](_0x1a45a7);if(!_0x5decbd)return _0x2919e8;const _0x42f959='\x0a\x0aCo-Authored-By:\x20CoderFlow\x20<ai@coderflow.ai>\x0aLearn\x20more:\x20https://coderflow.ai';return _0x2919e8+_0x42f959;}catch(_0x46e012){return console['warn']('Failed\x20to\x20add\x20CoderFlow\x20attribution:',_0x46e012),_0x1a45a7;}}['show'](_0xa55f6){!this['initialized']&&this['init']();this['taskData']=_0xa55f6;const _0x315154=this['_el']('approve-modal'),_0x549584=this['_el']('commit-message-input'),_0x48fec6=this['_el']('pull-before-commit'),_0x53cebd=this['_el']('push-after-commit'),_0x3d8e45=this['_el']('create-new-branch'),_0x5e6ecb=this['_el']('new-branch-input-container'),_0x1893c4=this['_el']('new-branch-name'),_0x193056=this['_el']('approve-repo-name'),_0x4e7ebe=this['_el']('approve-stats'),_0x31f0ad=this['_el']('multi-repo-note');if(!_0x315154)return;this['hideError'](),this['hideWarning']();_0xa55f6['warning']&&this['showWarning'](_0xa55f6['warning']);const _0x31ae3c=_0xa55f6['reposChanged']||[];if(_0x31ae3c['length']===0x0&&!_0xa55f6['syncFirst']){this['showToast']('No\x20changes\x20to\x20approve','error');return;}this['_updateDisplay'](_0x31ae3c,_0xa55f6);const _0xe9d001=_0xa55f6['commitMessage']||'',_0x30cfb7=this['_stripCoAuthoredByLines'](_0xe9d001);_0x549584['value']=_0x30cfb7;if(_0x48fec6)_0x48fec6['checked']=!![];if(_0x53cebd)_0x53cebd['checked']=!![];_0x3d8e45&&(_0x3d8e45['checked']=![]);_0x5e6ecb&&(_0x5e6ecb['hidden']=!![]);_0x1893c4&&(_0x1893c4['value']='');if(_0x53cebd)_0x53cebd['disabled']=![];if(_0x3d8e45)_0x3d8e45['disabled']=![];this['updatePRSupport'](_0xa55f6['prSupported']===!![]);const _0x85c0a6=this['_el']('ibmi-sync-section');if(_0x85c0a6){_0x85c0a6['hidden']=!_0xa55f6['ibmiSyncAvailable'];const _0x19b48e=this['_el']('sync-to-ibmi'),_0x2032ba=this['_el']('ibmi-sync-fields'),_0x10bb64=this['_el']('ibmi-sync-library');if(_0x19b48e)_0x19b48e['checked']=![];if(_0x2032ba)_0x2032ba['hidden']=!![];if(_0x10bb64)_0x10bb64['value']='';const _0x398962=this['_el']('ibmi-sync-credentials-row');_0x398962&&(_0x398962['hidden']=!(_0xa55f6['ibmiSyncAvailable']&&_0xa55f6['syncCredentials']==='prompt'));}const _0x3eacb6=this['_el']('confirm-approve');_0xa55f6['syncFirst']&&this['onSync']?(_0x3eacb6&&(_0x3eacb6['disabled']=!![],_0x3eacb6['textContent']='Syncing...'),this['_performSync']()):_0x3eacb6&&(_0x3eacb6['disabled']=![],_0x3eacb6['textContent']='Commit\x20Changes');_0x315154['hidden']=![];const _0x4f816b=++this['_attributionRequestId'];void this['_applyAttributionAsync']({'requestId':_0x4f816b,'taskId':_0xa55f6['taskId'],'originalCommitMessage':_0x30cfb7}),setTimeout(()=>{_0x549584['focus'](),_0x549584['setSelectionRange'](0x0,_0x549584['value']['length']);},0x64);}['updatePRSupport'](_0xf987a){const _0x4bf9cb=this['_el']('pr-option-section'),_0x5838d0=this['_el']('create-pull-request'),_0x32297c=this['_el']('pr-hint'),_0x4173c6=this['_el']('push-after-commit'),_0x210bb0=this['_el']('create-new-branch');if(!_0x4bf9cb)return;if(_0xf987a){_0x4bf9cb['hidden']=![];_0x5838d0&&!_0x5838d0['disabled']&&(_0x5838d0['checked']=![]);if(_0x32297c)_0x32297c['hidden']=!![];this['_createPR']=![];return;}_0x5838d0?.['checked']&&(_0x5838d0['checked']=![]);if(_0x32297c)_0x32297c['hidden']=!![];if(_0x4173c6)_0x4173c6['disabled']=![];if(_0x210bb0)_0x210bb0['disabled']=![];this['_createPR']=![],_0x4bf9cb['hidden']=!![];}async['_applyAttributionAsync']({requestId:_0x5ab8e8,taskId:_0x232876,originalCommitMessage:_0x3a0372}){const _0x49e53d=this['_el']('commit-message-input');if(!_0x49e53d)return;const _0xe578f6=await this['_addAttributionIfEnabled'](_0x3a0372);if(_0x5ab8e8!==this['_attributionRequestId'])return;if(!this['taskData']||this['taskData']['taskId']!==_0x232876)return;if(!this['isVisible']())return;const _0x3d3c71=_0x1de05b=>_0x1de05b['replace'](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a');if(_0x3d3c71(_0x49e53d['value'])!==_0x3d3c71(_0x3a0372))return;_0x49e53d['value']=_0xe578f6;}['_updateDisplay'](_0x541292,_0x5e497b){const _0xb84532=this['_el']('approve-repo-name'),_0x5b65aa=this['_el']('approve-stats'),_0x88db66=this['_el']('multi-repo-note');if(_0x541292['length']===0x0){if(_0xb84532)_0xb84532['textContent']='Syncing...';if(_0x5b65aa)_0x5b65aa['textContent']='';if(_0x88db66)_0x88db66['hidden']=!![];return;}const _0x22de26=_0x541292['reduce']((_0x27e92f,_0x7cea82)=>_0x27e92f+(_0x7cea82['files_changed']||0x0),0x0),_0x195338=_0x541292['reduce']((_0x5c8abe,_0x260934)=>_0x5c8abe+(_0x260934['lines_added']||0x0),0x0),_0x47cd93=_0x541292['reduce']((_0x45e2e0,_0x4b4752)=>_0x45e2e0+(_0x4b4752['lines_deleted']||0x0),0x0);if(_0x541292['length']===0x1){if(_0xb84532)_0xb84532['textContent']=_0x541292[0x0]?.['name']||'repository';if(_0x88db66)_0x88db66['hidden']=!![];}else{const _0x5115e9=_0x541292['map'](_0x2d516a=>_0x2d516a['name'])['join'](',\x20');if(_0xb84532)_0xb84532['textContent']=_0x541292['length']+'\x20repositories:\x20'+_0x5115e9;if(_0x88db66)_0x88db66['hidden']=![];}_0x5b65aa&&(_0x5b65aa['textContent']=_0x22de26+'\x20file'+(_0x22de26===0x1?'':'s')+'\x20changed\x20(+'+_0x195338+'\x20-'+_0x47cd93+')'),this['_displayBranchInfo'](_0x541292,_0x5e497b?.['branches']||{});}async['_performSync'](){if(!this['onSync']||this['isSyncing'])return;this['isSyncing']=!![];const _0x47c852=this['_el']('confirm-approve');try{const _0x59392f=await this['onSync'](this['taskData']['taskId']);if(!this['isVisible']()){this['isSyncing']=![];return;}if(_0x59392f['repos_changed']){const _0x9086f0=this['taskData']['reposChanged']?.['length']||0x0,_0x27b0a3=this['taskData']['reposChanged']?.['reduce']((_0x253d67,_0x2f94bb)=>_0x253d67+(_0x2f94bb['files_changed']||0x0),0x0)||0x0;this['taskData']['reposChanged']=_0x59392f['repos_changed'];if(_0x59392f['current_branches']){const _0x54ed6f={...this['taskData']['branches']||{}};for(const [_0x237701,_0x54d475]of Object['entries'](_0x59392f['current_branches'])){_0x54d475?_0x54ed6f[_0x237701]=_0x54d475:delete _0x54ed6f[_0x237701];}this['taskData']['branches']=_0x54ed6f;}this['_updateDisplay'](_0x59392f['repos_changed'],this['taskData']);const _0x877666=_0x59392f['repos_changed']['length'],_0x2d3582=_0x59392f['repos_changed']['reduce']((_0x3d35e0,_0x54d488)=>_0x3d35e0+(_0x54d488['files_changed']||0x0),0x0);(_0x2d3582>_0x27b0a3||_0x877666>_0x9086f0)&&this['showWarning'](this['taskData']['warning']?this['taskData']['warning']+'\x20Additional\x20changes\x20detected\x20since\x20last\x20sync.':'Additional\x20changes\x20detected\x20since\x20last\x20sync.\x20Review\x20the\x20updated\x20file\x20list.');}_0x47c852&&(!this['taskData']['reposChanged']||this['taskData']['reposChanged']['length']===0x0?(_0x47c852['disabled']=!![],_0x47c852['textContent']='No\x20Changes',this['showError']('No\x20changes\x20to\x20approve\x20after\x20sync')):(_0x47c852['disabled']=![],_0x47c852['textContent']='Commit\x20Changes'));}catch(_0x5098bf){console['error']('Failed\x20to\x20sync\x20repos\x20before\x20approve:',_0x5098bf);if(!this['isVisible']()){this['isSyncing']=![];return;}this['showError']('Sync\x20failed:\x20'+_0x5098bf['message']+'.\x20You\x20can\x20still\x20commit\x20with\x20existing\x20staged\x20changes.'),_0x47c852&&(this['taskData']['reposChanged']&&this['taskData']['reposChanged']['length']>0x0?(_0x47c852['disabled']=![],_0x47c852['textContent']='Commit\x20Changes'):(_0x47c852['disabled']=!![],_0x47c852['textContent']='No\x20Changes'));}finally{this['isSyncing']=![];}}['hide'](){const _0x5e2368=this['_el']('approve-modal');_0x5e2368&&(_0x5e2368['hidden']=!![]),this['_syncFileTree']&&(this['_syncFileTree']['destroy'](),this['_syncFileTree']=null),this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}async['_handleApprove'](){const _0x43d827=this['_el']('commit-message-input'),_0x2d79ee=this['_el']('pull-before-commit'),_0x3c375d=this['_el']('push-after-commit'),_0x49fa01=this['_el']('create-new-branch'),_0x1e3249=this['_el']('new-branch-name'),_0x487f27=this['_el']('confirm-approve'),_0x37a387=_0x43d827['value']['trim'](),_0x54790c=_0x2d79ee?.['checked']??!![],_0x489928=_0x3c375d?.['checked']??!![],_0x5b7eb3=_0x49fa01?.['checked']||![],_0x3fee88=_0x1e3249?.['value']['trim']()||'';this['hideError']();if(!_0x37a387){this['showError']('Commit\x20message\x20is\x20required'),_0x43d827['focus']();return;}if(_0x5b7eb3&&!_0x3fee88){this['showError']('Branch\x20name\x20is\x20required\x20when\x20creating\x20a\x20new\x20branch'),_0x1e3249?.['focus']();return;}if(_0x5b7eb3&&_0x3fee88){const _0x4a601b=/[\s~^:?*\[\\]/;if(_0x4a601b['test'](_0x3fee88)){this['showError']('Invalid\x20branch\x20name.\x20Avoid\x20spaces\x20and\x20special\x20characters\x20like\x20~\x20^\x20:\x20?\x20*\x20[\x20\x5c'),_0x1e3249?.['focus']();return;}}const _0x5374eb=this['_el']('sync-to-ibmi')?.['checked'];if(_0x5374eb){const _0x58b75e=this['_el']('ibmi-sync-library')?.['value']?.['trim']();if(!_0x58b75e){this['showError']('IBM\x20i\x20library\x20name\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-library')?.['focus']();return;}if(this['_syncFileTree']){const _0x9e0522=this['_syncFileTree']['getSelectedFiles']();if(_0x9e0522['length']===0x0){this['showError']('Select\x20at\x20least\x20one\x20file\x20to\x20sync');return;}}if(this['taskData']?.['syncCredentials']==='prompt'){const _0x497c6e=this['_el']('ibmi-sync-user')?.['value']?.['trim']();if(!_0x497c6e){this['showError']('User\x20profile\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-user')?.['focus']();return;}const _0x4a0d15=this['_el']('ibmi-sync-password')?.['value'];if(!_0x4a0d15){this['showError']('Password\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-password')?.['focus']();return;}}}const _0x2f7a60=_0x487f27?.['textContent']||'Commit\x20Changes';_0x487f27&&(_0x487f27['disabled']=!![],_0x5b7eb3?_0x487f27['textContent']='Creating\x20branch\x20&\x20committing...':_0x487f27['textContent']=_0x54790c?'Pulling\x20&\x20Committing...':'Committing...');try{const _0x50af32={'commit_message':_0x37a387,'pull':_0x54790c,'push':_0x489928};_0x5b7eb3&&_0x3fee88&&(_0x50af32['new_branch']=_0x3fee88);let _0x457281=null;this['onApprove']&&(_0x457281=await this['onApprove'](this['taskData']['taskId'],_0x50af32));let _0x14ef64='Changes\x20committed';if(_0x5b7eb3)_0x14ef64='Changes\x20committed\x20to\x20new\x20branch\x20\x27'+_0x3fee88+'\x27',_0x489928&&(_0x14ef64+='\x20and\x20pushed');else{if(_0x54790c&&_0x489928)_0x14ef64='Changes\x20pulled,\x20committed,\x20and\x20pushed';else{if(_0x54790c)_0x14ef64='Changes\x20pulled\x20and\x20committed';else _0x489928&&(_0x14ef64='Changes\x20committed\x20and\x20pushed');}}const _0x4cb5dc=this['_el']('sync-to-ibmi')?.['checked'];let _0x2bfd66=null,_0x45adbd=null,_0x1ffb0e=null,_0x1a7e31=null;if(_0x4cb5dc&&this['onSyncToIbmi']){_0x2bfd66=this['_el']('ibmi-sync-library')?.['value']?.['trim']()?.['toUpperCase'](),_0x45adbd=this['_el']('ibmi-sync-user')?.['value']?.['trim']()?.['toUpperCase']()||null,_0x1ffb0e=this['_el']('ibmi-sync-password')?.['value']||null;if(this['_syncFileTree']&&this['_syncRelativeFiles']&&this['_syncAbsolutePaths']){const _0x126987=this['_syncFileTree']['getSelectedFiles']();_0x1a7e31=_0x126987['map'](_0x49f5d6=>{const _0x24b1e3=this['_syncRelativeFiles']['indexOf'](_0x49f5d6);return _0x24b1e3>=0x0?this['_syncAbsolutePaths'][_0x24b1e3]:_0x49f5d6;});}}this['showToast'](_0x14ef64,'success'),this['hide']();if(this['_createPR']&&this['onCreatePR'])try{await this['onCreatePR'](this['taskData']['taskId'],_0x457281||{});}catch(_0x5d1e1f){console['warn']('PR\x20creation\x20failed\x20or\x20cancelled:',_0x5d1e1f);}if(_0x4cb5dc&&this['onSyncToIbmi']&&_0x2bfd66){localStorage['setItem']('coderflow_ibmi_sync_library',_0x2bfd66);if(_0x45adbd)localStorage['setItem']('coderflow_ibmi_sync_user',_0x45adbd);try{await this['onSyncToIbmi'](this['taskData']['taskId'],_0x2bfd66,_0x45adbd,_0x1ffb0e,_0x1a7e31);}catch(_0x2c4b2a){this['showToast']('Sync\x20failed:\x20'+_0x2c4b2a['message'],'error');}}this['onSuccess']&&this['onSuccess'](this['taskData']);}catch(_0x1da6d7){console['error']('Failed\x20to\x20approve\x20changes',_0x1da6d7),this['showError']('Failed\x20to\x20commit:\x20'+_0x1da6d7['message']),_0x487f27&&(_0x487f27['disabled']=![],_0x487f27['textContent']=_0x2f7a60),this['onError']&&this['onError'](_0x1da6d7);}}['isVisible'](){const _0x4aa70b=this['_el']('approve-modal');return _0x4aa70b&&!_0x4aa70b['hidden'];}['destroy'](){const _0x44c785=this['_el']('approve-modal');_0x44c785&&_0x44c785['remove'](),this['initialized']=![];}}export function getApproveState(_0x4dcb3f,_0xe2fa70){if(!_0x4dcb3f)return{'canApprove':![],'reason':'No\x20task\x20data'};if(isLogOnlyTaskType(_0x4dcb3f['taskType']))return{'canApprove':![],'reason':(_0x4dcb3f['taskType']==='test'?'Test':'Deploy')+'\x20tasks\x20cannot\x20be\x20approved'};const _0x17ee29=_0xe2fa70?.['repos_changed']?.['length']>0x0,_0x57bb82=_0x4dcb3f['status']==='completed'||_0x4dcb3f['status']==='failed'||_0x4dcb3f['status']==='interrupted',_0x3f5f98=_0x4dcb3f['containerState']==='running',_0x423e7c=_0x4dcb3f['approvedBy']!==undefined&&_0x4dcb3f['approvedBy']!==null;if(_0x423e7c){const _0x497d8a=_0x4dcb3f['approvedBy']['name']||_0x4dcb3f['approvedBy']['username']||'user';return{'canApprove':![],'reason':'Already\x20approved\x20by\x20'+_0x497d8a};}if(!_0x17ee29)return{'canApprove':![],'reason':'No\x20changes\x20to\x20approve'};if(!_0x57bb82)return{'canApprove':![],'reason':'Task\x20must\x20complete\x20first'};if(!_0x4dcb3f['containerId'])return{'canApprove':![],'reason':'Container\x20no\x20longer\x20available'};if(!_0x3f5f98)return{'canApprove':![],'reason':'Container\x20is\x20not\x20running'};return{'canApprove':!![],'reason':'Ready\x20to\x20approve'};}
|
|
1
|
+
function isLogOnlyTaskType(_0xfc6417){return _0xfc6417==='test'||_0xfc6417==='deploy';}export function createApproveDialogHTML(_0x1df728='',_0x132d39={}){const _0x681bb5=_0x1df728,_0x541821=_0x132d39['useTaskPageStyles']?'modal\x20profound-approve-modal':'profound-feedback-modal\x20profound-approve-modal',_0x1c3d1e=_0x132d39['useTaskPageStyles']?'modal-warning':'approve-modal-warning',_0x503be5=_0x132d39['useTaskPageStyles']?'modal-error':'approve-modal-error';return'\x0a\x20\x20\x20\x20<div\x20id=\x22'+_0x681bb5+'approve-modal\x22\x20class=\x22'+_0x541821+'\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'+_0x681bb5+'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'+_0x681bb5+'approve-warning\x22\x20class=\x22'+_0x1c3d1e+'\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'+_0x681bb5+'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'+_0x681bb5+'approve-error\x22\x20class=\x22'+_0x503be5+'\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'+_0x681bb5+'approve-error-text\x22></span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-section\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22modal-info\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20id=\x22'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'commit-message-input\x22>Commit\x20message:</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<textarea\x20id=\x22'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'pull-before-commit\x22\x20checked>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span>Pull\x20from\x20remote\x20after\x20commit\x20(rebase)</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</label>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<label\x20class=\x22checkbox-label\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<input\x20type=\x22checkbox\x22\x20id=\x22'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'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'+_0x681bb5+'cancel-approve\x22>Cancel</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22btn-primary\x22\x20id=\x22'+_0x681bb5+'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(_0x4eae01={}){this['prefix']=_0x4eae01['prefix']||'',this['onApprove']=_0x4eae01['onApprove'],this['onSync']=_0x4eae01['onSync'],this['onSuccess']=_0x4eae01['onSuccess'],this['onError']=_0x4eae01['onError'],this['onCreatePR']=_0x4eae01['onCreatePR'],this['showToast']=_0x4eae01['showToast']||(()=>{}),this['container']=_0x4eae01['container']||document['body'],this['useTaskPageStyles']=_0x4eae01['useTaskPageStyles']||![],this['baseUrl']=_0x4eae01['baseUrl']||'',this['coderflowAttribution']=_0x4eae01['coderflowAttribution'],this['onSyncToIbmi']=_0x4eae01['onSyncToIbmi']||null,this['onGetSyncFiles']=_0x4eae01['onGetSyncFiles']||null,this['taskData']=null,this['initialized']=![],this['isSyncing']=![],this['_createPR']=![],this['_attributionRequestId']=0x0,this['_syncFileTree']=null,this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}['init'](){if(this['initialized'])return;const _0x305184=document['createElement']('div');_0x305184['innerHTML']=createApproveDialogHTML(this['prefix'],{'useTaskPageStyles':this['useTaskPageStyles']}),this['container']['appendChild'](_0x305184['firstElementChild']),this['_bindEvents'](),this['initialized']=!![];}['_el'](_0x3232b7){return document['getElementById'](''+this['prefix']+_0x3232b7);}['_bindEvents'](){const _0x10ec2e=this['_el']('approve-modal'),_0x3e68da=this['_el']('close-approve-modal'),_0x5c822e=this['_el']('cancel-approve'),_0x5987d5=this['_el']('confirm-approve'),_0x1ac483=_0x10ec2e?.['querySelector']('.modal-overlay'),_0x181782=this['_el']('create-new-branch'),_0x3154a9=this['_el']('new-branch-input-container'),_0x13842c=this['_el']('new-branch-name'),_0x3596c6=this['_el']('push-after-commit'),_0x3e5e0b=this['_el']('create-pull-request'),_0x27b862=this['_el']('pr-hint');_0x3e68da?.['addEventListener']('click',()=>this['hide']()),_0x5c822e?.['addEventListener']('click',()=>this['hide']()),_0x1ac483?.['addEventListener']('click',()=>this['hide']()),_0x5987d5?.['addEventListener']('click',()=>this['_handleApprove']());_0x181782&&_0x181782['addEventListener']('change',()=>{_0x3154a9&&(_0x3154a9['hidden']=!_0x181782['checked']),_0x181782['checked']&&_0x13842c&&_0x13842c['focus']();});_0x3e5e0b&&_0x3596c6&&_0x181782&&(_0x3e5e0b['addEventListener']('change',()=>{this['_createPR']=_0x3e5e0b['checked'];if(_0x3e5e0b['checked']){_0x3596c6['checked']=!![],_0x3596c6['disabled']=!![],_0x181782['checked']=!![],_0x181782['disabled']=!![];_0x3154a9&&(_0x3154a9['hidden']=![]);if(_0x27b862)_0x27b862['hidden']=![];}else{_0x3596c6['disabled']=![],_0x181782['disabled']=![];if(_0x27b862)_0x27b862['hidden']=!![];}}),_0x3596c6['addEventListener']('change',()=>{if(!_0x3596c6['checked']&&_0x3e5e0b['checked']){_0x3e5e0b['checked']=![],this['_createPR']=![],_0x3596c6['disabled']=![],_0x181782['disabled']=![];if(_0x27b862)_0x27b862['hidden']=!![];}}));const _0xa49f15=this['_el']('sync-to-ibmi');_0xa49f15&&_0xa49f15['addEventListener']('change',async _0x43628b=>{const _0xd1d47d=this['_el']('ibmi-sync-fields');if(_0xd1d47d)_0xd1d47d['hidden']=!_0x43628b['target']['checked'];if(_0x43628b['target']['checked']){const _0x66618e=this['_el']('ibmi-sync-library'),_0x35fa50=localStorage['getItem']('coderflow_ibmi_sync_library');_0x35fa50&&_0x66618e&&!_0x66618e['value']&&(_0x66618e['value']=_0x35fa50);const _0x5f37df=this['_el']('ibmi-sync-user');if(_0x5f37df&&!_0x5f37df['value']){const _0x31bb9b=localStorage['getItem']('coderflow_ibmi_sync_user');if(_0x31bb9b)_0x5f37df['value']=_0x31bb9b;}const _0x33de49=this['_el']('ibmi-sync-password');if(_0x33de49)_0x33de49['value']='';!this['_syncFileTree']&&this['onGetSyncFiles']&&this['taskData']?.['taskId']&&await this['_loadSyncFileTree']();}}),document['addEventListener']('keydown',_0x13f703=>{_0x13f703['key']==='Escape'&&_0x10ec2e&&!_0x10ec2e['hidden']&&this['hide']();});}async['_loadSyncFileTree'](){const _0x7b728a=this['_el']('ibmi-sync-file-tree'),_0x1ecd06=this['_el']('ibmi-sync-files-summary');if(!_0x7b728a)return;_0x7b728a['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>Loading\x20files...</span>';if(_0x1ecd06)_0x1ecd06['textContent']='';try{const {files:_0xe66283,absolutePaths:_0x32e88e}=await this['onGetSyncFiles'](this['taskData']['taskId']);this['_syncRelativeFiles']=_0xe66283,this['_syncAbsolutePaths']=_0x32e88e;if(_0xe66283['length']===0x0){_0x7b728a['innerHTML']='<span\x20style=\x22color:\x20var(--color-text-muted,\x20#888);\x20font-size:\x2013px;\x22>No\x20changed\x20files\x20found.</span>';return;}const {FileSelectionTree:_0x7de8f0}=await import('./file-selection-tree.js'),{validateIbmiFile:_0x59e28c,hasKnownIbmiExtension:_0x13db48}=await import('./ibmi-file-filter.js');this['_syncFileTree']=new _0x7de8f0({'container':_0x7b728a,'files':_0xe66283,'isPreselected':_0x44273e=>{const {valid:_0x301c67}=_0x59e28c(_0x44273e);return _0x301c67&&_0x13db48(_0x44273e);},'isDisabled':_0x2aaaa9=>{const {valid:_0x514fa5,reason:_0x53223f}=_0x59e28c(_0x2aaaa9);return{'disabled':!_0x514fa5,'reason':_0x53223f};},'isAutoCheckEligible':_0x407731=>{const {valid:_0x47aee6}=_0x59e28c(_0x407731);return _0x47aee6&&_0x13db48(_0x407731);},'onChange':_0x917740=>{_0x1ecd06&&(_0x1ecd06['textContent']=_0x917740['length']+'\x20of\x20'+_0xe66283['length']+'\x20file'+(_0xe66283['length']!==0x1?'s':'')+'\x20selected');}}),this['_syncFileTree']['render']();}catch(_0xbd42cb){_0x7b728a['innerHTML']='<span\x20style=\x22color:\x20var(--color-danger,\x20#e55368);\x20font-size:\x2013px;\x22>Failed\x20to\x20load\x20files</span>';}}['showError'](_0x4f1167){const _0x11067a=this['_el']('approve-error'),_0x5326fb=this['_el']('approve-error-text');_0x11067a&&_0x5326fb&&(_0x5326fb['textContent']=_0x4f1167,_0x11067a['hidden']=![],_0x11067a['scrollIntoView']({'behavior':'smooth','block':'nearest'}));}['hideError'](){const _0x31b816=this['_el']('approve-error'),_0xf0d6a1=this['_el']('approve-error-text');_0x31b816&&_0xf0d6a1&&(_0x31b816['hidden']=!![],_0xf0d6a1['textContent']='');}['_displayBranchInfo'](_0x526398,_0x3e4def={}){const _0x390d01=this['_el']('approve-branches');if(!_0x390d01)return;const _0x3e4af5=[];for(const _0x47da1a of _0x526398){_0x3e4def[_0x47da1a['name']]&&_0x3e4af5['push']({'repo':_0x47da1a['name'],'branch':_0x3e4def[_0x47da1a['name']]});}if(_0x3e4af5['length']>0x0){_0x390d01['hidden']=![];if(_0x3e4af5['length']===0x1)_0x390d01['innerHTML']='<div\x20class=\x22branch-info\x22>Branch:\x20<code>'+_0x3e4af5[0x0]['branch']+'</code></div>';else{const _0x37dd9f=_0x3e4af5['map'](_0x1d777f=>'<div\x20class=\x22branch-item\x22><strong>'+_0x1d777f['repo']+':</strong>\x20<code>'+_0x1d777f['branch']+'</code></div>')['join']('');_0x390d01['innerHTML']='<div\x20class=\x22branch-info\x22>Branches:<div\x20class=\x22branch-list\x22>'+_0x37dd9f+'</div></div>';}}else _0x390d01['hidden']=!![],_0x390d01['innerHTML']='';}['showWarning'](_0x438fa5){const _0x3825f5=this['_el']('approve-warning'),_0x19367c=this['_el']('approve-warning-text');_0x3825f5&&_0x19367c&&(_0x19367c['textContent']=_0x438fa5,_0x3825f5['hidden']=![]);}['hideWarning'](){const _0x2a54f5=this['_el']('approve-warning'),_0x5be954=this['_el']('approve-warning-text');_0x2a54f5&&_0x5be954&&(_0x2a54f5['hidden']=!![],_0x5be954['textContent']='');}['_stripCoAuthoredByLines'](_0x599c71){return _0x599c71['replace'](/^Co-Authored-By:.*$/gmi,'')['replace'](/^Learn more: https:\/\/coderflow\.ai\s*$/gm,'')['replace'](/\n{3,}/g,'\x0a\x0a')['trim']();}async['_addAttributionIfEnabled'](_0x230ca5){try{let _0x4e7040;try{const _0x193fbc=await fetch(this['baseUrl']+'/settings');if(_0x193fbc['ok']){const _0x376a8c=await _0x193fbc['json']();_0x4e7040=_0x376a8c['coderflow_attribution']!==![];}}catch(_0x10d387){}_0x4e7040===undefined&&(this['coderflowAttribution']!==undefined?_0x4e7040=this['coderflowAttribution']!==![]:_0x4e7040=!![]);const _0x560eec=this['_stripCoAuthoredByLines'](_0x230ca5);if(!_0x4e7040)return _0x560eec;const _0x39c22e='\x0a\x0aCo-Authored-By:\x20CoderFlow\x20<ai@coderflow.ai>\x0aLearn\x20more:\x20https://coderflow.ai';return _0x560eec+_0x39c22e;}catch(_0x45153e){return console['warn']('Failed\x20to\x20add\x20CoderFlow\x20attribution:',_0x45153e),_0x230ca5;}}['show'](_0x1eb86e){!this['initialized']&&this['init']();this['taskData']=_0x1eb86e;const _0x34dd17=this['_el']('approve-modal'),_0x540f44=this['_el']('commit-message-input'),_0x11824b=this['_el']('pull-before-commit'),_0x389c6e=this['_el']('push-after-commit'),_0x2b8ea7=this['_el']('create-new-branch'),_0x559c89=this['_el']('new-branch-input-container'),_0x53aba3=this['_el']('new-branch-name'),_0x2fa3ea=this['_el']('approve-repo-name'),_0x420699=this['_el']('approve-stats'),_0x16faa3=this['_el']('multi-repo-note');if(!_0x34dd17)return;this['hideError'](),this['hideWarning']();_0x1eb86e['warning']&&this['showWarning'](_0x1eb86e['warning']);const _0x2c5ab9=_0x1eb86e['reposChanged']||[];if(_0x2c5ab9['length']===0x0&&!_0x1eb86e['syncFirst']){this['showToast']('No\x20changes\x20to\x20approve','error');return;}this['_updateDisplay'](_0x2c5ab9,_0x1eb86e);const _0x362297=_0x1eb86e['commitMessage']||'',_0x23ec14=this['_stripCoAuthoredByLines'](_0x362297);_0x540f44['value']=_0x23ec14;if(_0x11824b)_0x11824b['checked']=!![];if(_0x389c6e)_0x389c6e['checked']=!![];_0x2b8ea7&&(_0x2b8ea7['checked']=![]);_0x559c89&&(_0x559c89['hidden']=!![]);_0x53aba3&&(_0x53aba3['value']='');if(_0x389c6e)_0x389c6e['disabled']=![];if(_0x2b8ea7)_0x2b8ea7['disabled']=![];this['updatePRSupport'](_0x1eb86e['prSupported']===!![]);const _0x19dce8=this['_el']('ibmi-sync-section');if(_0x19dce8){_0x19dce8['hidden']=!_0x1eb86e['ibmiSyncAvailable'];const _0x754149=this['_el']('sync-to-ibmi'),_0x462b90=this['_el']('ibmi-sync-fields'),_0x3b04f7=this['_el']('ibmi-sync-library');if(_0x754149)_0x754149['checked']=![];if(_0x462b90)_0x462b90['hidden']=!![];if(_0x3b04f7)_0x3b04f7['value']='';const _0x5816d7=this['_el']('ibmi-sync-credentials-row');_0x5816d7&&(_0x5816d7['hidden']=!(_0x1eb86e['ibmiSyncAvailable']&&_0x1eb86e['syncCredentials']==='prompt'));}const _0x4e5148=this['_el']('confirm-approve');_0x1eb86e['syncFirst']&&this['onSync']?(_0x4e5148&&(_0x4e5148['disabled']=!![],_0x4e5148['textContent']='Syncing...'),this['_performSync']()):_0x4e5148&&(_0x4e5148['disabled']=![],_0x4e5148['textContent']='Commit\x20Changes');_0x34dd17['hidden']=![];const _0x35607d=++this['_attributionRequestId'];void this['_applyAttributionAsync']({'requestId':_0x35607d,'taskId':_0x1eb86e['taskId'],'originalCommitMessage':_0x23ec14}),setTimeout(()=>{_0x540f44['focus'](),_0x540f44['setSelectionRange'](0x0,_0x540f44['value']['length']);},0x64);}['updatePRSupport'](_0x51bec2){const _0x2a1ca2=this['_el']('pr-option-section'),_0x181da3=this['_el']('create-pull-request'),_0x28c68a=this['_el']('pr-hint'),_0xda12d8=this['_el']('push-after-commit'),_0x344474=this['_el']('create-new-branch');if(!_0x2a1ca2)return;if(_0x51bec2){_0x2a1ca2['hidden']=![];_0x181da3&&!_0x181da3['disabled']&&(_0x181da3['checked']=![]);if(_0x28c68a)_0x28c68a['hidden']=!![];this['_createPR']=![];return;}_0x181da3?.['checked']&&(_0x181da3['checked']=![]);if(_0x28c68a)_0x28c68a['hidden']=!![];if(_0xda12d8)_0xda12d8['disabled']=![];if(_0x344474)_0x344474['disabled']=![];this['_createPR']=![],_0x2a1ca2['hidden']=!![];}async['_applyAttributionAsync']({requestId:_0x5775a8,taskId:_0x35a071,originalCommitMessage:_0x2dda04}){const _0x754fe5=this['_el']('commit-message-input');if(!_0x754fe5)return;const _0x3321c3=await this['_addAttributionIfEnabled'](_0x2dda04);if(_0x5775a8!==this['_attributionRequestId'])return;if(!this['taskData']||this['taskData']['taskId']!==_0x35a071)return;if(!this['isVisible']())return;const _0x33d7b0=_0x58fdff=>_0x58fdff['replace'](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a');if(_0x33d7b0(_0x754fe5['value'])!==_0x33d7b0(_0x2dda04))return;_0x754fe5['value']=_0x3321c3;}['_updateDisplay'](_0x2c6c93,_0x24ebd3){const _0x311368=this['_el']('approve-repo-name'),_0x1552c4=this['_el']('approve-stats'),_0x277262=this['_el']('multi-repo-note');if(_0x2c6c93['length']===0x0){if(_0x311368)_0x311368['textContent']='Syncing...';if(_0x1552c4)_0x1552c4['textContent']='';if(_0x277262)_0x277262['hidden']=!![];return;}const _0x27d402=_0x2c6c93['reduce']((_0x3114e8,_0x111d69)=>_0x3114e8+(_0x111d69['files_changed']||0x0),0x0),_0x39be22=_0x2c6c93['reduce']((_0x1a50cf,_0x12aa16)=>_0x1a50cf+(_0x12aa16['lines_added']||0x0),0x0),_0x41119d=_0x2c6c93['reduce']((_0x1fa72a,_0x398754)=>_0x1fa72a+(_0x398754['lines_deleted']||0x0),0x0);if(_0x2c6c93['length']===0x1){if(_0x311368)_0x311368['textContent']=_0x2c6c93[0x0]?.['name']||'repository';if(_0x277262)_0x277262['hidden']=!![];}else{const _0x25adfb=_0x2c6c93['map'](_0x27d2df=>_0x27d2df['name'])['join'](',\x20');if(_0x311368)_0x311368['textContent']=_0x2c6c93['length']+'\x20repositories:\x20'+_0x25adfb;if(_0x277262)_0x277262['hidden']=![];}_0x1552c4&&(_0x1552c4['textContent']=_0x27d402+'\x20file'+(_0x27d402===0x1?'':'s')+'\x20changed\x20(+'+_0x39be22+'\x20-'+_0x41119d+')'),this['_displayBranchInfo'](_0x2c6c93,_0x24ebd3?.['branches']||{});}async['_performSync'](){if(!this['onSync']||this['isSyncing'])return;this['isSyncing']=!![];const _0xf23656=this['_el']('confirm-approve');try{const _0x4553da=await this['onSync'](this['taskData']['taskId']);if(!this['isVisible']()){this['isSyncing']=![];return;}if(_0x4553da['repos_changed']){const _0x41e036=this['taskData']['reposChanged']?.['length']||0x0,_0x4a7b1e=this['taskData']['reposChanged']?.['reduce']((_0x17e8a9,_0x1f676c)=>_0x17e8a9+(_0x1f676c['files_changed']||0x0),0x0)||0x0;this['taskData']['reposChanged']=_0x4553da['repos_changed'];if(_0x4553da['current_branches']){const _0x7a041b={...this['taskData']['branches']||{}};for(const [_0x10e673,_0x2e3f03]of Object['entries'](_0x4553da['current_branches'])){_0x2e3f03?_0x7a041b[_0x10e673]=_0x2e3f03:delete _0x7a041b[_0x10e673];}this['taskData']['branches']=_0x7a041b;}this['_updateDisplay'](_0x4553da['repos_changed'],this['taskData']);const _0x21289e=_0x4553da['repos_changed']['length'],_0x337589=_0x4553da['repos_changed']['reduce']((_0x1db39f,_0x56f9f0)=>_0x1db39f+(_0x56f9f0['files_changed']||0x0),0x0);(_0x337589>_0x4a7b1e||_0x21289e>_0x41e036)&&this['showWarning'](this['taskData']['warning']?this['taskData']['warning']+'\x20Additional\x20changes\x20detected\x20since\x20last\x20sync.':'Additional\x20changes\x20detected\x20since\x20last\x20sync.\x20Review\x20the\x20updated\x20file\x20list.');}_0xf23656&&(!this['taskData']['reposChanged']||this['taskData']['reposChanged']['length']===0x0?(_0xf23656['disabled']=!![],_0xf23656['textContent']='No\x20Changes',this['showError']('No\x20changes\x20to\x20approve\x20after\x20sync')):(_0xf23656['disabled']=![],_0xf23656['textContent']='Commit\x20Changes'));}catch(_0x425f66){console['error']('Failed\x20to\x20sync\x20repos\x20before\x20approve:',_0x425f66);if(!this['isVisible']()){this['isSyncing']=![];return;}this['showError']('Sync\x20failed:\x20'+_0x425f66['message']+'.\x20You\x20can\x20still\x20commit\x20with\x20existing\x20staged\x20changes.'),_0xf23656&&(this['taskData']['reposChanged']&&this['taskData']['reposChanged']['length']>0x0?(_0xf23656['disabled']=![],_0xf23656['textContent']='Commit\x20Changes'):(_0xf23656['disabled']=!![],_0xf23656['textContent']='No\x20Changes'));}finally{this['isSyncing']=![];}}['hide'](){const _0x275a2b=this['_el']('approve-modal');_0x275a2b&&(_0x275a2b['hidden']=!![]),this['_syncFileTree']&&(this['_syncFileTree']['destroy'](),this['_syncFileTree']=null),this['_syncRelativeFiles']=null,this['_syncAbsolutePaths']=null;}async['_handleApprove'](){const _0x2ce024=this['_el']('commit-message-input'),_0x401ab2=this['_el']('pull-before-commit'),_0x2eaa72=this['_el']('push-after-commit'),_0x2fc4b0=this['_el']('create-new-branch'),_0x26124d=this['_el']('new-branch-name'),_0x222b59=this['_el']('confirm-approve'),_0x260eeb=_0x2ce024['value']['trim'](),_0x3dbcb1=_0x401ab2?.['checked']??!![],_0x1d30fd=_0x2eaa72?.['checked']??!![],_0x1bd88c=_0x2fc4b0?.['checked']||![],_0x541f8b=_0x26124d?.['value']['trim']()||'';this['hideError']();if(!_0x260eeb){this['showError']('Commit\x20message\x20is\x20required'),_0x2ce024['focus']();return;}if(_0x1bd88c&&!_0x541f8b){this['showError']('Branch\x20name\x20is\x20required\x20when\x20creating\x20a\x20new\x20branch'),_0x26124d?.['focus']();return;}if(_0x1bd88c&&_0x541f8b){const _0x22b147=/[\s~^:?*\[\\]/;if(_0x22b147['test'](_0x541f8b)){this['showError']('Invalid\x20branch\x20name.\x20Avoid\x20spaces\x20and\x20special\x20characters\x20like\x20~\x20^\x20:\x20?\x20*\x20[\x20\x5c'),_0x26124d?.['focus']();return;}}const _0x4c8649=this['_el']('sync-to-ibmi')?.['checked'];if(_0x4c8649){const _0x343d28=this['_el']('ibmi-sync-library')?.['value']?.['trim']();if(!_0x343d28){this['showError']('IBM\x20i\x20library\x20name\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-library')?.['focus']();return;}if(this['_syncFileTree']){const _0x5c138f=this['_syncFileTree']['getSelectedFiles']();if(_0x5c138f['length']===0x0){this['showError']('Select\x20at\x20least\x20one\x20file\x20to\x20sync');return;}}if(this['taskData']?.['syncCredentials']==='prompt'){const _0x38d095=this['_el']('ibmi-sync-user')?.['value']?.['trim']();if(!_0x38d095){this['showError']('User\x20profile\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-user')?.['focus']();return;}const _0x3b05e0=this['_el']('ibmi-sync-password')?.['value'];if(!_0x3b05e0){this['showError']('Password\x20is\x20required\x20for\x20sync'),this['_el']('ibmi-sync-password')?.['focus']();return;}}}const _0x38c629=_0x222b59?.['textContent']||'Commit\x20Changes';_0x222b59&&(_0x222b59['disabled']=!![],_0x1bd88c?_0x222b59['textContent']='Creating\x20branch\x20&\x20committing...':_0x222b59['textContent']=_0x3dbcb1?'Pulling\x20&\x20Committing...':'Committing...');try{const _0x28f7a3={'commit_message':_0x260eeb,'pull':_0x3dbcb1,'push':_0x1d30fd};_0x1bd88c&&_0x541f8b&&(_0x28f7a3['new_branch']=_0x541f8b);let _0x5d58a7=null;this['onApprove']&&(_0x5d58a7=await this['onApprove'](this['taskData']['taskId'],_0x28f7a3));let _0x4826ad='Changes\x20committed';if(_0x1bd88c)_0x4826ad='Changes\x20committed\x20to\x20new\x20branch\x20\x27'+_0x541f8b+'\x27',_0x1d30fd&&(_0x4826ad+='\x20and\x20pushed');else{if(_0x3dbcb1&&_0x1d30fd)_0x4826ad='Changes\x20pulled,\x20committed,\x20and\x20pushed';else{if(_0x3dbcb1)_0x4826ad='Changes\x20pulled\x20and\x20committed';else _0x1d30fd&&(_0x4826ad='Changes\x20committed\x20and\x20pushed');}}const _0x373c47=this['_el']('sync-to-ibmi')?.['checked'];let _0x277eb4=null,_0x9cfe3c=null,_0x8cde5d=null,_0x42b53d=null;if(_0x373c47&&this['onSyncToIbmi']){_0x277eb4=this['_el']('ibmi-sync-library')?.['value']?.['trim']()?.['toUpperCase'](),_0x9cfe3c=this['_el']('ibmi-sync-user')?.['value']?.['trim']()?.['toUpperCase']()||null,_0x8cde5d=this['_el']('ibmi-sync-password')?.['value']||null;if(this['_syncFileTree']&&this['_syncRelativeFiles']&&this['_syncAbsolutePaths']){const _0x94d222=this['_syncFileTree']['getSelectedFiles']();_0x42b53d=_0x94d222['map'](_0x5e18da=>{const _0x28c543=this['_syncRelativeFiles']['indexOf'](_0x5e18da);return _0x28c543>=0x0?this['_syncAbsolutePaths'][_0x28c543]:_0x5e18da;});}}this['showToast'](_0x4826ad,'success'),this['hide']();if(this['_createPR']&&this['onCreatePR'])try{await this['onCreatePR'](this['taskData']['taskId'],_0x5d58a7||{});}catch(_0xa95c57){console['warn']('PR\x20creation\x20failed\x20or\x20cancelled:',_0xa95c57);}if(_0x373c47&&this['onSyncToIbmi']&&_0x277eb4){localStorage['setItem']('coderflow_ibmi_sync_library',_0x277eb4);if(_0x9cfe3c)localStorage['setItem']('coderflow_ibmi_sync_user',_0x9cfe3c);try{await this['onSyncToIbmi'](this['taskData']['taskId'],_0x277eb4,_0x9cfe3c,_0x8cde5d,_0x42b53d);}catch(_0x40bae5){this['showToast']('Sync\x20failed:\x20'+_0x40bae5['message'],'error');}}this['onSuccess']&&this['onSuccess'](this['taskData']);}catch(_0x34a33a){console['error']('Failed\x20to\x20approve\x20changes',_0x34a33a),this['showError']('Failed\x20to\x20commit:\x20'+_0x34a33a['message']),_0x222b59&&(_0x222b59['disabled']=![],_0x222b59['textContent']=_0x38c629),this['onError']&&this['onError'](_0x34a33a);}}['isVisible'](){const _0x187d8d=this['_el']('approve-modal');return _0x187d8d&&!_0x187d8d['hidden'];}['destroy'](){const _0x2e0fe2=this['_el']('approve-modal');_0x2e0fe2&&_0x2e0fe2['remove'](),this['initialized']=![];}}export function getApproveState(_0x1456b8,_0x592987){if(!_0x1456b8)return{'canApprove':![],'reason':'No\x20task\x20data'};if(isLogOnlyTaskType(_0x1456b8['taskType']))return{'canApprove':![],'reason':(_0x1456b8['taskType']==='test'?'Test':'Deploy')+'\x20tasks\x20cannot\x20be\x20approved'};const _0x19eab7=_0x592987?.['repos_changed']?.['length']>0x0,_0x17966a=_0x1456b8['status']==='completed'||_0x1456b8['status']==='failed'||_0x1456b8['status']==='interrupted',_0x57f18a=_0x1456b8['containerState']==='running',_0x2c55a2=_0x1456b8['approvedBy']!==undefined&&_0x1456b8['approvedBy']!==null;if(_0x2c55a2){const _0x95e793=_0x1456b8['approvedBy']['name']||_0x1456b8['approvedBy']['username']||'user';return{'canApprove':![],'reason':'Already\x20approved\x20by\x20'+_0x95e793};}if(!_0x19eab7)return{'canApprove':![],'reason':'No\x20changes\x20to\x20approve'};if(!_0x17966a)return{'canApprove':![],'reason':'Task\x20must\x20complete\x20first'};if(!_0x1456b8['containerId'])return{'canApprove':![],'reason':'Container\x20no\x20longer\x20available'};if(!_0x57f18a)return{'canApprove':![],'reason':'Container\x20is\x20not\x20running'};return{'canApprove':!![],'reason':'Ready\x20to\x20approve'};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function buildAutomationEnvironmentHref(
|
|
1
|
+
export function buildAutomationEnvironmentHref(_0x5b9428,_0x26054b){const _0x580d96=new URLSearchParams();_0x5b9428&&_0x580d96['set']('env',String(_0x5b9428));_0x580d96['set']('tab','automations');_0x26054b&&_0x580d96['set']('automation',String(_0x26054b));const _0x5af50d=_0x580d96['toString']();return'environments.html'+(_0x5af50d?'?'+_0x5af50d:'');}export function buildAutomationTaskFilterHref(_0x26453d){const _0x41f05a=new URLSearchParams();_0x26453d&&_0x41f05a['set']('automation',String(_0x26453d));const _0x34383d=_0x41f05a['toString']();return'index.html'+(_0x34383d?'?'+_0x34383d:'');}export function parseAutomationDeepLinkParams(_0x4eb29f=''){const _0x19c9e9=new URLSearchParams(_0x4eb29f||'');return{'env':_0x19c9e9['get']('env'),'tab':_0x19c9e9['get']('tab'),'automation':_0x19c9e9['get']('automation')};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const AUTOMATION_MONTHLY_DAY_MIN=0x1;export const AUTOMATION_MONTHLY_DAY_MAX=0x1c;const DEFAULT_SCHEDULE_FORM_STATE=Object['freeze']({'frequency':'daily','dailyHour':'2','dailyMinute':'0','weeklyDay':'1','weeklyHour':'9','weeklyMinute':'0','monthlyDay':'1','monthlyHour':'0','monthlyMinute':'0','recurringInterval':'*/30\x20*\x20*\x20*\x20*','recurringStartHour':'','recurringEndHour':'','recurringDayToken':'*','customCron':''}),RECURRING_INTERVAL_STEPS=['2','4','6','8','12'];function createDefaultScheduleFormState(){return{...DEFAULT_SCHEDULE_FORM_STATE};}function parseBoundedInteger(
|
|
1
|
+
export const AUTOMATION_MONTHLY_DAY_MIN=0x1;export const AUTOMATION_MONTHLY_DAY_MAX=0x1c;const DEFAULT_SCHEDULE_FORM_STATE=Object['freeze']({'frequency':'daily','dailyHour':'2','dailyMinute':'0','weeklyDay':'1','weeklyHour':'9','weeklyMinute':'0','monthlyDay':'1','monthlyHour':'0','monthlyMinute':'0','recurringInterval':'*/30\x20*\x20*\x20*\x20*','recurringStartHour':'','recurringEndHour':'','recurringDayToken':'*','customCron':''}),RECURRING_INTERVAL_STEPS=['2','4','6','8','12'];function createDefaultScheduleFormState(){return{...DEFAULT_SCHEDULE_FORM_STATE};}function parseBoundedInteger(_0x66e64,_0x41ac78,_0x18825c){const _0x3f7fc7=Number['parseInt'](_0x66e64,0xa);if(!Number['isInteger'](_0x3f7fc7)||_0x3f7fc7<_0x41ac78||_0x3f7fc7>_0x18825c)return null;return _0x3f7fc7;}function inferRecurringInterval(_0x3c92a6,_0x524e24){if(_0x3c92a6==='*/15')return'*/15\x20*\x20*\x20*\x20*';if(_0x3c92a6==='*/30')return'*/30\x20*\x20*\x20*\x20*';if(_0x3c92a6!=='0')return'*/30\x20*\x20*\x20*\x20*';if(_0x524e24==='*'||/^\d{1,2}-\d{1,2}$/['test'](_0x524e24))return'0\x20*\x20*\x20*\x20*';for(const _0x489ff1 of RECURRING_INTERVAL_STEPS){if(_0x524e24['startsWith']('*/'+_0x489ff1)||_0x524e24['includes']('/'+_0x489ff1))return'0\x20*/'+_0x489ff1+'\x20*\x20*\x20*';}return'*/30\x20*\x20*\x20*\x20*';}function parseRecurringHourRange(_0x23d632){const _0x2430cc=String(_0x23d632||'')['trim']()['match'](/^(\d{1,2})-(\d{1,2})(?:\/\d+)?$/);if(!_0x2430cc)return{'start':'','end':''};const _0x448bc7=parseBoundedInteger(_0x2430cc[0x1],0x0,0x17),_0x2d314e=parseBoundedInteger(_0x2430cc[0x2],0x0,0x17);if(_0x448bc7===null||_0x2d314e===null||_0x448bc7>_0x2d314e)return{'start':'','end':''};return{'start':String(_0x448bc7),'end':String(_0x2d314e)};}export function parseAutomationScheduleToFormState(_0x332ec1){const _0x112440=String(_0x332ec1||'')['trim'](),_0x238db8=createDefaultScheduleFormState(),_0x4c658d=_0x112440['match'](/^(\d{1,2}) (\d{1,2}) \* \* \*$/);if(_0x4c658d){const _0x1184e8=parseBoundedInteger(_0x4c658d[0x1],0x0,0x3b),_0x1bb1d5=parseBoundedInteger(_0x4c658d[0x2],0x0,0x17);if(_0x1184e8!==null&&_0x1bb1d5!==null)return _0x238db8['frequency']='daily',_0x238db8['dailyMinute']=String(_0x1184e8),_0x238db8['dailyHour']=String(_0x1bb1d5),_0x238db8;}const _0xa3512c=_0x112440['match'](/^(\d{1,2}) (\d{1,2}) \* \* ([0-7])$/);if(_0xa3512c){const _0x20d7dd=parseBoundedInteger(_0xa3512c[0x1],0x0,0x3b),_0x2c7373=parseBoundedInteger(_0xa3512c[0x2],0x0,0x17),_0x5f34b3=parseBoundedInteger(_0xa3512c[0x3],0x0,0x7);if(_0x20d7dd!==null&&_0x2c7373!==null&&_0x5f34b3!==null)return _0x238db8['frequency']='weekly',_0x238db8['weeklyMinute']=String(_0x20d7dd),_0x238db8['weeklyHour']=String(_0x2c7373),_0x238db8['weeklyDay']=String(_0x5f34b3===0x7?0x0:_0x5f34b3),_0x238db8;}const _0x64860b=_0x112440['match'](/^(\d{1,2}) (\d{1,2}) (\d{1,2}) \* \*$/);if(_0x64860b){const _0x1b4e2d=parseBoundedInteger(_0x64860b[0x1],0x0,0x3b),_0x872241=parseBoundedInteger(_0x64860b[0x2],0x0,0x17),_0x5be32e=parseBoundedInteger(_0x64860b[0x3],AUTOMATION_MONTHLY_DAY_MIN,AUTOMATION_MONTHLY_DAY_MAX);if(_0x1b4e2d!==null&&_0x872241!==null&&_0x5be32e!==null)return _0x238db8['frequency']='monthly',_0x238db8['monthlyMinute']=String(_0x1b4e2d),_0x238db8['monthlyHour']=String(_0x872241),_0x238db8['monthlyDay']=String(_0x5be32e),_0x238db8;}const _0x42fc8b=_0x112440['match'](/^(\*\/15|\*\/30|0) ([^\s]+) \* \* ([^\s]+)$/);if(_0x42fc8b){const [,_0x3a772b,_0xb3ac8a,_0x36a745]=_0x42fc8b;_0x238db8['frequency']='recurring',_0x238db8['recurringInterval']=inferRecurringInterval(_0x3a772b,_0xb3ac8a),_0x238db8['recurringDayToken']=String(_0x36a745||'')['trim']()||'*';const _0x37513a=parseRecurringHourRange(_0xb3ac8a);return _0x238db8['recurringStartHour']=_0x37513a['start'],_0x238db8['recurringEndHour']=_0x37513a['end'],_0x238db8;}return _0x238db8['frequency']='custom',_0x238db8['customCron']=_0x112440,_0x238db8;}export function buildAutomationCronFromFormState(_0x3a3929={}){const _0x25f594=String(_0x3a3929['frequency']||'daily');if(_0x25f594==='custom')return String(_0x3a3929['customCron']||'')['trim']();if(_0x25f594==='daily'){const _0x3eb055=String(_0x3a3929['dailyHour']??'2'),_0x3465a4=String(_0x3a3929['dailyMinute']??'0');return _0x3465a4+'\x20'+_0x3eb055+'\x20*\x20*\x20*';}if(_0x25f594==='weekly'){const _0x3a8c30=String(_0x3a3929['weeklyDay']??'1'),_0x1dfe7e=String(_0x3a3929['weeklyHour']??'9'),_0x46baa6=String(_0x3a3929['weeklyMinute']??'0');return _0x46baa6+'\x20'+_0x1dfe7e+'\x20*\x20*\x20'+_0x3a8c30;}if(_0x25f594==='monthly'){const _0x15765f=String(_0x3a3929['monthlyDay']??'1'),_0x411329=String(_0x3a3929['monthlyHour']??'0'),_0x10ad6e=String(_0x3a3929['monthlyMinute']??'0');return _0x10ad6e+'\x20'+_0x411329+'\x20'+_0x15765f+'\x20*\x20*';}const _0x5ce598=String(_0x3a3929['recurringInterval']||'*/30\x20*\x20*\x20*\x20*')['trim'](),[_0x5d83f4='*/30',_0x57f457='*']=_0x5ce598['split'](/\s+/);let _0x4369e8=_0x57f457;const _0x308798=String(_0x3a3929['recurringStartHour']??'')['trim'](),_0x277036=String(_0x3a3929['recurringEndHour']??'')['trim']();if(_0x308798!==''&&_0x277036!==''){const _0x232508=Number['parseInt'](_0x308798,0xa),_0x52c5c9=Number['parseInt'](_0x277036,0xa);if(Number['isInteger'](_0x232508)&&Number['isInteger'](_0x52c5c9)&&_0x232508<=_0x52c5c9){const _0x3cfe79=_0x57f457['match'](/^\*\/(\d+)$/);_0x3cfe79?_0x4369e8=_0x232508+'-'+_0x52c5c9+'/'+_0x3cfe79[0x1]:_0x4369e8=_0x232508+'-'+_0x52c5c9;}}const _0x428ef2=String(_0x3a3929['recurringDayToken']??'*')['trim']()||'*';return _0x5d83f4+'\x20'+_0x4369e8+'\x20*\x20*\x20'+_0x428ef2;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export class CommentsWidget{constructor(_0x2a55c3,_0x3f5597={}){this['container']=_0x2a55c3,this['options']={'taskId':_0x3f5597['taskId']||null,'currentUserId':_0x3f5597['currentUserId']||null,'compact':_0x3f5597['compact']||![],'skipHeader':_0x3f5597['skipHeader']||![],'onCommentsLoaded':_0x3f5597['onCommentsLoaded']||null,'onCommentsChanged':_0x3f5597['onCommentsChanged']||null,'enableAttachments':_0x3f5597['enableAttachments']||![],'getAPI':_0x3f5597['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 _0x13be6d=this['options']['getAPI'](),_0x39458e=await _0x13be6d['getTaskAttachments'](this['options']['taskId']);this['existingAttachments']=_0x39458e['attachments']||[];}catch(_0x1776fb){console['warn']('Failed\x20to\x20load\x20existing\x20attachments:',_0x1776fb),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 _0x440a9d=this['header']['querySelector']('.comments-toggle-btn');_0x440a9d['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 _0xd33e53=document['createElement']('div');_0xd33e53['className']='comments-editor-wrapper',this['toolbar']=document['createElement']('div'),this['toolbar']['className']='comments-toolbar\x20comments-toolbar-hidden',_0xd33e53['appendChild'](this['toolbar']);const _0x52ec13=document['createElement']('div');_0x52ec13['className']='comments-editor-placeholder',_0xd33e53['appendChild'](_0x52ec13);const _0x124ef2=document['createElement']('div');_0x124ef2['className']='comments-input-actions',_0x124ef2['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'](_0xd33e53),this['inputSection']['appendChild'](_0x124ef2),this['container']['appendChild'](this['inputSection']),this['initEditor'](_0x52ec13),this['submitBtn']=_0x124ef2['querySelector']('.comments-submit-btn'),this['cancelBtn']=_0x124ef2['querySelector']('.comments-cancel-btn'),this['submitBtn']['addEventListener']('click',()=>this['handleSubmit']()),this['cancelBtn']['addEventListener']('click',()=>this['cancelEdit']());}['initEditor'](_0x5f2599){const _0x316055=document['createElement']('textarea');_0x316055['placeholder']='Add\x20a\x20comment...',_0x316055['className']='comments-textarea',_0x5f2599['appendChild'](_0x316055);const _0x39726f=window['MarkdownEditor'];if(!_0x39726f){console['error']('MarkdownEditor\x20not\x20loaded');return;}const _0x2899b4={'placeholder':'Add\x20a\x20comment...','editable':!![],'toolbar':!![],'minHeight':this['options']['compact']?'60px':'80px','onChange':_0x139a52=>{const _0x10b2e2=_0x139a52&&_0x139a52['trim']()['length']>0x0||this['pendingAttachments']['length']>0x0;this['submitBtn']['disabled']=!_0x10b2e2;},'fetchUsers':async()=>{const _0x1a14ee=this['options']['getAPI']();return _0x1a14ee['getUsers']();}};this['options']['enableAttachments']&&this['options']['taskId']&&(_0x2899b4['onAddAttachments']=_0x470b32=>{this['pendingAttachments']['push'](..._0x470b32),this['submitBtn']['disabled']=![];},_0x2899b4['resolveAttachmentUrl']=_0x128c6f=>{const _0x4fffbc=this['options']['getAPI']();return _0x4fffbc['getBaseUrl']()+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x128c6f);},_0x2899b4['isAttachmentNameTaken']=_0x368e61=>{return this['pendingAttachments']['some'](_0x4e1964=>_0x4e1964['name']===_0x368e61)||this['existingAttachments']['some'](_0x1e180c=>_0x1e180c['name']===_0x368e61);});this['editor']=new _0x39726f(_0x316055,_0x2899b4);const _0x36e81a=this['editor']['editor'],_0x154492=this['editor']['toolbar'];_0x154492&&(_0x154492['classList']['add']('comments-toolbar-hidden'),_0x36e81a['addEventListener']('focus',()=>{_0x154492['classList']['remove']('comments-toolbar-hidden');}),_0x36e81a['addEventListener']('blur',_0x467d78=>{setTimeout(()=>{!this['editor']['container']?.['contains'](document['activeElement'])&&!_0x154492['contains'](document['activeElement'])&&(!this['editor']['getValue']()?.['trim']()&&!this['editingCommentId']&&_0x154492['classList']['add']('comments-toolbar-hidden'));},0x64);}));}['toggleExpanded'](){this['isExpanded']=!this['isExpanded'],this['commentsListWrapper']['hidden']=!this['isExpanded'],this['inputSection']['hidden']=!this['isExpanded'];const _0x83f9fc=this['header']['querySelector']('.comments-chevron');_0x83f9fc&&(_0x83f9fc['style']['transform']=this['isExpanded']?'rotate(180deg)':''),this['isExpanded']&&this['comments']['length']===0x0&&this['options']['taskId']&&this['loadComments']();}['setTaskId'](_0x1e21ff){this['options']['taskId']=_0x1e21ff,this['comments']=[],this['renderComments'](),_0x1e21ff&&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 _0x4646d9=this['options']['getAPI'](),_0x27ea40=await _0x4646d9['getComments'](this['options']['taskId']);this['comments']=_0x27ea40['comments']||[],this['renderComments'](),this['updateCount'](),this['options']['onCommentsLoaded']&&this['options']['onCommentsLoaded'](this['comments']);}catch(_0x5befa3){console['error']('Failed\x20to\x20load\x20comments:',_0x5befa3),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'](_0x19c58d=>{const _0x2993ee=this['createCommentElement'](_0x19c58d);this['commentsList']['appendChild'](_0x2993ee);});}['createCommentElement'](_0x234232){const _0x406d44=document['createElement']('div');_0x406d44['className']='comment-item',_0x406d44['dataset']['commentId']=_0x234232['id'];const _0x549d19=this['options']['currentUserId']&&_0x234232['author']?.['userId']===this['options']['currentUserId'],_0x1237b1=this['formatDate'](_0x234232['createdAt']),_0x29b2f7=_0x234232['updatedAt']!==_0x234232['createdAt'],_0x54b7ba=this['resolveAttachmentUrls'](_0x234232['content']);let _0x283285=window['marked']?window['marked']['parse'](_0x54b7ba):_0x54b7ba;_0x283285=this['renderMentions'](_0x283285),_0x406d44['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'](_0x234232['author']?.['name']||'Anonymous')+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-timestamp\x22\x20title=\x22'+new Date(_0x234232['createdAt'])['toLocaleString']()+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x1237b1+(_0x29b2f7?'\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'+(_0x549d19?'\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>'+_0x283285+'</div>\x0a\x20\x20\x20\x20';if(_0x549d19){const _0x110a5a=_0x406d44['querySelector']('.comment-edit-btn'),_0x48e616=_0x406d44['querySelector']('.comment-delete-btn');_0x110a5a?.['addEventListener']('click',()=>this['startEdit'](_0x234232)),_0x48e616?.['addEventListener']('click',()=>this['deleteComment'](_0x234232['id']));}return _0x406d44;}['formatDate'](_0x484047){const _0x42b49e=new Date(_0x484047),_0x53df8b=new Date(),_0x8cf3a6=_0x53df8b-_0x42b49e,_0x9b3ea8=Math['floor'](_0x8cf3a6/0xea60),_0x204640=Math['floor'](_0x8cf3a6/0x36ee80),_0x47ec4c=Math['floor'](_0x8cf3a6/0x5265c00);if(_0x9b3ea8<0x1)return'just\x20now';if(_0x9b3ea8<0x3c)return _0x9b3ea8+'m\x20ago';if(_0x204640<0x18)return _0x204640+'h\x20ago';if(_0x47ec4c<0x7)return _0x47ec4c+'d\x20ago';return _0x42b49e['toLocaleDateString']();}['escapeHtml'](_0x106602){const _0x3614ce=document['createElement']('div');return _0x3614ce['textContent']=_0x106602,_0x3614ce['innerHTML'];}['resolveAttachmentUrls'](_0x48b0d8){if(!_0x48b0d8||!this['options']['taskId'])return _0x48b0d8;const _0x25892a=this['options']['getAPI'](),_0x517b2c=_0x25892a['getBaseUrl']();let _0x1c4393=String(_0x48b0d8)['replace'](/\]\(attachment:(?:\/\/)?([^)]+)\)/g,(_0x417749,_0x1eaf8f)=>{const _0x490e19=String(_0x1eaf8f||'')['trim']();if(!_0x490e19)return _0x417749;let _0x45e2dc=_0x490e19;try{_0x45e2dc=decodeURIComponent(_0x490e19);}catch{}return']('+_0x517b2c+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x45e2dc)+')';});return _0x1c4393;}['renderMentions'](_0x46b0a1){if(!_0x46b0a1)return _0x46b0a1;return String(_0x46b0a1)['replace'](/@?<a\s+href="mention:([^"]+)"[^>]*>([^<]+)<\/a>/g,(_0x3dc900,_0xae2f6a,_0x474160)=>{const _0x184b71=this['escapeHtml'](_0x474160),_0x46a12c=this['escapeHtml'](_0xae2f6a);return'<span\x20class=\x22mention\x22\x20data-mention-user-id=\x22'+_0x46a12c+'\x22>@'+_0x184b71+'</span>';});}['startEdit'](_0x42f4c3){this['editingCommentId']=_0x42f4c3['id'],this['editor']['setValue'](_0x42f4c3['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 _0x10bb75=this['editor']['getValue']()?.['trim']();if(!_0x10bb75&&this['pendingAttachments']['length']===0x0||!this['options']['taskId'])return;this['setLoading'](!![]);try{const _0x53ed99=this['options']['getAPI']();this['pendingAttachments']['length']>0x0&&this['options']['enableAttachments']&&(await _0x53ed99['uploadAttachments'](this['options']['taskId'],this['pendingAttachments']),this['existingAttachments']['push'](...this['pendingAttachments']['map'](_0x28a882=>({'name':_0x28a882['name']}))),this['pendingAttachments']=[]);if(this['editingCommentId']){const _0x42165e=await _0x53ed99['updateComment'](this['options']['taskId'],this['editingCommentId'],_0x10bb75),_0x549578=this['comments']['findIndex'](_0xf74310=>_0xf74310['id']===this['editingCommentId']);_0x549578!==-0x1&&(this['comments'][_0x549578]=_0x42165e['comment']);}else{const _0x2976e0=await _0x53ed99['addComment'](this['options']['taskId'],_0x10bb75);this['comments']['push'](_0x2976e0['comment']);}this['renderComments'](),this['updateCount'](),this['cancelEdit'](),this['editor']['clear']();}catch(_0x27c7a6){console['error']('Failed\x20to\x20save\x20comment:',_0x27c7a6),alert('Failed\x20to\x20save\x20comment:\x20'+_0x27c7a6['message']);}finally{this['setLoading'](![]);}}async['deleteComment'](_0x1006ac){const _0x26840d=await this['showDeleteConfirmModal']();if(!_0x26840d)return;try{const _0x5c893b=this['options']['getAPI']();await _0x5c893b['deleteComment'](this['options']['taskId'],_0x1006ac),this['comments']=this['comments']['filter'](_0x1a3b4e=>_0x1a3b4e['id']!==_0x1006ac),this['renderComments'](),this['updateCount']();}catch(_0xfca618){console['error']('Failed\x20to\x20delete\x20comment:',_0xfca618),alert('Failed\x20to\x20delete\x20comment:\x20'+_0xfca618['message']);}}['showDeleteConfirmModal'](){return new Promise(_0x200f01=>{const _0x4436b8=document['createElement']('div');_0x4436b8['className']='comments-confirm-modal',_0x4436b8['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'](_0x4436b8);const _0x47919a=_0x424dea=>{document['removeEventListener']('keydown',_0x3ff95f),_0x4436b8['remove'](),_0x200f01(_0x424dea);},_0x3ff95f=_0xbe4851=>{if(_0xbe4851['key']==='Escape')_0x47919a(![]);};document['addEventListener']('keydown',_0x3ff95f),_0x4436b8['querySelector']('.comments-confirm-backdrop')['addEventListener']('click',()=>_0x47919a(![])),_0x4436b8['querySelector']('.comments-confirm-close')['addEventListener']('click',()=>_0x47919a(![])),_0x4436b8['querySelector']('.comments-confirm-cancel')['addEventListener']('click',()=>_0x47919a(![])),_0x4436b8['querySelector']('.comments-confirm-delete')['addEventListener']('click',()=>_0x47919a(!![])),_0x4436b8['querySelector']('.comments-confirm-cancel')['focus']();});}['setLoading'](_0x239fcf){this['submitBtn']['disabled']=_0x239fcf,this['submitBtn']['querySelector']('.btn-text')['hidden']=_0x239fcf,this['submitBtn']['querySelector']('.btn-loading')['hidden']=!_0x239fcf;}['updateCount'](){const _0x3e0c7e=this['comments']['length'],_0x158d5e=this['container']['querySelector']('#comments-count-badge');_0x158d5e&&(_0x158d5e['textContent']=_0x3e0c7e,_0x158d5e['hidden']=_0x3e0c7e===0x0);const _0x5a1552=this['container']['querySelector']('#comments-count');_0x5a1552&&(_0x5a1552['textContent']=_0x3e0c7e>0x0?'('+_0x3e0c7e+')':''),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(_0x56fe8e,_0x572d37={}){this['container']=_0x56fe8e,this['options']={'taskId':_0x572d37['taskId']||null,'currentUserId':_0x572d37['currentUserId']||null,'compact':_0x572d37['compact']||![],'skipHeader':_0x572d37['skipHeader']||![],'onCommentsLoaded':_0x572d37['onCommentsLoaded']||null,'onCommentsChanged':_0x572d37['onCommentsChanged']||null,'enableAttachments':_0x572d37['enableAttachments']||![],'getAPI':_0x572d37['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 _0xedfd7d=this['options']['getAPI'](),_0x14c537=await _0xedfd7d['getTaskAttachments'](this['options']['taskId']);this['existingAttachments']=_0x14c537['attachments']||[];}catch(_0x10fdfa){console['warn']('Failed\x20to\x20load\x20existing\x20attachments:',_0x10fdfa),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 _0x5603d3=this['header']['querySelector']('.comments-toggle-btn');_0x5603d3['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 _0x4c24e=document['createElement']('div');_0x4c24e['className']='comments-editor-wrapper',this['toolbar']=document['createElement']('div'),this['toolbar']['className']='comments-toolbar\x20comments-toolbar-hidden',_0x4c24e['appendChild'](this['toolbar']);const _0x5b88c1=document['createElement']('div');_0x5b88c1['className']='comments-editor-placeholder',_0x4c24e['appendChild'](_0x5b88c1);const _0x438acb=document['createElement']('div');_0x438acb['className']='comments-input-actions',_0x438acb['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'](_0x4c24e),this['inputSection']['appendChild'](_0x438acb),this['container']['appendChild'](this['inputSection']),this['initEditor'](_0x5b88c1),this['submitBtn']=_0x438acb['querySelector']('.comments-submit-btn'),this['cancelBtn']=_0x438acb['querySelector']('.comments-cancel-btn'),this['submitBtn']['addEventListener']('click',()=>this['handleSubmit']()),this['cancelBtn']['addEventListener']('click',()=>this['cancelEdit']());}['initEditor'](_0x23195){const _0x7ddf92=document['createElement']('textarea');_0x7ddf92['placeholder']='Add\x20a\x20comment...',_0x7ddf92['className']='comments-textarea',_0x23195['appendChild'](_0x7ddf92);const _0xcbfe9d=window['MarkdownEditor'];if(!_0xcbfe9d){console['error']('MarkdownEditor\x20not\x20loaded');return;}const _0x10caaa={'placeholder':'Add\x20a\x20comment...','editable':!![],'toolbar':!![],'minHeight':this['options']['compact']?'60px':'80px','onChange':_0x41d582=>{const _0x33a012=_0x41d582&&_0x41d582['trim']()['length']>0x0||this['pendingAttachments']['length']>0x0;this['submitBtn']['disabled']=!_0x33a012;},'fetchUsers':async()=>{const _0x4eb1af=this['options']['getAPI']();return _0x4eb1af['getUsers']();}};this['options']['enableAttachments']&&this['options']['taskId']&&(_0x10caaa['onAddAttachments']=_0x3dedd6=>{this['pendingAttachments']['push'](..._0x3dedd6),this['submitBtn']['disabled']=![];},_0x10caaa['resolveAttachmentUrl']=_0x12f9e0=>{const _0x3c92fa=this['options']['getAPI']();return _0x3c92fa['getBaseUrl']()+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x12f9e0);},_0x10caaa['isAttachmentNameTaken']=_0x27777d=>{return this['pendingAttachments']['some'](_0x409e6c=>_0x409e6c['name']===_0x27777d)||this['existingAttachments']['some'](_0x3e4e57=>_0x3e4e57['name']===_0x27777d);});this['editor']=new _0xcbfe9d(_0x7ddf92,_0x10caaa);const _0x9af956=this['editor']['editor'],_0x4fafd9=this['editor']['toolbar'];_0x4fafd9&&(_0x4fafd9['classList']['add']('comments-toolbar-hidden'),_0x9af956['addEventListener']('focus',()=>{_0x4fafd9['classList']['remove']('comments-toolbar-hidden');}),_0x9af956['addEventListener']('blur',_0x3a6de4=>{setTimeout(()=>{!this['editor']['container']?.['contains'](document['activeElement'])&&!_0x4fafd9['contains'](document['activeElement'])&&(!this['editor']['getValue']()?.['trim']()&&!this['editingCommentId']&&_0x4fafd9['classList']['add']('comments-toolbar-hidden'));},0x64);}));}['toggleExpanded'](){this['isExpanded']=!this['isExpanded'],this['commentsListWrapper']['hidden']=!this['isExpanded'],this['inputSection']['hidden']=!this['isExpanded'];const _0xf0949e=this['header']['querySelector']('.comments-chevron');_0xf0949e&&(_0xf0949e['style']['transform']=this['isExpanded']?'rotate(180deg)':''),this['isExpanded']&&this['comments']['length']===0x0&&this['options']['taskId']&&this['loadComments']();}['setTaskId'](_0x582936){this['options']['taskId']=_0x582936,this['comments']=[],this['renderComments'](),_0x582936&&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 _0x1241e4=this['options']['getAPI'](),_0x41caa6=await _0x1241e4['getComments'](this['options']['taskId']);this['comments']=_0x41caa6['comments']||[],this['renderComments'](),this['updateCount'](),this['options']['onCommentsLoaded']&&this['options']['onCommentsLoaded'](this['comments']);}catch(_0x4f35b1){console['error']('Failed\x20to\x20load\x20comments:',_0x4f35b1),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'](_0x489b17=>{const _0x236bf6=this['createCommentElement'](_0x489b17);this['commentsList']['appendChild'](_0x236bf6);});}['createCommentElement'](_0x23ac59){const _0x4021f3=document['createElement']('div');_0x4021f3['className']='comment-item',_0x4021f3['dataset']['commentId']=_0x23ac59['id'];const _0x2c3fd5=this['options']['currentUserId']&&_0x23ac59['author']?.['userId']===this['options']['currentUserId'],_0x51fdbf=this['formatDate'](_0x23ac59['createdAt']),_0x4ef79c=_0x23ac59['updatedAt']!==_0x23ac59['createdAt'],_0x34f6ad=this['resolveAttachmentUrls'](_0x23ac59['content']);let _0xb4607e=window['marked']?window['marked']['parse'](_0x34f6ad):_0x34f6ad;_0xb4607e=this['renderMentions'](_0xb4607e),_0x4021f3['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'](_0x23ac59['author']?.['name']||'Anonymous')+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22comment-timestamp\x22\x20title=\x22'+new Date(_0x23ac59['createdAt'])['toLocaleString']()+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x51fdbf+(_0x4ef79c?'\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'+(_0x2c3fd5?'\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>'+_0xb4607e+'</div>\x0a\x20\x20\x20\x20';if(_0x2c3fd5){const _0x46449b=_0x4021f3['querySelector']('.comment-edit-btn'),_0x5a97b8=_0x4021f3['querySelector']('.comment-delete-btn');_0x46449b?.['addEventListener']('click',()=>this['startEdit'](_0x23ac59)),_0x5a97b8?.['addEventListener']('click',()=>this['deleteComment'](_0x23ac59['id']));}return _0x4021f3;}['formatDate'](_0x583b9f){const _0x4f5f18=new Date(_0x583b9f),_0x1b8fa2=new Date(),_0x4dedc7=_0x1b8fa2-_0x4f5f18,_0x5cad14=Math['floor'](_0x4dedc7/0xea60),_0x451688=Math['floor'](_0x4dedc7/0x36ee80),_0x1bd300=Math['floor'](_0x4dedc7/0x5265c00);if(_0x5cad14<0x1)return'just\x20now';if(_0x5cad14<0x3c)return _0x5cad14+'m\x20ago';if(_0x451688<0x18)return _0x451688+'h\x20ago';if(_0x1bd300<0x7)return _0x1bd300+'d\x20ago';return _0x4f5f18['toLocaleDateString']();}['escapeHtml'](_0x1620ba){const _0x2b7787=document['createElement']('div');return _0x2b7787['textContent']=_0x1620ba,_0x2b7787['innerHTML'];}['resolveAttachmentUrls'](_0x32cf69){if(!_0x32cf69||!this['options']['taskId'])return _0x32cf69;const _0xcaaf25=this['options']['getAPI'](),_0x384eff=_0xcaaf25['getBaseUrl']();let _0x321fc8=String(_0x32cf69)['replace'](/\]\(attachment:(?:\/\/)?([^)]+)\)/g,(_0x4a30eb,_0x51476b)=>{const _0x11ff07=String(_0x51476b||'')['trim']();if(!_0x11ff07)return _0x4a30eb;let _0x4c8e10=_0x11ff07;try{_0x4c8e10=decodeURIComponent(_0x11ff07);}catch{}return']('+_0x384eff+'/tasks/'+this['options']['taskId']+'/attachments/'+encodeURIComponent(_0x4c8e10)+')';});return _0x321fc8;}['renderMentions'](_0x20b5e6){if(!_0x20b5e6)return _0x20b5e6;return String(_0x20b5e6)['replace'](/@?<a\s+href="mention:([^"]+)"[^>]*>([^<]+)<\/a>/g,(_0x115da2,_0x51ec7a,_0x336353)=>{const _0x24d137=this['escapeHtml'](_0x336353),_0x28ba3b=this['escapeHtml'](_0x51ec7a);return'<span\x20class=\x22mention\x22\x20data-mention-user-id=\x22'+_0x28ba3b+'\x22>@'+_0x24d137+'</span>';});}['startEdit'](_0xd7b041){this['editingCommentId']=_0xd7b041['id'],this['editor']['setValue'](_0xd7b041['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 _0x40c603=this['editor']['getValue']()?.['trim']();if(!_0x40c603&&this['pendingAttachments']['length']===0x0||!this['options']['taskId'])return;this['setLoading'](!![]);try{const _0xd8f5ad=this['options']['getAPI']();this['pendingAttachments']['length']>0x0&&this['options']['enableAttachments']&&(await _0xd8f5ad['uploadAttachments'](this['options']['taskId'],this['pendingAttachments']),this['existingAttachments']['push'](...this['pendingAttachments']['map'](_0x4a7a71=>({'name':_0x4a7a71['name']}))),this['pendingAttachments']=[]);if(this['editingCommentId']){const _0x2f2b2b=await _0xd8f5ad['updateComment'](this['options']['taskId'],this['editingCommentId'],_0x40c603),_0x172841=this['comments']['findIndex'](_0xc0894f=>_0xc0894f['id']===this['editingCommentId']);_0x172841!==-0x1&&(this['comments'][_0x172841]=_0x2f2b2b['comment']);}else{const _0xae013b=await _0xd8f5ad['addComment'](this['options']['taskId'],_0x40c603);this['comments']['push'](_0xae013b['comment']);}this['renderComments'](),this['updateCount'](),this['cancelEdit'](),this['editor']['clear']();}catch(_0x16a265){console['error']('Failed\x20to\x20save\x20comment:',_0x16a265),alert('Failed\x20to\x20save\x20comment:\x20'+_0x16a265['message']);}finally{this['setLoading'](![]);}}async['deleteComment'](_0x32e6e0){const _0x51b926=await this['showDeleteConfirmModal']();if(!_0x51b926)return;try{const _0x1dda53=this['options']['getAPI']();await _0x1dda53['deleteComment'](this['options']['taskId'],_0x32e6e0),this['comments']=this['comments']['filter'](_0x49586b=>_0x49586b['id']!==_0x32e6e0),this['renderComments'](),this['updateCount']();}catch(_0x1b418f){console['error']('Failed\x20to\x20delete\x20comment:',_0x1b418f),alert('Failed\x20to\x20delete\x20comment:\x20'+_0x1b418f['message']);}}['showDeleteConfirmModal'](){return new Promise(_0x57ec17=>{const _0x16b6c1=document['createElement']('div');_0x16b6c1['className']='comments-confirm-modal',_0x16b6c1['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'](_0x16b6c1);const _0x1d2aa4=_0x12f04f=>{document['removeEventListener']('keydown',_0x49400d),_0x16b6c1['remove'](),_0x57ec17(_0x12f04f);},_0x49400d=_0x493121=>{if(_0x493121['key']==='Escape')_0x1d2aa4(![]);};document['addEventListener']('keydown',_0x49400d),_0x16b6c1['querySelector']('.comments-confirm-backdrop')['addEventListener']('click',()=>_0x1d2aa4(![])),_0x16b6c1['querySelector']('.comments-confirm-close')['addEventListener']('click',()=>_0x1d2aa4(![])),_0x16b6c1['querySelector']('.comments-confirm-cancel')['addEventListener']('click',()=>_0x1d2aa4(![])),_0x16b6c1['querySelector']('.comments-confirm-delete')['addEventListener']('click',()=>_0x1d2aa4(!![])),_0x16b6c1['querySelector']('.comments-confirm-cancel')['focus']();});}['setLoading'](_0x4dff15){this['submitBtn']['disabled']=_0x4dff15,this['submitBtn']['querySelector']('.btn-text')['hidden']=_0x4dff15,this['submitBtn']['querySelector']('.btn-loading')['hidden']=!_0x4dff15;}['updateCount'](){const _0x386535=this['comments']['length'],_0x12b8eb=this['container']['querySelector']('#comments-count-badge');_0x12b8eb&&(_0x12b8eb['textContent']=_0x386535,_0x12b8eb['hidden']=_0x386535===0x0);const _0x319966=this['container']['querySelector']('#comments-count');_0x319966&&(_0x319966['textContent']=_0x386535>0x0?'('+_0x386535+')':''),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(_0x3ec969){const _0x35bfa8=[],_0x5f5999=_0x3ec969['split']('\x0a');let _0x822b50=null,_0x1b3591=null;for(const _0x2baa06 of _0x5f5999){if(_0x2baa06['startsWith']('diff\x20--git')){_0x822b50&&_0x1b3591&&_0x822b50['hunks']['push'](_0x1b3591);_0x822b50&&_0x35bfa8['push'](_0x822b50);const _0x4a2e85=_0x2baa06['match'](/diff --git a\/(.+?) b\/(.+)/);_0x822b50={'oldPath':_0x4a2e85?_0x4a2e85[0x1]:'','newPath':_0x4a2e85?_0x4a2e85[0x2]:'','hunks':[],'isDeleted':![]},_0x1b3591=null;}else{if(_0x2baa06['startsWith']('deleted\x20file\x20mode')&&_0x822b50)_0x822b50['isDeleted']=!![];else{if(_0x2baa06['startsWith']('@@'))_0x1b3591&&_0x822b50&&_0x822b50['hunks']['push'](_0x1b3591),_0x1b3591={'header':_0x2baa06,'lines':[]};else _0x1b3591&&_0x1b3591['lines']['push'](_0x2baa06);}}}return _0x822b50&&_0x1b3591&&_0x822b50['hunks']['push'](_0x1b3591),_0x822b50&&_0x35bfa8['push'](_0x822b50),_0x35bfa8;}export function parseHunkHeader(_0x13dbd6){const _0x44f59d=_0x13dbd6['match'](/@@ -(\d+),?\d* \+(\d+),?\d* @@/);if(_0x44f59d)return{'oldStart':parseInt(_0x44f59d[0x1],0xa),'newStart':parseInt(_0x44f59d[0x2],0xa)};return{'oldStart':0x1,'newStart':0x1};}export function highlightDiffLine(_0x2c3516,_0x57d5f8){const _0x3706ed=window['hljs']||(typeof hljs!=='undefined'?hljs:null);if(_0x3706ed&&_0x57d5f8)try{const _0x247c09=_0x3706ed['getLanguage'](_0x57d5f8)?_0x57d5f8:null;if(_0x247c09)return _0x3706ed['highlight'](_0x2c3516,{'language':_0x247c09})['value'];}catch(_0x337c48){console['error']('Diff\x20syntax\x20highlighting\x20error:',_0x337c48);}return Utils['escapeHtml'](_0x2c3516);}export function getFileLanguage(_0x21af42){const _0x1d006f=_0x21af42['split']('.')['pop']()['toLowerCase'](),_0x153c13={'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 _0x153c13[_0x1d006f]||null;}export function computeWordDiff(_0x5cc639,_0xc5fa87){const _0x3825b2=_0x56d91f=>{const _0x1d99d3=[];let _0x58fba6='',_0x5000b6=![];for(let _0x5efe6c=0x0;_0x5efe6c<_0x56d91f['length'];_0x5efe6c++){const _0x5d0ebd=_0x56d91f[_0x5efe6c],_0x4075fe=/\s/['test'](_0x5d0ebd);if(_0x58fba6==='')_0x58fba6=_0x5d0ebd,_0x5000b6=_0x4075fe;else _0x4075fe===_0x5000b6?_0x58fba6+=_0x5d0ebd:(_0x1d99d3['push'](_0x58fba6),_0x58fba6=_0x5d0ebd,_0x5000b6=_0x4075fe);}return _0x58fba6&&_0x1d99d3['push'](_0x58fba6),_0x1d99d3;},_0x3ee5d6=_0x3825b2(_0x5cc639),_0x2314b6=_0x3825b2(_0xc5fa87),_0x5938fb=_0x3ee5d6['length'],_0x3e4c8d=_0x2314b6['length'],_0x48e247=Array(_0x5938fb+0x1)['fill'](null)['map'](()=>Array(_0x3e4c8d+0x1)['fill'](0x0));for(let _0x17e04f=0x1;_0x17e04f<=_0x5938fb;_0x17e04f++){for(let _0x432c4a=0x1;_0x432c4a<=_0x3e4c8d;_0x432c4a++){_0x3ee5d6[_0x17e04f-0x1]===_0x2314b6[_0x432c4a-0x1]?_0x48e247[_0x17e04f][_0x432c4a]=_0x48e247[_0x17e04f-0x1][_0x432c4a-0x1]+0x1:_0x48e247[_0x17e04f][_0x432c4a]=Math['max'](_0x48e247[_0x17e04f-0x1][_0x432c4a],_0x48e247[_0x17e04f][_0x432c4a-0x1]);}}const _0x3f5778={'old':[],'new':[]};let _0x35c619=_0x5938fb,_0x1e20d1=_0x3e4c8d;const _0x713b04=[],_0x5b6cb=[];while(_0x35c619>0x0||_0x1e20d1>0x0){if(_0x35c619>0x0&&_0x1e20d1>0x0&&_0x3ee5d6[_0x35c619-0x1]===_0x2314b6[_0x1e20d1-0x1])_0x713b04['unshift']({'type':'equal','text':_0x3ee5d6[_0x35c619-0x1]}),_0x5b6cb['unshift']({'type':'equal','text':_0x2314b6[_0x1e20d1-0x1]}),_0x35c619--,_0x1e20d1--;else{if(_0x1e20d1>0x0&&(_0x35c619===0x0||_0x48e247[_0x35c619][_0x1e20d1-0x1]>=_0x48e247[_0x35c619-0x1][_0x1e20d1]))_0x5b6cb['unshift']({'type':'insert','text':_0x2314b6[_0x1e20d1-0x1]}),_0x1e20d1--;else _0x35c619>0x0&&(_0x713b04['unshift']({'type':'delete','text':_0x3ee5d6[_0x35c619-0x1]}),_0x35c619--);}}return _0x3f5778['old']=_0x713b04,_0x3f5778['new']=_0x5b6cb,_0x3f5778;}export function renderDiffLineWithWordHighlight(_0x2ff545,_0x39ea7c,_0xfbd3c7,_0x5c3aaf){if(!_0x39ea7c||_0x39ea7c['length']===0x0)return highlightDiffLine(_0x2ff545,_0x5c3aaf);let _0xc4cddb='';const _0x219178=_0xfbd3c7==='add'?'diff-word-add':'diff-word-remove',_0x137c3e=_0xfbd3c7==='add'?'insert':'delete';for(const _0x136e80 of _0x39ea7c){const _0x1dd4c1=Utils['escapeHtml'](_0x136e80['text']);_0x136e80['type']===_0x137c3e?_0xc4cddb+='<span\x20class=\x22'+_0x219178+'\x22>'+_0x1dd4c1+'</span>':_0xc4cddb+=_0x1dd4c1;}return _0xc4cddb;}export function calculateDiffStats(_0x23281f){let _0x4d1579=0x0,_0x3dac8c=0x0,_0xdc6fb8=0x0;return _0x23281f['forEach'](_0x4e964f=>{let _0x7bcd45=0x0,_0x577b39=0x0;_0x4e964f['hunks']['forEach'](_0x40a999=>{_0x40a999['lines']['forEach'](_0x1719bf=>{if(_0x1719bf['startsWith']('+'))_0x7bcd45+=0x1;else{if(_0x1719bf['startsWith']('-'))_0x577b39+=0x1;}});}),(_0x7bcd45+_0x577b39>0x0||_0x4e964f['isDeleted'])&&(_0xdc6fb8+=0x1),_0x4d1579+=_0x7bcd45,_0x3dac8c+=_0x577b39;}),{'additions':_0x4d1579,'deletions':_0x3dac8c,'files':_0xdc6fb8};}export function getFileStatus(_0x5d8a0c,_0x394c04,_0x22c76b){if(_0x5d8a0c['isDeleted'])return'deleted';if(_0x394c04>0x0&&_0x22c76b===0x0)return'added';return'modified';}export function safeBase64(_0x1a9841){try{return btoa(unescape(encodeURIComponent(_0x1a9841)));}catch(_0x5d7df6){return btoa(_0x1a9841);}}export function getStorageKey(_0x40ad94,_0x491f6f){return _0x40ad94+'-'+safeBase64(_0x491f6f);}export function getCollapsedState(_0x3b37e5,_0x521267){const _0x3beb13=localStorage['getItem'](getStorageKey(_0x3b37e5,_0x521267));return _0x3beb13==='true';}export function renderUnifiedDiff(_0x13348b,_0x17b8cc){return _0x13348b['map']((_0x39071f,_0xc744ee)=>{const _0x1694c8=_0x39071f['newPath']||_0x39071f['oldPath']||'unknown',_0x56f913='diff-'+_0x17b8cc+'-'+_0xc744ee,_0x2fdcbe=getFileLanguage(_0x1694c8),{additions:_0x5cd00d,deletions:_0x47b5c9}=calculateDiffStats([_0x39071f]),_0x298868=getCollapsedState(_0x17b8cc,_0x1694c8),_0x50c888=getFileStatus(_0x39071f,_0x5cd00d,_0x47b5c9),_0x208e33=_0x50c888==='added'?'A':_0x50c888==='deleted'?'D':'M',_0x2959d7=_0x39071f['hunks']['map'](_0x30fb42=>{const {oldStart:_0x118b00,newStart:_0x49c21b}=parseHunkHeader(_0x30fb42['header']);let _0x5ebb45=_0x118b00,_0x594b1f=_0x49c21b;const _0x565e38=_0x30fb42['lines']['map'](_0x24063a=>({'line':_0x24063a,'type':_0x24063a['startsWith']('+')?'add':_0x24063a['startsWith']('-')?'remove':_0x24063a['startsWith']('\x5c')?'meta':'context'}));let _0x40de3b=0x0;while(_0x40de3b<_0x565e38['length']){if(_0x565e38[_0x40de3b]['type']==='remove'){let _0x481223=_0x40de3b,_0x39303b=_0x40de3b;while(_0x39303b<_0x565e38['length']&&_0x565e38[_0x39303b]['type']==='remove')_0x39303b++;let _0x2dfd5f=_0x39303b,_0x48676e=_0x2dfd5f;while(_0x48676e<_0x565e38['length']&&_0x565e38[_0x48676e]['type']==='add')_0x48676e++;const _0x362b13=_0x39303b-_0x481223,_0x315e04=_0x48676e-_0x2dfd5f,_0x42256f=Math['min'](_0x362b13,_0x315e04);for(let _0x2b2210=0x0;_0x2b2210<_0x42256f;_0x2b2210++){const _0x3bb157=_0x565e38[_0x481223+_0x2b2210]['line']['substring'](0x1),_0x475c11=_0x565e38[_0x2dfd5f+_0x2b2210]['line']['substring'](0x1),_0x4435d6=computeWordDiff(_0x3bb157,_0x475c11);_0x565e38[_0x481223+_0x2b2210]['wordDiff']=_0x4435d6['old'],_0x565e38[_0x2dfd5f+_0x2b2210]['wordDiff']=_0x4435d6['new'];}_0x40de3b=_0x48676e;}else _0x40de3b++;}const _0x2387ce=_0x565e38['map'](_0x3c11c6=>{const _0x1954e3=_0x3c11c6['line'];if(_0x1954e3['startsWith']('+')){const _0x285067=_0x1954e3['substring'](0x1),_0x274535=_0x3c11c6['wordDiff']?renderDiffLineWithWordHighlight(_0x285067,_0x3c11c6['wordDiff'],'add',_0x2fdcbe):highlightDiffLine(_0x285067,_0x2fdcbe),_0x54fe95='<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>'+_0x594b1f+'</span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>+</span>'+_0x274535+'</span></div>';return _0x594b1f+=0x1,_0x54fe95;}if(_0x1954e3['startsWith']('-')){const _0x265a7b=_0x1954e3['substring'](0x1),_0x938cb=_0x3c11c6['wordDiff']?renderDiffLineWithWordHighlight(_0x265a7b,_0x3c11c6['wordDiff'],'remove',_0x2fdcbe):highlightDiffLine(_0x265a7b,_0x2fdcbe),_0x22dbf1='<div\x20class=\x22diff-line\x20diff-remove\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x5ebb45+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>-</span>'+_0x938cb+'</span></div>';return _0x5ebb45+=0x1,_0x22dbf1;}if(_0x1954e3['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'](_0x1954e3)+'</span></div>';const _0x6c9c6=_0x1954e3['startsWith']('\x20')?_0x1954e3['substring'](0x1):_0x1954e3,_0x193f94=highlightDiffLine(_0x6c9c6,_0x2fdcbe),_0x1cfe59='<div\x20class=\x22diff-line\x20diff-context\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x5ebb45+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x594b1f+'</span><span\x20class=\x22diff-line-content\x22>\x20'+_0x193f94+'</span></div>';return _0x5ebb45+=0x1,_0x594b1f+=0x1,_0x1cfe59;})['join']('');return'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>'+Utils['escapeHtml'](_0x30fb42['header'])+'</div>'+_0x2387ce+'</div>';})['join'](''),_0x2b3981=_0x2959d7||'<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-'+_0x56f913+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-header\x22\x20data-diff-id=\x22'+_0x56f913+'\x22\x20data-file-name=\x22'+Utils['escapeHtml'](_0x1694c8)+'\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'+_0x50c888+'\x22>'+_0x208e33+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-name\x22>'+Utils['escapeHtml'](_0x1694c8)+'</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>+'+_0x5cd00d+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-del\x22>-'+_0x47b5c9+'</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'+_0x56f913+'\x22\x20data-collapsed=\x22'+_0x298868+'\x22\x20type=\x22button\x22\x20aria-label=\x22'+(_0x298868?'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'+(_0x298868?'collapsed':'')+'\x22\x20id=\x22'+_0x56f913+'\x22>'+_0x2b3981+'</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20';})['join']('');}
|
|
1
|
+
import{Utils}from'./app.js';export function parsePatchContent(_0x11a464){const _0x9522=[],_0x9509db=_0x11a464['split']('\x0a');let _0x4ac03d=null,_0x542695=null;for(const _0x40e312 of _0x9509db){if(_0x40e312['startsWith']('diff\x20--git')){_0x4ac03d&&_0x542695&&_0x4ac03d['hunks']['push'](_0x542695);_0x4ac03d&&_0x9522['push'](_0x4ac03d);const _0x352144=_0x40e312['match'](/diff --git a\/(.+?) b\/(.+)/);_0x4ac03d={'oldPath':_0x352144?_0x352144[0x1]:'','newPath':_0x352144?_0x352144[0x2]:'','hunks':[],'isDeleted':![]},_0x542695=null;}else{if(_0x40e312['startsWith']('deleted\x20file\x20mode')&&_0x4ac03d)_0x4ac03d['isDeleted']=!![];else{if(_0x40e312['startsWith']('@@'))_0x542695&&_0x4ac03d&&_0x4ac03d['hunks']['push'](_0x542695),_0x542695={'header':_0x40e312,'lines':[]};else _0x542695&&_0x542695['lines']['push'](_0x40e312);}}}return _0x4ac03d&&_0x542695&&_0x4ac03d['hunks']['push'](_0x542695),_0x4ac03d&&_0x9522['push'](_0x4ac03d),_0x9522;}export function parseHunkHeader(_0xcf6644){const _0x4fa3e0=_0xcf6644['match'](/@@ -(\d+),?\d* \+(\d+),?\d* @@/);if(_0x4fa3e0)return{'oldStart':parseInt(_0x4fa3e0[0x1],0xa),'newStart':parseInt(_0x4fa3e0[0x2],0xa)};return{'oldStart':0x1,'newStart':0x1};}export function highlightDiffLine(_0x5a526f,_0x3535a4){const _0x5f348e=window['hljs']||(typeof hljs!=='undefined'?hljs:null);if(_0x5f348e&&_0x3535a4)try{const _0x88a3f2=_0x5f348e['getLanguage'](_0x3535a4)?_0x3535a4:null;if(_0x88a3f2)return _0x5f348e['highlight'](_0x5a526f,{'language':_0x88a3f2})['value'];}catch(_0x34dbf2){console['error']('Diff\x20syntax\x20highlighting\x20error:',_0x34dbf2);}return Utils['escapeHtml'](_0x5a526f);}export function getFileLanguage(_0xd2b2c9){const _0x2b9be6=_0xd2b2c9['split']('.')['pop']()['toLowerCase'](),_0x3c1857={'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 _0x3c1857[_0x2b9be6]||null;}export function computeWordDiff(_0x7695f0,_0x47f7d7){const _0x264fb3=_0x21611c=>{const _0x56d931=[];let _0x52acc5='',_0x54873f=![];for(let _0x53a9b9=0x0;_0x53a9b9<_0x21611c['length'];_0x53a9b9++){const _0x436ec6=_0x21611c[_0x53a9b9],_0x293f4b=/\s/['test'](_0x436ec6);if(_0x52acc5==='')_0x52acc5=_0x436ec6,_0x54873f=_0x293f4b;else _0x293f4b===_0x54873f?_0x52acc5+=_0x436ec6:(_0x56d931['push'](_0x52acc5),_0x52acc5=_0x436ec6,_0x54873f=_0x293f4b);}return _0x52acc5&&_0x56d931['push'](_0x52acc5),_0x56d931;},_0x153f51=_0x264fb3(_0x7695f0),_0x103c86=_0x264fb3(_0x47f7d7),_0x373784=_0x153f51['length'],_0x101c03=_0x103c86['length'],_0x7d0bda=Array(_0x373784+0x1)['fill'](null)['map'](()=>Array(_0x101c03+0x1)['fill'](0x0));for(let _0x5e103d=0x1;_0x5e103d<=_0x373784;_0x5e103d++){for(let _0x319e4d=0x1;_0x319e4d<=_0x101c03;_0x319e4d++){_0x153f51[_0x5e103d-0x1]===_0x103c86[_0x319e4d-0x1]?_0x7d0bda[_0x5e103d][_0x319e4d]=_0x7d0bda[_0x5e103d-0x1][_0x319e4d-0x1]+0x1:_0x7d0bda[_0x5e103d][_0x319e4d]=Math['max'](_0x7d0bda[_0x5e103d-0x1][_0x319e4d],_0x7d0bda[_0x5e103d][_0x319e4d-0x1]);}}const _0x3380fb={'old':[],'new':[]};let _0x469777=_0x373784,_0x187dd8=_0x101c03;const _0x3ce7de=[],_0x5f41eb=[];while(_0x469777>0x0||_0x187dd8>0x0){if(_0x469777>0x0&&_0x187dd8>0x0&&_0x153f51[_0x469777-0x1]===_0x103c86[_0x187dd8-0x1])_0x3ce7de['unshift']({'type':'equal','text':_0x153f51[_0x469777-0x1]}),_0x5f41eb['unshift']({'type':'equal','text':_0x103c86[_0x187dd8-0x1]}),_0x469777--,_0x187dd8--;else{if(_0x187dd8>0x0&&(_0x469777===0x0||_0x7d0bda[_0x469777][_0x187dd8-0x1]>=_0x7d0bda[_0x469777-0x1][_0x187dd8]))_0x5f41eb['unshift']({'type':'insert','text':_0x103c86[_0x187dd8-0x1]}),_0x187dd8--;else _0x469777>0x0&&(_0x3ce7de['unshift']({'type':'delete','text':_0x153f51[_0x469777-0x1]}),_0x469777--);}}return _0x3380fb['old']=_0x3ce7de,_0x3380fb['new']=_0x5f41eb,_0x3380fb;}export function renderDiffLineWithWordHighlight(_0xacc780,_0x401179,_0xf0c0a2,_0x5b0878){if(!_0x401179||_0x401179['length']===0x0)return highlightDiffLine(_0xacc780,_0x5b0878);let _0x4cf53f='';const _0x1d332c=_0xf0c0a2==='add'?'diff-word-add':'diff-word-remove',_0x33a280=_0xf0c0a2==='add'?'insert':'delete';for(const _0xd3e5f7 of _0x401179){const _0x377faf=Utils['escapeHtml'](_0xd3e5f7['text']);_0xd3e5f7['type']===_0x33a280?_0x4cf53f+='<span\x20class=\x22'+_0x1d332c+'\x22>'+_0x377faf+'</span>':_0x4cf53f+=_0x377faf;}return _0x4cf53f;}export function calculateDiffStats(_0x1a94f8){let _0x1f7f4e=0x0,_0x118aa2=0x0,_0x477c35=0x0;return _0x1a94f8['forEach'](_0x21de7f=>{let _0xd3e9ea=0x0,_0x2ea081=0x0;_0x21de7f['hunks']['forEach'](_0x21327c=>{_0x21327c['lines']['forEach'](_0x5d9505=>{if(_0x5d9505['startsWith']('+'))_0xd3e9ea+=0x1;else{if(_0x5d9505['startsWith']('-'))_0x2ea081+=0x1;}});}),(_0xd3e9ea+_0x2ea081>0x0||_0x21de7f['isDeleted'])&&(_0x477c35+=0x1),_0x1f7f4e+=_0xd3e9ea,_0x118aa2+=_0x2ea081;}),{'additions':_0x1f7f4e,'deletions':_0x118aa2,'files':_0x477c35};}export function getFileStatus(_0x20d249,_0x58b272,_0x51d79a){if(_0x20d249['isDeleted'])return'deleted';if(_0x58b272>0x0&&_0x51d79a===0x0)return'added';return'modified';}export function safeBase64(_0x5ba44e){try{return btoa(unescape(encodeURIComponent(_0x5ba44e)));}catch(_0x45b884){return btoa(_0x5ba44e);}}export function getStorageKey(_0x3386a3,_0x193426){return _0x3386a3+'-'+safeBase64(_0x193426);}export function getCollapsedState(_0x5856f6,_0xe5548d){const _0x27a3df=localStorage['getItem'](getStorageKey(_0x5856f6,_0xe5548d));return _0x27a3df==='true';}export function renderUnifiedDiff(_0x4ad9dc,_0x235d56){return _0x4ad9dc['map']((_0x15a45f,_0x224f87)=>{const _0x3892d=_0x15a45f['newPath']||_0x15a45f['oldPath']||'unknown',_0x26725c='diff-'+_0x235d56+'-'+_0x224f87,_0x4b49eb=getFileLanguage(_0x3892d),{additions:_0x253965,deletions:_0x476a7a}=calculateDiffStats([_0x15a45f]),_0x474804=getCollapsedState(_0x235d56,_0x3892d),_0x460c62=getFileStatus(_0x15a45f,_0x253965,_0x476a7a),_0x20099e=_0x460c62==='added'?'A':_0x460c62==='deleted'?'D':'M',_0x46eb8d=_0x15a45f['hunks']['map'](_0x3d1c10=>{const {oldStart:_0x18477c,newStart:_0x3a5584}=parseHunkHeader(_0x3d1c10['header']);let _0x5154c9=_0x18477c,_0x58f2d0=_0x3a5584;const _0x20870e=_0x3d1c10['lines']['map'](_0xd575c5=>({'line':_0xd575c5,'type':_0xd575c5['startsWith']('+')?'add':_0xd575c5['startsWith']('-')?'remove':_0xd575c5['startsWith']('\x5c')?'meta':'context'}));let _0x20fe09=0x0;while(_0x20fe09<_0x20870e['length']){if(_0x20870e[_0x20fe09]['type']==='remove'){let _0x16a2b4=_0x20fe09,_0x57ae5c=_0x20fe09;while(_0x57ae5c<_0x20870e['length']&&_0x20870e[_0x57ae5c]['type']==='remove')_0x57ae5c++;let _0x271f20=_0x57ae5c,_0x564dd2=_0x271f20;while(_0x564dd2<_0x20870e['length']&&_0x20870e[_0x564dd2]['type']==='add')_0x564dd2++;const _0xb64a0c=_0x57ae5c-_0x16a2b4,_0x4ef31b=_0x564dd2-_0x271f20,_0x3872b1=Math['min'](_0xb64a0c,_0x4ef31b);for(let _0x445773=0x0;_0x445773<_0x3872b1;_0x445773++){const _0x4e0f3b=_0x20870e[_0x16a2b4+_0x445773]['line']['substring'](0x1),_0x4baed9=_0x20870e[_0x271f20+_0x445773]['line']['substring'](0x1),_0x2efd0b=computeWordDiff(_0x4e0f3b,_0x4baed9);_0x20870e[_0x16a2b4+_0x445773]['wordDiff']=_0x2efd0b['old'],_0x20870e[_0x271f20+_0x445773]['wordDiff']=_0x2efd0b['new'];}_0x20fe09=_0x564dd2;}else _0x20fe09++;}const _0x242a20=_0x20870e['map'](_0x47402f=>{const _0xef8e4e=_0x47402f['line'];if(_0xef8e4e['startsWith']('+')){const _0x5c39ec=_0xef8e4e['substring'](0x1),_0x573b9d=_0x47402f['wordDiff']?renderDiffLineWithWordHighlight(_0x5c39ec,_0x47402f['wordDiff'],'add',_0x4b49eb):highlightDiffLine(_0x5c39ec,_0x4b49eb),_0x1d2cfd='<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>'+_0x58f2d0+'</span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>+</span>'+_0x573b9d+'</span></div>';return _0x58f2d0+=0x1,_0x1d2cfd;}if(_0xef8e4e['startsWith']('-')){const _0x5b5d2e=_0xef8e4e['substring'](0x1),_0x2ec196=_0x47402f['wordDiff']?renderDiffLineWithWordHighlight(_0x5b5d2e,_0x47402f['wordDiff'],'remove',_0x4b49eb):highlightDiffLine(_0x5b5d2e,_0x4b49eb),_0xafedd2='<div\x20class=\x22diff-line\x20diff-remove\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x5154c9+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22></span><span\x20class=\x22diff-line-content\x22><span\x20class=\x22diff-prefix\x22>-</span>'+_0x2ec196+'</span></div>';return _0x5154c9+=0x1,_0xafedd2;}if(_0xef8e4e['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'](_0xef8e4e)+'</span></div>';const _0x421d77=_0xef8e4e['startsWith']('\x20')?_0xef8e4e['substring'](0x1):_0xef8e4e,_0x47f1b2=highlightDiffLine(_0x421d77,_0x4b49eb),_0x3b05e6='<div\x20class=\x22diff-line\x20diff-context\x22><span\x20class=\x22diff-line-num\x20diff-line-num-old\x22>'+_0x5154c9+'</span><span\x20class=\x22diff-line-num\x20diff-line-num-new\x22>'+_0x58f2d0+'</span><span\x20class=\x22diff-line-content\x22>\x20'+_0x47f1b2+'</span></div>';return _0x5154c9+=0x1,_0x58f2d0+=0x1,_0x3b05e6;})['join']('');return'<div\x20class=\x22diff-hunk\x22><div\x20class=\x22diff-hunk-header\x22>'+Utils['escapeHtml'](_0x3d1c10['header'])+'</div>'+_0x242a20+'</div>';})['join'](''),_0x521976=_0x46eb8d||'<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-'+_0x26725c+'\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22file-diff-header\x22\x20data-diff-id=\x22'+_0x26725c+'\x22\x20data-file-name=\x22'+Utils['escapeHtml'](_0x3892d)+'\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'+_0x460c62+'\x22>'+_0x20099e+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22file-diff-name\x22>'+Utils['escapeHtml'](_0x3892d)+'</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>+'+_0x253965+'</span>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<span\x20class=\x22diff-del\x22>-'+_0x476a7a+'</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'+_0x26725c+'\x22\x20data-collapsed=\x22'+_0x474804+'\x22\x20type=\x22button\x22\x20aria-label=\x22'+(_0x474804?'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'+(_0x474804?'collapsed':'')+'\x22\x20id=\x22'+_0x26725c+'\x22>'+_0x521976+'</div>\x0a\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20';})['join']('');}
|
|
@@ -1841,6 +1841,27 @@ code {
|
|
|
1841
1841
|
cursor: pointer;
|
|
1842
1842
|
}
|
|
1843
1843
|
|
|
1844
|
+
/* Standard instruction toggles */
|
|
1845
|
+
.standard-instructions-card {
|
|
1846
|
+
margin-bottom: 16px;
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
.std-instr-preview-link {
|
|
1850
|
+
margin-left: 6px;
|
|
1851
|
+
font-size: 12px;
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
.std-instr-preview {
|
|
1855
|
+
margin-top: 8px;
|
|
1856
|
+
padding: 12px 16px;
|
|
1857
|
+
background: var(--color-background);
|
|
1858
|
+
border: 1px solid var(--color-border);
|
|
1859
|
+
border-radius: var(--radius-medium, 6px);
|
|
1860
|
+
font-size: 13px;
|
|
1861
|
+
max-height: 300px;
|
|
1862
|
+
overflow-y: auto;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1844
1865
|
/* ============================================================
|
|
1845
1866
|
UTILITIES
|
|
1846
1867
|
============================================================ */
|
|
@@ -543,23 +543,93 @@
|
|
|
543
543
|
<div id="urls-list" class="config-list"></div>
|
|
544
544
|
</div>
|
|
545
545
|
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
546
|
+
</div>
|
|
547
|
+
</div>
|
|
548
|
+
|
|
549
|
+
<div class="content-card">
|
|
550
|
+
<div class="card-header">
|
|
551
|
+
<h3>Volume Mounts</h3>
|
|
552
|
+
<button class="btn-secondary btn-small" id="add-volume-mount-btn">+ Add Mount</button>
|
|
553
|
+
</div>
|
|
554
|
+
<div class="card-body">
|
|
555
|
+
<p class="text-muted" style="margin-bottom: 12px;">Mount host directories into containers</p>
|
|
556
|
+
<div id="volume-mounts-list" class="config-list"></div>
|
|
554
557
|
</div>
|
|
555
558
|
</div>
|
|
556
559
|
</div>
|
|
557
560
|
|
|
558
561
|
<!-- Instructions Tab -->
|
|
559
562
|
<div id="tab-agents" class="tab-panel" role="tabpanel" hidden>
|
|
563
|
+
<!-- Standard Instructions toggles -->
|
|
564
|
+
<div class="content-card standard-instructions-card">
|
|
565
|
+
<div class="card-header">
|
|
566
|
+
<h3>Standard Instructions</h3>
|
|
567
|
+
<span class="text-muted">Appended to instructions at task startup</span>
|
|
568
|
+
</div>
|
|
569
|
+
<div class="card-body">
|
|
570
|
+
<div class="form-single-column">
|
|
571
|
+
<div class="std-instr-item">
|
|
572
|
+
<div class="form-row">
|
|
573
|
+
<label class="toggle-switch">
|
|
574
|
+
<input type="checkbox" id="toggle-output-requirements">
|
|
575
|
+
<span class="toggle-slider"></span>
|
|
576
|
+
<span class="toggle-label">Output Requirements</span>
|
|
577
|
+
</label>
|
|
578
|
+
<span class="text-muted">Produce a task summary and commit message <a href="#" class="std-instr-preview-link" data-target="preview-output-requirements">View</a></span>
|
|
579
|
+
</div>
|
|
580
|
+
<div class="std-instr-preview markdown-preview-container" id="preview-output-requirements" hidden></div>
|
|
581
|
+
</div>
|
|
582
|
+
<div class="std-instr-item" data-condition="skill:playwright-skill">
|
|
583
|
+
<div class="form-row">
|
|
584
|
+
<label class="toggle-switch">
|
|
585
|
+
<input type="checkbox" id="toggle-screenshot-guidelines">
|
|
586
|
+
<span class="toggle-slider"></span>
|
|
587
|
+
<span class="toggle-label">Screenshot Guidelines</span>
|
|
588
|
+
</label>
|
|
589
|
+
<span class="text-muted">Save and reference screenshots in task output <a href="#" class="std-instr-preview-link" data-target="preview-screenshot-guidelines">View</a></span>
|
|
590
|
+
</div>
|
|
591
|
+
<div class="std-instr-preview markdown-preview-container" id="preview-screenshot-guidelines" hidden></div>
|
|
592
|
+
</div>
|
|
593
|
+
<div class="std-instr-item" data-condition="connection:ibmi:build|interactive">
|
|
594
|
+
<div class="form-row">
|
|
595
|
+
<label class="toggle-switch">
|
|
596
|
+
<input type="checkbox" id="toggle-ibmi-output-requirements">
|
|
597
|
+
<span class="toggle-slider"></span>
|
|
598
|
+
<span class="toggle-label">IBM i Output Requirements</span>
|
|
599
|
+
</label>
|
|
600
|
+
<span class="text-muted">Add library name and verification results to task summary <a href="#" class="std-instr-preview-link" data-target="preview-ibmi-output-requirements">View</a></span>
|
|
601
|
+
</div>
|
|
602
|
+
<div class="std-instr-preview markdown-preview-container" id="preview-ibmi-output-requirements" hidden></div>
|
|
603
|
+
</div>
|
|
604
|
+
<div class="std-instr-item" data-condition="connection:ibmi:interactive">
|
|
605
|
+
<div class="form-row">
|
|
606
|
+
<label class="toggle-switch">
|
|
607
|
+
<input type="checkbox" id="toggle-ibmi-exploratory-verification">
|
|
608
|
+
<span class="toggle-slider"></span>
|
|
609
|
+
<span class="toggle-label">IBM i Exploratory Verification</span>
|
|
610
|
+
</label>
|
|
611
|
+
<span class="text-muted">Ad-hoc testing of interactive display file screens <a href="#" class="std-instr-preview-link" data-target="preview-ibmi-exploratory-verification">View</a></span>
|
|
612
|
+
</div>
|
|
613
|
+
<div class="std-instr-preview markdown-preview-container" id="preview-ibmi-exploratory-verification" hidden></div>
|
|
614
|
+
</div>
|
|
615
|
+
<div class="std-instr-item" data-condition="connection:ibmi:sql">
|
|
616
|
+
<div class="form-row">
|
|
617
|
+
<label class="toggle-switch">
|
|
618
|
+
<input type="checkbox" id="toggle-ibmi-database-sql">
|
|
619
|
+
<span class="toggle-slider"></span>
|
|
620
|
+
<span class="toggle-label">IBM i Database and SQL</span>
|
|
621
|
+
</label>
|
|
622
|
+
<span class="text-muted">Guidelines for querying IBM i database tables <a href="#" class="std-instr-preview-link" data-target="preview-ibmi-database-sql">View</a></span>
|
|
623
|
+
</div>
|
|
624
|
+
<div class="std-instr-preview markdown-preview-container" id="preview-ibmi-database-sql" hidden></div>
|
|
625
|
+
</div>
|
|
626
|
+
</div>
|
|
627
|
+
</div>
|
|
628
|
+
</div>
|
|
629
|
+
|
|
560
630
|
<div class="content-card">
|
|
561
631
|
<div class="card-header">
|
|
562
|
-
<h3>Instructions
|
|
632
|
+
<h3>Custom Instructions</h3>
|
|
563
633
|
<button class="btn-secondary btn-small" id="preview-agents-btn">
|
|
564
634
|
<span>👁</span> Preview
|
|
565
635
|
</button>
|