asta-ui 0.9.9 → 0.11.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/css/asta.css +2 -2
- package/css/asta.js +2693 -1
- package/css/components.css +3467 -5
- package/css/runtime/saas.css +333 -0
- package/css/runtime/saas.js +2690 -0
- package/css/src/core.css +5 -5
- package/css/src/saas.css +3162 -0
- package/css/tokens.css +27 -0
- package/dist/accordion-aui-143.d.ts +2 -0
- package/dist/accordion-aui-143.js +10 -0
- package/dist/accordion-aui-144.d.ts +2 -0
- package/dist/accordion-aui-144.js +10 -0
- package/dist/agent-plan-aui-197.d.ts +2 -0
- package/dist/agent-plan-aui-197.js +10 -0
- package/dist/agent-plan-aui-198.d.ts +2 -0
- package/dist/agent-plan-aui-198.js +10 -0
- package/dist/ai-chat-aui-215.d.ts +2 -0
- package/dist/ai-chat-aui-215.js +10 -0
- package/dist/ai-chat-aui-216.d.ts +2 -0
- package/dist/ai-chat-aui-216.js +9 -0
- package/dist/alert-aui-107.d.ts +2 -0
- package/dist/alert-aui-107.js +9 -0
- package/dist/alert-aui-108.d.ts +2 -0
- package/dist/alert-aui-108.js +9 -0
- package/dist/announcement-bar-aui-181.d.ts +2 -0
- package/dist/announcement-bar-aui-181.js +10 -0
- package/dist/announcement-bar-aui-182.d.ts +2 -0
- package/dist/announcement-bar-aui-182.js +10 -0
- package/dist/api-keys-aui-241.d.ts +2 -0
- package/dist/api-keys-aui-241.js +10 -0
- package/dist/api-keys-aui-242.d.ts +2 -0
- package/dist/api-keys-aui-242.js +9 -0
- package/dist/audit-log-aui-071.d.ts +2 -0
- package/dist/audit-log-aui-071.js +9 -0
- package/dist/audit-log-aui-072.d.ts +2 -0
- package/dist/audit-log-aui-072.js +10 -0
- package/dist/audit-log.d.ts +2 -0
- package/dist/audit-log.js +13 -0
- package/dist/avatar-aui-093.d.ts +2 -0
- package/dist/avatar-aui-093.js +10 -0
- package/dist/avatar-aui-094.d.ts +2 -0
- package/dist/avatar-aui-094.js +9 -0
- package/dist/avatar-group-aui-121.d.ts +2 -0
- package/dist/avatar-group-aui-121.js +10 -0
- package/dist/avatar-group-aui-122.d.ts +2 -0
- package/dist/avatar-group-aui-122.js +11 -0
- package/dist/badge-aui-091.d.ts +2 -0
- package/dist/badge-aui-091.js +11 -0
- package/dist/badge-aui-092.d.ts +2 -0
- package/dist/badge-aui-092.js +9 -0
- package/dist/base/accordion-aui-143.d.ts +2 -0
- package/dist/base/accordion-aui-143.js +10 -0
- package/dist/base/accordion-aui-144.d.ts +2 -0
- package/dist/base/accordion-aui-144.js +10 -0
- package/dist/base/agent-plan-aui-197.d.ts +2 -0
- package/dist/base/agent-plan-aui-197.js +10 -0
- package/dist/base/agent-plan-aui-198.d.ts +2 -0
- package/dist/base/agent-plan-aui-198.js +10 -0
- package/dist/base/ai-chat-aui-215.d.ts +2 -0
- package/dist/base/ai-chat-aui-215.js +10 -0
- package/dist/base/ai-chat-aui-216.d.ts +2 -0
- package/dist/base/ai-chat-aui-216.js +9 -0
- package/dist/base/alert-aui-107.d.ts +2 -0
- package/dist/base/alert-aui-107.js +9 -0
- package/dist/base/alert-aui-108.d.ts +2 -0
- package/dist/base/alert-aui-108.js +9 -0
- package/dist/base/announcement-bar-aui-181.d.ts +2 -0
- package/dist/base/announcement-bar-aui-181.js +10 -0
- package/dist/base/announcement-bar-aui-182.d.ts +2 -0
- package/dist/base/announcement-bar-aui-182.js +10 -0
- package/dist/base/api-keys-aui-241.d.ts +2 -0
- package/dist/base/api-keys-aui-241.js +10 -0
- package/dist/base/api-keys-aui-242.d.ts +2 -0
- package/dist/base/api-keys-aui-242.js +9 -0
- package/dist/base/audit-log-aui-071.d.ts +2 -0
- package/dist/base/audit-log-aui-071.js +9 -0
- package/dist/base/audit-log-aui-072.d.ts +2 -0
- package/dist/base/audit-log-aui-072.js +10 -0
- package/dist/base/audit-log.d.ts +2 -0
- package/dist/base/audit-log.js +13 -0
- package/dist/base/avatar-aui-093.d.ts +2 -0
- package/dist/base/avatar-aui-093.js +10 -0
- package/dist/base/avatar-aui-094.d.ts +2 -0
- package/dist/base/avatar-aui-094.js +9 -0
- package/dist/base/avatar-group-aui-121.d.ts +2 -0
- package/dist/base/avatar-group-aui-121.js +10 -0
- package/dist/base/avatar-group-aui-122.d.ts +2 -0
- package/dist/base/avatar-group-aui-122.js +11 -0
- package/dist/base/badge-aui-091.d.ts +2 -0
- package/dist/base/badge-aui-091.js +11 -0
- package/dist/base/badge-aui-092.d.ts +2 -0
- package/dist/base/badge-aui-092.js +9 -0
- package/dist/base/billing-aui-233.d.ts +2 -0
- package/dist/base/billing-aui-233.js +12 -0
- package/dist/base/billing-aui-234.d.ts +2 -0
- package/dist/base/billing-aui-234.js +10 -0
- package/dist/base/billing.js +2 -2
- package/dist/base/breadcrumb-aui-109.d.ts +2 -0
- package/dist/base/breadcrumb-aui-109.js +9 -0
- package/dist/base/breadcrumb-aui-110.d.ts +2 -0
- package/dist/base/breadcrumb-aui-110.js +10 -0
- package/dist/base/button.js +1 -1
- package/dist/base/cancel-flow-aui-087.d.ts +2 -0
- package/dist/base/cancel-flow-aui-087.js +10 -0
- package/dist/base/cancel-flow-aui-088.d.ts +2 -0
- package/dist/base/cancel-flow-aui-088.js +10 -0
- package/dist/base/cancel-flow.d.ts +2 -0
- package/dist/base/cancel-flow.js +9 -0
- package/dist/base/carousel-aui-161.d.ts +2 -0
- package/dist/base/carousel-aui-161.js +9 -0
- package/dist/base/carousel-aui-162.d.ts +2 -0
- package/dist/base/carousel-aui-162.js +9 -0
- package/dist/base/chart-card-aui-225.d.ts +2 -0
- package/dist/base/chart-card-aui-225.js +10 -0
- package/dist/base/chart-card-aui-226.d.ts +2 -0
- package/dist/base/chart-card-aui-226.js +9 -0
- package/dist/base/checkout-aui-219.d.ts +2 -0
- package/dist/base/checkout-aui-219.js +10 -0
- package/dist/base/checkout-aui-220.d.ts +2 -0
- package/dist/base/checkout-aui-220.js +10 -0
- package/dist/base/checkout.js +2 -2
- package/dist/base/citations-aui-193.d.ts +2 -0
- package/dist/base/citations-aui-193.js +10 -0
- package/dist/base/citations-aui-194.d.ts +2 -0
- package/dist/base/citations-aui-194.js +10 -0
- package/dist/base/color-picker-aui-119.d.ts +2 -0
- package/dist/base/color-picker-aui-119.js +13 -0
- package/dist/base/color-picker-aui-120.d.ts +2 -0
- package/dist/base/color-picker-aui-120.js +13 -0
- package/dist/base/command-palette-aui-201.d.ts +2 -0
- package/dist/base/command-palette-aui-201.js +9 -0
- package/dist/base/command-palette-aui-202.d.ts +2 -0
- package/dist/base/command-palette-aui-202.js +9 -0
- package/dist/base/comments-aui-213.d.ts +2 -0
- package/dist/base/comments-aui-213.js +10 -0
- package/dist/base/comments-aui-214.d.ts +2 -0
- package/dist/base/comments-aui-214.js +10 -0
- package/dist/base/comments.js +2 -2
- package/dist/base/context-menu-aui-167.d.ts +2 -0
- package/dist/base/context-menu-aui-167.js +9 -0
- package/dist/base/context-menu-aui-168.d.ts +2 -0
- package/dist/base/context-menu-aui-168.js +9 -0
- package/dist/base/context-meter-aui-131.d.ts +2 -0
- package/dist/base/context-meter-aui-131.js +10 -0
- package/dist/base/context-meter-aui-132.d.ts +2 -0
- package/dist/base/context-meter-aui-132.js +10 -0
- package/dist/base/cookie-consent-aui-189.d.ts +2 -0
- package/dist/base/cookie-consent-aui-189.js +10 -0
- package/dist/base/cookie-consent-aui-190.d.ts +2 -0
- package/dist/base/cookie-consent-aui-190.js +10 -0
- package/dist/base/cookie-consent.js +3 -3
- package/dist/base/copy-button-aui-113.d.ts +2 -0
- package/dist/base/copy-button-aui-113.js +10 -0
- package/dist/base/copy-button-aui-114.d.ts +2 -0
- package/dist/base/copy-button-aui-114.js +9 -0
- package/dist/base/countdown-aui-125.d.ts +2 -0
- package/dist/base/countdown-aui-125.js +10 -0
- package/dist/base/countdown-aui-126.d.ts +2 -0
- package/dist/base/countdown-aui-126.js +9 -0
- package/dist/base/data-table-aui-205.d.ts +2 -0
- package/dist/base/data-table-aui-205.js +10 -0
- package/dist/base/data-table-aui-206.d.ts +2 -0
- package/dist/base/data-table-aui-206.js +10 -0
- package/dist/base/dialog-aui-149.d.ts +2 -0
- package/dist/base/dialog-aui-149.js +10 -0
- package/dist/base/dialog-aui-150.d.ts +2 -0
- package/dist/base/dialog-aui-150.js +10 -0
- package/dist/base/drawer-aui-157.d.ts +2 -0
- package/dist/base/drawer-aui-157.js +9 -0
- package/dist/base/drawer-aui-158.d.ts +2 -0
- package/dist/base/drawer-aui-158.js +9 -0
- package/dist/base/dropdown-menu-aui-141.d.ts +2 -0
- package/dist/base/dropdown-menu-aui-141.js +9 -0
- package/dist/base/dropdown-menu-aui-142.d.ts +2 -0
- package/dist/base/dropdown-menu-aui-142.js +12 -0
- package/dist/base/dropdown-menu.js +2 -2
- package/dist/base/empty-state-aui-165.d.ts +2 -0
- package/dist/base/empty-state-aui-165.js +10 -0
- package/dist/base/empty-state-aui-166.d.ts +2 -0
- package/dist/base/empty-state-aui-166.js +10 -0
- package/dist/base/empty-state.js +2 -2
- package/dist/base/event-calendar-aui-217.d.ts +2 -0
- package/dist/base/event-calendar-aui-217.js +10 -0
- package/dist/base/event-calendar-aui-218.d.ts +2 -0
- package/dist/base/event-calendar-aui-218.js +9 -0
- package/dist/base/feature-flags-aui-079.d.ts +2 -0
- package/dist/base/feature-flags-aui-079.js +10 -0
- package/dist/base/feature-flags-aui-080.d.ts +2 -0
- package/dist/base/feature-flags-aui-080.js +10 -0
- package/dist/base/feature-flags.d.ts +2 -0
- package/dist/base/feature-flags.js +14 -0
- package/dist/base/field-aui-139.d.ts +2 -0
- package/dist/base/field-aui-139.js +9 -0
- package/dist/base/field-aui-140.d.ts +2 -0
- package/dist/base/field-aui-140.js +9 -0
- package/dist/base/file-card-aui-173.d.ts +2 -0
- package/dist/base/file-card-aui-173.js +10 -0
- package/dist/base/file-card-aui-174.d.ts +2 -0
- package/dist/base/file-card-aui-174.js +9 -0
- package/dist/base/file-manager-aui-231.d.ts +2 -0
- package/dist/base/file-manager-aui-231.js +10 -0
- package/dist/base/file-manager-aui-232.d.ts +2 -0
- package/dist/base/file-manager-aui-232.js +10 -0
- package/dist/base/file-manager.js +2 -2
- package/dist/base/file-upload-aui-153.d.ts +2 -0
- package/dist/base/file-upload-aui-153.js +10 -0
- package/dist/base/file-upload-aui-154.d.ts +2 -0
- package/dist/base/file-upload-aui-154.js +9 -0
- package/dist/base/footer.js +2 -2
- package/dist/base/hover-card-aui-169.d.ts +2 -0
- package/dist/base/hover-card-aui-169.js +9 -0
- package/dist/base/hover-card-aui-170.d.ts +2 -0
- package/dist/base/hover-card-aui-170.js +10 -0
- package/dist/base/image-compare-aui-179.d.ts +2 -0
- package/dist/base/image-compare-aui-179.js +10 -0
- package/dist/base/image-compare-aui-180.d.ts +2 -0
- package/dist/base/image-compare-aui-180.js +9 -0
- package/dist/base/inbox-aui-229.d.ts +2 -0
- package/dist/base/inbox-aui-229.js +10 -0
- package/dist/base/inbox-aui-230.d.ts +2 -0
- package/dist/base/inbox-aui-230.js +10 -0
- package/dist/base/inbox.js +2 -2
- package/dist/base/inline-edit-aui-123.d.ts +2 -0
- package/dist/base/inline-edit-aui-123.js +10 -0
- package/dist/base/inline-edit-aui-124.d.ts +2 -0
- package/dist/base/inline-edit-aui-124.js +10 -0
- package/dist/base/integrations-aui-081.d.ts +2 -0
- package/dist/base/integrations-aui-081.js +11 -0
- package/dist/base/integrations-aui-082.d.ts +2 -0
- package/dist/base/integrations-aui-082.js +11 -0
- package/dist/base/integrations.d.ts +2 -0
- package/dist/base/integrations.js +11 -0
- package/dist/base/invoice-aui-227.d.ts +2 -0
- package/dist/base/invoice-aui-227.js +10 -0
- package/dist/base/invoice-aui-228.d.ts +2 -0
- package/dist/base/invoice-aui-228.js +10 -0
- package/dist/base/invoice.js +2 -2
- package/dist/base/kanban-aui-209.d.ts +2 -0
- package/dist/base/kanban-aui-209.js +9 -0
- package/dist/base/kanban-aui-210.d.ts +2 -0
- package/dist/base/kanban-aui-210.js +10 -0
- package/dist/base/kbd-aui-095.d.ts +2 -0
- package/dist/base/kbd-aui-095.js +11 -0
- package/dist/base/kbd-aui-096.d.ts +2 -0
- package/dist/base/kbd-aui-096.js +11 -0
- package/dist/base/menubar-aui-183.d.ts +2 -0
- package/dist/base/menubar-aui-183.js +9 -0
- package/dist/base/menubar-aui-184.d.ts +2 -0
- package/dist/base/menubar-aui-184.js +9 -0
- package/dist/base/meter-aui-127.d.ts +2 -0
- package/dist/base/meter-aui-127.js +9 -0
- package/dist/base/meter-aui-128.d.ts +2 -0
- package/dist/base/meter-aui-128.js +9 -0
- package/dist/base/model-picker-aui-191.d.ts +2 -0
- package/dist/base/model-picker-aui-191.js +9 -0
- package/dist/base/model-picker-aui-192.d.ts +2 -0
- package/dist/base/model-picker-aui-192.js +9 -0
- package/dist/base/motion-button-aui-089.d.ts +2 -0
- package/dist/base/motion-button-aui-089.js +9 -0
- package/dist/base/motion-button-aui-090.d.ts +2 -0
- package/dist/base/motion-button-aui-090.js +9 -0
- package/dist/base/navbar.js +2 -2
- package/dist/base/notification-center-aui-223.d.ts +2 -0
- package/dist/base/notification-center-aui-223.js +10 -0
- package/dist/base/notification-center-aui-224.d.ts +2 -0
- package/dist/base/notification-center-aui-224.js +10 -0
- package/dist/base/number-input-aui-147.d.ts +2 -0
- package/dist/base/number-input-aui-147.js +9 -0
- package/dist/base/number-input-aui-148.d.ts +2 -0
- package/dist/base/number-input-aui-148.js +10 -0
- package/dist/base/onboarding-aui-211.d.ts +2 -0
- package/dist/base/onboarding-aui-211.js +9 -0
- package/dist/base/onboarding-aui-212.d.ts +2 -0
- package/dist/base/onboarding-aui-212.js +10 -0
- package/dist/base/onboarding.js +2 -2
- package/dist/base/pagination-aui-111.d.ts +2 -0
- package/dist/base/pagination-aui-111.js +10 -0
- package/dist/base/pagination-aui-112.d.ts +2 -0
- package/dist/base/pagination-aui-112.js +9 -0
- package/dist/base/phone-input-aui-185.d.ts +2 -0
- package/dist/base/phone-input-aui-185.js +11 -0
- package/dist/base/phone-input-aui-186.d.ts +2 -0
- package/dist/base/phone-input-aui-186.js +11 -0
- package/dist/base/popover-aui-155.d.ts +2 -0
- package/dist/base/popover-aui-155.js +10 -0
- package/dist/base/popover-aui-156.d.ts +2 -0
- package/dist/base/popover-aui-156.js +10 -0
- package/dist/base/pricing.js +2 -2
- package/dist/base/progress-aui-105.d.ts +2 -0
- package/dist/base/progress-aui-105.js +10 -0
- package/dist/base/progress-aui-106.d.ts +2 -0
- package/dist/base/progress-aui-106.js +10 -0
- package/dist/base/prompt-composer-aui-237.d.ts +2 -0
- package/dist/base/prompt-composer-aui-237.js +10 -0
- package/dist/base/prompt-composer-aui-238.d.ts +2 -0
- package/dist/base/prompt-composer-aui-238.js +10 -0
- package/dist/base/properties-panel-aui-199.d.ts +2 -0
- package/dist/base/properties-panel-aui-199.js +10 -0
- package/dist/base/properties-panel-aui-200.d.ts +2 -0
- package/dist/base/properties-panel-aui-200.js +9 -0
- package/dist/base/range-slider-aui-117.d.ts +2 -0
- package/dist/base/range-slider-aui-117.js +10 -0
- package/dist/base/range-slider-aui-118.d.ts +2 -0
- package/dist/base/range-slider-aui-118.js +9 -0
- package/dist/base/rating-aui-103.d.ts +2 -0
- package/dist/base/rating-aui-103.js +10 -0
- package/dist/base/rating-aui-104.d.ts +2 -0
- package/dist/base/rating-aui-104.js +10 -0
- package/dist/base/roles-permissions-aui-073.d.ts +2 -0
- package/dist/base/roles-permissions-aui-073.js +10 -0
- package/dist/base/roles-permissions-aui-074.d.ts +2 -0
- package/dist/base/roles-permissions-aui-074.js +10 -0
- package/dist/base/roles-permissions.d.ts +2 -0
- package/dist/base/roles-permissions.js +9 -0
- package/dist/base/scrub-input-aui-133.d.ts +2 -0
- package/dist/base/scrub-input-aui-133.js +9 -0
- package/dist/base/scrub-input-aui-134.d.ts +2 -0
- package/dist/base/scrub-input-aui-134.js +9 -0
- package/dist/base/security-settings-aui-075.d.ts +2 -0
- package/dist/base/security-settings-aui-075.js +10 -0
- package/dist/base/security-settings-aui-076.d.ts +2 -0
- package/dist/base/security-settings-aui-076.js +10 -0
- package/dist/base/security-settings.d.ts +2 -0
- package/dist/base/security-settings.js +10 -0
- package/dist/base/segmented-control-aui-135.d.ts +2 -0
- package/dist/base/segmented-control-aui-135.js +9 -0
- package/dist/base/segmented-control-aui-136.d.ts +2 -0
- package/dist/base/segmented-control-aui-136.js +9 -0
- package/dist/base/settings-panel-aui-203.d.ts +2 -0
- package/dist/base/settings-panel-aui-203.js +9 -0
- package/dist/base/settings-panel-aui-204.d.ts +2 -0
- package/dist/base/settings-panel-aui-204.js +10 -0
- package/dist/base/settings-panel.js +2 -2
- package/dist/base/sidebar-aui-207.d.ts +2 -0
- package/dist/base/sidebar-aui-207.js +9 -0
- package/dist/base/sidebar-aui-208.d.ts +2 -0
- package/dist/base/sidebar-aui-208.js +9 -0
- package/dist/base/sign-in.js +2 -2
- package/dist/base/skeleton-aui-101.d.ts +2 -0
- package/dist/base/skeleton-aui-101.js +10 -0
- package/dist/base/skeleton-aui-102.d.ts +2 -0
- package/dist/base/skeleton-aui-102.js +12 -0
- package/dist/base/sortable-list-aui-187.d.ts +2 -0
- package/dist/base/sortable-list-aui-187.js +9 -0
- package/dist/base/sortable-list-aui-188.d.ts +2 -0
- package/dist/base/sortable-list-aui-188.js +9 -0
- package/dist/base/spinner-aui-097.d.ts +2 -0
- package/dist/base/spinner-aui-097.js +9 -0
- package/dist/base/spinner-aui-098.d.ts +2 -0
- package/dist/base/spinner-aui-098.js +10 -0
- package/dist/base/stat-card-aui-163.d.ts +2 -0
- package/dist/base/stat-card-aui-163.js +10 -0
- package/dist/base/stat-card-aui-164.d.ts +2 -0
- package/dist/base/stat-card-aui-164.js +9 -0
- package/dist/base/status-page-aui-083.d.ts +2 -0
- package/dist/base/status-page-aui-083.js +10 -0
- package/dist/base/status-page-aui-084.d.ts +2 -0
- package/dist/base/status-page-aui-084.js +10 -0
- package/dist/base/status-page.d.ts +2 -0
- package/dist/base/status-page.js +10 -0
- package/dist/base/stepper-aui-151.d.ts +2 -0
- package/dist/base/stepper-aui-151.js +10 -0
- package/dist/base/stepper-aui-152.d.ts +2 -0
- package/dist/base/stepper-aui-152.js +10 -0
- package/dist/base/switch.js +1 -1
- package/dist/base/tabs-aui-137.d.ts +2 -0
- package/dist/base/tabs-aui-137.js +9 -0
- package/dist/base/tabs-aui-138.d.ts +2 -0
- package/dist/base/tabs-aui-138.js +10 -0
- package/dist/base/team-members-aui-221.d.ts +2 -0
- package/dist/base/team-members-aui-221.js +11 -0
- package/dist/base/team-members-aui-222.d.ts +2 -0
- package/dist/base/team-members-aui-222.js +10 -0
- package/dist/base/team-members.js +2 -2
- package/dist/base/testimonials-aui-235.d.ts +2 -0
- package/dist/base/testimonials-aui-235.js +10 -0
- package/dist/base/testimonials-aui-236.d.ts +2 -0
- package/dist/base/testimonials-aui-236.js +10 -0
- package/dist/base/thinking-aui-129.d.ts +2 -0
- package/dist/base/thinking-aui-129.js +10 -0
- package/dist/base/thinking-aui-130.d.ts +2 -0
- package/dist/base/thinking-aui-130.js +9 -0
- package/dist/base/timeline-aui-159.d.ts +2 -0
- package/dist/base/timeline-aui-159.js +11 -0
- package/dist/base/timeline-aui-160.d.ts +2 -0
- package/dist/base/timeline-aui-160.js +9 -0
- package/dist/base/toast-aui-145.d.ts +2 -0
- package/dist/base/toast-aui-145.js +9 -0
- package/dist/base/toast-aui-146.d.ts +2 -0
- package/dist/base/toast-aui-146.js +12 -0
- package/dist/base/toggle-group-aui-115.d.ts +2 -0
- package/dist/base/toggle-group-aui-115.js +11 -0
- package/dist/base/toggle-group-aui-116.d.ts +2 -0
- package/dist/base/toggle-group-aui-116.js +9 -0
- package/dist/base/tool-approval-aui-195.d.ts +2 -0
- package/dist/base/tool-approval-aui-195.js +10 -0
- package/dist/base/tool-approval-aui-196.d.ts +2 -0
- package/dist/base/tool-approval-aui-196.js +10 -0
- package/dist/base/tool-dock-aui-177.d.ts +2 -0
- package/dist/base/tool-dock-aui-177.js +9 -0
- package/dist/base/tool-dock-aui-178.d.ts +2 -0
- package/dist/base/tool-dock-aui-178.js +10 -0
- package/dist/base/tooltip-aui-099.d.ts +2 -0
- package/dist/base/tooltip-aui-099.js +9 -0
- package/dist/base/tooltip-aui-100.d.ts +2 -0
- package/dist/base/tooltip-aui-100.js +9 -0
- package/dist/base/trace-waterfall-aui-239.d.ts +2 -0
- package/dist/base/trace-waterfall-aui-239.js +9 -0
- package/dist/base/trace-waterfall-aui-240.d.ts +2 -0
- package/dist/base/trace-waterfall-aui-240.js +9 -0
- package/dist/base/tree-view-aui-171.d.ts +2 -0
- package/dist/base/tree-view-aui-171.js +9 -0
- package/dist/base/tree-view-aui-172.d.ts +2 -0
- package/dist/base/tree-view-aui-172.js +10 -0
- package/dist/base/usage-overview-aui-069.d.ts +2 -0
- package/dist/base/usage-overview-aui-069.js +10 -0
- package/dist/base/usage-overview-aui-070.d.ts +2 -0
- package/dist/base/usage-overview-aui-070.js +10 -0
- package/dist/base/usage-overview.d.ts +2 -0
- package/dist/base/usage-overview.js +10 -0
- package/dist/base/webhooks-aui-077.d.ts +2 -0
- package/dist/base/webhooks-aui-077.js +10 -0
- package/dist/base/webhooks-aui-078.d.ts +2 -0
- package/dist/base/webhooks-aui-078.js +10 -0
- package/dist/base/webhooks.d.ts +2 -0
- package/dist/base/webhooks.js +10 -0
- package/dist/base/whats-new-aui-085.d.ts +2 -0
- package/dist/base/whats-new-aui-085.js +10 -0
- package/dist/base/whats-new-aui-086.d.ts +2 -0
- package/dist/base/whats-new-aui-086.js +9 -0
- package/dist/base/whats-new.d.ts +2 -0
- package/dist/base/whats-new.js +15 -0
- package/dist/base/workspace-switcher-aui-175.d.ts +2 -0
- package/dist/base/workspace-switcher-aui-175.js +9 -0
- package/dist/base/workspace-switcher-aui-176.d.ts +2 -0
- package/dist/base/workspace-switcher-aui-176.js +9 -0
- package/dist/base.js +1239 -125
- package/dist/billing-aui-233.d.ts +2 -0
- package/dist/billing-aui-233.js +12 -0
- package/dist/billing-aui-234.d.ts +2 -0
- package/dist/billing-aui-234.js +10 -0
- package/dist/billing.js +2 -2
- package/dist/breadcrumb-aui-109.d.ts +2 -0
- package/dist/breadcrumb-aui-109.js +9 -0
- package/dist/breadcrumb-aui-110.d.ts +2 -0
- package/dist/breadcrumb-aui-110.js +10 -0
- package/dist/button.js +1 -1
- package/dist/cancel-flow-aui-087.d.ts +2 -0
- package/dist/cancel-flow-aui-087.js +10 -0
- package/dist/cancel-flow-aui-088.d.ts +2 -0
- package/dist/cancel-flow-aui-088.js +10 -0
- package/dist/cancel-flow.d.ts +2 -0
- package/dist/cancel-flow.js +9 -0
- package/dist/carousel-aui-161.d.ts +2 -0
- package/dist/carousel-aui-161.js +9 -0
- package/dist/carousel-aui-162.d.ts +2 -0
- package/dist/carousel-aui-162.js +9 -0
- package/dist/chart-card-aui-225.d.ts +2 -0
- package/dist/chart-card-aui-225.js +10 -0
- package/dist/chart-card-aui-226.d.ts +2 -0
- package/dist/chart-card-aui-226.js +9 -0
- package/dist/checkout-aui-219.d.ts +2 -0
- package/dist/checkout-aui-219.js +10 -0
- package/dist/checkout-aui-220.d.ts +2 -0
- package/dist/checkout-aui-220.js +10 -0
- package/dist/checkout.js +2 -2
- package/dist/{chunk-5ZQ6PMJT.js → chunk-22ILG5VV.js} +2 -2
- package/dist/chunk-23EWWQ3Y.js +111 -0
- package/dist/chunk-2ETENLLY.js +156 -0
- package/dist/chunk-2KXQFWGS.js +269 -0
- package/dist/{chunk-B6KIW23F.js → chunk-2RUX5OTU.js} +1 -1
- package/dist/{chunk-BQL7HJSV.js → chunk-2U3WJCWO.js} +1 -1
- package/dist/chunk-32BY5RC4.js +330 -0
- package/dist/chunk-3D6SQU5R.js +115 -0
- package/dist/{chunk-KEPRNTOF.js → chunk-3F4MIHEK.js} +1 -1
- package/dist/chunk-3GEWK5XT.js +204 -0
- package/dist/chunk-3L7E3255.js +162 -0
- package/dist/chunk-3QHXG6FW.js +228 -0
- package/dist/chunk-3QXDPHRK.js +282 -0
- package/dist/chunk-3UGT5EYC.js +167 -0
- package/dist/chunk-3VRDAU5C.js +162 -0
- package/dist/chunk-3YAVOB4C.js +184 -0
- package/dist/chunk-44BVNT7X.js +237 -0
- package/dist/chunk-44LIMETZ.js +159 -0
- package/dist/chunk-46NYTVKS.js +195 -0
- package/dist/chunk-47HI4B6B.js +256 -0
- package/dist/chunk-4CNBG72C.js +256 -0
- package/dist/chunk-4FT4XE5E.js +190 -0
- package/dist/chunk-4RHHI2A6.js +155 -0
- package/dist/chunk-4TLYVD6I.js +155 -0
- package/dist/chunk-56MU4LQU.js +161 -0
- package/dist/chunk-5BHTODRR.js +151 -0
- package/dist/{chunk-E6HAVXWS.js → chunk-5CD5RMFF.js} +1 -1
- package/dist/chunk-5DKBUC4O.js +195 -0
- package/dist/chunk-5H7MWXN4.js +439 -0
- package/dist/chunk-5IKSMRNL.js +152 -0
- package/dist/chunk-5IN3XZ54.js +117 -0
- package/dist/chunk-5SRENDOL.js +149 -0
- package/dist/chunk-5ZPBPHMT.js +290 -0
- package/dist/chunk-62ZR5JFG.js +199 -0
- package/dist/chunk-6AKVEMGV.js +167 -0
- package/dist/chunk-6J4IRQNU.js +433 -0
- package/dist/chunk-6N6W2NNL.js +204 -0
- package/dist/chunk-6NW4NQX2.js +221 -0
- package/dist/chunk-6PYYSG6C.js +120 -0
- package/dist/chunk-6XQVFVVU.js +85 -0
- package/dist/chunk-6YSE5UDT.js +412 -0
- package/dist/chunk-75MJJVD4.js +276 -0
- package/dist/{chunk-3PSV752Q.js → chunk-7E5ZWVOH.js} +1 -1
- package/dist/chunk-7GCP7OO2.js +75 -0
- package/dist/chunk-7PUHEBP6.js +157 -0
- package/dist/chunk-7U7272IB.js +206 -0
- package/dist/{chunk-5EYHX66O.js → chunk-7YF3BCAH.js} +1 -1
- package/dist/chunk-A44L4WI5.js +164 -0
- package/dist/chunk-AKW6V2M3.js +161 -0
- package/dist/chunk-AOZ3CKBU.js +154 -0
- package/dist/chunk-AQIJYAZH.js +245 -0
- package/dist/chunk-AQQAJVBE.js +199 -0
- package/dist/chunk-B36BFGVY.js +195 -0
- package/dist/chunk-B5632XPB.js +118 -0
- package/dist/chunk-BIAK6K4Z.js +237 -0
- package/dist/chunk-BKM2BPNE.js +105 -0
- package/dist/chunk-BN3PQYDM.js +178 -0
- package/dist/{chunk-WYFRNK6S.js → chunk-BT7K6WI5.js} +1 -1
- package/dist/{chunk-Y5NPX36Y.js → chunk-BTSLCG3J.js} +1 -1
- package/dist/chunk-BV6EI7NZ.js +149 -0
- package/dist/chunk-CBBHTHUR.js +242 -0
- package/dist/chunk-CBTX2ZL3.js +162 -0
- package/dist/chunk-CDJELHJE.js +152 -0
- package/dist/chunk-CE6PESJJ.js +199 -0
- package/dist/chunk-CG4IXAMD.js +124 -0
- package/dist/chunk-CLWDJTFR.js +217 -0
- package/dist/chunk-COMZRBJG.js +204 -0
- package/dist/chunk-CT5JZRT6.js +203 -0
- package/dist/chunk-CUU4TM5K.js +182 -0
- package/dist/chunk-CXJLC4QP.js +173 -0
- package/dist/{chunk-IVTOFG7I.js → chunk-CYU52LAD.js} +1 -1
- package/dist/chunk-D2OJGMRI.js +216 -0
- package/dist/chunk-D3ZPZDDB.js +83 -0
- package/dist/chunk-D7E2L5T2.js +208 -0
- package/dist/chunk-DBS72N66.js +184 -0
- package/dist/chunk-DBXRVCJ7.js +182 -0
- package/dist/chunk-DNC3TKXG.js +276 -0
- package/dist/chunk-DPRLEWJV.js +116 -0
- package/dist/{chunk-LUDI3KWR.js → chunk-DQNJLPQZ.js} +1 -1
- package/dist/chunk-DTNSTD47.js +146 -0
- package/dist/{chunk-TCCKCLEZ.js → chunk-DUAMPG7T.js} +1 -1
- package/dist/{chunk-TXHOOVX7.js → chunk-E4ZM7ZFL.js} +1 -1
- package/dist/chunk-EARCNYPG.js +375 -0
- package/dist/chunk-EK264O5G.js +179 -0
- package/dist/chunk-EKRNT34P.js +433 -0
- package/dist/chunk-EMBSKPTF.js +256 -0
- package/dist/chunk-ETXJI76W.js +217 -0
- package/dist/chunk-EWZW4YYH.js +197 -0
- package/dist/chunk-F2CVYXSM.js +265 -0
- package/dist/chunk-F2P42M4R.js +75 -0
- package/dist/chunk-F3FSB237.js +151 -0
- package/dist/chunk-F6KQSAFI.js +147 -0
- package/dist/chunk-F7QDMSE7.js +212 -0
- package/dist/chunk-FD6L6QOY.js +206 -0
- package/dist/chunk-FDDGDWCQ.js +261 -0
- package/dist/chunk-FHASONL2.js +204 -0
- package/dist/chunk-FHKXLESU.js +152 -0
- package/dist/chunk-FK3LBC4N.js +290 -0
- package/dist/chunk-FQLR4R6E.js +105 -0
- package/dist/chunk-FT66OTRI.js +247 -0
- package/dist/chunk-G4CMTRRS.js +116 -0
- package/dist/chunk-GAV642LQ.js +95 -0
- package/dist/chunk-GFZ7HXS3.js +144 -0
- package/dist/chunk-GKJIPWDZ.js +98 -0
- package/dist/chunk-GL3CEPXZ.js +113 -0
- package/dist/chunk-GLY773XR.js +265 -0
- package/dist/chunk-GO3ML6CS.js +158 -0
- package/dist/chunk-GPYTCOA3.js +217 -0
- package/dist/chunk-GTEIG36P.js +177 -0
- package/dist/chunk-GTSJGBSX.js +200 -0
- package/dist/chunk-GWX4FIYE.js +176 -0
- package/dist/chunk-GXRC2WSE.js +149 -0
- package/dist/chunk-H3HZJTM4.js +149 -0
- package/dist/chunk-H3PQQL5R.js +162 -0
- package/dist/chunk-HDOUY5RX.js +152 -0
- package/dist/chunk-HFOFQBBA.js +364 -0
- package/dist/chunk-HG4AZIAT.js +195 -0
- package/dist/{chunk-Z3PHHGUZ.js → chunk-HGQK3XJB.js} +1 -1
- package/dist/{chunk-3QC5SYGC.js → chunk-HKNI3L5Q.js} +1 -1
- package/dist/chunk-HNCGN6RP.js +158 -0
- package/dist/{chunk-MUURQUEM.js → chunk-HON5QYW7.js} +1 -1
- package/dist/chunk-HP6I7ABB.js +178 -0
- package/dist/chunk-HVTUOECI.js +291 -0
- package/dist/chunk-HX7OA7HR.js +246 -0
- package/dist/chunk-HXAUSPRL.js +144 -0
- package/dist/chunk-HZZQOODR.js +218 -0
- package/dist/chunk-IAKX4RFT.js +159 -0
- package/dist/chunk-IB4Y3OQC.js +201 -0
- package/dist/chunk-IGBXOYXT.js +251 -0
- package/dist/chunk-IIDYNQDP.js +247 -0
- package/dist/chunk-ILC5BM5S.js +180 -0
- package/dist/chunk-IQOSUA7R.js +230 -0
- package/dist/chunk-IQPUUNU6.js +151 -0
- package/dist/{chunk-URXTC4RD.js → chunk-IS35SPLR.js} +1 -1
- package/dist/chunk-ISEEO32S.js +186 -0
- package/dist/chunk-ISZSSLFO.js +250 -0
- package/dist/chunk-IVFCLJ65.js +80 -0
- package/dist/chunk-IX3FPFWA.js +182 -0
- package/dist/chunk-J4GTA2QZ.js +276 -0
- package/dist/chunk-J6SBWSMV.js +201 -0
- package/dist/chunk-J72ITZHM.js +133 -0
- package/dist/chunk-JAPU5PZ3.js +210 -0
- package/dist/chunk-JAUWTCZA.js +247 -0
- package/dist/chunk-JCWKRHUF.js +187 -0
- package/dist/{chunk-3AJ4EBSV.js → chunk-JIQIQ7IZ.js} +1 -1
- package/dist/chunk-JJTEIYPY.js +121 -0
- package/dist/chunk-JLRCNJVP.js +269 -0
- package/dist/chunk-JPG2YUGA.js +241 -0
- package/dist/chunk-JPZLGCCT.js +206 -0
- package/dist/chunk-JSJA6CMO.js +228 -0
- package/dist/chunk-JTBYA3OH.js +162 -0
- package/dist/chunk-JVGAZEJC.js +276 -0
- package/dist/{chunk-GQZPSVLB.js → chunk-JZNZUL3S.js} +1 -1
- package/dist/chunk-K2II4HG2.js +174 -0
- package/dist/chunk-K2TX7OOF.js +156 -0
- package/dist/chunk-K5T7OEVV.js +174 -0
- package/dist/chunk-KGWP422P.js +98 -0
- package/dist/chunk-KIFZ4XYQ.js +108 -0
- package/dist/chunk-KJBPLUNL.js +192 -0
- package/dist/chunk-KLBYI6FG.js +193 -0
- package/dist/{chunk-XWQNDAL5.js → chunk-KMYHXVOF.js} +1 -1
- package/dist/chunk-KPERBVIP.js +185 -0
- package/dist/chunk-KSIPLRRO.js +154 -0
- package/dist/chunk-KTEU3EOJ.js +193 -0
- package/dist/chunk-KUN462PF.js +142 -0
- package/dist/{chunk-KKDIIZQG.js → chunk-KY6XHDJY.js} +1 -1
- package/dist/chunk-L26GEETE.js +132 -0
- package/dist/chunk-L7ANCVLW.js +210 -0
- package/dist/{chunk-JZJWB5CQ.js → chunk-LBUUCJQE.js} +1 -1
- package/dist/chunk-LE3NNINY.js +187 -0
- package/dist/chunk-LL5YS72V.js +144 -0
- package/dist/chunk-LMHSZB4Y.js +140 -0
- package/dist/chunk-LN5ZBLVS.js +204 -0
- package/dist/chunk-LUWCN6M6.js +149 -0
- package/dist/chunk-LW5UBK6L.js +117 -0
- package/dist/chunk-LX5MWEGA.js +132 -0
- package/dist/chunk-M56L4FV4.js +140 -0
- package/dist/chunk-MAGDDLBW.js +90 -0
- package/dist/chunk-MEADFUX2.js +153 -0
- package/dist/chunk-MFPKAMOG.js +130 -0
- package/dist/chunk-MHV54X35.js +151 -0
- package/dist/{chunk-5A36JYGI.js → chunk-MJ7U3HGA.js} +1 -1
- package/dist/chunk-MLZAEZMV.js +174 -0
- package/dist/chunk-MMV7D47H.js +208 -0
- package/dist/chunk-MNV5NHCJ.js +149 -0
- package/dist/chunk-MO4XEB63.js +121 -0
- package/dist/chunk-MR6YPSOY.js +173 -0
- package/dist/chunk-MRD6HKGW.js +76 -0
- package/dist/chunk-MRVHBF5O.js +118 -0
- package/dist/chunk-MSZVUVPQ.js +65 -0
- package/dist/chunk-MXZYTPO5.js +186 -0
- package/dist/chunk-MZXACKNO.js +168 -0
- package/dist/{chunk-W3AUNR4J.js → chunk-N3ZDCARL.js} +1 -1
- package/dist/chunk-NBU75HIT.js +166 -0
- package/dist/chunk-NEE3G3HR.js +223 -0
- package/dist/chunk-NH7JJL7P.js +119 -0
- package/dist/chunk-NITHEUYC.js +265 -0
- package/dist/chunk-NKDXTOTG.js +424 -0
- package/dist/chunk-NOQWUNQJ.js +118 -0
- package/dist/chunk-NRWZWWZA.js +245 -0
- package/dist/chunk-NU2A7BDW.js +115 -0
- package/dist/chunk-NUZDJ357.js +197 -0
- package/dist/chunk-NVFGWPTA.js +412 -0
- package/dist/chunk-NYMUK4ML.js +179 -0
- package/dist/chunk-O2TK3C6N.js +161 -0
- package/dist/chunk-O3RBVK7O.js +164 -0
- package/dist/chunk-O4UZVMRX.js +83 -0
- package/dist/chunk-O57UPOOF.js +89 -0
- package/dist/chunk-OHMQ3PBV.js +83 -0
- package/dist/chunk-OIAFEBJ3.js +242 -0
- package/dist/chunk-OIVL2EYT.js +206 -0
- package/dist/chunk-OJFNVSP6.js +200 -0
- package/dist/chunk-OKPO3E2E.js +230 -0
- package/dist/chunk-OOI2PB4O.js +119 -0
- package/dist/chunk-OOTOPYNI.js +119 -0
- package/dist/chunk-ORUP57TE.js +120 -0
- package/dist/chunk-OSDUNR6C.js +157 -0
- package/dist/chunk-OSJ4BZGF.js +184 -0
- package/dist/chunk-OSZ4CYA7.js +174 -0
- package/dist/chunk-OTAZYAWP.js +133 -0
- package/dist/chunk-P452DGOG.js +364 -0
- package/dist/chunk-PEHA2D2Q.js +116 -0
- package/dist/{chunk-H3LVWLBS.js → chunk-PFKHMDTK.js} +1 -1
- package/dist/{chunk-AF2WLL3H.js → chunk-PGMKVOVX.js} +2 -2
- package/dist/chunk-PGW37WH6.js +130 -0
- package/dist/chunk-PMGANSWQ.js +174 -0
- package/dist/chunk-PUGLGN3Y.js +123 -0
- package/dist/chunk-PUYW5BP2.js +203 -0
- package/dist/chunk-PV5B432D.js +285 -0
- package/dist/chunk-PVYQ6FSK.js +211 -0
- package/dist/chunk-PYDVGESH.js +183 -0
- package/dist/chunk-PZTP52WH.js +199 -0
- package/dist/chunk-Q7WEVW7Q.js +265 -0
- package/dist/chunk-QC2ET4I2.js +291 -0
- package/dist/chunk-QEIROKZM.js +189 -0
- package/dist/chunk-QGQQL3R7.js +203 -0
- package/dist/chunk-QIJ2C3Y3.js +186 -0
- package/dist/{chunk-WSYMYSW3.js → chunk-QIZHAGI4.js} +1 -1
- package/dist/{chunk-HBKB2GXI.js → chunk-QJH5ZLJ7.js} +1 -1
- package/dist/chunk-QML4ECKC.js +103 -0
- package/dist/chunk-QRM26V2R.js +204 -0
- package/dist/chunk-QY3WUUJQ.js +141 -0
- package/dist/chunk-R4N5MVCA.js +165 -0
- package/dist/chunk-R635J37J.js +199 -0
- package/dist/chunk-RCO6UZVU.js +199 -0
- package/dist/chunk-RDHKZCRP.js +159 -0
- package/dist/chunk-REECP5W2.js +166 -0
- package/dist/chunk-RJRILG6Z.js +158 -0
- package/dist/chunk-RLGU3BAH.js +247 -0
- package/dist/chunk-RMZJK2GV.js +186 -0
- package/dist/chunk-RU3COGOU.js +185 -0
- package/dist/chunk-RUQZODSY.js +190 -0
- package/dist/chunk-S3CRPILZ.js +149 -0
- package/dist/chunk-SCDZXEWG.js +182 -0
- package/dist/chunk-SFVMISGU.js +184 -0
- package/dist/chunk-SL3HDDGE.js +259 -0
- package/dist/chunk-STKIMVGX.js +141 -0
- package/dist/chunk-SUWGV23S.js +211 -0
- package/dist/chunk-SYDNCJ7C.js +154 -0
- package/dist/chunk-SZZL6IIK.js +143 -0
- package/dist/chunk-T3QB7UFP.js +208 -0
- package/dist/chunk-TGCNNZK5.js +179 -0
- package/dist/chunk-TH6WOUGQ.js +161 -0
- package/dist/{chunk-Q2QV62WV.js → chunk-TKXFGPCY.js} +1 -1
- package/dist/chunk-TNJ5REKO.js +261 -0
- package/dist/chunk-TO2VZQPO.js +179 -0
- package/dist/chunk-TQPIT2NK.js +147 -0
- package/dist/chunk-TQUHEZ2G.js +179 -0
- package/dist/{chunk-GTRJUSVK.js → chunk-TSYFDGCR.js} +1 -1
- package/dist/chunk-TVAFHJ3A.js +185 -0
- package/dist/chunk-TX76FDVC.js +211 -0
- package/dist/chunk-U2CTOPPM.js +196 -0
- package/dist/chunk-U2EQEZZI.js +173 -0
- package/dist/chunk-U6WUO4FI.js +259 -0
- package/dist/chunk-U77RQXF7.js +221 -0
- package/dist/chunk-UHT6UPRI.js +121 -0
- package/dist/chunk-UNWQUAGA.js +276 -0
- package/dist/chunk-URHPEK7W.js +234 -0
- package/dist/chunk-UY6NQ7PH.js +189 -0
- package/dist/chunk-V3D2HW3V.js +107 -0
- package/dist/chunk-V5NGRQSK.js +158 -0
- package/dist/{chunk-QKMSLSS6.js → chunk-V5SXW6U7.js} +1 -1
- package/dist/chunk-VYMBTNQR.js +189 -0
- package/dist/chunk-VYQU55XD.js +103 -0
- package/dist/chunk-W3G5OHVN.js +545 -0
- package/dist/{chunk-HSDMCZMX.js → chunk-W5ZXNQUJ.js} +2 -2
- package/dist/chunk-WAQTHFIN.js +223 -0
- package/dist/chunk-WEKJIUSM.js +276 -0
- package/dist/chunk-WFPOTRV2.js +162 -0
- package/dist/chunk-WNXFWEUG.js +166 -0
- package/dist/chunk-WO4NUNUP.js +72 -0
- package/dist/chunk-WPHSKHJN.js +78 -0
- package/dist/{chunk-FC54ZZOS.js → chunk-WQM3JDLU.js} +1 -1
- package/dist/chunk-WQMLPER4.js +187 -0
- package/dist/chunk-WUUECGPE.js +247 -0
- package/dist/chunk-WUXU3S5N.js +140 -0
- package/dist/chunk-WVK5GECZ.js +122 -0
- package/dist/chunk-WXJOF3CX.js +186 -0
- package/dist/chunk-X4ABJNZL.js +204 -0
- package/dist/chunk-X6J4DRSE.js +186 -0
- package/dist/chunk-XEVEPCZ2.js +433 -0
- package/dist/chunk-XIVINNUT.js +209 -0
- package/dist/chunk-XKJJLODR.js +83 -0
- package/dist/chunk-XKQFWB4Z.js +424 -0
- package/dist/chunk-XMRBEPCY.js +154 -0
- package/dist/chunk-XMSZRP6S.js +177 -0
- package/dist/{chunk-M6UUAF25.js → chunk-XQQ2USYE.js} +1 -1
- package/dist/chunk-XSJF5HAE.js +234 -0
- package/dist/chunk-XY3QFIPY.js +216 -0
- package/dist/chunk-Y465JAOG.js +247 -0
- package/dist/chunk-Y4IQA5Z7.js +196 -0
- package/dist/chunk-YBHXPZUP.js +185 -0
- package/dist/{chunk-XSNQN67K.js → chunk-YE6GLSZ4.js} +1 -1
- package/dist/chunk-YFP4QSLO.js +241 -0
- package/dist/chunk-YPG64NY6.js +179 -0
- package/dist/chunk-YPYTX4QE.js +172 -0
- package/dist/chunk-YSIC77ML.js +113 -0
- package/dist/chunk-YUNGCCCL.js +123 -0
- package/dist/chunk-YYL6ZWEJ.js +374 -0
- package/dist/chunk-Z3PAQOUS.js +199 -0
- package/dist/chunk-ZFJHR7ZA.js +218 -0
- package/dist/chunk-ZH3W4QOE.js +189 -0
- package/dist/chunk-ZM6ZCLBP.js +121 -0
- package/dist/chunk-ZNDGNCN7.js +124 -0
- package/dist/chunk-ZT64XOMR.js +248 -0
- package/dist/chunk-ZYE3IBTN.js +250 -0
- package/dist/citations-aui-193.d.ts +2 -0
- package/dist/citations-aui-193.js +10 -0
- package/dist/citations-aui-194.d.ts +2 -0
- package/dist/citations-aui-194.js +10 -0
- package/dist/color-picker-aui-119.d.ts +2 -0
- package/dist/color-picker-aui-119.js +13 -0
- package/dist/color-picker-aui-120.d.ts +2 -0
- package/dist/color-picker-aui-120.js +13 -0
- package/dist/command-palette-aui-201.d.ts +2 -0
- package/dist/command-palette-aui-201.js +9 -0
- package/dist/command-palette-aui-202.d.ts +2 -0
- package/dist/command-palette-aui-202.js +9 -0
- package/dist/comments-aui-213.d.ts +2 -0
- package/dist/comments-aui-213.js +10 -0
- package/dist/comments-aui-214.d.ts +2 -0
- package/dist/comments-aui-214.js +10 -0
- package/dist/comments.js +2 -2
- package/dist/context-menu-aui-167.d.ts +2 -0
- package/dist/context-menu-aui-167.js +9 -0
- package/dist/context-menu-aui-168.d.ts +2 -0
- package/dist/context-menu-aui-168.js +9 -0
- package/dist/context-meter-aui-131.d.ts +2 -0
- package/dist/context-meter-aui-131.js +10 -0
- package/dist/context-meter-aui-132.d.ts +2 -0
- package/dist/context-meter-aui-132.js +10 -0
- package/dist/cookie-consent-aui-189.d.ts +2 -0
- package/dist/cookie-consent-aui-189.js +10 -0
- package/dist/cookie-consent-aui-190.d.ts +2 -0
- package/dist/cookie-consent-aui-190.js +10 -0
- package/dist/cookie-consent.js +2 -2
- package/dist/copy-button-aui-113.d.ts +2 -0
- package/dist/copy-button-aui-113.js +10 -0
- package/dist/copy-button-aui-114.d.ts +2 -0
- package/dist/copy-button-aui-114.js +9 -0
- package/dist/countdown-aui-125.d.ts +2 -0
- package/dist/countdown-aui-125.js +10 -0
- package/dist/countdown-aui-126.d.ts +2 -0
- package/dist/countdown-aui-126.js +9 -0
- package/dist/data-table-aui-205.d.ts +2 -0
- package/dist/data-table-aui-205.js +10 -0
- package/dist/data-table-aui-206.d.ts +2 -0
- package/dist/data-table-aui-206.js +10 -0
- package/dist/dialog-aui-149.d.ts +2 -0
- package/dist/dialog-aui-149.js +10 -0
- package/dist/dialog-aui-150.d.ts +2 -0
- package/dist/dialog-aui-150.js +10 -0
- package/dist/drawer-aui-157.d.ts +2 -0
- package/dist/drawer-aui-157.js +9 -0
- package/dist/drawer-aui-158.d.ts +2 -0
- package/dist/drawer-aui-158.js +9 -0
- package/dist/dropdown-menu-aui-141.d.ts +2 -0
- package/dist/dropdown-menu-aui-141.js +9 -0
- package/dist/dropdown-menu-aui-142.d.ts +2 -0
- package/dist/dropdown-menu-aui-142.js +12 -0
- package/dist/dropdown-menu.js +2 -2
- package/dist/empty-state-aui-165.d.ts +2 -0
- package/dist/empty-state-aui-165.js +10 -0
- package/dist/empty-state-aui-166.d.ts +2 -0
- package/dist/empty-state-aui-166.js +10 -0
- package/dist/empty-state.js +2 -2
- package/dist/event-calendar-aui-217.d.ts +2 -0
- package/dist/event-calendar-aui-217.js +10 -0
- package/dist/event-calendar-aui-218.d.ts +2 -0
- package/dist/event-calendar-aui-218.js +9 -0
- package/dist/feature-flags-aui-079.d.ts +2 -0
- package/dist/feature-flags-aui-079.js +10 -0
- package/dist/feature-flags-aui-080.d.ts +2 -0
- package/dist/feature-flags-aui-080.js +10 -0
- package/dist/feature-flags.d.ts +2 -0
- package/dist/feature-flags.js +14 -0
- package/dist/field-aui-139.d.ts +2 -0
- package/dist/field-aui-139.js +9 -0
- package/dist/field-aui-140.d.ts +2 -0
- package/dist/field-aui-140.js +9 -0
- package/dist/file-card-aui-173.d.ts +2 -0
- package/dist/file-card-aui-173.js +10 -0
- package/dist/file-card-aui-174.d.ts +2 -0
- package/dist/file-card-aui-174.js +9 -0
- package/dist/file-manager-aui-231.d.ts +2 -0
- package/dist/file-manager-aui-231.js +10 -0
- package/dist/file-manager-aui-232.d.ts +2 -0
- package/dist/file-manager-aui-232.js +10 -0
- package/dist/file-manager.js +2 -2
- package/dist/file-upload-aui-153.d.ts +2 -0
- package/dist/file-upload-aui-153.js +10 -0
- package/dist/file-upload-aui-154.d.ts +2 -0
- package/dist/file-upload-aui-154.js +9 -0
- package/dist/footer.js +2 -2
- package/dist/hover-card-aui-169.d.ts +2 -0
- package/dist/hover-card-aui-169.js +9 -0
- package/dist/hover-card-aui-170.d.ts +2 -0
- package/dist/hover-card-aui-170.js +10 -0
- package/dist/image-compare-aui-179.d.ts +2 -0
- package/dist/image-compare-aui-179.js +10 -0
- package/dist/image-compare-aui-180.d.ts +2 -0
- package/dist/image-compare-aui-180.js +9 -0
- package/dist/inbox-aui-229.d.ts +2 -0
- package/dist/inbox-aui-229.js +10 -0
- package/dist/inbox-aui-230.d.ts +2 -0
- package/dist/inbox-aui-230.js +10 -0
- package/dist/inbox.js +2 -2
- package/dist/index.js +1238 -124
- package/dist/inline-edit-aui-123.d.ts +2 -0
- package/dist/inline-edit-aui-123.js +10 -0
- package/dist/inline-edit-aui-124.d.ts +2 -0
- package/dist/inline-edit-aui-124.js +10 -0
- package/dist/integrations-aui-081.d.ts +2 -0
- package/dist/integrations-aui-081.js +11 -0
- package/dist/integrations-aui-082.d.ts +2 -0
- package/dist/integrations-aui-082.js +11 -0
- package/dist/integrations.d.ts +2 -0
- package/dist/integrations.js +11 -0
- package/dist/invoice-aui-227.d.ts +2 -0
- package/dist/invoice-aui-227.js +10 -0
- package/dist/invoice-aui-228.d.ts +2 -0
- package/dist/invoice-aui-228.js +10 -0
- package/dist/invoice.js +2 -2
- package/dist/kanban-aui-209.d.ts +2 -0
- package/dist/kanban-aui-209.js +9 -0
- package/dist/kanban-aui-210.d.ts +2 -0
- package/dist/kanban-aui-210.js +10 -0
- package/dist/kbd-aui-095.d.ts +2 -0
- package/dist/kbd-aui-095.js +11 -0
- package/dist/kbd-aui-096.d.ts +2 -0
- package/dist/kbd-aui-096.js +11 -0
- package/dist/menubar-aui-183.d.ts +2 -0
- package/dist/menubar-aui-183.js +9 -0
- package/dist/menubar-aui-184.d.ts +2 -0
- package/dist/menubar-aui-184.js +9 -0
- package/dist/meter-aui-127.d.ts +2 -0
- package/dist/meter-aui-127.js +9 -0
- package/dist/meter-aui-128.d.ts +2 -0
- package/dist/meter-aui-128.js +9 -0
- package/dist/model-picker-aui-191.d.ts +2 -0
- package/dist/model-picker-aui-191.js +9 -0
- package/dist/model-picker-aui-192.d.ts +2 -0
- package/dist/model-picker-aui-192.js +9 -0
- package/dist/motion-button-aui-089.d.ts +2 -0
- package/dist/motion-button-aui-089.js +9 -0
- package/dist/motion-button-aui-090.d.ts +2 -0
- package/dist/motion-button-aui-090.js +9 -0
- package/dist/navbar.js +2 -2
- package/dist/notification-center-aui-223.d.ts +2 -0
- package/dist/notification-center-aui-223.js +10 -0
- package/dist/notification-center-aui-224.d.ts +2 -0
- package/dist/notification-center-aui-224.js +10 -0
- package/dist/number-input-aui-147.d.ts +2 -0
- package/dist/number-input-aui-147.js +9 -0
- package/dist/number-input-aui-148.d.ts +2 -0
- package/dist/number-input-aui-148.js +10 -0
- package/dist/onboarding-aui-211.d.ts +2 -0
- package/dist/onboarding-aui-211.js +9 -0
- package/dist/onboarding-aui-212.d.ts +2 -0
- package/dist/onboarding-aui-212.js +10 -0
- package/dist/onboarding.js +2 -2
- package/dist/pagination-aui-111.d.ts +2 -0
- package/dist/pagination-aui-111.js +10 -0
- package/dist/pagination-aui-112.d.ts +2 -0
- package/dist/pagination-aui-112.js +9 -0
- package/dist/phone-input-aui-185.d.ts +2 -0
- package/dist/phone-input-aui-185.js +11 -0
- package/dist/phone-input-aui-186.d.ts +2 -0
- package/dist/phone-input-aui-186.js +11 -0
- package/dist/popover-aui-155.d.ts +2 -0
- package/dist/popover-aui-155.js +10 -0
- package/dist/popover-aui-156.d.ts +2 -0
- package/dist/popover-aui-156.js +10 -0
- package/dist/pricing.js +2 -2
- package/dist/progress-aui-105.d.ts +2 -0
- package/dist/progress-aui-105.js +10 -0
- package/dist/progress-aui-106.d.ts +2 -0
- package/dist/progress-aui-106.js +10 -0
- package/dist/prompt-composer-aui-237.d.ts +2 -0
- package/dist/prompt-composer-aui-237.js +10 -0
- package/dist/prompt-composer-aui-238.d.ts +2 -0
- package/dist/prompt-composer-aui-238.js +10 -0
- package/dist/properties-panel-aui-199.d.ts +2 -0
- package/dist/properties-panel-aui-199.js +10 -0
- package/dist/properties-panel-aui-200.d.ts +2 -0
- package/dist/properties-panel-aui-200.js +9 -0
- package/dist/range-slider-aui-117.d.ts +2 -0
- package/dist/range-slider-aui-117.js +10 -0
- package/dist/range-slider-aui-118.d.ts +2 -0
- package/dist/range-slider-aui-118.js +9 -0
- package/dist/rating-aui-103.d.ts +2 -0
- package/dist/rating-aui-103.js +10 -0
- package/dist/rating-aui-104.d.ts +2 -0
- package/dist/rating-aui-104.js +10 -0
- package/dist/roles-permissions-aui-073.d.ts +2 -0
- package/dist/roles-permissions-aui-073.js +10 -0
- package/dist/roles-permissions-aui-074.d.ts +2 -0
- package/dist/roles-permissions-aui-074.js +10 -0
- package/dist/roles-permissions.d.ts +2 -0
- package/dist/roles-permissions.js +9 -0
- package/dist/scrub-input-aui-133.d.ts +2 -0
- package/dist/scrub-input-aui-133.js +9 -0
- package/dist/scrub-input-aui-134.d.ts +2 -0
- package/dist/scrub-input-aui-134.js +9 -0
- package/dist/security-settings-aui-075.d.ts +2 -0
- package/dist/security-settings-aui-075.js +10 -0
- package/dist/security-settings-aui-076.d.ts +2 -0
- package/dist/security-settings-aui-076.js +10 -0
- package/dist/security-settings.d.ts +2 -0
- package/dist/security-settings.js +10 -0
- package/dist/segmented-control-aui-135.d.ts +2 -0
- package/dist/segmented-control-aui-135.js +9 -0
- package/dist/segmented-control-aui-136.d.ts +2 -0
- package/dist/segmented-control-aui-136.js +9 -0
- package/dist/settings-panel-aui-203.d.ts +2 -0
- package/dist/settings-panel-aui-203.js +9 -0
- package/dist/settings-panel-aui-204.d.ts +2 -0
- package/dist/settings-panel-aui-204.js +10 -0
- package/dist/settings-panel.js +2 -2
- package/dist/sidebar-aui-207.d.ts +2 -0
- package/dist/sidebar-aui-207.js +9 -0
- package/dist/sidebar-aui-208.d.ts +2 -0
- package/dist/sidebar-aui-208.js +9 -0
- package/dist/sign-in.js +2 -2
- package/dist/skeleton-aui-101.d.ts +2 -0
- package/dist/skeleton-aui-101.js +10 -0
- package/dist/skeleton-aui-102.d.ts +2 -0
- package/dist/skeleton-aui-102.js +12 -0
- package/dist/sortable-list-aui-187.d.ts +2 -0
- package/dist/sortable-list-aui-187.js +9 -0
- package/dist/sortable-list-aui-188.d.ts +2 -0
- package/dist/sortable-list-aui-188.js +9 -0
- package/dist/spinner-aui-097.d.ts +2 -0
- package/dist/spinner-aui-097.js +9 -0
- package/dist/spinner-aui-098.d.ts +2 -0
- package/dist/spinner-aui-098.js +10 -0
- package/dist/stat-card-aui-163.d.ts +2 -0
- package/dist/stat-card-aui-163.js +10 -0
- package/dist/stat-card-aui-164.d.ts +2 -0
- package/dist/stat-card-aui-164.js +9 -0
- package/dist/status-page-aui-083.d.ts +2 -0
- package/dist/status-page-aui-083.js +10 -0
- package/dist/status-page-aui-084.d.ts +2 -0
- package/dist/status-page-aui-084.js +10 -0
- package/dist/status-page.d.ts +2 -0
- package/dist/status-page.js +10 -0
- package/dist/stepper-aui-151.d.ts +2 -0
- package/dist/stepper-aui-151.js +10 -0
- package/dist/stepper-aui-152.d.ts +2 -0
- package/dist/stepper-aui-152.js +10 -0
- package/dist/tabs-aui-137.d.ts +2 -0
- package/dist/tabs-aui-137.js +9 -0
- package/dist/tabs-aui-138.d.ts +2 -0
- package/dist/tabs-aui-138.js +10 -0
- package/dist/team-members-aui-221.d.ts +2 -0
- package/dist/team-members-aui-221.js +11 -0
- package/dist/team-members-aui-222.d.ts +2 -0
- package/dist/team-members-aui-222.js +10 -0
- package/dist/team-members.js +2 -2
- package/dist/testimonials-aui-235.d.ts +2 -0
- package/dist/testimonials-aui-235.js +10 -0
- package/dist/testimonials-aui-236.d.ts +2 -0
- package/dist/testimonials-aui-236.js +10 -0
- package/dist/thinking-aui-129.d.ts +2 -0
- package/dist/thinking-aui-129.js +10 -0
- package/dist/thinking-aui-130.d.ts +2 -0
- package/dist/thinking-aui-130.js +9 -0
- package/dist/timeline-aui-159.d.ts +2 -0
- package/dist/timeline-aui-159.js +11 -0
- package/dist/timeline-aui-160.d.ts +2 -0
- package/dist/timeline-aui-160.js +9 -0
- package/dist/toast-aui-145.d.ts +2 -0
- package/dist/toast-aui-145.js +9 -0
- package/dist/toast-aui-146.d.ts +2 -0
- package/dist/toast-aui-146.js +12 -0
- package/dist/toggle-group-aui-115.d.ts +2 -0
- package/dist/toggle-group-aui-115.js +11 -0
- package/dist/toggle-group-aui-116.d.ts +2 -0
- package/dist/toggle-group-aui-116.js +9 -0
- package/dist/tool-approval-aui-195.d.ts +2 -0
- package/dist/tool-approval-aui-195.js +10 -0
- package/dist/tool-approval-aui-196.d.ts +2 -0
- package/dist/tool-approval-aui-196.js +10 -0
- package/dist/tool-dock-aui-177.d.ts +2 -0
- package/dist/tool-dock-aui-177.js +9 -0
- package/dist/tool-dock-aui-178.d.ts +2 -0
- package/dist/tool-dock-aui-178.js +10 -0
- package/dist/tooltip-aui-099.d.ts +2 -0
- package/dist/tooltip-aui-099.js +9 -0
- package/dist/tooltip-aui-100.d.ts +2 -0
- package/dist/tooltip-aui-100.js +9 -0
- package/dist/trace-waterfall-aui-239.d.ts +2 -0
- package/dist/trace-waterfall-aui-239.js +9 -0
- package/dist/trace-waterfall-aui-240.d.ts +2 -0
- package/dist/trace-waterfall-aui-240.js +9 -0
- package/dist/tree-view-aui-171.d.ts +2 -0
- package/dist/tree-view-aui-171.js +9 -0
- package/dist/tree-view-aui-172.d.ts +2 -0
- package/dist/tree-view-aui-172.js +10 -0
- package/dist/types/components/kit/audit-log.d.ts +78 -0
- package/dist/types/components/kit/base/audit-log.d.ts +78 -0
- package/dist/types/components/kit/base/feature-flags.d.ts +61 -0
- package/dist/types/components/kit/base/status-page.d.ts +62 -0
- package/dist/types/components/kit/base/usage-overview.d.ts +56 -0
- package/dist/types/components/kit/base/variants/accordion-aui-143.d.ts +22 -0
- package/dist/types/components/kit/base/variants/accordion-aui-144.d.ts +30 -0
- package/dist/types/components/kit/base/variants/agent-plan-aui-197.d.ts +30 -0
- package/dist/types/components/kit/base/variants/agent-plan-aui-198.d.ts +25 -0
- package/dist/types/components/kit/base/variants/ai-chat-aui-215.d.ts +32 -0
- package/dist/types/components/kit/base/variants/announcement-bar-aui-181.d.ts +25 -0
- package/dist/types/components/kit/base/variants/announcement-bar-aui-182.d.ts +21 -0
- package/dist/types/components/kit/base/variants/api-keys-aui-241.d.ts +33 -0
- package/dist/types/components/kit/base/variants/audit-log-aui-072.d.ts +34 -0
- package/dist/types/components/kit/base/variants/avatar-aui-093.d.ts +23 -0
- package/dist/types/components/kit/base/variants/avatar-group-aui-121.d.ts +28 -0
- package/dist/types/components/kit/base/variants/avatar-group-aui-122.d.ts +31 -0
- package/dist/types/components/kit/base/variants/billing-aui-233.d.ts +37 -0
- package/dist/types/components/kit/base/variants/billing-aui-234.d.ts +46 -0
- package/dist/types/components/kit/base/variants/breadcrumb-aui-110.d.ts +18 -0
- package/dist/types/components/kit/base/variants/cancel-flow-aui-087.d.ts +34 -0
- package/dist/types/components/kit/base/variants/cancel-flow-aui-088.d.ts +30 -0
- package/dist/types/components/kit/base/variants/checkout-aui-219.d.ts +41 -0
- package/dist/types/components/kit/base/variants/checkout-aui-220.d.ts +43 -0
- package/dist/types/components/kit/base/variants/citations-aui-193.d.ts +29 -0
- package/dist/types/components/kit/base/variants/citations-aui-194.d.ts +29 -0
- package/dist/types/components/kit/base/variants/comments-aui-213.d.ts +35 -0
- package/dist/types/components/kit/base/variants/comments-aui-214.d.ts +40 -0
- package/dist/types/components/kit/base/variants/context-meter-aui-131.d.ts +24 -0
- package/dist/types/components/kit/base/variants/context-meter-aui-132.d.ts +28 -0
- package/dist/types/components/kit/base/variants/cookie-consent-aui-189.d.ts +32 -0
- package/dist/types/components/kit/base/variants/cookie-consent-aui-190.d.ts +34 -0
- package/dist/types/components/kit/base/variants/copy-button-aui-113.d.ts +24 -0
- package/dist/types/components/kit/base/variants/countdown-aui-125.d.ts +25 -0
- package/dist/types/components/kit/base/variants/data-table-aui-205.d.ts +41 -0
- package/dist/types/components/kit/base/variants/data-table-aui-206.d.ts +33 -0
- package/dist/types/components/kit/base/variants/dialog-aui-149.d.ts +24 -0
- package/dist/types/components/kit/base/variants/dialog-aui-150.d.ts +33 -0
- package/dist/types/components/kit/base/variants/dropdown-menu-aui-142.d.ts +45 -0
- package/dist/types/components/kit/base/variants/empty-state-aui-165.d.ts +34 -0
- package/dist/types/components/kit/base/variants/empty-state-aui-166.d.ts +36 -0
- package/dist/types/components/kit/base/variants/event-calendar-aui-217.d.ts +32 -0
- package/dist/types/components/kit/base/variants/feature-flags-aui-079.d.ts +38 -0
- package/dist/types/components/kit/base/variants/feature-flags-aui-080.d.ts +29 -0
- package/dist/types/components/kit/base/variants/file-card-aui-173.d.ts +24 -0
- package/dist/types/components/kit/base/variants/file-manager-aui-231.d.ts +32 -0
- package/dist/types/components/kit/base/variants/file-manager-aui-232.d.ts +29 -0
- package/dist/types/components/kit/base/variants/file-upload-aui-153.d.ts +30 -0
- package/dist/types/components/kit/base/variants/hover-card-aui-170.d.ts +32 -0
- package/dist/types/components/kit/base/variants/image-compare-aui-179.d.ts +29 -0
- package/dist/types/components/kit/base/variants/inbox-aui-229.d.ts +31 -0
- package/dist/types/components/kit/base/variants/inbox-aui-230.d.ts +31 -0
- package/dist/types/components/kit/base/variants/inline-edit-aui-123.d.ts +32 -0
- package/dist/types/components/kit/base/variants/inline-edit-aui-124.d.ts +23 -0
- package/dist/types/components/kit/base/variants/integrations-aui-081.d.ts +41 -0
- package/dist/types/components/kit/base/variants/integrations-aui-082.d.ts +46 -0
- package/dist/types/components/kit/base/variants/invoice-aui-227.d.ts +40 -0
- package/dist/types/components/kit/base/variants/invoice-aui-228.d.ts +43 -0
- package/dist/types/components/kit/base/variants/kanban-aui-210.d.ts +32 -0
- package/dist/types/components/kit/base/variants/kbd-aui-095.d.ts +28 -0
- package/dist/types/components/kit/base/variants/kbd-aui-096.d.ts +21 -0
- package/dist/types/components/kit/base/variants/notification-center-aui-223.d.ts +36 -0
- package/dist/types/components/kit/base/variants/notification-center-aui-224.d.ts +37 -0
- package/dist/types/components/kit/base/variants/number-input-aui-148.d.ts +24 -0
- package/dist/types/components/kit/base/variants/onboarding-aui-212.d.ts +38 -0
- package/dist/types/components/kit/base/variants/pagination-aui-111.d.ts +27 -0
- package/dist/types/components/kit/base/variants/phone-input-aui-185.d.ts +25 -0
- package/dist/types/components/kit/base/variants/phone-input-aui-186.d.ts +33 -0
- package/dist/types/components/kit/base/variants/popover-aui-155.d.ts +33 -0
- package/dist/types/components/kit/base/variants/popover-aui-156.d.ts +38 -0
- package/dist/types/components/kit/base/variants/progress-aui-105.d.ts +32 -0
- package/dist/types/components/kit/base/variants/progress-aui-106.d.ts +29 -0
- package/dist/types/components/kit/base/variants/prompt-composer-aui-237.d.ts +26 -0
- package/dist/types/components/kit/base/variants/prompt-composer-aui-238.d.ts +33 -0
- package/dist/types/components/kit/base/variants/properties-panel-aui-199.d.ts +30 -0
- package/dist/types/components/kit/base/variants/range-slider-aui-117.d.ts +35 -0
- package/dist/types/components/kit/base/variants/rating-aui-103.d.ts +25 -0
- package/dist/types/components/kit/base/variants/rating-aui-104.d.ts +20 -0
- package/dist/types/components/kit/base/variants/roles-permissions-aui-073.d.ts +39 -0
- package/dist/types/components/kit/base/variants/roles-permissions-aui-074.d.ts +31 -0
- package/dist/types/components/kit/base/variants/security-settings-aui-075.d.ts +29 -0
- package/dist/types/components/kit/base/variants/security-settings-aui-076.d.ts +33 -0
- package/dist/types/components/kit/base/variants/settings-panel-aui-204.d.ts +26 -0
- package/dist/types/components/kit/base/variants/skeleton-aui-101.d.ts +38 -0
- package/dist/types/components/kit/base/variants/skeleton-aui-102.d.ts +30 -0
- package/dist/types/components/kit/base/variants/spinner-aui-098.d.ts +25 -0
- package/dist/types/components/kit/base/variants/stat-card-aui-163.d.ts +26 -0
- package/dist/types/components/kit/base/variants/status-page-aui-083.d.ts +25 -0
- package/dist/types/components/kit/base/variants/status-page-aui-084.d.ts +32 -0
- package/dist/types/components/kit/base/variants/stepper-aui-151.d.ts +34 -0
- package/dist/types/components/kit/base/variants/stepper-aui-152.d.ts +29 -0
- package/dist/types/components/kit/base/variants/tabs-aui-138.d.ts +33 -0
- package/dist/types/components/kit/base/variants/team-members-aui-221.d.ts +33 -0
- package/dist/types/components/kit/base/variants/team-members-aui-222.d.ts +26 -0
- package/dist/types/components/kit/base/variants/testimonials-aui-235.d.ts +29 -0
- package/dist/types/components/kit/base/variants/testimonials-aui-236.d.ts +33 -0
- package/dist/types/components/kit/base/variants/thinking-aui-129.d.ts +28 -0
- package/dist/types/components/kit/base/variants/timeline-aui-159.d.ts +33 -0
- package/dist/types/components/kit/base/variants/toast-aui-146.d.ts +38 -0
- package/dist/types/components/kit/base/variants/tool-approval-aui-195.d.ts +34 -0
- package/dist/types/components/kit/base/variants/tool-approval-aui-196.d.ts +41 -0
- package/dist/types/components/kit/base/variants/tool-dock-aui-178.d.ts +24 -0
- package/dist/types/components/kit/base/variants/tree-view-aui-172.d.ts +31 -0
- package/dist/types/components/kit/base/variants/usage-overview-aui-069.d.ts +40 -0
- package/dist/types/components/kit/base/variants/usage-overview-aui-070.d.ts +30 -0
- package/dist/types/components/kit/base/variants/webhooks-aui-077.d.ts +39 -0
- package/dist/types/components/kit/base/variants/webhooks-aui-078.d.ts +37 -0
- package/dist/types/components/kit/base/variants/whats-new-aui-085.d.ts +35 -0
- package/dist/types/components/kit/cancel-flow.d.ts +67 -0
- package/dist/types/components/kit/feature-flags.d.ts +61 -0
- package/dist/types/components/kit/integrations.d.ts +59 -0
- package/dist/types/components/kit/roles-permissions.d.ts +51 -0
- package/dist/types/components/kit/security-settings.d.ts +52 -0
- package/dist/types/components/kit/status-page.d.ts +62 -0
- package/dist/types/components/kit/usage-overview.d.ts +56 -0
- package/dist/types/components/kit/variants/accordion-aui-143.d.ts +22 -0
- package/dist/types/components/kit/variants/accordion-aui-144.d.ts +30 -0
- package/dist/types/components/kit/variants/agent-plan-aui-197.d.ts +30 -0
- package/dist/types/components/kit/variants/agent-plan-aui-198.d.ts +25 -0
- package/dist/types/components/kit/variants/ai-chat-aui-215.d.ts +32 -0
- package/dist/types/components/kit/variants/ai-chat-aui-216.d.ts +31 -0
- package/dist/types/components/kit/variants/alert-aui-107.d.ts +26 -0
- package/dist/types/components/kit/variants/alert-aui-108.d.ts +37 -0
- package/dist/types/components/kit/variants/announcement-bar-aui-181.d.ts +25 -0
- package/dist/types/components/kit/variants/announcement-bar-aui-182.d.ts +21 -0
- package/dist/types/components/kit/variants/api-keys-aui-241.d.ts +33 -0
- package/dist/types/components/kit/variants/api-keys-aui-242.d.ts +38 -0
- package/dist/types/components/kit/variants/audit-log-aui-071.d.ts +37 -0
- package/dist/types/components/kit/variants/audit-log-aui-072.d.ts +34 -0
- package/dist/types/components/kit/variants/avatar-aui-093.d.ts +23 -0
- package/dist/types/components/kit/variants/avatar-aui-094.d.ts +29 -0
- package/dist/types/components/kit/variants/avatar-group-aui-121.d.ts +28 -0
- package/dist/types/components/kit/variants/avatar-group-aui-122.d.ts +31 -0
- package/dist/types/components/kit/variants/badge-aui-091.d.ts +31 -0
- package/dist/types/components/kit/variants/badge-aui-092.d.ts +26 -0
- package/dist/types/components/kit/variants/billing-aui-233.d.ts +37 -0
- package/dist/types/components/kit/variants/billing-aui-234.d.ts +46 -0
- package/dist/types/components/kit/variants/breadcrumb-aui-109.d.ts +31 -0
- package/dist/types/components/kit/variants/breadcrumb-aui-110.d.ts +18 -0
- package/dist/types/components/kit/variants/cancel-flow-aui-087.d.ts +34 -0
- package/dist/types/components/kit/variants/cancel-flow-aui-088.d.ts +30 -0
- package/dist/types/components/kit/variants/carousel-aui-161.d.ts +26 -0
- package/dist/types/components/kit/variants/carousel-aui-162.d.ts +21 -0
- package/dist/types/components/kit/variants/chart-card-aui-225.d.ts +38 -0
- package/dist/types/components/kit/variants/chart-card-aui-226.d.ts +29 -0
- package/dist/types/components/kit/variants/checkout-aui-219.d.ts +41 -0
- package/dist/types/components/kit/variants/checkout-aui-220.d.ts +43 -0
- package/dist/types/components/kit/variants/citations-aui-193.d.ts +29 -0
- package/dist/types/components/kit/variants/citations-aui-194.d.ts +29 -0
- package/dist/types/components/kit/variants/color-picker-aui-119.d.ts +33 -0
- package/dist/types/components/kit/variants/color-picker-aui-120.d.ts +32 -0
- package/dist/types/components/kit/variants/command-palette-aui-201.d.ts +39 -0
- package/dist/types/components/kit/variants/command-palette-aui-202.d.ts +33 -0
- package/dist/types/components/kit/variants/comments-aui-213.d.ts +35 -0
- package/dist/types/components/kit/variants/comments-aui-214.d.ts +40 -0
- package/dist/types/components/kit/variants/context-menu-aui-167.d.ts +45 -0
- package/dist/types/components/kit/variants/context-menu-aui-168.d.ts +42 -0
- package/dist/types/components/kit/variants/context-meter-aui-131.d.ts +24 -0
- package/dist/types/components/kit/variants/context-meter-aui-132.d.ts +28 -0
- package/dist/types/components/kit/variants/cookie-consent-aui-189.d.ts +32 -0
- package/dist/types/components/kit/variants/cookie-consent-aui-190.d.ts +34 -0
- package/dist/types/components/kit/variants/copy-button-aui-113.d.ts +24 -0
- package/dist/types/components/kit/variants/copy-button-aui-114.d.ts +24 -0
- package/dist/types/components/kit/variants/countdown-aui-125.d.ts +25 -0
- package/dist/types/components/kit/variants/countdown-aui-126.d.ts +22 -0
- package/dist/types/components/kit/variants/data-table-aui-205.d.ts +41 -0
- package/dist/types/components/kit/variants/data-table-aui-206.d.ts +33 -0
- package/dist/types/components/kit/variants/dialog-aui-149.d.ts +24 -0
- package/dist/types/components/kit/variants/dialog-aui-150.d.ts +33 -0
- package/dist/types/components/kit/variants/drawer-aui-157.d.ts +28 -0
- package/dist/types/components/kit/variants/drawer-aui-158.d.ts +27 -0
- package/dist/types/components/kit/variants/dropdown-menu-aui-141.d.ts +31 -0
- package/dist/types/components/kit/variants/dropdown-menu-aui-142.d.ts +45 -0
- package/dist/types/components/kit/variants/empty-state-aui-165.d.ts +34 -0
- package/dist/types/components/kit/variants/empty-state-aui-166.d.ts +36 -0
- package/dist/types/components/kit/variants/event-calendar-aui-217.d.ts +32 -0
- package/dist/types/components/kit/variants/event-calendar-aui-218.d.ts +42 -0
- package/dist/types/components/kit/variants/feature-flags-aui-079.d.ts +38 -0
- package/dist/types/components/kit/variants/feature-flags-aui-080.d.ts +29 -0
- package/dist/types/components/kit/variants/field-aui-139.d.ts +37 -0
- package/dist/types/components/kit/variants/field-aui-140.d.ts +21 -0
- package/dist/types/components/kit/variants/file-card-aui-173.d.ts +24 -0
- package/dist/types/components/kit/variants/file-card-aui-174.d.ts +27 -0
- package/dist/types/components/kit/variants/file-manager-aui-231.d.ts +32 -0
- package/dist/types/components/kit/variants/file-manager-aui-232.d.ts +29 -0
- package/dist/types/components/kit/variants/file-upload-aui-153.d.ts +30 -0
- package/dist/types/components/kit/variants/file-upload-aui-154.d.ts +29 -0
- package/dist/types/components/kit/variants/hover-card-aui-169.d.ts +36 -0
- package/dist/types/components/kit/variants/hover-card-aui-170.d.ts +32 -0
- package/dist/types/components/kit/variants/image-compare-aui-179.d.ts +29 -0
- package/dist/types/components/kit/variants/image-compare-aui-180.d.ts +29 -0
- package/dist/types/components/kit/variants/inbox-aui-229.d.ts +31 -0
- package/dist/types/components/kit/variants/inbox-aui-230.d.ts +31 -0
- package/dist/types/components/kit/variants/inline-edit-aui-123.d.ts +32 -0
- package/dist/types/components/kit/variants/inline-edit-aui-124.d.ts +23 -0
- package/dist/types/components/kit/variants/integrations-aui-081.d.ts +41 -0
- package/dist/types/components/kit/variants/integrations-aui-082.d.ts +46 -0
- package/dist/types/components/kit/variants/invoice-aui-227.d.ts +40 -0
- package/dist/types/components/kit/variants/invoice-aui-228.d.ts +43 -0
- package/dist/types/components/kit/variants/kanban-aui-209.d.ts +35 -0
- package/dist/types/components/kit/variants/kanban-aui-210.d.ts +32 -0
- package/dist/types/components/kit/variants/kbd-aui-095.d.ts +28 -0
- package/dist/types/components/kit/variants/kbd-aui-096.d.ts +21 -0
- package/dist/types/components/kit/variants/menubar-aui-183.d.ts +43 -0
- package/dist/types/components/kit/variants/menubar-aui-184.d.ts +40 -0
- package/dist/types/components/kit/variants/meter-aui-127.d.ts +29 -0
- package/dist/types/components/kit/variants/meter-aui-128.d.ts +32 -0
- package/dist/types/components/kit/variants/model-picker-aui-191.d.ts +34 -0
- package/dist/types/components/kit/variants/model-picker-aui-192.d.ts +36 -0
- package/dist/types/components/kit/variants/motion-button-aui-089.d.ts +25 -0
- package/dist/types/components/kit/variants/motion-button-aui-090.d.ts +24 -0
- package/dist/types/components/kit/variants/notification-center-aui-223.d.ts +36 -0
- package/dist/types/components/kit/variants/notification-center-aui-224.d.ts +37 -0
- package/dist/types/components/kit/variants/number-input-aui-147.d.ts +31 -0
- package/dist/types/components/kit/variants/number-input-aui-148.d.ts +24 -0
- package/dist/types/components/kit/variants/onboarding-aui-211.d.ts +30 -0
- package/dist/types/components/kit/variants/onboarding-aui-212.d.ts +38 -0
- package/dist/types/components/kit/variants/pagination-aui-111.d.ts +27 -0
- package/dist/types/components/kit/variants/pagination-aui-112.d.ts +25 -0
- package/dist/types/components/kit/variants/phone-input-aui-185.d.ts +25 -0
- package/dist/types/components/kit/variants/phone-input-aui-186.d.ts +33 -0
- package/dist/types/components/kit/variants/popover-aui-155.d.ts +33 -0
- package/dist/types/components/kit/variants/popover-aui-156.d.ts +38 -0
- package/dist/types/components/kit/variants/progress-aui-105.d.ts +32 -0
- package/dist/types/components/kit/variants/progress-aui-106.d.ts +29 -0
- package/dist/types/components/kit/variants/prompt-composer-aui-237.d.ts +26 -0
- package/dist/types/components/kit/variants/prompt-composer-aui-238.d.ts +33 -0
- package/dist/types/components/kit/variants/properties-panel-aui-199.d.ts +30 -0
- package/dist/types/components/kit/variants/properties-panel-aui-200.d.ts +40 -0
- package/dist/types/components/kit/variants/range-slider-aui-117.d.ts +35 -0
- package/dist/types/components/kit/variants/range-slider-aui-118.d.ts +39 -0
- package/dist/types/components/kit/variants/rating-aui-103.d.ts +25 -0
- package/dist/types/components/kit/variants/rating-aui-104.d.ts +20 -0
- package/dist/types/components/kit/variants/roles-permissions-aui-073.d.ts +39 -0
- package/dist/types/components/kit/variants/roles-permissions-aui-074.d.ts +31 -0
- package/dist/types/components/kit/variants/scrub-input-aui-133.d.ts +23 -0
- package/dist/types/components/kit/variants/scrub-input-aui-134.d.ts +29 -0
- package/dist/types/components/kit/variants/security-settings-aui-075.d.ts +29 -0
- package/dist/types/components/kit/variants/security-settings-aui-076.d.ts +33 -0
- package/dist/types/components/kit/variants/segmented-control-aui-135.d.ts +27 -0
- package/dist/types/components/kit/variants/segmented-control-aui-136.d.ts +29 -0
- package/dist/types/components/kit/variants/settings-panel-aui-203.d.ts +33 -0
- package/dist/types/components/kit/variants/settings-panel-aui-204.d.ts +26 -0
- package/dist/types/components/kit/variants/sidebar-aui-207.d.ts +39 -0
- package/dist/types/components/kit/variants/sidebar-aui-208.d.ts +47 -0
- package/dist/types/components/kit/variants/skeleton-aui-101.d.ts +38 -0
- package/dist/types/components/kit/variants/skeleton-aui-102.d.ts +30 -0
- package/dist/types/components/kit/variants/sortable-list-aui-187.d.ts +30 -0
- package/dist/types/components/kit/variants/sortable-list-aui-188.d.ts +35 -0
- package/dist/types/components/kit/variants/spinner-aui-097.d.ts +21 -0
- package/dist/types/components/kit/variants/spinner-aui-098.d.ts +25 -0
- package/dist/types/components/kit/variants/stat-card-aui-163.d.ts +26 -0
- package/dist/types/components/kit/variants/stat-card-aui-164.d.ts +37 -0
- package/dist/types/components/kit/variants/status-page-aui-083.d.ts +25 -0
- package/dist/types/components/kit/variants/status-page-aui-084.d.ts +32 -0
- package/dist/types/components/kit/variants/stepper-aui-151.d.ts +34 -0
- package/dist/types/components/kit/variants/stepper-aui-152.d.ts +29 -0
- package/dist/types/components/kit/variants/tabs-aui-137.d.ts +33 -0
- package/dist/types/components/kit/variants/tabs-aui-138.d.ts +33 -0
- package/dist/types/components/kit/variants/team-members-aui-221.d.ts +33 -0
- package/dist/types/components/kit/variants/team-members-aui-222.d.ts +26 -0
- package/dist/types/components/kit/variants/testimonials-aui-235.d.ts +29 -0
- package/dist/types/components/kit/variants/testimonials-aui-236.d.ts +33 -0
- package/dist/types/components/kit/variants/thinking-aui-129.d.ts +28 -0
- package/dist/types/components/kit/variants/thinking-aui-130.d.ts +23 -0
- package/dist/types/components/kit/variants/timeline-aui-159.d.ts +33 -0
- package/dist/types/components/kit/variants/timeline-aui-160.d.ts +28 -0
- package/dist/types/components/kit/variants/toast-aui-145.d.ts +27 -0
- package/dist/types/components/kit/variants/toast-aui-146.d.ts +38 -0
- package/dist/types/components/kit/variants/toggle-group-aui-115.d.ts +23 -0
- package/dist/types/components/kit/variants/toggle-group-aui-116.d.ts +27 -0
- package/dist/types/components/kit/variants/tool-approval-aui-195.d.ts +34 -0
- package/dist/types/components/kit/variants/tool-approval-aui-196.d.ts +41 -0
- package/dist/types/components/kit/variants/tool-dock-aui-177.d.ts +31 -0
- package/dist/types/components/kit/variants/tool-dock-aui-178.d.ts +24 -0
- package/dist/types/components/kit/variants/tooltip-aui-099.d.ts +21 -0
- package/dist/types/components/kit/variants/tooltip-aui-100.d.ts +28 -0
- package/dist/types/components/kit/variants/trace-waterfall-aui-239.d.ts +33 -0
- package/dist/types/components/kit/variants/trace-waterfall-aui-240.d.ts +38 -0
- package/dist/types/components/kit/variants/tree-view-aui-171.d.ts +18 -0
- package/dist/types/components/kit/variants/tree-view-aui-172.d.ts +31 -0
- package/dist/types/components/kit/variants/usage-overview-aui-069.d.ts +40 -0
- package/dist/types/components/kit/variants/usage-overview-aui-070.d.ts +30 -0
- package/dist/types/components/kit/variants/webhooks-aui-077.d.ts +39 -0
- package/dist/types/components/kit/variants/webhooks-aui-078.d.ts +37 -0
- package/dist/types/components/kit/variants/whats-new-aui-085.d.ts +35 -0
- package/dist/types/components/kit/variants/whats-new-aui-086.d.ts +31 -0
- package/dist/types/components/kit/variants/workspace-switcher-aui-175.d.ts +29 -0
- package/dist/types/components/kit/variants/workspace-switcher-aui-176.d.ts +38 -0
- package/dist/types/components/kit/webhooks.d.ts +69 -0
- package/dist/types/components/kit/whats-new.d.ts +74 -0
- package/dist/types/packages/asta-ui/src/accordion-aui-143.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/accordion-aui-144.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/agent-plan-aui-197.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/agent-plan-aui-198.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/ai-chat-aui-215.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/ai-chat-aui-216.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/alert-aui-107.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/alert-aui-108.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/announcement-bar-aui-181.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/announcement-bar-aui-182.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/api-keys-aui-241.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/api-keys-aui-242.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/audit-log-aui-071.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/audit-log-aui-072.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/audit-log.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/avatar-aui-093.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/avatar-aui-094.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/avatar-group-aui-121.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/avatar-group-aui-122.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/badge-aui-091.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/badge-aui-092.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/accordion-aui-143.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/accordion-aui-144.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/agent-plan-aui-197.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/agent-plan-aui-198.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/ai-chat-aui-215.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/ai-chat-aui-216.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/alert-aui-107.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/alert-aui-108.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/announcement-bar-aui-181.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/announcement-bar-aui-182.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/api-keys-aui-241.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/api-keys-aui-242.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/audit-log-aui-071.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/audit-log-aui-072.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/audit-log.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/avatar-aui-093.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/avatar-aui-094.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/avatar-group-aui-121.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/avatar-group-aui-122.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/badge-aui-091.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/badge-aui-092.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/billing-aui-233.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/billing-aui-234.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/breadcrumb-aui-109.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/breadcrumb-aui-110.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/cancel-flow-aui-087.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/cancel-flow-aui-088.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/cancel-flow.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/carousel-aui-161.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/carousel-aui-162.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/chart-card-aui-225.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/chart-card-aui-226.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/checkout-aui-219.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/checkout-aui-220.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/citations-aui-193.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/citations-aui-194.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/color-picker-aui-119.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/color-picker-aui-120.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/command-palette-aui-201.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/command-palette-aui-202.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/comments-aui-213.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/comments-aui-214.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/context-menu-aui-167.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/context-menu-aui-168.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/context-meter-aui-131.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/context-meter-aui-132.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/cookie-consent-aui-189.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/cookie-consent-aui-190.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/copy-button-aui-113.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/copy-button-aui-114.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/countdown-aui-125.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/countdown-aui-126.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/data-table-aui-205.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/data-table-aui-206.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/dialog-aui-149.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/dialog-aui-150.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/drawer-aui-157.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/drawer-aui-158.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/dropdown-menu-aui-141.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/dropdown-menu-aui-142.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/empty-state-aui-165.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/empty-state-aui-166.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/event-calendar-aui-217.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/event-calendar-aui-218.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/feature-flags-aui-079.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/feature-flags-aui-080.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/feature-flags.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/field-aui-139.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/field-aui-140.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/file-card-aui-173.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/file-card-aui-174.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/file-manager-aui-231.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/file-manager-aui-232.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/file-upload-aui-153.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/file-upload-aui-154.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/hover-card-aui-169.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/hover-card-aui-170.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/image-compare-aui-179.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/image-compare-aui-180.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/inbox-aui-229.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/inbox-aui-230.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/inline-edit-aui-123.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/inline-edit-aui-124.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/integrations-aui-081.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/integrations-aui-082.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/integrations.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/invoice-aui-227.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/invoice-aui-228.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/kanban-aui-209.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/kanban-aui-210.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/kbd-aui-095.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/kbd-aui-096.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/menubar-aui-183.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/menubar-aui-184.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/meter-aui-127.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/meter-aui-128.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/model-picker-aui-191.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/model-picker-aui-192.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/motion-button-aui-089.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/motion-button-aui-090.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/notification-center-aui-223.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/notification-center-aui-224.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/number-input-aui-147.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/number-input-aui-148.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/onboarding-aui-211.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/onboarding-aui-212.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/pagination-aui-111.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/pagination-aui-112.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/phone-input-aui-185.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/phone-input-aui-186.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/popover-aui-155.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/popover-aui-156.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/progress-aui-105.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/progress-aui-106.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/prompt-composer-aui-237.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/prompt-composer-aui-238.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/properties-panel-aui-199.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/properties-panel-aui-200.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/range-slider-aui-117.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/range-slider-aui-118.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/rating-aui-103.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/rating-aui-104.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/roles-permissions-aui-073.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/roles-permissions-aui-074.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/roles-permissions.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/scrub-input-aui-133.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/scrub-input-aui-134.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/security-settings-aui-075.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/security-settings-aui-076.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/security-settings.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/segmented-control-aui-135.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/segmented-control-aui-136.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/settings-panel-aui-203.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/settings-panel-aui-204.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/sidebar-aui-207.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/sidebar-aui-208.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/skeleton-aui-101.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/skeleton-aui-102.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/sortable-list-aui-187.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/sortable-list-aui-188.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/spinner-aui-097.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/spinner-aui-098.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/stat-card-aui-163.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/stat-card-aui-164.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/status-page-aui-083.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/status-page-aui-084.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/status-page.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/stepper-aui-151.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/stepper-aui-152.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tabs-aui-137.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tabs-aui-138.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/team-members-aui-221.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/team-members-aui-222.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/testimonials-aui-235.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/testimonials-aui-236.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/thinking-aui-129.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/thinking-aui-130.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/timeline-aui-159.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/timeline-aui-160.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/toast-aui-145.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/toast-aui-146.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/toggle-group-aui-115.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/toggle-group-aui-116.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tool-approval-aui-195.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tool-approval-aui-196.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tool-dock-aui-177.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tool-dock-aui-178.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tooltip-aui-099.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tooltip-aui-100.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/trace-waterfall-aui-239.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/trace-waterfall-aui-240.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tree-view-aui-171.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tree-view-aui-172.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/usage-overview-aui-069.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/usage-overview-aui-070.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/usage-overview.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/webhooks-aui-077.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/webhooks-aui-078.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/webhooks.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/whats-new-aui-085.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/whats-new-aui-086.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/whats-new.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/workspace-switcher-aui-175.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/workspace-switcher-aui-176.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base.d.ts +369 -1
- package/dist/types/packages/asta-ui/src/billing-aui-233.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/billing-aui-234.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/breadcrumb-aui-109.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/breadcrumb-aui-110.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/cancel-flow-aui-087.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/cancel-flow-aui-088.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/cancel-flow.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/carousel-aui-161.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/carousel-aui-162.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/chart-card-aui-225.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/chart-card-aui-226.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/checkout-aui-219.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/checkout-aui-220.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/citations-aui-193.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/citations-aui-194.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/color-picker-aui-119.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/color-picker-aui-120.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/command-palette-aui-201.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/command-palette-aui-202.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/comments-aui-213.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/comments-aui-214.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/context-menu-aui-167.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/context-menu-aui-168.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/context-meter-aui-131.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/context-meter-aui-132.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/cookie-consent-aui-189.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/cookie-consent-aui-190.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/copy-button-aui-113.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/copy-button-aui-114.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/countdown-aui-125.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/countdown-aui-126.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/data-table-aui-205.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/data-table-aui-206.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/dialog-aui-149.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/dialog-aui-150.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/drawer-aui-157.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/drawer-aui-158.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/dropdown-menu-aui-141.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/dropdown-menu-aui-142.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/empty-state-aui-165.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/empty-state-aui-166.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/event-calendar-aui-217.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/event-calendar-aui-218.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/feature-flags-aui-079.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/feature-flags-aui-080.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/feature-flags.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/field-aui-139.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/field-aui-140.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/file-card-aui-173.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/file-card-aui-174.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/file-manager-aui-231.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/file-manager-aui-232.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/file-upload-aui-153.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/file-upload-aui-154.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/hover-card-aui-169.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/hover-card-aui-170.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/image-compare-aui-179.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/image-compare-aui-180.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/inbox-aui-229.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/inbox-aui-230.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/index.d.ts +369 -1
- package/dist/types/packages/asta-ui/src/inline-edit-aui-123.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/inline-edit-aui-124.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/integrations-aui-081.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/integrations-aui-082.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/integrations.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/invoice-aui-227.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/invoice-aui-228.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/kanban-aui-209.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/kanban-aui-210.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/kbd-aui-095.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/kbd-aui-096.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/menubar-aui-183.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/menubar-aui-184.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/meter-aui-127.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/meter-aui-128.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/model-picker-aui-191.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/model-picker-aui-192.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/motion-button-aui-089.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/motion-button-aui-090.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/notification-center-aui-223.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/notification-center-aui-224.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/number-input-aui-147.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/number-input-aui-148.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/onboarding-aui-211.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/onboarding-aui-212.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/pagination-aui-111.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/pagination-aui-112.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/phone-input-aui-185.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/phone-input-aui-186.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/popover-aui-155.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/popover-aui-156.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/progress-aui-105.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/progress-aui-106.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/prompt-composer-aui-237.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/prompt-composer-aui-238.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/properties-panel-aui-199.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/properties-panel-aui-200.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/range-slider-aui-117.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/range-slider-aui-118.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/rating-aui-103.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/rating-aui-104.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/roles-permissions-aui-073.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/roles-permissions-aui-074.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/roles-permissions.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/scrub-input-aui-133.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/scrub-input-aui-134.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/security-settings-aui-075.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/security-settings-aui-076.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/security-settings.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/segmented-control-aui-135.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/segmented-control-aui-136.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/settings-panel-aui-203.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/settings-panel-aui-204.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/sidebar-aui-207.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/sidebar-aui-208.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/skeleton-aui-101.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/skeleton-aui-102.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/sortable-list-aui-187.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/sortable-list-aui-188.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/spinner-aui-097.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/spinner-aui-098.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/stat-card-aui-163.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/stat-card-aui-164.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/status-page-aui-083.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/status-page-aui-084.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/status-page.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/stepper-aui-151.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/stepper-aui-152.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tabs-aui-137.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tabs-aui-138.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/team-members-aui-221.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/team-members-aui-222.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/testimonials-aui-235.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/testimonials-aui-236.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/thinking-aui-129.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/thinking-aui-130.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/timeline-aui-159.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/timeline-aui-160.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/toast-aui-145.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/toast-aui-146.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/toggle-group-aui-115.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/toggle-group-aui-116.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tool-approval-aui-195.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tool-approval-aui-196.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tool-dock-aui-177.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tool-dock-aui-178.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tooltip-aui-099.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tooltip-aui-100.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/trace-waterfall-aui-239.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/trace-waterfall-aui-240.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tree-view-aui-171.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tree-view-aui-172.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/usage-overview-aui-069.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/usage-overview-aui-070.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/usage-overview.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/webhooks-aui-077.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/webhooks-aui-078.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/webhooks.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/whats-new-aui-085.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/whats-new-aui-086.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/whats-new.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/workspace-switcher-aui-175.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/workspace-switcher-aui-176.d.ts +2 -0
- package/dist/usage-overview-aui-069.d.ts +2 -0
- package/dist/usage-overview-aui-069.js +10 -0
- package/dist/usage-overview-aui-070.d.ts +2 -0
- package/dist/usage-overview-aui-070.js +10 -0
- package/dist/usage-overview.d.ts +2 -0
- package/dist/usage-overview.js +10 -0
- package/dist/webhooks-aui-077.d.ts +2 -0
- package/dist/webhooks-aui-077.js +10 -0
- package/dist/webhooks-aui-078.d.ts +2 -0
- package/dist/webhooks-aui-078.js +10 -0
- package/dist/webhooks.d.ts +2 -0
- package/dist/webhooks.js +10 -0
- package/dist/whats-new-aui-085.d.ts +2 -0
- package/dist/whats-new-aui-085.js +10 -0
- package/dist/whats-new-aui-086.d.ts +2 -0
- package/dist/whats-new-aui-086.js +9 -0
- package/dist/whats-new.d.ts +2 -0
- package/dist/whats-new.js +15 -0
- package/dist/workspace-switcher-aui-175.d.ts +2 -0
- package/dist/workspace-switcher-aui-175.js +9 -0
- package/dist/workspace-switcher-aui-176.d.ts +2 -0
- package/dist/workspace-switcher-aui-176.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,2690 @@
|
|
|
1
|
+
/* SaaS organisms: usage overview, audit log, roles and permissions, security settings, webhooks, feature flags,
|
|
2
|
+
* integrations, status page, what's new, cancel flow.
|
|
3
|
+
* Event delegation on document, so markup swapped in by htmx works without re-init. Each block below documents its
|
|
4
|
+
* data-* hooks and the "asta:*" events it fires; see css/examples/<slug>.html for the wiring.
|
|
5
|
+
*/
|
|
6
|
+
(() => {
|
|
7
|
+
if (window.astaSaas) return;
|
|
8
|
+
window.astaSaas = true;
|
|
9
|
+
const el = (e) => (e.target instanceof Element ? e.target : null);
|
|
10
|
+
const near = (e, sel) => el(e)?.closest(sel) ?? null;
|
|
11
|
+
const fire = (node, name, detail) => node.dispatchEvent(new CustomEvent(name, { bubbles: true, detail }));
|
|
12
|
+
|
|
13
|
+
/* ---------- usage-overview ---------- */
|
|
14
|
+
/* ---------- Usage overview ----------
|
|
15
|
+
* [data-asta-usage] (data-start="YYYY-MM-DD", data-days, data-elapsed for the period shown)
|
|
16
|
+
* [data-asta-usage-period="this|last|prev|next"] sets aria-pressed on the two segment buttons and fires
|
|
17
|
+
* "asta:usage-period" with detail.period. Put hx-get on those buttons to swap in the other period.
|
|
18
|
+
* [data-asta-usage-select] picks a meter: aria-pressed, data-selected on its row, and the chart redraws from the
|
|
19
|
+
* row's data-daily, data-included, data-label, data-unit, data-compact and data-level (a level such as seats).
|
|
20
|
+
* [data-asta-usage-plot] shows a tip on hover and reads days with ←/→, Home, End. Esc hides the tip.
|
|
21
|
+
* [data-asta-usage-alert] opens the row's alert form, checked on blur and submit (a whole number 1–200). Without
|
|
22
|
+
* hx-post or action it saves after a moment; either way it fires "asta:usage-alert" with detail.id and
|
|
23
|
+
* detail.threshold (null for [data-asta-usage-alert-remove]). Esc closes the form.
|
|
24
|
+
*/
|
|
25
|
+
{
|
|
26
|
+
const uNear = (e, sel) => (e.target instanceof Element ? e.target.closest(sel) : null);
|
|
27
|
+
const uFire = (node, name, detail) => node.dispatchEvent(new CustomEvent(name, { bubbles: true, detail }));
|
|
28
|
+
const uFocus = (node) => node && requestAnimationFrame(() => node.focus());
|
|
29
|
+
// Formatters are built once.
|
|
30
|
+
const NUM = new Intl.NumberFormat("en-US", { maximumFractionDigits: 1 });
|
|
31
|
+
const COMPACT = new Intl.NumberFormat("en-US", { notation: "compact", maximumFractionDigits: 1 });
|
|
32
|
+
const DAYF = new Intl.DateTimeFormat("en-US", { month: "short", day: "numeric", timeZone: "UTC" });
|
|
33
|
+
const W = 20;
|
|
34
|
+
const H = 160;
|
|
35
|
+
|
|
36
|
+
const say = (root, text) => {
|
|
37
|
+
const s = root.querySelector("[data-asta-usage-status]");
|
|
38
|
+
if (s) s.textContent = text;
|
|
39
|
+
};
|
|
40
|
+
const niceMax = (v) => {
|
|
41
|
+
if (v <= 0) return 1;
|
|
42
|
+
const p = 10 ** Math.floor(Math.log10(v));
|
|
43
|
+
return ([1, 2, 2.5, 5, 10].find((s) => s * p >= v) ?? 10) * p;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// Everything the chart needs, read from the row and the root.
|
|
47
|
+
function model(root, li) {
|
|
48
|
+
const d = li.dataset;
|
|
49
|
+
const n = Number(root.dataset.days) || 30;
|
|
50
|
+
const level = d.level !== undefined;
|
|
51
|
+
const included = Number(d.included) || 0;
|
|
52
|
+
const start = Date.parse(root.dataset.start || "") || Date.now();
|
|
53
|
+
return {
|
|
54
|
+
n,
|
|
55
|
+
level,
|
|
56
|
+
label: d.label || "Usage",
|
|
57
|
+
unit: d.unit || "",
|
|
58
|
+
compact: d.compact !== undefined,
|
|
59
|
+
elapsed: Math.min(n, Number(root.dataset.elapsed) || n),
|
|
60
|
+
daily: (d.daily || "").split(",").filter(Boolean).map(Number),
|
|
61
|
+
perDay: level ? included : included / n,
|
|
62
|
+
day: (i) => DAYF.format(new Date(start + i * 86_400_000)),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
const amount = (m, v) => `${(m.compact ? COMPACT : NUM).format(v)}${m.unit ? ` ${m.unit}` : ""}`;
|
|
66
|
+
const short = (m, v) => (m.compact || v >= 10_000 ? COMPACT : NUM).format(v);
|
|
67
|
+
function describe(m, i) {
|
|
68
|
+
const v = m.daily[i];
|
|
69
|
+
if (i >= m.elapsed || v === undefined) return `${m.day(i)}: no data yet`;
|
|
70
|
+
return `${m.day(i)}: ${amount(m, v)}, ${m.perDay > 0 ? Math.round((v / m.perDay) * 100) : 0}% of the daily ${m.level ? "limit" : "pace"}`;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function draw(root, li) {
|
|
74
|
+
const chart = root.querySelector("[data-asta-usage-chart]");
|
|
75
|
+
const plot = chart?.querySelector("[data-asta-usage-plot]");
|
|
76
|
+
if (!plot) return;
|
|
77
|
+
const m = model(root, li);
|
|
78
|
+
const top = niceMax(Math.max(m.perDay, ...m.daily) * 1.1);
|
|
79
|
+
const y = (v) => H - (v / top) * H;
|
|
80
|
+
const ns = "http://www.w3.org/2000/svg";
|
|
81
|
+
const svg = document.createElementNS(ns, "svg");
|
|
82
|
+
svg.setAttribute("viewBox", `0 0 ${m.n * W} ${H}`);
|
|
83
|
+
svg.setAttribute("preserveAspectRatio", "none");
|
|
84
|
+
svg.setAttribute("aria-hidden", "true");
|
|
85
|
+
const add = (tag, attrs) => {
|
|
86
|
+
const node = document.createElementNS(ns, tag);
|
|
87
|
+
for (const k in attrs) node.setAttribute(k, attrs[k]);
|
|
88
|
+
svg.append(node);
|
|
89
|
+
return node;
|
|
90
|
+
};
|
|
91
|
+
for (const t of [0, 0.5, 1]) add("line", { x1: 0, x2: m.n * W, y1: H * t, y2: H * t, "vector-effect": "non-scaling-stroke" });
|
|
92
|
+
for (let i = 0; i < m.n; i++) {
|
|
93
|
+
const v = m.daily[i];
|
|
94
|
+
const future = i >= m.elapsed || v === undefined;
|
|
95
|
+
const h = future ? 2 : Math.max(2, H - y(v));
|
|
96
|
+
const r = add("rect", { x: i * W + 3, width: W - 6, y: H - h, height: h, rx: 2, "data-day": i });
|
|
97
|
+
if (future) r.setAttribute("data-future", "");
|
|
98
|
+
else {
|
|
99
|
+
if (v > m.perDay) r.setAttribute("data-over", "");
|
|
100
|
+
r.style.animationDelay = `${Math.min(i * 14, 400)}ms`;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
add("line", { x1: 0, x2: m.n * W, y1: y(m.perDay), y2: y(m.perDay), "stroke-width": 1.5, "stroke-dasharray": "5 4", "vector-effect": "non-scaling-stroke", "data-pace": "" });
|
|
104
|
+
for (let i = 0; i < m.n; i++) add("rect", { x: i * W, width: W, height: H, fill: "transparent", "data-hit": i });
|
|
105
|
+
plot.querySelector("svg")?.replaceWith(svg);
|
|
106
|
+
|
|
107
|
+
const ys = chart.querySelectorAll(".asta-usage-overview-yaxis > span");
|
|
108
|
+
[top, top / 2, 0].forEach((v, i) => ys[i] && (ys[i].textContent = short(m, v)));
|
|
109
|
+
const pace = plot.querySelector(".asta-usage-overview-pace");
|
|
110
|
+
if (pace) {
|
|
111
|
+
pace.style.top = `${(y(m.perDay) / H) * 100}%`;
|
|
112
|
+
pace.textContent = `${m.level ? "Included" : "Daily pace"} ${short(m, m.perDay)}`;
|
|
113
|
+
}
|
|
114
|
+
const x = plot.querySelector(".asta-usage-overview-xaxis");
|
|
115
|
+
if (x) {
|
|
116
|
+
x.textContent = "";
|
|
117
|
+
const n = m.n;
|
|
118
|
+
for (const d of [0, 7, 14, 21, n - 1].filter((d, i, a) => d < n && a.indexOf(d) === i && (d === n - 1 || n - 1 - d > 3))) {
|
|
119
|
+
const s = document.createElement("span");
|
|
120
|
+
s.style.left = `${((d + 0.5) / n) * 100}%`;
|
|
121
|
+
s.textContent = m.day(d);
|
|
122
|
+
x.append(s);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
const head = chart.querySelector(".asta-usage-overview-chart-head");
|
|
126
|
+
if (head) {
|
|
127
|
+
head.querySelector("h4").textContent = `${m.label} per day`;
|
|
128
|
+
head.querySelector("p").textContent = m.level ? "Included limit" : "Daily pace that stays within the plan";
|
|
129
|
+
}
|
|
130
|
+
const used = li.dataset.used ? Number(li.dataset.used) : m.daily.reduce((a, b) => a + b, 0);
|
|
131
|
+
plot.setAttribute("aria-label", `${m.label} per day. ${amount(m, used)} of ${amount(m, Number(li.dataset.included) || 0)}. Arrow keys move between days.`);
|
|
132
|
+
plot._m = m;
|
|
133
|
+
tip(plot, null);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Server-rendered charts read their model on first use.
|
|
137
|
+
function ensure(plot) {
|
|
138
|
+
const root = plot.closest("[data-asta-usage]");
|
|
139
|
+
const li = root?.querySelector(".asta-usage-overview-meter[data-selected]");
|
|
140
|
+
if (!plot._m && li) plot._m = model(root, li);
|
|
141
|
+
return plot._m;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function tip(plot, i) {
|
|
145
|
+
if (i !== null) ensure(plot);
|
|
146
|
+
const box = plot.querySelector(".asta-usage-overview-tip");
|
|
147
|
+
plot.querySelectorAll("rect[data-on]").forEach((r) => r.removeAttribute("data-on"));
|
|
148
|
+
plot._i = i;
|
|
149
|
+
if (i === null || !plot._m) {
|
|
150
|
+
plot.removeAttribute("data-active");
|
|
151
|
+
if (box) box.hidden = true;
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
const m = plot._m;
|
|
155
|
+
plot.setAttribute("data-active", "");
|
|
156
|
+
plot.querySelector(`rect[data-day="${i}"]`)?.setAttribute("data-on", "");
|
|
157
|
+
if (!box) return;
|
|
158
|
+
box.hidden = false;
|
|
159
|
+
box.textContent = describe(m, i);
|
|
160
|
+
box.style.left = `${((i + 0.5) / m.n) * 100}%`;
|
|
161
|
+
box.style.transform = `translateX(${i < 3 ? -12 : i > m.n - 4 ? -88 : -50}%)`;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function openAlert(li) {
|
|
165
|
+
const form = li.querySelector("[data-asta-usage-alert-form]");
|
|
166
|
+
const btn = li.querySelector("[data-asta-usage-alert]");
|
|
167
|
+
if (!form) return;
|
|
168
|
+
form.hidden = false;
|
|
169
|
+
btn?.setAttribute("aria-expanded", "true");
|
|
170
|
+
const input = form.querySelector("input[name=threshold]");
|
|
171
|
+
if (input) input.value = btn?.dataset.value || "80";
|
|
172
|
+
showMsg(form, null);
|
|
173
|
+
form.querySelector(".asta-usage-overview-alert-error")?.setAttribute("hidden", "");
|
|
174
|
+
form.querySelector("[data-asta-usage-alert-remove]")?.toggleAttribute("hidden", !btn?.dataset.value);
|
|
175
|
+
uFocus(input);
|
|
176
|
+
}
|
|
177
|
+
function closeAlert(li, focus = true) {
|
|
178
|
+
const form = li.querySelector("[data-asta-usage-alert-form]");
|
|
179
|
+
const btn = li.querySelector("[data-asta-usage-alert]");
|
|
180
|
+
if (form) form.hidden = true;
|
|
181
|
+
btn?.setAttribute("aria-expanded", "false");
|
|
182
|
+
if (focus) uFocus(btn);
|
|
183
|
+
}
|
|
184
|
+
function showMsg(form, error) {
|
|
185
|
+
const input = form.querySelector("input[name=threshold]");
|
|
186
|
+
const msg = form.querySelector(".asta-usage-overview-msg");
|
|
187
|
+
if (error) input?.setAttribute("aria-invalid", "true");
|
|
188
|
+
else input?.removeAttribute("aria-invalid");
|
|
189
|
+
if (!msg) return;
|
|
190
|
+
msg.toggleAttribute("data-error", !!error);
|
|
191
|
+
const text = msg.querySelector("span:last-child") ?? msg;
|
|
192
|
+
text.textContent = error || msg.dataset.hint || "";
|
|
193
|
+
}
|
|
194
|
+
function check(form) {
|
|
195
|
+
const v = form.querySelector("input[name=threshold]")?.value ?? "";
|
|
196
|
+
const n = Number(v);
|
|
197
|
+
const error = v.trim() === "" || !Number.isInteger(n) || n < 1 || n > 200 ? "Enter a whole number from 1 to 200." : null;
|
|
198
|
+
showMsg(form, error);
|
|
199
|
+
return !error;
|
|
200
|
+
}
|
|
201
|
+
function setAlert(root, li, value) {
|
|
202
|
+
const btn = li.querySelector("[data-asta-usage-alert]");
|
|
203
|
+
const label = li.dataset.label || "this meter";
|
|
204
|
+
if (btn) {
|
|
205
|
+
btn.toggleAttribute("data-set", value !== null);
|
|
206
|
+
if (value === null) delete btn.dataset.value;
|
|
207
|
+
else btn.dataset.value = String(value);
|
|
208
|
+
const text = btn.querySelector("span:last-child");
|
|
209
|
+
if (text) text.textContent = value === null ? "Set alert" : `At ${value}%`;
|
|
210
|
+
btn.setAttribute("aria-label", value === null ? `Set alert for ${label}` : `Alert for ${label} at ${value}%. Change alert`);
|
|
211
|
+
}
|
|
212
|
+
closeAlert(li);
|
|
213
|
+
say(root, value === null ? `Alert for ${label} removed.` : `Alert saved. We'll email you when ${label} reaches ${value}%.`);
|
|
214
|
+
uFire(li, "asta:usage-alert", { id: li.dataset.id, threshold: value });
|
|
215
|
+
}
|
|
216
|
+
// Demo save: a short wait so the busy state shows, then the button takes the new value.
|
|
217
|
+
function demoSave(root, li, value) {
|
|
218
|
+
const submit = li.querySelector(".asta-usage-overview-alert button[type=submit]");
|
|
219
|
+
const label = submit?.textContent;
|
|
220
|
+
if (submit) {
|
|
221
|
+
submit.disabled = true;
|
|
222
|
+
submit.setAttribute("aria-busy", "true");
|
|
223
|
+
submit.textContent = "Saving…";
|
|
224
|
+
}
|
|
225
|
+
setTimeout(() => {
|
|
226
|
+
if (submit) {
|
|
227
|
+
submit.disabled = false;
|
|
228
|
+
submit.removeAttribute("aria-busy");
|
|
229
|
+
submit.textContent = label;
|
|
230
|
+
}
|
|
231
|
+
setAlert(root, li, value);
|
|
232
|
+
}, 600);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
document.addEventListener("click", (e) => {
|
|
236
|
+
const root = uNear(e, "[data-asta-usage]");
|
|
237
|
+
if (!root) return;
|
|
238
|
+
const li = uNear(e, ".asta-usage-overview-meter");
|
|
239
|
+
const period = uNear(e, "[data-asta-usage-period]");
|
|
240
|
+
if (period) {
|
|
241
|
+
const v = period.getAttribute("data-asta-usage-period");
|
|
242
|
+
if (v === "this" || v === "last") root.querySelectorAll(".asta-usage-overview-segment > button").forEach((b) => b.setAttribute("aria-pressed", String(b === period)));
|
|
243
|
+
uFire(root, "asta:usage-period", { period: v });
|
|
244
|
+
} else if (li && uNear(e, "[data-asta-usage-select]")) {
|
|
245
|
+
root.querySelectorAll(".asta-usage-overview-meter").forEach((row) => {
|
|
246
|
+
row.toggleAttribute("data-selected", row === li);
|
|
247
|
+
row.querySelector("[data-asta-usage-select]")?.setAttribute("aria-pressed", String(row === li));
|
|
248
|
+
});
|
|
249
|
+
draw(root, li);
|
|
250
|
+
say(root, `Showing ${li.dataset.label || "usage"} per day.`);
|
|
251
|
+
uFire(li, "asta:usage-meter", { id: li.dataset.id });
|
|
252
|
+
} else if (li && uNear(e, "[data-asta-usage-alert]")) {
|
|
253
|
+
if (li.querySelector("[data-asta-usage-alert-form]")?.hidden === false) closeAlert(li);
|
|
254
|
+
else openAlert(li);
|
|
255
|
+
} else if (li && uNear(e, "[data-asta-usage-alert-remove]")) demoSave(root, li, null);
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
// Capture phase, so an invalid form never reaches htmx or the browser.
|
|
259
|
+
document.addEventListener(
|
|
260
|
+
"submit",
|
|
261
|
+
(e) => {
|
|
262
|
+
const form = e.target instanceof HTMLFormElement && e.target.matches("[data-asta-usage-alert-form]") ? e.target : null;
|
|
263
|
+
const li = form?.closest(".asta-usage-overview-meter");
|
|
264
|
+
const root = form?.closest("[data-asta-usage]");
|
|
265
|
+
if (!li || !root) return;
|
|
266
|
+
if (!check(form)) {
|
|
267
|
+
e.preventDefault();
|
|
268
|
+
e.stopPropagation();
|
|
269
|
+
uFocus(form.querySelector("input[name=threshold]"));
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
const remote = form.hasAttribute("action") || [...form.attributes].some((a) => /^(hx|data-hx)-(post|put)$/.test(a.name));
|
|
273
|
+
if (!remote) {
|
|
274
|
+
e.preventDefault();
|
|
275
|
+
demoSave(root, li, Number(form.querySelector("input[name=threshold]").value));
|
|
276
|
+
}
|
|
277
|
+
},
|
|
278
|
+
true,
|
|
279
|
+
);
|
|
280
|
+
|
|
281
|
+
document.addEventListener("focusout", (e) => {
|
|
282
|
+
const form = uNear(e, "[data-asta-usage-alert-form]");
|
|
283
|
+
if (form && e.target.matches("input[name=threshold]")) check(form);
|
|
284
|
+
const plot = uNear(e, "[data-asta-usage-plot]");
|
|
285
|
+
if (plot && e.target === plot) tip(plot, null);
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
document.addEventListener("pointerover", (e) => {
|
|
289
|
+
const hit = uNear(e, "[data-asta-usage-plot] rect[data-hit]");
|
|
290
|
+
if (hit) tip(hit.closest("[data-asta-usage-plot]"), Number(hit.getAttribute("data-hit")));
|
|
291
|
+
});
|
|
292
|
+
document.addEventListener("pointerout", (e) => {
|
|
293
|
+
const plot = uNear(e, "[data-asta-usage-plot]");
|
|
294
|
+
if (plot && !(e.relatedTarget instanceof Node && plot.contains(e.relatedTarget))) tip(plot, null);
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
document.addEventListener("keydown", (e) => {
|
|
298
|
+
const root = uNear(e, "[data-asta-usage]");
|
|
299
|
+
if (!root) return;
|
|
300
|
+
const form = uNear(e, "[data-asta-usage-alert-form]");
|
|
301
|
+
if (form && e.key === "Escape") {
|
|
302
|
+
e.preventDefault();
|
|
303
|
+
closeAlert(form.closest(".asta-usage-overview-meter"));
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
const plot = e.target instanceof Element && e.target.matches("[data-asta-usage-plot]") ? e.target : null;
|
|
307
|
+
if (!plot) return;
|
|
308
|
+
const m = ensure(plot);
|
|
309
|
+
if (!m) return;
|
|
310
|
+
const last = Math.max(0, m.elapsed - 1);
|
|
311
|
+
const cur = plot._i ?? null;
|
|
312
|
+
const k = e.key;
|
|
313
|
+
const next = k === "ArrowLeft" ? (cur ?? last + 1) - 1 : k === "ArrowRight" ? (cur ?? -1) + 1 : k === "Home" ? 0 : k === "End" ? last : k === "Escape" ? -1 : null;
|
|
314
|
+
if (next === null) return;
|
|
315
|
+
e.preventDefault();
|
|
316
|
+
if (next < 0) return tip(plot, null);
|
|
317
|
+
const i = Math.min(last, next);
|
|
318
|
+
tip(plot, i);
|
|
319
|
+
say(root, describe(m, i));
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/* ---------- audit-log ---------- */
|
|
324
|
+
/* ---------- Audit log ----------
|
|
325
|
+
* [data-asta-audit] (data-range-default): rows are li.asta-audit-log-row with data-id, data-type, data-actor and
|
|
326
|
+
* data-at (ISO time). [data-asta-audit-search] (Escape clears), [data-asta-audit-actor], the .asta-audit-log-range
|
|
327
|
+
* buttons (data-range="24h|7d|30d") and the .asta-audit-log-chip toggles (data-type) filter rows in place: day
|
|
328
|
+
* counts, the total, [data-asta-audit-clear] and .asta-audit-log-empty follow, and "asta:audit-filter" fires with
|
|
329
|
+
* detail { query, actor, types, range } (answer it with hx-get if the server filters).
|
|
330
|
+
* .asta-audit-log-summary opens its detail (one at a time). Escape inside closes it, arrows/Home/End move between rows.
|
|
331
|
+
* [data-asta-audit-export] fires cancelable "asta:audit-export" with detail.rows; unless cancelled it downloads a CSV
|
|
332
|
+
* of the shown rows. [data-asta-audit-more]: with hx-get, htmx adds the next page's day sections (hx-target="previous
|
|
333
|
+
* .asta-audit-log-empty" hx-swap="beforebegin") and asta.js re-filters after the swap. Without it, the next template[data-asta-audit-page] is added after a short wait; when none are left the
|
|
334
|
+
* button gives way to the end note. Fires "asta:audit-more".
|
|
335
|
+
* data-now (ISO) on the root anchors the ranges. Without it, ranges count from the viewer's clock and
|
|
336
|
+
* time[data-ago] labels are refreshed from datetime once a minute while the log is on screen. */
|
|
337
|
+
{
|
|
338
|
+
const auEl = (e) => (e.target instanceof Element ? e.target : null);
|
|
339
|
+
const auNear = (e, sel) => auEl(e)?.closest(sel) ?? null;
|
|
340
|
+
const auFire = (node, name, detail, cancelable = false) => node.dispatchEvent(new CustomEvent(name, { bubbles: true, cancelable, detail }));
|
|
341
|
+
const auFocus = (node) => node && requestAnimationFrame(() => node.focus());
|
|
342
|
+
const auRoot = (e) => auNear(e, "[data-asta-audit]");
|
|
343
|
+
const AU_DAY = 86_400_000;
|
|
344
|
+
const AU_RANGE = { "24h": AU_DAY, "7d": 7 * AU_DAY, "30d": 30 * AU_DAY };
|
|
345
|
+
// data-now (ISO) anchors the ranges to the time the server rendered the page.
|
|
346
|
+
const auNow = (root) => Date.parse(root.dataset.now ?? "") || Date.now();
|
|
347
|
+
const auCount = (n) => `${n} ${n === 1 ? "event" : "events"}`;
|
|
348
|
+
const auSay = (root, text) => {
|
|
349
|
+
const s = root.querySelector("[data-asta-audit-status]");
|
|
350
|
+
if (s) s.textContent = text;
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
function auFilters(root) {
|
|
354
|
+
return {
|
|
355
|
+
query: (root.querySelector("[data-asta-audit-search]")?.value ?? "").trim().toLowerCase(),
|
|
356
|
+
actor: root.querySelector("[data-asta-audit-actor]")?.value || null,
|
|
357
|
+
types: [...root.querySelectorAll(".asta-audit-log-chip[aria-pressed=true]")].map((c) => c.dataset.type),
|
|
358
|
+
range: root.querySelector(".asta-audit-log-range [aria-pressed=true]")?.dataset.range ?? "30d",
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
function auApply(root, announce) {
|
|
363
|
+
const f = auFilters(root);
|
|
364
|
+
const since = auNow(root) - (AU_RANGE[f.range] ?? Infinity);
|
|
365
|
+
let total = 0;
|
|
366
|
+
for (const day of root.querySelectorAll(".asta-audit-log-day")) {
|
|
367
|
+
let n = 0;
|
|
368
|
+
for (const row of day.querySelectorAll(".asta-audit-log-row")) {
|
|
369
|
+
const at = Date.parse(row.dataset.at ?? "");
|
|
370
|
+
const ok =
|
|
371
|
+
(!Number.isFinite(at) || at >= since) &&
|
|
372
|
+
(!f.actor || row.dataset.actor === f.actor) &&
|
|
373
|
+
(!f.types.length || f.types.includes(row.dataset.type)) &&
|
|
374
|
+
(!f.query || row.textContent.toLowerCase().includes(f.query));
|
|
375
|
+
row.hidden = !ok;
|
|
376
|
+
if (ok) n++;
|
|
377
|
+
}
|
|
378
|
+
day.hidden = n === 0;
|
|
379
|
+
const c = day.querySelector(".asta-audit-log-day-head > span");
|
|
380
|
+
if (c) c.textContent = auCount(n);
|
|
381
|
+
total += n;
|
|
382
|
+
}
|
|
383
|
+
const active = !!f.query || !!f.actor || f.types.length > 0 || f.range !== (root.dataset.rangeDefault ?? "30d");
|
|
384
|
+
const count = root.querySelector("[data-asta-audit-count]");
|
|
385
|
+
if (count) count.textContent = auCount(total);
|
|
386
|
+
root.querySelector(".asta-audit-log-tail [data-asta-audit-clear]")?.toggleAttribute("hidden", !active);
|
|
387
|
+
const empty = root.querySelector(".asta-audit-log-empty");
|
|
388
|
+
if (empty) empty.hidden = total > 0;
|
|
389
|
+
const exp = root.querySelector("[data-asta-audit-export]");
|
|
390
|
+
if (exp) exp.disabled = total === 0;
|
|
391
|
+
if (announce) {
|
|
392
|
+
clearTimeout(root._auSay);
|
|
393
|
+
root._auSay = setTimeout(() => auSay(root, `${auCount(total)} match`), 600);
|
|
394
|
+
auFire(root, "asta:audit-filter", { ...f });
|
|
395
|
+
}
|
|
396
|
+
return total;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
function auToggle(root, summary, focusBack) {
|
|
400
|
+
const open = summary.getAttribute("aria-expanded") !== "true";
|
|
401
|
+
for (const s of root.querySelectorAll(".asta-audit-log-summary[aria-expanded=true]")) {
|
|
402
|
+
s.setAttribute("aria-expanded", "false");
|
|
403
|
+
document.getElementById(s.getAttribute("aria-controls"))?.setAttribute("hidden", "");
|
|
404
|
+
}
|
|
405
|
+
summary.setAttribute("aria-expanded", String(open));
|
|
406
|
+
const panel = document.getElementById(summary.getAttribute("aria-controls"));
|
|
407
|
+
if (panel) panel.hidden = !open;
|
|
408
|
+
if (focusBack) auFocus(summary);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
function auClear(root) {
|
|
412
|
+
const search = root.querySelector("[data-asta-audit-search]");
|
|
413
|
+
if (search) search.value = "";
|
|
414
|
+
const actor = root.querySelector("[data-asta-audit-actor]");
|
|
415
|
+
if (actor) actor.value = "";
|
|
416
|
+
root.querySelectorAll(".asta-audit-log-chip").forEach((c) => c.setAttribute("aria-pressed", "false"));
|
|
417
|
+
const def = root.dataset.rangeDefault ?? "30d";
|
|
418
|
+
root.querySelectorAll(".asta-audit-log-range [data-range]").forEach((b) => b.setAttribute("aria-pressed", String(b.dataset.range === def)));
|
|
419
|
+
auApply(root, true);
|
|
420
|
+
auFocus(search);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
function auCsv(rows) {
|
|
424
|
+
const q = (v) => (/[",\n]/.test(v) ? `"${v.replace(/"/g, '""')}"` : v);
|
|
425
|
+
const line = (r) => [r.id, r.at, r.actor, r.type, r.text].map((v) => q(String(v ?? ""))).join(",");
|
|
426
|
+
return ["id,time,actor,type,event", ...rows.map(line)].join("\n");
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
function auExport(root, btn) {
|
|
430
|
+
const rows = [...root.querySelectorAll(".asta-audit-log-row:not([hidden])")].map((r) => ({
|
|
431
|
+
id: r.dataset.id,
|
|
432
|
+
at: r.dataset.at,
|
|
433
|
+
actor: r.dataset.actor,
|
|
434
|
+
type: r.dataset.type,
|
|
435
|
+
text: r.querySelector(".asta-audit-log-text")?.textContent.trim().replace(/\s+/g, " "),
|
|
436
|
+
}));
|
|
437
|
+
if (!auFire(root, "asta:audit-export", { rows }, true)) return;
|
|
438
|
+
const url = URL.createObjectURL(new Blob([auCsv(rows)], { type: "text/csv;charset=utf-8" }));
|
|
439
|
+
Object.assign(document.createElement("a"), { href: url, download: `audit-log-${new Date().toISOString().slice(0, 10)}.csv` }).click();
|
|
440
|
+
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
|
441
|
+
auSay(root, `Exported ${auCount(rows.length)} as CSV.`);
|
|
442
|
+
const label = btn.querySelector("[data-label]");
|
|
443
|
+
if (label) {
|
|
444
|
+
label.textContent = "Exported";
|
|
445
|
+
clearTimeout(btn._auT);
|
|
446
|
+
btn._auT = setTimeout(() => (label.textContent = "Export CSV"), 2000);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
function auMore(root, btn) {
|
|
451
|
+
auFire(root, "asta:audit-more");
|
|
452
|
+
const remote = [...btn.attributes].some((a) => /^(hx|data-hx)-(get|post)$/.test(a.name));
|
|
453
|
+
if (remote) return;
|
|
454
|
+
const tpl = root.querySelector("template[data-asta-audit-page]");
|
|
455
|
+
const label = btn.querySelector("[data-label]") ?? btn;
|
|
456
|
+
btn.disabled = true;
|
|
457
|
+
btn.setAttribute("aria-busy", "true");
|
|
458
|
+
label.textContent = "Loading…";
|
|
459
|
+
setTimeout(() => {
|
|
460
|
+
btn.disabled = false;
|
|
461
|
+
btn.removeAttribute("aria-busy");
|
|
462
|
+
label.textContent = "Load older activity";
|
|
463
|
+
const before = new Set(root.querySelectorAll(".asta-audit-log-row"));
|
|
464
|
+
if (tpl) {
|
|
465
|
+
root.querySelector(".asta-audit-log-empty")?.before(tpl.content.cloneNode(true));
|
|
466
|
+
tpl.remove();
|
|
467
|
+
}
|
|
468
|
+
const fresh = [...root.querySelectorAll(".asta-audit-log-row")].filter((r) => !before.has(r));
|
|
469
|
+
auApply(root, false);
|
|
470
|
+
auSay(root, fresh.length ? `Loaded ${auCount(fresh.length)}.` : "No older events.");
|
|
471
|
+
if (!root.querySelector("template[data-asta-audit-page]")) {
|
|
472
|
+
btn.hidden = true;
|
|
473
|
+
root.querySelector("[data-asta-audit-end]")?.removeAttribute("hidden");
|
|
474
|
+
}
|
|
475
|
+
auFocus(fresh.find((r) => !r.hidden)?.querySelector(".asta-audit-log-summary") ?? btn);
|
|
476
|
+
}, 700);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
document.addEventListener("click", (e) => {
|
|
480
|
+
const root = auRoot(e);
|
|
481
|
+
if (!root) return;
|
|
482
|
+
const summary = auNear(e, ".asta-audit-log-summary");
|
|
483
|
+
const chip = auNear(e, ".asta-audit-log-chip");
|
|
484
|
+
const range = auNear(e, ".asta-audit-log-range [data-range]");
|
|
485
|
+
if (summary) auToggle(root, summary, false);
|
|
486
|
+
else if (chip) {
|
|
487
|
+
chip.setAttribute("aria-pressed", String(chip.getAttribute("aria-pressed") !== "true"));
|
|
488
|
+
auApply(root, true);
|
|
489
|
+
} else if (range) {
|
|
490
|
+
root.querySelectorAll(".asta-audit-log-range [data-range]").forEach((b) => b.setAttribute("aria-pressed", String(b === range)));
|
|
491
|
+
auApply(root, true);
|
|
492
|
+
} else if (auNear(e, "[data-asta-audit-clear]")) auClear(root);
|
|
493
|
+
else if (auNear(e, "[data-asta-audit-export]")) auExport(root, auNear(e, "[data-asta-audit-export]"));
|
|
494
|
+
else if (auNear(e, "[data-asta-audit-more]")) auMore(root, auNear(e, "[data-asta-audit-more]"));
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
document.addEventListener("input", (e) => {
|
|
498
|
+
const root = auRoot(e);
|
|
499
|
+
if (root && auNear(e, "[data-asta-audit-search],[data-asta-audit-actor]")) auApply(root, true);
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
document.addEventListener("keydown", (e) => {
|
|
503
|
+
const root = auRoot(e);
|
|
504
|
+
if (!root) return;
|
|
505
|
+
if (e.key === "Escape") {
|
|
506
|
+
const search = auNear(e, "[data-asta-audit-search]");
|
|
507
|
+
if (search?.value) {
|
|
508
|
+
e.preventDefault();
|
|
509
|
+
search.value = "";
|
|
510
|
+
auApply(root, true);
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
const panel = auNear(e, ".asta-audit-log-detail");
|
|
514
|
+
const summary = panel && root.querySelector(`[aria-controls="${panel.id}"]`);
|
|
515
|
+
if (summary) {
|
|
516
|
+
e.preventDefault();
|
|
517
|
+
auToggle(root, summary, true);
|
|
518
|
+
}
|
|
519
|
+
return;
|
|
520
|
+
}
|
|
521
|
+
const at = auNear(e, ".asta-audit-log-summary");
|
|
522
|
+
if (!at || !["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key)) return;
|
|
523
|
+
const rows = [...root.querySelectorAll(".asta-audit-log-row:not([hidden]) > .asta-audit-log-summary")];
|
|
524
|
+
const i = rows.indexOf(at);
|
|
525
|
+
e.preventDefault();
|
|
526
|
+
rows[{ ArrowDown: Math.min(i + 1, rows.length - 1), ArrowUp: Math.max(i - 1, 0), Home: 0, End: rows.length - 1 }[e.key]]?.focus();
|
|
527
|
+
});
|
|
528
|
+
|
|
529
|
+
// Server pages swapped in by htmx get the current filters.
|
|
530
|
+
document.addEventListener("htmx:afterSettle", (e) => {
|
|
531
|
+
const root = auRoot(e);
|
|
532
|
+
if (root) auApply(root, false);
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
// Relative times stay fresh: once a minute, only for logs on screen and only while the tab is visible.
|
|
536
|
+
const auAgo = (ms) => {
|
|
537
|
+
const s = Math.max(0, ms / 1000);
|
|
538
|
+
if (s < 60) return "Just now";
|
|
539
|
+
if (s < 3600) return `${Math.floor(s / 60)} min ago`;
|
|
540
|
+
if (s < 86400) return `${Math.floor(s / 3600)} h ago`;
|
|
541
|
+
return `${Math.floor(s / 86400)} d ago`;
|
|
542
|
+
};
|
|
543
|
+
const auSeen = new Set();
|
|
544
|
+
let auTimer = 0;
|
|
545
|
+
function auTick() {
|
|
546
|
+
if (document.hidden) return;
|
|
547
|
+
for (const root of auSeen) {
|
|
548
|
+
if (!root.isConnected || root.dataset.now) continue;
|
|
549
|
+
root.querySelectorAll("time[data-ago]").forEach((t) => {
|
|
550
|
+
const at = Date.parse(t.getAttribute("datetime") ?? "");
|
|
551
|
+
if (Number.isFinite(at) && Date.now() - at < 30 * AU_DAY) t.textContent = auAgo(Date.now() - at);
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
const auIo = new IntersectionObserver((list) => {
|
|
556
|
+
list.forEach((en) => (en.isIntersecting && en.target.isConnected ? auSeen.add(en.target) : auSeen.delete(en.target)));
|
|
557
|
+
if (auSeen.size && !auTimer) auTimer = setInterval(auTick, 60_000);
|
|
558
|
+
else if (!auSeen.size && auTimer) auTimer = (clearInterval(auTimer), 0);
|
|
559
|
+
});
|
|
560
|
+
const auWatch = () =>
|
|
561
|
+
document.querySelectorAll("[data-asta-audit]:not([data-au-watched])").forEach((r) => {
|
|
562
|
+
r.setAttribute("data-au-watched", "");
|
|
563
|
+
auIo.observe(r);
|
|
564
|
+
auApply(r, false);
|
|
565
|
+
});
|
|
566
|
+
if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", auWatch);
|
|
567
|
+
else auWatch();
|
|
568
|
+
document.addEventListener("htmx:load", auWatch);
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
/* ---------- roles-permissions ---------- */
|
|
572
|
+
/* ---------- Roles and permissions ----------
|
|
573
|
+
* [data-asta-roles] (data-pick): the matrix lives in a [data-asta-roles-matrix] form with checkboxes
|
|
574
|
+
* name="grant" value="<role>:<permission>". The `checked` attribute is the saved state, so changes are counted
|
|
575
|
+
* against it. [data-asta-roles-toggle] collapses a group (data-collapsed on its tbody), [data-asta-roles-all] sets
|
|
576
|
+
* a whole group for one role (data-mixed while partly on), locked boxes (aria-disabled) never change. Arrow keys,
|
|
577
|
+
* Home and End move across the grid. [data-asta-roles-pick] picks the column shown on phones. [data-asta-roles-add]
|
|
578
|
+
* opens the add form: a name and a role to copy, then a new column (data-new). [data-asta-roles-remove] hides a
|
|
579
|
+
* column (data-removed). The bar ([data-asta-roles-bar]) counts changes; Discard puts the saved state back. Save
|
|
580
|
+
* submits the matrix form: with hx-post or action it goes to your server and the bar follows the request, without
|
|
581
|
+
* them it fires "asta:roles-save" with detail { grants, roles, removed } (call preventDefault and dispatch
|
|
582
|
+
* "asta:roles-saved" or "asta:roles-failed" on the section when done) or pretends to save.
|
|
583
|
+
*/
|
|
584
|
+
{
|
|
585
|
+
const tgt = (e) => (e.target instanceof Element ? e.target : null);
|
|
586
|
+
const up = (e, sel) => tgt(e)?.closest(sel) ?? null;
|
|
587
|
+
const emit = (node, name, detail) => node.dispatchEvent(new CustomEvent(name, { bubbles: true, cancelable: true, detail }));
|
|
588
|
+
const soon = (node) => node && requestAnimationFrame(() => node.focus());
|
|
589
|
+
const say = (root, text) => {
|
|
590
|
+
const s = root.querySelector("[data-asta-roles-status]");
|
|
591
|
+
if (s) s.textContent = text;
|
|
592
|
+
};
|
|
593
|
+
const tableOf = (root) => root.querySelector(".asta-roles-permissions-table");
|
|
594
|
+
const heads = (root) => [...(tableOf(root)?.tHead?.rows[0]?.cells ?? [])];
|
|
595
|
+
const roleAt = (root, i) => heads(root)[i];
|
|
596
|
+
const roleName = (th) => th?.querySelector(".asta-roles-permissions-role-name")?.textContent.trim() ?? "";
|
|
597
|
+
const boxes = (root) => [...root.querySelectorAll("input[name=grant]")];
|
|
598
|
+
const live = (input) => !input.closest("td")?.hasAttribute("data-removed");
|
|
599
|
+
|
|
600
|
+
// A group box mirrors the permission boxes of its column: on, off or mixed.
|
|
601
|
+
function syncGroup(tbody, col) {
|
|
602
|
+
const all = tbody.rows[0]?.cells[col]?.querySelector("[data-asta-roles-all]");
|
|
603
|
+
if (!all) return;
|
|
604
|
+
const ins = [...tbody.querySelectorAll(".asta-roles-permissions-row")].map((tr) => tr.cells[col]?.querySelector("input")).filter(Boolean);
|
|
605
|
+
const on = ins.filter((i) => i.checked).length;
|
|
606
|
+
all.checked = on > 0 && on === ins.length;
|
|
607
|
+
all.indeterminate = on > 0 && on < ins.length;
|
|
608
|
+
all.toggleAttribute("data-mixed", all.indeterminate);
|
|
609
|
+
}
|
|
610
|
+
function syncAll(root) {
|
|
611
|
+
for (const tb of tableOf(root)?.tBodies ?? []) for (let c = 1; c < (tb.rows[0]?.cells.length ?? 0); c++) syncGroup(tb, c);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
// Count changes against the saved state and show the bar while there are any.
|
|
615
|
+
function refresh(root) {
|
|
616
|
+
let n = 0;
|
|
617
|
+
for (const i of boxes(root)) {
|
|
618
|
+
const td = i.closest("td");
|
|
619
|
+
const newCol = roleAt(root, td.cellIndex)?.hasAttribute("data-new");
|
|
620
|
+
const changed = live(i) && !newCol && i.checked !== i.defaultChecked;
|
|
621
|
+
td.toggleAttribute("data-dirty", changed);
|
|
622
|
+
if (changed) n++;
|
|
623
|
+
}
|
|
624
|
+
n += heads(root).filter((th) => th.hasAttribute("data-new") || th.hasAttribute("data-removed")).length;
|
|
625
|
+
const bar = root.querySelector("[data-asta-roles-bar]");
|
|
626
|
+
if (!bar || bar.dataset.state === "saving") return n;
|
|
627
|
+
if (n) {
|
|
628
|
+
bar.dataset.state = "idle";
|
|
629
|
+
bar.hidden = false;
|
|
630
|
+
bar.querySelector("[data-asta-roles-count]").textContent = `${n} unsaved ${n === 1 ? "change" : "changes"}`;
|
|
631
|
+
bar.querySelector(".asta-roles-permissions-save").textContent = "Save changes";
|
|
632
|
+
} else if (bar.dataset.state !== "saved") bar.hidden = true;
|
|
633
|
+
return n;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
function setBar(root, state) {
|
|
637
|
+
const bar = root.querySelector("[data-asta-roles-bar]");
|
|
638
|
+
if (!bar) return;
|
|
639
|
+
clearTimeout(bar._astaT);
|
|
640
|
+
bar.dataset.state = state;
|
|
641
|
+
bar.hidden = false;
|
|
642
|
+
const save = bar.querySelector(".asta-roles-permissions-save");
|
|
643
|
+
bar.querySelectorAll("button").forEach((b) => (b.disabled = state === "saving"));
|
|
644
|
+
save.toggleAttribute("aria-busy", state === "saving");
|
|
645
|
+
save.textContent = state === "saving" ? "Saving…" : state === "failed" ? "Try again" : "Save changes";
|
|
646
|
+
const text = { saved: "Changes saved", failed: "Couldn't save. Your changes are still here." }[state];
|
|
647
|
+
if (text) bar.querySelector("[data-asta-roles-count]").textContent = text;
|
|
648
|
+
say(root, state === "saving" ? "Saving changes…" : text ?? "");
|
|
649
|
+
if (state === "saved") bar._astaT = setTimeout(() => bar.dataset.state === "saved" && (bar.hidden = true), 2400);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
// After a save the current state becomes the saved one: removed columns go, new ones settle.
|
|
653
|
+
function commit(root) {
|
|
654
|
+
for (const i of boxes(root)) i.defaultChecked = i.checked;
|
|
655
|
+
root.querySelectorAll("[data-removed]").forEach((n) => n.remove());
|
|
656
|
+
root.querySelectorAll("option[hidden]").forEach((o) => o.remove());
|
|
657
|
+
heads(root).forEach((th) => th.removeAttribute("data-new"));
|
|
658
|
+
root.querySelectorAll("input[name=removeRole], input[name=newRole]").forEach((n) => n.remove());
|
|
659
|
+
heads(root).forEach((th) => th.querySelector(".asta-roles-permissions-role-meta")?.textContent === "New, not saved" && (th.querySelector(".asta-roles-permissions-role-meta").textContent = "Custom"));
|
|
660
|
+
renumber(root);
|
|
661
|
+
setBar(root, "saved");
|
|
662
|
+
soon(root.querySelector('.asta-roles-permissions-table [tabindex="0"]'));
|
|
663
|
+
}
|
|
664
|
+
function discard(root) {
|
|
665
|
+
for (const i of boxes(root)) i.checked = i.defaultChecked;
|
|
666
|
+
// Right to left, so dropping a column doesn't shift the ones still to check.
|
|
667
|
+
heads(root).reverse().forEach((th) => th.hasAttribute("data-new") && dropColumn(root, th.cellIndex, true));
|
|
668
|
+
root.querySelectorAll("[data-asta-roles-pick] option").forEach((o) => !heads(root).some((th) => th.dataset.role === o.dataset.role) && o.remove());
|
|
669
|
+
root.querySelectorAll("[data-removed]").forEach((n) => n.removeAttribute("data-removed"));
|
|
670
|
+
root.querySelectorAll("option[hidden]").forEach((o) => (o.hidden = false));
|
|
671
|
+
root.querySelectorAll("input[name=removeRole]").forEach((n) => n.remove());
|
|
672
|
+
renumber(root);
|
|
673
|
+
syncAll(root);
|
|
674
|
+
refresh(root);
|
|
675
|
+
say(root, "Changes discarded.");
|
|
676
|
+
soon(root.querySelector('.asta-roles-permissions-table [tabindex="0"]') ?? root.querySelector("[data-asta-roles-pick]"));
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
// Picker options carry column numbers; keep them right after columns come and go.
|
|
680
|
+
function renumber(root) {
|
|
681
|
+
const pick = root.querySelector("[data-asta-roles-pick]");
|
|
682
|
+
if (!pick) return;
|
|
683
|
+
const cols = heads(root);
|
|
684
|
+
for (const o of pick.options) {
|
|
685
|
+
const c = cols.findIndex((th) => th.dataset.role === o.dataset.role);
|
|
686
|
+
if (c > 0) o.value = String(c);
|
|
687
|
+
}
|
|
688
|
+
if (!cols[Number(root.dataset.pick)] || cols[Number(root.dataset.pick)].hasAttribute("data-removed")) {
|
|
689
|
+
const first = cols.findIndex((th, c) => c > 0 && !th.hasAttribute("data-locked") && !th.hasAttribute("data-removed"));
|
|
690
|
+
root.dataset.pick = String(first > 0 ? first : 1);
|
|
691
|
+
}
|
|
692
|
+
pick.value = root.dataset.pick;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
function dropColumn(root, c, hard) {
|
|
696
|
+
for (const tr of tableOf(root).rows) {
|
|
697
|
+
const cell = tr.cells[c];
|
|
698
|
+
if (!cell) continue;
|
|
699
|
+
if (hard) cell.remove();
|
|
700
|
+
else cell.setAttribute("data-removed", "");
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
function removeRole(root, th) {
|
|
704
|
+
const c = th.cellIndex;
|
|
705
|
+
const name = roleName(th);
|
|
706
|
+
const opt = root.querySelector(`[data-asta-roles-pick] option[data-role="${CSS.escape(th.dataset.role)}"]`);
|
|
707
|
+
if (th.hasAttribute("data-new")) {
|
|
708
|
+
dropColumn(root, c, true);
|
|
709
|
+
opt?.remove();
|
|
710
|
+
} else {
|
|
711
|
+
dropColumn(root, c, false);
|
|
712
|
+
if (opt) opt.hidden = true;
|
|
713
|
+
const hid = Object.assign(document.createElement("input"), { type: "hidden", name: "removeRole", value: th.dataset.role });
|
|
714
|
+
root.querySelector("[data-asta-roles-matrix]")?.append(hid);
|
|
715
|
+
}
|
|
716
|
+
renumber(root);
|
|
717
|
+
refresh(root);
|
|
718
|
+
say(root, `${name} role removed. Discard to bring it back.`);
|
|
719
|
+
soon(root.querySelector("[data-asta-roles-add]"));
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
// A new column is a copy of the first editable one, with the boxes of the role it copies (or none).
|
|
723
|
+
function addRole(root, name, from) {
|
|
724
|
+
const cols = heads(root);
|
|
725
|
+
const base = cols.findIndex((th, c) => c > 0 && !th.hasAttribute("data-locked"));
|
|
726
|
+
if (base < 0) return;
|
|
727
|
+
const src = from ? cols.findIndex((th) => th.dataset.role === from) : -1;
|
|
728
|
+
const id = `role-${Date.now().toString(36)}`;
|
|
729
|
+
const at = cols.length;
|
|
730
|
+
for (const tr of tableOf(root).rows) {
|
|
731
|
+
const cell = tr.cells[base].cloneNode(true);
|
|
732
|
+
cell.removeAttribute("data-dirty");
|
|
733
|
+
cell.removeAttribute("data-removed");
|
|
734
|
+
tr.append(cell);
|
|
735
|
+
if (tr.parentElement.tagName === "THEAD") {
|
|
736
|
+
cell.dataset.role = id;
|
|
737
|
+
cell.setAttribute("data-new", "");
|
|
738
|
+
cell.removeAttribute("data-locked");
|
|
739
|
+
cell.querySelector(".asta-roles-permissions-role-name").textContent = name;
|
|
740
|
+
cell.querySelector(".asta-roles-permissions-role-name").title = name;
|
|
741
|
+
cell.querySelector(".asta-roles-permissions-role-meta").textContent = "New, not saved";
|
|
742
|
+
cell.querySelector(".asta-roles-permissions-remove")?.remove();
|
|
743
|
+
const x = root.querySelector("template[data-asta-roles-remove]")?.content.firstElementChild?.cloneNode(true);
|
|
744
|
+
if (x) {
|
|
745
|
+
x.setAttribute("aria-label", `Remove ${name} role`);
|
|
746
|
+
cell.querySelector(".asta-roles-permissions-role").append(x);
|
|
747
|
+
}
|
|
748
|
+
cell.append(Object.assign(document.createElement("input"), { type: "hidden", name: "newRole", value: `${id}:${name}` }));
|
|
749
|
+
continue;
|
|
750
|
+
}
|
|
751
|
+
const input = cell.querySelector("input[type=checkbox]");
|
|
752
|
+
if (!input) continue;
|
|
753
|
+
const was = src > 0 ? tr.cells[src]?.querySelector("input[type=checkbox]") : null;
|
|
754
|
+
input.checked = input.defaultChecked = false;
|
|
755
|
+
input.checked = !!was?.checked;
|
|
756
|
+
input.tabIndex = -1;
|
|
757
|
+
if (input.name === "grant") input.value = `${id}:${input.value.split(":").slice(1).join(":")}`;
|
|
758
|
+
const label = input.getAttribute("aria-label");
|
|
759
|
+
if (label) input.setAttribute("aria-label", label.replace(/ for .*$/, ` for ${name}`));
|
|
760
|
+
}
|
|
761
|
+
const pick = root.querySelector("[data-asta-roles-pick]");
|
|
762
|
+
if (pick) pick.append(Object.assign(document.createElement("option"), { value: String(at), textContent: `${name} · New, not saved` }));
|
|
763
|
+
pick?.lastElementChild?.setAttribute("data-role", id);
|
|
764
|
+
root.dataset.pick = String(at);
|
|
765
|
+
renumber(root);
|
|
766
|
+
syncAll(root);
|
|
767
|
+
refresh(root);
|
|
768
|
+
say(root, `${name} role added${src > 0 ? ` with the permissions of ${roleName(cols[src])}` : ""}.`);
|
|
769
|
+
const head = roleAt(root, at)?.querySelector(".asta-roles-permissions-role-name");
|
|
770
|
+
if (head && head.getClientRects().length) {
|
|
771
|
+
head.tabIndex = -1;
|
|
772
|
+
soon(head);
|
|
773
|
+
} else soon(pick);
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
// The add form: a name that is filled in and not taken, checked on submit and again on blur once wrong.
|
|
777
|
+
function checkName(root, form) {
|
|
778
|
+
const input = form.querySelector("input[name=roleName]");
|
|
779
|
+
const msg = document.getElementById(input.getAttribute("aria-describedby"));
|
|
780
|
+
const name = input.value.trim();
|
|
781
|
+
const taken = heads(root).some((th) => !th.hasAttribute("data-removed") && roleName(th).toLowerCase() === name.toLowerCase());
|
|
782
|
+
const err = !name ? msg?.dataset.errorEmpty : taken ? msg?.dataset.errorTaken : "";
|
|
783
|
+
if (err) input.setAttribute("aria-invalid", "true");
|
|
784
|
+
else input.removeAttribute("aria-invalid");
|
|
785
|
+
if (msg) {
|
|
786
|
+
msg.toggleAttribute("data-error", !!err);
|
|
787
|
+
msg.querySelector("span").textContent = err || msg.dataset.hint;
|
|
788
|
+
}
|
|
789
|
+
return err ? null : name;
|
|
790
|
+
}
|
|
791
|
+
function openAdd(root, open) {
|
|
792
|
+
const form = root.querySelector("[data-asta-roles-form]");
|
|
793
|
+
const btn = root.querySelector("[data-asta-roles-add]");
|
|
794
|
+
if (!form) return;
|
|
795
|
+
form.hidden = !open;
|
|
796
|
+
btn?.setAttribute("aria-expanded", String(open));
|
|
797
|
+
if (open) {
|
|
798
|
+
const sel = form.querySelector("select[name=copyFrom]");
|
|
799
|
+
if (sel) {
|
|
800
|
+
sel.length = 1;
|
|
801
|
+
for (const th of heads(root).slice(1)) {
|
|
802
|
+
if (th.hasAttribute("data-removed")) continue;
|
|
803
|
+
sel.append(Object.assign(document.createElement("option"), { value: th.dataset.role, textContent: roleName(th) }));
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
soon(form.querySelector("input[name=roleName]"));
|
|
807
|
+
} else {
|
|
808
|
+
form.reset();
|
|
809
|
+
const input = form.querySelector("input[name=roleName]");
|
|
810
|
+
if (input) {
|
|
811
|
+
input.removeAttribute("aria-invalid");
|
|
812
|
+
const msg = document.getElementById(input.getAttribute("aria-describedby"));
|
|
813
|
+
msg?.removeAttribute("data-error");
|
|
814
|
+
if (msg) msg.querySelector("span").textContent = msg.dataset.hint;
|
|
815
|
+
}
|
|
816
|
+
soon(btn);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
function toggleGroup(tbody) {
|
|
821
|
+
const btn = tbody.querySelector("[data-asta-roles-toggle]");
|
|
822
|
+
const open = btn.getAttribute("aria-expanded") !== "true";
|
|
823
|
+
btn.setAttribute("aria-expanded", String(open));
|
|
824
|
+
tbody.toggleAttribute("data-collapsed", !open);
|
|
825
|
+
// Keep one tab stop: if it sat in a hidden row, hand it to the toggle.
|
|
826
|
+
const stop = tableOf(tbody.closest("[data-asta-roles]")).querySelector('[tabindex="0"]');
|
|
827
|
+
if (!stop || !stop.getClientRects().length) {
|
|
828
|
+
if (stop) stop.tabIndex = -1;
|
|
829
|
+
btn.tabIndex = 0;
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
document.addEventListener("click", (e) => {
|
|
834
|
+
const root = up(e, "[data-asta-roles]");
|
|
835
|
+
if (!root) return;
|
|
836
|
+
const input = up(e, ".asta-roles-permissions-table input[type=checkbox], .asta-roles-permissions-box input");
|
|
837
|
+
if (input?.getAttribute("aria-disabled") === "true") return e.preventDefault();
|
|
838
|
+
if (up(e, "[data-asta-roles-toggle]")) toggleGroup(up(e, "tbody"));
|
|
839
|
+
else if (up(e, "[data-asta-roles-add]")) openAdd(root, root.querySelector("[data-asta-roles-form]")?.hidden ?? false);
|
|
840
|
+
else if (up(e, "[data-asta-roles-cancel]")) openAdd(root, false);
|
|
841
|
+
else if (up(e, "[data-asta-roles-remove]")) removeRole(root, up(e, "th"));
|
|
842
|
+
else if (up(e, "[data-asta-roles-discard]")) discard(root);
|
|
843
|
+
});
|
|
844
|
+
|
|
845
|
+
document.addEventListener("change", (e) => {
|
|
846
|
+
const root = up(e, "[data-asta-roles]");
|
|
847
|
+
if (!root) return;
|
|
848
|
+
const t = tgt(e);
|
|
849
|
+
if (t.matches("[data-asta-roles-pick]")) {
|
|
850
|
+
root.dataset.pick = t.value;
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
853
|
+
if (!(t instanceof HTMLInputElement) || t.type !== "checkbox") return;
|
|
854
|
+
const td = t.closest("td");
|
|
855
|
+
const tbody = t.closest("tbody");
|
|
856
|
+
const role = roleName(roleAt(root, td.cellIndex));
|
|
857
|
+
if (t.matches("[data-asta-roles-all]")) {
|
|
858
|
+
const on = t.checked;
|
|
859
|
+
for (const tr of tbody.querySelectorAll(".asta-roles-permissions-row")) {
|
|
860
|
+
const i = tr.cells[td.cellIndex]?.querySelector("input");
|
|
861
|
+
if (i && i.getAttribute("aria-disabled") !== "true") i.checked = on;
|
|
862
|
+
}
|
|
863
|
+
say(root, `${on ? "All" : "No"} ${tbody.querySelector("[data-asta-roles-toggle]")?.dataset.label ?? ""} permissions for ${role}.`);
|
|
864
|
+
} else {
|
|
865
|
+
const label = t.closest("tr").querySelector(".asta-roles-permissions-label")?.textContent ?? "";
|
|
866
|
+
say(root, `${label} ${t.checked ? "allowed" : "removed"} for ${role}.`);
|
|
867
|
+
}
|
|
868
|
+
syncGroup(tbody, td.cellIndex);
|
|
869
|
+
refresh(root);
|
|
870
|
+
});
|
|
871
|
+
|
|
872
|
+
document.addEventListener("focusout", (e) => {
|
|
873
|
+
const form = up(e, "[data-asta-roles-form]");
|
|
874
|
+
if (form && tgt(e).matches("input[name=roleName][aria-invalid]")) checkName(form.closest("[data-asta-roles]"), form);
|
|
875
|
+
});
|
|
876
|
+
|
|
877
|
+
// Arrow keys move one cell (skipping hidden rows and empty first cells), Home/End go to the row's ends,
|
|
878
|
+
// Ctrl+Home/End to the grid's corners. Esc closes the add form.
|
|
879
|
+
const focusables = (tr) => [...tr.cells].map((c) => (c.hasAttribute("data-removed") ? null : c.querySelector("button[data-asta-roles-toggle], input[type=checkbox]")));
|
|
880
|
+
document.addEventListener("keydown", (e) => {
|
|
881
|
+
const root = up(e, "[data-asta-roles]");
|
|
882
|
+
if (!root) return;
|
|
883
|
+
if (e.key === "Escape" && up(e, "[data-asta-roles-form]")) {
|
|
884
|
+
e.preventDefault();
|
|
885
|
+
return openAdd(root, false);
|
|
886
|
+
}
|
|
887
|
+
const t = tgt(e);
|
|
888
|
+
const tr = t.closest(".asta-roles-permissions-table tbody tr");
|
|
889
|
+
if (!tr || !/^(Arrow(Up|Down|Left|Right)|Home|End)$/.test(e.key)) return;
|
|
890
|
+
const rows = [...tableOf(root).tBodies].flatMap((tb) => [...tb.rows]).filter((r) => r.getClientRects().length);
|
|
891
|
+
let r = rows.indexOf(tr);
|
|
892
|
+
let c = focusables(tr).indexOf(t);
|
|
893
|
+
if (r < 0 || c < 0) return;
|
|
894
|
+
e.preventDefault();
|
|
895
|
+
const at = (ri, ci) => (rows[ri] ? focusables(rows[ri])[ci] : null);
|
|
896
|
+
let next = null;
|
|
897
|
+
if (e.key === "Home" || e.key === "End") {
|
|
898
|
+
if (e.ctrlKey) r = e.key === "Home" ? 0 : rows.length - 1;
|
|
899
|
+
const list = focusables(rows[r]);
|
|
900
|
+
next = e.key === "Home" ? list.find(Boolean) : list.findLast(Boolean);
|
|
901
|
+
} else if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
|
|
902
|
+
const d = e.key === "ArrowLeft" ? -1 : 1;
|
|
903
|
+
for (c += d; c >= 0 && c < tr.cells.length && !next; c += d) next = at(r, c);
|
|
904
|
+
} else {
|
|
905
|
+
const d = e.key === "ArrowUp" ? -1 : 1;
|
|
906
|
+
for (r += d; r >= 0 && r < rows.length && !next; r += d) next = at(r, c);
|
|
907
|
+
}
|
|
908
|
+
if (!next || !next.getClientRects().length) return;
|
|
909
|
+
root.querySelectorAll('.asta-roles-permissions-table [tabindex="0"]').forEach((n) => (n.tabIndex = -1));
|
|
910
|
+
next.tabIndex = 0;
|
|
911
|
+
next.focus();
|
|
912
|
+
});
|
|
913
|
+
|
|
914
|
+
// Capture phase, so an invalid add form never reaches htmx, and the matrix shows its saving state first.
|
|
915
|
+
document.addEventListener(
|
|
916
|
+
"submit",
|
|
917
|
+
(e) => {
|
|
918
|
+
const form = e.target instanceof HTMLFormElement ? e.target : null;
|
|
919
|
+
const root = form?.closest("[data-asta-roles]");
|
|
920
|
+
if (!root) return;
|
|
921
|
+
const remote = form.hasAttribute("action") || [...form.attributes].some((a) => /^(hx|data-hx)-(post|put|patch)$/.test(a.name));
|
|
922
|
+
if (form.matches("[data-asta-roles-form]")) {
|
|
923
|
+
const name = checkName(root, form);
|
|
924
|
+
if (!name) {
|
|
925
|
+
e.preventDefault();
|
|
926
|
+
e.stopPropagation();
|
|
927
|
+
soon(form.querySelector("input[name=roleName]"));
|
|
928
|
+
return;
|
|
929
|
+
}
|
|
930
|
+
if (remote) return;
|
|
931
|
+
e.preventDefault();
|
|
932
|
+
const from = form.querySelector("select[name=copyFrom]")?.value;
|
|
933
|
+
form.hidden = true;
|
|
934
|
+
form.reset();
|
|
935
|
+
root.querySelector("[data-asta-roles-add]")?.setAttribute("aria-expanded", "false");
|
|
936
|
+
addRole(root, name, from);
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
if (!form.matches("[data-asta-roles-matrix]")) return;
|
|
940
|
+
setBar(root, "saving");
|
|
941
|
+
if (remote) return;
|
|
942
|
+
e.preventDefault();
|
|
943
|
+
const grants = {};
|
|
944
|
+
for (const i of boxes(root)) {
|
|
945
|
+
if (!live(i) || !i.checked) continue;
|
|
946
|
+
const [role, ...p] = i.value.split(":");
|
|
947
|
+
(grants[role] ??= []).push(p.join(":"));
|
|
948
|
+
}
|
|
949
|
+
const roles = heads(root).slice(1).filter((th) => !th.hasAttribute("data-removed")).map((th) => ({ id: th.dataset.role, name: roleName(th), new: th.hasAttribute("data-new") }));
|
|
950
|
+
const removed = heads(root).filter((th) => th.hasAttribute("data-removed")).map((th) => th.dataset.role);
|
|
951
|
+
if (emit(root, "asta:roles-save", { grants, roles, removed })) setTimeout(() => commit(root), 700);
|
|
952
|
+
},
|
|
953
|
+
true,
|
|
954
|
+
);
|
|
955
|
+
document.addEventListener("asta:roles-saved", (e) => e.target.matches?.("[data-asta-roles]") && commit(e.target));
|
|
956
|
+
document.addEventListener("asta:roles-failed", (e) => e.target.matches?.("[data-asta-roles]") && setBar(e.target, "failed"));
|
|
957
|
+
document.addEventListener("htmx:afterRequest", (e) => {
|
|
958
|
+
const form = e.detail?.elt;
|
|
959
|
+
if (!(form instanceof Element) || !form.matches("[data-asta-roles-matrix]")) return;
|
|
960
|
+
const root = form.closest("[data-asta-roles]");
|
|
961
|
+
if (e.detail.successful) commit(root);
|
|
962
|
+
else setBar(root, "failed");
|
|
963
|
+
});
|
|
964
|
+
|
|
965
|
+
// Group boxes start mixed from data-mixed; the property only exists in JS.
|
|
966
|
+
const mixed = () => document.querySelectorAll("[data-asta-roles] input[data-mixed]").forEach((i) => (i.indeterminate = true));
|
|
967
|
+
document.addEventListener("htmx:load", mixed);
|
|
968
|
+
if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", mixed, { once: true });
|
|
969
|
+
else mixed();
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
/* ---------- security-settings ---------- */
|
|
973
|
+
/* ---------- Security settings ----------
|
|
974
|
+
* [data-asta-security]: the two-factor card ([data-state] off|setup|codes|on) shows the [data-show~=state] parts.
|
|
975
|
+
* [data-asta-security-2fa-start] opens setup, the [data-asta-security-verify] form checks for 6 digits (spaces and
|
|
976
|
+
* dashes from a paste are dropped), [data-asta-security-codes-done] finishes, [data-asta-security-codes-download]
|
|
977
|
+
* saves the codes as .txt. [data-asta-security-ask] (aria-controls) opens a confirm strip whose
|
|
978
|
+
* [data-asta-security-go] runs its data-action: 2fa-off, passkey-remove or signout-others. [data-asta-security-signout]
|
|
979
|
+
* signs one session out, [data-asta-security-passkey-add] adds one. Each fires "asta:security" with detail.action
|
|
980
|
+
* (and detail.id / detail.code). A form or button with hx-* or action is left to the server; without one the demo
|
|
981
|
+
* runs locally after a short wait. Uses near() and fire() from the shared runtime helpers.
|
|
982
|
+
*/
|
|
983
|
+
const ssRoot = (e) => near(e, "[data-asta-security]");
|
|
984
|
+
const ssFocus = (node) => node && requestAnimationFrame(() => node.focus());
|
|
985
|
+
const ssServer = (node) => !!node && [...node.attributes].some((a) => a.name.startsWith("hx-") || a.name === "action");
|
|
986
|
+
const ssAlnum = "abcdefghjkmnpqrstuvwxyz23456789";
|
|
987
|
+
const ssPick = (n) => Array.from({ length: n }, () => ssAlnum[Math.floor(Math.random() * ssAlnum.length)]).join("");
|
|
988
|
+
const ssSay = (root, text) => {
|
|
989
|
+
const live = root.querySelector("[data-asta-security-status]");
|
|
990
|
+
if (live) live.textContent = text;
|
|
991
|
+
};
|
|
992
|
+
// Mark a button busy for the demo wait, swapping in its data-busy-text and putting its content back after.
|
|
993
|
+
const ssIdle = new WeakMap();
|
|
994
|
+
function ssBusy(btn, on) {
|
|
995
|
+
if (!btn) return;
|
|
996
|
+
if (on && btn.dataset.busyText) {
|
|
997
|
+
ssIdle.set(btn, btn.innerHTML);
|
|
998
|
+
btn.textContent = btn.dataset.busyText;
|
|
999
|
+
} else if (!on && ssIdle.has(btn)) {
|
|
1000
|
+
btn.innerHTML = ssIdle.get(btn);
|
|
1001
|
+
ssIdle.delete(btn);
|
|
1002
|
+
}
|
|
1003
|
+
btn.toggleAttribute("aria-busy", on);
|
|
1004
|
+
btn.disabled = on;
|
|
1005
|
+
}
|
|
1006
|
+
const ssLater = (btn, ms, done) => {
|
|
1007
|
+
ssBusy(btn, true);
|
|
1008
|
+
setTimeout(() => {
|
|
1009
|
+
ssBusy(btn, false);
|
|
1010
|
+
done();
|
|
1011
|
+
}, ms);
|
|
1012
|
+
};
|
|
1013
|
+
|
|
1014
|
+
function ssState(card, state) {
|
|
1015
|
+
card.dataset.state = state;
|
|
1016
|
+
card.querySelectorAll("[data-show]").forEach((n) => (n.hidden = !n.dataset.show.split(" ").includes(state)));
|
|
1017
|
+
card.querySelectorAll(".asta-security-settings-status").forEach((s) => s.toggleAttribute("data-on", state === "on" || state === "codes"));
|
|
1018
|
+
}
|
|
1019
|
+
function ssMsg(msg, error) {
|
|
1020
|
+
if (!msg) return;
|
|
1021
|
+
msg.toggleAttribute("data-error", !!error);
|
|
1022
|
+
const text = msg.querySelector("span:last-child") ?? msg;
|
|
1023
|
+
text.textContent = error || msg.dataset.hint || "";
|
|
1024
|
+
}
|
|
1025
|
+
function ssAsk(btn, open) {
|
|
1026
|
+
const strip = btn && document.getElementById(btn.getAttribute("aria-controls"));
|
|
1027
|
+
if (!strip) return;
|
|
1028
|
+
strip.hidden = !open;
|
|
1029
|
+
btn.setAttribute("aria-expanded", String(open));
|
|
1030
|
+
ssFocus(open ? strip.querySelector("[data-asta-security-keep]") : btn);
|
|
1031
|
+
}
|
|
1032
|
+
const ssAsker = (strip) => strip && strip.id && document.querySelector(`[data-asta-security-ask][aria-controls="${strip.id}"]`);
|
|
1033
|
+
|
|
1034
|
+
function ssCount(root) {
|
|
1035
|
+
const list = root.querySelector("[data-asta-security-sessions]");
|
|
1036
|
+
const n = list ? list.querySelectorAll(".asta-security-settings-row:not([data-current])").length : 0;
|
|
1037
|
+
const slot = root.querySelector("[data-slot=others]");
|
|
1038
|
+
if (slot) slot.textContent = n ? `${n} other ${n === 1 ? "session" : "sessions"}` : "Only this device is signed in.";
|
|
1039
|
+
const ask = root.querySelector('[data-asta-security-ask][aria-controls][data-for="others"]');
|
|
1040
|
+
if (ask) ask.disabled = !n;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
function ssGo(root, strip) {
|
|
1044
|
+
const card = strip.closest(".asta-security-settings-2fa");
|
|
1045
|
+
const row = strip.closest(".asta-security-settings-row");
|
|
1046
|
+
const action = strip.dataset.action;
|
|
1047
|
+
const id = row?.dataset.id;
|
|
1048
|
+
fire(root, "asta:security", { action, id });
|
|
1049
|
+
const go = strip.querySelector("[data-asta-security-go]");
|
|
1050
|
+
if (ssServer(go)) return;
|
|
1051
|
+
ssLater(go, 700, () => {
|
|
1052
|
+
strip.hidden = true;
|
|
1053
|
+
if (action === "2fa-off" && card) {
|
|
1054
|
+
ssAsker(strip)?.setAttribute("aria-expanded", "false");
|
|
1055
|
+
ssState(card, "off");
|
|
1056
|
+
ssSay(root, "Two-factor authentication is off.");
|
|
1057
|
+
ssFocus(card.querySelector("[data-asta-security-2fa-start]"));
|
|
1058
|
+
} else if (action === "passkey-remove" && row) {
|
|
1059
|
+
const list = row.parentElement;
|
|
1060
|
+
row.remove();
|
|
1061
|
+
if (list && !list.children.length) list.closest(".asta-security-settings-card")?.querySelector(".asta-security-settings-empty")?.removeAttribute("hidden");
|
|
1062
|
+
ssSay(root, "Passkey removed.");
|
|
1063
|
+
ssFocus(root.querySelector("[data-asta-security-passkey-add]"));
|
|
1064
|
+
} else if (action === "signout-others") {
|
|
1065
|
+
root.querySelectorAll("[data-asta-security-sessions] > .asta-security-settings-row:not([data-current])").forEach((r) => r.remove());
|
|
1066
|
+
ssAsker(strip)?.setAttribute("aria-expanded", "false");
|
|
1067
|
+
ssCount(root);
|
|
1068
|
+
ssSay(root, "Signed out of the other sessions.");
|
|
1069
|
+
ssFocus(root.querySelector("[data-asta-security-sessions-heading]"));
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
function ssVerify(root, form, e) {
|
|
1075
|
+
const input = form.querySelector("input[name=code]");
|
|
1076
|
+
const msg = input && document.getElementById(input.getAttribute("aria-describedby"));
|
|
1077
|
+
const code = (input?.value ?? "").replace(/\D/g, "");
|
|
1078
|
+
if (code.length !== 6) {
|
|
1079
|
+
// Capture phase, so htmx never sees an invalid submit.
|
|
1080
|
+
e.preventDefault();
|
|
1081
|
+
e.stopImmediatePropagation();
|
|
1082
|
+
input?.setAttribute("aria-invalid", "true");
|
|
1083
|
+
ssMsg(msg, msg?.dataset.errorText ?? "Enter the 6 digits from your authenticator app.");
|
|
1084
|
+
return input?.focus();
|
|
1085
|
+
}
|
|
1086
|
+
fire(root, "asta:security", { action: "2fa-verify", code });
|
|
1087
|
+
if (ssServer(form)) return;
|
|
1088
|
+
e.preventDefault();
|
|
1089
|
+
ssLater(form.querySelector("[type=submit]"), 700, () => {
|
|
1090
|
+
if (code === "000000") {
|
|
1091
|
+
input.setAttribute("aria-invalid", "true");
|
|
1092
|
+
ssMsg(msg, msg?.dataset.mismatchText ?? "That code didn't match. Try the newest code in your app.");
|
|
1093
|
+
ssSay(root, "That code didn't match.");
|
|
1094
|
+
return input.focus();
|
|
1095
|
+
}
|
|
1096
|
+
const card = form.closest(".asta-security-settings-2fa");
|
|
1097
|
+
const list = card?.querySelector(".asta-security-settings-codes-list");
|
|
1098
|
+
if (list) {
|
|
1099
|
+
list.textContent = "";
|
|
1100
|
+
const codes = Array.from({ length: 10 }, () => `${ssPick(4)}-${ssPick(4)}`);
|
|
1101
|
+
for (const c of codes) list.append(Object.assign(document.createElement("li"), { textContent: c }));
|
|
1102
|
+
card.querySelector(".asta-security-settings-codes [data-asta-copy]")?.setAttribute("data-asta-copy", codes.join("\n"));
|
|
1103
|
+
}
|
|
1104
|
+
if (card) ssState(card, "codes");
|
|
1105
|
+
ssSay(root, "Two-factor is on. Save your recovery codes now, they won't be shown again.");
|
|
1106
|
+
ssFocus(card?.querySelector(".asta-security-settings-codes [data-asta-copy]"));
|
|
1107
|
+
});
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
document.addEventListener("click", (e) => {
|
|
1111
|
+
const root = ssRoot(e);
|
|
1112
|
+
if (!root) return;
|
|
1113
|
+
const card = near(e, ".asta-security-settings-2fa");
|
|
1114
|
+
const row = near(e, ".asta-security-settings-row");
|
|
1115
|
+
let btn;
|
|
1116
|
+
if (card && (btn = near(e, "[data-asta-security-2fa-start]"))) {
|
|
1117
|
+
fire(root, "asta:security", { action: "2fa-start" });
|
|
1118
|
+
const open = () => {
|
|
1119
|
+
ssState(card, "setup");
|
|
1120
|
+
ssSay(root, "Scan the code, then type the 6-digit code from your app.");
|
|
1121
|
+
ssFocus(card.querySelector("input[name=code]"));
|
|
1122
|
+
};
|
|
1123
|
+
// With hx-* the server swaps a fresh secret into the setup panel while it opens.
|
|
1124
|
+
if (ssServer(btn)) open();
|
|
1125
|
+
else ssLater(btn, 500, open);
|
|
1126
|
+
} else if (card && near(e, "[data-asta-security-cancel]")) {
|
|
1127
|
+
ssState(card, "off");
|
|
1128
|
+
ssFocus(card.querySelector("[data-asta-security-2fa-start]"));
|
|
1129
|
+
} else if (card && near(e, "[data-asta-security-codes-done]")) {
|
|
1130
|
+
ssState(card, "on");
|
|
1131
|
+
ssSay(root, "Recovery codes hidden.");
|
|
1132
|
+
ssFocus(card.querySelector("[data-asta-security-ask]"));
|
|
1133
|
+
} else if (card && near(e, "[data-asta-security-codes-download]")) {
|
|
1134
|
+
const codes = [...card.querySelectorAll(".asta-security-settings-codes-list li")].map((li) => li.textContent);
|
|
1135
|
+
fire(root, "asta:security", { action: "codes-download", codes });
|
|
1136
|
+
const url = URL.createObjectURL(new Blob([`Recovery codes. Each one works once.\n\n${codes.join("\n")}\n`], { type: "text/plain" }));
|
|
1137
|
+
Object.assign(document.createElement("a"), { href: url, download: "recovery-codes.txt" }).click();
|
|
1138
|
+
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
|
1139
|
+
} else if ((btn = near(e, "[data-asta-security-ask]"))) {
|
|
1140
|
+
ssAsk(btn, btn.getAttribute("aria-expanded") !== "true");
|
|
1141
|
+
} else if ((btn = near(e, "[data-asta-security-keep]"))) {
|
|
1142
|
+
ssAsk(ssAsker(btn.closest(".asta-security-settings-confirm")), false);
|
|
1143
|
+
} else if ((btn = near(e, "[data-asta-security-go]"))) {
|
|
1144
|
+
ssGo(root, btn.closest(".asta-security-settings-confirm"));
|
|
1145
|
+
} else if (row && (btn = near(e, "[data-asta-security-signout]"))) {
|
|
1146
|
+
fire(root, "asta:security", { action: "signout", id: row.dataset.id });
|
|
1147
|
+
if (ssServer(btn)) return;
|
|
1148
|
+
row.setAttribute("data-busy", "");
|
|
1149
|
+
ssLater(btn, 700, () => {
|
|
1150
|
+
const next = row.nextElementSibling ?? row.previousElementSibling;
|
|
1151
|
+
row.remove();
|
|
1152
|
+
ssCount(root);
|
|
1153
|
+
ssSay(root, "Session signed out.");
|
|
1154
|
+
ssFocus(next?.querySelector("[data-asta-security-signout]") ?? root.querySelector("[data-asta-security-sessions-heading]"));
|
|
1155
|
+
});
|
|
1156
|
+
} else if ((btn = near(e, "[data-asta-security-passkey-add]"))) {
|
|
1157
|
+
fire(root, "asta:security", { action: "passkey-add" });
|
|
1158
|
+
if (ssServer(btn)) return;
|
|
1159
|
+
ssLater(btn, 900, () => {
|
|
1160
|
+
const tpl = root.querySelector("template[data-asta-security-passkey]");
|
|
1161
|
+
const list = root.querySelector("[data-asta-security-passkeys]");
|
|
1162
|
+
if (!tpl || !list) return;
|
|
1163
|
+
const li = tpl.content.firstElementChild.cloneNode(true);
|
|
1164
|
+
const uid = `ss-pk-${Date.now().toString(36)}`;
|
|
1165
|
+
li.dataset.id = uid;
|
|
1166
|
+
li.querySelector("[data-asta-security-ask]")?.setAttribute("aria-controls", `${uid}-confirm`);
|
|
1167
|
+
const strip = li.querySelector(".asta-security-settings-confirm");
|
|
1168
|
+
if (strip) strip.id = `${uid}-confirm`;
|
|
1169
|
+
const date = li.querySelector("[data-slot=added]");
|
|
1170
|
+
if (date) date.textContent = `Added ${new Date().toLocaleDateString("en-US", { month: "short", day: "numeric" })} · Not used yet`;
|
|
1171
|
+
list.append(li);
|
|
1172
|
+
list.closest(".asta-security-settings-card")?.querySelector(".asta-security-settings-empty")?.setAttribute("hidden", "");
|
|
1173
|
+
ssSay(root, "Passkey added.");
|
|
1174
|
+
});
|
|
1175
|
+
}
|
|
1176
|
+
});
|
|
1177
|
+
|
|
1178
|
+
document.addEventListener("submit", (e) => {
|
|
1179
|
+
const form = e.target instanceof HTMLFormElement && e.target.matches("[data-asta-security-verify]") ? e.target : null;
|
|
1180
|
+
const root = form?.closest("[data-asta-security]");
|
|
1181
|
+
if (form && root) ssVerify(root, form, e);
|
|
1182
|
+
}, true);
|
|
1183
|
+
// Digits only, but never block a paste: spaces and dashes are dropped as they come in.
|
|
1184
|
+
document.addEventListener("input", (e) => {
|
|
1185
|
+
const t = e.target;
|
|
1186
|
+
if (!(t instanceof HTMLInputElement) || !t.matches("[data-asta-security-verify] input[name=code]")) return;
|
|
1187
|
+
const clean = t.value.replace(/\D/g, "").slice(0, 6);
|
|
1188
|
+
if (clean !== t.value) t.value = clean;
|
|
1189
|
+
if (t.hasAttribute("aria-invalid")) {
|
|
1190
|
+
t.removeAttribute("aria-invalid");
|
|
1191
|
+
ssMsg(document.getElementById(t.getAttribute("aria-describedby")), null);
|
|
1192
|
+
}
|
|
1193
|
+
});
|
|
1194
|
+
// Escape closes a confirm strip, or leaves setup.
|
|
1195
|
+
document.addEventListener("keydown", (e) => {
|
|
1196
|
+
if (e.key !== "Escape") return;
|
|
1197
|
+
const strip = near(e, "[data-asta-security] .asta-security-settings-confirm");
|
|
1198
|
+
if (strip) {
|
|
1199
|
+
e.preventDefault();
|
|
1200
|
+
return ssAsk(ssAsker(strip), false);
|
|
1201
|
+
}
|
|
1202
|
+
const setup = near(e, "[data-asta-security] .asta-security-settings-setup");
|
|
1203
|
+
const card = setup?.closest(".asta-security-settings-2fa");
|
|
1204
|
+
if (card) {
|
|
1205
|
+
e.preventDefault();
|
|
1206
|
+
ssState(card, "off");
|
|
1207
|
+
ssFocus(card.querySelector("[data-asta-security-2fa-start]"));
|
|
1208
|
+
}
|
|
1209
|
+
});
|
|
1210
|
+
|
|
1211
|
+
/* ---------- webhooks ---------- */
|
|
1212
|
+
/* ---------- Webhooks ----------
|
|
1213
|
+
* Webhooks [data-asta-webhooks]: [data-asta-webhooks-create|cancel] open and close the add form, checked on submit
|
|
1214
|
+
* (an https URL, one event at least). Group boxes [data-asta-webhooks-all="invoice"] tick their events and
|
|
1215
|
+
* show a dash when only some are ticked. Without hx-post or action the form adds a demo endpoint from
|
|
1216
|
+
* <template data-asta-webhooks-item> and <template data-asta-webhooks-detail>, then fires
|
|
1217
|
+
* "asta:webhook-create". Items (.asta-webhooks-item, arrows move) pick the detail panel they control.
|
|
1218
|
+
* The switch fires "asta:webhook-toggle" {id, enabled}. [data-asta-webhooks-reveal] swaps the masked secret
|
|
1219
|
+
* for data-secret. [data-asta-webhooks-test] and [data-asta-webhooks-retry] are async: without hx-* they
|
|
1220
|
+
* fake a result, otherwise the server answers. [data-asta-webhooks-delete|keep|confirm] ask, then fire
|
|
1221
|
+
* "asta:webhook-delete" {id} and remove the endpoint.
|
|
1222
|
+
* Uses near, fire and el from the top of this file. */
|
|
1223
|
+
|
|
1224
|
+
const whRoot = (e) => near(e, "[data-asta-webhooks]");
|
|
1225
|
+
const whSoon = (node) => node && requestAnimationFrame(() => node.focus());
|
|
1226
|
+
const whRemote = (n) => !!n && (n.hasAttribute("action") || [...n.attributes].some((a) => /^(hx|data-hx)-(get|post|put|patch|delete)$/.test(a.name)));
|
|
1227
|
+
const whHost = (u) => u.replace(/^https?:\/\//, "");
|
|
1228
|
+
const whWait = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
1229
|
+
const WH_ICON = {
|
|
1230
|
+
enabled: "M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12ZM5.5 8.3l1.7 1.7 3.3-3.4",
|
|
1231
|
+
disabled: "M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12ZM6.75 6v4M9.25 6v4",
|
|
1232
|
+
failing: "M8 2.5 14 13H2zM8 6.5v3M8 11.2h.01",
|
|
1233
|
+
};
|
|
1234
|
+
const WH_WORD = { enabled: "Enabled", disabled: "Disabled", failing: "Failing" };
|
|
1235
|
+
const whSvg = (d) => `<svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d}"/></svg>`;
|
|
1236
|
+
|
|
1237
|
+
function whStatus(node, s) {
|
|
1238
|
+
if (!node) return;
|
|
1239
|
+
node.dataset.status = s;
|
|
1240
|
+
node.innerHTML = `${whSvg(WH_ICON[s])}${WH_WORD[s]}`;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
/* Form */
|
|
1244
|
+
const whForm = (root) => root.querySelector("[data-asta-webhooks-form]");
|
|
1245
|
+
const whCreate = (root) => root.querySelector("[data-asta-webhooks-create]");
|
|
1246
|
+
function whMsg(msg, text) {
|
|
1247
|
+
if (!msg) return;
|
|
1248
|
+
msg.toggleAttribute("data-error", !!text);
|
|
1249
|
+
msg.querySelector("span:last-child").textContent = text || msg.dataset.hint;
|
|
1250
|
+
}
|
|
1251
|
+
const msgOf = (n) => n && document.getElementById(n.getAttribute("aria-describedby"));
|
|
1252
|
+
function whOpen(root) {
|
|
1253
|
+
const form = whForm(root);
|
|
1254
|
+
if (!form) return;
|
|
1255
|
+
form.hidden = false;
|
|
1256
|
+
whCreate(root)?.setAttribute("aria-expanded", "true");
|
|
1257
|
+
whSoon(form.querySelector("input[name=url]"));
|
|
1258
|
+
}
|
|
1259
|
+
function whClose(root, focus = true) {
|
|
1260
|
+
const form = whForm(root);
|
|
1261
|
+
if (!form) return;
|
|
1262
|
+
form.hidden = true;
|
|
1263
|
+
form.reset();
|
|
1264
|
+
form.querySelectorAll("[data-asta-webhooks-all]").forEach((b) => (b.indeterminate = false));
|
|
1265
|
+
form.querySelectorAll("[aria-invalid]").forEach((n) => n.removeAttribute("aria-invalid"));
|
|
1266
|
+
form.querySelectorAll(".asta-webhooks-msg").forEach((m) => whMsg(m, ""));
|
|
1267
|
+
form.querySelector(".asta-webhooks-alert")?.setAttribute("hidden", "");
|
|
1268
|
+
whCreate(root)?.setAttribute("aria-expanded", "false");
|
|
1269
|
+
if (focus) whSoon(whCreate(root));
|
|
1270
|
+
}
|
|
1271
|
+
function whUrlError(root, value) {
|
|
1272
|
+
const s = value.trim();
|
|
1273
|
+
if (!s) return "Enter the URL that should receive events.";
|
|
1274
|
+
let u;
|
|
1275
|
+
try {
|
|
1276
|
+
u = new URL(s);
|
|
1277
|
+
} catch {
|
|
1278
|
+
return "Enter a full URL, like https://api.yourapp.com/webhooks.";
|
|
1279
|
+
}
|
|
1280
|
+
if (u.protocol !== "https:") return "Use an https:// URL. Events carry customer data.";
|
|
1281
|
+
if ([...root.querySelectorAll(".asta-webhooks-item")].some((b) => b.dataset.url === u.href)) return "This URL already has an endpoint.";
|
|
1282
|
+
return "";
|
|
1283
|
+
}
|
|
1284
|
+
function whShowUrl(root, input) {
|
|
1285
|
+
const err = whUrlError(root, input.value);
|
|
1286
|
+
if (err) input.setAttribute("aria-invalid", "true");
|
|
1287
|
+
else input.removeAttribute("aria-invalid");
|
|
1288
|
+
whMsg(msgOf(input), err);
|
|
1289
|
+
return err;
|
|
1290
|
+
}
|
|
1291
|
+
function whCheck(root, form) {
|
|
1292
|
+
const url = form.querySelector("input[name=url]");
|
|
1293
|
+
const events = [...form.querySelectorAll("input[name=events]")];
|
|
1294
|
+
const urlErr = url ? whShowUrl(root, url) : "";
|
|
1295
|
+
const noEvent = events.length > 0 && !events.some((n) => n.checked);
|
|
1296
|
+
whMsg(msgOf(form.querySelector(".asta-webhooks-events")), noEvent ? "Pick at least one event." : "");
|
|
1297
|
+
if (urlErr) url.focus();
|
|
1298
|
+
else if (noEvent) form.querySelector("[data-asta-webhooks-all]")?.focus();
|
|
1299
|
+
return !urlErr && !noEvent;
|
|
1300
|
+
}
|
|
1301
|
+
// A group box reflects its events: ticked, empty or a dash.
|
|
1302
|
+
function whSync(group) {
|
|
1303
|
+
const all = group.querySelector("[data-asta-webhooks-all]");
|
|
1304
|
+
const evs = [...group.querySelectorAll("input[name=events]")];
|
|
1305
|
+
const n = evs.filter((x) => x.checked).length;
|
|
1306
|
+
if (all) {
|
|
1307
|
+
all.checked = n === evs.length;
|
|
1308
|
+
all.indeterminate = n > 0 && n < evs.length;
|
|
1309
|
+
}
|
|
1310
|
+
const form = group.closest("form");
|
|
1311
|
+
const msg = form && msgOf(form.querySelector(".asta-webhooks-events"));
|
|
1312
|
+
if (msg && !msg.hasAttribute("data-error")) {
|
|
1313
|
+
const total = form.querySelectorAll("input[name=events]:checked").length;
|
|
1314
|
+
msg.querySelector("span:last-child").textContent = `${total ? `${total} selected. ` : ""}${msg.dataset.hint}`;
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
function whFill(node, map) {
|
|
1319
|
+
node.querySelectorAll("[data-slot]").forEach((n) => (n.textContent = map[n.dataset.slot] ?? n.textContent));
|
|
1320
|
+
}
|
|
1321
|
+
function whDemoCreate(root, form) {
|
|
1322
|
+
const itemTpl = root.querySelector("template[data-asta-webhooks-item]");
|
|
1323
|
+
const detailTpl = root.querySelector("template[data-asta-webhooks-detail]");
|
|
1324
|
+
const list = root.querySelector(".asta-webhooks-list");
|
|
1325
|
+
if (!itemTpl || !detailTpl || !list) return;
|
|
1326
|
+
const url = new URL(form.querySelector("input[name=url]").value.trim()).href;
|
|
1327
|
+
const description = form.querySelector("input[name=description]")?.value.trim() ?? "";
|
|
1328
|
+
const events = [...form.querySelectorAll("input[name=events]:checked")].map((n) => n.value);
|
|
1329
|
+
const id = `we${Date.now().toString(36)}`;
|
|
1330
|
+
const secret = `whsec_demo_${Math.random().toString(36).slice(2, 14)}${Math.random().toString(36).slice(2, 14)}`;
|
|
1331
|
+
const map = { url, host: whHost(url), description: description || "No description", meta: `${events.length} ${events.length === 1 ? "event" : "events"}${description ? ` · ${description}` : ""}`, count: `${events.length} events subscribed`, secret: `${secret.slice(0, 6)}${"•".repeat(14)}${secret.slice(-4)}` };
|
|
1332
|
+
const li = itemTpl.content.firstElementChild.cloneNode(true);
|
|
1333
|
+
const detail = detailTpl.content.firstElementChild.cloneNode(true);
|
|
1334
|
+
whFill(li, map);
|
|
1335
|
+
whFill(detail, map);
|
|
1336
|
+
const btn = li.querySelector(".asta-webhooks-item");
|
|
1337
|
+
btn.dataset.url = url;
|
|
1338
|
+
btn.setAttribute("aria-controls", `${id}-d`);
|
|
1339
|
+
btn.querySelector(".asta-webhooks-url")?.setAttribute("title", url);
|
|
1340
|
+
detail.id = `${id}-d`;
|
|
1341
|
+
detail.dataset.id = id;
|
|
1342
|
+
detail.hidden = true;
|
|
1343
|
+
const code = detail.querySelector("[data-secret]");
|
|
1344
|
+
if (code) code.dataset.secret = secret;
|
|
1345
|
+
detail.querySelector("[data-asta-copy]")?.setAttribute("data-asta-copy", secret);
|
|
1346
|
+
list.prepend(li);
|
|
1347
|
+
list.parentElement.append(detail);
|
|
1348
|
+
whClose(root, false);
|
|
1349
|
+
fire(root, "asta:webhook-create", { url, events, description });
|
|
1350
|
+
whSelect(root, btn);
|
|
1351
|
+
whSoon(detail.querySelector("h4"));
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
/* List and detail */
|
|
1355
|
+
function whSelect(root, btn, reveal = false) {
|
|
1356
|
+
root.querySelectorAll(".asta-webhooks-item").forEach((b) => {
|
|
1357
|
+
const on = b === btn;
|
|
1358
|
+
b.toggleAttribute("aria-current", on);
|
|
1359
|
+
if (on) b.setAttribute("aria-current", "true");
|
|
1360
|
+
const panel = document.getElementById(b.getAttribute("aria-controls"));
|
|
1361
|
+
if (panel) panel.hidden = !on;
|
|
1362
|
+
});
|
|
1363
|
+
const panel = document.getElementById(btn.getAttribute("aria-controls"));
|
|
1364
|
+
// Stacked layout: bring the detail into view.
|
|
1365
|
+
if (reveal && panel && root.clientWidth < 760) {
|
|
1366
|
+
const smooth = !matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
1367
|
+
requestAnimationFrame(() => panel.scrollIntoView({ block: "start", behavior: smooth ? "smooth" : "auto" }));
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
const itemFor = (root, detail) => root.querySelector(`.asta-webhooks-item[aria-controls="${detail.id}"]`);
|
|
1371
|
+
|
|
1372
|
+
function whToggle(root, sw) {
|
|
1373
|
+
const detail = sw.closest(".asta-webhooks-detail");
|
|
1374
|
+
const on = sw.getAttribute("aria-checked") !== "true";
|
|
1375
|
+
sw.setAttribute("aria-checked", String(on));
|
|
1376
|
+
const failing = detail.dataset.failing !== undefined;
|
|
1377
|
+
const s = !on ? "disabled" : failing ? "failing" : "enabled";
|
|
1378
|
+
whStatus(detail.querySelector(".asta-webhooks-status"), s);
|
|
1379
|
+
whStatus(itemFor(root, detail)?.querySelector(".asta-webhooks-status"), s);
|
|
1380
|
+
const test = detail.querySelector("[data-asta-webhooks-test]");
|
|
1381
|
+
if (test) test.disabled = !on;
|
|
1382
|
+
fire(detail, "asta:webhook-toggle", { id: detail.dataset.id, enabled: on });
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
const WH_CODE = { 200: "OK", 201: "Created", 202: "Accepted", 204: "No content", 400: "Bad request", 401: "Unauthorized", 404: "Not found", 429: "Too many requests", 500: "Server error", 502: "Bad gateway", 503: "Unavailable", 504: "Gateway timeout" };
|
|
1386
|
+
const whWord = (c) => (c ? WH_CODE[c] ?? (c < 300 ? "Success" : c < 500 ? "Client error" : "Server error") : "No response");
|
|
1387
|
+
|
|
1388
|
+
function whDelivery(event, status, ms) {
|
|
1389
|
+
const li = document.createElement("li");
|
|
1390
|
+
li.className = "asta-webhooks-delivery";
|
|
1391
|
+
if (!(status >= 200 && status < 300)) li.setAttribute("data-failed", "");
|
|
1392
|
+
li.innerHTML = `<code></code><span class="asta-webhooks-dmeta"><span class="asta-webhooks-code">${whSvg(WH_ICON.enabled)}${whSvg(WH_ICON.failing)}<span></span></span><span>${ms} ms</span><span>Just now</span></span><span class="asta-webhooks-daction"><button type="button" class="asta-btn asta-btn-ghost asta-btn-xs" data-asta-webhooks-retry><span class="asta-btn-label">Retry</span><span class="asta-btn-spinner" aria-hidden="true">${whSvg("M8 2a6 6 0 1 0 6 6")}</span></button><span data-when="failed">Still failing</span><span data-when="ok">${whSvg("m3.5 8.5 3 3 6-7")}Retried</span></span>`;
|
|
1393
|
+
li.querySelector("code").textContent = event;
|
|
1394
|
+
li.querySelector(".asta-webhooks-code > span").textContent = `${status ?? "—"} ${whWord(status)}`;
|
|
1395
|
+
li.querySelector("[data-asta-webhooks-retry]").setAttribute("aria-label", `Retry ${event}`);
|
|
1396
|
+
return li;
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
async function whTest(root, btn) {
|
|
1400
|
+
const detail = btn.closest(".asta-webhooks-detail");
|
|
1401
|
+
const out = detail.querySelector(".asta-webhooks-result");
|
|
1402
|
+
btn.setAttribute("aria-busy", "true");
|
|
1403
|
+
btn.disabled = true;
|
|
1404
|
+
await whWait(900);
|
|
1405
|
+
const failing = detail.dataset.failing !== undefined;
|
|
1406
|
+
const status = failing ? 502 : 200;
|
|
1407
|
+
const ms = failing ? 1204 : 90 + Math.round(Math.random() * 120);
|
|
1408
|
+
btn.removeAttribute("aria-busy");
|
|
1409
|
+
btn.disabled = false;
|
|
1410
|
+
if (out) {
|
|
1411
|
+
out.innerHTML = `<span${failing ? "" : " data-ok"}>${whSvg(failing ? WH_ICON.failing : WH_ICON.enabled)}<span></span></span>`;
|
|
1412
|
+
out.querySelector("span > span").textContent = `${failing ? "Test failed" : "Test delivered"}: ${status} ${whWord(status)} in ${ms} ms`;
|
|
1413
|
+
}
|
|
1414
|
+
detail.querySelector(".asta-webhooks-dlist")?.prepend(whDelivery("test.ping", status, ms));
|
|
1415
|
+
fire(detail, "asta:webhook-test", { id: detail.dataset.id, status });
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
async function whRetry(btn) {
|
|
1419
|
+
const li = btn.closest(".asta-webhooks-delivery");
|
|
1420
|
+
const detail = btn.closest(".asta-webhooks-detail");
|
|
1421
|
+
li.dataset.retry = "pending";
|
|
1422
|
+
btn.setAttribute("aria-busy", "true");
|
|
1423
|
+
btn.disabled = true;
|
|
1424
|
+
await whWait(900);
|
|
1425
|
+
// Demo: a failing endpoint fails its first retry, then succeeds.
|
|
1426
|
+
const n = Number(li.dataset.tries || 0) + 1;
|
|
1427
|
+
li.dataset.tries = String(n);
|
|
1428
|
+
const ok = !(detail?.dataset.failing !== undefined && n === 1);
|
|
1429
|
+
const status = ok ? 200 : 500;
|
|
1430
|
+
btn.removeAttribute("aria-busy");
|
|
1431
|
+
btn.disabled = false;
|
|
1432
|
+
li.dataset.retry = ok ? "ok" : "failed";
|
|
1433
|
+
li.toggleAttribute("data-failed", !ok);
|
|
1434
|
+
const code = li.querySelector(".asta-webhooks-code > span:last-child");
|
|
1435
|
+
if (code) code.textContent = `${status} ${whWord(status)}`;
|
|
1436
|
+
const meta = li.querySelectorAll(".asta-webhooks-dmeta > span");
|
|
1437
|
+
if (meta[1]) meta[1].textContent = `${ok ? 156 : 912} ms`;
|
|
1438
|
+
if (meta[2]) meta[2].textContent = "Just now";
|
|
1439
|
+
fire(li, "asta:webhook-retry", { id: detail?.dataset.id, delivery: li.dataset.id, status });
|
|
1440
|
+
if (!ok) whSoon(btn);
|
|
1441
|
+
else whSoon(detail?.querySelector("h4"));
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
function whAsk(detail, open) {
|
|
1445
|
+
const confirm = detail.querySelector(".asta-webhooks-confirm");
|
|
1446
|
+
const btn = detail.querySelector("[data-asta-webhooks-delete]");
|
|
1447
|
+
if (!confirm) return;
|
|
1448
|
+
confirm.hidden = !open;
|
|
1449
|
+
btn?.setAttribute("aria-expanded", String(open));
|
|
1450
|
+
whSoon(open ? confirm.querySelector("[data-asta-webhooks-keep]") : btn);
|
|
1451
|
+
}
|
|
1452
|
+
function whDelete(root, detail) {
|
|
1453
|
+
const item = itemFor(root, detail);
|
|
1454
|
+
const li = item?.closest("li");
|
|
1455
|
+
const next = (li?.nextElementSibling ?? li?.previousElementSibling)?.querySelector(".asta-webhooks-item");
|
|
1456
|
+
fire(root, "asta:webhook-delete", { id: detail.dataset.id });
|
|
1457
|
+
li?.remove();
|
|
1458
|
+
detail.remove();
|
|
1459
|
+
if (next) {
|
|
1460
|
+
whSelect(root, next);
|
|
1461
|
+
whSoon(next);
|
|
1462
|
+
} else whSoon(whCreate(root));
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
document.addEventListener("click", (e) => {
|
|
1466
|
+
const root = whRoot(e);
|
|
1467
|
+
if (!root) return;
|
|
1468
|
+
const detail = near(e, ".asta-webhooks-detail");
|
|
1469
|
+
const item = near(e, ".asta-webhooks-item");
|
|
1470
|
+
if (near(e, "[data-asta-webhooks-create]")) {
|
|
1471
|
+
const form = whForm(root);
|
|
1472
|
+
if (form && !form.hidden) form.querySelector("input[name=url]")?.focus();
|
|
1473
|
+
else whOpen(root);
|
|
1474
|
+
} else if (near(e, "[data-asta-webhooks-cancel]")) whClose(root);
|
|
1475
|
+
else if (item) whSelect(root, item, true);
|
|
1476
|
+
else if (!detail) return;
|
|
1477
|
+
else if (near(e, ".asta-webhooks-switch")) whToggle(root, near(e, ".asta-webhooks-switch"));
|
|
1478
|
+
else if (near(e, "[data-asta-webhooks-reveal]")) {
|
|
1479
|
+
const btn = near(e, "[data-asta-webhooks-reveal]");
|
|
1480
|
+
const code = detail.querySelector("[data-secret]");
|
|
1481
|
+
const show = btn.getAttribute("aria-pressed") !== "true";
|
|
1482
|
+
btn.setAttribute("aria-pressed", String(show));
|
|
1483
|
+
btn.querySelector(".asta-btn-label").textContent = show ? "Hide" : "Reveal";
|
|
1484
|
+
if (code) {
|
|
1485
|
+
code.dataset.masked ??= code.textContent;
|
|
1486
|
+
code.textContent = show ? code.dataset.secret : code.dataset.masked;
|
|
1487
|
+
}
|
|
1488
|
+
} else if (near(e, "[data-asta-webhooks-test]") && !whRemote(near(e, "[data-asta-webhooks-test]"))) whTest(root, near(e, "[data-asta-webhooks-test]"));
|
|
1489
|
+
else if (near(e, "[data-asta-webhooks-retry]") && !whRemote(near(e, "[data-asta-webhooks-retry]"))) whRetry(near(e, "[data-asta-webhooks-retry]"));
|
|
1490
|
+
else if (near(e, "[data-asta-webhooks-delete]")) whAsk(detail, true);
|
|
1491
|
+
else if (near(e, "[data-asta-webhooks-keep]")) whAsk(detail, false);
|
|
1492
|
+
else if (near(e, "[data-asta-webhooks-confirm]")) whDelete(root, detail);
|
|
1493
|
+
});
|
|
1494
|
+
|
|
1495
|
+
document.addEventListener("change", (e) => {
|
|
1496
|
+
if (!whRoot(e)) return;
|
|
1497
|
+
const t = el(e);
|
|
1498
|
+
const group = t?.closest(".asta-webhooks-group");
|
|
1499
|
+
if (!group) return;
|
|
1500
|
+
if (t.matches("[data-asta-webhooks-all]")) group.querySelectorAll("input[name=events]").forEach((n) => (n.checked = t.checked));
|
|
1501
|
+
whSync(group);
|
|
1502
|
+
});
|
|
1503
|
+
|
|
1504
|
+
// Errors show on blur and submit, never while typing; a shown error clears once the value is fixed.
|
|
1505
|
+
document.addEventListener("focusout", (e) => {
|
|
1506
|
+
const root = whRoot(e);
|
|
1507
|
+
const t = el(e);
|
|
1508
|
+
if (root && t?.matches("[data-asta-webhooks-form] input[name=url]") && t.value.trim()) whShowUrl(root, t);
|
|
1509
|
+
});
|
|
1510
|
+
document.addEventListener("input", (e) => {
|
|
1511
|
+
const root = whRoot(e);
|
|
1512
|
+
const t = el(e);
|
|
1513
|
+
if (root && t?.matches("[data-asta-webhooks-form] input[name=url][aria-invalid]") && !whUrlError(root, t.value)) {
|
|
1514
|
+
t.removeAttribute("aria-invalid");
|
|
1515
|
+
whMsg(msgOf(t), "");
|
|
1516
|
+
}
|
|
1517
|
+
});
|
|
1518
|
+
|
|
1519
|
+
// Capture phase, so an invalid form never reaches htmx or the browser.
|
|
1520
|
+
document.addEventListener(
|
|
1521
|
+
"submit",
|
|
1522
|
+
(e) => {
|
|
1523
|
+
const form = e.target instanceof HTMLFormElement && e.target.matches("[data-asta-webhooks-form]") ? e.target : null;
|
|
1524
|
+
const root = form?.closest("[data-asta-webhooks]");
|
|
1525
|
+
if (!root) return;
|
|
1526
|
+
if (!whCheck(root, form)) {
|
|
1527
|
+
e.preventDefault();
|
|
1528
|
+
e.stopPropagation();
|
|
1529
|
+
return;
|
|
1530
|
+
}
|
|
1531
|
+
if (!whRemote(form)) {
|
|
1532
|
+
e.preventDefault();
|
|
1533
|
+
whDemoCreate(root, form);
|
|
1534
|
+
}
|
|
1535
|
+
},
|
|
1536
|
+
true,
|
|
1537
|
+
);
|
|
1538
|
+
|
|
1539
|
+
document.addEventListener("keydown", (e) => {
|
|
1540
|
+
const root = whRoot(e);
|
|
1541
|
+
if (!root) return;
|
|
1542
|
+
if (e.key === "Escape") {
|
|
1543
|
+
if (near(e, "[data-asta-webhooks-form]")) {
|
|
1544
|
+
e.preventDefault();
|
|
1545
|
+
whClose(root);
|
|
1546
|
+
} else if (near(e, ".asta-webhooks-confirm")) {
|
|
1547
|
+
e.preventDefault();
|
|
1548
|
+
whAsk(near(e, ".asta-webhooks-detail"), false);
|
|
1549
|
+
}
|
|
1550
|
+
return;
|
|
1551
|
+
}
|
|
1552
|
+
const item = near(e, ".asta-webhooks-item");
|
|
1553
|
+
if (!item || !["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key)) return;
|
|
1554
|
+
const items = [...root.querySelectorAll(".asta-webhooks-item")];
|
|
1555
|
+
const i = items.indexOf(item);
|
|
1556
|
+
const n = e.key === "ArrowDown" ? i + 1 : e.key === "ArrowUp" ? i - 1 : e.key === "Home" ? 0 : items.length - 1;
|
|
1557
|
+
const next = items[Math.max(0, Math.min(items.length - 1, n))];
|
|
1558
|
+
e.preventDefault();
|
|
1559
|
+
whSelect(root, next);
|
|
1560
|
+
next.focus();
|
|
1561
|
+
});
|
|
1562
|
+
|
|
1563
|
+
/* ---------- feature-flags ---------- */
|
|
1564
|
+
/* ---------- Feature flags ----------
|
|
1565
|
+
* Feature flags [data-asta-flags data-env="staging" data-url?]: rows keep their state in data-development,
|
|
1566
|
+
* data-staging and data-production ("on 25"). The environment radios [data-asta-flags-env] re-render every
|
|
1567
|
+
* switch, bar, env strip and rollout field. [data-asta-flags-search] and the [data-asta-flags-filter] radios
|
|
1568
|
+
* (all, on, off, stale) hide rows, update [data-count] and show [data-asta-flags-empty]. [data-asta-flags-expand]
|
|
1569
|
+
* opens the row panel. The switch [data-asta-flags-switch] and [data-asta-flags-save] change the current
|
|
1570
|
+
* environment; in production they ask first in .asta-feature-flags-confirm ([data-asta-flags-keep|confirm],
|
|
1571
|
+
* Esc keeps). Changes are optimistic: with data-url asta.js POSTs JSON {key, env, on|rollout|rules} and rolls
|
|
1572
|
+
* back on a non-2xx answer; it always fires "asta:flag-change" {key, env, change, rollback()}. Rules are added
|
|
1573
|
+
* by [data-asta-flags-addrule] and removed by [data-asta-flags-rule-remove]. [data-asta-flags-create|cancel]
|
|
1574
|
+
* open and close the new flag form, checked on submit. Without hx-post or action it adds a row from
|
|
1575
|
+
* <template data-asta-flags-row> and fires "asta:flag-create" {key, name}.
|
|
1576
|
+
* Uses near, fire and el from the top of this file. */
|
|
1577
|
+
|
|
1578
|
+
const ffRoot = (e) => near(e, "[data-asta-flags]");
|
|
1579
|
+
const ffSoon = (node) => node && requestAnimationFrame(() => node.focus());
|
|
1580
|
+
const ffRemote = (n) => !!n && (n.hasAttribute("action") || [...n.attributes].some((a) => /^(hx|data-hx)-(get|post|put|patch|delete)$/.test(a.name)));
|
|
1581
|
+
const ffEsc = (s) => s.replace(/[&<>"']/g, (c) => `&#${c.charCodeAt(0)};`);
|
|
1582
|
+
const FF_ENV = { development: ["Development", "Dev"], staging: ["Staging", "Staging"], production: ["Production", "Prod"] };
|
|
1583
|
+
const FF_KEY = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
1584
|
+
const FF_ATTRS = [
|
|
1585
|
+
["Workspace plan", ["is", "is not"], "Growth"],
|
|
1586
|
+
["Email", ["ends with", "is"], "@astabyte.com"],
|
|
1587
|
+
["Country", ["is", "is not"], "ID"],
|
|
1588
|
+
];
|
|
1589
|
+
const ffSlug = (s) => s.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 48);
|
|
1590
|
+
const ffEnv = (root) => root.dataset.env || "staging";
|
|
1591
|
+
const ffGet = (row, env) => {
|
|
1592
|
+
const [s, n] = (row.dataset[env] || "off 100").split(" ");
|
|
1593
|
+
return { on: s === "on", rollout: Math.max(0, Math.min(100, Number(n) || 0)) };
|
|
1594
|
+
};
|
|
1595
|
+
const ffSet = (row, env, st) => (row.dataset[env] = `${st.on ? "on" : "off"} ${st.rollout}`);
|
|
1596
|
+
const ffRules = (row) =>
|
|
1597
|
+
[...row.querySelectorAll(".asta-feature-flags-rule")].map((li) => ({ attribute: li.dataset.attribute, operator: li.dataset.operator, value: li.dataset.value }));
|
|
1598
|
+
|
|
1599
|
+
function ffSay(root, msg) {
|
|
1600
|
+
const s = root.querySelector("[data-asta-flags-status]");
|
|
1601
|
+
if (s) s.textContent = msg;
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
// Paint one row for the current environment.
|
|
1605
|
+
function ffPaint(row) {
|
|
1606
|
+
const root = row.closest("[data-asta-flags]");
|
|
1607
|
+
const env = ffEnv(root);
|
|
1608
|
+
const { on, rollout } = ffGet(row, env);
|
|
1609
|
+
const sw = row.querySelector("[data-asta-flags-switch]");
|
|
1610
|
+
if (sw) {
|
|
1611
|
+
sw.checked = on;
|
|
1612
|
+
sw.setAttribute("aria-label", `${row.dataset.key} in ${FF_ENV[env][0]}`);
|
|
1613
|
+
}
|
|
1614
|
+
const bar = row.querySelector(".asta-feature-flags-bar > span");
|
|
1615
|
+
if (bar) {
|
|
1616
|
+
bar.style.setProperty("--value", String(rollout / 100));
|
|
1617
|
+
bar.toggleAttribute("data-on", on);
|
|
1618
|
+
}
|
|
1619
|
+
const text = row.querySelector("[data-asta-flags-amount-text]");
|
|
1620
|
+
if (text) text.innerHTML = `${rollout}%${on ? "" : "<span> · off</span>"}`;
|
|
1621
|
+
row.querySelectorAll(".asta-feature-flags-envs > [data-env]").forEach((s) => {
|
|
1622
|
+
const st = ffGet(row, s.dataset.env);
|
|
1623
|
+
s.toggleAttribute("data-on", st.on);
|
|
1624
|
+
s.setAttribute("aria-current", String(s.dataset.env === env));
|
|
1625
|
+
s.textContent = `${FF_ENV[s.dataset.env][1]} ${st.on ? "on" : "off"}`;
|
|
1626
|
+
});
|
|
1627
|
+
const label = row.querySelector("[data-env-label]");
|
|
1628
|
+
if (label) label.textContent = FF_ENV[env][0];
|
|
1629
|
+
ffDraft(row, rollout);
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
// Put the rollout fields back to a value and hide Save / Reset.
|
|
1633
|
+
function ffDraft(row, n) {
|
|
1634
|
+
const amount = row.querySelector(".asta-feature-flags-amount");
|
|
1635
|
+
if (!amount) return;
|
|
1636
|
+
const range = amount.querySelector("[data-asta-flags-range]");
|
|
1637
|
+
const num = amount.querySelector("[data-asta-flags-percent]");
|
|
1638
|
+
if (range) {
|
|
1639
|
+
range.value = String(n);
|
|
1640
|
+
range.dispatchEvent(new Event("input", { bubbles: true }));
|
|
1641
|
+
}
|
|
1642
|
+
if (num) num.value = String(n);
|
|
1643
|
+
amount.removeAttribute("data-dirty");
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
// Hide rows that don't match the search and filter, then update the counts and the empty state.
|
|
1647
|
+
function ffApply(root) {
|
|
1648
|
+
const env = ffEnv(root);
|
|
1649
|
+
const q = (root.querySelector("[data-asta-flags-search]")?.value || "").trim().toLowerCase();
|
|
1650
|
+
const filter = root.querySelector("[data-asta-flags-filter] input:checked")?.value || "all";
|
|
1651
|
+
const rows = [...root.querySelectorAll(".asta-feature-flags-row")];
|
|
1652
|
+
const counts = { all: 0, on: 0, off: 0, stale: 0 };
|
|
1653
|
+
let shown = 0;
|
|
1654
|
+
for (const row of rows) {
|
|
1655
|
+
const match = !q || row.textContent.toLowerCase().includes(q);
|
|
1656
|
+
const on = ffGet(row, env).on;
|
|
1657
|
+
const test = { all: true, on, off: !on, stale: row.hasAttribute("data-stale") };
|
|
1658
|
+
if (match) for (const k in counts) counts[k] += test[k] ? 1 : 0;
|
|
1659
|
+
const show = match && test[filter];
|
|
1660
|
+
row.hidden = !show;
|
|
1661
|
+
shown += show ? 1 : 0;
|
|
1662
|
+
}
|
|
1663
|
+
root.querySelectorAll("[data-count]").forEach((c) => (c.textContent = String(counts[c.dataset.count] ?? 0)));
|
|
1664
|
+
const empty = root.querySelector("[data-asta-flags-empty]");
|
|
1665
|
+
if (empty) {
|
|
1666
|
+
const none = rows.length === 0;
|
|
1667
|
+
const [title, line] = empty.querySelectorAll("p");
|
|
1668
|
+
if (title) title.textContent = none ? "No feature flags yet" : "No flags match";
|
|
1669
|
+
if (line) line.textContent = none ? "Create one to ship code dark." : "Try another search or filter.";
|
|
1670
|
+
empty.querySelector("[data-asta-flags-clear]")?.toggleAttribute("hidden", none);
|
|
1671
|
+
empty.hidden = shown > 0;
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
const ffWhat = (row, env, change) =>
|
|
1676
|
+
change.rules
|
|
1677
|
+
? `save targeting for ${row.dataset.key}`
|
|
1678
|
+
: change.on !== undefined
|
|
1679
|
+
? `turn ${change.on ? "on" : "off"} ${row.dataset.key} in ${FF_ENV[env][0]}`
|
|
1680
|
+
: `set ${row.dataset.key} to ${change.rollout}% in ${FF_ENV[env][0]}`;
|
|
1681
|
+
|
|
1682
|
+
// Optimistic save: apply now, put the old state back if the server says no.
|
|
1683
|
+
function ffCommit(row, change, before) {
|
|
1684
|
+
const root = row.closest("[data-asta-flags]");
|
|
1685
|
+
const env = ffEnv(root);
|
|
1686
|
+
const key = row.dataset.key;
|
|
1687
|
+
const old = before ?? { state: row.dataset[env], rules: row.querySelector(".asta-feature-flags-rules > ul")?.innerHTML };
|
|
1688
|
+
if (!change.rules) ffSet(row, env, { ...ffGet(row, env), ...change });
|
|
1689
|
+
const err = row.querySelector(".asta-feature-flags-error");
|
|
1690
|
+
if (err) err.hidden = true;
|
|
1691
|
+
row.setAttribute("data-saving", "");
|
|
1692
|
+
ffPaint(row);
|
|
1693
|
+
ffApply(root);
|
|
1694
|
+
let done = false;
|
|
1695
|
+
const finish = (ok) => {
|
|
1696
|
+
if (done) return;
|
|
1697
|
+
done = true;
|
|
1698
|
+
row.removeAttribute("data-saving");
|
|
1699
|
+
if (ok) return ffSay(root, `Saved changes to ${key}.`);
|
|
1700
|
+
row.dataset[env] = old.state;
|
|
1701
|
+
const ul = row.querySelector(".asta-feature-flags-rules > ul");
|
|
1702
|
+
if (change.rules && ul && old.rules !== undefined) ul.innerHTML = old.rules;
|
|
1703
|
+
ffPaint(row);
|
|
1704
|
+
ffApply(root);
|
|
1705
|
+
const msg = `Couldn't ${ffWhat(row, env, change)}. It's back to how it was. Try again.`;
|
|
1706
|
+
if (err) {
|
|
1707
|
+
err.querySelector("span").textContent = msg;
|
|
1708
|
+
err.hidden = false;
|
|
1709
|
+
}
|
|
1710
|
+
ffSay(root, msg);
|
|
1711
|
+
};
|
|
1712
|
+
fire(row, "asta:flag-change", { key, env, change, rollback: () => finish(false) });
|
|
1713
|
+
const url = root.dataset.url;
|
|
1714
|
+
if (!url) return setTimeout(() => finish(true), 400);
|
|
1715
|
+
fetch(url, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ key, env, ...change }) })
|
|
1716
|
+
.then((r) => finish(r.ok))
|
|
1717
|
+
.catch(() => finish(false));
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
// Production asks first.
|
|
1721
|
+
function ffRequest(row, change) {
|
|
1722
|
+
const root = row.closest("[data-asta-flags]");
|
|
1723
|
+
if (ffEnv(root) !== "production") return ffCommit(row, change);
|
|
1724
|
+
const box = row.querySelector(".asta-feature-flags-confirm");
|
|
1725
|
+
if (!box) return ffCommit(row, change);
|
|
1726
|
+
const key = row.dataset.key;
|
|
1727
|
+
box._ffChange = change;
|
|
1728
|
+
box.querySelector("[data-asta-flags-question]").textContent =
|
|
1729
|
+
change.on !== undefined ? `Turn ${change.on ? "on" : "off"} ${key} in Production?` : `Set ${key} to ${change.rollout}% in Production?`;
|
|
1730
|
+
box.querySelector("[data-asta-flags-confirm]").textContent = change.on !== undefined ? `Turn ${change.on ? "on" : "off"}` : `Set to ${change.rollout}%`;
|
|
1731
|
+
box.hidden = false;
|
|
1732
|
+
row.querySelector("[data-asta-flags-switch]")?.setAttribute("disabled", "");
|
|
1733
|
+
ffSoon(box.querySelector("[data-asta-flags-keep]"));
|
|
1734
|
+
}
|
|
1735
|
+
|
|
1736
|
+
function ffSettle(row, go) {
|
|
1737
|
+
const box = row.querySelector(".asta-feature-flags-confirm");
|
|
1738
|
+
if (!box || box.hidden) return;
|
|
1739
|
+
const change = box._ffChange;
|
|
1740
|
+
box.hidden = true;
|
|
1741
|
+
box._ffChange = null;
|
|
1742
|
+
const sw = row.querySelector("[data-asta-flags-switch]");
|
|
1743
|
+
sw?.removeAttribute("disabled");
|
|
1744
|
+
if (go && change) ffCommit(row, change);
|
|
1745
|
+
ffSoon(change && change.rollout !== undefined ? row.querySelector("[data-asta-flags-percent]") : sw);
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
function ffAmount(row) {
|
|
1749
|
+
const amount = row.querySelector(".asta-feature-flags-amount");
|
|
1750
|
+
const num = amount?.querySelector("[data-asta-flags-percent]");
|
|
1751
|
+
const n = Math.max(0, Math.min(100, Math.round(Number(num?.value) || 0)));
|
|
1752
|
+
const cur = ffGet(row, ffEnv(row.closest("[data-asta-flags]"))).rollout;
|
|
1753
|
+
const save = amount?.querySelector("[data-asta-flags-save]");
|
|
1754
|
+
if (save) save.textContent = `Save ${n}%`;
|
|
1755
|
+
amount?.toggleAttribute("data-dirty", n !== cur);
|
|
1756
|
+
return n;
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
function ffRuleHtml(a, o, v) {
|
|
1760
|
+
return `<li class="asta-feature-flags-rule" data-new data-attribute="${ffEsc(a)}" data-operator="${ffEsc(o)}" data-value="${ffEsc(v)}"><span>${ffEsc(a)} <i>${ffEsc(o)}</i> <code>${ffEsc(v)}</code></span><button type="button" class="asta-btn asta-btn-ghost asta-btn-xs asta-btn-icon" data-asta-flags-rule-remove aria-label="Remove rule ${ffEsc(`${a} ${o} ${v}`)}"><svg viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m4.5 4.5 7 7M11.5 4.5l-7 7"/></svg></button></li>`;
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
function ffMsg(input, text) {
|
|
1764
|
+
const msg = input && document.getElementById(input.getAttribute("aria-describedby") || "");
|
|
1765
|
+
if (!input) return;
|
|
1766
|
+
input.setAttribute("aria-invalid", String(!!text));
|
|
1767
|
+
if (!msg) return;
|
|
1768
|
+
msg.toggleAttribute("data-error", !!text);
|
|
1769
|
+
if (msg.hasAttribute("data-hint")) msg.hidden = false;
|
|
1770
|
+
else msg.hidden = !text;
|
|
1771
|
+
msg.querySelector("span").textContent = text || msg.dataset.hint || "";
|
|
1772
|
+
}
|
|
1773
|
+
|
|
1774
|
+
function ffCheckKey(root, key) {
|
|
1775
|
+
if (!key) return "Enter a key.";
|
|
1776
|
+
if (!FF_KEY.test(key)) return "Use lowercase letters, numbers and single dashes, like new-checkout.";
|
|
1777
|
+
if ([...root.querySelectorAll(".asta-feature-flags-row")].some((r) => r.dataset.key === key)) return "A flag with this key already exists.";
|
|
1778
|
+
return "";
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
function ffOpen(root, open) {
|
|
1782
|
+
const form = root.querySelector("[data-asta-flags-form]");
|
|
1783
|
+
const btn = root.querySelector("[data-asta-flags-create]");
|
|
1784
|
+
if (!form) return;
|
|
1785
|
+
form.hidden = !open;
|
|
1786
|
+
btn?.setAttribute("aria-expanded", String(open));
|
|
1787
|
+
if (open) return ffSoon(form.querySelector("[name=name]"));
|
|
1788
|
+
form.reset();
|
|
1789
|
+
delete form.dataset.touched;
|
|
1790
|
+
form.querySelectorAll("input").forEach((i) => ffMsg(i, ""));
|
|
1791
|
+
const alert = form.querySelector("[data-asta-flags-alert]");
|
|
1792
|
+
if (alert) alert.hidden = true;
|
|
1793
|
+
ffSoon(btn);
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
document.addEventListener("change", (e) => {
|
|
1797
|
+
const root = ffRoot(e);
|
|
1798
|
+
if (!root) return;
|
|
1799
|
+
const t = el(e);
|
|
1800
|
+
if (near(e, "[data-asta-flags-env]") && t.checked) {
|
|
1801
|
+
root.dataset.env = t.value;
|
|
1802
|
+
root.querySelectorAll(".asta-feature-flags-confirm:not([hidden])").forEach((b) => ffSettle(b.closest(".asta-feature-flags-row"), false));
|
|
1803
|
+
root.querySelectorAll(".asta-feature-flags-row").forEach(ffPaint);
|
|
1804
|
+
ffApply(root);
|
|
1805
|
+
return ffSay(root, `Showing ${FF_ENV[t.value][0]}.`);
|
|
1806
|
+
}
|
|
1807
|
+
if (near(e, "[data-asta-flags-filter]")) return ffApply(root);
|
|
1808
|
+
if (t.matches("[data-asta-flags-switch]")) {
|
|
1809
|
+
const row = t.closest(".asta-feature-flags-row");
|
|
1810
|
+
const want = t.checked;
|
|
1811
|
+
t.checked = !want; // stays put until the change is saved or confirmed
|
|
1812
|
+
return ffRequest(row, { on: want });
|
|
1813
|
+
}
|
|
1814
|
+
if (t.matches("[data-asta-flags-attr]")) {
|
|
1815
|
+
const [, ops, ph] = FF_ATTRS[Number(t.value)] || FF_ATTRS[0];
|
|
1816
|
+
const form = t.closest("form");
|
|
1817
|
+
form.elements.operator.innerHTML = ops.map((o) => `<option>${ffEsc(o)}</option>`).join("");
|
|
1818
|
+
form.elements.value.placeholder = `e.g. ${ph}`;
|
|
1819
|
+
ffMsg(form.elements.value, "");
|
|
1820
|
+
}
|
|
1821
|
+
});
|
|
1822
|
+
|
|
1823
|
+
document.addEventListener("input", (e) => {
|
|
1824
|
+
const root = ffRoot(e);
|
|
1825
|
+
if (!root) return;
|
|
1826
|
+
const t = el(e);
|
|
1827
|
+
if (t.matches("[data-asta-flags-search]")) return ffApply(root);
|
|
1828
|
+
if (t.matches("[data-asta-flags-range]") && e.isTrusted) {
|
|
1829
|
+
const row = t.closest(".asta-feature-flags-row");
|
|
1830
|
+
row.querySelector("[data-asta-flags-percent]").value = t.value;
|
|
1831
|
+
return ffAmount(row);
|
|
1832
|
+
}
|
|
1833
|
+
if (t.matches("[data-asta-flags-percent]")) return ffAmount(t.closest(".asta-feature-flags-row"));
|
|
1834
|
+
const form = t.closest("[data-asta-flags-form]");
|
|
1835
|
+
if (!form) return;
|
|
1836
|
+
if (t.name === "key") form.dataset.touched = "";
|
|
1837
|
+
if (t.name === "name" && !("touched" in form.dataset)) form.elements.key.value = ffSlug(t.value);
|
|
1838
|
+
});
|
|
1839
|
+
|
|
1840
|
+
document.addEventListener(
|
|
1841
|
+
"blur",
|
|
1842
|
+
(e) => {
|
|
1843
|
+
const root = ffRoot(e);
|
|
1844
|
+
const t = el(e);
|
|
1845
|
+
if (!root || !t) return;
|
|
1846
|
+
if (t.matches("[data-asta-flags-percent]")) {
|
|
1847
|
+
const row = t.closest(".asta-feature-flags-row");
|
|
1848
|
+
const n = ffAmount(row);
|
|
1849
|
+
t.value = String(n);
|
|
1850
|
+
const range = row.querySelector("[data-asta-flags-range]");
|
|
1851
|
+
range.value = String(n);
|
|
1852
|
+
range.dispatchEvent(new Event("input", { bubbles: true }));
|
|
1853
|
+
return;
|
|
1854
|
+
}
|
|
1855
|
+
const form = t.closest("[data-asta-flags-form]");
|
|
1856
|
+
if (form && t.name === "key" && t.value) ffMsg(t, ffCheckKey(root, t.value));
|
|
1857
|
+
if (form && t.name === "name" && t.value.trim() && t.getAttribute("aria-invalid") === "true") ffMsg(t, "");
|
|
1858
|
+
},
|
|
1859
|
+
true,
|
|
1860
|
+
);
|
|
1861
|
+
|
|
1862
|
+
document.addEventListener("click", (e) => {
|
|
1863
|
+
const root = ffRoot(e);
|
|
1864
|
+
if (!root) return;
|
|
1865
|
+
const row = near(e, ".asta-feature-flags-row");
|
|
1866
|
+
if (near(e, "[data-asta-flags-create]")) return ffOpen(root, root.querySelector("[data-asta-flags-form]")?.hidden ?? false);
|
|
1867
|
+
if (near(e, "[data-asta-flags-cancel]")) return ffOpen(root, false);
|
|
1868
|
+
if (near(e, "[data-asta-flags-clear]")) {
|
|
1869
|
+
const s = root.querySelector("[data-asta-flags-search]");
|
|
1870
|
+
if (s) s.value = "";
|
|
1871
|
+
const all = root.querySelector("[data-asta-flags-filter] input[value=all]");
|
|
1872
|
+
if (all) all.checked = true;
|
|
1873
|
+
all?.dispatchEvent(new Event("change", { bubbles: true }));
|
|
1874
|
+
ffApply(root);
|
|
1875
|
+
return ffSoon(s);
|
|
1876
|
+
}
|
|
1877
|
+
if (!row) return;
|
|
1878
|
+
const expand = near(e, "[data-asta-flags-expand]");
|
|
1879
|
+
if (expand) {
|
|
1880
|
+
const open = expand.getAttribute("aria-expanded") !== "true";
|
|
1881
|
+
expand.setAttribute("aria-expanded", String(open));
|
|
1882
|
+
const panel = row.querySelector(".asta-feature-flags-panel");
|
|
1883
|
+
if (panel) panel.hidden = !open;
|
|
1884
|
+
return;
|
|
1885
|
+
}
|
|
1886
|
+
if (near(e, "[data-asta-flags-keep]")) return ffSettle(row, false);
|
|
1887
|
+
if (near(e, "[data-asta-flags-confirm]")) return ffSettle(row, true);
|
|
1888
|
+
if (near(e, "[data-asta-flags-dismiss]")) {
|
|
1889
|
+
row.querySelector(".asta-feature-flags-error").hidden = true;
|
|
1890
|
+
return ffSoon(row.querySelector("[data-asta-flags-switch]"));
|
|
1891
|
+
}
|
|
1892
|
+
if (near(e, "[data-asta-flags-save]")) return ffRequest(row, { rollout: ffAmount(row) });
|
|
1893
|
+
if (near(e, "[data-asta-flags-reset]")) {
|
|
1894
|
+
ffDraft(row, ffGet(row, ffEnv(root)).rollout);
|
|
1895
|
+
return ffSoon(row.querySelector("[data-asta-flags-percent]"));
|
|
1896
|
+
}
|
|
1897
|
+
const remove = near(e, "[data-asta-flags-rule-remove]");
|
|
1898
|
+
if (remove) {
|
|
1899
|
+
const ul = remove.closest("ul");
|
|
1900
|
+
const before = { state: row.dataset[ffEnv(root)], rules: ul.innerHTML };
|
|
1901
|
+
const li = remove.closest("li");
|
|
1902
|
+
const next = li.nextElementSibling || li.previousElementSibling;
|
|
1903
|
+
li.remove();
|
|
1904
|
+
ffCommit(row, { rules: ffRules(row) }, before);
|
|
1905
|
+
ffSoon(next?.querySelector("button") || row.querySelector("[data-asta-flags-addrule] [name=value]"));
|
|
1906
|
+
}
|
|
1907
|
+
});
|
|
1908
|
+
|
|
1909
|
+
document.addEventListener("submit", (e) => {
|
|
1910
|
+
const root = ffRoot(e);
|
|
1911
|
+
if (!root) return;
|
|
1912
|
+
const add = near(e, "[data-asta-flags-addrule]");
|
|
1913
|
+
if (add) {
|
|
1914
|
+
e.preventDefault();
|
|
1915
|
+
const row = add.closest(".asta-feature-flags-row");
|
|
1916
|
+
const input = add.elements.value;
|
|
1917
|
+
const v = input.value.trim();
|
|
1918
|
+
const [attr, , ph] = FF_ATTRS[Number(add.elements.attribute.value)] || FF_ATTRS[0];
|
|
1919
|
+
if (!v) {
|
|
1920
|
+
ffMsg(input, `Enter a value, like ${ph}.`);
|
|
1921
|
+
return ffSoon(input);
|
|
1922
|
+
}
|
|
1923
|
+
ffMsg(input, "");
|
|
1924
|
+
const ul = row.querySelector(".asta-feature-flags-rules > ul");
|
|
1925
|
+
const before = { state: row.dataset[ffEnv(root)], rules: ul.innerHTML };
|
|
1926
|
+
ul.insertAdjacentHTML("beforeend", ffRuleHtml(attr, add.elements.operator.value, v));
|
|
1927
|
+
input.value = "";
|
|
1928
|
+
ffCommit(row, { rules: ffRules(row) }, before);
|
|
1929
|
+
return ffSoon(input);
|
|
1930
|
+
}
|
|
1931
|
+
const form = near(e, "[data-asta-flags-form]");
|
|
1932
|
+
if (!form) return;
|
|
1933
|
+
const name = form.elements.name;
|
|
1934
|
+
const key = form.elements.key;
|
|
1935
|
+
const nameErr = name.value.trim() ? "" : "Give the flag a name.";
|
|
1936
|
+
const keyErr = ffCheckKey(root, key.value);
|
|
1937
|
+
ffMsg(name, nameErr);
|
|
1938
|
+
ffMsg(key, keyErr);
|
|
1939
|
+
if (nameErr || keyErr) {
|
|
1940
|
+
e.preventDefault();
|
|
1941
|
+
return ffSoon(nameErr ? name : key);
|
|
1942
|
+
}
|
|
1943
|
+
if (ffRemote(form)) return; // the server answers with the new row
|
|
1944
|
+
e.preventDefault();
|
|
1945
|
+
const tpl = root.querySelector("template[data-asta-flags-row]");
|
|
1946
|
+
const list = root.querySelector(".asta-feature-flags-list");
|
|
1947
|
+
if (!tpl || !list) {
|
|
1948
|
+
form.querySelector("[data-asta-flags-alert]").hidden = false;
|
|
1949
|
+
return;
|
|
1950
|
+
}
|
|
1951
|
+
const k = key.value;
|
|
1952
|
+
const n = ffEsc(name.value.trim());
|
|
1953
|
+
list.insertAdjacentHTML(
|
|
1954
|
+
"afterbegin",
|
|
1955
|
+
tpl.innerHTML.replaceAll("__key__", k).replaceAll("__name__", n).replaceAll("__owner__", ffEsc(root.dataset.owner || "You")),
|
|
1956
|
+
);
|
|
1957
|
+
const row = list.firstElementChild;
|
|
1958
|
+
row.setAttribute("data-new", "");
|
|
1959
|
+
const s = root.querySelector("[data-asta-flags-search]");
|
|
1960
|
+
if (s) s.value = "";
|
|
1961
|
+
const all = root.querySelector("[data-asta-flags-filter] input[value=all]");
|
|
1962
|
+
if (all) all.checked = true;
|
|
1963
|
+
ffPaint(row);
|
|
1964
|
+
ffApply(root);
|
|
1965
|
+
fire(root, "asta:flag-create", { key: k, name: name.value.trim() });
|
|
1966
|
+
ffSay(root, `Flag ${k} created, off everywhere.`);
|
|
1967
|
+
ffOpen(root, false);
|
|
1968
|
+
ffSoon(row.querySelector("[data-asta-flags-switch]"));
|
|
1969
|
+
});
|
|
1970
|
+
|
|
1971
|
+
document.addEventListener("keydown", (e) => {
|
|
1972
|
+
const root = ffRoot(e);
|
|
1973
|
+
if (!root || e.key !== "Escape") return;
|
|
1974
|
+
if (near(e, "[data-asta-flags-form]")) {
|
|
1975
|
+
e.preventDefault();
|
|
1976
|
+
return ffOpen(root, false);
|
|
1977
|
+
}
|
|
1978
|
+
const confirm = near(e, ".asta-feature-flags-confirm");
|
|
1979
|
+
if (confirm) {
|
|
1980
|
+
e.preventDefault();
|
|
1981
|
+
ffSettle(confirm.closest(".asta-feature-flags-row"), false);
|
|
1982
|
+
}
|
|
1983
|
+
});
|
|
1984
|
+
|
|
1985
|
+
document.addEventListener("keydown", (e) => {
|
|
1986
|
+
if (e.key !== "Enter" || !el(e)?.matches("[data-asta-flags-percent]")) return;
|
|
1987
|
+
e.preventDefault();
|
|
1988
|
+
const row = near(e, ".asta-feature-flags-row");
|
|
1989
|
+
const n = ffAmount(row);
|
|
1990
|
+
if (n !== ffGet(row, ffEnv(row.closest("[data-asta-flags]"))).rollout) ffRequest(row, { rollout: n });
|
|
1991
|
+
});
|
|
1992
|
+
|
|
1993
|
+
/* ---------- integrations ---------- */
|
|
1994
|
+
/* ---------- Integrations ----------
|
|
1995
|
+
* [data-asta-integrations]: [data-asta-integrations-search] filters by name and description (Escape clears),
|
|
1996
|
+
* [role=tab][data-category] picks a category (arrows, Home, End), [data-asta-integrations-filter] (aria-pressed)
|
|
1997
|
+
* keeps connected apps only. Counts, the sr-only heading and the empty state follow.
|
|
1998
|
+
* Cards (.asta-integrations-card, data-id, data-connected, data-state):
|
|
1999
|
+
* Connect fires "asta:integration-connect" (cancelable, detail.id, detail.resolve({ account }), detail.reject(msg)).
|
|
2000
|
+
* Call preventDefault() and settle it yourself, or put hx-post on the button and swap the card from the server.
|
|
2001
|
+
* Otherwise it pretends: waits and connects (data-demo-fail on the card fails the first try).
|
|
2002
|
+
* Disconnect asks inline, then fires "asta:integration-disconnect" the same way. Manage fires
|
|
2003
|
+
* "asta:integration-manage" with detail.id. */
|
|
2004
|
+
{
|
|
2005
|
+
const igEl = (e) => (e.target instanceof Element ? e.target : null);
|
|
2006
|
+
const igNear = (e, sel) => igEl(e)?.closest(sel) ?? null;
|
|
2007
|
+
const igFire = (node, name, detail, cancelable = false) => node.dispatchEvent(new CustomEvent(name, { bubbles: true, cancelable, detail }));
|
|
2008
|
+
const igFocus = (node) => node && requestAnimationFrame(() => node.focus());
|
|
2009
|
+
const say = (root, text) => {
|
|
2010
|
+
const s = root.querySelector("[data-asta-integrations-status]");
|
|
2011
|
+
if (s) s.textContent = text;
|
|
2012
|
+
};
|
|
2013
|
+
const nameOf = (card) => card.dataset.name || card.querySelector(".asta-integrations-name")?.textContent?.trim() || "App";
|
|
2014
|
+
const remote = (btn) => !!btn && [...btn.attributes].some((a) => /^(hx|data-hx)-(post|put|delete|get)$/.test(a.name));
|
|
2015
|
+
|
|
2016
|
+
function filter(root) {
|
|
2017
|
+
const input = root.querySelector("[data-asta-integrations-search]");
|
|
2018
|
+
const raw = input?.value.trim() ?? "";
|
|
2019
|
+
const q = raw.toLowerCase();
|
|
2020
|
+
const only = root.querySelector("[data-asta-integrations-filter]")?.getAttribute("aria-pressed") === "true";
|
|
2021
|
+
const tab = root.querySelector('[role=tab][aria-selected="true"]')?.dataset.category ?? "all";
|
|
2022
|
+
const cards = [...root.querySelectorAll(".asta-integrations-card")];
|
|
2023
|
+
const match = (c) => (!q || c.textContent.toLowerCase().includes(q)) && (!only || c.hasAttribute("data-connected"));
|
|
2024
|
+
const counts = { all: 0 };
|
|
2025
|
+
let shown = 0;
|
|
2026
|
+
for (const c of cards) {
|
|
2027
|
+
const ok = match(c);
|
|
2028
|
+
if (ok) {
|
|
2029
|
+
counts.all++;
|
|
2030
|
+
counts[c.dataset.category] = (counts[c.dataset.category] ?? 0) + 1;
|
|
2031
|
+
}
|
|
2032
|
+
const show = ok && (tab === "all" || c.dataset.category === tab);
|
|
2033
|
+
c.hidden = !show;
|
|
2034
|
+
if (show) shown++;
|
|
2035
|
+
}
|
|
2036
|
+
root.querySelectorAll("[role=tab][data-category] [data-count]").forEach((n) => (n.textContent = String(counts[n.closest("[role=tab]").dataset.category] ?? 0)));
|
|
2037
|
+
const conn = root.querySelector("[data-asta-integrations-filter] .asta-integrations-num");
|
|
2038
|
+
if (conn) conn.textContent = String(cards.filter((c) => c.hasAttribute("data-connected")).length);
|
|
2039
|
+
root.querySelector("[data-asta-integrations-clear]")?.toggleAttribute("hidden", !raw);
|
|
2040
|
+
const tabLabel = root.querySelector('[role=tab][aria-selected="true"]')?.firstChild?.textContent?.trim();
|
|
2041
|
+
const heading = root.querySelector("[data-asta-integrations-heading]");
|
|
2042
|
+
if (heading) heading.textContent = `${shown} ${shown === 1 ? "integration" : "integrations"}${tab !== "all" && tabLabel ? ` in ${tabLabel}` : ""}${raw ? ` matching ${raw}` : ""}`;
|
|
2043
|
+
const empty = root.querySelector(".asta-integrations-empty");
|
|
2044
|
+
if (empty) {
|
|
2045
|
+
empty.hidden = shown > 0;
|
|
2046
|
+
empty.dataset.reason = q ? "search" : only ? "connected" : "none";
|
|
2047
|
+
empty.querySelectorAll("[data-slot=query]").forEach((n) => (n.textContent = raw));
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
function setState(card, state) {
|
|
2052
|
+
if (state) card.dataset.state = state;
|
|
2053
|
+
else card.removeAttribute("data-state");
|
|
2054
|
+
const btn = card.querySelector("[data-asta-integrations-connect]");
|
|
2055
|
+
if (btn) {
|
|
2056
|
+
const busy = state === "connecting";
|
|
2057
|
+
for (const a of ["aria-busy", "aria-disabled"]) {
|
|
2058
|
+
if (busy) btn.setAttribute(a, "true");
|
|
2059
|
+
else btn.removeAttribute(a);
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
function fail(root, card, message) {
|
|
2064
|
+
const p = card.querySelector(".asta-integrations-alert [data-slot=message]");
|
|
2065
|
+
const text = message || `Couldn't reach ${nameOf(card)}. Check that you're signed in there, then try again.`;
|
|
2066
|
+
if (p) p.textContent = text;
|
|
2067
|
+
setState(card, "error");
|
|
2068
|
+
say(root, `${nameOf(card)} didn't connect. ${text}`);
|
|
2069
|
+
igFocus(card.querySelector("[data-asta-integrations-retry]"));
|
|
2070
|
+
}
|
|
2071
|
+
function connected(root, card, account) {
|
|
2072
|
+
card.setAttribute("data-connected", "");
|
|
2073
|
+
if (account) {
|
|
2074
|
+
const slot = card.querySelector(".asta-integrations-meta > span");
|
|
2075
|
+
if (slot) slot.textContent = ` · ${account}`;
|
|
2076
|
+
}
|
|
2077
|
+
setState(card, null);
|
|
2078
|
+
say(root, `${nameOf(card)} connected.`);
|
|
2079
|
+
filter(root);
|
|
2080
|
+
igFocus(card.querySelector("[data-asta-integrations-manage]"));
|
|
2081
|
+
}
|
|
2082
|
+
function disconnected(root, card) {
|
|
2083
|
+
card.removeAttribute("data-connected");
|
|
2084
|
+
setState(card, null);
|
|
2085
|
+
say(root, `${nameOf(card)} disconnected.`);
|
|
2086
|
+
filter(root);
|
|
2087
|
+
igFocus(card.hidden ? root.querySelector("[data-asta-integrations-heading]") : card.querySelector("[data-asta-integrations-connect]"));
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
// Runs one side of the flow: an event a server can take over, htmx, or the demo.
|
|
2091
|
+
function run(root, card, kind) {
|
|
2092
|
+
const out = kind === "connect";
|
|
2093
|
+
const btn = card.querySelector(out ? "[data-asta-integrations-connect]" : "[data-asta-integrations-confirm]");
|
|
2094
|
+
setState(card, out ? "connecting" : "disconnecting");
|
|
2095
|
+
say(root, `${out ? "Connecting" : "Disconnecting"} ${nameOf(card)}…`);
|
|
2096
|
+
if (!out) igFocus(card.querySelector(".asta-integrations-busy button"));
|
|
2097
|
+
let settled = false;
|
|
2098
|
+
const resolve = (r) => {
|
|
2099
|
+
if (settled || !card.isConnected) return;
|
|
2100
|
+
settled = true;
|
|
2101
|
+
if (out) connected(root, card, r?.account);
|
|
2102
|
+
else disconnected(root, card);
|
|
2103
|
+
};
|
|
2104
|
+
const reject = (msg) => {
|
|
2105
|
+
if (settled || !card.isConnected) return;
|
|
2106
|
+
settled = true;
|
|
2107
|
+
if (out) return fail(root, card, msg);
|
|
2108
|
+
fail(root, card, msg || `Couldn't disconnect ${nameOf(card)}. It's still connected. Try again in a moment.`);
|
|
2109
|
+
};
|
|
2110
|
+
const taken = !igFire(card, `asta:integration-${kind}`, { id: card.dataset.id, resolve, reject }, true);
|
|
2111
|
+
if (taken || remote(btn)) return;
|
|
2112
|
+
setTimeout(() => {
|
|
2113
|
+
if (out && card.hasAttribute("data-demo-fail")) {
|
|
2114
|
+
card.removeAttribute("data-demo-fail");
|
|
2115
|
+
return reject(card.dataset.demoFail || "");
|
|
2116
|
+
}
|
|
2117
|
+
resolve();
|
|
2118
|
+
}, out ? 900 : 700);
|
|
2119
|
+
}
|
|
2120
|
+
|
|
2121
|
+
document.addEventListener("click", (e) => {
|
|
2122
|
+
const root = igNear(e, "[data-asta-integrations]");
|
|
2123
|
+
if (!root) return;
|
|
2124
|
+
const card = igNear(e, ".asta-integrations-card");
|
|
2125
|
+
const tab = igNear(e, "[role=tab][data-category]");
|
|
2126
|
+
if (tab) {
|
|
2127
|
+
root.querySelectorAll("[role=tab][data-category]").forEach((t) => {
|
|
2128
|
+
const on = t === tab;
|
|
2129
|
+
t.setAttribute("aria-selected", String(on));
|
|
2130
|
+
t.tabIndex = on ? 0 : -1;
|
|
2131
|
+
});
|
|
2132
|
+
root.querySelector("[role=tabpanel]")?.setAttribute("aria-labelledby", tab.id);
|
|
2133
|
+
filter(root);
|
|
2134
|
+
} else if (igNear(e, "[data-asta-integrations-filter]")) {
|
|
2135
|
+
const f = igNear(e, "[data-asta-integrations-filter]");
|
|
2136
|
+
f.setAttribute("aria-pressed", String(f.getAttribute("aria-pressed") !== "true"));
|
|
2137
|
+
filter(root);
|
|
2138
|
+
} else if (igNear(e, "[data-asta-integrations-clear]")) {
|
|
2139
|
+
const input = root.querySelector("[data-asta-integrations-search]");
|
|
2140
|
+
if (input) input.value = "";
|
|
2141
|
+
filter(root);
|
|
2142
|
+
say(root, "Search cleared.");
|
|
2143
|
+
igFocus(input);
|
|
2144
|
+
} else if (igNear(e, "[data-asta-integrations-showall]")) {
|
|
2145
|
+
const f = root.querySelector("[data-asta-integrations-filter]");
|
|
2146
|
+
f?.setAttribute("aria-pressed", "false");
|
|
2147
|
+
filter(root);
|
|
2148
|
+
igFocus(f);
|
|
2149
|
+
} else if (!card) return;
|
|
2150
|
+
else if (igNear(e, "[data-asta-integrations-connect]")) {
|
|
2151
|
+
if (card.dataset.state !== "connecting") run(root, card, "connect");
|
|
2152
|
+
} else if (igNear(e, "[data-asta-integrations-retry]")) {
|
|
2153
|
+
run(root, card, card.hasAttribute("data-connected") ? "disconnect" : "connect");
|
|
2154
|
+
if (!card.hasAttribute("data-connected")) igFocus(card.querySelector("[data-asta-integrations-connect]"));
|
|
2155
|
+
} else if (igNear(e, "[data-asta-integrations-dismiss]")) {
|
|
2156
|
+
setState(card, null);
|
|
2157
|
+
igFocus(card.querySelector(card.hasAttribute("data-connected") ? "[data-asta-integrations-disconnect]" : "[data-asta-integrations-connect]"));
|
|
2158
|
+
} else if (igNear(e, "[data-asta-integrations-disconnect]")) {
|
|
2159
|
+
setState(card, "confirm");
|
|
2160
|
+
igFocus(card.querySelector("[data-asta-integrations-keep]"));
|
|
2161
|
+
} else if (igNear(e, "[data-asta-integrations-keep]")) {
|
|
2162
|
+
setState(card, null);
|
|
2163
|
+
igFocus(card.querySelector("[data-asta-integrations-disconnect]"));
|
|
2164
|
+
} else if (igNear(e, "[data-asta-integrations-confirm]")) run(root, card, "disconnect");
|
|
2165
|
+
else if (igNear(e, "[data-asta-integrations-manage]")) {
|
|
2166
|
+
say(root, `Opening ${nameOf(card)} settings.`);
|
|
2167
|
+
igFire(card, "asta:integration-manage", { id: card.dataset.id });
|
|
2168
|
+
}
|
|
2169
|
+
});
|
|
2170
|
+
|
|
2171
|
+
document.addEventListener("input", (e) => {
|
|
2172
|
+
const root = igNear(e, "[data-asta-integrations]");
|
|
2173
|
+
if (root && igNear(e, "[data-asta-integrations-search]")) filter(root);
|
|
2174
|
+
});
|
|
2175
|
+
|
|
2176
|
+
document.addEventListener("keydown", (e) => {
|
|
2177
|
+
const root = igNear(e, "[data-asta-integrations]");
|
|
2178
|
+
if (!root) return;
|
|
2179
|
+
const search = igNear(e, "[data-asta-integrations-search]");
|
|
2180
|
+
if (search && e.key === "Escape" && search.value) {
|
|
2181
|
+
e.preventDefault();
|
|
2182
|
+
search.value = "";
|
|
2183
|
+
filter(root);
|
|
2184
|
+
say(root, "Search cleared.");
|
|
2185
|
+
return;
|
|
2186
|
+
}
|
|
2187
|
+
if (e.key === "Escape" && igNear(e, ".asta-integrations-confirm")) {
|
|
2188
|
+
e.preventDefault();
|
|
2189
|
+
const card = igNear(e, ".asta-integrations-card");
|
|
2190
|
+
setState(card, null);
|
|
2191
|
+
igFocus(card.querySelector("[data-asta-integrations-disconnect]"));
|
|
2192
|
+
return;
|
|
2193
|
+
}
|
|
2194
|
+
const tab = igNear(e, "[role=tab][data-category]");
|
|
2195
|
+
if (!tab) return;
|
|
2196
|
+
const tabs = [...root.querySelectorAll("[role=tab][data-category]")];
|
|
2197
|
+
const i = tabs.indexOf(tab);
|
|
2198
|
+
const n = e.key === "ArrowRight" ? (i + 1) % tabs.length : e.key === "ArrowLeft" ? (i - 1 + tabs.length) % tabs.length : e.key === "Home" ? 0 : e.key === "End" ? tabs.length - 1 : -1;
|
|
2199
|
+
if (n < 0) return;
|
|
2200
|
+
e.preventDefault();
|
|
2201
|
+
tabs[n].click();
|
|
2202
|
+
tabs[n].focus();
|
|
2203
|
+
});
|
|
2204
|
+
|
|
2205
|
+
// htmx swapped a card or the whole section: recount.
|
|
2206
|
+
document.addEventListener("htmx:afterSettle", (e) => {
|
|
2207
|
+
const root = igNear(e, "[data-asta-integrations]") ?? (e.target instanceof Element ? e.target.querySelector("[data-asta-integrations]") : null);
|
|
2208
|
+
if (root) filter(root);
|
|
2209
|
+
});
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
/* ---------- status-page ---------- */
|
|
2213
|
+
/* ---------- Status page ----------
|
|
2214
|
+
* [data-asta-status] (data-today="YYYY-MM-DD", the newest bar's day in UTC):
|
|
2215
|
+
* [data-asta-status-strip] is one tab stop. Arrows move a day, PageUp/PageDown a week, Home/End the ends,
|
|
2216
|
+
* skipping bars hidden by the range or the narrow view. Hover or focus shows .asta-status-page-tip with the date,
|
|
2217
|
+
* uptime and incident from each <i>'s data-s, data-u and data-t. Labels are written on first use.
|
|
2218
|
+
* [data-asta-status-subscribe] checks the email on blur and submit. With hx-post or action it goes to your server
|
|
2219
|
+
* (swap in the .asta-status-page-done markup); without, it waits a moment, shows the done state and fires
|
|
2220
|
+
* "asta:status-subscribe" with detail.email. [data-asta-status-again] brings the form back. */
|
|
2221
|
+
{
|
|
2222
|
+
const sel = (e, s) => (e.target instanceof Element ? e.target.closest(s) : null);
|
|
2223
|
+
const WORD = { "": "Operational", d: "Degraded", x: "Outage", m: "Maintenance", n: "No data" };
|
|
2224
|
+
const UPTIME = { "": 100, d: 99.5, x: 97, m: 100 };
|
|
2225
|
+
const dayFmt = new Intl.DateTimeFormat("en-US", { month: "short", day: "numeric", year: "numeric", timeZone: "UTC" });
|
|
2226
|
+
const bars = (strip) => [...strip.children].filter((n) => n.tagName === "I");
|
|
2227
|
+
// Only on key presses and pointer entry, never per frame.
|
|
2228
|
+
const visible = (strip) => bars(strip).filter((b) => b.offsetParent !== null);
|
|
2229
|
+
const tipOf = (strip) => strip.parentElement?.querySelector(".asta-status-page-tip");
|
|
2230
|
+
|
|
2231
|
+
function info(bar) {
|
|
2232
|
+
const s = bar.dataset.s ?? "";
|
|
2233
|
+
const all = bars(bar.parentElement);
|
|
2234
|
+
const today = Date.parse(`${bar.closest("[data-asta-status]")?.dataset.today ?? ""}T00:00:00Z`);
|
|
2235
|
+
const age = all.length - 1 - all.indexOf(bar);
|
|
2236
|
+
const date = dayFmt.format(new Date((Number.isNaN(today) ? Date.now() : today) - age * 86_400_000));
|
|
2237
|
+
const u = Number(bar.dataset.u ?? UPTIME[s]);
|
|
2238
|
+
const pct = u >= 99.995 ? "100%" : `${(Math.floor(u * 100) / 100).toFixed(2)}%`;
|
|
2239
|
+
return { date, word: WORD[s] ?? WORD[""], pct: s === "n" ? "" : pct, incident: bar.dataset.t ?? (s === "n" ? "Not tracked yet" : "No incidents") };
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
function label(strip) {
|
|
2243
|
+
if (strip.dataset.labelled) return;
|
|
2244
|
+
strip.dataset.labelled = "";
|
|
2245
|
+
const id = strip.id || (strip.id = `asta-sp-${Math.random().toString(36).slice(2, 8)}`);
|
|
2246
|
+
bars(strip).forEach((b, i) => {
|
|
2247
|
+
const d = info(b);
|
|
2248
|
+
b.id ||= `${id}-${i}`;
|
|
2249
|
+
b.setAttribute("aria-label", `${d.date}: ${d.word}${d.pct && `, ${d.pct} uptime`}${b.dataset.t ? `, ${b.dataset.t}` : ""}`);
|
|
2250
|
+
});
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
function show(strip, bar) {
|
|
2254
|
+
const tip = tipOf(strip);
|
|
2255
|
+
if (!tip) return;
|
|
2256
|
+
if (!bar) {
|
|
2257
|
+
tip.hidden = true;
|
|
2258
|
+
return;
|
|
2259
|
+
}
|
|
2260
|
+
const d = info(bar);
|
|
2261
|
+
const b = document.createElement("b");
|
|
2262
|
+
b.textContent = d.date;
|
|
2263
|
+
const w = document.createElement("span");
|
|
2264
|
+
w.textContent = d.pct ? `${d.word} · ${d.pct} uptime` : d.word;
|
|
2265
|
+
const t = document.createElement("span");
|
|
2266
|
+
t.textContent = d.incident;
|
|
2267
|
+
tip.replaceChildren(b, w, t);
|
|
2268
|
+
const vis = visible(strip);
|
|
2269
|
+
const frac = vis.indexOf(bar) / Math.max(1, vis.length - 1);
|
|
2270
|
+
tip.dataset.align = frac < 0.2 ? "start" : frac > 0.8 ? "end" : "";
|
|
2271
|
+
tip.style.left = `${frac < 0.2 ? bar.offsetLeft : frac > 0.8 ? bar.offsetLeft + bar.offsetWidth : bar.offsetLeft + bar.offsetWidth / 2}px`;
|
|
2272
|
+
tip.hidden = false;
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
function select(strip, bar) {
|
|
2276
|
+
bars(strip).forEach((b) => b.setAttribute("aria-selected", String(b === bar)));
|
|
2277
|
+
strip.setAttribute("aria-activedescendant", bar.id);
|
|
2278
|
+
show(strip, bar);
|
|
2279
|
+
}
|
|
2280
|
+
const current = (strip) => {
|
|
2281
|
+
const vis = visible(strip);
|
|
2282
|
+
const on = strip.querySelector('i[aria-selected="true"]');
|
|
2283
|
+
return on && vis.includes(on) ? on : vis[vis.length - 1];
|
|
2284
|
+
};
|
|
2285
|
+
|
|
2286
|
+
document.addEventListener("focusin", (e) => {
|
|
2287
|
+
const strip = sel(e, "[data-asta-status-strip]");
|
|
2288
|
+
if (!strip || e.target !== strip) return;
|
|
2289
|
+
label(strip);
|
|
2290
|
+
const bar = current(strip);
|
|
2291
|
+
if (bar) select(strip, bar);
|
|
2292
|
+
});
|
|
2293
|
+
document.addEventListener("focusout", (e) => {
|
|
2294
|
+
const strip = sel(e, "[data-asta-status-strip]");
|
|
2295
|
+
if (strip && e.target === strip && !strip.hasAttribute("data-hover")) show(strip, null);
|
|
2296
|
+
const input = sel(e, "[data-asta-status-subscribe] input[type=email]");
|
|
2297
|
+
if (input?.value) check(input);
|
|
2298
|
+
});
|
|
2299
|
+
document.addEventListener("keydown", (e) => {
|
|
2300
|
+
const strip = sel(e, "[data-asta-status-strip]");
|
|
2301
|
+
if (!strip || e.target !== strip) return;
|
|
2302
|
+
const step = { ArrowLeft: -1, ArrowRight: 1, PageUp: -7, PageDown: 7 }[e.key];
|
|
2303
|
+
if (!step && e.key !== "Home" && e.key !== "End") return;
|
|
2304
|
+
e.preventDefault();
|
|
2305
|
+
const vis = visible(strip);
|
|
2306
|
+
const at = vis.indexOf(current(strip));
|
|
2307
|
+
const next = step ? Math.min(Math.max(at + step, 0), vis.length - 1) : e.key === "Home" ? 0 : vis.length - 1;
|
|
2308
|
+
strip.removeAttribute("data-hover");
|
|
2309
|
+
vis.forEach((b) => b.removeAttribute("data-shown"));
|
|
2310
|
+
if (vis[next]) select(strip, vis[next]);
|
|
2311
|
+
});
|
|
2312
|
+
document.addEventListener("pointerover", (e) => {
|
|
2313
|
+
const bar = sel(e, "[data-asta-status-strip] > i");
|
|
2314
|
+
if (!bar) return;
|
|
2315
|
+
const strip = bar.parentElement;
|
|
2316
|
+
label(strip);
|
|
2317
|
+
strip.setAttribute("data-hover", "");
|
|
2318
|
+
strip.querySelector("i[data-shown]")?.removeAttribute("data-shown");
|
|
2319
|
+
bar.setAttribute("data-shown", "");
|
|
2320
|
+
show(strip, bar);
|
|
2321
|
+
});
|
|
2322
|
+
document.addEventListener(
|
|
2323
|
+
"pointerleave",
|
|
2324
|
+
(e) => {
|
|
2325
|
+
if (!(e.target instanceof Element) || !e.target.matches("[data-asta-status-strip]")) return;
|
|
2326
|
+
const strip = e.target;
|
|
2327
|
+
strip.removeAttribute("data-hover");
|
|
2328
|
+
strip.querySelector("i[data-shown]")?.removeAttribute("data-shown");
|
|
2329
|
+
show(strip, document.activeElement === strip ? current(strip) : null);
|
|
2330
|
+
},
|
|
2331
|
+
true,
|
|
2332
|
+
);
|
|
2333
|
+
|
|
2334
|
+
// Subscribe. The hint line keeps its texts in data-hint, data-error-empty, data-error-invalid and data-error-failed.
|
|
2335
|
+
const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/;
|
|
2336
|
+
function say(msg, key) {
|
|
2337
|
+
if (!msg) return;
|
|
2338
|
+
msg.toggleAttribute("data-error", key !== "hint");
|
|
2339
|
+
const text = msg.querySelector("span:last-child") ?? msg;
|
|
2340
|
+
text.textContent = msg.dataset[key === "hint" ? "hint" : `error${key[0].toUpperCase()}${key.slice(1)}`] ?? "";
|
|
2341
|
+
}
|
|
2342
|
+
function check(input) {
|
|
2343
|
+
const v = input.value.trim();
|
|
2344
|
+
const bad = !v ? "empty" : EMAIL.test(v) ? null : "invalid";
|
|
2345
|
+
if (bad) input.setAttribute("aria-invalid", "true");
|
|
2346
|
+
else input.removeAttribute("aria-invalid");
|
|
2347
|
+
say(document.getElementById(input.getAttribute("aria-describedby")), bad ?? "hint");
|
|
2348
|
+
return !bad;
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2351
|
+
document.addEventListener("input", (e) => {
|
|
2352
|
+
const input = sel(e, "[data-asta-status-subscribe] input[type=email]");
|
|
2353
|
+
if (input?.getAttribute("aria-invalid") === "true" && EMAIL.test(input.value.trim())) check(input);
|
|
2354
|
+
});
|
|
2355
|
+
|
|
2356
|
+
// Capture phase, so an invalid address never reaches htmx or the browser.
|
|
2357
|
+
document.addEventListener(
|
|
2358
|
+
"submit",
|
|
2359
|
+
(e) => {
|
|
2360
|
+
const form = e.target instanceof HTMLFormElement && e.target.matches("[data-asta-status-subscribe]") ? e.target : null;
|
|
2361
|
+
const input = form?.querySelector("input[type=email]");
|
|
2362
|
+
if (!input) return;
|
|
2363
|
+
if (!check(input)) {
|
|
2364
|
+
e.preventDefault();
|
|
2365
|
+
e.stopPropagation();
|
|
2366
|
+
input.focus();
|
|
2367
|
+
return;
|
|
2368
|
+
}
|
|
2369
|
+
const remote = form.hasAttribute("action") || [...form.attributes].some((a) => /^(hx|data-hx)-(post|put)$/.test(a.name));
|
|
2370
|
+
if (remote) return;
|
|
2371
|
+
e.preventDefault();
|
|
2372
|
+
const btn = form.querySelector("[type=submit]");
|
|
2373
|
+
const idle = btn?.textContent;
|
|
2374
|
+
if (btn) {
|
|
2375
|
+
btn.disabled = true;
|
|
2376
|
+
btn.setAttribute("aria-busy", "true");
|
|
2377
|
+
btn.textContent = btn.dataset.busy ?? "Subscribing…";
|
|
2378
|
+
}
|
|
2379
|
+
const email = input.value.trim();
|
|
2380
|
+
setTimeout(() => {
|
|
2381
|
+
if (btn) {
|
|
2382
|
+
btn.disabled = false;
|
|
2383
|
+
btn.removeAttribute("aria-busy");
|
|
2384
|
+
btn.textContent = idle;
|
|
2385
|
+
}
|
|
2386
|
+
const done = form.parentElement?.querySelector(".asta-status-page-done");
|
|
2387
|
+
if (done) {
|
|
2388
|
+
done.querySelectorAll("[data-slot=email]").forEach((n) => (n.textContent = email));
|
|
2389
|
+
form.hidden = true;
|
|
2390
|
+
done.hidden = false;
|
|
2391
|
+
}
|
|
2392
|
+
const live = form.parentElement?.querySelector("[data-asta-status-live]");
|
|
2393
|
+
if (live) live.textContent = `Subscribed. We sent a confirmation link to ${email}.`;
|
|
2394
|
+
form.dispatchEvent(new CustomEvent("asta:status-subscribe", { bubbles: true, detail: { email } }));
|
|
2395
|
+
}, 700);
|
|
2396
|
+
},
|
|
2397
|
+
true,
|
|
2398
|
+
);
|
|
2399
|
+
|
|
2400
|
+
document.addEventListener("click", (e) => {
|
|
2401
|
+
const again = sel(e, "[data-asta-status-again]");
|
|
2402
|
+
const done = again?.closest(".asta-status-page-done");
|
|
2403
|
+
const form = done?.parentElement?.querySelector("[data-asta-status-subscribe]");
|
|
2404
|
+
if (!form) return;
|
|
2405
|
+
done.hidden = true;
|
|
2406
|
+
form.hidden = false;
|
|
2407
|
+
form.reset();
|
|
2408
|
+
const input = form.querySelector("input[type=email]");
|
|
2409
|
+
if (input) {
|
|
2410
|
+
input.removeAttribute("aria-invalid");
|
|
2411
|
+
say(document.getElementById(input.getAttribute("aria-describedby")), "hint");
|
|
2412
|
+
requestAnimationFrame(() => input.focus());
|
|
2413
|
+
}
|
|
2414
|
+
});
|
|
2415
|
+
}
|
|
2416
|
+
|
|
2417
|
+
/* ---------- what's new ---------- */
|
|
2418
|
+
/* ---------- Changelog ----------
|
|
2419
|
+
* [data-asta-whats-new] (data-page-size): [data-asta-whats-new-tag] buttons and the [data-asta-whats-new-search]
|
|
2420
|
+
* field filter entries by data-tags and text. .asta-whats-new-more expands a long entry. .asta-whats-new-react
|
|
2421
|
+
* toggles a thumbs-up and fires "asta:whats-new-react" with detail.id and detail.reacted.
|
|
2422
|
+
* [data-asta-whats-new-read] clears data-unread and fires "asta:whats-new-read" with detail.ids.
|
|
2423
|
+
* [data-asta-whats-new-load] reveals the next li[data-later] entries, or fires "asta:whats-new-more" when none are
|
|
2424
|
+
* left (answer it with hx-get + hx-swap="beforeend" on the list).
|
|
2425
|
+
* [data-asta-whats-new-pop]: the .asta-whats-new-trigger opens the panel; Esc, an outside click or tabbing away
|
|
2426
|
+
* closes it and focus goes back to the trigger.
|
|
2427
|
+
* Uses near() and fire() from the top of this file. */
|
|
2428
|
+
|
|
2429
|
+
const clRoot = (e) => near(e, "[data-asta-whats-new]");
|
|
2430
|
+
const clFocus = (node) => node && requestAnimationFrame(() => node.focus());
|
|
2431
|
+
const clEntries = (root) => [...root.querySelectorAll(".asta-whats-new-entry")];
|
|
2432
|
+
|
|
2433
|
+
function clApply(root) {
|
|
2434
|
+
const tag = root.querySelector("[data-asta-whats-new-tag][aria-pressed=true]")?.dataset.astaChangelogTag ?? "all";
|
|
2435
|
+
const q = (root.querySelector("[data-asta-whats-new-search]")?.value ?? "").trim().toLowerCase();
|
|
2436
|
+
let shown = 0;
|
|
2437
|
+
for (const li of clEntries(root)) {
|
|
2438
|
+
const ok = (tag === "all" || (li.dataset.tags ?? "").split(" ").includes(tag)) && (!q || li.textContent.toLowerCase().includes(q));
|
|
2439
|
+
li.hidden = !ok || li.hasAttribute("data-later");
|
|
2440
|
+
if (ok) shown++;
|
|
2441
|
+
}
|
|
2442
|
+
const none = root.querySelector(".asta-whats-new-nomatch");
|
|
2443
|
+
if (none) {
|
|
2444
|
+
none.hidden = shown > 0;
|
|
2445
|
+
const text = none.querySelector("[data-slot=query]");
|
|
2446
|
+
if (text) text.textContent = q ? `No updates match “${q}”` : "No updates with this tag yet";
|
|
2447
|
+
}
|
|
2448
|
+
const load = root.querySelector(".asta-whats-new-loadmore");
|
|
2449
|
+
if (load) load.hidden = shown === 0 || ((tag !== "all" || q) && !clEntries(root).some((li) => li.hasAttribute("data-later")));
|
|
2450
|
+
const live = root.querySelector("[data-asta-whats-new-status]");
|
|
2451
|
+
if (live) live.textContent = `${shown} ${shown === 1 ? "update" : "updates"}`;
|
|
2452
|
+
}
|
|
2453
|
+
|
|
2454
|
+
// Marks read everywhere on the page, so a header popover and the full list stay in step.
|
|
2455
|
+
function clMarkRead(scope) {
|
|
2456
|
+
const all = [...document.querySelectorAll("[data-asta-whats-new], [data-asta-whats-new-pop]")];
|
|
2457
|
+
const items = [...scope.querySelectorAll("[data-unread]")];
|
|
2458
|
+
all.forEach((r) => {
|
|
2459
|
+
r.querySelectorAll("[data-unread]").forEach((n) => n.removeAttribute("data-unread"));
|
|
2460
|
+
r.querySelectorAll("[data-asta-whats-new-read], .asta-whats-new-count, .asta-whats-new-badge").forEach((n) => (n.hidden = true));
|
|
2461
|
+
});
|
|
2462
|
+
const live = scope.querySelector("[data-asta-whats-new-status]");
|
|
2463
|
+
if (live) live.textContent = `${items.length} ${items.length === 1 ? "update" : "updates"} marked as read.`;
|
|
2464
|
+
fire(scope, "asta:whats-new-read", { ids: items.map((n) => n.dataset.id).filter(Boolean) });
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
function clLoad(root, btn) {
|
|
2468
|
+
const size = Number(root.dataset.pageSize) || 4;
|
|
2469
|
+
const later = clEntries(root).filter((li) => li.hasAttribute("data-later")).slice(0, size);
|
|
2470
|
+
if (!later.length) return fire(root, "asta:whats-new-more", {});
|
|
2471
|
+
later.forEach((li) => li.removeAttribute("data-later"));
|
|
2472
|
+
clApply(root);
|
|
2473
|
+
clFocus(later.find((li) => !li.hidden)?.querySelector(".asta-whats-new-entry-title"));
|
|
2474
|
+
if (!clEntries(root).some((li) => li.hasAttribute("data-later")) && !btn.hasAttribute("hx-get")) btn.closest(".asta-whats-new-loadmore").hidden = true;
|
|
2475
|
+
}
|
|
2476
|
+
|
|
2477
|
+
function clPop(pop, open, focus = true) {
|
|
2478
|
+
const trigger = pop.querySelector(".asta-whats-new-trigger");
|
|
2479
|
+
const panel = pop.querySelector(".asta-whats-new-panel");
|
|
2480
|
+
if (!trigger || !panel || panel.hidden === !open) return;
|
|
2481
|
+
panel.hidden = !open;
|
|
2482
|
+
trigger.setAttribute("aria-expanded", String(open));
|
|
2483
|
+
if (open) clFocus(panel);
|
|
2484
|
+
else if (focus) clFocus(trigger);
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2487
|
+
document.addEventListener("click", (e) => {
|
|
2488
|
+
const pop = near(e, "[data-asta-whats-new-pop]");
|
|
2489
|
+
document.querySelectorAll("[data-asta-whats-new-pop]").forEach((p) => p !== pop && clPop(p, false, false));
|
|
2490
|
+
if (pop) {
|
|
2491
|
+
if (near(e, ".asta-whats-new-trigger")) clPop(pop, pop.querySelector(".asta-whats-new-panel")?.hidden ?? false);
|
|
2492
|
+
else if (near(e, "[data-asta-whats-new-read]")) {
|
|
2493
|
+
clMarkRead(pop);
|
|
2494
|
+
clFocus(pop.querySelector(".asta-whats-new-panel"));
|
|
2495
|
+
}
|
|
2496
|
+
return;
|
|
2497
|
+
}
|
|
2498
|
+
const root = clRoot(e);
|
|
2499
|
+
if (!root) return;
|
|
2500
|
+
const filter = near(e, "[data-asta-whats-new-tag]");
|
|
2501
|
+
const more = near(e, ".asta-whats-new-more");
|
|
2502
|
+
const react = near(e, ".asta-whats-new-react");
|
|
2503
|
+
if (filter) {
|
|
2504
|
+
root.querySelectorAll("[data-asta-whats-new-tag]").forEach((b) => b.setAttribute("aria-pressed", String(b === filter)));
|
|
2505
|
+
clApply(root);
|
|
2506
|
+
} else if (more) {
|
|
2507
|
+
const open = more.getAttribute("aria-expanded") !== "true";
|
|
2508
|
+
more.setAttribute("aria-expanded", String(open));
|
|
2509
|
+
const rest = document.getElementById(more.getAttribute("aria-controls"));
|
|
2510
|
+
if (rest) rest.hidden = !open;
|
|
2511
|
+
} else if (react) {
|
|
2512
|
+
const on = react.getAttribute("aria-pressed") !== "true";
|
|
2513
|
+
const n = react.querySelector("[data-slot=count]");
|
|
2514
|
+
const count = Math.max(0, Number(n?.textContent || 0) + (on ? 1 : -1));
|
|
2515
|
+
react.setAttribute("aria-pressed", String(on));
|
|
2516
|
+
if (n) n.textContent = String(count);
|
|
2517
|
+
react.setAttribute("aria-label", `Helpful, ${count} ${count === 1 ? "person" : "people"}`);
|
|
2518
|
+
fire(react, "asta:whats-new-react", { id: react.closest("[data-id]")?.dataset.id, reacted: on });
|
|
2519
|
+
} else if (near(e, "[data-asta-whats-new-read]")) {
|
|
2520
|
+
clMarkRead(root);
|
|
2521
|
+
clFocus(root.querySelector(".asta-whats-new-title"));
|
|
2522
|
+
} else if (near(e, "[data-asta-whats-new-clear]")) {
|
|
2523
|
+
root.querySelectorAll("[data-asta-whats-new-tag]").forEach((b) => b.setAttribute("aria-pressed", String(b.dataset.astaChangelogTag === "all")));
|
|
2524
|
+
const field = root.querySelector("[data-asta-whats-new-search]");
|
|
2525
|
+
if (field) field.value = "";
|
|
2526
|
+
clApply(root);
|
|
2527
|
+
clFocus(field);
|
|
2528
|
+
} else if (near(e, "[data-asta-whats-new-load]")) clLoad(root, near(e, "[data-asta-whats-new-load]"));
|
|
2529
|
+
});
|
|
2530
|
+
|
|
2531
|
+
document.addEventListener("input", (e) => {
|
|
2532
|
+
const root = clRoot(e);
|
|
2533
|
+
if (root && e.target.matches?.("[data-asta-whats-new-search]")) clApply(root);
|
|
2534
|
+
});
|
|
2535
|
+
|
|
2536
|
+
document.addEventListener("keydown", (e) => {
|
|
2537
|
+
if (e.key !== "Escape") return;
|
|
2538
|
+
const pop = near(e, "[data-asta-whats-new-pop]");
|
|
2539
|
+
if (pop && !pop.querySelector(".asta-whats-new-panel")?.hidden) {
|
|
2540
|
+
e.preventDefault();
|
|
2541
|
+
clPop(pop, false);
|
|
2542
|
+
return;
|
|
2543
|
+
}
|
|
2544
|
+
const field = near(e, "[data-asta-whats-new-search]");
|
|
2545
|
+
if (field?.value) {
|
|
2546
|
+
e.preventDefault();
|
|
2547
|
+
field.value = "";
|
|
2548
|
+
clApply(clRoot(e));
|
|
2549
|
+
}
|
|
2550
|
+
});
|
|
2551
|
+
|
|
2552
|
+
// Tabbing out of the popover closes it without pulling focus back.
|
|
2553
|
+
document.addEventListener("focusout", (e) => {
|
|
2554
|
+
const pop = near(e, "[data-asta-whats-new-pop]");
|
|
2555
|
+
if (pop && e.relatedTarget instanceof Node && !pop.contains(e.relatedTarget)) clPop(pop, false, false);
|
|
2556
|
+
});
|
|
2557
|
+
|
|
2558
|
+
/* ---------- cancel-flow ---------- */
|
|
2559
|
+
/* ---------- Cancel subscription ----------
|
|
2560
|
+
* [data-asta-cancel]: [data-asta-cancel-next] checks a reason is picked and shows the offer named by the radio's
|
|
2561
|
+
* data-offer. [data-asta-cancel-back|continue] move between steps. [data-asta-cancel-accept|confirm|resubscribe|export]
|
|
2562
|
+
* fire the cancelable "asta:cancel-accept", "asta:cancel", "asta:cancel-resubscribe" and "asta:cancel-export" with
|
|
2563
|
+
* detail.done(ok). Unhandled, the demo waits a moment and succeeds. [data-asta-cancel-keep] fires "asta:cancel-keep".
|
|
2564
|
+
* Uses near() and fire() from the shared helpers above. Block-scoped so its names stay local. */
|
|
2565
|
+
{
|
|
2566
|
+
const ORDER = ["reason", "offer", "confirm", "done"];
|
|
2567
|
+
const cfFocus = (node) => node && requestAnimationFrame(() => node.focus());
|
|
2568
|
+
const cfPanels = (root) => [...root.querySelectorAll(".asta-cancel-flow-panel")];
|
|
2569
|
+
const cfPanel = (root) => cfPanels(root).find((p) => !p.hidden);
|
|
2570
|
+
const cfSay = (root, text) => {
|
|
2571
|
+
const s = root.querySelector("[data-asta-cancel-status]");
|
|
2572
|
+
if (s) s.textContent = text;
|
|
2573
|
+
};
|
|
2574
|
+
|
|
2575
|
+
function cfChoice(root) {
|
|
2576
|
+
const r = root.querySelector("input[name=reason]:checked");
|
|
2577
|
+
const detail = root.querySelector(".asta-cancel-flow-other textarea")?.value.trim();
|
|
2578
|
+
const months = Number(root.querySelector("select[name=months]")?.value) || 1;
|
|
2579
|
+
return { reason: r?.value ?? "", offer: r?.dataset.offer ?? "talk", months, ...(r?.value === "other" && detail ? { detail } : {}) };
|
|
2580
|
+
}
|
|
2581
|
+
|
|
2582
|
+
// Show one panel, sync the step list and land focus on the new heading.
|
|
2583
|
+
function cfShow(root, name, dir = "next") {
|
|
2584
|
+
root.querySelector(".asta-cancel-flow-stage")?.setAttribute("data-dir", dir);
|
|
2585
|
+
cfPanels(root).forEach((p) => (p.hidden = p.dataset.panel !== name));
|
|
2586
|
+
const step = ORDER.includes(name) ? name : "done";
|
|
2587
|
+
const at = ORDER.indexOf(step);
|
|
2588
|
+
root.querySelectorAll(".asta-cancel-flow-steps > li").forEach((li, i) => {
|
|
2589
|
+
const state = i < at || (step === "done" && i === at) ? "done" : i === at ? "current" : "todo";
|
|
2590
|
+
li.dataset.state = state;
|
|
2591
|
+
if (i === at) li.setAttribute("aria-current", "step");
|
|
2592
|
+
else li.removeAttribute("aria-current");
|
|
2593
|
+
const sr = li.querySelector("[data-slot=state]");
|
|
2594
|
+
if (sr) sr.textContent = state === "done" ? ", completed" : state === "current" ? ", current step" : "";
|
|
2595
|
+
});
|
|
2596
|
+
root.querySelectorAll(".asta-cancel-flow-alert").forEach((a) => (a.hidden = true));
|
|
2597
|
+
cfFocus(cfPanel(root)?.querySelector(".asta-cancel-flow-heading"));
|
|
2598
|
+
}
|
|
2599
|
+
|
|
2600
|
+
// The offer panel shows the block for the picked reason and borrows its heading and accept label.
|
|
2601
|
+
function cfOffer(root) {
|
|
2602
|
+
const { offer } = cfChoice(root);
|
|
2603
|
+
const panel = root.querySelector('[data-panel="offer"]');
|
|
2604
|
+
if (!panel) return;
|
|
2605
|
+
let shown = null;
|
|
2606
|
+
panel.querySelectorAll("[data-offer-panel]").forEach((o) => {
|
|
2607
|
+
o.hidden = o.dataset.offerPanel !== offer;
|
|
2608
|
+
if (!o.hidden) shown = o;
|
|
2609
|
+
});
|
|
2610
|
+
const heading = panel.querySelector(".asta-cancel-flow-heading");
|
|
2611
|
+
if (shown && heading) heading.textContent = shown.dataset.title || heading.textContent;
|
|
2612
|
+
const label = panel.querySelector("[data-asta-cancel-accept] .asta-btn-label");
|
|
2613
|
+
if (shown && label) label.textContent = shown.dataset.accept || label.textContent;
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2616
|
+
function cfMsg(root, on) {
|
|
2617
|
+
const msg = root.querySelector(".asta-cancel-flow-msg");
|
|
2618
|
+
if (!msg) return;
|
|
2619
|
+
msg.toggleAttribute("data-error", on);
|
|
2620
|
+
const text = msg.querySelector("span:last-child");
|
|
2621
|
+
if (text) text.textContent = on ? msg.dataset.errorText : msg.dataset.hint;
|
|
2622
|
+
}
|
|
2623
|
+
|
|
2624
|
+
// Busy button, the rest of the panel disabled, then hand done(ok) to whoever handles the event.
|
|
2625
|
+
function cfRun(root, btn, name, then) {
|
|
2626
|
+
const panel = cfPanel(root);
|
|
2627
|
+
const buttons = [...(panel?.querySelectorAll("button") ?? [])];
|
|
2628
|
+
const alert = panel?.querySelector(".asta-cancel-flow-alert");
|
|
2629
|
+
if (alert) alert.hidden = true;
|
|
2630
|
+
btn.setAttribute("aria-busy", "true");
|
|
2631
|
+
buttons.forEach((b) => (b.disabled = true));
|
|
2632
|
+
let settled = false;
|
|
2633
|
+
const done = (ok) => {
|
|
2634
|
+
if (settled) return;
|
|
2635
|
+
settled = true;
|
|
2636
|
+
btn.removeAttribute("aria-busy");
|
|
2637
|
+
buttons.forEach((b) => (b.disabled = false));
|
|
2638
|
+
if (ok !== false) return then();
|
|
2639
|
+
if (alert) alert.hidden = false;
|
|
2640
|
+
cfFocus(btn);
|
|
2641
|
+
};
|
|
2642
|
+
const ev = new CustomEvent(name, { bubbles: true, cancelable: true, detail: { ...cfChoice(root), done } });
|
|
2643
|
+
root.dispatchEvent(ev);
|
|
2644
|
+
if (!ev.defaultPrevented) setTimeout(() => done(true), 800);
|
|
2645
|
+
}
|
|
2646
|
+
|
|
2647
|
+
document.addEventListener("click", (e) => {
|
|
2648
|
+
const root = near(e, "[data-asta-cancel]");
|
|
2649
|
+
if (!root) return;
|
|
2650
|
+
const btn = near(e, "button");
|
|
2651
|
+
if (!btn || btn.disabled) return;
|
|
2652
|
+
const at = cfPanel(root)?.dataset.panel;
|
|
2653
|
+
if (btn.matches("[data-asta-cancel-next]")) {
|
|
2654
|
+
if (!cfChoice(root).reason) {
|
|
2655
|
+
cfMsg(root, true);
|
|
2656
|
+
cfSay(root, "Pick a reason to continue.");
|
|
2657
|
+
root.querySelector("input[name=reason]")?.focus();
|
|
2658
|
+
return;
|
|
2659
|
+
}
|
|
2660
|
+
cfOffer(root);
|
|
2661
|
+
cfShow(root, "offer");
|
|
2662
|
+
} else if (btn.matches("[data-asta-cancel-back]")) cfShow(root, at === "confirm" ? "offer" : "reason", "back");
|
|
2663
|
+
else if (btn.matches("[data-asta-cancel-continue]")) cfShow(root, "confirm");
|
|
2664
|
+
else if (btn.matches("[data-asta-cancel-keep]")) fire(root, "asta:cancel-keep", cfChoice(root));
|
|
2665
|
+
else if (btn.matches("[data-asta-cancel-accept]"))
|
|
2666
|
+
cfRun(root, btn, "asta:cancel-accept", () => {
|
|
2667
|
+
const { offer, months } = cfChoice(root);
|
|
2668
|
+
root.querySelectorAll('[data-panel="kept-pause"] [data-slot=months]').forEach((n) => (n.textContent = `${months} ${months === 1 ? "month" : "months"}`));
|
|
2669
|
+
cfShow(root, `kept-${offer}`);
|
|
2670
|
+
});
|
|
2671
|
+
else if (btn.matches("[data-asta-cancel-confirm]")) cfRun(root, btn, "asta:cancel", () => cfShow(root, "done"));
|
|
2672
|
+
else if (btn.matches("[data-asta-cancel-resubscribe]")) cfRun(root, btn, "asta:cancel-resubscribe", () => cfShow(root, "back"));
|
|
2673
|
+
else if (btn.matches("[data-asta-cancel-export]"))
|
|
2674
|
+
cfRun(root, btn, "asta:cancel-export", () => {
|
|
2675
|
+
const label = btn.querySelector(".asta-btn-label");
|
|
2676
|
+
if (label && btn.dataset.doneLabel) label.textContent = btn.dataset.doneLabel;
|
|
2677
|
+
btn.disabled = true;
|
|
2678
|
+
const note = cfPanel(root)?.querySelector("small[data-done-text]");
|
|
2679
|
+
if (note) note.textContent = note.dataset.doneText;
|
|
2680
|
+
cfSay(root, "Export started. We'll email you a download link.");
|
|
2681
|
+
});
|
|
2682
|
+
});
|
|
2683
|
+
|
|
2684
|
+
// Picking a reason clears the error.
|
|
2685
|
+
document.addEventListener("change", (e) => {
|
|
2686
|
+
const root = near(e, "[data-asta-cancel]");
|
|
2687
|
+
if (root && e.target instanceof HTMLInputElement && e.target.name === "reason") cfMsg(root, false);
|
|
2688
|
+
});
|
|
2689
|
+
}
|
|
2690
|
+
})();
|