@open-charging-cloud/chargy-gui 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/LICENSE +661 -0
  3. package/README.md +48 -2
  4. package/SECURITY.md +21 -0
  5. package/dist/anchorKeyTrust.d.ts +9 -0
  6. package/dist/anchorKeyTrust.d.ts.map +1 -0
  7. package/dist/anchorKeyTrust.js +24 -0
  8. package/dist/anchorKeyTrust.js.map +1 -0
  9. package/dist/anchorKeyTrustView.d.ts +14 -0
  10. package/dist/anchorKeyTrustView.d.ts.map +1 -0
  11. package/dist/anchorKeyTrustView.js +95 -0
  12. package/dist/anchorKeyTrustView.js.map +1 -0
  13. package/dist/browserFiles.d.ts +5 -0
  14. package/dist/browserFiles.d.ts.map +1 -0
  15. package/dist/browserFiles.js +100 -0
  16. package/dist/browserFiles.js.map +1 -0
  17. package/dist/core/i18n.json +1518 -0
  18. package/dist/core/package.json +119 -0
  19. package/dist/core/validationRules.json +8 -0
  20. package/dist/domHelpers.d.ts +25 -0
  21. package/dist/domHelpers.d.ts.map +1 -0
  22. package/dist/domHelpers.js +212 -0
  23. package/dist/domHelpers.js.map +1 -0
  24. package/dist/historicalSessionPanel.d.ts +24 -0
  25. package/dist/historicalSessionPanel.d.ts.map +1 -0
  26. package/dist/historicalSessionPanel.js +108 -0
  27. package/dist/historicalSessionPanel.js.map +1 -0
  28. package/dist/index.d.ts +40 -0
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +56 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/liveLinkTrust.d.ts +208 -0
  33. package/dist/liveLinkTrust.d.ts.map +1 -0
  34. package/dist/liveLinkTrust.js +452 -0
  35. package/dist/liveLinkTrust.js.map +1 -0
  36. package/dist/livePOISession.d.ts +38 -0
  37. package/dist/livePOISession.d.ts.map +1 -0
  38. package/dist/livePOISession.js +193 -0
  39. package/dist/livePOISession.js.map +1 -0
  40. package/dist/measurementDetailsRenderer.d.ts +25 -0
  41. package/dist/measurementDetailsRenderer.d.ts.map +1 -0
  42. package/dist/measurementDetailsRenderer.js +343 -0
  43. package/dist/measurementDetailsRenderer.js.map +1 -0
  44. package/dist/poiConsistencyView.d.ts +3 -0
  45. package/dist/poiConsistencyView.d.ts.map +1 -0
  46. package/dist/poiConsistencyView.js +14 -0
  47. package/dist/poiConsistencyView.js.map +1 -0
  48. package/dist/poiObservedHistory.d.ts +49 -0
  49. package/dist/poiObservedHistory.d.ts.map +1 -0
  50. package/dist/poiObservedHistory.js +205 -0
  51. package/dist/poiObservedHistory.js.map +1 -0
  52. package/dist/poiTransport.d.ts +12 -0
  53. package/dist/poiTransport.d.ts.map +1 -0
  54. package/dist/poiTransport.js +74 -0
  55. package/dist/poiTransport.js.map +1 -0
  56. package/dist/poiTrustContext.d.ts +134 -0
  57. package/dist/poiTrustContext.d.ts.map +1 -0
  58. package/dist/poiTrustContext.js +243 -0
  59. package/dist/poiTrustContext.js.map +1 -0
  60. package/dist/poiTrustLineage.d.ts +10 -0
  61. package/dist/poiTrustLineage.d.ts.map +1 -0
  62. package/dist/poiTrustLineage.js +47 -0
  63. package/dist/poiTrustLineage.js.map +1 -0
  64. package/dist/poiURLs.d.ts +5 -0
  65. package/dist/poiURLs.d.ts.map +1 -0
  66. package/dist/poiURLs.js +24 -0
  67. package/dist/poiURLs.js.map +1 -0
  68. package/dist/poiWitnessManagement.d.ts +3 -0
  69. package/dist/poiWitnessManagement.d.ts.map +1 -0
  70. package/dist/poiWitnessManagement.js +127 -0
  71. package/dist/poiWitnessManagement.js.map +1 -0
  72. package/dist/poiWitnessTrust.d.ts +26 -0
  73. package/dist/poiWitnessTrust.d.ts.map +1 -0
  74. package/dist/poiWitnessTrust.js +90 -0
  75. package/dist/poiWitnessTrust.js.map +1 -0
  76. package/dist/pricePublicationData.d.ts +19 -0
  77. package/dist/pricePublicationData.d.ts.map +1 -0
  78. package/dist/pricePublicationData.js +83 -0
  79. package/dist/pricePublicationData.js.map +1 -0
  80. package/dist/roamingNetworks.d.ts +14 -0
  81. package/dist/roamingNetworks.d.ts.map +1 -0
  82. package/dist/roamingNetworks.js +33 -0
  83. package/dist/roamingNetworks.js.map +1 -0
  84. package/dist/securityFingerprint.d.ts +16 -0
  85. package/dist/securityFingerprint.d.ts.map +1 -0
  86. package/dist/securityFingerprint.js +36 -0
  87. package/dist/securityFingerprint.js.map +1 -0
  88. package/dist/securityFingerprintView.d.ts +3 -0
  89. package/dist/securityFingerprintView.d.ts.map +1 -0
  90. package/dist/securityFingerprintView.js +61 -0
  91. package/dist/securityFingerprintView.js.map +1 -0
  92. package/dist/sessionEvidenceStore.d.ts +23 -0
  93. package/dist/sessionEvidenceStore.d.ts.map +1 -0
  94. package/dist/sessionEvidenceStore.js +81 -0
  95. package/dist/sessionEvidenceStore.js.map +1 -0
  96. package/dist/sessionMeterKeyView.d.ts +9 -0
  97. package/dist/sessionMeterKeyView.d.ts.map +1 -0
  98. package/dist/sessionMeterKeyView.js +55 -0
  99. package/dist/sessionMeterKeyView.js.map +1 -0
  100. package/dist/sessionPOIData.d.ts +49 -0
  101. package/dist/sessionPOIData.d.ts.map +1 -0
  102. package/dist/sessionPOIData.js +161 -0
  103. package/dist/sessionPOIData.js.map +1 -0
  104. package/dist/sessionPOIPanel.d.ts +50 -0
  105. package/dist/sessionPOIPanel.d.ts.map +1 -0
  106. package/dist/sessionPOIPanel.js +288 -0
  107. package/dist/sessionPOIPanel.js.map +1 -0
  108. package/dist/sessionPriceData.d.ts +17 -0
  109. package/dist/sessionPriceData.d.ts.map +1 -0
  110. package/dist/sessionPriceData.js +51 -0
  111. package/dist/sessionPriceData.js.map +1 -0
  112. package/dist/sessionPricePanel.d.ts +31 -0
  113. package/dist/sessionPricePanel.d.ts.map +1 -0
  114. package/dist/sessionPricePanel.js +222 -0
  115. package/dist/sessionPricePanel.js.map +1 -0
  116. package/dist/sessionUIState.d.ts +12 -0
  117. package/dist/sessionUIState.d.ts.map +1 -0
  118. package/dist/sessionUIState.js +33 -0
  119. package/dist/sessionUIState.js.map +1 -0
  120. package/dist/stationProofData.d.ts +38 -0
  121. package/dist/stationProofData.d.ts.map +1 -0
  122. package/dist/stationProofData.js +83 -0
  123. package/dist/stationProofData.js.map +1 -0
  124. package/dist/stationProofPanel.d.ts +44 -0
  125. package/dist/stationProofPanel.d.ts.map +1 -0
  126. package/dist/stationProofPanel.js +304 -0
  127. package/dist/stationProofPanel.js.map +1 -0
  128. package/dist/stationProofView.d.ts +9 -0
  129. package/dist/stationProofView.d.ts.map +1 -0
  130. package/dist/stationProofView.js +186 -0
  131. package/dist/stationProofView.js.map +1 -0
  132. package/dist/trustAnchorData.d.ts +40 -0
  133. package/dist/trustAnchorData.d.ts.map +1 -0
  134. package/dist/trustAnchorData.js +91 -0
  135. package/dist/trustAnchorData.js.map +1 -0
  136. package/dist/trustAnchorDataView.d.ts +13 -0
  137. package/dist/trustAnchorDataView.d.ts.map +1 -0
  138. package/dist/trustAnchorDataView.js +69 -0
  139. package/dist/trustAnchorDataView.js.map +1 -0
  140. package/dist/trustAnchorImport.d.ts +5 -0
  141. package/dist/trustAnchorImport.d.ts.map +1 -0
  142. package/dist/trustAnchorImport.js +34 -0
  143. package/dist/trustAnchorImport.js.map +1 -0
  144. package/dist/trustAnchorPreview.d.ts +37 -0
  145. package/dist/trustAnchorPreview.d.ts.map +1 -0
  146. package/dist/trustAnchorPreview.js +180 -0
  147. package/dist/trustAnchorPreview.js.map +1 -0
  148. package/dist/trustManagement.d.ts +34 -0
  149. package/dist/trustManagement.d.ts.map +1 -0
  150. package/dist/trustManagement.js +405 -0
  151. package/dist/trustManagement.js.map +1 -0
  152. package/dist/trustStore.d.ts +75 -0
  153. package/dist/trustStore.d.ts.map +1 -0
  154. package/dist/trustStore.js +408 -0
  155. package/dist/trustStore.js.map +1 -0
  156. package/dist/trustTransitionView.d.ts +5 -0
  157. package/dist/trustTransitionView.d.ts.map +1 -0
  158. package/dist/trustTransitionView.js +110 -0
  159. package/dist/trustTransitionView.js.map +1 -0
  160. package/dist/trustedPublicKeys.d.ts +4 -0
  161. package/dist/trustedPublicKeys.d.ts.map +1 -0
  162. package/dist/trustedPublicKeys.js +25 -0
  163. package/dist/trustedPublicKeys.js.map +1 -0
  164. package/dist/wwcpPoi.d.ts +2 -0
  165. package/dist/wwcpPoi.d.ts.map +1 -0
  166. package/dist/wwcpPoi.js +2 -0
  167. package/dist/wwcpPoi.js.map +1 -0
  168. package/documentation/AUDIT.md +262 -0
  169. package/images/NGI0_tag.svg +149 -0
  170. package/package.json +75 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trustAnchorPreview.js","sourceRoot":"","sources":["../src/trustAnchorPreview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC/H,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AA6BzE,sFAAsF;AACtF,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC;IAE3D,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1B,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,IAAI,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxF,IAAI,CAAC;YACD,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;YAClC,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBACnB,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;gBACnC,MAAM,MAAM,GAAG,OAAO,KAAK,oBAAoB,IAAI,KAA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AAK,SAAS,EAAE,CAAC;QAClC,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;QACrE,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC;QACvB,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAC;QACrC,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAAC;QACnD,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC;IACvC,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC","sourcesContent":["import { TrustAnchor, TRUST_ANCHOR_QR_PREFIX, TRUST_ANCHOR_CONTEXT, parseJSON, isObject } from '@open-charging-cloud/wwcp-poi';\nimport { renderSecurityFingerprint } from './securityFingerprintView.js';\n\nexport interface TrustAnchorPreview {\n readonly anchor: TrustAnchor;\n readonly text: string;\n}\n\nexport type TrustAnchorCheckState = \"valid\" | \"invalid\" | \"unavailable\";\n\n/** Results supplied by a verifier, independently of the scanned document. */\nexport interface TrustAnchorValidation {\n readonly signatures: TrustAnchorCheckState;\n readonly signers: TrustAnchorCheckState;\n readonly quorum: TrustAnchorCheckState;\n readonly validity?: TrustAnchorCheckState;\n readonly reasons?: Readonly<Partial<Record<\"signatures\" | \"signers\" | \"quorum\" | \"validity\", string>>>;\n}\n\nexport interface TrustAnchorPreviewOptions {\n readonly busy?: boolean;\n readonly onImport?: () => void;\n readonly onDiscard?: () => void;\n}\n\nexport type ScannedTrustAnchor =\n | { readonly kind: \"other\" }\n | { readonly kind: \"invalid\"; readonly message: string; readonly messageKey?: string }\n | { readonly kind: \"anchor\"; readonly preview: TrustAnchorPreview };\n\n/** Shared by camera, clipboard and files. Never follows URLs or establishes trust. */\nexport function parseTrustAnchorInput(text: string): ScannedTrustAnchor {\n const trimmed = text.trim();\n let candidate = trimmed.startsWith(TRUST_ANCHOR_QR_PREFIX);\n\n if (trimmed.startsWith(\"{\")) {\n candidate = trimmed.includes(TRUST_ANCHOR_CONTEXT) || /\"trustAnchor\"\\s*:/.test(trimmed);\n try {\n const parsed = parseJSON(trimmed);\n if (isObject(parsed)) {\n const context = parsed[\"@context\"];\n const direct = context === TRUST_ANCHOR_CONTEXT || Array.isArray(context) && context.includes(TRUST_ANCHOR_CONTEXT);\n // Do not consume a charging receipt or evidence bundle merely because it embeds an anchor.\n const responseFields = [\"roamingNetworkId\", \"identityKeyIds\", \"minConsensus\", \"uri\", \"qrCode\", \"trustAnchor\"];\n const response = \"trustAnchor\" in parsed && Object.keys(parsed).every(key => responseFields.includes(key));\n if (!direct && !response)\n return { kind: \"other\" };\n const value = response ? parsed[\"trustAnchor\"] : parsed;\n if (isObject(value)) {\n const valueContext = value[\"@context\"];\n if (valueContext === TRUST_ANCHOR_CONTEXT || Array.isArray(valueContext) && valueContext.includes(TRUST_ANCHOR_CONTEXT))\n return { kind: \"anchor\", preview: { anchor: TrustAnchor.fromJSON(value), text: trimmed } };\n }\n }\n return candidate ? { kind: \"invalid\", message: \"Invalid trust anchor document\" } : { kind: \"other\" };\n }\n catch (error) {\n return candidate ? { kind: \"invalid\", message: error instanceof Error ? error.message : String(error) } : { kind: \"other\" };\n }\n }\n\n if (!candidate) {\n try {\n const url = new URL(trimmed);\n candidate = (url.protocol === \"https:\" || url.protocol === \"http:\") &&\n url.pathname.replace(/\\/+$/, \"\").split(\"/\").at(-2) === \"RNs\" &&\n url.searchParams.has(\"keys\");\n }\n catch {\n return { kind: \"other\" };\n }\n }\n\n if (!candidate)\n return { kind: \"other\" };\n\n try {\n return { kind: \"anchor\", preview: { anchor: TrustAnchor.parse(trimmed), text: trimmed } };\n }\n catch (error) {\n return { kind: \"invalid\", message: error instanceof Error ? error.message : String(error) };\n }\n}\n\nexport const parseScannedTrustAnchor = parseTrustAnchorInput;\n\n/** All three checks must pass before the whole field receives the success appearance. */\nexport function renderTrustAnchorValidation(result: TrustAnchorValidation,\n localize: (key: string) => string,\n activeTrustedKeyCount: number = 0,\n unavailableReason?: string): HTMLElement {\n const validation = document.createElement(\"section\");\n validation.className = \"trustAnchorValidation\";\n const states = [ result.signatures, result.signers, result.quorum, ...(result.validity === undefined ? [] : [result.validity]) ];\n const allValid = states.every(state => state === \"valid\");\n validation.dataset[\"state\"] = allValid ? \"valid\" : states.includes(\"invalid\") ? \"invalid\" : \"unavailable\";\n validation.setAttribute(\"aria-labelledby\", \"trustAnchorValidationTitle\");\n const validationTitle = validation.appendChild(document.createElement(\"h3\"));\n validationTitle.id = \"trustAnchorValidationTitle\";\n validationTitle.textContent = localize(\"trustAnchorValidationTitle\");\n if (allValid) {\n const icon = document.createElement(\"i\");\n icon.className = \"fas fa-check-circle trustAnchorValidationSuccessIcon\";\n icon.setAttribute(\"aria-hidden\", \"true\");\n validationTitle.prepend(icon, document.createTextNode(\" \"));\n }\n\n const checks: { id: \"signatures\" | \"signers\" | \"quorum\" | \"validity\", state: TrustAnchorCheckState, label: string, reason: string }[] = [\n { id: \"signatures\", state: result.signatures, label: \"trustAnchorSignaturesValid\", reason: \"trustAnchorNoSignatures\" },\n { id: \"signers\", state: result.signers, label: \"trustAnchorSignersTrusted\", reason: \"trustAnchorSignersNotCheckable\" },\n { id: \"quorum\", state: result.quorum, label: \"trustAnchorQuorumMet\", reason: \"trustAnchorQuorumNotCheckable\" }\n ];\n if (result.validity !== undefined)\n checks.push({ id: \"validity\", state: result.validity, label: \"trustDataValidityLabel\", reason: \"trustDataValidityUnknown\" });\n const checkList = validation.appendChild(document.createElement(\"ul\"));\n for (const check of checks) {\n const row = checkList.appendChild(document.createElement(\"li\"));\n row.dataset[\"check\"] = check.id;\n row.dataset[\"state\"] = check.state;\n const icon = row.appendChild(document.createElement(\"span\"));\n icon.className = \"trustAnchorCheckIcon\";\n icon.setAttribute(\"aria-hidden\", \"true\");\n if (check.state === \"valid\")\n icon.classList.add(\"fas\", \"fa-check-circle\");\n else if (check.state === \"invalid\")\n icon.classList.add(\"fas\", \"fa-times-circle\");\n else\n icon.textContent = \"○\";\n const content = row.appendChild(document.createElement(\"div\"));\n const label = content.appendChild(document.createElement(\"strong\"));\n label.textContent = localize(check.label);\n const reason = content.appendChild(document.createElement(\"p\"));\n reason.textContent = result.reasons?.[check.id] ?? localize(check.state === \"valid\" ? \"trustAnchorCheckPassed\" :\n check.state === \"invalid\" ? \"trustAnchorCheckFailed\" : unavailableReason ?? check.reason);\n }\n const trustPolicy = validation.appendChild(document.createElement(\"p\"));\n trustPolicy.className = \"trustAnchorTrustPolicy\";\n trustPolicy.textContent = localize(\"trustAnchorTrustPolicy\");\n const bundledKeyCount = validation.appendChild(document.createElement(\"p\"));\n bundledKeyCount.className = \"trustAnchorBundledKeyCount\";\n bundledKeyCount.textContent = `${localize(\"trustAnchorBundledKeysLabel\")}: ${activeTrustedKeyCount}`;\n\n return validation;\n}\n\n/** Step one contains only the supplied anchor. No storage, downloads, key trust or verification. */\nexport function renderTrustAnchorPreview(preview: TrustAnchorPreview,\n language: string,\n localize: (key: string) => string,\n options: TrustAnchorPreviewOptions = {}): HTMLElement {\n const { anchor, text } = preview;\n const section = document.createElement(\"section\");\n section.className = \"trustAnchorPreview\";\n section.setAttribute(\"aria-labelledby\", \"trustAnchorPreviewTitle\");\n\n const title = section.appendChild(document.createElement(\"h2\"));\n title.id = \"trustAnchorPreviewTitle\";\n title.textContent = localize(\"trustAnchorPreviewTitle\");\n\n const fields = section.appendChild(document.createElement(\"dl\"));\n const addField = (label: string, values: readonly string[], monospace: boolean = false): void => {\n const term = fields.appendChild(document.createElement(\"dt\"));\n term.textContent = label;\n const description = fields.appendChild(document.createElement(\"dd\"));\n if (monospace)\n description.className = \"trustAnchorMonospace\";\n for (const value of values) {\n const line = description.appendChild(document.createElement(\"div\"));\n line.textContent = value;\n }\n };\n\n const localizedText = (texts: Readonly<Record<string, string>>): string =>\n texts[language] ?? texts[\"en\"] ?? Object.values(texts)[0] ?? \"\";\n\n const name = localizedText(anchor.name);\n if (name !== \"\")\n addField(localize(\"trustAnchorNameLabel\"), [ name ]);\n const description = localizedText(anchor.description);\n if (description !== \"\")\n addField(localize(\"trustAnchorDescriptionLabel\"), [ description ]);\n\n addField(localize(\"trustAnchorNetworkLabel\"), [ anchor.id ]);\n addField(localize(\"trustAnchorURLsLabel\"), anchor.urls, true);\n addField(localize(\"trustAnchorQuorumLabel\"), [ `${anchor.minConsensus} / ${anchor.holders.length}` ]);\n\n const keys = section.appendChild(document.createElement(\"details\"));\n keys.open = true;\n const keysSummary = keys.appendChild(document.createElement(\"summary\"));\n keysSummary.textContent = `${localize(\"trustAnchorIdentityKeysLabel\")} (${anchor.keys.length})`;\n const holders = keys.appendChild(document.createElement(\"div\"));\n holders.className = \"trustAnchorFingerprintHolders\";\n for (const [index, holder] of anchor.holders.entries()) {\n const group = holders.appendChild(document.createElement(\"div\"));\n group.className = \"trustAnchorHolder\";\n group.style.flexGrow = String(holder.length);\n group.style.flexBasis = `${Math.min(holder.length, 2) * 164}px`;\n const heading = group.appendChild(document.createElement(\"h3\"));\n heading.textContent = `${localize(\"trustAnchorHolderLabel\")} ${index + 1}`;\n const grid = group.appendChild(document.createElement(\"div\"));\n grid.className = \"securityFingerprintGrid\";\n for (const key of holder)\n grid.appendChild(renderSecurityFingerprint(key, localize));\n }\n\n const raw = section.appendChild(document.createElement(\"details\"));\n const rawSummary = raw.appendChild(document.createElement(\"summary\"));\n rawSummary.textContent = localize(\"recognizedContent\");\n const rawText = raw.appendChild(document.createElement(\"pre\"));\n rawText.textContent = text;\n\n const actions = section.appendChild(document.createElement(\"div\"));\n actions.className = \"trustAnchorPreviewActions\";\n if (options.onImport !== undefined) {\n const button = actions.appendChild(document.createElement(\"button\"));\n button.type = \"button\";\n button.dataset[\"action\"] = \"import\";\n button.className = \"trustAnchorImport\";\n button.textContent = localize(\"trustAnchorImportLabel\");\n button.disabled = options.busy === true;\n button.onclick = options.onImport;\n }\n if (options.onDiscard !== undefined) {\n const button = actions.appendChild(document.createElement(\"button\"));\n button.type = \"button\";\n button.dataset[\"action\"] = \"discard\";\n button.textContent = localize(\"trustManualCancel\");\n button.onclick = options.onDiscard;\n }\n\n return section;\n}\n"]}
