@coffre/ui 0.15.0 → 0.16.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.
Files changed (139) hide show
  1. package/dist/audit-sentences.d.ts +56 -0
  2. package/dist/audit-sentences.js +886 -0
  3. package/dist/audit-sentences.js.map +1 -0
  4. package/dist/chunks/audit-sentence-C8NnAdjF.js +48 -0
  5. package/dist/chunks/audit-sentence-C8NnAdjF.js.map +1 -0
  6. package/dist/chunks/{connected-apps-CGUQlFMx.js → connected-apps-6sMSgQ9U.js} +5 -5
  7. package/dist/chunks/{connected-apps-CGUQlFMx.js.map → connected-apps-6sMSgQ9U.js.map} +1 -1
  8. package/dist/chunks/{delete-place-CswZ-meh.js → delete-place-T469tSN9.js} +5 -5
  9. package/dist/chunks/{delete-place-CswZ-meh.js.map → delete-place-T469tSN9.js.map} +1 -1
  10. package/dist/chunks/{directory-DrswWQLT.js → directory-B_gVf7UL.js} +18 -17
  11. package/dist/chunks/directory-B_gVf7UL.js.map +1 -0
  12. package/dist/chunks/{folders-A6sbR_PG.js → folders-CVYauIDz.js} +3 -3
  13. package/dist/chunks/{folders-A6sbR_PG.js.map → folders-CVYauIDz.js.map} +1 -1
  14. package/dist/chunks/{grants-C0cb2oii.js → grants-Dn_EW2XW.js} +8 -8
  15. package/dist/chunks/grants-Dn_EW2XW.js.map +1 -0
  16. package/dist/chunks/{multi-combobox-B3SEv1gq.js → multi-combobox-fbBRzi9z.js} +3 -3
  17. package/dist/chunks/{multi-combobox-B3SEv1gq.js.map → multi-combobox-fbBRzi9z.js.map} +1 -1
  18. package/dist/chunks/{offboarding-C1jbG_dk.js → offboarding-CXM464J_.js} +81 -80
  19. package/dist/chunks/offboarding-CXM464J_.js.map +1 -0
  20. package/dist/chunks/{page-CfhC9Hp1.js → page-Cb0ZjGda.js} +7 -12
  21. package/dist/chunks/page-Cb0ZjGda.js.map +1 -0
  22. package/dist/chunks/{personal-tokens-xC9wulhg.js → personal-tokens-CSHMlRHy.js} +7 -7
  23. package/dist/chunks/personal-tokens-CSHMlRHy.js.map +1 -0
  24. package/dist/chunks/{principal-CI17XK13.js → principal-BKJxbAtE.js} +2 -2
  25. package/dist/chunks/{principal-CI17XK13.js.map → principal-BKJxbAtE.js.map} +1 -1
  26. package/dist/chunks/{principal-page-CdSeftGD.js → principal-page-COPmTDVW.js} +132 -19
  27. package/dist/chunks/principal-page-COPmTDVW.js.map +1 -0
  28. package/dist/chunks/{project-page-CHxjBE97.js → project-page-g5_n46Nz.js} +3 -3
  29. package/dist/chunks/{project-page-CHxjBE97.js.map → project-page-g5_n46Nz.js.map} +1 -1
  30. package/dist/chunks/protected-DEWeOrmI.js +77 -0
  31. package/dist/chunks/protected-DEWeOrmI.js.map +1 -0
  32. package/dist/chunks/{queries-D1JuimTu.js → queries-D4_o-bz3.js} +22 -155
  33. package/dist/chunks/queries-D4_o-bz3.js.map +1 -0
  34. package/dist/chunks/{references-D5llUGQL.js → references-wTh_DT0M.js} +27 -23
  35. package/dist/chunks/references-wTh_DT0M.js.map +1 -0
  36. package/dist/chunks/{role-field-CoCv8wse.js → role-field-BiP09qfN.js} +5 -5
  37. package/dist/chunks/role-field-BiP09qfN.js.map +1 -0
  38. package/dist/chunks/{row-state-CYH7kZHl.js → row-state-CYhtmUkc.js} +3 -3
  39. package/dist/chunks/{row-state-CYH7kZHl.js.map → row-state-CYhtmUkc.js.map} +1 -1
  40. package/dist/chunks/{signin-errors-TlQmQe0t.js → signin-errors-BMnox7XD.js} +5 -19
  41. package/dist/chunks/signin-errors-BMnox7XD.js.map +1 -0
  42. package/dist/chunks/{theme-rF44Wbmm.js → theme-imSolE1q.js} +3 -3
  43. package/dist/chunks/{theme-rF44Wbmm.js.map → theme-imSolE1q.js.map} +1 -1
  44. package/dist/chunks/{ui-CGdORVzW.js → ui-Q_Eczt7m.js} +7 -3
  45. package/dist/chunks/{ui-CGdORVzW.js.map → ui-Q_Eczt7m.js.map} +1 -1
  46. package/dist/chunks/{use-action-BxrHTBZw.js → use-action-BfnN-De2.js} +3 -3
  47. package/dist/chunks/{use-action-BxrHTBZw.js.map → use-action-BfnN-De2.js.map} +1 -1
  48. package/dist/chunks/{use-change-BorW2R6C.js → use-change-Cc0X4sF3.js} +6 -4
  49. package/dist/chunks/use-change-Cc0X4sF3.js.map +1 -0
  50. package/dist/chunks/{use-roles-BZnJ9Cq0.js → use-roles-stcv2QFj.js} +13 -56
  51. package/dist/chunks/use-roles-stcv2QFj.js.map +1 -0
  52. package/dist/chunks/{use-shell-CPskgi1k.js → use-shell-DMhLa2sh.js} +3 -3
  53. package/dist/chunks/{use-shell-CPskgi1k.js.map → use-shell-DMhLa2sh.js.map} +1 -1
  54. package/dist/index.d.ts +23 -55
  55. package/dist/index.js +12 -31
  56. package/dist/index.js.map +1 -1
  57. package/dist/pages/account.js +12 -12
  58. package/dist/pages/account.js.map +1 -1
  59. package/dist/pages/approval.js +2 -2
  60. package/dist/pages/audit.js +173 -196
  61. package/dist/pages/audit.js.map +1 -1
  62. package/dist/pages/device-login.js +2 -2
  63. package/dist/pages/environment.js +445 -252
  64. package/dist/pages/environment.js.map +1 -1
  65. package/dist/pages/login.js +6 -15
  66. package/dist/pages/login.js.map +1 -1
  67. package/dist/pages/oauth-authorize.js +2 -2
  68. package/dist/pages/project-access.js +11 -11
  69. package/dist/pages/project-environments.js +359 -28
  70. package/dist/pages/project-environments.js.map +1 -1
  71. package/dist/pages/project-settings.js +8 -8
  72. package/dist/pages/project.js +3 -3
  73. package/dist/pages/projects.js +8 -8
  74. package/dist/pages/service-account.js +19 -16
  75. package/dist/pages/service-account.js.map +1 -1
  76. package/dist/pages/service-accounts.js +6 -7
  77. package/dist/pages/service-accounts.js.map +1 -1
  78. package/dist/pages/settings.d.ts +1 -6
  79. package/dist/pages/settings.js +155 -286
  80. package/dist/pages/settings.js.map +1 -1
  81. package/dist/pages/unregistered.js +2 -2
  82. package/dist/pages/user.js +7 -8
  83. package/dist/pages/user.js.map +1 -1
  84. package/dist/pages/users.js +6 -7
  85. package/dist/pages/users.js.map +1 -1
  86. package/package.json +8 -3
  87. package/src/components/actions-log.tsx +8 -61
  88. package/src/components/directory.tsx +10 -9
  89. package/src/components/grants.tsx +2 -2
  90. package/src/components/icons.tsx +0 -2
  91. package/src/components/offboarding.tsx +9 -16
  92. package/src/components/page.tsx +2 -3
  93. package/src/components/personal-tokens.tsx +5 -2
  94. package/src/components/principal-page.tsx +5 -4
  95. package/src/components/protected.tsx +39 -52
  96. package/src/components/references.tsx +18 -7
  97. package/src/components/role-editor.tsx +68 -99
  98. package/src/components/role-field.tsx +1 -1
  99. package/src/components/trusted-workloads.tsx +6 -5
  100. package/src/components/ui.tsx +5 -0
  101. package/src/lib/audit-proofs.ts +51 -0
  102. package/src/lib/audit-sentences.ts +490 -529
  103. package/src/lib/bindings.ts +6 -0
  104. package/src/lib/changes.ts +3 -1
  105. package/src/lib/coffre.ts +2 -2
  106. package/src/lib/queries.ts +19 -168
  107. package/src/lib/reveal.ts +32 -5
  108. package/src/lib/roles.ts +10 -36
  109. package/src/lib/row-reads.ts +2 -2
  110. package/src/lib/signin-errors.ts +5 -33
  111. package/src/options.ts +3 -19
  112. package/src/pages/account.tsx +1 -1
  113. package/src/pages/audit.tsx +151 -228
  114. package/src/pages/environment.tsx +373 -247
  115. package/src/pages/login.tsx +2 -4
  116. package/src/pages/project-environments.tsx +322 -20
  117. package/src/pages/service-accounts.tsx +1 -1
  118. package/src/pages/settings.tsx +49 -134
  119. package/src/pages/user.tsx +2 -2
  120. package/src/pages/users.tsx +1 -1
  121. package/src/parity.ts +11 -20
  122. package/src/styles/globals.css +107 -273
  123. package/dist/chunks/actions-log-DupYCEyV.js +0 -1134
  124. package/dist/chunks/actions-log-DupYCEyV.js.map +0 -1
  125. package/dist/chunks/directory-DrswWQLT.js.map +0 -1
  126. package/dist/chunks/environment-actions-8rL9Cw6X.js +0 -576
  127. package/dist/chunks/environment-actions-8rL9Cw6X.js.map +0 -1
  128. package/dist/chunks/grants-C0cb2oii.js.map +0 -1
  129. package/dist/chunks/offboarding-C1jbG_dk.js.map +0 -1
  130. package/dist/chunks/page-CfhC9Hp1.js.map +0 -1
  131. package/dist/chunks/personal-tokens-xC9wulhg.js.map +0 -1
  132. package/dist/chunks/principal-page-CdSeftGD.js.map +0 -1
  133. package/dist/chunks/queries-D1JuimTu.js.map +0 -1
  134. package/dist/chunks/references-D5llUGQL.js.map +0 -1
  135. package/dist/chunks/role-field-CoCv8wse.js.map +0 -1
  136. package/dist/chunks/signin-errors-TlQmQe0t.js.map +0 -1
  137. package/dist/chunks/use-change-BorW2R6C.js.map +0 -1
  138. package/dist/chunks/use-roles-BZnJ9Cq0.js.map +0 -1
  139. package/src/components/environment-actions.tsx +0 -508
