@marinoscar/vault-web 0.0.0-bootstrap → 0.1.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/LICENSE +21 -0
- package/README.md +99 -0
- package/dist/agent/headless/agentActivity.d.ts +53 -0
- package/dist/agent/headless/agentActivity.js +58 -0
- package/dist/agent/headless/index.d.ts +2 -0
- package/dist/agent/headless/index.js +3 -0
- package/dist/agent/headless/useAgentActivity.d.ts +9 -0
- package/dist/agent/headless/useAgentActivity.js +30 -0
- package/dist/agent/ui/components/AgentActivityTable.d.ts +25 -0
- package/dist/agent/ui/components/AgentActivityTable.js +114 -0
- package/dist/agent/ui/index.d.ts +3 -0
- package/dist/agent/ui/index.js +4 -0
- package/dist/agent/ui/pages/AgentAccessSettingsPage.d.ts +7 -0
- package/dist/agent/ui/pages/AgentAccessSettingsPage.js +70 -0
- package/dist/agent/ui/pages/AgentActivityPage.d.ts +6 -0
- package/dist/agent/ui/pages/AgentActivityPage.js +61 -0
- package/dist/backups/headless/backupContents.d.ts +69 -0
- package/dist/backups/headless/backupContents.js +133 -0
- package/dist/backups/headless/backupPassword.d.ts +34 -0
- package/dist/backups/headless/backupPassword.js +80 -0
- package/dist/backups/headless/backupSchedule.d.ts +56 -0
- package/dist/backups/headless/backupSchedule.js +189 -0
- package/dist/backups/headless/index.d.ts +4 -0
- package/dist/backups/headless/index.js +5 -0
- package/dist/backups/headless/useBackupRunHistory.d.ts +36 -0
- package/dist/backups/headless/useBackupRunHistory.js +83 -0
- package/dist/backups/ui/components/AdminBackupDownloadDialog.d.ts +20 -0
- package/dist/backups/ui/components/AdminBackupDownloadDialog.js +65 -0
- package/dist/backups/ui/components/BackupContentsGroup.d.ts +17 -0
- package/dist/backups/ui/components/BackupContentsGroup.js +21 -0
- package/dist/backups/ui/components/BackupPasswordFields.d.ts +18 -0
- package/dist/backups/ui/components/BackupPasswordFields.js +40 -0
- package/dist/backups/ui/components/BackupRunsTable.d.ts +44 -0
- package/dist/backups/ui/components/BackupRunsTable.js +61 -0
- package/dist/backups/ui/components/DataBackup.d.ts +14 -0
- package/dist/backups/ui/components/DataBackup.js +169 -0
- package/dist/backups/ui/components/ScheduledBackups.d.ts +13 -0
- package/dist/backups/ui/components/ScheduledBackups.js +304 -0
- package/dist/backups/ui/index.d.ts +8 -0
- package/dist/backups/ui/index.js +9 -0
- package/dist/backups/ui/pages/BackupSettingsPage.d.ts +8 -0
- package/dist/backups/ui/pages/BackupSettingsPage.js +19 -0
- package/dist/backups/ui/pages/MyBackupsPage.d.ts +8 -0
- package/dist/backups/ui/pages/MyBackupsPage.js +19 -0
- package/dist/brand/BrandLockup.d.ts +14 -0
- package/dist/brand/BrandLockup.js +13 -0
- package/dist/brand/assets/vault-mark.png +0 -0
- package/dist/brand/contrast.d.ts +8 -0
- package/dist/brand/contrast.js +21 -0
- package/dist/brand/index.d.ts +7 -0
- package/dist/brand/index.js +8 -0
- package/dist/brand/mark.d.ts +6 -0
- package/dist/brand/mark.js +7 -0
- package/dist/brand/theme.d.ts +25 -0
- package/dist/brand/theme.js +84 -0
- package/dist/brand/tokens.d.ts +52 -0
- package/dist/brand/tokens.js +54 -0
- package/dist/cards/headless/cardExpiry.d.ts +57 -0
- package/dist/cards/headless/cardExpiry.js +138 -0
- package/dist/cards/headless/cardFormat.d.ts +60 -0
- package/dist/cards/headless/cardFormat.js +135 -0
- package/dist/cards/headless/cardImage.d.ts +293 -0
- package/dist/cards/headless/cardImage.js +518 -0
- package/dist/cards/headless/index.d.ts +6 -0
- package/dist/cards/headless/index.js +7 -0
- package/dist/cards/headless/useCardImport.d.ts +137 -0
- package/dist/cards/headless/useCardImport.js +391 -0
- package/dist/cards/headless/useCardRenewal.d.ts +102 -0
- package/dist/cards/headless/useCardRenewal.js +305 -0
- package/dist/cards/headless/useCards.d.ts +80 -0
- package/dist/cards/headless/useCards.js +114 -0
- package/dist/cards/ui/components/AiEgressNotice.d.ts +13 -0
- package/dist/cards/ui/components/AiEgressNotice.js +18 -0
- package/dist/cards/ui/components/CardCaptureStep.d.ts +59 -0
- package/dist/cards/ui/components/CardCaptureStep.js +96 -0
- package/dist/cards/ui/components/CardCropAdjuster.d.ts +43 -0
- package/dist/cards/ui/components/CardCropAdjuster.js +215 -0
- package/dist/cards/ui/components/CardCropReview.d.ts +51 -0
- package/dist/cards/ui/components/CardCropReview.js +88 -0
- package/dist/cards/ui/components/CardExpiryBadge.d.ts +8 -0
- package/dist/cards/ui/components/CardExpiryBadge.js +43 -0
- package/dist/cards/ui/components/CardFieldDiff.d.ts +37 -0
- package/dist/cards/ui/components/CardFieldDiff.js +66 -0
- package/dist/cards/ui/components/CardFlowStepper.d.ts +24 -0
- package/dist/cards/ui/components/CardFlowStepper.js +23 -0
- package/dist/cards/ui/components/CardReviewForm.d.ts +44 -0
- package/dist/cards/ui/components/CardReviewForm.js +102 -0
- package/dist/cards/ui/components/CardScanModelSection.d.ts +23 -0
- package/dist/cards/ui/components/CardScanModelSection.js +81 -0
- package/dist/cards/ui/components/CardTile.d.ts +40 -0
- package/dist/cards/ui/components/CardTile.js +94 -0
- package/dist/cards/ui/index.d.ts +15 -0
- package/dist/cards/ui/index.js +16 -0
- package/dist/cards/ui/pages/AiSettingsPage.d.ts +12 -0
- package/dist/cards/ui/pages/AiSettingsPage.js +24 -0
- package/dist/cards/ui/pages/CardsPage.d.ts +26 -0
- package/dist/cards/ui/pages/CardsPage.js +160 -0
- package/dist/cards/ui/pages/ImportCardPage.d.ts +24 -0
- package/dist/cards/ui/pages/ImportCardPage.js +343 -0
- package/dist/cards/ui/pages/RenewCardPage.d.ts +35 -0
- package/dist/cards/ui/pages/RenewCardPage.js +350 -0
- package/dist/core/headless/api.d.ts +272 -0
- package/dist/core/headless/api.js +425 -0
- package/dist/core/headless/cardScanAvailability.d.ts +20 -0
- package/dist/core/headless/cardScanAvailability.js +27 -0
- package/dist/core/headless/clipboard.d.ts +60 -0
- package/dist/core/headless/clipboard.js +101 -0
- package/dist/core/headless/http.d.ts +41 -0
- package/dist/core/headless/http.js +50 -0
- package/dist/core/headless/index.d.ts +12 -0
- package/dist/core/headless/index.js +13 -0
- package/dist/core/headless/relativeTime.d.ts +7 -0
- package/dist/core/headless/relativeTime.js +28 -0
- package/dist/core/headless/saveBlob.d.ts +6 -0
- package/dist/core/headless/saveBlob.js +21 -0
- package/dist/core/headless/types.d.ts +441 -0
- package/dist/core/headless/types.js +49 -0
- package/dist/core/headless/useAiStatus.d.ts +41 -0
- package/dist/core/headless/useAiStatus.js +42 -0
- package/dist/core/headless/useCopyToClipboard.d.ts +20 -0
- package/dist/core/headless/useCopyToClipboard.js +52 -0
- package/dist/core/headless/useDashboardResource.d.ts +22 -0
- package/dist/core/headless/useDashboardResource.js +52 -0
- package/dist/core/headless/useSystemSettings.d.ts +17 -0
- package/dist/core/headless/useSystemSettings.js +106 -0
- package/dist/core/headless/useUserSettings.d.ts +13 -0
- package/dist/core/headless/useUserSettings.js +103 -0
- package/dist/core/ui/ErrorBoundary.d.ts +15 -0
- package/dist/core/ui/ErrorBoundary.js +27 -0
- package/dist/core/ui/LoadingSpinner.d.ts +6 -0
- package/dist/core/ui/LoadingSpinner.js +14 -0
- package/dist/core/ui/SettingsPageFrame.d.ts +19 -0
- package/dist/core/ui/SettingsPageFrame.js +12 -0
- package/dist/core/ui/StorageSettingsLink.d.ts +19 -0
- package/dist/core/ui/StorageSettingsLink.js +26 -0
- package/dist/core/ui/index.d.ts +4 -0
- package/dist/core/ui/index.js +5 -0
- package/dist/home/headless/homeLinks.d.ts +24 -0
- package/dist/home/headless/homeLinks.js +24 -0
- package/dist/home/headless/index.d.ts +1 -0
- package/dist/home/headless/index.js +2 -0
- package/dist/home/ui/components/BackupStatusPanel.d.ts +28 -0
- package/dist/home/ui/components/BackupStatusPanel.js +99 -0
- package/dist/home/ui/components/DashboardPanel.d.ts +33 -0
- package/dist/home/ui/components/DashboardPanel.js +21 -0
- package/dist/home/ui/components/ExpiringCardsPanel.d.ts +31 -0
- package/dist/home/ui/components/ExpiringCardsPanel.js +35 -0
- package/dist/home/ui/components/FirstRunPanel.d.ts +7 -0
- package/dist/home/ui/components/FirstRunPanel.js +21 -0
- package/dist/home/ui/components/QuickActions.d.ts +14 -0
- package/dist/home/ui/components/QuickActions.js +40 -0
- package/dist/home/ui/components/RecentSecretsPanel.d.ts +19 -0
- package/dist/home/ui/components/RecentSecretsPanel.js +20 -0
- package/dist/home/ui/components/StatsRow.d.ts +19 -0
- package/dist/home/ui/components/StatsRow.js +46 -0
- package/dist/home/ui/components/WelcomeHeader.d.ts +11 -0
- package/dist/home/ui/components/WelcomeHeader.js +15 -0
- package/dist/home/ui/index.d.ts +9 -0
- package/dist/home/ui/index.js +10 -0
- package/dist/home/ui/pages/HomePage.d.ts +14 -0
- package/dist/home/ui/pages/HomePage.js +121 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/media/headless/index.d.ts +2 -0
- package/dist/media/headless/index.js +3 -0
- package/dist/media/headless/useMediaFiles.d.ts +20 -0
- package/dist/media/headless/useMediaFiles.js +82 -0
- package/dist/media/headless/useMediaFolders.d.ts +22 -0
- package/dist/media/headless/useMediaFolders.js +81 -0
- package/dist/media/ui/components/FolderList.d.ts +19 -0
- package/dist/media/ui/components/FolderList.js +36 -0
- package/dist/media/ui/components/MediaList.d.ts +20 -0
- package/dist/media/ui/components/MediaList.js +55 -0
- package/dist/media/ui/components/MediaPlayer.d.ts +7 -0
- package/dist/media/ui/components/MediaPlayer.js +361 -0
- package/dist/media/ui/index.d.ts +10 -0
- package/dist/media/ui/index.js +11 -0
- package/dist/media/ui/pages/CreateFolderPage.d.ts +1 -0
- package/dist/media/ui/pages/CreateFolderPage.js +39 -0
- package/dist/media/ui/pages/EditFolderPage.d.ts +1 -0
- package/dist/media/ui/pages/EditFolderPage.js +59 -0
- package/dist/media/ui/pages/MediaFolderPage.d.ts +1 -0
- package/dist/media/ui/pages/MediaFolderPage.js +68 -0
- package/dist/media/ui/pages/MediaFoldersPage.d.ts +1 -0
- package/dist/media/ui/pages/MediaFoldersPage.js +58 -0
- package/dist/media/ui/pages/MediaPlayerPage.d.ts +1 -0
- package/dist/media/ui/pages/MediaPlayerPage.js +76 -0
- package/dist/media/ui/pages/MediaUploadPage.d.ts +1 -0
- package/dist/media/ui/pages/MediaUploadPage.js +88 -0
- package/dist/media/ui/pages/RenameMediaFilePage.d.ts +1 -0
- package/dist/media/ui/pages/RenameMediaFilePage.js +63 -0
- package/dist/navigation/destinations.d.ts +50 -0
- package/dist/navigation/destinations.js +109 -0
- package/dist/navigation/index.d.ts +1 -0
- package/dist/navigation/index.js +4 -0
- package/dist/secrets/headless/fieldOptionsValidation.d.ts +45 -0
- package/dist/secrets/headless/fieldOptionsValidation.js +79 -0
- package/dist/secrets/headless/index.d.ts +6 -0
- package/dist/secrets/headless/index.js +7 -0
- package/dist/secrets/headless/secretFields.d.ts +86 -0
- package/dist/secrets/headless/secretFields.js +190 -0
- package/dist/secrets/headless/useSecretDetail.d.ts +33 -0
- package/dist/secrets/headless/useSecretDetail.js +87 -0
- package/dist/secrets/headless/useSecretTypes.d.ts +16 -0
- package/dist/secrets/headless/useSecretTypes.js +62 -0
- package/dist/secrets/headless/useSecrets.d.ts +24 -0
- package/dist/secrets/headless/useSecrets.js +59 -0
- package/dist/secrets/headless/useTotpCode.d.ts +24 -0
- package/dist/secrets/headless/useTotpCode.js +116 -0
- package/dist/secrets/ui/components/CardImages.d.ts +31 -0
- package/dist/secrets/ui/components/CardImages.js +208 -0
- package/dist/secrets/ui/components/DynamicSecretFields.d.ts +10 -0
- package/dist/secrets/ui/components/DynamicSecretFields.js +90 -0
- package/dist/secrets/ui/components/FieldDefinitionBuilder.d.ts +13 -0
- package/dist/secrets/ui/components/FieldDefinitionBuilder.js +114 -0
- package/dist/secrets/ui/components/FieldOptionsEditor.d.ts +15 -0
- package/dist/secrets/ui/components/FieldOptionsEditor.js +45 -0
- package/dist/secrets/ui/components/SecretAttachments.d.ts +15 -0
- package/dist/secrets/ui/components/SecretAttachments.js +106 -0
- package/dist/secrets/ui/components/SecretForm.d.ts +34 -0
- package/dist/secrets/ui/components/SecretForm.js +83 -0
- package/dist/secrets/ui/components/SecretFormDialog.d.ts +15 -0
- package/dist/secrets/ui/components/SecretFormDialog.js +95 -0
- package/dist/secrets/ui/components/SecretTypeFormDialog.d.ts +15 -0
- package/dist/secrets/ui/components/SecretTypeFormDialog.js +92 -0
- package/dist/secrets/ui/components/SecretTypeIcon.d.ts +8 -0
- package/dist/secrets/ui/components/SecretTypeIcon.js +16 -0
- package/dist/secrets/ui/components/SecretTypesList.d.ts +10 -0
- package/dist/secrets/ui/components/SecretTypesList.js +13 -0
- package/dist/secrets/ui/components/SecretValueField.d.ts +20 -0
- package/dist/secrets/ui/components/SecretValueField.js +52 -0
- package/dist/secrets/ui/components/SecretVersionDrawer.d.ts +22 -0
- package/dist/secrets/ui/components/SecretVersionDrawer.js +131 -0
- package/dist/secrets/ui/components/SecretsTable.d.ts +49 -0
- package/dist/secrets/ui/components/SecretsTable.js +174 -0
- package/dist/secrets/ui/components/TotpCodeCard.d.ts +8 -0
- package/dist/secrets/ui/components/TotpCodeCard.js +34 -0
- package/dist/secrets/ui/index.d.ts +20 -0
- package/dist/secrets/ui/index.js +21 -0
- package/dist/secrets/ui/pages/CreateSecretPage.d.ts +2 -0
- package/dist/secrets/ui/pages/CreateSecretPage.js +25 -0
- package/dist/secrets/ui/pages/CreateSecretTypePage.d.ts +1 -0
- package/dist/secrets/ui/pages/CreateSecretTypePage.js +62 -0
- package/dist/secrets/ui/pages/EditSecretPage.d.ts +5 -0
- package/dist/secrets/ui/pages/EditSecretPage.js +55 -0
- package/dist/secrets/ui/pages/EditSecretTypePage.d.ts +1 -0
- package/dist/secrets/ui/pages/EditSecretTypePage.js +88 -0
- package/dist/secrets/ui/pages/SecretDetailPage.d.ts +7 -0
- package/dist/secrets/ui/pages/SecretDetailPage.js +182 -0
- package/dist/secrets/ui/pages/SecretTypesPage.d.ts +1 -0
- package/dist/secrets/ui/pages/SecretTypesPage.js +23 -0
- package/dist/secrets/ui/pages/SecretsPage.d.ts +6 -0
- package/dist/secrets/ui/pages/SecretsPage.js +179 -0
- package/dist/settings/ui/components/FeatureFlagsList.d.ts +7 -0
- package/dist/settings/ui/components/FeatureFlagsList.js +46 -0
- package/dist/settings/ui/components/ImageUpload.d.ts +6 -0
- package/dist/settings/ui/components/ImageUpload.js +61 -0
- package/dist/settings/ui/components/ProfileSettings.d.ts +11 -0
- package/dist/settings/ui/components/ProfileSettings.js +55 -0
- package/dist/settings/ui/components/ThemeSettings.d.ts +7 -0
- package/dist/settings/ui/components/ThemeSettings.js +24 -0
- package/dist/settings/ui/components/UISettings.d.ts +9 -0
- package/dist/settings/ui/components/UISettings.js +25 -0
- package/dist/settings/ui/components/UserProfileCard.d.ts +1 -0
- package/dist/settings/ui/components/UserProfileCard.js +39 -0
- package/dist/settings/ui/components/UserSettingsSection.d.ts +23 -0
- package/dist/settings/ui/components/UserSettingsSection.js +29 -0
- package/dist/settings/ui/index.d.ts +10 -0
- package/dist/settings/ui/index.js +11 -0
- package/dist/settings/ui/pages/AppearanceSettingsPage.d.ts +6 -0
- package/dist/settings/ui/pages/AppearanceSettingsPage.js +11 -0
- package/dist/settings/ui/pages/GeneralSettingsPage.d.ts +9 -0
- package/dist/settings/ui/pages/GeneralSettingsPage.js +41 -0
- package/dist/settings/ui/pages/ProfileSettingsPage.d.ts +6 -0
- package/dist/settings/ui/pages/ProfileSettingsPage.js +11 -0
- package/package.json +146 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vault brand tokens (E10.1, issue #92; spec: docs/specs/ux-refresh.md §5).
|
|
3
|
+
*
|
|
4
|
+
* The ONE place a brand colour is written. `theme/index.ts` feeds these to the
|
|
5
|
+
* platform shell's `createShellTheme`; no component hard-codes a colour.
|
|
6
|
+
*
|
|
7
|
+
* Deep teal primary, slate neutrals, an amber accent. The amber is a FILL
|
|
8
|
+
* colour only: as text on a light surface it reads 2.01:1 and fails WCAG AA,
|
|
9
|
+
* so amber words use `accentText` (#8A5A00, 5.93:1 on white). The contrast of
|
|
10
|
+
* every pair the UI relies on is asserted by
|
|
11
|
+
* `src/__tests__/theme/tokens.test.ts` with `theme/contrast.ts`.
|
|
12
|
+
*/
|
|
13
|
+
export type BrandMode = 'light' | 'dark';
|
|
14
|
+
/** The colour roles of one mode. */
|
|
15
|
+
export interface BrandModeTokens {
|
|
16
|
+
/** Buttons, links, the active navigation row, the focus ring. */
|
|
17
|
+
primary: string;
|
|
18
|
+
/** A lighter and a darker step of `primary` (hover, pressed, tonal surfaces). */
|
|
19
|
+
primaryLight: string;
|
|
20
|
+
primaryDark: string;
|
|
21
|
+
/** Text and icons on a `primary` fill. */
|
|
22
|
+
onPrimary: string;
|
|
23
|
+
/** The amber accent: badge fills, selected-row markers, empty-state glyphs. Fill only. */
|
|
24
|
+
accent: string;
|
|
25
|
+
/** Text on an `accent` fill. */
|
|
26
|
+
onAccent: string;
|
|
27
|
+
/** Amber used as text, when it must be. */
|
|
28
|
+
accentText: string;
|
|
29
|
+
/** App background. */
|
|
30
|
+
background: string;
|
|
31
|
+
/** Cards, dialogs, the app bar and the rail. */
|
|
32
|
+
paper: string;
|
|
33
|
+
/** Body text. */
|
|
34
|
+
textPrimary: string;
|
|
35
|
+
/** Captions, helper text, inactive navigation. */
|
|
36
|
+
textSecondary: string;
|
|
37
|
+
/** Errors and destructive actions. */
|
|
38
|
+
error: string;
|
|
39
|
+
/** Hairlines: the app bar's border, the rail's edge, dividers. */
|
|
40
|
+
divider: string;
|
|
41
|
+
}
|
|
42
|
+
export declare const BRAND_TOKENS: Readonly<Record<BrandMode, BrandModeTokens>>;
|
|
43
|
+
/** The browser chrome colour (`<meta name="theme-color">`, the PWA manifest). */
|
|
44
|
+
export declare const BRAND_THEME_COLOR: string;
|
|
45
|
+
/** The product name shown in the app bar and the document title. */
|
|
46
|
+
export declare const PRODUCT_NAME = "Vault";
|
|
47
|
+
/**
|
|
48
|
+
* The one-line product promise under the sign-in heading. Mirrors `tagline`
|
|
49
|
+
* in `packages/shared/identity.json` (the rebrand source);
|
|
50
|
+
* `__tests__/theme/tokens.test.ts` fails when the two drift.
|
|
51
|
+
*/
|
|
52
|
+
export declare const PRODUCT_TAGLINE = "Your secrets, cards and documents, encrypted and versioned.";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vault brand tokens (E10.1, issue #92; spec: docs/specs/ux-refresh.md §5).
|
|
3
|
+
*
|
|
4
|
+
* The ONE place a brand colour is written. `theme/index.ts` feeds these to the
|
|
5
|
+
* platform shell's `createShellTheme`; no component hard-codes a colour.
|
|
6
|
+
*
|
|
7
|
+
* Deep teal primary, slate neutrals, an amber accent. The amber is a FILL
|
|
8
|
+
* colour only: as text on a light surface it reads 2.01:1 and fails WCAG AA,
|
|
9
|
+
* so amber words use `accentText` (#8A5A00, 5.93:1 on white). The contrast of
|
|
10
|
+
* every pair the UI relies on is asserted by
|
|
11
|
+
* `src/__tests__/theme/tokens.test.ts` with `theme/contrast.ts`.
|
|
12
|
+
*/
|
|
13
|
+
export const BRAND_TOKENS = {
|
|
14
|
+
light: {
|
|
15
|
+
primary: '#0F5F66',
|
|
16
|
+
primaryLight: '#3D8A90',
|
|
17
|
+
primaryDark: '#0A4348',
|
|
18
|
+
onPrimary: '#FFFFFF',
|
|
19
|
+
accent: '#F2A900',
|
|
20
|
+
onAccent: '#1E293B',
|
|
21
|
+
accentText: '#8A5A00',
|
|
22
|
+
background: '#F5F7F8',
|
|
23
|
+
paper: '#FFFFFF',
|
|
24
|
+
textPrimary: '#1E293B',
|
|
25
|
+
textSecondary: '#475569',
|
|
26
|
+
error: '#B3261E',
|
|
27
|
+
divider: '#E2E8F0',
|
|
28
|
+
},
|
|
29
|
+
dark: {
|
|
30
|
+
primary: '#5CC8D0',
|
|
31
|
+
primaryLight: '#8ADBE0',
|
|
32
|
+
primaryDark: '#2FA3AC',
|
|
33
|
+
onPrimary: '#0E1719',
|
|
34
|
+
accent: '#F2A900',
|
|
35
|
+
onAccent: '#1E293B',
|
|
36
|
+
accentText: '#F2A900',
|
|
37
|
+
background: '#0E1719',
|
|
38
|
+
paper: '#1A2427',
|
|
39
|
+
textPrimary: '#E6EDF0',
|
|
40
|
+
textSecondary: '#94A3B8',
|
|
41
|
+
error: '#FF8A80',
|
|
42
|
+
divider: '#2A373B',
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
/** The browser chrome colour (`<meta name="theme-color">`, the PWA manifest). */
|
|
46
|
+
export const BRAND_THEME_COLOR = BRAND_TOKENS.light.primary;
|
|
47
|
+
/** The product name shown in the app bar and the document title. */
|
|
48
|
+
export const PRODUCT_NAME = 'Vault';
|
|
49
|
+
/**
|
|
50
|
+
* The one-line product promise under the sign-in heading. Mirrors `tagline`
|
|
51
|
+
* in `packages/shared/identity.json` (the rebrand source);
|
|
52
|
+
* `__tests__/theme/tokens.test.ts` fails when the two drift.
|
|
53
|
+
*/
|
|
54
|
+
export const PRODUCT_TAGLINE = 'Your secrets, cards and documents, encrypted and versioned.';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payment card expiry status derivation.
|
|
3
|
+
*
|
|
4
|
+
* A stored card's expiry reaches us from a `Record<string, unknown>` whose shape
|
|
5
|
+
* is defined by a user-editable secret type, so every input here is untrusted: a
|
|
6
|
+
* field may be absent on card secrets created before the expiry fields existed,
|
|
7
|
+
* may be a number rather than a string, and may carry whatever the user typed.
|
|
8
|
+
* Nothing here throws — unusable input yields `'unknown'` so the cards view
|
|
9
|
+
* renders an honest "unknown expiry" badge instead of a plausible-but-wrong
|
|
10
|
+
* "valid".
|
|
11
|
+
*
|
|
12
|
+
* Pure functions only: no DOM access and no ambient clock read that a caller
|
|
13
|
+
* cannot override, so this is reusable from the renewal flow.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* A card counts as "expiring soon" once it is within this many days of lapsing.
|
|
17
|
+
*
|
|
18
|
+
* Exported so callers can describe the window ("expiring within 60 days")
|
|
19
|
+
* without restating the number and drifting out of sync with this module.
|
|
20
|
+
*/
|
|
21
|
+
export declare const EXPIRING_SOON_DAYS = 60;
|
|
22
|
+
/** The window, in milliseconds, used for the `expiring_soon` comparison. */
|
|
23
|
+
export declare const EXPIRING_SOON_MS: number;
|
|
24
|
+
export type CardExpiryStatus = 'expired' | 'expiring_soon' | 'valid' | 'unknown';
|
|
25
|
+
/**
|
|
26
|
+
* The instant a card stops being valid: midnight at the start of the month
|
|
27
|
+
* AFTER the printed expiry month.
|
|
28
|
+
*
|
|
29
|
+
* A card printed `07/2026` is good through 2026-07-31T23:59:59.999, so the
|
|
30
|
+
* exclusive end is 2026-08-01T00:00:00. Passing the 1-based month straight into
|
|
31
|
+
* the 0-based `Date` month argument produces exactly that next-month boundary,
|
|
32
|
+
* and `Date` normalises the December rollover (month 12 of 2026 becomes January
|
|
33
|
+
* 2027) on its own.
|
|
34
|
+
*
|
|
35
|
+
* Local time is deliberate: "my card expires at the end of July" is a statement
|
|
36
|
+
* about the cardholder's calendar, not UTC's.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getCardExpiryEnd(expMonth: unknown, expYear: unknown): Date | null;
|
|
39
|
+
/**
|
|
40
|
+
* Classify a stored card expiry relative to `now`.
|
|
41
|
+
*
|
|
42
|
+
* `now` is injectable so callers (and tests) are not at the mercy of the ambient
|
|
43
|
+
* clock. It defaults to the current time for ordinary UI use.
|
|
44
|
+
*
|
|
45
|
+
* A card is valid through the END of its expiry month, so a card marked 07/2026
|
|
46
|
+
* is still `'valid'` on 2026-07-31 and only becomes `'expired'` on 2026-08-01.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getCardExpiryStatus(expMonth: unknown, expYear: unknown, now?: Date): CardExpiryStatus;
|
|
49
|
+
/**
|
|
50
|
+
* Sort key for "soonest expiry first".
|
|
51
|
+
*
|
|
52
|
+
* Cards with an unusable expiry sort last: we cannot claim they need attention,
|
|
53
|
+
* and floating them to the top would bury the cards that actually do.
|
|
54
|
+
*/
|
|
55
|
+
export declare function getCardExpirySortKey(expMonth: unknown, expYear: unknown): number;
|
|
56
|
+
/** Whether a status is one the user should act on. */
|
|
57
|
+
export declare function isNeedsAttention(status: CardExpiryStatus): boolean;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payment card expiry status derivation.
|
|
3
|
+
*
|
|
4
|
+
* A stored card's expiry reaches us from a `Record<string, unknown>` whose shape
|
|
5
|
+
* is defined by a user-editable secret type, so every input here is untrusted: a
|
|
6
|
+
* field may be absent on card secrets created before the expiry fields existed,
|
|
7
|
+
* may be a number rather than a string, and may carry whatever the user typed.
|
|
8
|
+
* Nothing here throws — unusable input yields `'unknown'` so the cards view
|
|
9
|
+
* renders an honest "unknown expiry" badge instead of a plausible-but-wrong
|
|
10
|
+
* "valid".
|
|
11
|
+
*
|
|
12
|
+
* Pure functions only: no DOM access and no ambient clock read that a caller
|
|
13
|
+
* cannot override, so this is reusable from the renewal flow.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* A card counts as "expiring soon" once it is within this many days of lapsing.
|
|
17
|
+
*
|
|
18
|
+
* Exported so callers can describe the window ("expiring within 60 days")
|
|
19
|
+
* without restating the number and drifting out of sync with this module.
|
|
20
|
+
*/
|
|
21
|
+
export const EXPIRING_SOON_DAYS = 60;
|
|
22
|
+
const MS_PER_DAY = 24 * 60 * 60 * 1000;
|
|
23
|
+
/** The window, in milliseconds, used for the `expiring_soon` comparison. */
|
|
24
|
+
export const EXPIRING_SOON_MS = EXPIRING_SOON_DAYS * MS_PER_DAY;
|
|
25
|
+
/**
|
|
26
|
+
* Parse a stored expiry month into 1-12.
|
|
27
|
+
*
|
|
28
|
+
* Returns null rather than clamping: a stored `13` is a data problem, and
|
|
29
|
+
* silently reading it as December would put a wrong date in front of the user.
|
|
30
|
+
*/
|
|
31
|
+
function parseExpiryMonth(value) {
|
|
32
|
+
if (typeof value !== 'string' && typeof value !== 'number') {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const digits = String(value).trim();
|
|
36
|
+
// Reject anything that is not purely digits: '7abc' is not a month.
|
|
37
|
+
if (!/^\d{1,2}$/.test(digits)) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
const month = Number.parseInt(digits, 10);
|
|
41
|
+
if (month < 1 || month > 12) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
return month;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Parse a stored expiry year into a full four-digit year in 2000-2099.
|
|
48
|
+
*
|
|
49
|
+
* Deliberately stricter than `cardFormat`'s copy helpers, which expand a
|
|
50
|
+
* two-digit year into the 2000s for pasting into a checkout form. Guessing is
|
|
51
|
+
* safe when the user can see the result in the field they pasted into; it is not
|
|
52
|
+
* safe here, where the guess silently decides whether we tell someone their card
|
|
53
|
+
* is dead. A two-digit year therefore reads as `'unknown'` — an honest "we don't
|
|
54
|
+
* know" badge — rather than resolving `'20'` to 2020 and asserting "expired".
|
|
55
|
+
* The API normalises AI-imported years to four digits, so this is the canonical
|
|
56
|
+
* stored shape.
|
|
57
|
+
*/
|
|
58
|
+
function parseExpiryYear(value) {
|
|
59
|
+
if (typeof value !== 'string' && typeof value !== 'number') {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
const digits = String(value).trim();
|
|
63
|
+
if (!/^\d{4}$/.test(digits)) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
const year = Number.parseInt(digits, 10);
|
|
67
|
+
if (year < 2000 || year > 2099) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
return year;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The instant a card stops being valid: midnight at the start of the month
|
|
74
|
+
* AFTER the printed expiry month.
|
|
75
|
+
*
|
|
76
|
+
* A card printed `07/2026` is good through 2026-07-31T23:59:59.999, so the
|
|
77
|
+
* exclusive end is 2026-08-01T00:00:00. Passing the 1-based month straight into
|
|
78
|
+
* the 0-based `Date` month argument produces exactly that next-month boundary,
|
|
79
|
+
* and `Date` normalises the December rollover (month 12 of 2026 becomes January
|
|
80
|
+
* 2027) on its own.
|
|
81
|
+
*
|
|
82
|
+
* Local time is deliberate: "my card expires at the end of July" is a statement
|
|
83
|
+
* about the cardholder's calendar, not UTC's.
|
|
84
|
+
*/
|
|
85
|
+
export function getCardExpiryEnd(expMonth, expYear) {
|
|
86
|
+
const month = parseExpiryMonth(expMonth);
|
|
87
|
+
const year = parseExpiryYear(expYear);
|
|
88
|
+
if (month === null || year === null) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
return new Date(year, month, 1, 0, 0, 0, 0);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Classify a stored card expiry relative to `now`.
|
|
95
|
+
*
|
|
96
|
+
* `now` is injectable so callers (and tests) are not at the mercy of the ambient
|
|
97
|
+
* clock. It defaults to the current time for ordinary UI use.
|
|
98
|
+
*
|
|
99
|
+
* A card is valid through the END of its expiry month, so a card marked 07/2026
|
|
100
|
+
* is still `'valid'` on 2026-07-31 and only becomes `'expired'` on 2026-08-01.
|
|
101
|
+
*/
|
|
102
|
+
export function getCardExpiryStatus(expMonth, expYear, now = new Date()) {
|
|
103
|
+
const expiryEnd = getCardExpiryEnd(expMonth, expYear);
|
|
104
|
+
if (expiryEnd === null) {
|
|
105
|
+
return 'unknown';
|
|
106
|
+
}
|
|
107
|
+
// A caller can hand us an Invalid Date; treating it as a real instant would
|
|
108
|
+
// make every comparison false and mislabel every card 'valid'.
|
|
109
|
+
const nowMs = now.getTime();
|
|
110
|
+
if (Number.isNaN(nowMs)) {
|
|
111
|
+
return 'unknown';
|
|
112
|
+
}
|
|
113
|
+
const remainingMs = expiryEnd.getTime() - nowMs;
|
|
114
|
+
// The boundary instant itself is already past the card's last valid moment.
|
|
115
|
+
if (remainingMs <= 0) {
|
|
116
|
+
return 'expired';
|
|
117
|
+
}
|
|
118
|
+
// Inclusive: landing exactly on the threshold counts as expiring soon, so the
|
|
119
|
+
// warning appears a full window ahead rather than a millisecond short.
|
|
120
|
+
if (remainingMs <= EXPIRING_SOON_MS) {
|
|
121
|
+
return 'expiring_soon';
|
|
122
|
+
}
|
|
123
|
+
return 'valid';
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Sort key for "soonest expiry first".
|
|
127
|
+
*
|
|
128
|
+
* Cards with an unusable expiry sort last: we cannot claim they need attention,
|
|
129
|
+
* and floating them to the top would bury the cards that actually do.
|
|
130
|
+
*/
|
|
131
|
+
export function getCardExpirySortKey(expMonth, expYear) {
|
|
132
|
+
const expiryEnd = getCardExpiryEnd(expMonth, expYear);
|
|
133
|
+
return expiryEnd === null ? Number.POSITIVE_INFINITY : expiryEnd.getTime();
|
|
134
|
+
}
|
|
135
|
+
/** Whether a status is one the user should act on. */
|
|
136
|
+
export function isNeedsAttention(status) {
|
|
137
|
+
return status === 'expired' || status === 'expiring_soon';
|
|
138
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payment card formatting helpers.
|
|
3
|
+
*
|
|
4
|
+
* These exist so a stored card can be pasted straight into a checkout form.
|
|
5
|
+
* Stored values come from a `Record<string, unknown>` whose shape is defined by
|
|
6
|
+
* a user-editable secret type, so every input here is untrusted: a field may be
|
|
7
|
+
* absent on older card secrets, may be a number rather than a string, and may
|
|
8
|
+
* carry whatever separators the user typed. Every function returns a string and
|
|
9
|
+
* none of them throw — malformed input yields '' so a copy button degrades to a
|
|
10
|
+
* no-op instead of breaking the detail view.
|
|
11
|
+
*
|
|
12
|
+
* Pure functions only: no DOM access, so they are reusable from the cards view.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Card number as digits only — no spaces, no dashes.
|
|
16
|
+
*
|
|
17
|
+
* Checkout forms vary in whether they tolerate separators, and digits are
|
|
18
|
+
* universally accepted, so we normalise on paste.
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatCardNumberForCopy(value: unknown): string;
|
|
21
|
+
/**
|
|
22
|
+
* Security code (CVV/CVC) as digits only.
|
|
23
|
+
*/
|
|
24
|
+
export declare function formatSecurityCodeForCopy(value: unknown): string;
|
|
25
|
+
/**
|
|
26
|
+
* Expiry month as a zero-padded two-digit string, e.g. `3` -> `03`.
|
|
27
|
+
*
|
|
28
|
+
* Returns '' when the value is not a month in 1-12, so a garbage stored value
|
|
29
|
+
* never produces a plausible-looking-but-wrong `00`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function formatExpiryMonthForCopy(month: unknown): string;
|
|
32
|
+
/**
|
|
33
|
+
* Expiry year as two digits, e.g. `2029` -> `29`, `29` -> `29`.
|
|
34
|
+
*
|
|
35
|
+
* Accepts either a 2- or 4-digit stored year. Anything else returns ''.
|
|
36
|
+
*/
|
|
37
|
+
export declare function formatExpiryYearShortForCopy(year: unknown): string;
|
|
38
|
+
/**
|
|
39
|
+
* Expiry year as four digits, e.g. `29` -> `2029`, `2029` -> `2029`.
|
|
40
|
+
*
|
|
41
|
+
* A 2-digit year is expanded into the 2000s, matching how every card expiry in
|
|
42
|
+
* circulation is written.
|
|
43
|
+
*/
|
|
44
|
+
export declare function formatExpiryYearLongForCopy(year: unknown): string;
|
|
45
|
+
/**
|
|
46
|
+
* Expiry as `MM/YY`.
|
|
47
|
+
*
|
|
48
|
+
* Returns '' unless both halves are valid — a half-formed `12/` is worse than
|
|
49
|
+
* nothing in a checkout field.
|
|
50
|
+
*/
|
|
51
|
+
export declare function formatExpiryForCopy(month: unknown, year: unknown): string;
|
|
52
|
+
/**
|
|
53
|
+
* Display mask for a card number: all but the last four digits become bullets,
|
|
54
|
+
* grouped in fours — `•••• •••• •••• 4242`.
|
|
55
|
+
*
|
|
56
|
+
* For display only; never use this as a copy value. Cards shorter than five
|
|
57
|
+
* digits are masked entirely rather than leaking the whole number as "last
|
|
58
|
+
* four".
|
|
59
|
+
*/
|
|
60
|
+
export declare function maskCardNumber(value: unknown): string;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Payment card formatting helpers.
|
|
3
|
+
*
|
|
4
|
+
* These exist so a stored card can be pasted straight into a checkout form.
|
|
5
|
+
* Stored values come from a `Record<string, unknown>` whose shape is defined by
|
|
6
|
+
* a user-editable secret type, so every input here is untrusted: a field may be
|
|
7
|
+
* absent on older card secrets, may be a number rather than a string, and may
|
|
8
|
+
* carry whatever separators the user typed. Every function returns a string and
|
|
9
|
+
* none of them throw — malformed input yields '' so a copy button degrades to a
|
|
10
|
+
* no-op instead of breaking the detail view.
|
|
11
|
+
*
|
|
12
|
+
* Pure functions only: no DOM access, so they are reusable from the cards view.
|
|
13
|
+
*/
|
|
14
|
+
/** Coerce an unknown stored field into a trimmed string. */
|
|
15
|
+
function toStringValue(value) {
|
|
16
|
+
if (value === null || value === undefined) {
|
|
17
|
+
return '';
|
|
18
|
+
}
|
|
19
|
+
if (typeof value === 'string') {
|
|
20
|
+
return value.trim();
|
|
21
|
+
}
|
|
22
|
+
if (typeof value === 'number') {
|
|
23
|
+
return Number.isFinite(value) ? String(value) : '';
|
|
24
|
+
}
|
|
25
|
+
// Booleans, objects, arrays and symbols are never valid card fields.
|
|
26
|
+
return '';
|
|
27
|
+
}
|
|
28
|
+
/** Strip everything that is not a digit. */
|
|
29
|
+
function digitsOnly(value) {
|
|
30
|
+
return toStringValue(value).replace(/\D/g, '');
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Card number as digits only — no spaces, no dashes.
|
|
34
|
+
*
|
|
35
|
+
* Checkout forms vary in whether they tolerate separators, and digits are
|
|
36
|
+
* universally accepted, so we normalise on paste.
|
|
37
|
+
*/
|
|
38
|
+
export function formatCardNumberForCopy(value) {
|
|
39
|
+
return digitsOnly(value);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Security code (CVV/CVC) as digits only.
|
|
43
|
+
*/
|
|
44
|
+
export function formatSecurityCodeForCopy(value) {
|
|
45
|
+
return digitsOnly(value);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Expiry month as a zero-padded two-digit string, e.g. `3` -> `03`.
|
|
49
|
+
*
|
|
50
|
+
* Returns '' when the value is not a month in 1-12, so a garbage stored value
|
|
51
|
+
* never produces a plausible-looking-but-wrong `00`.
|
|
52
|
+
*/
|
|
53
|
+
export function formatExpiryMonthForCopy(month) {
|
|
54
|
+
const digits = digitsOnly(month);
|
|
55
|
+
if (digits === '') {
|
|
56
|
+
return '';
|
|
57
|
+
}
|
|
58
|
+
const parsed = Number.parseInt(digits, 10);
|
|
59
|
+
if (Number.isNaN(parsed) || parsed < 1 || parsed > 12) {
|
|
60
|
+
return '';
|
|
61
|
+
}
|
|
62
|
+
return String(parsed).padStart(2, '0');
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Expiry year as two digits, e.g. `2029` -> `29`, `29` -> `29`.
|
|
66
|
+
*
|
|
67
|
+
* Accepts either a 2- or 4-digit stored year. Anything else returns ''.
|
|
68
|
+
*/
|
|
69
|
+
export function formatExpiryYearShortForCopy(year) {
|
|
70
|
+
const digits = digitsOnly(year);
|
|
71
|
+
if (digits.length === 2) {
|
|
72
|
+
return digits;
|
|
73
|
+
}
|
|
74
|
+
if (digits.length === 4) {
|
|
75
|
+
return digits.slice(2);
|
|
76
|
+
}
|
|
77
|
+
return '';
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Expiry year as four digits, e.g. `29` -> `2029`, `2029` -> `2029`.
|
|
81
|
+
*
|
|
82
|
+
* A 2-digit year is expanded into the 2000s, matching how every card expiry in
|
|
83
|
+
* circulation is written.
|
|
84
|
+
*/
|
|
85
|
+
export function formatExpiryYearLongForCopy(year) {
|
|
86
|
+
const digits = digitsOnly(year);
|
|
87
|
+
if (digits.length === 4) {
|
|
88
|
+
return digits;
|
|
89
|
+
}
|
|
90
|
+
if (digits.length === 2) {
|
|
91
|
+
return `20${digits}`;
|
|
92
|
+
}
|
|
93
|
+
return '';
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Expiry as `MM/YY`.
|
|
97
|
+
*
|
|
98
|
+
* Returns '' unless both halves are valid — a half-formed `12/` is worse than
|
|
99
|
+
* nothing in a checkout field.
|
|
100
|
+
*/
|
|
101
|
+
export function formatExpiryForCopy(month, year) {
|
|
102
|
+
const mm = formatExpiryMonthForCopy(month);
|
|
103
|
+
const yy = formatExpiryYearShortForCopy(year);
|
|
104
|
+
if (mm === '' || yy === '') {
|
|
105
|
+
return '';
|
|
106
|
+
}
|
|
107
|
+
return `${mm}/${yy}`;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Display mask for a card number: all but the last four digits become bullets,
|
|
111
|
+
* grouped in fours — `•••• •••• •••• 4242`.
|
|
112
|
+
*
|
|
113
|
+
* For display only; never use this as a copy value. Cards shorter than five
|
|
114
|
+
* digits are masked entirely rather than leaking the whole number as "last
|
|
115
|
+
* four".
|
|
116
|
+
*/
|
|
117
|
+
export function maskCardNumber(value) {
|
|
118
|
+
const digits = digitsOnly(value);
|
|
119
|
+
if (digits === '') {
|
|
120
|
+
return '';
|
|
121
|
+
}
|
|
122
|
+
const VISIBLE = 4;
|
|
123
|
+
// Too short to reveal a meaningful "last four" without leaking the whole
|
|
124
|
+
// number, so mask all of it.
|
|
125
|
+
if (digits.length <= VISIBLE) {
|
|
126
|
+
return '•'.repeat(digits.length);
|
|
127
|
+
}
|
|
128
|
+
const hiddenCount = digits.length - VISIBLE;
|
|
129
|
+
const last = digits.slice(hiddenCount);
|
|
130
|
+
// Group the masked portion in fours and keep the visible digits as their own
|
|
131
|
+
// trailing group, so a 15-digit Amex renders '•••• •••• ••• 4242' rather than
|
|
132
|
+
// splitting the real digits across groups.
|
|
133
|
+
const maskedGroups = '•'.repeat(hiddenCount).match(/.{1,4}/g) ?? [];
|
|
134
|
+
return [...maskedGroups, last].join(' ');
|
|
135
|
+
}
|