@@ -0,0 +1,34 @@
1
+ import type { StoredObservedHistory } from './poiObservedHistory.js';
2
+ import type { POIPublicKey } from '@open-charging-cloud/wwcp-poi';
3
+ import type { TrustStore } from './trustStore.js';
4
+ import type { ITransportAllowances } from './liveLinkTrust.js';
5
+ export declare class TrustManagement {
6
+ private readonly root;
7
+ private readonly store;
8
+ private readonly bundledKeys;
9
+ private readonly localize;
10
+ private readonly language;
11
+ private readonly allowances;
12
+ private readonly openArchive?;
13
+ private readonly openObservedLive?;
14
+ private page;
15
+ private generation;
16
+ private selectedNetworkId;
17
+ private stationPanel;
18
+ private stationPolicyId;
19
+ private stationQuery;
20
+ constructor(root: HTMLElement, store: TrustStore, bundledKeys: readonly POIPublicKey[], localize: (key: string) => string, language: () => string, allowances?: ITransportAllowances, openArchive?: ((text: string) => Promise<void>) | undefined, openObservedLive?: ((record: StoredObservedHistory, chain: string) => Promise<void>) | undefined);
21
+ open(): void;
22
+ hide(): void;
23
+ refresh(): void;
24
+ observationsChanged(): void;
25
+ back(): boolean;
26
+ private disposeStationPanel;
27
+ private button;
28
+ private text;
29
+ private mutate;
30
+ private renderAnchor;
31
+ private renderNetworkDetails;
32
+ private render;
33
+ }
34
+ //# sourceMappingURL=trustManagement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trustManagement.d.ts","sourceRoot":"","sources":["../src/trustManagement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,yBAAyB,CAAC;AAEnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAWlD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAO/D,qBAAa,eAAe;IAQL,OAAO,C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servedHistory.js';
2
+ import { TrustAnchor, toBase64 } from '@open-charging-cloud/wwcp-poi';
3
+ import { activeBundledPublicKeys } from './trustStore.js';
4
+ import { groupRoamingNetworks, roamingNetworkDisplayName } from './roamingNetworks.js';
5
+ import { renderTrustAnchorValidation } from './trustAnchorPreview.js';
6
+ import { parseTrustAnchorData } from './trustAnchorData.js';
7
+ import { renderTrustAnchorData } from './trustAnchorDataView.js';
8
+ import { renderSecurityFingerprint } from './securityFingerprintView.js';
9
+ import { POITrustService } from './poiTrustContext.js';
10
+ import { StationProofPanel } from './stationProofPanel.js';
11
+ import { SessionEvidenceStore } from './sessionEvidenceStore.js';
12
+ import { renderTrustTransitionManager } from './trustTransitionView.js';
13
+ import { renderPOIWitnessManagement } from './poiWitnessManagement.js';
14
+ export class TrustManagement {
15
+ root;
16
+ store;
17
+ bundledKeys;
18
+ localize;
19
+ language;
20
+ allowances;
21
+ openArchive;
22
+ openObservedLive;
23
+ page = "menu";
24
+ generation = 0;
25
+ selectedNetworkId = null;
26
+ stationPanel = null;
27
+ stationPolicyId = null;
28
+ stationQuery = '';
29
+ constructor(root, store, bundledKeys, localize, language, allowances = {}, openArchive, openObservedLive) {
30
+ this.root = root;
31
+ this.store = store;
32
+ this.bundledKeys = bundledKeys;
33
+ this.localize = localize;
34
+ this.language = language;
35
+ this.allowances = allowances;
36
+ this.openArchive = openArchive;
37
+ this.openObservedLive = openObservedLive;
38
+ const settings = root.closest('#settingsScreen, #settingsPage');
39
+ if (settings !== null)
40
+ new MutationObserver(() => {
41
+ if (settings.style.display === 'none' || settings.hidden !== false)
42
+ this.hide();
43
+ }).observe(settings, { attributes: true, attributeFilter: ['style', 'hidden'] });
44
+ }
45
+ open() { this.root.hidden = false; this.page = "menu"; this.selectedNetworkId = null; void this.render(); }
46
+ hide() { this.root.hidden = true; this.generation++; this.disposeStationPanel(); }
47
+ refresh() { if (this.root.hidden === false)
48
+ void this.render(); }
49
+ observationsChanged() {
50
+ if (this.root.hidden !== false || this.page !== 'stationProof' && this.page !== 'observations')
51
+ return;
52
+ // Preserve an explicit reset confirmation while its transaction is pending.
53
+ // Verification still reads the actual journal; this view grants no authority.
54
+ if (this.page === 'observations' && this.root.querySelector('[data-action=confirm-reset-observations]') !== null)
55
+ return;
56
+ this.refresh();
57
+ }
58
+ back() {
59
+ if (this.page === "menu")
60
+ return false;
61
+ if (this.page === 'stationProof')
62
+ this.page = 'networkDetails';
63
+ else {
64
+ this.page = this.page === "networkDetails" ? "networks" : "menu";
65
+ this.selectedNetworkId = null;
66
+ }
67
+ void this.render();
68
+ return true;
69
+ }
70
+ disposeStationPanel() {
71
+ if (this.stationPanel !== null) {
72
+ this.stationQuery = this.stationPanel.value;
73
+ this.stationPanel.dispose();
74
+ this.stationPanel = null;
75
+ }
76
+ }
77
+ button(parent, label, action, className = "") {
78
+ const button = parent.appendChild(document.createElement("button"));
79
+ button.type = "button";
80
+ button.textContent = this.localize(label);
81
+ button.className = className;
82
+ button.onclick = action;
83
+ return button;
84
+ }
85
+ text(parent, text, className = "") {
86
+ const element = parent.appendChild(document.createElement("p"));
87
+ element.textContent = text;
88
+ element.className = className;
89
+ return element;
90
+ }
91
+ async mutate(button, action, generation) {
92
+ button.disabled = true;
93
+ try {
94
+ await action();
95
+ if (this.generation === generation)
96
+ await this.render();
97
+ }
98
+ catch {
99
+ if (this.generation === generation) {
100
+ const error = this.text(this.root, this.localize("trustStorageError"), "trustManagementError");
101
+ error.setAttribute("role", "alert");
102
+ button.disabled = false;
103
+ }
104
+ }
105
+ }
106
+ renderAnchor(parent, record, generation, deletedKeys) {
107
+ const anchor = TrustAnchor.parse(record.qrCode);
108
+ const card = parent.appendChild(document.createElement("article"));
109
+ card.className = "trustManagementCard";
110
+ card.dataset["anchorId"] = record.id;
111
+ const name = card.appendChild(document.createElement("h4"));
112
+ name.textContent = anchor.name[this.language()] ?? anchor.name["en"] ?? Object.values(anchor.name)[0] ?? anchor.id;
113
+ this.text(card, anchor.id, "trustManagementIdentifier");
114
+ this.text(card, `${this.localize("trustAnchorImportedAtLabel")}: ${new Date(record.importedAt).toLocaleString(this.language())}`);
115
+ this.text(card, this.localize("trustAnchorSavedStatus"));
116
+ this.text(card, this.localize('poiAnchorDeleteNotice'));
117
+ const details = card.appendChild(document.createElement("details"));
118
+ const summary = details.appendChild(document.createElement("summary"));
119
+ summary.textContent = this.localize("trustAnchorDetailsLabel");
120
+ if (deletedKeys !== undefined)
121
+ details.open = true;
122
+ for (const url of anchor.urls)
123
+ this.text(details, url, "trustManagementIdentifier");
124
+ this.text(details, `${this.localize("trustAnchorQuorumLabel")}: ${anchor.minConsensus} / ${anchor.holders.length}`);
125
+ if (record.downloadedData !== undefined) {
126
+ try {
127
+ const data = parseTrustAnchorData(anchor, record.downloadedData, this.bundledKeys);
128
+ details.appendChild(renderTrustAnchorData(anchor, data, {
129
+ record, bundled: this.bundledKeys, deleted: deletedKeys ?? new Set(), localize: this.localize,
130
+ onChange: async (keyId, trusted) => {
131
+ if (this.generation !== generation)
132
+ return;
133
+ await this.store.setKeyTrust(record.id, keyId, trusted);
134
+ if (this.generation === generation)
135
+ await this.render();
136
+ }
137
+ }));
138
+ }
139
+ catch {
140
+ this.text(details, this.localize("trustDataStoredInvalid"), "trustManagementError");
141
+ }
142
+ }
143
+ else {
144
+ for (const [index, holder] of anchor.holders.entries()) {
145
+ this.text(details, `${this.localize("trustAnchorHolderLabel")} ${index + 1}`);
146
+ for (const id of holder)
147
+ details.appendChild(renderSecurityFingerprint(id, this.localize));
148
+ }
149
+ this.text(details, this.localize("trustNetworkKeyStatementMissing"));
150
+ }
151
+ const button = this.button(card, "trustAnchorDeleteLabel", () => {
152
+ void this.mutate(button, async () => this.store.deleteAnchor(record.id), generation);
153
+ }, "trustManagementDelete");
154
+ }
155
+ renderNetworkDetails(parent, network, deletedKeys, generation) {
156
+ parent.dataset["networkId"] = network.id;
157
+ const title = parent.appendChild(document.createElement("h4"));
158
+ title.textContent = roamingNetworkDisplayName(network, this.language());
159
+ this.text(parent, `${this.localize("trustAnchorNetworkLabel")}: ${network.id}`, "trustManagementIdentifier");
160
+ this.text(parent, this.localize("trustNetworkNameSource"));
161
+ this.text(parent, this.localize(network.context === undefined ? "trustNetworkIdentityUnverified" : "trustNetworkIdentityVerified"));
162
+ if (network.context !== undefined)
163
+ this.text(parent, `${this.localize("trustDataOperatorLabel")}: ${network.context.roamingNetworkOperatorId}`, "trustManagementIdentifier");
164
+ if (network.context?.effectivePolicyId !== undefined) {
165
+ this.text(parent, 'Epoch ' + String(network.context.epoch ?? 1));
166
+ parent.appendChild(renderSecurityFingerprint(network.context.effectivePolicyId, this.localize));
167
+ }
168
+ this.text(parent, `${this.localize("trustNetworkAnchorCount")}: ${network.anchors.length}`);
169
+ const policy = network.anchors[0];
170
+ if (policy !== undefined)
171
+ this.button(parent, 'poiCheckStation', () => {
172
+ if (this.stationPolicyId !== policy.id)
173
+ this.stationQuery = '';
174
+ this.stationPolicyId = policy.id;
175
+ this.page = 'stationProof';
176
+ void this.render();
177
+ }, 'settingsEntry');
178
+ if (network.anchors.every(record => record.downloadedData === undefined)) {
179
+ const statement = parent.appendChild(document.createElement("section"));
180
+ statement.className = "trustNetworkKeyStatement";
181
+ const heading = statement.appendChild(document.createElement("h4"));
182
+ heading.textContent = this.localize("trustNetworkKeyStatementTitle");
183
+ statement.appendChild(renderTrustAnchorValidation({ signatures: "unavailable", signers: "unavailable", quorum: "unavailable" }, this.localize, activeBundledPublicKeys(this.bundledKeys, deletedKeys).length, "trustNetworkKeyStatementMissing"));
184
+ }
185
+ this.text(parent, this.localize("trustNetworkPoliciesSeparate"));
186
+ for (const record of network.anchors)
187
+ this.renderAnchor(parent, record, generation, deletedKeys);
188
+ for (const record of network.anchors)
189
+ renderTrustTransitionManager(parent, record, this.store, this.bundledKeys, this.localize, () => this.generation === generation, () => { void this.render(); });
190
+ const removal = parent.appendChild(document.createElement("div"));
191
+ removal.className = "trustNetworkRemoval";
192
+ this.text(removal, this.localize("trustNetworkDeleteDescription"));
193
+ const button = this.button(removal, "trustNetworkDeleteLabel", () => {
194
+ void this.mutate(button, async () => {
195
+ await this.store.deleteRoamingNetwork(network.anchors.map(record => record.id));
196
+ if (this.generation === generation) {
197
+ this.page = "networks";
198
+ this.selectedNetworkId = null;
199
+ }
200
+ }, generation);
201
+ }, "trustManagementDelete");
202
+ }
203
+ async render() {
204
+ this.disposeStationPanel();
205
+ const generation = ++this.generation;
206
+ this.root.replaceChildren();
207
+ const settings = this.root.closest("#settingsScreen, #settingsPage");
208
+ if (settings !== null)
209
+ settings.scrollTop = 0;
210
+ this.root.dataset["page"] = this.page;
211
+ const heading = this.root.appendChild(document.createElement("h2"));
212
+ heading.textContent = this.localize("trustManagementTitle");
213
+ if (this.page === "menu") {
214
+ this.button(this.root, "trustRoamingNetworksTitle", () => { this.page = "networks"; void this.render(); }, "settingsEntry");
215
+ this.button(this.root, "trustAnchorsTitle", () => { this.page = "anchors"; void this.render(); }, "settingsEntry");
216
+ this.button(this.root, "trustBundledKeysTitle", () => { this.page = "keys"; void this.render(); }, "settingsEntry");
217
+ this.button(this.root, 'poiHistoryArchiveTitle', () => { this.page = 'archives'; void this.render(); }, 'settingsEntry');
218
+ this.button(this.root, 'poiObservedTitle', () => { this.page = 'observations'; void this.render(); }, 'settingsEntry');
219
+ this.button(this.root, 'poiWitnessTitle', () => { this.page = 'witnesses'; void this.render(); }, 'settingsEntry');
220
+ return;
221
+ }
222
+ const title = this.root.appendChild(document.createElement("h3"));
223
+ const titles = { witnesses: 'poiWitnessTitle', observations: 'poiObservedTitle', archives: 'poiHistoryArchiveTitle', anchors: "trustAnchorsTitle", keys: "trustBundledKeysTitle", networks: "trustRoamingNetworksTitle", networkDetails: "trustRoamingNetworkDetailsTitle", stationProof: 'poiCheckStation' };
224
+ title.textContent = this.localize(titles[this.page]);
225
+ const descriptions = { witnesses: 'poiWitnessDescription', observations: 'poiObservedDescription', archives: 'poiHistoryArchiveDescription', anchors: "trustAnchorsStorageDescription", keys: "trustBundledKeysDescription", networks: "trustRoamingNetworksDescription", networkDetails: "trustRoamingNetworkDetailsDescription", stationProof: 'poiStationDescription' };
226
+ this.text(this.root, this.localize(descriptions[this.page]));
227
+ const list = this.root.appendChild(document.createElement("div"));
228
+ list.className = "trustManagementList";
229
+ list.setAttribute("aria-busy", "true");
230
+ try {
231
+ if (this.page === 'witnesses') {
232
+ await renderPOIWitnessManagement(list, this.localize, () => this.generation === generation, () => { void this.render(); });
233
+ }
234
+ else if (this.page === 'observations') {
235
+ const store = new POIObservedHistoryStore(), records = (await store.list()).filter(record => record.state.points.length > 0 || record.state.conflicts.length > 0);
236
+ if (this.generation !== generation)
237
+ return;
238
+ if (records.length === 0)
239
+ this.text(list, this.localize('poiObservedEmpty'));
240
+ for (const record of records) {
241
+ const card = list.appendChild(document.createElement('article'));
242
+ card.className = 'trustManagementCard';
243
+ card.dataset['observationId'] = record.id;
244
+ this.text(card, record.roamingNetworkId + ' · ' + record.operatorId);
245
+ this.text(card, this.localize('poiObservedCount') + ': ' + String(record.state.points.length));
246
+ this.text(card, this.localize('poiObservedConflicts') + ': ' + String(record.state.conflicts.length));
247
+ for (const [key, head] of Object.entries(record.state.heads)) {
248
+ this.text(card, key + ' · ' + head.epoch + ' / ' + String(head.position));
249
+ if (key.startsWith('["live",') && this.openObservedLive !== undefined) {
250
+ const parsed = JSON.parse(key);
251
+ const open = this.button(card, 'poiObservedOpenLive', () => {
252
+ open.disabled = true;
253
+ void this.openObservedLive?.(record, parsed[1]).catch(() => { open.disabled = false; this.text(card, this.localize('poiObservedOpenFailed')); });
254
+ });
255
+ open.dataset['action'] = 'open-observed-live';
256
+ }
257
+ }
258
+ const detail = card.appendChild(document.createElement('details'));
259
+ detail.appendChild(document.createElement('summary')).textContent = this.localize('poiObservedDetails');
260
+ detail.appendChild(document.createElement('pre')).textContent = JSON.stringify(record.state, null, 2);
261
+ const reset = this.button(card, 'poiObservedReset', () => {
262
+ reset.disabled = true;
263
+ const warning = this.text(card, this.localize('poiObservedResetWarning'));
264
+ warning.setAttribute('role', 'alert');
265
+ const confirm = this.button(card, 'poiObservedResetConfirm', () => { void this.mutate(confirm, async () => store.reset(record.id), generation); }, 'trustManagementDelete');
266
+ confirm.dataset['action'] = 'confirm-reset-observations';
267
+ }, 'trustManagementDelete');
268
+ reset.dataset['action'] = 'reset-observations';
269
+ }
270
+ }
271
+ else if (this.page === 'archives') {
272
+ const store = new SessionEvidenceStore();
273
+ const records = await store.list();
274
+ if (this.generation !== generation)
275
+ return;
276
+ if (records.length === 0)
277
+ this.text(list, this.localize('poiHistoryArchiveEmpty'));
278
+ for (const record of records) {
279
+ const card = list.appendChild(document.createElement('article'));
280
+ card.className = 'trustManagementCard';
281
+ card.dataset['archiveId'] = record.id;
282
+ this.text(card, record.evseId, 'trustManagementIdentifier');
283
+ this.text(card, new Date(record.savedAt).toLocaleString(this.language()));
284
+ this.text(card, this.localize('poiHistoryArchiveRecheck'));
285
+ if (this.openArchive !== undefined) {
286
+ const button = this.button(card, 'poiHistoryOpen', () => {
287
+ button.disabled = true;
288
+ void this.openArchive?.(record.document).catch(() => { button.disabled = false; this.text(card, this.localize('poiHistoryFailed')); });
289
+ });
290
+ button.dataset['action'] = 'open-archive';
291
+ }
292
+ const exportButton = this.button(card, 'poiHistoryExport', () => {
293
+ const blob = new Blob([record.document], { type: 'application/json' });
294
+ const url = URL.createObjectURL(blob);
295
+ const link = document.createElement('a');
296
+ link.href = url;
297
+ link.download = 'chargy-evidence-' + record.id.slice(0, 12) + '.chargy';
298
+ document.body.appendChild(link);
299
+ link.click();
300
+ link.remove();
301
+ window.setTimeout(() => { URL.revokeObjectURL(url); }, 1000);
302
+ });
303
+ exportButton.dataset['action'] = 'export-archive';
304
+ const details = card.appendChild(document.createElement('details'));
305
+ details.appendChild(document.createElement('summary')).textContent = this.localize('poiHistoryPolicySnapshot');
306
+ details.appendChild(document.createElement('pre')).textContent = record.policySnapshot;
307
+ const remove = this.button(card, 'poiHistoryDelete', () => { void this.mutate(remove, async () => store.delete(record.id), generation); }, 'trustManagementDelete');
308
+ remove.dataset['action'] = 'delete-archive';
309
+ }
310
+ }
311
+ else if (this.page === 'stationProof' && this.stationPolicyId !== null) {
312
+ const panel = new StationProofPanel(list, this.store, new POITrustService(this.store, this.bundledKeys), this.stationPolicyId, this.localize, this.language(), this.allowances, this.stationQuery);
313
+ this.stationPanel = panel;
314
+ await panel.mount();
315
+ }
316
+ else if (this.page === "networks" || this.page === "networkDetails") {
317
+ const { records: anchors, deleted: deletedKeys } = await this.store.listTrustSnapshot();
318
+ if (this.generation !== generation)
319
+ return;
320
+ const networks = groupRoamingNetworks(anchors, this.bundledKeys, deletedKeys);
321
+ if (this.page === "networkDetails") {
322
+ const network = networks.find(entry => entry.identity === this.selectedNetworkId);
323
+ if (network === undefined) {
324
+ this.page = "networks";
325
+ this.selectedNetworkId = null;
326
+ await this.render();
327
+ return;
328
+ }
329
+ this.renderNetworkDetails(list, network, deletedKeys, generation);
330
+ }
331
+ else {
332
+ if (networks.length === 0)
333
+ this.text(list, this.localize("trustRoamingNetworksEmpty"));
334
+ for (const network of networks) {
335
+ const button = this.button(list, "trustNetworkOpenLabel", () => {
336
+ this.selectedNetworkId = network.identity;
337
+ this.page = "networkDetails";
338
+ void this.render();
339
+ }, "settingsEntry trustNetworkEntry");
340
+ button.dataset["networkId"] = network.id;
341
+ button.dataset["networkIdentity"] = network.identity;
342
+ button.replaceChildren();
343
+ const text = button.appendChild(document.createElement("div"));
344
+ const name = text.appendChild(document.createElement("strong"));
345
+ name.textContent = roamingNetworkDisplayName(network, this.language());
346
+ this.text(text, `${network.id} · ${this.localize("trustNetworkAnchorCount")}: ${network.anchors.length}`);
347
+ this.text(text, this.localize(network.context === undefined ? "trustNetworkIdentityUnverified" : "trustNetworkIdentityVerified"));
348
+ if (network.context !== undefined)
349
+ this.text(text, `${this.localize("trustDataOperatorLabel")}: ${network.context.roamingNetworkOperatorId}`);
350
+ this.text(text, this.localize("trustNetworkOpenLabel"));
351
+ }
352
+ }
353
+ }
354
+ else if (this.page === "anchors") {
355
+ const { records: anchors, deleted: deletedKeys } = await this.store.listTrustSnapshot();
356
+ if (this.generation !== generation)
357
+ return;
358
+ if (anchors.length === 0)
359
+ this.text(list, this.localize("trustAnchorsEmpty"));
360
+ for (const record of anchors)
361
+ this.renderAnchor(list, record, generation, deletedKeys);
362
+ }
363
+ else {
364
+ const deleted = await this.store.deletedBundledKeyIds();
365
+ if (this.generation !== generation)
366
+ return;
367
+ if (this.bundledKeys.length === 0)
368
+ this.text(list, this.localize("trustBundledKeysEmpty"));
369
+ for (const key of this.bundledKeys) {
370
+ const isDeleted = deleted.has(key.id);
371
+ const card = list.appendChild(document.createElement("article"));
372
+ card.className = "trustManagementCard";
373
+ card.dataset["keyId"] = key.id;
374
+ card.dataset["state"] = isDeleted ? "deleted" : "active";
375
+ if (key.holder !== undefined)
376
+ this.text(card, key.holder);
377
+ card.appendChild(renderSecurityFingerprint(key.id, this.localize));
378
+ this.text(card, this.localize(isDeleted ? "trustBundledKeyDeleted" : "trustBundledKeyActive"));
379
+ const details = card.appendChild(document.createElement("details"));
380
+ const summary = details.appendChild(document.createElement("summary"));
381
+ summary.textContent = this.localize("publicKeyLabel");
382
+ this.text(details, toBase64(key.keyBytes), "trustManagementIdentifier");
383
+ const button = this.button(card, isDeleted ? "trustBundledKeyRestore" : "trustBundledKeyDelete", () => {
384
+ void this.mutate(button, async () => isDeleted ? this.store.restoreBundledKey(key.id) : this.store.deleteBundledKey(key.id), generation);
385
+ }, isDeleted ? "" : "trustManagementDelete");
386
+ }
387
+ }
388
+ }
389
+ catch {
390
+ if (this.generation === generation) {
391
+ const error = this.text(list, this.localize("trustStorageError"), "trustManagementError");
392
+ error.setAttribute("role", "alert");
393
+ this.button(list, "trustRetryLabel", () => { void this.render(); });
394
+ }
395
+ }
396
+ finally {
397
+ if (this.generation === generation) {
398
+ if (settings !== null)
399
+ settings.scrollTop = 0;
400
+ list.setAttribute("aria-busy", "false");
401
+ }
402
+ }
403
+ }
404
+ }
405
+ //# sourceMappingURL=trustManagement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trustManagement.js","sourceRoot":"","sources":["../src/trustManagement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAC,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAItE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEvF,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAC,4BAA4B,EAAC,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAC,0BAA0B,EAAC,MAAM,2BAA2B,CAAC;AAIrE,MAAM,OAAO,eAAe;IAQY;IACC;IACA;IACA;IACA;IACA;IACA;IACA;IAd7B,IAAI,GAAwB,MAAM,CAAC;IACnC,UAAU,GAAG,CAAC,CAAC;IACf,iBAAiB,GAAkB,IAAI,CAAC;IACxC,YAAY,GAA6B,IAAI,CAAC;IAC9C,eAAe,GAAkB,IAAI,CAAC;IACtC,YAAY,GAAG,EAAE,CAAC;IAE1B,YAAoC,IAAiB,EAChB,KAAiB,EACjB,WAAoC,EACpC,QAAiC,EACjC,QAAsB,EACtB,aAAmC,EAAE,EACrC,WAA6C,EAC7C,gBAA4E;QAP7E,SA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C,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC;oBAC7I,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC;gBACjD,CAAC;YACL,CAAC;QACL,CAAC;QACD,MAAM,CAAC;YACH,IAAI,IAAI,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;gBACjC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,sBAAsB,CAAC,CAAC;gBAC1F,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBACpC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YACxE,CAAC;QACL,CAAC;gBACO,CAAC;YACL,IAAI,IAAI,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;gBACjC,IAAI,QAAQ,KAAK,IAAI;oBACjB,QAAQ,CAAC,SAAS,GAAG,CAAC,CAAC;gBAC3B,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YAC5C,CAAC;QACL,CAAC;IACL,CAAC;CACJ","sourcesContent":["import {POIObservedHistoryStore} from './poiObservedHistory.js';\nimport type {StoredObservedHistory} from './poiObservedHistory.js';\nimport { TrustAnchor, toBase64 } from '@open-charging-cloud/wwcp-poi';\nimport type { POIPublicKey } from '@open-charging-cloud/wwcp-poi';\nimport type { TrustStore } from './trustStore.js';\nimport type { StoredTrustAnchor } from './trustStore.js';\nimport { activeBundledPublicKeys } from './trustStore.js';\nimport { groupRoamingNetworks, roamingNetworkDisplayName } from './roamingNetworks.js';\nimport type { StoredRoamingNetwork } from './roamingNetworks.js';\nimport { renderTrustAnchorValidation } from './trustAnchorPreview.js';\nimport { parseTrustAnchorData } from './trustAnchorData.js';\nimport { renderTrustAnchorData } from './trustAnchorDataView.js';\nimport { renderSecurityFingerprint } from './securityFingerprintView.js';\nimport { POITrustService } from './poiTrustContext.js';\nimport { StationProofPanel } from './stationProofPanel.js';\nimport type { ITransportAllowances } from './liveLinkTrust.js';\nimport { SessionEvidenceStore } from './sessionEvidenceStore.js';\nimport {renderTrustTransitionManager} from './trustTransitionView.js';\nimport {renderPOIWitnessManagement} from './poiWitnessManagement.js';\n\ntype TrustManagementPage = \"menu\" | \"anchors\" | \"keys\" | \"networks\" | \"networkDetails\" | \"stationProof\" | 'archives' | 'observations' | 'witnesses';\n\nexport class TrustManagement {\n private page: TrustManagementPage = \"menu\";\n private generation = 0;\n private selectedNetworkId: string | null = null;\n private stationPanel: StationProofPanel | null = null;\n private stationPolicyId: string | null = null;\n private stationQuery = '';\n\n public constructor(private readonly root: HTMLElement,\n private readonly store: TrustStore,\n private readonly bundledKeys: readonly POIPublicKey[],\n private readonly localize: (key: string) => string,\n private readonly language: () => string,\n private readonly allowances: ITransportAllowances = {},\n private readonly openArchive?: (text: string) => Promise<void>,\n private readonly openObservedLive?:(record:StoredObservedHistory,chain:string)=>Promise<void>) {\n const settings = root.closest<HTMLElement>('#settingsScreen, #settingsPage');\n if (settings !== null)\n new MutationObserver(() => {\n if (settings.style.display === 'none' || settings.hidden !== false)\n this.hide();\n }).observe(settings, { attributes: true, attributeFilter: ['style', 'hidden'] });\n }\n\n public open(): void { this.root.hidden = false; this.page = \"menu\"; this.selectedNetworkId = null; void this.render(); }\n public hide(): void { this.root.hidden = true; this.generation++; this.disposeStationPanel(); }\n public refresh(): void { if (this.root.hidden === false) void this.render(); }\n public observationsChanged(): void {\n if(this.root.hidden!==false||this.page!=='stationProof'&&this.page!=='observations')return;\n // Preserve an explicit reset confirmation while its transaction is pending.\n // Verification still reads the actual journal; this view grants no authority.\n if(this.page==='observations'&&this.root.querySelector('[data-action=confirm-reset-observations]')!==null)return;\n this.refresh();\n }\n public back(): boolean {\n if (this.page === \"menu\")\n return false;\n if (this.page === 'stationProof')\n this.page = 'networkDetails';\n else {\n this.page = this.page === \"networkDetails\" ? \"networks\" : \"menu\";\n this.selectedNetworkId = null;\n }\n void this.render();\n return true;\n }\n\n private disposeStationPanel(): void {\n if (this.stationPanel !== null) {\n this.stationQuery = this.stationPanel.value;\n this.stationPanel.dispose();\n this.stationPanel = null;\n }\n }\n\n private button(parent: HTMLElement, label: string, action: () => void, className: string = \"\"): HTMLButtonElement {\n const button = parent.appendChild(document.createElement(\"button\"));\n button.type = \"button\";\n button.textContent = this.localize(label);\n button.className = className;\n button.onclick = action;\n return button;\n }\n\n private text(parent: HTMLElement, text: string, className: string = \"\"): HTMLElement {\n const element = parent.appendChild(document.createElement(\"p\"));\n element.textContent = text;\n element.className = className;\n return element;\n }\n\n private async mutate(button: HTMLButtonElement, action: () => Promise<void>, generation: number): Promise<void> {\n button.disabled = true;\n try {\n await action();\n if (this.generation === generation)\n await this.render();\n }\n catch {\n if (this.generation === generation) {\n const error = this.text(this.root, this.localize(\"trustStorageError\"), \"trustManagementError\");\n error.setAttribute(\"role\", \"alert\");\n button.disabled = false;\n }\n }\n }\n\n private renderAnchor(parent: HTMLElement, record: StoredTrustAnchor, generation: number,\n deletedKeys?: ReadonlySet<string>): void {\n const anchor = TrustAnchor.parse(record.qrCode);\n const card = parent.appendChild(document.createElement(\"article\"));\n card.className = \"trustManagementCard\";\n card.dataset[\"anchorId\"] = record.id;\n const name = card.appendChild(document.createElement(\"h4\"));\n name.textContent = anchor.name[this.language()] ?? anchor.name[\"en\"] ?? Object.values(anchor.name)[0] ?? anchor.id;\n this.text(card, anchor.id, \"trustManagementIdentifier\");\n this.text(card, `${this.localize(\"trustAnchorImportedAtLabel\")}: ${new Date(record.importedAt).toLocaleString(this.language())}`);\n this.text(card, this.localize(\"trustAnchorSavedStatus\"));\n this.text(card, this.localize('poiAnchorDeleteNotice'));\n const details = card.appendChild(document.createElement(\"details\"));\n const summary = details.appendChild(document.createElement(\"summary\"));\n summary.textContent = this.localize(\"trustAnchorDetailsLabel\");\n if (deletedKeys !== undefined)\n details.open = true;\n for (const url of anchor.urls)\n this.text(details, url, \"trustManagementIdentifier\");\n this.text(details, `${this.localize(\"trustAnchorQuorumLabel\")}: ${anchor.minConsensus} / ${anchor.holders.length}`);\n if (record.downloadedData !== undefined) {\n try {\n const data = parseTrustAnchorData(anchor, record.downloadedData, this.bundledKeys);\n details.appendChild(renderTrustAnchorData(anchor, data, {\n record, bundled: this.bundledKeys, deleted: deletedKeys ?? new Set(), localize: this.localize,\n onChange: async (keyId, trusted) => {\n if (this.generation !== generation)\n return;\n await this.store.setKeyTrust(record.id, keyId, trusted);\n if (this.generation === generation)\n await this.render();\n }\n }));\n }\n catch {\n this.text(details, this.localize(\"trustDataStoredInvalid\"), \"trustManagementError\");\n }\n }\n else {\n for (const [index, holder] of anchor.holders.entries()) {\n this.text(details, `${this.localize(\"trustAnchorHolderLabel\")} ${index + 1}`);\n for (const id of holder)\n details.appendChild(renderSecurityFingerprint(id, this.localize));\n }\n this.text(details, this.localize(\"trustNetworkKeyStatementMissing\"));\n }\n const button = this.button(card, \"trustAnchorDeleteLabel\", () => {\n void this.mutate(button, async () => this.store.deleteAnchor(record.id), generation);\n }, \"trustManagementDelete\");\n }\n\n private renderNetworkDetails(parent: HTMLElement, network: StoredRoamingNetwork,\n deletedKeys: ReadonlySet<string>, generation: number): void {\n parent.dataset[\"networkId\"] = network.id;\n const title = parent.appendChild(document.createElement(\"h4\"));\n title.textContent = roamingNetworkDisplayName(network, this.language());\n this.text(parent, `${this.localize(\"trustAnchorNetworkLabel\")}: ${network.id}`, \"trustManagementIdentifier\");\n this.text(parent, this.localize(\"trustNetworkNameSource\"));\n this.text(parent, this.localize(network.context === undefined ? \"trustNetworkIdentityUnverified\" : \"trustNetworkIdentityVerified\"));\n if (network.context !== undefined)\n this.text(parent, `${this.localize(\"trustDataOperatorLabel\")}: ${network.context.roamingNetworkOperatorId}`, \"trustManagementIdentifier\");\n if(network.context?.effectivePolicyId!==undefined){\n this.text(parent,'Epoch '+String(network.context.epoch??1));\n parent.appendChild(renderSecurityFingerprint(network.context.effectivePolicyId,this.localize));\n }\n this.text(parent, `${this.localize(\"trustNetworkAnchorCount\")}: ${network.anchors.length}`);\n const policy = network.anchors[0];\n if (policy !== undefined)\n this.button(parent, 'poiCheckStation', () => {\n if (this.stationPolicyId !== policy.id) this.stationQuery = '';\n this.stationPolicyId = policy.id;\n this.page = 'stationProof';\n void this.render();\n }, 'settingsEntry');\n if (network.anchors.every(record => record.downloadedData === undefined)) {\n const statement = parent.appendChild(document.createElement(\"section\"));\n statement.className = \"trustNetworkKeyStatement\";\n const heading = statement.appendChild(document.createElement(\"h4\"));\n heading.textContent = this.localize(\"trustNetworkKeyStatementTitle\");\n statement.appendChild(renderTrustAnchorValidation(\n { signatures: \"unavailable\", signers: \"unavailable\", quorum: \"unavailable\" }, this.localize,\n activeBundledPublicKeys(this.bundledKeys, deletedKeys).length, \"trustNetworkKeyStatementMissing\"\n ));\n }\n this.text(parent, this.localize(\"trustNetworkPoliciesSeparate\"));\n for (const record of network.anchors)\n this.renderAnchor(parent, record, generation, deletedKeys);\n for(const record of network.anchors)renderTrustTransitionManager(parent,record,this.store,this.bundledKeys,this.localize,()=>this.generation===generation,()=>{void this.render();});\n const removal = parent.appendChild(document.createElement(\"div\"));\n removal.className = \"trustNetworkRemoval\";\n this.text(removal, this.localize(\"trustNetworkDeleteDescription\"));\n const button = this.button(removal, \"trustNetworkDeleteLabel\", () => {\n void this.mutate(button, async () => {\n await this.store.deleteRoamingNetwork(network.anchors.map(record => record.id));\n if (this.generation === generation) {\n this.page = \"networks\";\n this.selectedNetworkId = null;\n }\n }, generation);\n }, \"trustManagementDelete\");\n }\n\n private async render(): Promise<void> {\n this.disposeStationPanel();\n const generation = ++this.generation;\n this.root.replaceChildren();\n const settings = this.root.closest<HTMLElement>(\"#settingsScreen, #settingsPage\");\n if (settings !== null)\n settings.scrollTop = 0;\n this.root.dataset[\"page\"] = this.page;\n const heading = this.root.appendChild(document.createElement(\"h2\"));\n heading.textContent = this.localize(\"trustManagementTitle\");\n if (this.page === \"menu\") {\n this.button(this.root, \"trustRoamingNetworksTitle\", () => { this.page = \"networks\"; void this.render(); }, \"settingsEntry\");\n this.button(this.root, \"trustAnchorsTitle\", () => { this.page = \"anchors\"; void this.render(); }, \"settingsEntry\");\n this.button(this.root, \"trustBundledKeysTitle\", () => { this.page = \"keys\"; void this.render(); }, \"settingsEntry\");\n this.button(this.root, 'poiHistoryArchiveTitle', () => { this.page = 'archives'; void this.render(); }, 'settingsEntry');\n this.button(this.root,'poiObservedTitle',()=>{this.page='observations';void this.render();},'settingsEntry');\n this.button(this.root,'poiWitnessTitle',()=>{this.page='witnesses';void this.render();},'settingsEntry');\n return;\n }\n\n const title = this.root.appendChild(document.createElement(\"h3\"));\n const titles = { witnesses:'poiWitnessTitle', observations:'poiObservedTitle', archives:'poiHistoryArchiveTitle', anchors: \"trustAnchorsTitle\", keys: \"trustBundledKeysTitle\", networks: \"trustRoamingNetworksTitle\", networkDetails: \"trustRoamingNetworkDetailsTitle\", stationProof: 'poiCheckStation' };\n title.textContent = this.localize(titles[this.page]);\n const descriptions = { witnesses:'poiWitnessDescription', observations:'poiObservedDescription', archives:'poiHistoryArchiveDescription', anchors: \"trustAnchorsStorageDescription\", keys: \"trustBundledKeysDescription\", networks: \"trustRoamingNetworksDescription\", networkDetails: \"trustRoamingNetworkDetailsDescription\", stationProof: 'poiStationDescription' };\n this.text(this.root, this.localize(descriptions[this.page]));\n const list = this.root.appendChild(document.createElement(\"div\"));\n list.className = \"trustManagementList\";\n list.setAttribute(\"aria-busy\", \"true\");\n try {\n if(this.page==='witnesses'){\n await renderPOIWitnessManagement(list,this.localize,()=>this.generation===generation,()=>{void this.render();});\n }\n else if(this.page==='observations'){\n const store=new POIObservedHistoryStore(),records=(await store.list()).filter(record=>record.state.points.length>0||record.state.conflicts.length>0);\n if(this.generation!==generation)return;\n if(records.length===0)this.text(list,this.localize('poiObservedEmpty'));\n for(const record of records){\n const card=list.appendChild(document.createElement('article'));card.className='trustManagementCard';card.dataset['observationId']=record.id;\n this.text(card,record.roamingNetworkId+' · '+record.operatorId);this.text(card,this.localize('poiObservedCount')+': '+String(record.state.points.length));\n this.text(card,this.localize('poiObservedConflicts')+': '+String(record.state.conflicts.length));\n for(const [key,head]of Object.entries(record.state.heads)){\n this.text(card,key+' · '+head.epoch+' / '+String(head.position));\n if(key.startsWith('[\"live\",')&&this.openObservedLive!==undefined){\n const parsed=JSON.parse(key) as [string,string];const open=this.button(card,'poiObservedOpenLive',()=>{\n open.disabled=true;void this.openObservedLive?.(record,parsed[1]).catch(()=>{open.disabled=false;this.text(card,this.localize('poiObservedOpenFailed'));});\n });open.dataset['action']='open-observed-live';\n }\n }\n const detail=card.appendChild(document.createElement('details'));detail.appendChild(document.createElement('summary')).textContent=this.localize('poiObservedDetails');\n detail.appendChild(document.createElement('pre')).textContent=JSON.stringify(record.state,null,2);\n const reset=this.button(card,'poiObservedReset',()=>{\n reset.disabled=true;const warning=this.text(card,this.localize('poiObservedResetWarning'));warning.setAttribute('role','alert');\n const confirm=this.button(card,'poiObservedResetConfirm',()=>{void this.mutate(confirm,async()=>store.reset(record.id),generation);},'trustManagementDelete');confirm.dataset['action']='confirm-reset-observations';\n },'trustManagementDelete');reset.dataset['action']='reset-observations';\n }\n }\n else if (this.page === 'archives') {\n const store = new SessionEvidenceStore(); const records = await store.list();\n if (this.generation !== generation) return;\n if (records.length === 0) this.text(list,this.localize('poiHistoryArchiveEmpty'));\n for (const record of records) {\n const card = list.appendChild(document.createElement('article')); card.className = 'trustManagementCard'; card.dataset['archiveId'] = record.id;\n this.text(card,record.evseId,'trustManagementIdentifier');\n this.text(card,new Date(record.savedAt).toLocaleString(this.language()));\n this.text(card,this.localize('poiHistoryArchiveRecheck'));\n if (this.openArchive !== undefined) {\n const button = this.button(card,'poiHistoryOpen',() => {\n button.disabled = true;\n void this.openArchive?.(record.document).catch(() => { button.disabled = false; this.text(card,this.localize('poiHistoryFailed')); });\n }); button.dataset['action'] = 'open-archive';\n }\n const exportButton = this.button(card,'poiHistoryExport',() => {\n const blob = new Blob([record.document],{type:'application/json'}); const url = URL.createObjectURL(blob);\n const link = document.createElement('a'); link.href = url; link.download = 'chargy-evidence-' + record.id.slice(0,12) + '.chargy';\n document.body.appendChild(link); link.click(); link.remove(); window.setTimeout(() => { URL.revokeObjectURL(url); },1000);\n }); exportButton.dataset['action'] = 'export-archive';\n const details = card.appendChild(document.createElement('details'));\n details.appendChild(document.createElement('summary')).textContent = this.localize('poiHistoryPolicySnapshot');\n details.appendChild(document.createElement('pre')).textContent = record.policySnapshot;\n const remove = this.button(card,'poiHistoryDelete',() => { void this.mutate(remove,async () => store.delete(record.id),generation); },'trustManagementDelete');\n remove.dataset['action'] = 'delete-archive';\n }\n }\n else if (this.page === 'stationProof' && this.stationPolicyId !== null) {\n const panel = new StationProofPanel(list, this.store, new POITrustService(this.store, this.bundledKeys),\n this.stationPolicyId, this.localize, this.language(), this.allowances, this.stationQuery);\n this.stationPanel = panel;\n await panel.mount();\n }\n else if (this.page === \"networks\" || this.page === \"networkDetails\") {\n const { records: anchors, deleted: deletedKeys } = await this.store.listTrustSnapshot();\n if (this.generation !== generation)\n return;\n const networks = groupRoamingNetworks(anchors, this.bundledKeys, deletedKeys);\n if (this.page === \"networkDetails\") {\n const network = networks.find(entry => entry.identity === this.selectedNetworkId);\n if (network === undefined) {\n this.page = \"networks\";\n this.selectedNetworkId = null;\n await this.render();\n return;\n }\n this.renderNetworkDetails(list, network, deletedKeys, generation);\n }\n else {\n if (networks.length === 0)\n this.text(list, this.localize(\"trustRoamingNetworksEmpty\"));\n for (const network of networks) {\n const button = this.button(list, \"trustNetworkOpenLabel\", () => {\n this.selectedNetworkId = network.identity;\n this.page = \"networkDetails\";\n void this.render();\n }, \"settingsEntry trustNetworkEntry\");\n button.dataset[\"networkId\"] = network.id;\n button.dataset[\"networkIdentity\"] = network.identity;\n button.replaceChildren();\n const text = button.appendChild(document.createElement(\"div\"));\n const name = text.appendChild(document.createElement(\"strong\"));\n name.textContent = roamingNetworkDisplayName(network, this.language());\n this.text(text, `${network.id} · ${this.localize(\"trustNetworkAnchorCount\")}: ${network.anchors.length}`);\n this.text(text, this.localize(network.context === undefined ? \"trustNetworkIdentityUnverified\" : \"trustNetworkIdentityVerified\"));\n if (network.context !== undefined)\n this.text(text, `${this.localize(\"trustDataOperatorLabel\")}: ${network.context.roamingNetworkOperatorId}`);\n this.text(text, this.localize(\"trustNetworkOpenLabel\"));\n }\n }\n }\n else if (this.page === \"anchors\") {\n const { records: anchors, deleted: deletedKeys } = await this.store.listTrustSnapshot();\n if (this.generation !== generation)\n return;\n if (anchors.length === 0)\n this.text(list, this.localize(\"trustAnchorsEmpty\"));\n for (const record of anchors)\n this.renderAnchor(list, record, generation, deletedKeys);\n }\n else {\n const deleted = await this.store.deletedBundledKeyIds();\n if (this.generation !== generation)\n return;\n if (this.bundledKeys.length === 0)\n this.text(list, this.localize(\"trustBundledKeysEmpty\"));\n for (const key of this.bundledKeys) {\n const isDeleted = deleted.has(key.id);\n const card = list.appendChild(document.createElement(\"article\"));\n card.className = \"trustManagementCard\";\n card.dataset[\"keyId\"] = key.id;\n card.dataset[\"state\"] = isDeleted ? \"deleted\" : \"active\";\n if (key.holder !== undefined)\n this.text(card, key.holder);\n card.appendChild(renderSecurityFingerprint(key.id, this.localize));\n this.text(card, this.localize(isDeleted ? \"trustBundledKeyDeleted\" : \"trustBundledKeyActive\"));\n const details = card.appendChild(document.createElement(\"details\"));\n const summary = details.appendChild(document.createElement(\"summary\"));\n summary.textContent = this.localize(\"publicKeyLabel\");\n this.text(details, toBase64(key.keyBytes), \"trustManagementIdentifier\");\n const button = this.button(card, isDeleted ? \"trustBundledKeyRestore\" : \"trustBundledKeyDelete\", () => {\n void this.mutate(button, async () => isDeleted ? this.store.restoreBundledKey(key.id) : this.store.deleteBundledKey(key.id), generation);\n }, isDeleted ? \"\" : \"trustManagementDelete\");\n }\n }\n }\n catch {\n if (this.generation === generation) {\n const error = this.text(list, this.localize(\"trustStorageError\"), \"trustManagementError\");\n error.setAttribute(\"role\", \"alert\");\n this.button(list, \"trustRetryLabel\", () => { void this.render(); });\n }\n }\n finally {\n if (this.generation === generation) {\n if (settings !== null)\n settings.scrollTop = 0;\n list.setAttribute(\"aria-busy\", \"false\");\n }\n }\n }\n}\n"]}