@@ -1 +1 @@
1
- {"version":3,"file":"folders-A6sbR_PG.js","names":[],"sources":["../../src/components/folders.tsx"],"sourcesContent":["import { useEffect, useId, useState, type ReactNode } from 'react';\nimport { Menu } from '@base-ui/react/menu';\n\nimport { folderProblem } from '../lib/validation';\nimport { Folder, MoreHorizontal, Pencil, X } from './icons';\nimport { ConfirmDialog, MenuPopup, Modal } from './ui';\n\n/**\n * A folder's heading row inside a table: the rows after it, up to the next\n * heading, are filed in it. Folders only arrange a list\n * (docs/design/environments.md).\n */\nexport function FolderRow({ folder, count, columns, actions }: { folder: string; count: number; columns: number; actions?: ReactNode }) {\n return (\n <tr className=\"folder-row\">\n <th colSpan={columns} scope=\"rowgroup\">\n <span className=\"folder-row-head\">\n <span className=\"th\">\n <Folder size={14} />\n {folder}\n <span className=\"count\">{count}</span>\n </span>\n {actions}\n </span>\n </th>\n </tr>\n );\n}\n\n/**\n * A folder heading's menu: rename it, which re-files everything in it, or\n * remove it, which takes everything out. A folder is only a label, so what\n * was in it stays where it is, and a rename onto a folder in use merges the\n * two.\n */\nexport function FolderMenu({\n folder,\n count,\n what,\n folders,\n onRename,\n onRemove,\n}: {\n folder: string;\n count: number;\n /** What it holds, as a sentence counts them: `project`, `key`. */\n what: string;\n /** The other folders in use beside it, offered as you type. */\n folders: readonly string[];\n onRename: (name: string) => void;\n onRemove: () => void;\n}) {\n const [renaming, setRenaming] = useState(false);\n const [removing, setRemoving] = useState(false);\n const [name, setName] = useState(folder);\n const listId = useId();\n useEffect(() => {\n if (renaming) setName(folder);\n }, [renaming, folder]);\n const problem = folderProblem(name);\n const merges = name !== folder && folders.includes(name);\n const items = `${count} ${what}${count === 1 ? '' : 's'}`;\n\n return (\n <>\n <Menu.Root>\n <Menu.Trigger className=\"act act-icon act-quiet folder-row-menu\" aria-label={`Actions for the folder ${folder}`}>\n <MoreHorizontal size={16} />\n </Menu.Trigger>\n <MenuPopup align=\"end\">\n <Menu.Item className=\"menu-item\" onClick={() => setRenaming(true)}>\n <Pencil size={14} />\n Rename folder…\n </Menu.Item>\n <Menu.Item className=\"menu-item menu-item-danger\" onClick={() => setRemoving(true)}>\n <X size={14} />\n Remove folder…\n </Menu.Item>\n </MenuPopup>\n </Menu.Root>\n\n <Modal\n open={renaming}\n onOpenChange={setRenaming}\n title={`Rename ${folder}`}\n description={`Its ${items} move with it. Nothing else changes.`}\n >\n <form\n className=\"form\"\n onSubmit={(event) => {\n event.preventDefault();\n if (problem !== null || name === '' || name === folder) return;\n onRename(name);\n setRenaming(false);\n }}\n >\n <label className=\"field\">\n <span className=\"label\">Name</span>\n <input\n className=\"input\"\n autoFocus\n spellCheck={false}\n autoComplete=\"off\"\n list={listId}\n value={name}\n aria-invalid={problem !== null}\n onChange={(event) => setName(event.target.value)}\n />\n <datalist id={listId}>\n {folders.filter((each) => each !== folder).map((each) => (\n <option key={each} value={each} />\n ))}\n </datalist>\n <span className={`hint${problem !== null ? ' edit-note-error' : ''}`}>\n {problem ?? (merges ? `${name} is in use: the two become one folder.` : 'One level: no slash.')}\n </span>\n </label>\n <div className=\"dialog-actions\">\n <button className=\"btn\" type=\"button\" onClick={() => setRenaming(false)}>\n Cancel\n </button>\n <button className=\"btn btn-primary\" type=\"submit\" disabled={problem !== null || name === '' || name === folder}>\n {merges ? 'Merge' : 'Rename'}\n </button>\n </div>\n </form>\n </Modal>\n\n <ConfirmDialog\n open={removing}\n onOpenChange={setRemoving}\n title={`Remove the folder ${folder}?`}\n body={`Its ${items} stay where they are, in no folder. Nothing else changes.`}\n confirmLabel=\"Remove folder\"\n onConfirm={onRemove}\n />\n </>\n );\n}\n\n/**\n * Where to file something: a folder by name, one already in use or a new\n * one, or none. Asked in a dialog, since it is one field and one decision.\n */\nexport function MoveToFolder({\n open,\n onOpenChange,\n what,\n current,\n folders,\n onMove,\n}: {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** What moves, as the title names it: \"STRIPE_KEY\". */\n what: string;\n current: string | null;\n /** The folders in use beside it, offered as you type. */\n folders: readonly string[];\n onMove: (folder: string | null) => void;\n}) {\n const [name, setName] = useState(current ?? '');\n const listId = useId();\n useEffect(() => {\n if (open) setName(current ?? '');\n }, [open, current]);\n const problem = folderProblem(name);\n const folder = name === '' ? null : name;\n\n return (\n <Modal\n open={open}\n onOpenChange={onOpenChange}\n title={`Move ${what} to a folder`}\n description=\"Folders only arrange the list: names, values and access stay as they are.\"\n >\n <form\n className=\"form\"\n onSubmit={(event) => {\n event.preventDefault();\n if (problem !== null) return;\n if (folder !== current) onMove(folder);\n onOpenChange(false);\n }}\n >\n <label className=\"field\">\n <span className=\"label\">Folder</span>\n <input\n className=\"input\"\n autoFocus\n spellCheck={false}\n autoComplete=\"off\"\n list={listId}\n placeholder=\"No folder\"\n value={name}\n aria-invalid={problem !== null}\n onChange={(event) => setName(event.target.value)}\n />\n <datalist id={listId}>\n {folders.map((each) => (\n <option key={each} value={each} />\n ))}\n </datalist>\n <span className={`hint${problem !== null ? ' edit-note-error' : ''}`}>\n {problem ?? 'Pick one in use, or name a new one. Empty for no folder.'}\n </span>\n </label>\n <div className=\"dialog-actions\">\n <button className=\"btn\" type=\"button\" onClick={() => onOpenChange(false)}>\n Cancel\n </button>\n <button className=\"btn btn-primary\" type=\"submit\" disabled={problem !== null || folder === current}>\n {folder === null && current !== null ? 'Take out of its folder' : 'Move'}\n </button>\n </div>\n </form>\n </Modal>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAgB,UAAU,EAAE,QAAQ,OAAO,SAAS,WAAoF;CACtI,OACE,oBAAC,MAAD;EAAI,WAAU;YACZ,oBAAC,MAAD;GAAI,SAAS;GAAS,OAAM;aAC1B,qBAAC,QAAD;IAAM,WAAU;cAAhB,CACE,qBAAC,QAAD;KAAM,WAAU;eAAhB;MACE,oBAAC,QAAD,EAAQ,MAAM,GAAK,CAAA;MAClB;MACD,oBAAC,QAAD;OAAM,WAAU;iBAAS;MAAY,CAAA;KACjC;QACL,OACG;;EACJ,CAAA;CACF,CAAA;AAER;;;;;;;AAQA,SAAgB,WAAW,EACzB,QACA,OACA,MACA,SACA,UACA,YAUC;CACD,MAAM,CAAC,UAAU,eAAe,SAAS,KAAK;CAC9C,MAAM,CAAC,UAAU,eAAe,SAAS,KAAK;CAC9C,MAAM,CAAC,MAAM,WAAW,SAAS,MAAM;CACvC,MAAM,SAAS,MAAM;CACrB,gBAAgB;EACd,IAAI,UAAU,QAAQ,MAAM;CAC9B,GAAG,CAAC,UAAU,MAAM,CAAC;CACrB,MAAM,UAAU,cAAc,IAAI;CAClC,MAAM,SAAS,SAAS,UAAU,QAAQ,SAAS,IAAI;CACvD,MAAM,QAAQ,GAAG,MAAM,GAAG,OAAO,UAAU,IAAI,KAAK;CAEpD,OACE,qBAAA,YAAA,EAAA,UAAA;EACE,qBAAC,KAAK,MAAN,EAAA,UAAA,CACE,oBAAC,KAAK,SAAN;GAAc,WAAU;GAAyC,cAAY,0BAA0B;aACrG,oBAAC,gBAAD,EAAgB,MAAM,GAAK,CAAA;EACf,CAAA,GACd,qBAAC,WAAD;GAAW,OAAM;aAAjB,CACE,qBAAC,KAAK,MAAN;IAAW,WAAU;IAAY,eAAe,YAAY,IAAI;cAAhE,CACE,oBAAC,QAAD,EAAQ,MAAM,GAAK,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Q,WAAU;KAAkB,MAAK;KAAS,UAAU,YAAY,QAAQ,WAAW;eACxF,WAAW,QAAQ,YAAY,OAAO,2BAA2B;IAC5D,CAAA,CACL;KACD;;CACD,CAAA;AAEX"}
1
+ {"version":3,"file":"folders-CVYauIDz.js","names":[],"sources":["../../src/components/folders.tsx"],"sourcesContent":["import { useEffect, useId, useState, type ReactNode } from 'react';\nimport { Menu } from '@base-ui/react/menu';\n\nimport { folderProblem } from '../lib/validation';\nimport { Folder, MoreHorizontal, Pencil, X } from './icons';\nimport { ConfirmDialog, MenuPopup, Modal } from './ui';\n\n/**\n * A folder's heading row inside a table: the rows after it, up to the next\n * heading, are filed in it. Folders only arrange a list\n * (docs/design/environments.md).\n */\nexport function FolderRow({ folder, count, columns, actions }: { folder: string; count: number; columns: number; actions?: ReactNode }) {\n return (\n <tr className=\"folder-row\">\n <th colSpan={columns} scope=\"rowgroup\">\n <span className=\"folder-row-head\">\n <span className=\"th\">\n <Folder size={14} />\n {folder}\n <span className=\"count\">{count}</span>\n </span>\n {actions}\n </span>\n </th>\n </tr>\n );\n}\n\n/**\n * A folder heading's menu: rename it, which re-files everything in it, or\n * remove it, which takes everything out. A folder is only a label, so what\n * was in it stays where it is, and a rename onto a folder in use merges the\n * two.\n */\nexport function FolderMenu({\n folder,\n count,\n what,\n folders,\n onRename,\n onRemove,\n}: {\n folder: string;\n count: number;\n /** What it holds, as a sentence counts them: `project`, `key`. */\n what: string;\n /** The other folders in use beside it, offered as you type. */\n folders: readonly string[];\n onRename: (name: string) => void;\n onRemove: () => void;\n}) {\n const [renaming, setRenaming] = useState(false);\n const [removing, setRemoving] = useState(false);\n const [name, setName] = useState(folder);\n const listId = useId();\n useEffect(() => {\n if (renaming) setName(folder);\n }, [renaming, folder]);\n const problem = folderProblem(name);\n const merges = name !== folder && folders.includes(name);\n const items = `${count} ${what}${count === 1 ? '' : 's'}`;\n\n return (\n <>\n <Menu.Root>\n <Menu.Trigger className=\"act act-icon act-quiet folder-row-menu\" aria-label={`Actions for the folder ${folder}`}>\n <MoreHorizontal size={16} />\n </Menu.Trigger>\n <MenuPopup align=\"end\">\n <Menu.Item className=\"menu-item\" onClick={() => setRenaming(true)}>\n <Pencil size={14} />\n Rename folder…\n </Menu.Item>\n <Menu.Item className=\"menu-item menu-item-danger\" onClick={() => setRemoving(true)}>\n <X size={14} />\n Remove folder…\n </Menu.Item>\n </MenuPopup>\n </Menu.Root>\n\n <Modal\n open={renaming}\n onOpenChange={setRenaming}\n title={`Rename ${folder}`}\n description={`Its ${items} move with it. Nothing else changes.`}\n >\n <form\n className=\"form\"\n onSubmit={(event) => {\n event.preventDefault();\n if (problem !== null || name === '' || name === folder) return;\n onRename(name);\n setRenaming(false);\n }}\n >\n <label className=\"field\">\n <span className=\"label\">Name</span>\n <input\n className=\"input\"\n autoFocus\n spellCheck={false}\n autoComplete=\"off\"\n list={listId}\n value={name}\n aria-invalid={problem !== null}\n onChange={(event) => setName(event.target.value)}\n />\n <datalist id={listId}>\n {folders.filter((each) => each !== folder).map((each) => (\n <option key={each} value={each} />\n ))}\n </datalist>\n <span className={`hint${problem !== null ? ' edit-note-error' : ''}`}>\n {problem ?? (merges ? `${name} is in use: the two become one folder.` : 'One level: no slash.')}\n </span>\n </label>\n <div className=\"dialog-actions\">\n <button className=\"btn\" type=\"button\" onClick={() => setRenaming(false)}>\n Cancel\n </button>\n <button className=\"btn btn-primary\" type=\"submit\" disabled={problem !== null || name === '' || name === folder}>\n {merges ? 'Merge' : 'Rename'}\n </button>\n </div>\n </form>\n </Modal>\n\n <ConfirmDialog\n open={removing}\n onOpenChange={setRemoving}\n title={`Remove the folder ${folder}?`}\n body={`Its ${items} stay where they are, in no folder. Nothing else changes.`}\n confirmLabel=\"Remove folder\"\n onConfirm={onRemove}\n />\n </>\n );\n}\n\n/**\n * Where to file something: a folder by name, one already in use or a new\n * one, or none. Asked in a dialog, since it is one field and one decision.\n */\nexport function MoveToFolder({\n open,\n onOpenChange,\n what,\n current,\n folders,\n onMove,\n}: {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** What moves, as the title names it: \"STRIPE_KEY\". */\n what: string;\n current: string | null;\n /** The folders in use beside it, offered as you type. */\n folders: readonly string[];\n onMove: (folder: string | null) => void;\n}) {\n const [name, setName] = useState(current ?? '');\n const listId = useId();\n useEffect(() => {\n if (open) setName(current ?? '');\n }, [open, current]);\n const problem = folderProblem(name);\n const folder = name === '' ? null : name;\n\n return (\n <Modal\n open={open}\n onOpenChange={onOpenChange}\n title={`Move ${what} to a folder`}\n description=\"Folders only arrange the list: names, values and access stay as they are.\"\n >\n <form\n className=\"form\"\n onSubmit={(event) => {\n event.preventDefault();\n if (problem !== null) return;\n if (folder !== current) onMove(folder);\n onOpenChange(false);\n }}\n >\n <label className=\"field\">\n <span className=\"label\">Folder</span>\n <input\n className=\"input\"\n autoFocus\n spellCheck={false}\n autoComplete=\"off\"\n list={listId}\n placeholder=\"No folder\"\n value={name}\n aria-invalid={problem !== null}\n onChange={(event) => setName(event.target.value)}\n />\n <datalist id={listId}>\n {folders.map((each) => (\n <option key={each} value={each} />\n ))}\n </datalist>\n <span className={`hint${problem !== null ? ' edit-note-error' : ''}`}>\n {problem ?? 'Pick one in use, or name a new one. Empty for no folder.'}\n </span>\n </label>\n <div className=\"dialog-actions\">\n <button className=\"btn\" type=\"button\" onClick={() => onOpenChange(false)}>\n Cancel\n </button>\n <button className=\"btn btn-primary\" type=\"submit\" disabled={problem !== null || folder === current}>\n {folder === null && current !== null ? 'Take out of its folder' : 'Move'}\n </button>\n </div>\n </form>\n </Modal>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAgB,UAAU,EAAE,QAAQ,OAAO,SAAS,WAAoF;CACtI,OACE,oBAAC,MAAD;EAAI,WAAU;YACZ,oBAAC,MAAD;GAAI,SAAS;GAAS,OAAM;aAC1B,qBAAC,QAAD;IAAM,WAAU;cAAhB,CACE,qBAAC,QAAD;KAAM,WAAU;eAAhB;MACE,oBAAC,QAAD,EAA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U,cAAc,IAAI;CAClC,MAAM,SAAS,SAAS,KAAK,OAAO;CAEpC,OACE,oBAAC,OAAD;EACQ;EACQ;EACd,OAAO,QAAQ,KAAK;EACpB,aAAY;YAEZ,qBAAC,QAAD;GACE,WAAU;GACV,WAAW,UAAU;IACnB,MAAM,eAAe;IACrB,IAAI,YAAY,MAAM;IACtB,IAAI,WAAW,SAAS,OAAO,MAAM;IACrC,aAAa,KAAK;GACpB;aAPF,CASE,qBAAC,SAAD;IAAO,WAAU;cAAjB;KACE,oBAAC,QAAD;MAAM,WAAU;gBAAQ;KAAY,CAAA;KACpC,oBAAC,SAAD;MACE,WAAU;MACV,WAAA;MACA,YAAY;MACZ,cAAa;MACb,MAAM;MACN,aAAY;MACZ,OAAO;MACP,gBAAc,YAAY;MAC1B,WAAW,UAAU,QAAQ,MAAM,OAAO,KAAK;KAChD,CAAA;KACD,oBAAC,YAAD;MAAU,IAAI;gBACX,QAAQ,KAAK,SACZ,oBAAC,UAAD,EAAmB,OAAO,KAAO,GAApB,IAAoB,CAClC;KACO,CAAA;KACV,oBAAC,QAAD;MAAM,WAAW,OAAO,YAAY,OAAO,qBAAqB;gBAC7D,WAAW;KACR,CAAA;IACD;OACP,qBAAC,OAAD;IAAK,WAAU;cAAf,CACE,oBAAC,UAAD;KAAQ,WAAU;KAAM,MAAK;KAAS,eAAe,aAAa,KAAK;eAAG;IAElE,CAAA,GACR,oBAAC,UAAD;KAAQ,WAAU;KAAkB,MAAK;KAAS,UAAU,YAAY,QAAQ,WAAW;eACxF,WAAW,QAAQ,YAAY,OAAO,2BAA2B;IAC5D,CAAA,CACL;KACD;;CACD,CAAA;AAEX"}
@@ -1,8 +1,8 @@
1
- import { o as keys } from "./queries-D1JuimTu.js";
2
- import { t as ConfirmButton } from "./ui-CGdORVzW.js";
3
- import { S as Clock, Z as ShieldCheck, u as useCoffre } from "./page-CfhC9Hp1.js";
4
- import { a as rowClass, i as RowPending, r as RowFailure } from "./row-state-CYH7kZHl.js";
5
- import { M as revokeGrant, Z as projectAccessLabel, n as useChangeStatus, t as useChange, y as grantId } from "./use-change-BorW2R6C.js";
1
+ import { i as keys } from "./queries-D4_o-bz3.js";
2
+ import { t as ConfirmButton } from "./ui-Q_Eczt7m.js";
3
+ import { S as Clock, X as ShieldCheck, u as useCoffre } from "./page-Cb0ZjGda.js";
4
+ import { a as rowClass, i as RowPending, r as RowFailure } from "./row-state-CYhtmUkc.js";
5
+ import { M as revokeGrant, Z as projectAccessLabel, n as useChangeStatus, t as useChange, y as grantId } from "./use-change-Cc0X4sF3.js";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
7
  //#region src/components/grants.tsx
8
8
  /**
@@ -75,8 +75,8 @@ function GrantRowView({ number, project, grant, lead, leadLabel }) {
75
75
  children: label
76
76
  }), byRole && /* @__PURE__ */ jsx("span", {
77
77
  className: "role-scope",
78
- title: "Their global role reaches this project. Change it on their page in Users.",
79
- children: "global role"
78
+ title: "Their instance role reaches this project. Change it on their page in Users.",
79
+ children: "instance role"
80
80
  })]
81
81
  }),
