@masmarino/gabarit 2.0.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +131 -85
- package/accordion/README.md +56 -0
- package/alert/README.md +87 -0
- package/app-shell/README.md +133 -0
- package/auth/README.md +155 -0
- package/auth-activate/README.md +119 -0
- package/auth-login/README.md +113 -0
- package/auth-register/README.md +104 -0
- package/auth-reset-password/README.md +120 -0
- package/autocomplete/README.md +77 -0
- package/avatar/README.md +34 -0
- package/avatar-group/README.md +47 -0
- package/badge/README.md +177 -0
- package/bar-chart/README.md +44 -0
- package/breadcrumb/README.md +38 -0
- package/button/README.md +175 -0
- package/card/README.md +179 -0
- package/checkbox/README.md +50 -0
- package/checkbox-group/README.md +78 -0
- package/confirm-danger-modal/README.md +77 -0
- package/copy-button/README.md +90 -0
- package/copy-field/README.md +54 -0
- package/date-picker/README.md +84 -0
- package/description-list/README.md +63 -0
- package/dimension-card/README.md +39 -0
- package/disclosure/README.md +48 -0
- package/divider/README.md +31 -0
- package/drawer/README.md +49 -0
- package/empty-state/README.md +84 -0
- package/fesm2022/masmarino-gabarit-accordion.mjs +243 -0
- package/fesm2022/masmarino-gabarit-accordion.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-alert.mjs +208 -0
- package/fesm2022/masmarino-gabarit-alert.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-app-shell.mjs +378 -0
- package/fesm2022/masmarino-gabarit-app-shell.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth-activate.mjs +415 -0
- package/fesm2022/masmarino-gabarit-auth-activate.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth-login.mjs +467 -0
- package/fesm2022/masmarino-gabarit-auth-login.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth-register.mjs +457 -0
- package/fesm2022/masmarino-gabarit-auth-register.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth-reset-password.mjs +364 -0
- package/fesm2022/masmarino-gabarit-auth-reset-password.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth.mjs +844 -0
- package/fesm2022/masmarino-gabarit-auth.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-autocomplete.mjs +475 -0
- package/fesm2022/masmarino-gabarit-autocomplete.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-avatar-group.mjs +202 -0
- package/fesm2022/masmarino-gabarit-avatar-group.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-avatar.mjs +107 -0
- package/fesm2022/masmarino-gabarit-avatar.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-badge.mjs +449 -0
- package/fesm2022/masmarino-gabarit-badge.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-bar-chart.mjs +408 -0
- package/fesm2022/masmarino-gabarit-bar-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-breadcrumb.mjs +59 -0
- package/fesm2022/masmarino-gabarit-breadcrumb.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-button.mjs +374 -0
- package/fesm2022/masmarino-gabarit-button.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-card.mjs +400 -0
- package/fesm2022/masmarino-gabarit-card.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-chart.mjs +1289 -0
- package/fesm2022/masmarino-gabarit-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-checkbox-group.mjs +335 -0
- package/fesm2022/masmarino-gabarit-checkbox-group.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-checkbox.mjs +170 -0
- package/fesm2022/masmarino-gabarit-checkbox.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-confirm-danger-modal.mjs +387 -0
- package/fesm2022/masmarino-gabarit-confirm-danger-modal.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-copy-button.mjs +407 -0
- package/fesm2022/masmarino-gabarit-copy-button.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-copy-field.mjs +229 -0
- package/fesm2022/masmarino-gabarit-copy-field.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-date-picker.mjs +1242 -0
- package/fesm2022/masmarino-gabarit-date-picker.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-description-list.mjs +127 -0
- package/fesm2022/masmarino-gabarit-description-list.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-dimension-card.mjs +162 -0
- package/fesm2022/masmarino-gabarit-dimension-card.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-disclosure.mjs +154 -0
- package/fesm2022/masmarino-gabarit-disclosure.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-divider.mjs +90 -0
- package/fesm2022/masmarino-gabarit-divider.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-docs.mjs +16 -2
- package/fesm2022/masmarino-gabarit-docs.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-drawer.mjs +209 -0
- package/fesm2022/masmarino-gabarit-drawer.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-empty-state.mjs +226 -0
- package/fesm2022/masmarino-gabarit-empty-state.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-file-upload.mjs +335 -0
- package/fesm2022/masmarino-gabarit-file-upload.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-floating-panel.mjs +24 -0
- package/fesm2022/masmarino-gabarit-floating-panel.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-format.mjs +345 -0
- package/fesm2022/masmarino-gabarit-format.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-funnel-chart.mjs +247 -0
- package/fesm2022/masmarino-gabarit-funnel-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-gauge-bar.mjs +180 -0
- package/fesm2022/masmarino-gabarit-gauge-bar.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-git-field.mjs +127 -0
- package/fesm2022/masmarino-gabarit-git-field.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-icon-marker.mjs +150 -0
- package/fesm2022/masmarino-gabarit-icon-marker.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-icon.mjs +308 -0
- package/fesm2022/masmarino-gabarit-icon.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-input.mjs +493 -0
- package/fesm2022/masmarino-gabarit-input.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-job-graph.mjs +216 -0
- package/fesm2022/masmarino-gabarit-job-graph.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-job-status.mjs +104 -0
- package/fesm2022/masmarino-gabarit-job-status.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-line-chart.mjs +574 -0
- package/fesm2022/masmarino-gabarit-line-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-list-card.mjs +320 -0
- package/fesm2022/masmarino-gabarit-list-card.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-list-row.mjs +58 -0
- package/fesm2022/masmarino-gabarit-list-row.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-list-toolbar.mjs +369 -0
- package/fesm2022/masmarino-gabarit-list-toolbar.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-menu.mjs +464 -0
- package/fesm2022/masmarino-gabarit-menu.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs +897 -0
- package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-mfa-settings.mjs +629 -0
- package/fesm2022/masmarino-gabarit-mfa-settings.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-modal.mjs +260 -0
- package/fesm2022/masmarino-gabarit-modal.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-nav-tabs.mjs +332 -0
- package/fesm2022/masmarino-gabarit-nav-tabs.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-notification-dot.mjs +119 -0
- package/fesm2022/masmarino-gabarit-notification-dot.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-page-header.mjs +78 -0
- package/fesm2022/masmarino-gabarit-page-header.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-page-layout.mjs +157 -0
- package/fesm2022/masmarino-gabarit-page-layout.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-pagination.mjs +415 -0
- package/fesm2022/masmarino-gabarit-pagination.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-panel.mjs +80 -0
- package/fesm2022/masmarino-gabarit-panel.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-passkey-settings.mjs +606 -0
- package/fesm2022/masmarino-gabarit-passkey-settings.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-pie-chart.mjs +317 -0
- package/fesm2022/masmarino-gabarit-pie-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-popover.mjs +142 -0
- package/fesm2022/masmarino-gabarit-popover.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-radio-group.mjs +202 -0
- package/fesm2022/masmarino-gabarit-radio-group.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-save-status.mjs +142 -0
- package/fesm2022/masmarino-gabarit-save-status.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-search-bar.mjs +576 -0
- package/fesm2022/masmarino-gabarit-search-bar.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-secret-reveal.mjs +348 -0
- package/fesm2022/masmarino-gabarit-secret-reveal.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-segmented-control.mjs +272 -0
- package/fesm2022/masmarino-gabarit-segmented-control.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-select.mjs +512 -0
- package/fesm2022/masmarino-gabarit-select.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-skeleton-list.mjs +189 -0
- package/fesm2022/masmarino-gabarit-skeleton-list.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-skeleton.mjs +109 -0
- package/fesm2022/masmarino-gabarit-skeleton.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-slider.mjs +239 -0
- package/fesm2022/masmarino-gabarit-slider.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-sparkline.mjs +276 -0
- package/fesm2022/masmarino-gabarit-sparkline.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-spinner.mjs +86 -0
- package/fesm2022/masmarino-gabarit-spinner.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-stat-grid.mjs +139 -0
- package/fesm2022/masmarino-gabarit-stat-grid.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-stat-tile.mjs +312 -0
- package/fesm2022/masmarino-gabarit-stat-tile.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-stepper.mjs +219 -0
- package/fesm2022/masmarino-gabarit-stepper.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-switch.mjs +151 -0
- package/fesm2022/masmarino-gabarit-switch.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-table.mjs +206 -0
- package/fesm2022/masmarino-gabarit-table.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tabs.mjs +210 -0
- package/fesm2022/masmarino-gabarit-tabs.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tag-input.mjs +288 -0
- package/fesm2022/masmarino-gabarit-tag-input.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tag.mjs +155 -0
- package/fesm2022/masmarino-gabarit-tag.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-textarea.mjs +369 -0
- package/fesm2022/masmarino-gabarit-textarea.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-timeline-chart.mjs +521 -0
- package/fesm2022/masmarino-gabarit-timeline-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-toaster.mjs +220 -0
- package/fesm2022/masmarino-gabarit-toaster.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tooltip.mjs +185 -0
- package/fesm2022/masmarino-gabarit-tooltip.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tree.mjs +258 -0
- package/fesm2022/masmarino-gabarit-tree.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-user-chip.mjs +106 -0
- package/fesm2022/masmarino-gabarit-user-chip.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit.mjs +83 -24785
- package/fesm2022/masmarino-gabarit.mjs.map +1 -1
- package/file-upload/README.md +47 -0
- package/funnel-chart/README.md +39 -0
- package/gauge-bar/README.md +35 -0
- package/git-field/README.md +34 -0
- package/icon/README.md +52 -0
- package/icon-marker/README.md +37 -0
- package/input/README.md +120 -0
- package/job-graph/README.md +76 -0
- package/job-status/README.md +34 -0
- package/line-chart/README.md +52 -0
- package/list-card/README.md +144 -0
- package/list-row/README.md +72 -0
- package/list-toolbar/README.md +52 -0
- package/menu/README.md +90 -0
- package/mfa-enrollment/README.md +189 -0
- package/mfa-settings/README.md +154 -0
- package/modal/README.md +72 -0
- package/nav-tabs/README.md +106 -0
- package/notification-dot/README.md +43 -0
- package/package.json +329 -1
- package/page-header/README.md +56 -0
- package/page-layout/README.md +76 -0
- package/pagination/README.md +73 -0
- package/panel/README.md +56 -0
- package/passkey-settings/README.md +120 -0
- package/pie-chart/README.md +85 -0
- package/popover/README.md +62 -0
- package/radio-group/README.md +47 -0
- package/save-status/README.md +44 -0
- package/search-bar/README.md +84 -0
- package/secret-reveal/README.md +60 -0
- package/segmented-control/README.md +79 -0
- package/select/README.md +61 -0
- package/skeleton/README.md +49 -0
- package/skeleton-list/README.md +40 -0
- package/slider/README.md +44 -0
- package/sparkline/README.md +37 -0
- package/spinner/README.md +41 -0
- package/stat-grid/README.md +47 -0
- package/stat-tile/README.md +75 -0
- package/stepper/README.md +67 -0
- package/switch/README.md +51 -0
- package/table/README.md +75 -0
- package/tabs/README.md +34 -0
- package/tag/README.md +34 -0
- package/tag-input/README.md +45 -0
- package/textarea/README.md +76 -0
- package/timeline-chart/README.md +49 -0
- package/toaster/README.md +92 -0
- package/tooltip/README.md +50 -0
- package/tree/README.md +79 -0
- package/types/masmarino-gabarit-accordion.d.ts +54 -0
- package/types/masmarino-gabarit-alert.d.ts +65 -0
- package/types/masmarino-gabarit-app-shell.d.ts +102 -0
- package/types/masmarino-gabarit-auth-activate.d.ts +70 -0
- package/types/masmarino-gabarit-auth-login.d.ts +63 -0
- package/types/masmarino-gabarit-auth-register.d.ts +66 -0
- package/types/masmarino-gabarit-auth-reset-password.d.ts +53 -0
- package/types/masmarino-gabarit-auth.d.ts +543 -0
- package/types/masmarino-gabarit-autocomplete.d.ts +140 -0
- package/types/masmarino-gabarit-avatar-group.d.ts +60 -0
- package/types/masmarino-gabarit-avatar.d.ts +31 -0
- package/types/masmarino-gabarit-badge.d.ts +139 -0
- package/types/masmarino-gabarit-bar-chart.d.ts +111 -0
- package/types/masmarino-gabarit-breadcrumb.d.ts +12 -0
- package/types/masmarino-gabarit-button.d.ts +108 -0
- package/types/masmarino-gabarit-card.d.ts +102 -0
- package/types/masmarino-gabarit-chart.d.ts +361 -0
- package/types/masmarino-gabarit-checkbox-group.d.ts +113 -0
- package/types/masmarino-gabarit-checkbox.d.ts +49 -0
- package/types/masmarino-gabarit-confirm-danger-modal.d.ts +94 -0
- package/types/masmarino-gabarit-copy-button.d.ts +111 -0
- package/types/masmarino-gabarit-copy-field.d.ts +64 -0
- package/types/masmarino-gabarit-date-picker.d.ts +399 -0
- package/types/masmarino-gabarit-description-list.d.ts +40 -0
- package/types/masmarino-gabarit-dimension-card.d.ts +55 -0
- package/types/masmarino-gabarit-disclosure.d.ts +44 -0
- package/types/masmarino-gabarit-divider.d.ts +20 -0
- package/types/masmarino-gabarit-docs.d.ts +2 -1
- package/types/masmarino-gabarit-drawer.d.ts +51 -0
- package/types/masmarino-gabarit-empty-state.d.ts +67 -0
- package/types/masmarino-gabarit-file-upload.d.ts +95 -0
- package/types/masmarino-gabarit-floating-panel.d.ts +14 -0
- package/types/masmarino-gabarit-format.d.ts +54 -0
- package/types/masmarino-gabarit-funnel-chart.d.ts +78 -0
- package/types/masmarino-gabarit-gauge-bar.d.ts +54 -0
- package/types/masmarino-gabarit-git-field.d.ts +39 -0
- package/types/masmarino-gabarit-icon-marker.d.ts +47 -0
- package/types/masmarino-gabarit-icon.d.ts +23 -0
- package/types/masmarino-gabarit-input.d.ts +181 -0
- package/types/masmarino-gabarit-job-graph.d.ts +63 -0
- package/types/masmarino-gabarit-job-status.d.ts +20 -0
- package/types/masmarino-gabarit-line-chart.d.ts +153 -0
- package/types/masmarino-gabarit-list-card.d.ts +87 -0
- package/types/masmarino-gabarit-list-row.d.ts +14 -0
- package/types/masmarino-gabarit-list-toolbar.d.ts +100 -0
- package/types/masmarino-gabarit-menu.d.ts +93 -0
- package/types/masmarino-gabarit-mfa-enrollment.d.ts +142 -0
- package/types/masmarino-gabarit-mfa-settings.d.ts +89 -0
- package/types/masmarino-gabarit-modal.d.ts +60 -0
- package/types/masmarino-gabarit-nav-tabs.d.ts +65 -0
- package/types/masmarino-gabarit-notification-dot.d.ts +34 -0
- package/types/masmarino-gabarit-page-header.d.ts +20 -0
- package/types/masmarino-gabarit-page-layout.d.ts +46 -0
- package/types/masmarino-gabarit-pagination.d.ts +109 -0
- package/types/masmarino-gabarit-panel.d.ts +21 -0
- package/types/masmarino-gabarit-passkey-settings.d.ts +94 -0
- package/types/masmarino-gabarit-pie-chart.d.ts +94 -0
- package/types/masmarino-gabarit-popover.d.ts +33 -0
- package/types/masmarino-gabarit-radio-group.d.ts +66 -0
- package/types/masmarino-gabarit-save-status.d.ts +39 -0
- package/types/masmarino-gabarit-search-bar.d.ts +183 -0
- package/types/masmarino-gabarit-secret-reveal.d.ts +95 -0
- package/types/masmarino-gabarit-segmented-control.d.ts +76 -0
- package/types/masmarino-gabarit-select.d.ts +146 -0
- package/types/masmarino-gabarit-skeleton-list.d.ts +54 -0
- package/types/masmarino-gabarit-skeleton.d.ts +26 -0
- package/types/masmarino-gabarit-slider.d.ts +73 -0
- package/types/masmarino-gabarit-sparkline.d.ts +70 -0
- package/types/masmarino-gabarit-spinner.d.ts +20 -0
- package/types/masmarino-gabarit-stat-grid.d.ts +39 -0
- package/types/masmarino-gabarit-stat-tile.d.ts +79 -0
- package/types/masmarino-gabarit-stepper.d.ts +67 -0
- package/types/masmarino-gabarit-switch.d.ts +42 -0
- package/types/masmarino-gabarit-table.d.ts +60 -0
- package/types/masmarino-gabarit-tabs.d.ts +40 -0
- package/types/masmarino-gabarit-tag-input.d.ts +78 -0
- package/types/masmarino-gabarit-tag.d.ts +35 -0
- package/types/masmarino-gabarit-textarea.d.ts +109 -0
- package/types/masmarino-gabarit-timeline-chart.d.ts +145 -0
- package/types/masmarino-gabarit-toaster.d.ts +62 -0
- package/types/masmarino-gabarit-tooltip.d.ts +39 -0
- package/types/masmarino-gabarit-tree.d.ts +71 -0
- package/types/masmarino-gabarit-user-chip.d.ts +26 -0
- package/types/masmarino-gabarit.d.ts +83 -6599
- package/user-chip/README.md +42 -0
|
@@ -0,0 +1,629 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, Injector, computed, effect, inject, input, output, signal, untracked } from "@angular/core";
|
|
4
|
+
import * as i1 from "@angular/forms";
|
|
5
|
+
import { FormsModule } from "@angular/forms";
|
|
6
|
+
import { Badge } from "@masmarino/gabarit/badge";
|
|
7
|
+
import { Button } from "@masmarino/gabarit/button";
|
|
8
|
+
import { Icon } from "@masmarino/gabarit/icon";
|
|
9
|
+
import { GbtInput } from "@masmarino/gabarit/input";
|
|
10
|
+
import { Skeleton } from "@masmarino/gabarit/skeleton";
|
|
11
|
+
import { Alert } from "@masmarino/gabarit/alert";
|
|
12
|
+
import { Card } from "@masmarino/gabarit/card";
|
|
13
|
+
import { ConfirmDangerModal } from "@masmarino/gabarit/confirm-danger-modal";
|
|
14
|
+
import { DEFAULT_MFA_SETTINGS_LABELS, MFA_PORT, MfaSettingsState, authLabels, classifyMfaFailure, classifyPasswordFailure, focusAfterRender } from "@masmarino/gabarit/auth";
|
|
15
|
+
import { BackupCodes, TotpQr } from "@masmarino/gabarit/mfa-enrollment";
|
|
16
|
+
let nextId = 0;
|
|
17
|
+
var MfaSettings = class MfaSettings {
|
|
18
|
+
mfa = inject(MFA_PORT);
|
|
19
|
+
state = inject(MfaSettingsState);
|
|
20
|
+
host = inject(ElementRef);
|
|
21
|
+
injector = inject(Injector);
|
|
22
|
+
labels = input({}, ...ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []);
|
|
23
|
+
lowCodesThreshold = input(3, ...ngDevMode ? [{ debugName: "lowCodesThreshold" }] : /* istanbul ignore next */ []);
|
|
24
|
+
sessionRevoked = output();
|
|
25
|
+
text = authLabels("mfaSettings", DEFAULT_MFA_SETTINGS_LABELS, this.labels);
|
|
26
|
+
id = `gbt-mfa-settings-${nextId++}`;
|
|
27
|
+
view = signal("loading", ...ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []);
|
|
28
|
+
status = signal({
|
|
29
|
+
totpEnabled: false,
|
|
30
|
+
backupCodesRemaining: 0,
|
|
31
|
+
passkeys: []
|
|
32
|
+
}, ...ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []);
|
|
33
|
+
prompt = signal(null, ...ngDevMode ? [{ debugName: "prompt" }] : /* istanbul ignore next */ []);
|
|
34
|
+
password = signal("", ...ngDevMode ? [{ debugName: "password" }] : /* istanbul ignore next */ []);
|
|
35
|
+
passwordError = signal(null, ...ngDevMode ? [{ debugName: "passwordError" }] : /* istanbul ignore next */ []);
|
|
36
|
+
notice = signal("", ...ngDevMode ? [{ debugName: "notice" }] : /* istanbul ignore next */ []);
|
|
37
|
+
secret = signal("", ...ngDevMode ? [{ debugName: "secret" }] : /* istanbul ignore next */ []);
|
|
38
|
+
otpauthUrl = signal("", ...ngDevMode ? [{ debugName: "otpauthUrl" }] : /* istanbul ignore next */ []);
|
|
39
|
+
code = signal("", ...ngDevMode ? [{ debugName: "code" }] : /* istanbul ignore next */ []);
|
|
40
|
+
codeError = signal(null, ...ngDevMode ? [{ debugName: "codeError" }] : /* istanbul ignore next */ []);
|
|
41
|
+
backupCodes = signal([], ...ngDevMode ? [{ debugName: "backupCodes" }] : /* istanbul ignore next */ []);
|
|
42
|
+
codesOrigin = signal("enrolled", ...ngDevMode ? [{ debugName: "codesOrigin" }] : /* istanbul ignore next */ []);
|
|
43
|
+
acknowledged = signal(false, ...ngDevMode ? [{ debugName: "acknowledged" }] : /* istanbul ignore next */ []);
|
|
44
|
+
busy = signal(false, ...ngDevMode ? [{ debugName: "busy" }] : /* istanbul ignore next */ []);
|
|
45
|
+
confirmingDisable = signal(false, ...ngDevMode ? [{ debugName: "confirmingDisable" }] : /* istanbul ignore next */ []);
|
|
46
|
+
hasPasskey = computed(() => (this.state.passkeyCount() ?? this.status().passkeys.length) > 0, ...ngDevMode ? [{ debugName: "hasPasskey" }] : /* istanbul ignore next */ []);
|
|
47
|
+
hasFactor = computed(() => this.status().totpEnabled || this.hasPasskey(), ...ngDevMode ? [{ debugName: "hasFactor" }] : /* istanbul ignore next */ []);
|
|
48
|
+
removal = computed(() => {
|
|
49
|
+
const text = this.text();
|
|
50
|
+
return this.hasPasskey() ? {
|
|
51
|
+
title: text.removeTitle,
|
|
52
|
+
help: text.removeHelp,
|
|
53
|
+
action: text.removeAction,
|
|
54
|
+
dialogHeading: text.removeDialogHeading,
|
|
55
|
+
dialogMessage: text.removeDialogMessage,
|
|
56
|
+
promptLead: text.removePromptLead,
|
|
57
|
+
busy: text.removeBusy
|
|
58
|
+
} : {
|
|
59
|
+
title: text.resetTitle,
|
|
60
|
+
help: text.resetHelp,
|
|
61
|
+
action: text.resetAction,
|
|
62
|
+
dialogHeading: text.resetDialogHeading,
|
|
63
|
+
dialogMessage: text.resetDialogMessage,
|
|
64
|
+
promptLead: text.resetPromptLead,
|
|
65
|
+
busy: text.resetBusy
|
|
66
|
+
};
|
|
67
|
+
}, ...ngDevMode ? [{ debugName: "removal" }] : /* istanbul ignore next */ []);
|
|
68
|
+
lowCodes = computed(() => this.status().backupCodesRemaining <= this.lowCodesThreshold(), ...ngDevMode ? [{ debugName: "lowCodes" }] : /* istanbul ignore next */ []);
|
|
69
|
+
codesLeft = computed(() => this.text().codesLeft(this.status().backupCodesRemaining), ...ngDevMode ? [{ debugName: "codesLeft" }] : /* istanbul ignore next */ []);
|
|
70
|
+
promptCopy = computed(() => this.copyOf(this.prompt() ?? "enroll"), ...ngDevMode ? [{ debugName: "promptCopy" }] : /* istanbul ignore next */ []);
|
|
71
|
+
heading = computed(() => {
|
|
72
|
+
switch (this.view()) {
|
|
73
|
+
case "enrolling": return this.text().enrollingHeading;
|
|
74
|
+
case "codes": return this.text().codesHeading;
|
|
75
|
+
default: return this.text().heading;
|
|
76
|
+
}
|
|
77
|
+
}, ...ngDevMode ? [{ debugName: "heading" }] : /* istanbul ignore next */ []);
|
|
78
|
+
help = computed(() => this.view() === "codes" ? this.text().codesHelp : this.text().help, ...ngDevMode ? [{ debugName: "help" }] : /* istanbul ignore next */ []);
|
|
79
|
+
constructor() {
|
|
80
|
+
this.load();
|
|
81
|
+
effect(() => {
|
|
82
|
+
if (this.state.formOwner() === "passkeys") untracked(() => {
|
|
83
|
+
if (this.prompt() !== null) {
|
|
84
|
+
this.resetPrompt();
|
|
85
|
+
this.prompt.set(null);
|
|
86
|
+
this.confirmingDisable.set(false);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
effect(() => this.state.setAppFlowActive(this.view() === "enrolling" || this.view() === "codes"));
|
|
91
|
+
effect((onCleanup) => {
|
|
92
|
+
if (this.view() === "codes" && !this.acknowledged()) {
|
|
93
|
+
const view = this.host.nativeElement.ownerDocument.defaultView;
|
|
94
|
+
const warn = (event) => {
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
event.returnValue = "";
|
|
97
|
+
};
|
|
98
|
+
view?.addEventListener("beforeunload", warn);
|
|
99
|
+
onCleanup(() => view?.removeEventListener("beforeunload", warn));
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
inject(DestroyRef).onDestroy(() => {
|
|
103
|
+
this.state.setAppFlowActive(false);
|
|
104
|
+
this.password.set("");
|
|
105
|
+
this.code.set("");
|
|
106
|
+
this.secret.set("");
|
|
107
|
+
this.otpauthUrl.set("");
|
|
108
|
+
this.backupCodes.set([]);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
load() {
|
|
112
|
+
this.view.set("loading");
|
|
113
|
+
this.mfa.status().subscribe({
|
|
114
|
+
next: (status) => {
|
|
115
|
+
this.state.statusLoaded(status);
|
|
116
|
+
this.status.set(status);
|
|
117
|
+
this.view.set("ready");
|
|
118
|
+
},
|
|
119
|
+
error: () => this.view.set("failed")
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
copyOf(prompt) {
|
|
123
|
+
const text = this.text();
|
|
124
|
+
switch (prompt) {
|
|
125
|
+
case "enroll": return {
|
|
126
|
+
lead: text.enrollLead,
|
|
127
|
+
submit: text.enrollSubmit,
|
|
128
|
+
busy: text.enrollBusy,
|
|
129
|
+
variant: "primary",
|
|
130
|
+
failed: text.enrollFailed
|
|
131
|
+
};
|
|
132
|
+
case "regenerate": return {
|
|
133
|
+
lead: text.regenerateLead,
|
|
134
|
+
submit: text.regenerateSubmit,
|
|
135
|
+
busy: text.regenerateBusy,
|
|
136
|
+
variant: "primary",
|
|
137
|
+
failed: text.regenerateFailed
|
|
138
|
+
};
|
|
139
|
+
case "disable": return {
|
|
140
|
+
lead: this.removal().promptLead,
|
|
141
|
+
submit: text.disableSubmit,
|
|
142
|
+
busy: text.disableCheckBusy,
|
|
143
|
+
variant: "secondary",
|
|
144
|
+
failed: text.disableFailed
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
openPrompt(prompt) {
|
|
149
|
+
this.state.claimForm("app");
|
|
150
|
+
this.resetPrompt();
|
|
151
|
+
this.prompt.set(prompt);
|
|
152
|
+
this.focus(`#${this.id}-password`);
|
|
153
|
+
}
|
|
154
|
+
cancelPrompt() {
|
|
155
|
+
const prompt = this.prompt();
|
|
156
|
+
this.resetPrompt();
|
|
157
|
+
this.prompt.set(null);
|
|
158
|
+
if (prompt) this.focus(`[data-opener="${prompt}"] button`);
|
|
159
|
+
}
|
|
160
|
+
setPassword(value) {
|
|
161
|
+
this.password.set(value);
|
|
162
|
+
this.passwordError.set(null);
|
|
163
|
+
this.notice.set("");
|
|
164
|
+
}
|
|
165
|
+
submitPrompt() {
|
|
166
|
+
const prompt = this.prompt();
|
|
167
|
+
if (this.busy() || !prompt) return;
|
|
168
|
+
if (this.password() === "") {
|
|
169
|
+
this.passwordError.set(this.text().enterPassword);
|
|
170
|
+
this.focus(`#${this.id}-password`);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
this.passwordError.set(null);
|
|
174
|
+
this.notice.set("");
|
|
175
|
+
switch (prompt) {
|
|
176
|
+
case "enroll": return this.enroll();
|
|
177
|
+
case "regenerate": return this.regenerate();
|
|
178
|
+
case "disable":
|
|
179
|
+
this.confirmingDisable.set(true);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
enroll() {
|
|
184
|
+
this.busy.set(true);
|
|
185
|
+
this.mfa.enroll(this.password()).subscribe({
|
|
186
|
+
next: ({ secret, otpauthUrl }) => {
|
|
187
|
+
this.busy.set(false);
|
|
188
|
+
this.resetPrompt();
|
|
189
|
+
this.prompt.set(null);
|
|
190
|
+
this.secret.set(secret);
|
|
191
|
+
this.otpauthUrl.set(otpauthUrl);
|
|
192
|
+
this.view.set("enrolling");
|
|
193
|
+
this.focus("[data-mfa-anchor]");
|
|
194
|
+
},
|
|
195
|
+
error: (err) => this.promptFailed(err)
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
regenerate() {
|
|
199
|
+
this.busy.set(true);
|
|
200
|
+
this.mfa.regenerate(this.password()).subscribe({
|
|
201
|
+
next: ({ backupCodes }) => {
|
|
202
|
+
this.busy.set(false);
|
|
203
|
+
this.resetPrompt();
|
|
204
|
+
this.prompt.set(null);
|
|
205
|
+
this.showCodes(backupCodes, "regenerated");
|
|
206
|
+
},
|
|
207
|
+
error: (err) => this.promptFailed(err)
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
disable() {
|
|
211
|
+
if (this.busy()) return;
|
|
212
|
+
this.busy.set(true);
|
|
213
|
+
this.mfa.disable(this.password()).subscribe({
|
|
214
|
+
next: () => {
|
|
215
|
+
this.busy.set(false);
|
|
216
|
+
this.confirmingDisable.set(false);
|
|
217
|
+
this.resetPrompt();
|
|
218
|
+
this.prompt.set(null);
|
|
219
|
+
this.status.update((status) => ({
|
|
220
|
+
...status,
|
|
221
|
+
totpEnabled: false
|
|
222
|
+
}));
|
|
223
|
+
this.view.set("revoked");
|
|
224
|
+
this.focus("[data-mfa-anchor]");
|
|
225
|
+
this.sessionRevoked.emit();
|
|
226
|
+
},
|
|
227
|
+
error: (err) => {
|
|
228
|
+
this.confirmingDisable.set(false);
|
|
229
|
+
this.promptFailed(err);
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
closeDisableDialog() {
|
|
234
|
+
if (!this.busy()) {
|
|
235
|
+
this.confirmingDisable.set(false);
|
|
236
|
+
this.focus(`#${this.id}-password`);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
promptFailed(err) {
|
|
240
|
+
this.busy.set(false);
|
|
241
|
+
switch (classifyPasswordFailure(err)) {
|
|
242
|
+
case "wrong-password":
|
|
243
|
+
this.passwordError.set(this.text().wrongPassword);
|
|
244
|
+
break;
|
|
245
|
+
case "rate-limited":
|
|
246
|
+
this.notice.set(this.text().tooManyAttempts);
|
|
247
|
+
break;
|
|
248
|
+
default: this.notice.set(this.copyOf(this.prompt() ?? "enroll").failed);
|
|
249
|
+
}
|
|
250
|
+
this.focus(`#${this.id}-password`);
|
|
251
|
+
}
|
|
252
|
+
resetPrompt() {
|
|
253
|
+
this.password.set("");
|
|
254
|
+
this.passwordError.set(null);
|
|
255
|
+
this.notice.set("");
|
|
256
|
+
}
|
|
257
|
+
activate() {
|
|
258
|
+
if (this.busy()) return;
|
|
259
|
+
const code = this.code().replace(/\s+/g, "");
|
|
260
|
+
if (code === "") {
|
|
261
|
+
this.codeError.set(this.text().enterCode);
|
|
262
|
+
this.focus(`#${this.id}-code`);
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
this.codeError.set(null);
|
|
266
|
+
this.notice.set("");
|
|
267
|
+
this.busy.set(true);
|
|
268
|
+
this.mfa.confirm(code).subscribe({
|
|
269
|
+
next: ({ backupCodes }) => {
|
|
270
|
+
this.busy.set(false);
|
|
271
|
+
this.state.totpConfirmed();
|
|
272
|
+
this.secret.set("");
|
|
273
|
+
this.otpauthUrl.set("");
|
|
274
|
+
this.code.set("");
|
|
275
|
+
this.showCodes(backupCodes, "enrolled");
|
|
276
|
+
},
|
|
277
|
+
error: (err) => {
|
|
278
|
+
this.busy.set(false);
|
|
279
|
+
switch (classifyMfaFailure(err)) {
|
|
280
|
+
case "wrong-code":
|
|
281
|
+
this.codeError.set(this.text().wrongCode);
|
|
282
|
+
this.code.set("");
|
|
283
|
+
break;
|
|
284
|
+
case "rate-limited":
|
|
285
|
+
this.notice.set(this.text().tooManyAttempts);
|
|
286
|
+
break;
|
|
287
|
+
default: this.notice.set(this.text().activationFailed);
|
|
288
|
+
}
|
|
289
|
+
this.focus(`#${this.id}-code`);
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
setCode(value) {
|
|
294
|
+
this.code.set(value);
|
|
295
|
+
this.codeError.set(null);
|
|
296
|
+
this.notice.set("");
|
|
297
|
+
}
|
|
298
|
+
cancelEnrollment() {
|
|
299
|
+
this.secret.set("");
|
|
300
|
+
this.otpauthUrl.set("");
|
|
301
|
+
this.code.set("");
|
|
302
|
+
this.codeError.set(null);
|
|
303
|
+
this.notice.set("");
|
|
304
|
+
this.view.set("ready");
|
|
305
|
+
this.focus("[data-opener=\"enroll\"] button");
|
|
306
|
+
}
|
|
307
|
+
showCodes(codes, origin) {
|
|
308
|
+
this.backupCodes.set(codes);
|
|
309
|
+
this.codesOrigin.set(origin);
|
|
310
|
+
this.acknowledged.set(false);
|
|
311
|
+
this.view.set("codes");
|
|
312
|
+
this.focus("[data-mfa-anchor]");
|
|
313
|
+
}
|
|
314
|
+
finishCodes() {
|
|
315
|
+
if (!this.acknowledged()) return;
|
|
316
|
+
this.status.update((status) => ({
|
|
317
|
+
...status,
|
|
318
|
+
totpEnabled: status.totpEnabled || this.codesOrigin() === "enrolled",
|
|
319
|
+
backupCodesRemaining: this.backupCodes().length
|
|
320
|
+
}));
|
|
321
|
+
this.backupCodes.set([]);
|
|
322
|
+
this.acknowledged.set(false);
|
|
323
|
+
this.view.set("ready");
|
|
324
|
+
this.focus("[data-mfa-anchor]");
|
|
325
|
+
}
|
|
326
|
+
focus(selector) {
|
|
327
|
+
focusAfterRender(this.host, this.injector, selector);
|
|
328
|
+
}
|
|
329
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
330
|
+
minVersion: "12.0.0",
|
|
331
|
+
version: "22.2.0",
|
|
332
|
+
ngImport: i0,
|
|
333
|
+
type: MfaSettings,
|
|
334
|
+
deps: [],
|
|
335
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
336
|
+
});
|
|
337
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
338
|
+
minVersion: "17.0.0",
|
|
339
|
+
version: "22.2.0",
|
|
340
|
+
type: MfaSettings,
|
|
341
|
+
isStandalone: true,
|
|
342
|
+
selector: "gbt-mfa-settings",
|
|
343
|
+
inputs: {
|
|
344
|
+
labels: {
|
|
345
|
+
classPropertyName: "labels",
|
|
346
|
+
publicName: "labels",
|
|
347
|
+
isSignal: true,
|
|
348
|
+
isRequired: false,
|
|
349
|
+
transformFunction: null
|
|
350
|
+
},
|
|
351
|
+
lowCodesThreshold: {
|
|
352
|
+
classPropertyName: "lowCodesThreshold",
|
|
353
|
+
publicName: "lowCodesThreshold",
|
|
354
|
+
isSignal: true,
|
|
355
|
+
isRequired: false,
|
|
356
|
+
transformFunction: null
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
outputs: { sessionRevoked: "sessionRevoked" },
|
|
360
|
+
ngImport: i0,
|
|
361
|
+
template: "<gbt-card\n variant=\"outlined\"\n [icon]=\"view() === 'ready' && !hasFactor() ? 'shield-alert' : 'shield-check'\"\n [heading]=\"heading()\"\n [description]=\"help()\"\n>\n @switch (view()) {\n @case ('loading') {\n <span class=\"sr-only\" role=\"status\">{{ text().loading }}</span>\n <div class=\"gbt-mfa-settings__loading\" aria-busy=\"true\">\n <div class=\"gbt-mfa-settings__skeleton-row\" aria-hidden=\"true\">\n <div class=\"gbt-mfa-settings__skeleton-lines\">\n <gbt-skeleton width=\"9rem\" height=\"0.875rem\" />\n <gbt-skeleton width=\"min(20rem, 100%)\" height=\"0.75rem\" />\n </div>\n <gbt-skeleton width=\"4.5rem\" height=\"1.375rem\" variant=\"rect\" />\n </div>\n <div class=\"gbt-mfa-settings__skeleton-row\" aria-hidden=\"true\">\n <div class=\"gbt-mfa-settings__skeleton-lines\">\n <gbt-skeleton width=\"7rem\" height=\"0.875rem\" />\n <gbt-skeleton width=\"min(16rem, 100%)\" height=\"0.75rem\" />\n </div>\n <gbt-skeleton width=\"11rem\" height=\"2.25rem\" variant=\"rect\" />\n </div>\n </div>\n }\n\n @case ('failed') {\n <gbt-alert variant=\"error\" appearance=\"subtle\">\n {{ text().loadFailed }}\n <gbt-button\n alert-actions\n variant=\"secondary\"\n size=\"small\"\n [text]=\"text().retry\"\n (clicked)=\"load()\"\n />\n </gbt-alert>\n }\n\n @case ('revoked') {\n <div class=\"gbt-mfa-settings__anchor\" data-mfa-anchor tabindex=\"-1\">\n <gbt-alert variant=\"info\" appearance=\"subtle\" iconAlign=\"start\" live=\"off\">{{\n text().signedOut\n }}</gbt-alert>\n </div>\n }\n\n @case ('enrolling') {\n <form ngNoForm class=\"gbt-mfa-settings__scan\" (submit)=\"$event.preventDefault(); activate()\">\n <p class=\"gbt-mfa-settings__lead\" data-mfa-anchor tabindex=\"-1\">{{ text().scanLead }}</p>\n\n <div class=\"gbt-mfa-settings__scan-grid\">\n <gbt-totp-qr\n class=\"gbt-mfa-settings__qr\"\n [otpauthUrl]=\"otpauthUrl()\"\n [secret]=\"secret()\"\n />\n\n <div class=\"gbt-mfa-settings__scan-side\">\n @if (notice()) {\n <gbt-alert variant=\"error\" appearance=\"subtle\" iconAlign=\"start\">{{\n notice()\n }}</gbt-alert>\n }\n\n <gbt-input\n [id]=\"id + '-code'\"\n inputmode=\"numeric\"\n [spellcheck]=\"false\"\n autocapitalize=\"off\"\n enterkeyhint=\"go\"\n name=\"code\"\n autocomplete=\"one-time-code\"\n [label]=\"text().codeLabel\"\n [errorMessage]=\"codeError()\"\n [ngModel]=\"code()\"\n (ngModelChange)=\"setCode($event)\"\n />\n\n <div class=\"gbt-mfa-settings__actions\">\n <gbt-button\n type=\"submit\"\n [text]=\"text().activate\"\n [loading]=\"busy()\"\n [loadingLabel]=\"text().verifying\"\n />\n <gbt-button\n variant=\"secondary\"\n [text]=\"text().cancel\"\n [disabled]=\"busy()\"\n (clicked)=\"cancelEnrollment()\"\n />\n </div>\n </div>\n </div>\n </form>\n }\n\n @case ('codes') {\n <div class=\"gbt-mfa-settings__stack\">\n <p class=\"gbt-mfa-settings__lead\" data-mfa-anchor tabindex=\"-1\">\n {{\n codesOrigin() === 'enrolled' ? text().codesLeadEnrolled : text().codesLeadRegenerated\n }}\n </p>\n @if (!acknowledged()) {\n <gbt-alert variant=\"warning\" appearance=\"subtle\" iconAlign=\"start\" live=\"off\">{{\n text().dontLeave\n }}</gbt-alert>\n }\n <div class=\"gbt-mfa-settings__codes\">\n <gbt-backup-codes [codes]=\"backupCodes()\" [(acknowledged)]=\"acknowledged\" />\n </div>\n <div class=\"gbt-mfa-settings__actions\">\n <gbt-button [text]=\"text().done\" [disabled]=\"!acknowledged()\" (clicked)=\"finishCodes()\" />\n </div>\n </div>\n }\n\n @default {\n @if (hasFactor()) {\n <div class=\"gbt-mfa-settings__rows\">\n <div class=\"gbt-mfa-settings__row\">\n <div class=\"gbt-mfa-settings__row-head\" data-mfa-anchor tabindex=\"-1\">\n @if (status().totpEnabled) {\n <div class=\"gbt-mfa-settings__row-text\">\n <div class=\"gbt-mfa-settings__title-line\">\n <p class=\"gbt-mfa-settings__row-title\">{{ text().appConfigured }}</p>\n <gbt-badge\n class=\"gbt-mfa-settings__badge\"\n variant=\"success\"\n icon=\"check-circle\"\n >{{ text().enabled }}</gbt-badge\n >\n </div>\n <p class=\"gbt-mfa-settings__row-help\">\n {{ hasPasskey() ? text().appHelpWithPasskey : text().appHelp }}\n </p>\n </div>\n } @else {\n <div class=\"gbt-mfa-settings__row-text\">\n <div class=\"gbt-mfa-settings__title-line\">\n <p class=\"gbt-mfa-settings__row-title\">{{ text().noApp }}</p>\n <gbt-badge class=\"gbt-mfa-settings__badge\" variant=\"neutral\">{{\n text().optional\n }}</gbt-badge>\n </div>\n <p class=\"gbt-mfa-settings__row-help\">{{ text().noAppHelp }}</p>\n </div>\n @if (prompt() !== 'enroll') {\n <gbt-button\n class=\"gbt-mfa-settings__row-action\"\n data-opener=\"enroll\"\n variant=\"secondary\"\n iconName=\"plus\"\n [text]=\"text().addApp\"\n (clicked)=\"openPrompt('enroll')\"\n />\n }\n }\n </div>\n @if (!status().totpEnabled && prompt() === 'enroll') {\n <ng-container [ngTemplateOutlet]=\"passwordPrompt\" />\n }\n </div>\n\n <div class=\"gbt-mfa-settings__row\">\n <div class=\"gbt-mfa-settings__row-head\">\n <div class=\"gbt-mfa-settings__row-text\">\n <p class=\"gbt-mfa-settings__row-title\">{{ text().backupCodesTitle }}</p>\n <p\n class=\"gbt-mfa-settings__codes-left\"\n [attr.data-tone]=\"lowCodes() ? 'warning' : null\"\n >\n @if (lowCodes()) {\n <gbt-icon name=\"alert-triangle\" aria-hidden=\"true\" />\n }\n <span>{{ codesLeft() }}.</span>\n @if (lowCodes()) {\n <span>{{ text().lowCodes }}</span>\n }\n </p>\n <p class=\"gbt-mfa-settings__row-help\">{{ text().backupCodesHelp }}</p>\n </div>\n @if (prompt() !== 'regenerate') {\n <gbt-button\n class=\"gbt-mfa-settings__row-action\"\n data-opener=\"regenerate\"\n variant=\"secondary\"\n iconName=\"refresh-cw\"\n [text]=\"text().regenerateCodes\"\n (clicked)=\"openPrompt('regenerate')\"\n />\n }\n </div>\n @if (prompt() === 'regenerate') {\n <ng-container [ngTemplateOutlet]=\"passwordPrompt\" />\n }\n </div>\n\n @if (status().totpEnabled) {\n <div class=\"gbt-mfa-settings__row\">\n <div class=\"gbt-mfa-settings__row-head\">\n <div class=\"gbt-mfa-settings__row-text\">\n <p class=\"gbt-mfa-settings__row-title\">{{ removal().title }}</p>\n <p class=\"gbt-mfa-settings__row-help\">{{ removal().help }}</p>\n </div>\n @if (prompt() !== 'disable') {\n <gbt-button\n class=\"gbt-mfa-settings__row-action gbt-mfa-settings__row-action--remove\"\n data-opener=\"disable\"\n variant=\"secondary\"\n [text]=\"removal().action\"\n (clicked)=\"openPrompt('disable')\"\n />\n }\n </div>\n @if (prompt() === 'disable') {\n <ng-container [ngTemplateOutlet]=\"passwordPrompt\" />\n }\n </div>\n }\n </div>\n } @else {\n <div class=\"gbt-mfa-settings__stack\">\n <div class=\"gbt-mfa-settings__anchor\" data-mfa-anchor tabindex=\"-1\">\n <gbt-alert variant=\"warning\" appearance=\"subtle\" iconAlign=\"start\" live=\"off\">{{\n text().noFactorWarning\n }}</gbt-alert>\n </div>\n @if (prompt() === 'enroll') {\n <ng-container [ngTemplateOutlet]=\"passwordPrompt\" />\n } @else {\n <div class=\"gbt-mfa-settings__actions\">\n <gbt-button\n data-opener=\"enroll\"\n iconName=\"shield-check\"\n [text]=\"text().setUpNow\"\n (clicked)=\"openPrompt('enroll')\"\n />\n </div>\n }\n </div>\n }\n }\n }\n</gbt-card>\n\n@if (confirmingDisable()) {\n <gbt-confirm-danger-modal\n [isOpen]=\"true\"\n [heading]=\"removal().dialogHeading\"\n [message]=\"removal().dialogMessage\"\n [confirmLabel]=\"removal().action\"\n confirmIcon=\"trash-2\"\n [cancelLabel]=\"text().cancel\"\n [closeLabel]=\"text().close\"\n [busyLabel]=\"removal().busy\"\n [busy]=\"busy()\"\n (confirmed)=\"disable()\"\n (closed)=\"closeDisableDialog()\"\n />\n}\n\n<ng-template #passwordPrompt>\n <form\n ngNoForm\n class=\"gbt-mfa-settings__prompt\"\n (submit)=\"$event.preventDefault(); submitPrompt()\"\n >\n <p class=\"gbt-mfa-settings__prompt-lead\">{{ promptCopy().lead }}</p>\n\n @if (notice()) {\n <gbt-alert variant=\"error\" appearance=\"subtle\" iconAlign=\"start\">{{ notice() }}</gbt-alert>\n }\n\n <div class=\"gbt-mfa-settings__field\">\n <gbt-input\n [id]=\"id + '-password'\"\n name=\"currentPassword\"\n type=\"password\"\n autocomplete=\"current-password\"\n [label]=\"text().currentPassword\"\n [showPasswordLabel]=\"text().showPassword\"\n [hidePasswordLabel]=\"text().hidePassword\"\n [errorMessage]=\"passwordError()\"\n [ngModel]=\"password()\"\n (ngModelChange)=\"setPassword($event)\"\n />\n </div>\n\n <div class=\"gbt-mfa-settings__actions\">\n <gbt-button\n type=\"submit\"\n [variant]=\"promptCopy().variant\"\n [text]=\"promptCopy().submit\"\n [loading]=\"busy()\"\n [loadingLabel]=\"promptCopy().busy\"\n />\n <gbt-button\n variant=\"secondary\"\n [text]=\"text().cancel\"\n [disabled]=\"busy()\"\n (clicked)=\"cancelPrompt()\"\n />\n </div>\n </form>\n</ng-template>\n",
|
|
362
|
+
styles: [":host{display:block;min-width:0}:host gbt-card{min-width:0;container:gbt-settings-card/inline-size}:host gbt-card ::ng-deep .gbt-card{color:inherit;font-size:inherit;line-height:inherit}:host gbt-card ::ng-deep .gbt-card__count{background:color-mix(in srgb,var(--border-color) 22%,transparent)}.gbt-mfa-settings__rows{display:flex;flex-direction:column}.gbt-mfa-settings__row{display:flex;flex-direction:column;gap:1rem;padding-block:1.25rem}.gbt-mfa-settings__row:first-child{padding-top:0}.gbt-mfa-settings__row:last-child{padding-bottom:0}.gbt-mfa-settings__row+.gbt-mfa-settings__row{border-top:1px solid var(--gbt-hairline)}.gbt-mfa-settings__row-head{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:.75rem 1.5rem}.gbt-mfa-settings__row-head:focus{outline:none}.gbt-mfa-settings__row-text{display:flex;flex:1 1 18rem;flex-direction:column;gap:.125rem;min-width:0}.gbt-mfa-settings__row-title{margin:0;color:var(--text-primary);font-size:.875rem;font-weight:600;line-height:1.5rem}.gbt-mfa-settings__row-help{margin:0;color:var(--text-secondary);font-size:.8125rem;line-height:1.25rem}.gbt-mfa-settings__title-line{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem .625rem}.gbt-mfa-settings__badge,.gbt-mfa-settings__row-action{flex:none}.gbt-mfa-settings__row-action--remove ::ng-deep .gbt-button:not(:disabled):hover{border-color:var(--color-error-text);color:var(--color-error-text)}.gbt-mfa-settings__codes-left{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 .375rem;margin:0;color:var(--text-primary);font-size:.8125rem;font-weight:500;line-height:1.25rem}.gbt-mfa-settings__codes-left gbt-icon{align-self:center;flex:none;font-size:.75rem}.gbt-mfa-settings__codes-left[data-tone=warning]{color:var(--color-warning-text)}.gbt-mfa-settings__prompt{display:flex;flex-direction:column;gap:1.25rem;margin:0;gap:1rem;padding:1rem 1.125rem 1.125rem;border:1px solid var(--gbt-card-border);border-radius:var(--site-border-radius-sm);background:var(--bg-panel)}.gbt-mfa-settings__prompt-lead{margin:0;color:var(--text-secondary);font-size:.8125rem;line-height:1.25rem}.gbt-mfa-settings__field{display:flex;flex-direction:column;gap:.375rem;min-width:0;max-width:24rem}.gbt-mfa-settings__actions{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem .75rem}.gbt-mfa-settings__stack{display:flex;flex-direction:column;gap:1.25rem;min-width:0}.gbt-mfa-settings__anchor:focus,.gbt-mfa-settings__lead:focus{outline:none}.gbt-mfa-settings__lead{max-width:40rem;margin:0;color:var(--text-secondary);font-size:.875rem;line-height:1.5}.gbt-mfa-settings__codes{max-width:34rem}.gbt-mfa-settings__scan{display:flex;flex-direction:column;gap:1.25rem;margin:0}.gbt-mfa-settings__scan-grid{display:grid;grid-template-columns:minmax(0,19rem) minmax(0,1fr);align-items:start;gap:1.5rem 2rem}.gbt-mfa-settings__qr ::ng-deep .gbt-totp-qr__frame{margin-inline:0}.gbt-mfa-settings__scan-side{display:flex;flex-direction:column;gap:1.25rem;min-width:0;max-width:26rem}.gbt-mfa-settings__loading{display:flex;flex-direction:column;gap:1.5rem}.gbt-mfa-settings__skeleton-row{display:flex;align-items:center;justify-content:space-between;gap:1rem}.gbt-mfa-settings__skeleton-lines{display:flex;flex-direction:column;gap:.5rem;min-width:0}@container gbt-settings-card (max-width: 519px){.gbt-mfa-settings__scan-grid{grid-template-columns:minmax(0,1fr)}.gbt-mfa-settings__qr ::ng-deep .gbt-totp-qr__frame{margin-inline:auto}.gbt-mfa-settings__scan-side,.gbt-mfa-settings__field{max-width:none}.gbt-mfa-settings__prompt{padding:.875rem}.gbt-mfa-settings__row-action,.gbt-mfa-settings__actions gbt-button{display:block;flex:1 1 100%;width:auto}.gbt-mfa-settings__row-action ::ng-deep .gbt-button,.gbt-mfa-settings__actions gbt-button ::ng-deep .gbt-button{width:100%;min-height:2.75rem}}\n"],
|
|
363
|
+
dependencies: [
|
|
364
|
+
{
|
|
365
|
+
kind: "ngmodule",
|
|
366
|
+
type: FormsModule
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
kind: "directive",
|
|
370
|
+
type: i1.NgControlStatus,
|
|
371
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
kind: "directive",
|
|
375
|
+
type: i1.NgModel,
|
|
376
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
377
|
+
inputs: [
|
|
378
|
+
"name",
|
|
379
|
+
"disabled",
|
|
380
|
+
"ngModel",
|
|
381
|
+
"ngModelOptions"
|
|
382
|
+
],
|
|
383
|
+
outputs: ["ngModelChange"],
|
|
384
|
+
exportAs: ["ngModel"]
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
kind: "directive",
|
|
388
|
+
type: NgTemplateOutlet,
|
|
389
|
+
selector: "[ngTemplateOutlet]",
|
|
390
|
+
inputs: [
|
|
391
|
+
"ngTemplateOutletContext",
|
|
392
|
+
"ngTemplateOutlet",
|
|
393
|
+
"ngTemplateOutletInjector"
|
|
394
|
+
]
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
kind: "component",
|
|
398
|
+
type: Badge,
|
|
399
|
+
selector: "gbt-badge",
|
|
400
|
+
inputs: [
|
|
401
|
+
"variant",
|
|
402
|
+
"icon",
|
|
403
|
+
"appearance",
|
|
404
|
+
"size",
|
|
405
|
+
"truncate",
|
|
406
|
+
"tabularNums",
|
|
407
|
+
"mono",
|
|
408
|
+
"maxWidth",
|
|
409
|
+
"fullText",
|
|
410
|
+
"copyable",
|
|
411
|
+
"copyValue",
|
|
412
|
+
"copyLabel",
|
|
413
|
+
"copiedText",
|
|
414
|
+
"failedText",
|
|
415
|
+
"feedbackMs",
|
|
416
|
+
"value",
|
|
417
|
+
"max",
|
|
418
|
+
"hideZero",
|
|
419
|
+
"label"
|
|
420
|
+
],
|
|
421
|
+
outputs: ["copied", "copyFailed"]
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
kind: "component",
|
|
425
|
+
type: Button,
|
|
426
|
+
selector: "gbt-button, a[gbtButton]",
|
|
427
|
+
inputs: [
|
|
428
|
+
"variant",
|
|
429
|
+
"size",
|
|
430
|
+
"type",
|
|
431
|
+
"text",
|
|
432
|
+
"iconName",
|
|
433
|
+
"ariaLabel",
|
|
434
|
+
"loading",
|
|
435
|
+
"loadingLabel",
|
|
436
|
+
"disabled",
|
|
437
|
+
"pressed",
|
|
438
|
+
"ariaExpanded",
|
|
439
|
+
"ariaControls",
|
|
440
|
+
"ariaHaspopup",
|
|
441
|
+
"block",
|
|
442
|
+
"iconOnly"
|
|
443
|
+
],
|
|
444
|
+
outputs: ["clicked"]
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
kind: "component",
|
|
448
|
+
type: GbtInput,
|
|
449
|
+
selector: "gbt-input",
|
|
450
|
+
inputs: [
|
|
451
|
+
"id",
|
|
452
|
+
"label",
|
|
453
|
+
"type",
|
|
454
|
+
"required",
|
|
455
|
+
"disabled",
|
|
456
|
+
"placeholder",
|
|
457
|
+
"errorMessage",
|
|
458
|
+
"autocomplete",
|
|
459
|
+
"hint",
|
|
460
|
+
"hideLabel",
|
|
461
|
+
"size",
|
|
462
|
+
"mono",
|
|
463
|
+
"leadingIcon",
|
|
464
|
+
"inputmode",
|
|
465
|
+
"spellcheck",
|
|
466
|
+
"autocapitalize",
|
|
467
|
+
"enterkeyhint",
|
|
468
|
+
"maxlength",
|
|
469
|
+
"min",
|
|
470
|
+
"max",
|
|
471
|
+
"combobox",
|
|
472
|
+
"showPasswordLabel",
|
|
473
|
+
"hidePasswordLabel"
|
|
474
|
+
],
|
|
475
|
+
outputs: ["committed"]
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
kind: "component",
|
|
479
|
+
type: Icon,
|
|
480
|
+
selector: "gbt-icon",
|
|
481
|
+
inputs: ["name"]
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
kind: "component",
|
|
485
|
+
type: Skeleton,
|
|
486
|
+
selector: "gbt-skeleton",
|
|
487
|
+
inputs: [
|
|
488
|
+
"variant",
|
|
489
|
+
"width",
|
|
490
|
+
"height"
|
|
491
|
+
]
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
kind: "component",
|
|
495
|
+
type: Alert,
|
|
496
|
+
selector: "gbt-alert",
|
|
497
|
+
inputs: [
|
|
498
|
+
"variant",
|
|
499
|
+
"dismissible",
|
|
500
|
+
"closeLabel",
|
|
501
|
+
"live",
|
|
502
|
+
"heading",
|
|
503
|
+
"size",
|
|
504
|
+
"appearance",
|
|
505
|
+
"iconAlign"
|
|
506
|
+
],
|
|
507
|
+
outputs: ["dismissed"]
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
kind: "component",
|
|
511
|
+
type: BackupCodes,
|
|
512
|
+
selector: "gbt-backup-codes",
|
|
513
|
+
inputs: [
|
|
514
|
+
"codes",
|
|
515
|
+
"acknowledged",
|
|
516
|
+
"labels"
|
|
517
|
+
],
|
|
518
|
+
outputs: ["acknowledgedChange"]
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
kind: "component",
|
|
522
|
+
type: TotpQr,
|
|
523
|
+
selector: "gbt-totp-qr",
|
|
524
|
+
inputs: [
|
|
525
|
+
"otpauthUrl",
|
|
526
|
+
"secret",
|
|
527
|
+
"labels"
|
|
528
|
+
]
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
kind: "component",
|
|
532
|
+
type: ConfirmDangerModal,
|
|
533
|
+
selector: "gbt-confirm-danger-modal",
|
|
534
|
+
inputs: [
|
|
535
|
+
"isOpen",
|
|
536
|
+
"heading",
|
|
537
|
+
"message",
|
|
538
|
+
"confirmText",
|
|
539
|
+
"confirmInputLabel",
|
|
540
|
+
"confirmLabel",
|
|
541
|
+
"cancelLabel",
|
|
542
|
+
"closeLabel",
|
|
543
|
+
"busy",
|
|
544
|
+
"busyLabel",
|
|
545
|
+
"confirmIcon",
|
|
546
|
+
"tone"
|
|
547
|
+
],
|
|
548
|
+
outputs: ["confirmed", "closed"]
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
kind: "component",
|
|
552
|
+
type: Card,
|
|
553
|
+
selector: "gbt-card",
|
|
554
|
+
inputs: [
|
|
555
|
+
"hoverable",
|
|
556
|
+
"heading",
|
|
557
|
+
"icon",
|
|
558
|
+
"headingLevel",
|
|
559
|
+
"variant",
|
|
560
|
+
"description",
|
|
561
|
+
"count",
|
|
562
|
+
"flush",
|
|
563
|
+
"tone",
|
|
564
|
+
"selected",
|
|
565
|
+
"selectedLabel",
|
|
566
|
+
"href",
|
|
567
|
+
"linkLabel"
|
|
568
|
+
]
|
|
569
|
+
}
|
|
570
|
+
],
|
|
571
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
572
|
+
});
|
|
573
|
+
};
|
|
574
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
575
|
+
minVersion: "12.0.0",
|
|
576
|
+
version: "22.2.0",
|
|
577
|
+
ngImport: i0,
|
|
578
|
+
type: MfaSettings,
|
|
579
|
+
decorators: [{
|
|
580
|
+
type: Component,
|
|
581
|
+
args: [{
|
|
582
|
+
selector: "gbt-mfa-settings",
|
|
583
|
+
standalone: true,
|
|
584
|
+
imports: [
|
|
585
|
+
FormsModule,
|
|
586
|
+
NgTemplateOutlet,
|
|
587
|
+
Badge,
|
|
588
|
+
Button,
|
|
589
|
+
GbtInput,
|
|
590
|
+
Icon,
|
|
591
|
+
Skeleton,
|
|
592
|
+
Alert,
|
|
593
|
+
BackupCodes,
|
|
594
|
+
TotpQr,
|
|
595
|
+
ConfirmDangerModal,
|
|
596
|
+
Card
|
|
597
|
+
],
|
|
598
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
599
|
+
template: "<gbt-card\n variant=\"outlined\"\n [icon]=\"view() === 'ready' && !hasFactor() ? 'shield-alert' : 'shield-check'\"\n [heading]=\"heading()\"\n [description]=\"help()\"\n>\n @switch (view()) {\n @case ('loading') {\n <span class=\"sr-only\" role=\"status\">{{ text().loading }}</span>\n <div class=\"gbt-mfa-settings__loading\" aria-busy=\"true\">\n <div class=\"gbt-mfa-settings__skeleton-row\" aria-hidden=\"true\">\n <div class=\"gbt-mfa-settings__skeleton-lines\">\n <gbt-skeleton width=\"9rem\" height=\"0.875rem\" />\n <gbt-skeleton width=\"min(20rem, 100%)\" height=\"0.75rem\" />\n </div>\n <gbt-skeleton width=\"4.5rem\" height=\"1.375rem\" variant=\"rect\" />\n </div>\n <div class=\"gbt-mfa-settings__skeleton-row\" aria-hidden=\"true\">\n <div class=\"gbt-mfa-settings__skeleton-lines\">\n <gbt-skeleton width=\"7rem\" height=\"0.875rem\" />\n <gbt-skeleton width=\"min(16rem, 100%)\" height=\"0.75rem\" />\n </div>\n <gbt-skeleton width=\"11rem\" height=\"2.25rem\" variant=\"rect\" />\n </div>\n </div>\n }\n\n @case ('failed') {\n <gbt-alert variant=\"error\" appearance=\"subtle\">\n {{ text().loadFailed }}\n <gbt-button\n alert-actions\n variant=\"secondary\"\n size=\"small\"\n [text]=\"text().retry\"\n (clicked)=\"load()\"\n />\n </gbt-alert>\n }\n\n @case ('revoked') {\n <div class=\"gbt-mfa-settings__anchor\" data-mfa-anchor tabindex=\"-1\">\n <gbt-alert variant=\"info\" appearance=\"subtle\" iconAlign=\"start\" live=\"off\">{{\n text().signedOut\n }}</gbt-alert>\n </div>\n }\n\n @case ('enrolling') {\n <form ngNoForm class=\"gbt-mfa-settings__scan\" (submit)=\"$event.preventDefault(); activate()\">\n <p class=\"gbt-mfa-settings__lead\" data-mfa-anchor tabindex=\"-1\">{{ text().scanLead }}</p>\n\n <div class=\"gbt-mfa-settings__scan-grid\">\n <gbt-totp-qr\n class=\"gbt-mfa-settings__qr\"\n [otpauthUrl]=\"otpauthUrl()\"\n [secret]=\"secret()\"\n />\n\n <div class=\"gbt-mfa-settings__scan-side\">\n @if (notice()) {\n <gbt-alert variant=\"error\" appearance=\"subtle\" iconAlign=\"start\">{{\n notice()\n }}</gbt-alert>\n }\n\n <gbt-input\n [id]=\"id + '-code'\"\n inputmode=\"numeric\"\n [spellcheck]=\"false\"\n autocapitalize=\"off\"\n enterkeyhint=\"go\"\n name=\"code\"\n autocomplete=\"one-time-code\"\n [label]=\"text().codeLabel\"\n [errorMessage]=\"codeError()\"\n [ngModel]=\"code()\"\n (ngModelChange)=\"setCode($event)\"\n />\n\n <div class=\"gbt-mfa-settings__actions\">\n <gbt-button\n type=\"submit\"\n [text]=\"text().activate\"\n [loading]=\"busy()\"\n [loadingLabel]=\"text().verifying\"\n />\n <gbt-button\n variant=\"secondary\"\n [text]=\"text().cancel\"\n [disabled]=\"busy()\"\n (clicked)=\"cancelEnrollment()\"\n />\n </div>\n </div>\n </div>\n </form>\n }\n\n @case ('codes') {\n <div class=\"gbt-mfa-settings__stack\">\n <p class=\"gbt-mfa-settings__lead\" data-mfa-anchor tabindex=\"-1\">\n {{\n codesOrigin() === 'enrolled' ? text().codesLeadEnrolled : text().codesLeadRegenerated\n }}\n </p>\n @if (!acknowledged()) {\n <gbt-alert variant=\"warning\" appearance=\"subtle\" iconAlign=\"start\" live=\"off\">{{\n text().dontLeave\n }}</gbt-alert>\n }\n <div class=\"gbt-mfa-settings__codes\">\n <gbt-backup-codes [codes]=\"backupCodes()\" [(acknowledged)]=\"acknowledged\" />\n </div>\n <div class=\"gbt-mfa-settings__actions\">\n <gbt-button [text]=\"text().done\" [disabled]=\"!acknowledged()\" (clicked)=\"finishCodes()\" />\n </div>\n </div>\n }\n\n @default {\n @if (hasFactor()) {\n <div class=\"gbt-mfa-settings__rows\">\n <div class=\"gbt-mfa-settings__row\">\n <div class=\"gbt-mfa-settings__row-head\" data-mfa-anchor tabindex=\"-1\">\n @if (status().totpEnabled) {\n <div class=\"gbt-mfa-settings__row-text\">\n <div class=\"gbt-mfa-settings__title-line\">\n <p class=\"gbt-mfa-settings__row-title\">{{ text().appConfigured }}</p>\n <gbt-badge\n class=\"gbt-mfa-settings__badge\"\n variant=\"success\"\n icon=\"check-circle\"\n >{{ text().enabled }}</gbt-badge\n >\n </div>\n <p class=\"gbt-mfa-settings__row-help\">\n {{ hasPasskey() ? text().appHelpWithPasskey : text().appHelp }}\n </p>\n </div>\n } @else {\n <div class=\"gbt-mfa-settings__row-text\">\n <div class=\"gbt-mfa-settings__title-line\">\n <p class=\"gbt-mfa-settings__row-title\">{{ text().noApp }}</p>\n <gbt-badge class=\"gbt-mfa-settings__badge\" variant=\"neutral\">{{\n text().optional\n }}</gbt-badge>\n </div>\n <p class=\"gbt-mfa-settings__row-help\">{{ text().noAppHelp }}</p>\n </div>\n @if (prompt() !== 'enroll') {\n <gbt-button\n class=\"gbt-mfa-settings__row-action\"\n data-opener=\"enroll\"\n variant=\"secondary\"\n iconName=\"plus\"\n [text]=\"text().addApp\"\n (clicked)=\"openPrompt('enroll')\"\n />\n }\n }\n </div>\n @if (!status().totpEnabled && prompt() === 'enroll') {\n <ng-container [ngTemplateOutlet]=\"passwordPrompt\" />\n }\n </div>\n\n <div class=\"gbt-mfa-settings__row\">\n <div class=\"gbt-mfa-settings__row-head\">\n <div class=\"gbt-mfa-settings__row-text\">\n <p class=\"gbt-mfa-settings__row-title\">{{ text().backupCodesTitle }}</p>\n <p\n class=\"gbt-mfa-settings__codes-left\"\n [attr.data-tone]=\"lowCodes() ? 'warning' : null\"\n >\n @if (lowCodes()) {\n <gbt-icon name=\"alert-triangle\" aria-hidden=\"true\" />\n }\n <span>{{ codesLeft() }}.</span>\n @if (lowCodes()) {\n <span>{{ text().lowCodes }}</span>\n }\n </p>\n <p class=\"gbt-mfa-settings__row-help\">{{ text().backupCodesHelp }}</p>\n </div>\n @if (prompt() !== 'regenerate') {\n <gbt-button\n class=\"gbt-mfa-settings__row-action\"\n data-opener=\"regenerate\"\n variant=\"secondary\"\n iconName=\"refresh-cw\"\n [text]=\"text().regenerateCodes\"\n (clicked)=\"openPrompt('regenerate')\"\n />\n }\n </div>\n @if (prompt() === 'regenerate') {\n <ng-container [ngTemplateOutlet]=\"passwordPrompt\" />\n }\n </div>\n\n @if (status().totpEnabled) {\n <div class=\"gbt-mfa-settings__row\">\n <div class=\"gbt-mfa-settings__row-head\">\n <div class=\"gbt-mfa-settings__row-text\">\n <p class=\"gbt-mfa-settings__row-title\">{{ removal().title }}</p>\n <p class=\"gbt-mfa-settings__row-help\">{{ removal().help }}</p>\n </div>\n @if (prompt() !== 'disable') {\n <gbt-button\n class=\"gbt-mfa-settings__row-action gbt-mfa-settings__row-action--remove\"\n data-opener=\"disable\"\n variant=\"secondary\"\n [text]=\"removal().action\"\n (clicked)=\"openPrompt('disable')\"\n />\n }\n </div>\n @if (prompt() === 'disable') {\n <ng-container [ngTemplateOutlet]=\"passwordPrompt\" />\n }\n </div>\n }\n </div>\n } @else {\n <div class=\"gbt-mfa-settings__stack\">\n <div class=\"gbt-mfa-settings__anchor\" data-mfa-anchor tabindex=\"-1\">\n <gbt-alert variant=\"warning\" appearance=\"subtle\" iconAlign=\"start\" live=\"off\">{{\n text().noFactorWarning\n }}</gbt-alert>\n </div>\n @if (prompt() === 'enroll') {\n <ng-container [ngTemplateOutlet]=\"passwordPrompt\" />\n } @else {\n <div class=\"gbt-mfa-settings__actions\">\n <gbt-button\n data-opener=\"enroll\"\n iconName=\"shield-check\"\n [text]=\"text().setUpNow\"\n (clicked)=\"openPrompt('enroll')\"\n />\n </div>\n }\n </div>\n }\n }\n }\n</gbt-card>\n\n@if (confirmingDisable()) {\n <gbt-confirm-danger-modal\n [isOpen]=\"true\"\n [heading]=\"removal().dialogHeading\"\n [message]=\"removal().dialogMessage\"\n [confirmLabel]=\"removal().action\"\n confirmIcon=\"trash-2\"\n [cancelLabel]=\"text().cancel\"\n [closeLabel]=\"text().close\"\n [busyLabel]=\"removal().busy\"\n [busy]=\"busy()\"\n (confirmed)=\"disable()\"\n (closed)=\"closeDisableDialog()\"\n />\n}\n\n<ng-template #passwordPrompt>\n <form\n ngNoForm\n class=\"gbt-mfa-settings__prompt\"\n (submit)=\"$event.preventDefault(); submitPrompt()\"\n >\n <p class=\"gbt-mfa-settings__prompt-lead\">{{ promptCopy().lead }}</p>\n\n @if (notice()) {\n <gbt-alert variant=\"error\" appearance=\"subtle\" iconAlign=\"start\">{{ notice() }}</gbt-alert>\n }\n\n <div class=\"gbt-mfa-settings__field\">\n <gbt-input\n [id]=\"id + '-password'\"\n name=\"currentPassword\"\n type=\"password\"\n autocomplete=\"current-password\"\n [label]=\"text().currentPassword\"\n [showPasswordLabel]=\"text().showPassword\"\n [hidePasswordLabel]=\"text().hidePassword\"\n [errorMessage]=\"passwordError()\"\n [ngModel]=\"password()\"\n (ngModelChange)=\"setPassword($event)\"\n />\n </div>\n\n <div class=\"gbt-mfa-settings__actions\">\n <gbt-button\n type=\"submit\"\n [variant]=\"promptCopy().variant\"\n [text]=\"promptCopy().submit\"\n [loading]=\"busy()\"\n [loadingLabel]=\"promptCopy().busy\"\n />\n <gbt-button\n variant=\"secondary\"\n [text]=\"text().cancel\"\n [disabled]=\"busy()\"\n (clicked)=\"cancelPrompt()\"\n />\n </div>\n </form>\n</ng-template>\n",
|
|
600
|
+
styles: [":host{display:block;min-width:0}:host gbt-card{min-width:0;container:gbt-settings-card/inline-size}:host gbt-card ::ng-deep .gbt-card{color:inherit;font-size:inherit;line-height:inherit}:host gbt-card ::ng-deep .gbt-card__count{background:color-mix(in srgb,var(--border-color) 22%,transparent)}.gbt-mfa-settings__rows{display:flex;flex-direction:column}.gbt-mfa-settings__row{display:flex;flex-direction:column;gap:1rem;padding-block:1.25rem}.gbt-mfa-settings__row:first-child{padding-top:0}.gbt-mfa-settings__row:last-child{padding-bottom:0}.gbt-mfa-settings__row+.gbt-mfa-settings__row{border-top:1px solid var(--gbt-hairline)}.gbt-mfa-settings__row-head{display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-between;gap:.75rem 1.5rem}.gbt-mfa-settings__row-head:focus{outline:none}.gbt-mfa-settings__row-text{display:flex;flex:1 1 18rem;flex-direction:column;gap:.125rem;min-width:0}.gbt-mfa-settings__row-title{margin:0;color:var(--text-primary);font-size:.875rem;font-weight:600;line-height:1.5rem}.gbt-mfa-settings__row-help{margin:0;color:var(--text-secondary);font-size:.8125rem;line-height:1.25rem}.gbt-mfa-settings__title-line{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem .625rem}.gbt-mfa-settings__badge,.gbt-mfa-settings__row-action{flex:none}.gbt-mfa-settings__row-action--remove ::ng-deep .gbt-button:not(:disabled):hover{border-color:var(--color-error-text);color:var(--color-error-text)}.gbt-mfa-settings__codes-left{display:flex;flex-wrap:wrap;align-items:baseline;gap:0 .375rem;margin:0;color:var(--text-primary);font-size:.8125rem;font-weight:500;line-height:1.25rem}.gbt-mfa-settings__codes-left gbt-icon{align-self:center;flex:none;font-size:.75rem}.gbt-mfa-settings__codes-left[data-tone=warning]{color:var(--color-warning-text)}.gbt-mfa-settings__prompt{display:flex;flex-direction:column;gap:1.25rem;margin:0;gap:1rem;padding:1rem 1.125rem 1.125rem;border:1px solid var(--gbt-card-border);border-radius:var(--site-border-radius-sm);background:var(--bg-panel)}.gbt-mfa-settings__prompt-lead{margin:0;color:var(--text-secondary);font-size:.8125rem;line-height:1.25rem}.gbt-mfa-settings__field{display:flex;flex-direction:column;gap:.375rem;min-width:0;max-width:24rem}.gbt-mfa-settings__actions{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem .75rem}.gbt-mfa-settings__stack{display:flex;flex-direction:column;gap:1.25rem;min-width:0}.gbt-mfa-settings__anchor:focus,.gbt-mfa-settings__lead:focus{outline:none}.gbt-mfa-settings__lead{max-width:40rem;margin:0;color:var(--text-secondary);font-size:.875rem;line-height:1.5}.gbt-mfa-settings__codes{max-width:34rem}.gbt-mfa-settings__scan{display:flex;flex-direction:column;gap:1.25rem;margin:0}.gbt-mfa-settings__scan-grid{display:grid;grid-template-columns:minmax(0,19rem) minmax(0,1fr);align-items:start;gap:1.5rem 2rem}.gbt-mfa-settings__qr ::ng-deep .gbt-totp-qr__frame{margin-inline:0}.gbt-mfa-settings__scan-side{display:flex;flex-direction:column;gap:1.25rem;min-width:0;max-width:26rem}.gbt-mfa-settings__loading{display:flex;flex-direction:column;gap:1.5rem}.gbt-mfa-settings__skeleton-row{display:flex;align-items:center;justify-content:space-between;gap:1rem}.gbt-mfa-settings__skeleton-lines{display:flex;flex-direction:column;gap:.5rem;min-width:0}@container gbt-settings-card (max-width: 519px){.gbt-mfa-settings__scan-grid{grid-template-columns:minmax(0,1fr)}.gbt-mfa-settings__qr ::ng-deep .gbt-totp-qr__frame{margin-inline:auto}.gbt-mfa-settings__scan-side,.gbt-mfa-settings__field{max-width:none}.gbt-mfa-settings__prompt{padding:.875rem}.gbt-mfa-settings__row-action,.gbt-mfa-settings__actions gbt-button{display:block;flex:1 1 100%;width:auto}.gbt-mfa-settings__row-action ::ng-deep .gbt-button,.gbt-mfa-settings__actions gbt-button ::ng-deep .gbt-button{width:100%;min-height:2.75rem}}\n"]
|
|
601
|
+
}]
|
|
602
|
+
}],
|
|
603
|
+
ctorParameters: () => [],
|
|
604
|
+
propDecorators: {
|
|
605
|
+
labels: [{
|
|
606
|
+
type: i0.Input,
|
|
607
|
+
args: [{
|
|
608
|
+
isSignal: true,
|
|
609
|
+
alias: "labels",
|
|
610
|
+
required: false
|
|
611
|
+
}]
|
|
612
|
+
}],
|
|
613
|
+
lowCodesThreshold: [{
|
|
614
|
+
type: i0.Input,
|
|
615
|
+
args: [{
|
|
616
|
+
isSignal: true,
|
|
617
|
+
alias: "lowCodesThreshold",
|
|
618
|
+
required: false
|
|
619
|
+
}]
|
|
620
|
+
}],
|
|
621
|
+
sessionRevoked: [{
|
|
622
|
+
type: i0.Output,
|
|
623
|
+
args: ["sessionRevoked"]
|
|
624
|
+
}]
|
|
625
|
+
}
|
|
626
|
+
});
|
|
627
|
+
export { MfaSettings };
|
|
628
|
+
|
|
629
|
+
//# sourceMappingURL=masmarino-gabarit-mfa-settings.mjs.map
|