82
82
  /* @__PURE__ */ jsx("td", {
@@ -161,4 +161,4 @@ function useRefusedGrants(project, grants, principalType) {
161
161
  //#endregion
162
162
  export { useRefusedGrants as i, GrantsTable as n, RefusedGrants as r, GrantRowView as t };
163
163
 
164
- //# sourceMappingURL=grants-C0cb2oii.js.map
164
+ //# sourceMappingURL=grants-Dn_EW2XW.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grants-Dn_EW2XW.js","names":[],"sources":["../../src/components/grants.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { grantId, revokeGrant, type GrantVars } from '../lib/changes';\nimport type { FailedAdd } from '../lib/optimistic';\nimport { useCoffre } from '../lib/coffre';\nimport { projectAccessLabel } from '../lib/project-access';\nimport { keys } from '../lib/queries';\nimport { useChange, useChangeStatus } from '../lib/use-change';\nimport type { GrantRow } from '../shared/models';\nimport { RowFailure, RowPending, rowClass } from './row-state';\nimport { ConfirmButton } from './ui';\nimport { Clock, ShieldCheck } from './icons';\n\n/**\n * Grants as a table: who or where in the first column, then the access, when\n * it lapses, and a revoke.\n *\n * A project's page leads each row with the principal; a user's page leads with\n * the project. Everything after the first column is the same grant either way.\n */\nexport function GrantsTable({ lead, children }: { lead: ReactNode; children: ReactNode }) {\n return (\n <div className=\"dt-wrap\">\n <table className=\"dt grants stacks\">\n <thead>\n <tr>\n <th className=\"n\">#</th>\n <th className=\"col-principal\">{lead}</th>\n <th>\n <span className=\"th\">\n <ShieldCheck size={14} />\n Permissions\n </span>\n </th>\n <th className=\"col-expires\">\n <span className=\"th\">\n <Clock size={14} />\n Expires\n </span>\n </th>\n <th className=\"col-actions\">\n <span className=\"visually-hidden\">Actions</span>\n </th>\n </tr>\n </thead>\n <tbody>{children}</tbody>\n </table>\n </div>\n );\n}\n\nexport function GrantRowView({\n number,\n project,\n grant,\n lead,\n leadLabel,\n}: {\n number: number;\n project: string;\n grant: GrantRow;\n lead: ReactNode;\n leadLabel: string;\n}) {\n const revoke = useChange(revokeGrant(useCoffre(), project));\n const { status, dismiss } = useChangeStatus(keys.grants(project));\n const state = status(grantId(grant));\n // Someone's instance role reaching the project is shown here, and changed on their page in Users.\n const byRole = grant.scope === 'instance-role';\n const label = byRole ? grant.roleName : projectAccessLabel(grant);\n const expired = grant.expiresAt !== null && new Date(grant.expiresAt).getTime() < Date.now();\n\n return (\n <>\n <tr className={rowClass(state)}>\n <td className=\"n\">{number}</td>\n <td className=\"col-lead\" data-label={leadLabel}>\n {lead}\n </td>\n <td className=\"col-access\" data-label=\"Permissions\">\n <span className={`tag${grant.role === 'owner' ? ' tag-violet' : ''}`}>{label}</span>\n {byRole && (\n <span className=\"role-scope\" title=\"Their instance role reaches this project. Change it on their page in Users.\">\n instance role\n </span>\n )}\n </td>\n <td\n className={`col-expires cell-mono cell-muted${grant.expiresAt === null ? ' is-never' : ''}`}\n data-label=\"Expires\"\n >\n {grant.expiresAt === null ? (\n 'Never'\n ) : (\n <>\n <span className=\"narrow-only\">Expires </span>\n {grant.expiresAt.slice(0, 10)}\n {expired && (\n <>\n {' '}\n <span className=\"tag tag-red\">Expired</span>\n </>\n )}\n </>\n )}\n </td>\n <td className=\"col-actions\">\n {state.state === 'pending' ? (\n <RowPending status={state} />\n ) : byRole ? null : (\n <ConfirmButton\n trigger={<button className=\"act act-danger\">Revoke</button>}\n title={\n <>\n Revoke {label} from <span className=\"mono\">{grant.principalId}</span>?\n </>\n }\n body={\n <>\n They lose <strong>{label}</strong> on <span className=\"mono\">{project}</span>{' '}\n immediately, including any process using it right now. Other grants they hold\n still apply.\n </>\n }\n confirmLabel=\"Revoke access\"\n onConfirm={() => revoke(grant)}\n />\n )}\n </td>\n </tr>\n <RowFailure\n status={state}\n columns={5}\n onDismiss={() => state.state === 'failed' && dismiss(state.mutationId)}\n />\n </>\n );\n}\n\n/**\n * Grants the server refused to give: rolled back, so no row of theirs is\n * left, and listed here, after the table's rows, saying why.\n */\nexport function RefusedGrants({ refused }: { refused: RefusedGrant[] }) {\n return refused.map(({ mutationId, vars, status, dismiss }) => (\n <RowFailure key={mutationId} status={status} columns={5} onDismiss={dismiss}>\n {vars.principalId} was not given {projectAccessLabel(vars)}.\n </RowFailure>\n ));\n}\n\ntype RefusedGrant = FailedAdd<GrantVars> & { dismiss: () => void };\n\n/** The grants of one kind the server refused to give in a project, still to be said. */\nexport function useRefusedGrants(project: string, grants: GrantRow[], principalType?: GrantRow['principalType']): RefusedGrant[] {\n const { failedAdds, dismiss } = useChangeStatus(keys.grants(project));\n return failedAdds<GrantVars>(grants.map(grantId))\n .filter(({ vars }) => principalType === undefined || vars.principalType === principalType)\n .map((refused) => ({ ...refused, dismiss: () => dismiss(refused.mutationId) }));\n}\n"],"mappings":";;;;;;;;;;;;;;AAmBA,SAAgB,YAAY,EAAE,MAAM,YAAsD;CACxF,OACE,oBAAC,OAAD;EAAK,WAAU;YACb,qBAAC,SAAD;GAAO,WAAU;aAAjB,CACE,oBAAC,SAAD,EAAA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AwC;CACtE,OAAO,QAAQ,KAAK,EAAE,YAAY,MAAM,QAAQ,cAC9C,qBAAC,YAAD;EAAqC;EAAQ,SAAS;EAAG,WAAW;YAApE;GACG,KAAK;GAAY;GAAgB,mBAAmB,IAAI;GAAE;EACjD;IAFK,UAEL,CACb;AACH;;AAKA,SAAgB,iBAAiB,SAAiB,QAAoB,eAA2D;CAC/H,MAAM,EAAE,YAAY,YAAY,gBAAgB,KAAK,OAAO,OAAO,CAAC;CACpE,OAAO,WAAsB,OAAO,IAAI,OAAO,CAAC,CAAC,CAC9C,QAAQ,EAAE,WAAW,kBAAkB,KAAA,KAAa,KAAK,kBAAkB,aAAa,CAAC,CACzF,KAAK,aAAa;EAAE,GAAG;EAAS,eAAe,QAAQ,QAAQ,UAAU;CAAE,EAAE;AAClF"}
@@ -1,5 +1,5 @@
1
- import { x as usePreferences } from "./ui-CGdORVzW.js";
2
- import { _ as Check, ct as X } from "./page-CfhC9Hp1.js";
1
+ import { S as usePreferences } from "./ui-Q_Eczt7m.js";
2
+ import { _ as Check, st as X } from "./page-Cb0ZjGda.js";
3
3
  import { useId } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { Combobox } from "@base-ui/react/combobox";
@@ -96,4 +96,4 @@ function MultiCombobox({ label, options, value, onChange, placeholder, hint, not
96
96
  //#endregion
97
97
  export { MultiCombobox as t };
98
98
 
99
- //# sourceMappingURL=multi-combobox-B3SEv1gq.js.map
99
+ //# sourceMappingURL=multi-combobox-fbBRzi9z.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"multi-combobox-B3SEv1gq.js","names":[],"sources":["../../src/components/multi-combobox.tsx"],"sourcesContent":["import { Combobox } from '@base-ui/react/combobox';\nimport { useId, type ReactNode } from 'react';\nimport { usePreferences } from '../lib/preferences';\nimport { Check, X } from './icons';\n\n/**\n * Several of a fixed list, chosen by typing: each chosen one a chip in the\n * field, the rest offered below as the text filters them. Base UI's\n * combobox does the keyboard and ARIA: arrows move through the options,\n * Enter takes one, Backspace in an empty field removes the last chip, and\n * Left Arrow from the start of the field walks the chips.\n *\n * The value keeps the options' order, whatever order they were chosen in.\n */\nexport function MultiCombobox({\n label,\n options,\n value,\n onChange,\n placeholder,\n hint,\n note,\n mono = false,\n}: {\n label: ReactNode;\n options: readonly string[];\n value: string[];\n onChange: (value: string[]) => void;\n placeholder?: string;\n hint?: ReactNode;\n /** A word beside an option in the list, such as what choosing it exposes. */\n note?: (option: string) => ReactNode;\n mono?: boolean;\n}) {\n const { portal } = usePreferences();\n const id = useId();\n const labelId = useId();\n const hintId = useId();\n return (\n <Combobox.Root items={options} multiple value={value} onValueChange={(next) => onChange(options.filter((option) => next.includes(option)))}>\n <div className=\"field\">\n <label className=\"label\" htmlFor={id} id={labelId}>\n {label}\n </label>\n <Combobox.InputGroup className={`combo${mono ? ' combo-mono' : ''}`}>\n <Combobox.Chips className=\"combo-chips\" aria-label={value.length > 0 ? 'Chosen' : undefined}>\n {value.map((option) => (\n <Combobox.Chip key={option} className=\"combo-chip\" aria-label={option} aria-description=\"Press Backspace or Delete to remove\">\n {option}\n <Combobox.ChipRemove className=\"combo-chip-remove\" aria-label={`Remove ${option}`}>\n <X size={12} />\n </Combobox.ChipRemove>\n </Combobox.Chip>\n ))}\n <Combobox.Input\n id={id}\n // Named by reference too: while the list is open, Base UI hides what lies outside it, the label included.\n aria-labelledby={labelId}\n className=\"combo-input\"\n placeholder={value.length > 0 ? undefined : placeholder}\n aria-describedby={hint === undefined ? undefined : hintId}\n aria-description={value.length > 0 ? `${value.length} chosen. From the start of the field, press Left Arrow to reach them` : undefined}\n />\n </Combobox.Chips>\n </Combobox.InputGroup>\n {hint !== undefined && (\n <span className=\"hint\" id={hintId}>\n {hint}\n </span>\n )}\n </div>\n <Combobox.Portal container={portal}>\n <Combobox.Positioner className=\"menu-positioner\" sideOffset={4} align=\"start\">\n <Combobox.Popup className=\"menu combo-popup\">\n <Combobox.Empty className=\"combo-empty\">Nothing matches.</Combobox.Empty>\n <Combobox.List>\n {(option: string) => (\n <Combobox.Item key={option} value={option} className={`menu-item${mono ? ' mono' : ''}`}>\n <span className=\"combo-check\">\n <Combobox.ItemIndicator>\n <Check size={14} />\n </Combobox.ItemIndicator>\n </span>\n <span className=\"combo-option\">{option}</span>\n {note?.(option)}\n </Combobox.Item>\n )}\n </Combobox.List>\n </Combobox.Popup>\n </Combobox.Positioner>\n </Combobox.Portal>\n </Combobox.Root>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAcA,SAAgB,cAAc,EAC5B,OACA,SACA,OACA,UACA,aACA,MACA,MACA,OAAO,SAWN;CACD,MAAM,EAAE,WAAW,eAAe;CAClC,MAAM,KAAK,MAAM;CACjB,MAAM,UAAU,MAAM;CACtB,MAAM,SAAS,MAAM;CACrB,OACE,qBAAC,SAAS,MAAV;EAAe,OAAO;EAAS,UAAA;EAAgB;EAAO,gBAAgB,SAAS,SAAS,QAAQ,QAAQ,WAAW,KAAK,SAAS,MAAM,CAAC,CAAC;YAAzI,CACE,qBAAC,OAAD;GAAK,WAAU;aAAf;IACE,oBAAC,SAAD;KAAO,WAAU;KAAQ,SAAS;KAAI,IAAI;eACvC;IACI,CAAA;IACP,oBAAC,SAAS,YAAV;KAAqB,WAAW,QAAQ,OAAO,gBAAgB;eAC7D,qBAAC,SAAS,OAAV;MAAgB,WAAU;MAAc,cAAY,MAAM,SAAS,IAAI,WAAW,KAAA;gBAAlF,CACG,MAAM,KAAK,WACV,qBAAC,SAAS,MAAV;OAA4B,WAAU;OAAa,cAAY;OAAQ,oBAAiB;iBAAxF,CACG,QACD,oBAAC,SAAS,YAAV;QAAqB,WAAU;QAAoB,cAAY,UAAU;kBACvE,oBAAC,GAAD,EAAG,MAAM,GAAK,CAAA;OACK,CAAA,CACR;SALK,MAKL,CAChB,GACD,oBAAC,SAAS,OAAV;OACM;OAEJ,mBAAiB;OACjB,WAAU;OACV,aAAa,MAAM,SAAS,IAAI,KAAA,IAAY;OAC5C,oBAAkB,SAAS,KAAA,IAAY,KAAA,IAAY;OACnD,oBAAkB,MAAM,SAAS,IAAI,GAAG,MAAM,OAAO,wEAAwE,KAAA;MAC9H,CAAA,CACa;;IACG,CAAA;IACpB,SAAS,KAAA,KACR,oBAAC,QAAD;KAAM,WAAU;KAAO,IAAI;eACxB;IACG,CAAA;GAEL;MACL,oBAAC,SAAS,QAAV;GAAiB,WAAW;aAC1B,oBAAC,SAAS,YAAV;IAAqB,WAAU;IAAkB,YAAY;IAAG,OAAM;cACpE,qBAAC,SAAS,OAAV;KAAgB,WAAU;eAA1B,CACE,oBAAC,SAAS,OAAV;MAAgB,WAAU;gBAAc;KAAgC,CAAA,GACxE,oBAAC,SAAS,MAAV,EAAA,WACI,WACA,qBAAC,SAAS,MAAV;MAA4B,OAAO;MAAQ,WAAW,YAAY,OAAO,UAAU;gBAAnF;OACE,oBAAC,QAAD;QAAM,WAAU;kBACd,oBAAC,SAAS,eAAV,EAAA,UACE,oBAAC,OAAD,EAAO,MAAM,GAAK,CAAA,EACI,CAAA;OACpB,CAAA;OACN,oBAAC,QAAD;QAAM,WAAU;kBAAgB;OAAa,CAAA;OAC5C,OAAO,MAAM;MACD;QARK,MAQL,EAEJ,CAAA,CACD;;GACG,CAAA;EACN,CAAA,CACJ;;AAEnB"}
1
+ {"version":3,"file":"multi-combobox-fbBRzi9z.js","names":[],"sources":["../../src/components/multi-combobox.tsx"],"sourcesContent":["import { Combobox } from '@base-ui/react/combobox';\nimport { useId, type ReactNode } from 'react';\nimport { usePreferences } from '../lib/preferences';\nimport { Check, X } from './icons';\n\n/**\n * Several of a fixed list, chosen by typing: each chosen one a chip in the\n * field, the rest offered below as the text filters them. Base UI's\n * combobox does the keyboard and ARIA: arrows move through the options,\n * Enter takes one, Backspace in an empty field removes the last chip, and\n * Left Arrow from the start of the field walks the chips.\n *\n * The value keeps the options' order, whatever order they were chosen in.\n */\nexport function MultiCombobox({\n label,\n options,\n value,\n onChange,\n placeholder,\n hint,\n note,\n mono = false,\n}: {\n label: ReactNode;\n options: readonly string[];\n value: string[];\n onChange: (value: string[]) => void;\n placeholder?: string;\n hint?: ReactNode;\n /** A word beside an option in the list, such as what choosing it exposes. */\n note?: (option: string) => ReactNode;\n mono?: boolean;\n}) {\n const { portal } = usePreferences();\n const id = useId();\n const labelId = useId();\n const hintId = useId();\n return (\n <Combobox.Root items={options} multiple value={value} onValueChange={(next) => onChange(options.filter((option) => next.includes(option)))}>\n <div className=\"field\">\n <label className=\"label\" htmlFor={id} id={labelId}>\n {label}\n </label>\n <Combobox.InputGroup className={`combo${mono ? ' combo-mono' : ''}`}>\n <Combobox.Chips className=\"combo-chips\" aria-label={value.length > 0 ? 'Chosen' : undefined}>\n {value.map((option) => (\n <Combobox.Chip key={option} className=\"combo-chip\" aria-label={option} aria-description=\"Press Backspace or Delete to remove\">\n {option}\n <Combobox.ChipRemove className=\"combo-chip-remove\" aria-label={`Remove ${option}`}>\n <X size={12} />\n </Combobox.ChipRemove>\n </Combobox.Chip>\n ))}\n <Combobox.Input\n id={id}\n // Named by reference too: while the list is open, Base UI hides what lies outside it, the label included.\n aria-labelledby={labelId}\n className=\"combo-input\"\n placeholder={value.length > 0 ? undefined : placeholder}\n aria-describedby={hint === undefined ? undefined : hintId}\n aria-description={value.length > 0 ? `${value.length} chosen. From the start of the field, press Left Arrow to reach them` : undefined}\n />\n </Combobox.Chips>\n </Combobox.InputGroup>\n {hint !== undefined && (\n <span className=\"hint\" id={hintId}>\n {hint}\n </span>\n )}\n </div>\n <Combobox.Portal container={portal}>\n <Combobox.Positioner className=\"menu-positioner\" sideOffset={4} align=\"start\">\n <Combobox.Popup className=\"menu combo-popup\">\n <Combobox.Empty className=\"combo-empty\">Nothing matches.</Combobox.Empty>\n <Combobox.List>\n {(option: string) => (\n <Combobox.Item key={option} value={option} className={`menu-item${mono ? ' mono' : ''}`}>\n <span className=\"combo-check\">\n <Combobox.ItemIndicator>\n <Check size={14} />\n </Combobox.ItemIndicator>\n </span>\n <span className=\"combo-option\">{option}</span>\n {note?.(option)}\n </Combobox.Item>\n )}\n </Combobox.List>\n </Combobox.Popup>\n </Combobox.Positioner>\n </Combobox.Portal>\n </Combobox.Root>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAcA,SAAgB,cAAc,EAC5B,OACA,SACA,OACA,UACA,aACA,MACA,MACA,OAAO,SAWN;CACD,MAAM,EAAE,WAAW,eAAe;CAClC,MAAM,KAAK,MAAM;CACjB,MAAM,UAAU,MAAM;CACtB,MAAM,SAAS,MAAM;CACrB,OACE,qBAAC,SAAS,MAAV;EAAe,OAAO;EAAS,UAAA;EAAgB;EAAO,gBAAgB,SAAS,SAAS,QAAQ,QAAQ,WAAW,KAAK,SAAS,MAAM,CAAC,CAAC;YAAzI,CACE,qBAAC,OAAD;GAAK,WAAU;aAAf;IACE,oBAAC,SAAD;KAAO,WAAU;KAAQ,SAAS;KAAI,IAAI;eACvC;IACI,CAAA;IACP,oBAAC,SAAS,YAAV;KAAqB,WAAW,QAAQ,OAAO,gBAAgB;eAC7D,qBAAC,SAAS,OAAV;MAAgB,WAAU;MAAc,cAAY,MAAM,SAAS,IAAI,WAAW,KAAA;gBAAlF,CACG,MAAM,KAAK,WACV,qBAAC,SAAS,MAAV;OAA4B,WAAU;OAAa,cAAY;OAAQ,oBAAiB;iBAAxF,CACG,QACD,oBAAC,SAAS,YAAV;QAAqB,WAAU;QAAoB,cAAY,UAAU;kBACvE,oBAAC,GAAD,EAAG,MAAM,GAAK,CAAA;OACK,CAAA,CACR;SALK,MAKL,CAChB,GACD,oBAAC,SAAS,OAAV;OACM;OAEJ,mBAAiB;OACjB,WAAU;OACV,aAAa,MAAM,SAAS,IAAI,KAAA,IAAY;OAC5C,oBAAkB,SAAS,KAAA,IAAY,KAAA,IAAY;OACnD,oBAAkB,MAAM,SAAS,IAAI,GAAG,MAAM,OAAO,wEAAwE,KAAA;MAC9H,CAAA,CACa;;IACG,CAAA;IACpB,SAAS,KAAA,KACR,oBAAC,QAAD;KAAM,WAAU;KAAO,IAAI;eACxB;IACG,CAAA;GAEL;MACL,oBAAC,SAAS,QAAV;GAAiB,WAAW;aAC1B,oBAAC,SAAS,YAAV;IAAqB,WAAU;IAAkB,YAAY;IAAG,OAAM;cACpE,qBAAC,SAAS,OAAV;KAAgB,WAAU;eAA1B,CACE,oBAAC,SAAS,OAAV;MAAgB,WAAU;gBAAc;KAAgC,CAAA,GACxE,oBAAC,SAAS,MAAV,EAAA,WACI,WACA,qBAAC,SAAS,MAAV;MAA4B,OAAO;MAAQ,WAAW,YAAY,OAAO,UAAU;gBAAnF;OACE,oBAAC,QAAD;QAAM,WAAU;kBACd,oBAAC,SAAS,eAAV,EAAA,UACE,oBAAC,OAAD,EAAO,MAAM,GAAK,CAAA,EACI,CAAA;OACpB,CAAA;OACN,oBAAC,QAAD;QAAM,WAAU;kBAAgB;OAAa,CAAA;OAC5C,OAAO,MAAM;MACD;QARK,MAQL,EAEJ,CAAA,CACD;;GACG,CAAA;EACN,CAAA,CACJ;;AAEnB"}
@@ -1,8 +1,7 @@
1
- import { c as Notice, i as EmptyState, u as Timestamp } from "./ui-CGdORVzW.js";
2
- import { N as Key, at as User, b as ChevronRight, t as Card } from "./page-CfhC9Hp1.js";
3
- import { n as PrincipalLink } from "./principal-CI17XK13.js";
4
- import { n as ReadsLag } from "./actions-log-DupYCEyV.js";
5
- import { s as referenceProblem } from "./references-D5llUGQL.js";
1
+ import { c as Notice, g as ofAll, i as EmptyState, u as Timestamp } from "./ui-Q_Eczt7m.js";
2
+ import { M as Key, b as ChevronRight, it as User, t as Card } from "./page-Cb0ZjGda.js";
3
+ import { n as PrincipalLink } from "./principal-BKJxbAtE.js";
4
+ import { s as referenceProblem } from "./references-wTh_DT0M.js";
6
5
  import { Link } from "@tanstack/react-router";
7
6
  import { credentialScopeInWords } from "@coffre/core/access";
8
7
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
@@ -20,8 +19,14 @@ function PrincipalReportCards({ report }) {
20
19
  report,
21
20
  person
22
21
  }),
23
- report.issuedTokens.length > 0 && /* @__PURE__ */ jsx(IssuedTokens, { report }),
24
- report.references.length > 0 && /* @__PURE__ */ jsx(MadeReferences, { report })
22
+ report.issuedTokens !== null && report.issuedTokens.length > 0 && /* @__PURE__ */ jsx(IssuedTokens, {
23
+ tokens: report.issuedTokens,
24
+ total: report.totals.issuedTokens
25
+ }),
26
+ report.references !== null && report.references.length > 0 && /* @__PURE__ */ jsx(MadeReferences, {
27
+ references: report.references,
28
+ total: report.totals.references
29
+ })
25
30
  ] });
26
31
  }
27
32
  function RemovedNotice({ report }) {
@@ -54,86 +59,82 @@ function RemovedNotice({ report }) {
54
59
  * Removal ends their access but not the work it leaves, so they stay one click
55
60
  * away until every value they saw has been rotated.
56
61
  */
57
- function RemovedList({ principalType, removed, reads }) {
62
+ function RemovedList({ principalType, removed }) {
58
63
  const users = principalType === "user";
59
64
  const rows = removed.filter((principal) => principal.principalType === principalType);
60
65
  if (rows.length === 0) return null;
61
- return /* @__PURE__ */ jsxs(Fragment, { children: [
62
- /* @__PURE__ */ jsx("h2", {
63
- className: "section-title",
64
- children: "Removed"
65
- }),
66
- /* @__PURE__ */ jsx(ReadsLag, { reads }),
67
- /* @__PURE__ */ jsx("section", {
68
- className: "card",
69
- "aria-label": users ? "Removed users" : "Removed service accounts",
70
- children: /* @__PURE__ */ jsx("div", {
71
- className: "dt-wrap",
72
- children: /* @__PURE__ */ jsxs("table", {
73
- className: "dt directory stacks",
74
- children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
75
- /* @__PURE__ */ jsx("th", {
66
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("h2", {
67
+ className: "section-title",
68
+ children: "Removed"
69
+ }), /* @__PURE__ */ jsx("section", {
70
+ className: "card",
71
+ "aria-label": users ? "Removed users" : "Removed service accounts",
72
+ children: /* @__PURE__ */ jsx("div", {
73
+ className: "dt-wrap",
74
+ children: /* @__PURE__ */ jsxs("table", {
75
+ className: "dt directory stacks",
76
+ children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { children: [
77
+ /* @__PURE__ */ jsx("th", {
78
+ className: "n",
79
+ children: "#"
80
+ }),
81
+ /* @__PURE__ */ jsx("th", {
82
+ className: "col-principal",
83
+ children: /* @__PURE__ */ jsxs("span", {
84
+ className: "th",
85
+ children: [users ? /* @__PURE__ */ jsx(User, { size: 14 }) : /* @__PURE__ */ jsx(Key, { size: 14 }), users ? "Email" : "Name"]
86
+ })
87
+ }),
88
+ /* @__PURE__ */ jsx("th", {
89
+ className: "col-role",
90
+ children: "Consider rotating"
91
+ }),
92
+ /* @__PURE__ */ jsx("th", {
93
+ className: "col-actions",
94
+ children: /* @__PURE__ */ jsx("span", {
95
+ className: "visually-hidden",
96
+ children: "Report"
97
+ })
98
+ })
99
+ ] }) }), /* @__PURE__ */ jsx("tbody", { children: rows.map((principal, index) => /* @__PURE__ */ jsxs("tr", {
100
+ className: "row-link",
101
+ children: [
102
+ /* @__PURE__ */ jsx("td", {
76
103
  className: "n",
77
- children: "#"
104
+ children: index + 1
78
105
  }),
79
- /* @__PURE__ */ jsx("th", {
80
- className: "col-principal",
81
- children: /* @__PURE__ */ jsxs("span", {
82
- className: "th",
83
- children: [users ? /* @__PURE__ */ jsx(User, { size: 14 }) : /* @__PURE__ */ jsx(Key, { size: 14 }), users ? "Email" : "Name"]
106
+ /* @__PURE__ */ jsx("td", {
107
+ className: "col-lead",
108
+ "data-label": users ? "Email" : "Name",
109
+ children: /* @__PURE__ */ jsx(PrincipalLink, {
110
+ type: principal.principalType,
111
+ id: principal.principalId,
112
+ stretch: true
84
113
  })
85
114
  }),
86
- /* @__PURE__ */ jsx("th", {
115
+ /* @__PURE__ */ jsx("td", {
87
116
  className: "col-role",
88
- children: "Consider rotating"
117
+ "data-label": "Consider rotating",
118
+ children: principal.toRotate === 0 ? /* @__PURE__ */ jsx("span", {
119
+ className: "cell-muted",
120
+ children: "Nothing"
121
+ }) : `${principal.toRotate} ${principal.toRotate === 1 ? "value" : "values"}`
89
122
  }),
90
- /* @__PURE__ */ jsx("th", {
91
- className: "col-actions",
92
- children: /* @__PURE__ */ jsx("span", {
93
- className: "visually-hidden",
94
- children: "Report"
95
- })
123
+ /* @__PURE__ */ jsx("td", {
124
+ className: "col-actions col-open cell-muted",
125
+ "aria-hidden": "true",
126
+ children: /* @__PURE__ */ jsx(ChevronRight, { size: 16 })
96
127
  })
97
- ] }) }), /* @__PURE__ */ jsx("tbody", { children: rows.map((principal, index) => /* @__PURE__ */ jsxs("tr", {
98
- className: "row-link",
99
- children: [
100
- /* @__PURE__ */ jsx("td", {
101
- className: "n",
102
- children: index + 1
103
- }),
104
- /* @__PURE__ */ jsx("td", {
105
- className: "col-lead",
106
- "data-label": users ? "Email" : "Name",
107
- children: /* @__PURE__ */ jsx(PrincipalLink, {
108
- type: principal.principalType,
109
- id: principal.principalId,
110
- stretch: true
111
- })
112
- }),
113
- /* @__PURE__ */ jsx("td", {
114
- className: "col-role",
115
- "data-label": "Consider rotating",
116
- children: principal.toRotate === 0 ? /* @__PURE__ */ jsx("span", {
117
- className: "cell-muted",
118
- children: "Nothing"
119
- }) : `${principal.toRotate} ${principal.toRotate === 1 ? "value" : "values"}`
120
- }),
121
- /* @__PURE__ */ jsx("td", {
122
- className: "col-actions col-open cell-muted",
123
- "aria-hidden": "true",
124
- children: /* @__PURE__ */ jsx(ChevronRight, { size: 16 })
125
- })
126
- ]
127
- }, principal.principalId)) })]
128
- })
128
+ ]
129
+ }, principal.principalId)) })]
129
130
  })
130
131
  })
131
- ] });
132
+ })] });
132
133
  }
133
134
  /** Values a removed member saw that nobody has changed since. */
134
135
  function ConsiderRotating({ report, person }) {
135
136
  const they = person ? "they" : "it";
136
- return /* @__PURE__ */ jsxs(Card, {
137
+ return /* @__PURE__ */ jsx(Card, {
137
138
  labelledBy: "seen-values",
138
139
  title: "Consider rotating",
139
140
  description: `Values ${they} read or wrote that nobody has changed since. Rotate each at its source, such as a new API key or database password, then save the new value here.`,
@@ -141,7 +142,7 @@ function ConsiderRotating({ report, person }) {
141
142
  className: "card-aside",
142
143
  children: [report.rotated, " already rotated"]
143
144
  }),
144
- children: [/* @__PURE__ */ jsx(ReadsLag, { reads: report.reads }), report.exposed.length === 0 ? /* @__PURE__ */ jsx(EmptyState, {
145
+ children: report.exposed.length === 0 ? /* @__PURE__ */ jsx(EmptyState, {
145
146
  title: "Nothing left to rotate",
146
147
  children: report.rotated > 0 ? `Every value ${they} saw has had a new version since.` : `${person ? "They have" : "It has"} not read or written a value that is still current.`
147
148
  }) : /* @__PURE__ */ jsx("div", {
@@ -194,7 +195,7 @@ function ConsiderRotating({ report, person }) {
194
195
  })
195
196
  ] }, `${secret.project}/${secret.environment}/${secret.key}`)) })]
196
197
  })
197
- })]
198
+ })
198
199
  });
199
200
  }
200
201
  /**
@@ -202,10 +203,10 @@ function ConsiderRotating({ report, person }) {
202
203
  * environment that holds it, like a value, not to them (D46), so their
203
204
  * leaving ends none. Listed to review.
204
205
  */
205
- function MadeReferences({ report }) {
206
+ function MadeReferences({ references, total }) {
206
207
  return /* @__PURE__ */ jsx(Card, {
207
208
  labelledBy: "made-references",
208
- title: "References they made",
209
+ title: `References they made${ofAll(references.length, total)}`,
209
210
  description: "These stay after they leave, and whoever reads a reference's environment reads its source through it. Review them: the source's access managers, or whoever writes where one is held, can break it.",
210
211
  children: /* @__PURE__ */ jsx("div", {
211
212
  className: "dt-wrap",
@@ -218,7 +219,7 @@ function MadeReferences({ report }) {
218
219
  className: "col-shrink",
219
220
  children: "Made"
220
221
  })
221
- ] }) }), /* @__PURE__ */ jsx("tbody", { children: report.references.map((reference) => /* @__PURE__ */ jsxs("tr", { children: [
222
+ ] }) }), /* @__PURE__ */ jsx("tbody", { children: references.map((reference) => /* @__PURE__ */ jsxs("tr", { children: [
222
223
  /* @__PURE__ */ jsx("td", {
223
224
  className: "mono",
224
225
  "data-label": "Reference",
@@ -247,10 +248,10 @@ function MadeReferences({ report }) {
247
248
  })
248
249
  });
249
250
  }
250
- function IssuedTokens({ report }) {
251
+ function IssuedTokens({ tokens, total }) {
251
252
  return /* @__PURE__ */ jsx(Card, {
252
253
  labelledBy: "issued-tokens",
253
- title: "Bearer tokens they issued",
254
+ title: `Bearer tokens they issued${ofAll(tokens.length, total)}`,
254
255
  description: "These still work, and they saw each one when it was issued. Revoke any they may have kept.",
255
256
  children: /* @__PURE__ */ jsx("div", {
256
257
  className: "dt-wrap",
@@ -266,7 +267,7 @@ function IssuedTokens({ report }) {
266
267
  className: "col-shrink col-hide-narrow",
267
268
  children: "Last used"
268
269
  })
269
- ] }) }), /* @__PURE__ */ jsx("tbody", { children: report.issuedTokens.map((token) => /* @__PURE__ */ jsxs("tr", { children: [
270
+ ] }) }), /* @__PURE__ */ jsx("tbody", { children: tokens.map((token) => /* @__PURE__ */ jsxs("tr", { children: [
270
271
  /* @__PURE__ */ jsx("td", { children: /* @__PURE__ */ jsxs("span", {
271
272
  className: "cell-stack",
272
273
  children: [/* @__PURE__ */ jsxs(Link, {
@@ -311,4 +312,4 @@ function IssuedTokens({ report }) {
311
312
  //#endregion
312
313
  export { RemovedList as n, RemovedNotice as r, PrincipalReportCards as t };
313
314
 
314
- //# sourceMappingURL=offboarding-C1jbG_dk.js.map
315
+ //# sourceMappingURL=offboarding-CXM464J_.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"offboarding-CXM464J_.js","names":[],"sources":["../../src/components/offboarding.tsx"],"sourcesContent":["import { Link } from '@tanstack/react-router';\nimport { credentialScopeInWords } from '@coffre/core/access';\nimport type { PrincipalReport, RemovedPrincipal } from '../shared/models';\nimport { Card } from './page';\nimport { EmptyState, Notice, Timestamp, ofAll } from './ui';\nimport { PrincipalLink } from './principal';\nimport { referenceProblem } from './references';\nimport { ChevronRight, Key, User } from './icons';\nimport { serviceName } from '@coffre/client';\n\n/**\n * The part of a user's or token's page that answers \"what do we change now\n * they have left?\". Owners only. Once someone is removed everything that let\n * them in is gone, but what they saw is not, nor tokens they issued.\n */\nexport function PrincipalReportCards({ report }: { report: PrincipalReport }) {\n const person = report.principalType === 'user';\n return (\n <>\n {report.status === 'removed' && <ConsiderRotating report={report} person={person} />}\n {report.issuedTokens !== null && report.issuedTokens.length > 0 && <IssuedTokens tokens={report.issuedTokens} total={report.totals.issuedTokens} />}\n {report.references !== null && report.references.length > 0 && <MadeReferences references={report.references} total={report.totals.references} />}\n </>\n );\n}\n\nexport function RemovedNotice({ report }: { report: PrincipalReport }) {\n const person = report.principalType === 'user';\n return (\n <div className=\"report-notice\">\n <Notice>\n Removed\n {report.removedBy !== null && (\n <>\n {' '}by <span className=\"mono\">{report.removedBy}</span>\n </>\n )}\n {report.removedAt !== null && (\n <>\n {' '}on <Timestamp iso={report.removedAt} />\n </>\n )}\n .{' '}\n {person\n ? 'Their project access, sessions, CLI logins, personal tokens, linked sign-in accounts and connected apps were revoked, so adding them again starts from nothing.'\n : 'Its project access and every token issued to it were revoked, so adding it again starts from nothing.'}\n </Notice>\n </div>\n );\n}\n\n/**\n * The people or service accounts removed from the directory, under the live ones.\n * Removal ends their access but not the work it leaves, so they stay one click\n * away until every value they saw has been rotated.\n */\nexport function RemovedList({\n principalType,\n removed,\n}: {\n principalType: RemovedPrincipal['principalType'];\n removed: RemovedPrincipal[];\n}) {\n const users = principalType === 'user';\n const rows = removed.filter((principal) => principal.principalType === principalType);\n if (rows.length === 0) return null;\n return (\n <>\n <h2 className=\"section-title\">Removed</h2>\n <section className=\"card\" aria-label={users ? 'Removed users' : 'Removed service accounts'}>\n <div className=\"dt-wrap\">\n <table className=\"dt directory stacks\">\n <thead>\n <tr>\n <th className=\"n\">#</th>\n <th className=\"col-principal\">\n <span className=\"th\">\n {users ? <User size={14} /> : <Key size={14} />}\n {users ? 'Email' : 'Name'}\n </span>\n </th>\n <th className=\"col-role\">Consider rotating</th>\n <th className=\"col-actions\">\n <span className=\"visually-hidden\">Report</span>\n </th>\n </tr>\n </thead>\n <tbody>\n {rows.map((principal, index) => (\n <tr key={principal.principalId} className=\"row-link\">\n <td className=\"n\">{index + 1}</td>\n <td className=\"col-lead\" data-label={users ? 'Email' : 'Name'}>\n <PrincipalLink type={principal.principalType} id={principal.principalId} stretch />\n </td>\n <td className=\"col-role\" data-label=\"Consider rotating\">\n {principal.toRotate === 0 ? (\n <span className=\"cell-muted\">Nothing</span>\n ) : (\n `${principal.toRotate} ${principal.toRotate === 1 ? 'value' : 'values'}`\n )}\n </td>\n {/* The row opens the report; the chevron says it does. */}\n <td className=\"col-actions col-open cell-muted\" aria-hidden=\"true\">\n <ChevronRight size={16} />\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </section>\n </>\n );\n}\n\n/** Values a removed member saw that nobody has changed since. */\nfunction ConsiderRotating({ report, person }: { report: PrincipalReport; person: boolean }) {\n const they = person ? 'they' : 'it';\n return (\n <Card\n labelledBy=\"seen-values\"\n title=\"Consider rotating\"\n description={`Values ${they} read or wrote that nobody has changed since. Rotate each at its source, such as a new API key or database password, then save the new value here.`}\n actions={\n report.rotated > 0 && (\n <span className=\"card-aside\">{report.rotated} already rotated</span>\n )\n }\n >\n {report.exposed.length === 0 ? (\n <EmptyState title=\"Nothing left to rotate\">\n {report.rotated > 0\n ? `Every value ${they} saw has had a new version since.`\n : `${person ? 'They have' : 'It has'} not read or written a value that is still current.`}\n </EmptyState>\n ) : (\n <div className=\"dt-wrap\">\n <table className=\"dt report-values\">\n <thead>\n <tr>\n <th>Secret</th>\n <th className=\"col-shrink\">Version</th>\n <th className=\"col-shrink\">Last seen</th>\n </tr>\n </thead>\n <tbody>\n {report.exposed.map((secret) => (\n <tr key={`${secret.project}/${secret.environment}/${secret.key}`}>\n <td>\n <Link\n className=\"cell-link mono\"\n to=\"/projects/$project/$environment\"\n params={{ project: secret.project, environment: secret.environment }}\n search={{ filter: secret.key }}\n >\n <span className=\"report-path\">\n {secret.project}/{secret.environment}/\n </span>\n {secret.key}\n </Link>\n </td>\n <td className=\"col-shrink cell-mono cell-muted\">v{secret.version}</td>\n <td className=\"col-shrink nowrap\">\n {secret.how === 'wrote' ? 'Wrote' : 'Read'}{' '}\n <Timestamp iso={secret.at} display=\"relative\" />\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )}\n </Card>\n );\n}\n\n/**\n * References they made, as the log names them: each belongs to the\n * environment that holds it, like a value, not to them (D46), so their\n * leaving ends none. Listed to review.\n */\nfunction MadeReferences({ references, total }: { references: NonNullable<PrincipalReport['references']>; total: number | null }) {\n return (\n <Card\n labelledBy=\"made-references\"\n title={`References they made${ofAll(references.length, total)}`}\n description=\"These stay after they leave, and whoever reads a reference's environment reads its source through it. Review them: the source's access managers, or whoever writes where one is held, can break it.\"\n >\n <div className=\"dt-wrap\">\n <table className=\"dt stacks\">\n <thead>\n <tr>\n <th>Reference</th>\n <th>Reads</th>\n <th className=\"col-shrink\">Made</th>\n </tr>\n </thead>\n <tbody>\n {references.map((reference) => (\n <tr key={reference.id}>\n <td className=\"mono\" data-label=\"Reference\">{reference.holder}</td>\n <td data-label=\"Reads\">\n <span className=\"mono\">{reference.source}</span>\n {reference.state !== 'live' && <span className=\"cell-muted\"> · {referenceProblem(reference.state)}</span>}\n </td>\n <td className=\"col-shrink nowrap\" data-label=\"Made\">\n <Timestamp iso={reference.createdAt} display=\"relative\" />\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </Card>\n );\n}\n\nfunction IssuedTokens({ tokens, total }: { tokens: NonNullable<PrincipalReport['issuedTokens']>; total: number | null }) {\n return (\n <Card\n labelledBy=\"issued-tokens\"\n title={`Bearer tokens they issued${ofAll(tokens.length, total)}`}\n description=\"These still work, and they saw each one when it was issued. Revoke any they may have kept.\"\n >\n <div className=\"dt-wrap\">\n <table className=\"dt report-tokens\">\n <thead>\n <tr>\n <th>Token</th>\n <th className=\"col-shrink\">Expires</th>\n <th className=\"col-shrink col-hide-narrow\">Last used</th>\n </tr>\n </thead>\n <tbody>\n {tokens.map((token) => (\n <tr key={token.id}>\n <td>\n <span className=\"cell-stack\">\n <Link className=\"cell-link mono\" to=\"/service-accounts/$account\" params={{ account: serviceName(token.service) }}>\n service:{serviceName(token.service)}\n </Link>\n <small>\n {token.label ?? 'No label'} · <span className=\"mono\">{token.hint}</span> · reaches{' '}\n {token.scope === null ? 'all its account holds' : credentialScopeInWords(token.scope)}\n </small>\n </span>\n </td>\n <td className=\"col-shrink nowrap\">\n <Timestamp iso={token.expiresAt} display=\"relative\" />\n </td>\n <td className=\"col-shrink col-hide-narrow nowrap\">\n {token.lastUsedAt === null ? (\n <span className=\"cell-muted\">Never</span>\n ) : (\n <Timestamp iso={token.lastUsedAt} display=\"relative\" />\n )}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </Card>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAeA,SAAgB,qBAAqB,EAAE,UAAuC;CAC5E,MAAM,SAAS,OAAO,kBAAkB;CACxC,OACE,qBAAA,UAAA,EAAA,UAAA;EACG,OAAO,WAAW,aAAa,oBAAC,kBAAD;GAA0B;GAAgB;EAAS,CAAA;EAClF,OAAO,iBAAiB,QAAQ,OAAO,aAAa,SAAS,KAAK,oBAAC,cAAD;GAAc,QAAQ,OAAO;GAAc,OAAO,OAAO,OAAO;EAAe,CAAA;EACjJ,OAAO,eAAe,QAAQ,OAAO,WAAW,SAAS,KAAK,oBAAC,gBAAD;GAAgB,YAAY,OAAO;GAAY,OAAO,OAAO,OAAO;EAAa,CAAA;CAChJ,EAAA,CAAA;AAEN;AAEA,SAAgB,cAAc,EAAE,UAAuC;CACrE,MAAM,SAAS,OAAO,kBAAkB;CACxC,OACE,oBAAC,OAAD;EAAK,WAAU;YACb,qBAAC,QAAD,EAAA,UAAA;GAAQ;GAEL,OAAO,cAAc,QACpB,qBAAA,UAAA,EAAA,UAAA;IACG;IAAI;IAAG,oBAAC,QAAD;KAAM,WAAU;eAAQ,OAAO;IAAgB,CAAA;GACvD,EAAA,CAAA;GAEH,OAAO,cAAc,Q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QACJ,CAAA;KACJ,oBAAC,MAAD;MAAI,WAAU;gBACZ,oBAAC,WAAD;OAAW,KAAK,MAAM;OAAW,SAAQ;MAAY,CAAA;KACnD,CAAA;KACJ,oBAAC,MAAD;MAAI,WAAU;gBACX,MAAM,eAAe,OACpB,oBAAC,QAAD;OAAM,WAAU;iBAAa;MAAW,CAAA,IAExC,oBAAC,WAAD;OAAW,KAAK,MAAM;OAAY,SAAQ;MAAY,CAAA;KAEtD,CAAA;IACF,EAAA,GAtBK,MAAM,EAsBX,CACL,EACI,CAAA,CACF;;EACJ,CAAA;CACD,CAAA;AAEV"}
@@ -1,5 +1,5 @@
1
1
  import { useRouter } from "@tanstack/react-router";
2
- import { Activity, Archive, ArrowRight, Ban, Check, ChevronDown, ChevronRight, ChevronsUpDown, CircleAlert, CircleCheck, Clock, Copy, Ellipsis, Eye, EyeOff, Folder, GitFork, Hash, History, Info, KeyRound, Layers, Link as Link$1, LoaderCircle, Lock, LogOut, Menu, Monitor, Moon, PanelLeft, Pencil, Plus, RotateCcw, ScrollText, Search, Settings, ShieldCheck, Shuffle, Sun, Terminal, Trash2, TriangleAlert, Upload, User, UserRoundCog, Users, WandSparkles, X } from "lucide-react";
2
+ import { Activity, Archive, ArrowRight, Ban, Check, ChevronDown, ChevronRight, ChevronsUpDown, CircleAlert, CircleCheck, Clock, Copy, Ellipsis, Eye, EyeOff, Folder, Hash, History, Info, KeyRound, Layers, Link as Link$1, LoaderCircle, Lock, LogOut, Menu, Monitor, Moon, PanelLeft, Pencil, Plus, RotateCcw, ScrollText, Search, Settings, ShieldCheck, Shuffle, Sun, Terminal, Trash2, TriangleAlert, Upload, User, UserRoundCog, Users, WandSparkles, X } from "lucide-react";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { CoffreError } from "@coffre/client";
5
5
  //#region src/components/mark.ts
@@ -62,7 +62,6 @@ function lucide(Glyph) {
62
62
  };
63
63
  }
64
64
  var Folder$1 = lucide(Folder);
65
- var Fork = lucide(GitFork);
66
65
  var Layers$1 = lucide(Layers);
67
66
  var Users$1 = lucide(Users);
68
67
  var User$1 = lucide(User);
@@ -256,7 +255,7 @@ function failureMessage(error) {
256
255
  if (!(error instanceof CoffreError)) return "The request could not be sent. Nothing was changed.";
257
256
  if (error.status === 401) return "Your session has ended. Sign in again, then retry.";
258
257
  if (error.code === "cross_origin") return "coffre refused a change that did not come from this page. Reload, then retry.";
259
- if (error.code === "vault_refused" && error.reason === "not_allowed") return error.message.replace(/^the vault refused: /, "");
258
+ if (error.code === "vault_refused" && error.reason === "not_allowed") return error.message;
260
259
  if (error.status === 403) return "You hold no grant that covers this. Someone with grant.manage on the project can add one.";
261
260
  if (error.status === 404) return "Not found. It may have been renamed or archived.";
262
261
  if (error.status === 400 || error.status === 409) return error.message;
@@ -350,14 +349,10 @@ function Card({ title, description, actions, children, labelledBy, tone, wide =
350
349
  });
351
350
  }
352
351
  /** One labelled fact in a card's `dl.facts`. */
353
- function Fact({ label, children, action }) {
352
+ function Fact({ label, children }) {
354
353
  return /* @__PURE__ */ jsxs("div", {
355
- className: action === void 0 ? "fact" : "fact fact-with-action",
356
- children: [
357
- /* @__PURE__ */ jsx("dt", { children: label }),
358
- /* @__PURE__ */ jsx("dd", { children }),
359
- action
360
- ]
354
+ className: "fact",
355
+ children: [/* @__PURE__ */ jsx("dt", { children: label }), /* @__PURE__ */ jsx("dd", { children })]
361
356
  });
362
357
  }
363
358
  /**
@@ -395,6 +390,6 @@ function ClosedDoor({ icon, label, title, children, actions }) {
395
390
  });
396
391
  }
397
392
  //#endregion
398
- export { SignOut as $, Hash$1 as A, Menu$1 as B, Copy$1 as C, Fork as D, Folder$1 as E, Ledger as F, Pencil$1 as G, Moon$1 as H, Link$2 as I, RotateBack as J, Plus$1 as K, Loader as L, Info$1 as M, Key as N, Generate as O, Layers$1 as P, Shuffle$1 as Q, Lock$1 as R, Clock$1 as S, EyeOff$1 as T, MoreHorizontal as U, Monitor$1 as V, PanelLeft$1 as W, Settings$1 as X, Search$1 as Y, ShieldCheck$1 as Z, Check$1 as _, Refusal as a, User$1 as at, ChevronRight$1 as b, statusOf as c, X$1 as ct, Tile as d, SlashCircle as et, Activity$1 as f, ArrowRight$1 as g, Archive$1 as h, PageHeader as i, Upload$1 as it, History$1 as j, GitHub as k, uiResult as l, AlertTriangle as m, ClosedDoor as n, Terminal$1 as nt, failureMessage as o, UserCog as ot, AlertCircle as p, ProviderMark as q, Fact as r, Trash as rt, memberRef as s, Users$1 as st, Card as t, Sun$1 as tt, useCoffre as u, CheckCircle as v, Eye$1 as w, ChevronsUpDown$1 as x, ChevronDown$1 as y, Mark as z };
393
+ export { SlashCircle as $, History$1 as A, Monitor$1 as B, Copy$1 as C, Generate as D, Folder$1 as E, Link$2 as F, Plus$1 as G, MoreHorizontal as H, Loader as I, Search$1 as J, ProviderMark as K, Lock$1 as L, Key as M, Layers$1 as N, GitHub as O, Ledger as P, SignOut as Q, Mark as R, Clock$1 as S, EyeOff$1 as T, PanelLeft$1 as U, Moon$1 as V, Pencil$1 as W, ShieldCheck$1 as X, Settings$1 as Y, Shuffle$1 as Z, Check$1 as _, Refusal as a, UserCog as at, ChevronRight$1 as b, statusOf as c, Tile as d, Sun$1 as et, Activity$1 as f, ArrowRight$1 as g, Archive$1 as h, PageHeader as i, User$1 as it, Info$1 as j, Hash$1 as k, uiResult as l, AlertTriangle as m, ClosedDoor as n, Trash as nt, failureMessage as o, Users$1 as ot, AlertCircle as p, RotateBack as q, Fact as r, Upload$1 as rt, memberRef as s, X$1 as st, Card as t, Terminal$1 as tt, useCoffre as u, CheckCircle as v, Eye$1 as w, ChevronsUpDown$1 as x, ChevronDown$1 as y, Menu$1 as z };
399
394
 
400
- //# sourceMappingURL=page-CfhC9Hp1.js.map
395
+ //# sourceMappingURL=page-Cb0ZjGda.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-Cb0ZjGda.js","names":[],"sources":["../../src/components/mark.ts","../../src/components/icons.tsx","../../src/components/tile.tsx","../../src/lib/coffre.ts","../../src/components/page.tsx"],"sourcesContent":["/**\n * coffre's mark: a keyhole cut from a disc, which leaves a lowercase c, its\n * slot tilted up 14°. Drawn on a 32-unit grid, where 2 units are a pixel at\n * 16px.\n *\n * Everything that draws it reads this file: `Mark` in the app, the favicon,\n * and `scripts/icons.ts`, which renders the PNGs and the README's mark from\n * it. The colours stand in until the brand has its own: change them here,\n * then run `pnpm --filter @coffre/ui icons`.\n */\n\n/** 64px and up. */\nexport const MARK_PATH = 'M24.17 12.23A9 9 0 1 0 24.93 14.91L18.39 16.27A3.6 3.6 0 1 1 17.84 14.07Z';\n\n/** 48px and below: a larger disc, the hole on the pixel grid, a thicker slot, so both stay open at 16px. */\nexport const MARK_PATH_SMALL = 'M25.77 10.94A11 11 0 1 0 26.95 14.9L17.92 16.81A4 4 0 1 1 17.08 13.45Z';\n\n/** The tile behind the mark wherever it stands alone: the favicon, app icons, the README. */\nexport const TILE = '#000';\n\n/** The mark on its tile. */\nexport const INK = '#fff';\n\n/** The tile's corner radius, on the 32-unit grid. */\nexport const TILE_RADIUS = 7;\n\nexport function markPath(size: number): string {\n return size <= 48 ? MARK_PATH_SMALL : MARK_PATH;\n}\n\n/**\n * The mark on its tile, as an SVG document, drawn for `size` pixels.\n * `square` leaves the corners for the platform to round (iOS, GitHub);\n * `adaptive` swaps the colours in a dark browser, for the favicon.\n */\nexport function markSvg(size: number, { square = false, adaptive = false } = {}): string {\n const dark = adaptive ? `<style>@media (prefers-color-scheme:dark){rect{fill:${INK}}path{fill:${TILE}}}</style>` : '';\n const radius = square ? '' : ` rx=\"${TILE_RADIUS}\"`;\n return (\n `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\">${dark}` +\n `<rect width=\"32\" height=\"32\"${radius} fill=\"${TILE}\"/>` +\n `<path d=\"${markPath(size)}\" fill=\"${INK}\"/></svg>`\n );\n}\n","import type { LucideIcon } from 'lucide-react';\nimport {\n Activity as ActivityGlyph,\n ArrowRight as ArrowRightGlyph,\n Archive as ArchiveGlyph,\n Ban,\n Check as CheckGlyph,\n ChevronDown as ChevronDownGlyph,\n ChevronRight as ChevronRightGlyph,\n ChevronsUpDown as ChevronsUpDownGlyph,\n CircleAlert,\n CircleCheck,\n Clock as ClockGlyph,\n Copy as CopyGlyph,\n Ellipsis,\n Eye as EyeGlyph,\n EyeOff as EyeOffGlyph,\n Folder as FolderGlyph,\n Hash as HashGlyph,\n History as HistoryGlyph,\n Inbox as InboxGlyph,\n Info as InfoGlyph,\n KeyRound,\n Layers as LayersGlyph,\n Link as LinkGlyph,\n LoaderCircle,\n Lock as LockGlyph,\n LogOut,\n Menu as MenuGlyph,\n Monitor as MonitorGlyph,\n Moon as MoonGlyph,\n PanelLeft as PanelLeftGlyph,\n Pause as PauseGlyph,\n Pencil as PencilGlyph,\n Play as PlayGlyph,\n Plus as PlusGlyph,\n RotateCcw,\n ScrollText,\n Search as SearchGlyph,\n Settings as SettingsGlyph,\n ShieldCheck as ShieldCheckGlyph,\n Shuffle as ShuffleGlyph,\n Sun as SunGlyph,\n Terminal as TerminalGlyph,\n Trash2,\n TriangleAlert,\n Upload as UploadGlyph,\n User as UserGlyph,\n UserRoundCog,\n Users as UsersGlyph,\n WandSparkles,\n X as XGlyph,\n} from 'lucide-react';\nimport { markPath } from './mark';\n\n/**\n * One icon vocabulary for the whole app: Lucide, at one stroke weight.\n *\n * Mixing icon families is the fastest way to make a product UI feel assembled\n * rather than designed, so every glyph comes through here and call sites never\n * import Lucide themselves: changing one is a line in this file. The\n * exceptions are marks that are not ours to redraw: coffre's mark and the\n * sign-in providers' logos.\n */\n\ntype IconProps = {\n size?: number;\n className?: string;\n style?: React.CSSProperties;\n /** Icons are decorative by default; pass a label when one carries meaning. */\n label?: string;\n};\n\nfunction Svg({\n size = 16,\n className,\n style,\n label,\n children,\n}: IconProps & { children: React.ReactNode }) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.6}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={className}\n style={style}\n aria-hidden={label === undefined}\n aria-label={label}\n role={label === undefined ? undefined : 'img'}\n >\n {children}\n </svg>\n );\n}\n\n/**\n * The mark, bare, in the text's colour, so it follows the theme. The tiled\n * favicon and app icons are drawn from the same paths, in `./mark`.\n */\nexport function Mark({ size = 16, className, style, label }: IconProps) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 32 32\"\n className={className}\n style={style}\n aria-hidden={label === undefined}\n aria-label={label}\n role={label === undefined ? undefined : 'img'}\n >\n <path d={markPath(size)} fill=\"currentColor\" />\n </svg>\n );\n}\n\n/**\n * Lucide draws on a 24-unit grid with a 2-unit stroke. At the 14-16px these\n * are shown, 1.75 sits closer to Inter's weight beside them.\n */\nconst STROKE = 1.75;\n\nfunction lucide(Glyph: LucideIcon) {\n // Lucide hides a glyph from assistive technology unless it is labelled.\n return function Icon({ size = 16, className, style, label }: IconProps) {\n return (\n <Glyph\n size={size}\n strokeWidth={STROKE}\n className={className}\n style={style}\n {...(label === undefined ? {} : { 'aria-label': label, role: 'img' })}\n />\n );\n };\n}\n\n// Places\nexport const Folder = lucide(FolderGlyph);\nexport const Layers = lucide(LayersGlyph);\nexport const Users = lucide(UsersGlyph);\nexport const User = lucide(UserGlyph);\n/** Your own settings, so they never share the instance's gear. */\nexport const UserCog = lucide(UserRoundCog);\nexport const Key = lucide(KeyRound);\nexport const Ledger = lucide(ScrollText);\nexport const Settings = lucide(SettingsGlyph);\n\n// Secrets\nexport const Eye = lucide(EyeGlyph);\nexport const EyeOff = lucide(EyeOffGlyph);\nexport const Copy = lucide(CopyGlyph);\nexport const Generate = lucide(WandSparkles);\nexport const Shuffle = lucide(ShuffleGlyph);\nexport const Pencil = lucide(PencilGlyph);\nexport const Archive = lucide(ArchiveGlyph);\nexport const Trash = lucide(Trash2);\nexport const History = lucide(HistoryGlyph);\nexport const RotateBack = lucide(RotateCcw);\nexport const Upload = lucide(UploadGlyph);\nexport const Pause = lucide(PauseGlyph);\nexport const Play = lucide(PlayGlyph);\nexport const Lock = lucide(LockGlyph);\nexport const Terminal = lucide(TerminalGlyph);\nexport const Hash = lucide(HashGlyph);\nexport const Clock = lucide(ClockGlyph);\n\n// Outcomes\nexport const Check = lucide(CheckGlyph);\nexport const CheckCircle = lucide(CircleCheck);\nexport const SlashCircle = lucide(Ban);\nexport const ShieldCheck = lucide(ShieldCheckGlyph);\nexport const AlertTriangle = lucide(TriangleAlert);\nexport const AlertCircle = lucide(CircleAlert);\nexport const Info = lucide(InfoGlyph);\nexport const Activity = lucide(ActivityGlyph);\nexport const Inbox = lucide(InboxGlyph);\nexport const Loader = lucide(LoaderCircle);\n\n// Controls\nexport const X = lucide(XGlyph);\nexport const Plus = lucide(PlusGlyph);\nexport const Search = lucide(SearchGlyph);\nexport const Menu = lucide(MenuGlyph);\nexport const PanelLeft = lucide(PanelLeftGlyph);\nexport const MoreHorizontal = lucide(Ellipsis);\nexport const ChevronRight = lucide(ChevronRightGlyph);\nexport const ChevronDown = lucide(ChevronDownGlyph);\nexport const ChevronsUpDown = lucide(ChevronsUpDownGlyph);\nexport const ArrowRight = lucide(ArrowRightGlyph);\nexport const Link = lucide(LinkGlyph);\nexport const SignOut = lucide(LogOut);\n\n// Theme\nexport const Sun = lucide(SunGlyph);\nexport const Moon = lucide(MoonGlyph);\nexport const Monitor = lucide(MonitorGlyph);\n\n/**\n * GitHub's mark, drawn as GitHub publishes it: a filled shape on its own\n * 16-unit grid, since a brand is not ours to redraw in the stroke style.\n */\nexport function GitHub({ size = 16, className, style }: IconProps) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 16 16\"\n fill=\"currentColor\"\n className={className}\n style={style}\n aria-hidden\n >\n <path d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z\" />\n </svg>\n );\n}\n\n/** Google's \"G\", in its four colours, as Google's sign-in guidelines require. */\nexport function Google({ size = 16, className, style }: IconProps) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 48 48\" className={className} style={style} aria-hidden>\n <path fill=\"#EA4335\" d=\"M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z\" />\n <path fill=\"#4285F4\" d=\"M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z\" />\n <path fill=\"#FBBC05\" d=\"M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z\" />\n <path fill=\"#34A853\" d=\"M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z\" />\n </svg>\n );\n}\n\n/** Microsoft's four squares. */\nexport function Microsoft({ size = 16, className, style }: IconProps) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 21 21\" className={className} style={style} aria-hidden>\n <rect x=\"0\" y=\"0\" width=\"10\" height=\"10\" fill=\"#F25022\" />\n <rect x=\"11\" y=\"0\" width=\"10\" height=\"10\" fill=\"#7FBA00\" />\n <rect x=\"0\" y=\"11\" width=\"10\" height=\"10\" fill=\"#00A4EF\" />\n <rect x=\"11\" y=\"11\" width=\"10\" height=\"10\" fill=\"#FFB900\" />\n </svg>\n );\n}\n\n/** The mark on a provider's button; any other OpenID Connect issuer gets a key. */\nexport function ProviderMark({ brand, size = 16 }: { brand: string; size?: number }) {\n switch (brand) {\n case 'github':\n return <GitHub size={size} />;\n case 'google':\n return <Google size={size} />;\n case 'microsoft':\n return <Microsoft size={size} />;\n default:\n return <Key size={size} />;\n }\n}\n","const HUES = ['blue', 'green', 'amber', 'violet'] as const;\n\n/** The same name always lands on the same tint, on every screen (FNV-1a). */\nexport function tileHue(name: string): (typeof HUES)[number] {\n let hash = 0x811c9dc5;\n for (const char of name) hash = Math.imul(hash ^ char.charCodeAt(0), 0x01000193) >>> 0;\n return HUES[hash % HUES.length];\n}\n\n/**\n * A letter on a tint, standing in for a project wherever its name appears.\n *\n * It is a recognition aid, not information: the name is always beside it, so\n * the tile is hidden from assistive technology.\n */\nexport function Tile({ name, size = 'sm' }: { name: string; size?: 'sm' | 'lg' }) {\n return (\n <span className={`tile tile-${tileHue(name)}${size === 'lg' ? ' tile-lg' : ''}`} aria-hidden>\n {name.slice(0, 1)}\n </span>\n );\n}\n","import { CoffreError, type CoffreClient } from '@coffre/client';\nimport { useRouter } from '@tanstack/react-router';\n\nimport type { CoffreContext } from '../options';\n\n/**\n * The API as whoever is looking at the page, with their permissions: what\n * coffre's pages call, and a deployment's own may too. In the browser this\n * is plain `fetch` to `/api`, carrying the session cookie; on the server,\n * the API in process. Components call it from event handlers; loaders read\n * the same client as `context.coffre`.\n */\nexport function useCoffre(): CoffreClient {\n return (useRouter().options.context as CoffreContext).coffre;\n}\n\n/** A refusal the page words itself, shown as it is. */\nexport class Refusal extends Error {}\n\n/** A call that failed: what to say, and whether signing in again would help, which it does only for an ended session. */\ntype Failure = { ok: false; error: string; signedOut: boolean };\n\n/** The HTTP status of an API error; undefined when the request never got an answer. */\nexport function statusOf(error: unknown): number | undefined {\n return error instanceof CoffreError ? error.status : undefined;\n}\n\n/** What to tell the person when a call fails. */\nexport function failureMessage(error: unknown): string {\n if (error instanceof Refusal) return error.message;\n if (!(error instanceof CoffreError)) return 'The request could not be sent. Nothing was changed.';\n if (error.status === 401) return 'Your session has ended. Sign in again, then retry.';\n if (error.code === 'cross_origin') return 'coffre refused a change that did not come from this page. Reload, then retry.';\n // Only an Owner of the whole instance makes, changes or removes an Owner: the API's sentence says so, where a 403's would say a grant is missing.\n if (error.code === 'vault_refused' && error.reason === 'not_allowed') return error.message;\n if (error.status === 403) {\n return 'You hold no grant that covers this. Someone with grant.manage on the project can add one.';\n }\n if (error.status === 404) return 'Not found. It may have been renamed or archived.';\n // A 400 or 409 carries a sentence written for the person, such as which\n // field of a request is wrong, which names a service account as people\n // do, service:<name>. Anything unexpected stays generic.\n if (error.status === 400 || error.status === 409) return error.message;\n return 'coffre is unavailable. Nothing was read or written.';\n}\n\nexport function uiFailure(error: unknown): Failure {\n return { ok: false, error: failureMessage(error), signedOut: statusOf(error) === 401 };\n}\n\n/** A loader's answer: what it read, or what to say instead. */\nexport async function uiResult<T extends object>(\n operation: () => Promise<T>,\n): Promise<({ ok: true } & T) | Failure> {\n try {\n return { ok: true, ...(await operation()) };\n } catch (error) {\n return uiFailure(error);\n }\n}\n\n/** How the API names a member: `user:ada@acme.example`, `token:ci-deploy` (which people read as `service:ci-deploy`). */\nexport function memberRef(principalType: 'user' | 'service', principalId: string): string {\n return `${principalType === 'user' ? 'user' : 'token'}:${principalId}`;\n}\n","import type { ReactNode } from 'react';\nimport { Tile } from './tile';\n\n/**\n * The head of every page: an optional project tile, the title with a muted\n * aside, one line of description or facts, and the page's own actions.\n *\n * Where you are is already in the top bar's path, so the head does not repeat\n * it; it says what this page is.\n */\nexport function PageHeader({\n tile,\n lead,\n title,\n aside,\n description,\n meta,\n actions,\n}: {\n tile?: string;\n /** Stands where the tile would, for pages that are not about a project. */\n lead?: ReactNode;\n title: ReactNode;\n aside?: ReactNode;\n description?: ReactNode;\n meta?: ReactNode;\n actions?: ReactNode;\n}) {\n return (\n <header className=\"page-head\">\n <div className=\"page-head-text\">\n {tile !== undefined && <Tile name={tile} size=\"lg\" />}\n {lead}\n <div style={{ minWidth: 0 }}>\n <h1 className=\"page-title\">\n <span>{title}</span>\n {aside !== undefined && aside !== null && (\n <span className=\"page-title-aside\">{aside}</span>\n )}\n </h1>\n {description !== undefined && <p className=\"page-desc\">{description}</p>}\n {meta !== undefined && <div className=\"page-meta\">{meta}</div>}\n </div>\n </div>\n {actions !== undefined && actions !== false && (\n <div className=\"page-actions\">{actions}</div>\n )}\n </header>\n );\n}\n\n/** A bordered panel with a titled head; tables inside it run edge to edge. */\nexport function Card({\n title,\n description,\n actions,\n children,\n labelledBy,\n tone,\n wide = false,\n}: {\n title: ReactNode;\n description?: ReactNode;\n actions?: ReactNode;\n children: ReactNode;\n labelledBy: string;\n tone?: 'danger';\n /** Takes the content column whole, for a table of many or long columns. */\n wide?: boolean;\n}) {\n return (\n <section\n className={`card${tone === 'danger' ? ' card-danger' : ''}${wide ? ' card-wide' : ''}`}\n aria-labelledby={labelledBy}\n >\n <div className=\"card-head\">\n <div>\n <h2 className=\"card-title\" id={labelledBy}>\n {title}\n </h2>\n {description !== undefined && <p className=\"card-desc\">{description}</p>}\n </div>\n {actions}\n </div>\n {children}\n </section>\n );\n}\n\n/** One labelled fact in a card's `dl.facts`. */\nexport function Fact({ label, children }: { label: string; children: ReactNode }) {\n return (\n <div className=\"fact\">\n <dt>{label}</dt>\n <dd>{children}</dd>\n </div>\n );\n}\n\n/**\n * A page that cannot be shown: no access, no such thing, or no session.\n *\n * It says which page, why in a sentence, and offers the one useful way out.\n */\nexport function ClosedDoor({\n icon,\n label,\n title,\n children,\n actions,\n}: {\n icon?: ReactNode;\n label?: ReactNode;\n title: ReactNode;\n children: ReactNode;\n actions?: ReactNode;\n}) {\n return (\n <div className=\"closed\" role=\"status\">\n {icon !== undefined && (\n <div className=\"closed-icon\" aria-hidden>\n {icon}\n </div>\n )}\n {label !== undefined && <p className=\"closed-label\">{label}</p>}\n <h1 className=\"closed-title\">{title}</h1>\n <div className=\"closed-body\">{children}</div>\n {actions !== undefined && <div className=\"closed-actions\">{actions}</div>}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAYA,IAAa,YAAY;;AAGzB,IAAa,kBAAkB;AAW/B,SAAgB,SAAS,MAAsB;CAC7C,OAAO,QAAQ,KAAK,kBAAkB;AACxC;;;;;;;AC6EA,SAAgB,KAAK,EAAE,OAAO,IAAI,WAAW,OAAO,SAAoB;CACtE,OACE,oBAAC,OAAD;EACE,OAAO;EACP,QAAQ;EACR,SAAQ;EACG;EACJ;EACP,eAAa,UAAU,KAAA;EACvB,cAAY;EACZ,MAAM,UAAU,KAAA,IAAY,KAAA,IAAY;YAExC,oBAAC,QAAD;GAAM,GAAG,SAAS,IAAI;GAAG,MAAK;EAAgB,CAAA;CAC3C,CAAA;AAET;;;;;AAMA,IAAM,SAAS;AAEf,SAAS,OAAO,OAAmB;CAEjC,OAAO,SAAS,KAAK,EAAE,OAAO,IAAI,WAAW,OAAO,SAAoB;EACtE,OACE,oBAAC,OAAD;GACQ;GACN,aAAa;GACF;GACJ;GACP,GAAK,UAAU,KAAA,IAAY,CAAC,IAAI;IAAE,cAAc;IAAO,MAAM;GAAM;EACpE,CAAA;CAEL;AACF;AAGA,IAAa,WAAS,OAAO,MAAW;AACxC,IAAa,WAAS,OAAO,MAAW;AACxC,IAAa,UAAQ,OAAO,KAAU;AACtC,IAAa,SAAO,OAAO,IAAS;;AAEpC,IAAa,UAAU,OAAO,YAAY;AAC1C,IAAa,MAAM,OAAO,QAAQ;AAClC,IA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nB,CAIE,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,qBAAC,OAAD,EAAA,UAAA,CACE,oBAAC,MAAD;IAAI,WAAU;IAAa,IAAI;cAC5B;GACC,CAAA,GACH,gBAAgB,KAAA,KAAa,oBAAC,KAAD;IAAG,WAAU;cAAa;GAAe,CAAA,CACpE,EAAA,CAAA,GACJ,OACE;MACJ,QACM;;AAEb;;AAGA,SAAgB,KAAK,EAAE,OAAO,YAAoD;CAChF,OACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,oBAAC,MAAD,EAAA,UAAK,MAAU,CAAA,GACf,oBAAC,MAAD,EAAK,SAAa,CAAA,CACf;;AAET;;;;;;AAOA,SAAgB,WAAW,EACzB,MACA,OACA,OACA,UACA,WAOC;CACD,OACE,qBAAC,OAAD;EAAK,WAAU;EAAS,MAAK;YAA7B;GACG,SAAS,KAAA,KACR,oBAAC,OAAD;IAAK,WAAU;IAAc,eAAA;cAC1B;GACE,CAAA;GAEN,UAAU,KAAA,KAAa,oBAAC,KAAD;IAAG,WAAU;cAAgB;GAAS,CAAA;GAC9D,oBAAC,MAAD;IAAI,WAAU;cAAgB;GAAU,CAAA;GACxC,oBAAC,OAAD;IAAK,WAAU;IAAe;GAAc,CAAA;GAC3C,YAAY,KAAA,KAAa,oBAAC,OAAD;IAAK,WAAU;cAAkB;GAAa,CAAA;EACrE;;AAET"}
@@ -1,7 +1,7 @@
1
- import { a as ErrorLine, i as EmptyState, t as ConfirmButton, u as Timestamp } from "./ui-CGdORVzW.js";
2
- import { N as Key, ct as X, t as Card } from "./page-CfhC9Hp1.js";
3
- import { a as rowClass, i as RowPending, r as RowFailure } from "./row-state-CYH7kZHl.js";
4
- import { n as useChangeStatus, t as useChange } from "./use-change-BorW2R6C.js";
1
+ import { a as ErrorLine, g as ofAll, i as EmptyState, t as ConfirmButton, u as Timestamp } from "./ui-Q_Eczt7m.js";
2
+ import { M as Key, st as X, t as Card } from "./page-Cb0ZjGda.js";
3
+ import { a as rowClass, i as RowPending, r as RowFailure } from "./row-state-CYhtmUkc.js";
4
+ import { n as useChangeStatus, t as useChange } from "./use-change-Cc0X4sF3.js";
5
5
  import { Fragment } from "react";
6
6
  import { credentialScopeInWords } from "@coffre/core/access";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -12,12 +12,12 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
12
  * the instance. Each row says what it is called, what it reaches and when
13
13
  * it ends; Revoke stops it at its next request.
14
14
  */
15
- function PersonalTokensCard({ tokens, change, description, empty, emptyActions }) {
15
+ function PersonalTokensCard({ tokens, change, description, empty, emptyActions, total = null }) {
16
16
  const revoke = useChange(change);
17
17
  const { status, dismiss } = useChangeStatus(change.list.queryKey);
18
18
  return /* @__PURE__ */ jsx(Card, {
19
19
  labelledBy: "personal-tokens",
20
- title: "Personal tokens",
20
+ title: `Personal tokens${"error" in tokens ? "" : ofAll(tokens.length, total)}`,
21
21
  description,
22
22
  children: "error" in tokens ? /* @__PURE__ */ jsx("div", {
23
23
  className: "card-body",
@@ -135,4 +135,4 @@ function PersonalTokensCard({ tokens, change, description, empty, emptyActions }
135
135
  //#endregion
136
136
  export { PersonalTokensCard as t };
137
137
 
138
- //# sourceMappingURL=personal-tokens-xC9wulhg.js.map
138
+ //# sourceMappingURL=personal-tokens-CSHMlRHy.js.map