@kya-os/consent 0.3.0 → 0.4.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 (226) hide show
  1. package/README.md +185 -20
  2. package/dist/bundle/index.d.ts +4 -0
  3. package/dist/bundle/index.d.ts.map +1 -1
  4. package/dist/bundle/index.js +6 -0
  5. package/dist/bundle/index.js.map +1 -1
  6. package/dist/bundle/inline.d.ts.map +1 -1
  7. package/dist/bundle/inline.js +4 -4
  8. package/dist/bundle/inline.js.map +1 -1
  9. package/dist/cjs/bundle/index.js +15 -1
  10. package/dist/cjs/bundle/index.js.map +1 -1
  11. package/dist/cjs/bundle/inline.js +4 -4
  12. package/dist/cjs/bundle/inline.js.map +1 -1
  13. package/dist/cjs/components/consent-action-bar.js +97 -25
  14. package/dist/cjs/components/consent-action-bar.js.map +1 -1
  15. package/dist/cjs/components/consent-agent-header.js +7 -105
  16. package/dist/cjs/components/consent-agent-header.js.map +1 -1
  17. package/dist/cjs/components/consent-button.js +6 -1
  18. package/dist/cjs/components/consent-button.js.map +1 -1
  19. package/dist/cjs/components/consent-capabilities-screen.js +488 -66
  20. package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
  21. package/dist/cjs/components/consent-capability-card.js +197 -42
  22. package/dist/cjs/components/consent-capability-card.js.map +1 -1
  23. package/dist/cjs/components/consent-checkbox.js +7 -0
  24. package/dist/cjs/components/consent-checkbox.js.map +1 -1
  25. package/dist/cjs/components/consent-connector-header.js +206 -43
  26. package/dist/cjs/components/consent-connector-header.js.map +1 -1
  27. package/dist/cjs/components/consent-duration.js +1 -1
  28. package/dist/cjs/components/consent-footer.js +13 -12
  29. package/dist/cjs/components/consent-footer.js.map +1 -1
  30. package/dist/cjs/components/consent-headline.js +445 -30
  31. package/dist/cjs/components/consent-headline.js.map +1 -1
  32. package/dist/cjs/components/consent-oauth-button.js +71 -62
  33. package/dist/cjs/components/consent-oauth-button.js.map +1 -1
  34. package/dist/cjs/components/consent-otp-input.js +5 -0
  35. package/dist/cjs/components/consent-otp-input.js.map +1 -1
  36. package/dist/cjs/components/consent-phone-handoff.js +3 -3
  37. package/dist/cjs/components/consent-request-expiry.js +1 -1
  38. package/dist/cjs/components/consent-revocation-notice.js +4 -2
  39. package/dist/cjs/components/consent-revocation-notice.js.map +1 -1
  40. package/dist/cjs/components/consent-revoke.js +9 -4
  41. package/dist/cjs/components/consent-revoke.js.map +1 -1
  42. package/dist/cjs/components/consent-secured-by.js +106 -0
  43. package/dist/cjs/components/consent-secured-by.js.map +1 -0
  44. package/dist/cjs/components/consent-shell.js +1 -1
  45. package/dist/cjs/components/consent-terms.js +7 -0
  46. package/dist/cjs/components/consent-terms.js.map +1 -1
  47. package/dist/cjs/components/consent-wallet-check.js +1 -1
  48. package/dist/cjs/components/consent-wallet-notice.js +1 -1
  49. package/dist/cjs/components/consent-wallet-orb.js +1 -1
  50. package/dist/cjs/components/consent-wallet-signature.js +1 -1
  51. package/dist/cjs/components/decision-icons.js +33 -0
  52. package/dist/cjs/components/decision-icons.js.map +1 -0
  53. package/dist/cjs/components/edit-region.js +309 -0
  54. package/dist/cjs/components/edit-region.js.map +1 -0
  55. package/dist/cjs/components/grant-field-styles.js +2 -2
  56. package/dist/cjs/components/index.js +5 -1
  57. package/dist/cjs/components/index.js.map +1 -1
  58. package/dist/cjs/components/mcp-consent.js +81 -36
  59. package/dist/cjs/components/mcp-consent.js.map +1 -1
  60. package/dist/cjs/components/preview.js +67 -0
  61. package/dist/cjs/components/preview.js.map +1 -0
  62. package/dist/cjs/constants/capabilities.js +21 -2
  63. package/dist/cjs/constants/capabilities.js.map +1 -1
  64. package/dist/cjs/copy/tokens.js +60 -21
  65. package/dist/cjs/copy/tokens.js.map +1 -1
  66. package/dist/cjs/identity/agent-identity.js +3 -2
  67. package/dist/cjs/identity/agent-identity.js.map +1 -1
  68. package/dist/cjs/mcp-app/inline.js +2 -2
  69. package/dist/cjs/mcp-app/inline.js.map +1 -1
  70. package/dist/cjs/react/index.js +11 -2
  71. package/dist/cjs/react/index.js.map +1 -1
  72. package/dist/cjs/styles/brand.js +385 -0
  73. package/dist/cjs/styles/brand.js.map +1 -0
  74. package/dist/cjs/styles/index.js +1 -0
  75. package/dist/cjs/styles/index.js.map +1 -1
  76. package/dist/cjs/styles/theme.js +100 -30
  77. package/dist/cjs/styles/theme.js.map +1 -1
  78. package/dist/cjs/types/capabilities.types.js +1 -2
  79. package/dist/cjs/types/capabilities.types.js.map +1 -1
  80. package/dist/cjs/types/decision.types.js +13 -0
  81. package/dist/cjs/types/decision.types.js.map +1 -0
  82. package/dist/cjs/types/edit.types.js +80 -0
  83. package/dist/cjs/types/edit.types.js.map +1 -0
  84. package/dist/cjs/types/index.js +2 -0
  85. package/dist/cjs/types/index.js.map +1 -1
  86. package/dist/components/consent-action-bar.d.ts +20 -1
  87. package/dist/components/consent-action-bar.d.ts.map +1 -1
  88. package/dist/components/consent-action-bar.js +97 -25
  89. package/dist/components/consent-action-bar.js.map +1 -1
  90. package/dist/components/consent-agent-header.d.ts +4 -17
  91. package/dist/components/consent-agent-header.d.ts.map +1 -1
  92. package/dist/components/consent-agent-header.js +7 -105
  93. package/dist/components/consent-agent-header.js.map +1 -1
  94. package/dist/components/consent-button.d.ts +2 -0
  95. package/dist/components/consent-button.d.ts.map +1 -1
  96. package/dist/components/consent-button.js +6 -1
  97. package/dist/components/consent-button.js.map +1 -1
  98. package/dist/components/consent-capabilities-screen.d.ts +93 -14
  99. package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
  100. package/dist/components/consent-capabilities-screen.js +488 -67
  101. package/dist/components/consent-capabilities-screen.js.map +1 -1
  102. package/dist/components/consent-capability-card.d.ts +42 -5
  103. package/dist/components/consent-capability-card.d.ts.map +1 -1
  104. package/dist/components/consent-capability-card.js +196 -41
  105. package/dist/components/consent-capability-card.js.map +1 -1
  106. package/dist/components/consent-checkbox.d.ts +2 -0
  107. package/dist/components/consent-checkbox.d.ts.map +1 -1
  108. package/dist/components/consent-checkbox.js +7 -0
  109. package/dist/components/consent-checkbox.js.map +1 -1
  110. package/dist/components/consent-connector-header.d.ts +39 -7
  111. package/dist/components/consent-connector-header.d.ts.map +1 -1
  112. package/dist/components/consent-connector-header.js +206 -43
  113. package/dist/components/consent-connector-header.js.map +1 -1
  114. package/dist/components/consent-duration.js +1 -1
  115. package/dist/components/consent-footer.d.ts +6 -4
  116. package/dist/components/consent-footer.d.ts.map +1 -1
  117. package/dist/components/consent-footer.js +13 -12
  118. package/dist/components/consent-footer.js.map +1 -1
  119. package/dist/components/consent-headline.d.ts +76 -12
  120. package/dist/components/consent-headline.d.ts.map +1 -1
  121. package/dist/components/consent-headline.js +445 -32
  122. package/dist/components/consent-headline.js.map +1 -1
  123. package/dist/components/consent-oauth-button.d.ts +7 -3
  124. package/dist/components/consent-oauth-button.d.ts.map +1 -1
  125. package/dist/components/consent-oauth-button.js +74 -65
  126. package/dist/components/consent-oauth-button.js.map +1 -1
  127. package/dist/components/consent-otp-input.d.ts.map +1 -1
  128. package/dist/components/consent-otp-input.js +5 -0
  129. package/dist/components/consent-otp-input.js.map +1 -1
  130. package/dist/components/consent-passkey.d.ts +6 -0
  131. package/dist/components/consent-passkey.d.ts.map +1 -1
  132. package/dist/components/consent-passkey.js +67 -9
  133. package/dist/components/consent-passkey.js.map +1 -1
  134. package/dist/components/consent-phone-handoff.js +3 -3
  135. package/dist/components/consent-request-expiry.js +1 -1
  136. package/dist/components/consent-revocation-notice.d.ts.map +1 -1
  137. package/dist/components/consent-revocation-notice.js +4 -2
  138. package/dist/components/consent-revocation-notice.js.map +1 -1
  139. package/dist/components/consent-revoke.d.ts +2 -0
  140. package/dist/components/consent-revoke.d.ts.map +1 -1
  141. package/dist/components/consent-revoke.js +9 -4
  142. package/dist/components/consent-revoke.js.map +1 -1
  143. package/dist/components/consent-secured-by.d.ts +25 -0
  144. package/dist/components/consent-secured-by.d.ts.map +1 -0
  145. package/dist/components/consent-secured-by.js +103 -0
  146. package/dist/components/consent-secured-by.js.map +1 -0
  147. package/dist/components/consent-shell.js +1 -1
  148. package/dist/components/consent-terms.d.ts +2 -0
  149. package/dist/components/consent-terms.d.ts.map +1 -1
  150. package/dist/components/consent-terms.js +7 -0
  151. package/dist/components/consent-terms.js.map +1 -1
  152. package/dist/components/consent-wallet-check.js +1 -1
  153. package/dist/components/consent-wallet-notice.js +1 -1
  154. package/dist/components/consent-wallet-orb.js +1 -1
  155. package/dist/components/consent-wallet-signature.js +1 -1
  156. package/dist/components/decision-icons.d.ts +22 -0
  157. package/dist/components/decision-icons.d.ts.map +1 -0
  158. package/dist/components/decision-icons.js +30 -0
  159. package/dist/components/decision-icons.js.map +1 -0
  160. package/dist/components/edit-region.d.ts +50 -0
  161. package/dist/components/edit-region.d.ts.map +1 -0
  162. package/dist/components/edit-region.js +305 -0
  163. package/dist/components/edit-region.js.map +1 -0
  164. package/dist/components/grant-field-styles.js +2 -2
  165. package/dist/components/index.d.ts +3 -2
  166. package/dist/components/index.d.ts.map +1 -1
  167. package/dist/components/index.js +3 -2
  168. package/dist/components/index.js.map +1 -1
  169. package/dist/components/mcp-consent.d.ts +15 -0
  170. package/dist/components/mcp-consent.d.ts.map +1 -1
  171. package/dist/components/mcp-consent.js +81 -36
  172. package/dist/components/mcp-consent.js.map +1 -1
  173. package/dist/components/preview.d.ts +38 -0
  174. package/dist/components/preview.d.ts.map +1 -0
  175. package/dist/components/preview.js +61 -0
  176. package/dist/components/preview.js.map +1 -0
  177. package/dist/consent.js +2200 -389
  178. package/dist/consent.min.js +1308 -496
  179. package/dist/constants/capabilities.d.ts +14 -2
  180. package/dist/constants/capabilities.d.ts.map +1 -1
  181. package/dist/constants/capabilities.js +21 -2
  182. package/dist/constants/capabilities.js.map +1 -1
  183. package/dist/copy/tokens.d.ts +60 -21
  184. package/dist/copy/tokens.d.ts.map +1 -1
  185. package/dist/copy/tokens.js +60 -21
  186. package/dist/copy/tokens.js.map +1 -1
  187. package/dist/identity/agent-identity.d.ts +3 -2
  188. package/dist/identity/agent-identity.d.ts.map +1 -1
  189. package/dist/identity/agent-identity.js +3 -2
  190. package/dist/identity/agent-identity.js.map +1 -1
  191. package/dist/mcp-app/inline.d.ts.map +1 -1
  192. package/dist/mcp-app/inline.js +2 -2
  193. package/dist/mcp-app/inline.js.map +1 -1
  194. package/dist/react/index.d.ts +6 -1
  195. package/dist/react/index.d.ts.map +1 -1
  196. package/dist/react/index.js +10 -1
  197. package/dist/react/index.js.map +1 -1
  198. package/dist/styles/brand.d.ts +184 -0
  199. package/dist/styles/brand.d.ts.map +1 -0
  200. package/dist/styles/brand.js +372 -0
  201. package/dist/styles/brand.js.map +1 -0
  202. package/dist/styles/index.d.ts +1 -0
  203. package/dist/styles/index.d.ts.map +1 -1
  204. package/dist/styles/index.js +1 -0
  205. package/dist/styles/index.js.map +1 -1
  206. package/dist/styles/theme.d.ts +73 -13
  207. package/dist/styles/theme.d.ts.map +1 -1
  208. package/dist/styles/theme.js +96 -29
  209. package/dist/styles/theme.js.map +1 -1
  210. package/dist/types/capabilities.types.d.ts +12 -14
  211. package/dist/types/capabilities.types.d.ts.map +1 -1
  212. package/dist/types/capabilities.types.js +1 -2
  213. package/dist/types/capabilities.types.js.map +1 -1
  214. package/dist/types/decision.types.d.ts +57 -0
  215. package/dist/types/decision.types.d.ts.map +1 -0
  216. package/dist/types/decision.types.js +12 -0
  217. package/dist/types/decision.types.js.map +1 -0
  218. package/dist/types/edit.types.d.ts +73 -0
  219. package/dist/types/edit.types.d.ts.map +1 -0
  220. package/dist/types/edit.types.js +76 -0
  221. package/dist/types/edit.types.js.map +1 -0
  222. package/dist/types/index.d.ts +2 -0
  223. package/dist/types/index.d.ts.map +1 -1
  224. package/dist/types/index.js +2 -0
  225. package/dist/types/index.js.map +1 -1
  226. package/package.json +2 -2
package/dist/consent.js CHANGED
@@ -643,6 +643,7 @@ function r6(r8) {
643
643
  var ConsentButton = class extends i4 {
644
644
  constructor() {
645
645
  super();
646
+ this.preview = false;
646
647
  this.variant = "primary";
647
648
  this.type = "button";
648
649
  this.disabled = false;
@@ -651,7 +652,7 @@ var ConsentButton = class extends i4 {
651
652
  this.internals = this.attachInternals();
652
653
  }
653
654
  handleClick() {
654
- if (this.disabled || this.loading) return;
655
+ if (this.disabled || this.loading || this.preview) return;
655
656
  const form = this.internals.form;
656
657
  if (!form) return;
657
658
  if (this.type === "submit") {
@@ -750,6 +751,9 @@ ConsentButton.styles = i`
750
751
  }
751
752
  }
752
753
  `;
754
+ __decorateClass([
755
+ n4({ type: Boolean, reflect: true })
756
+ ], ConsentButton.prototype, "preview", 2);
753
757
  __decorateClass([
754
758
  n4({ type: String, reflect: true })
755
759
  ], ConsentButton.prototype, "variant", 2);
@@ -769,16 +773,49 @@ ConsentButton = __decorateClass([
769
773
  t3("consent-button")
770
774
  ], ConsentButton);
771
775
 
776
+ // src/components/preview.ts
777
+ var warned = /* @__PURE__ */ new WeakSet();
778
+ function isEditing(el) {
779
+ return el.preview && el.editable;
780
+ }
781
+ function warnIfEditableWithoutPreview(el) {
782
+ if (!el.editable || el.preview || warned.has(el)) return;
783
+ warned.add(el);
784
+ console.warn(
785
+ `<${el.localName}> ignores editable without preview, so a live page is never edited.`
786
+ );
787
+ }
788
+ function stopPreviewNavigation(el) {
789
+ return (event) => {
790
+ if (!el.preview) return;
791
+ for (const node of event.composedPath()) {
792
+ if (node === el) return;
793
+ if (node instanceof Element && (node.localName === "a" || node.localName === "area") && node.hasAttribute("href")) {
794
+ event.preventDefault();
795
+ return;
796
+ }
797
+ }
798
+ };
799
+ }
800
+ function guardPreviewNavigation(el) {
801
+ const stop = stopPreviewNavigation(el);
802
+ for (const type of ["click", "auxclick"]) {
803
+ el.addEventListener(type, stop, { capture: true });
804
+ }
805
+ }
806
+
772
807
  // src/components/consent-checkbox.ts
773
808
  var ConsentCheckbox = class extends i4 {
774
809
  constructor() {
775
810
  super();
811
+ this.preview = false;
776
812
  this.name = "";
777
813
  this.checked = false;
778
814
  this.required = false;
779
815
  this.disabled = false;
780
816
  this.value = "on";
781
817
  this.internals = this.attachInternals();
818
+ guardPreviewNavigation(this);
782
819
  }
783
820
  // Update form value when properties change
784
821
  updated(changedProperties) {
@@ -924,6 +961,9 @@ ConsentCheckbox.styles = i`
924
961
  text-decoration: none;
925
962
  }
926
963
  `;
964
+ __decorateClass([
965
+ n4({ type: Boolean, reflect: true })
966
+ ], ConsentCheckbox.prototype, "preview", 2);
927
967
  __decorateClass([
928
968
  n4({ type: String, reflect: true })
929
969
  ], ConsentCheckbox.prototype, "name", 2);
@@ -1444,7 +1484,7 @@ ConsentShell.styles = i`
1444
1484
  .container {
1445
1485
  box-sizing: border-box;
1446
1486
  background: white;
1447
- border-radius: 20px;
1487
+ border-radius: var(--cs-card-radius, 20px);
1448
1488
  border: 1px solid rgba(0, 0, 0, 0.1);
1449
1489
  box-shadow:
1450
1490
  0 20px 25px -5px rgba(0, 0, 0, 0.1),
@@ -2012,6 +2052,7 @@ function resolveConsentBranding(branding) {
2012
2052
  var ConsentTerms = class extends i4 {
2013
2053
  constructor() {
2014
2054
  super();
2055
+ this.preview = false;
2015
2056
  this.name = "termsAccepted";
2016
2057
  this.text = "Terms and Conditions";
2017
2058
  this.labelPrefix = "I agree to the";
@@ -2021,6 +2062,7 @@ var ConsentTerms = class extends i4 {
2021
2062
  this.disabled = false;
2022
2063
  this.value = "accepted";
2023
2064
  this.internals = this.attachInternals();
2065
+ guardPreviewNavigation(this);
2024
2066
  }
2025
2067
  updated(changedProperties) {
2026
2068
  if (changedProperties.has("checked") || changedProperties.has("value")) {
@@ -2198,6 +2240,9 @@ ConsentTerms.styles = i`
2198
2240
  margin-left: 0.125rem;
2199
2241
  }
2200
2242
  `;
2243
+ __decorateClass([
2244
+ n4({ type: Boolean, reflect: true })
2245
+ ], ConsentTerms.prototype, "preview", 2);
2201
2246
  __decorateClass([
2202
2247
  n4({ type: String, reflect: true })
2203
2248
  ], ConsentTerms.prototype, "name", 2);
@@ -2282,11 +2327,20 @@ var o7 = e7(t5);
2282
2327
  // src/components/consent-oauth-button.ts
2283
2328
  function sanitizeSvg(svg) {
2284
2329
  if (!svg || typeof svg !== "string") return "";
2285
- let sanitized = svg.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "");
2330
+ let sanitized = svg.replace(
2331
+ /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
2332
+ ""
2333
+ );
2286
2334
  sanitized = sanitized.replace(/\s*on\w+\s*=\s*["'][^"']*["']/gi, "");
2287
2335
  sanitized = sanitized.replace(/\s*on\w+\s*=\s*[^\s>]*/gi, "");
2288
- sanitized = sanitized.replace(/(href|src|xlink:href)\s*=\s*["']?\s*javascript:[^"'>\s]*/gi, '$1=""');
2289
- sanitized = sanitized.replace(/(href|src|xlink:href)\s*=\s*["']?\s*data:[^"'>\s]*/gi, '$1=""');
2336
+ sanitized = sanitized.replace(
2337
+ /(href|src|xlink:href)\s*=\s*["']?\s*javascript:[^"'>\s]*/gi,
2338
+ '$1=""'
2339
+ );
2340
+ sanitized = sanitized.replace(
2341
+ /(href|src|xlink:href)\s*=\s*["']?\s*data:[^"'>\s]*/gi,
2342
+ '$1=""'
2343
+ );
2290
2344
  sanitized = sanitized.replace(/data:text\/html[^"'>\s]*/gi, "");
2291
2345
  return sanitized;
2292
2346
  }
@@ -2344,6 +2398,7 @@ var PROVIDER_CONFIGS = {
2344
2398
  var ConsentOAuthButton = class extends i4 {
2345
2399
  constructor() {
2346
2400
  super(...arguments);
2401
+ this.preview = false;
2347
2402
  this.provider = "custom";
2348
2403
  this.url = "";
2349
2404
  this.loading = false;
@@ -2363,7 +2418,8 @@ var ConsentOAuthButton = class extends i4 {
2363
2418
  return `Continue with ${this.displayName}`;
2364
2419
  }
2365
2420
  handleClick() {
2366
- if (this.disabled || this.loading || this.redirecting) return;
2421
+ if (this.disabled || this.loading || this.redirecting || this.preview)
2422
+ return;
2367
2423
  if (this.url) {
2368
2424
  this.redirecting = true;
2369
2425
  window.location.href = this.url;
@@ -2513,7 +2569,9 @@ ConsentOAuthButton.styles = i`
2513
2569
  font-weight: 500;
2514
2570
  font-family: inherit;
2515
2571
  cursor: pointer;
2516
- transition: background-color 0.15s ease, opacity 0.15s ease;
2572
+ transition:
2573
+ background-color 0.15s ease,
2574
+ opacity 0.15s ease;
2517
2575
  display: inline-flex;
2518
2576
  align-items: center;
2519
2577
  justify-content: center;
@@ -2562,6 +2620,9 @@ ConsentOAuthButton.styles = i`
2562
2620
  text-align: center;
2563
2621
  }
2564
2622
  `;
2623
+ __decorateClass([
2624
+ n4({ type: Boolean, reflect: true })
2625
+ ], ConsentOAuthButton.prototype, "preview", 2);
2565
2626
  __decorateClass([
2566
2627
  n4({ type: String })
2567
2628
  ], ConsentOAuthButton.prototype, "provider", 2);
@@ -2847,7 +2908,12 @@ ConsentOTPInput.styles = i`
2847
2908
  justify-content: center;
2848
2909
  }
2849
2910
 
2911
+ /* Each cell starts at its full width and shrinks evenly when the
2912
+ container is narrower than six of them, so the row never spills out
2913
+ of its own box. */
2850
2914
  input {
2915
+ flex: 0 1 auto;
2916
+ min-width: 0;
2851
2917
  width: 2.75rem;
2852
2918
  height: 3.5rem;
2853
2919
  text-align: center;
@@ -2958,26 +3024,52 @@ var CONSENT_COPY_TOKENS = {
2958
3024
  },
2959
3025
  headline: {
2960
3026
  /**
2961
- * `{Agent}` → agent display name (serif italic at render time).
2962
- * `{Verb}` → operator verb, default "use".
2963
- * `{Org}` → organization display name (serif italic at render time).
3027
+ * `{Agent}` → agent display name (italic, a button that opens the
3028
+ * agent's details when the agent is given).
3029
+ * `{Verb}` → operator verb; empty or "use" takes `fallbackTemplate`.
2964
3030
  */
2965
- template: "{Agent} would like to {Verb} at {Org} for you.",
2966
- fallbackTemplate: "{Agent} is requesting permission at {Org}."
3031
+ template: "{Agent} would like to {Verb} on your behalf",
3032
+ fallbackTemplate: "{Agent} is requesting permission on your behalf"
2967
3033
  },
2968
3034
  subhead: {
2969
3035
  /** `{Agent}` → agent display name. */
2970
- template: "Pick what {Agent} is allowed to do on your behalf. You stay in charge: change or cancel anytime."
3036
+ template: "Pick what {Agent} is allowed to do on your behalf."
3037
+ },
3038
+ /** What the agent's name opens in the headline. */
3039
+ agentDetails: {
3040
+ /** The popover's accessible name. */
3041
+ about: "About {Agent}",
3042
+ kind: "AI agent",
3043
+ identity: "Identity",
3044
+ identifiedBy: "Identified by {Host}",
3045
+ /** Read before the host in the headline's chip. */
3046
+ identifiedByPrefix: "identified by ",
3047
+ identifiedExplanation: "Its details are published at {Host}, and it can only send you back to an address listed there.",
3048
+ verified: "Verified",
3049
+ verifiedExplanation: "Its Entity Card was checked and verified.",
3050
+ unverified: "Unverified",
3051
+ unverifiedExplanation: "It registered itself, so the name it gives is not checked.",
3052
+ agentId: "Agent ID"
3053
+ },
3054
+ /** The warning under the headline for an agent that registered itself. */
3055
+ unverifiedAgent: {
3056
+ heading: "Unverified agent",
3057
+ advice: "Allow only if you asked it to."
3058
+ },
3059
+ /** The box naming who is signing in. */
3060
+ approver: {
3061
+ signedIn: "Signed in as"
3062
+ },
3063
+ /** The box that says what the grant connects to and how it is bounded. */
3064
+ grantDetails: {
3065
+ heading: "Permission details",
3066
+ connectsTo: "Connects to",
3067
+ duration: "Duration",
3068
+ budget: "Budget",
3069
+ amountLimits: "Amount limits",
3070
+ alreadyGranted: "Already granted"
2971
3071
  },
2972
3072
  agentTile: {
2973
- verifiedPill: "Verified",
2974
- unverifiedPill: "UNVERIFIED",
2975
- /**
2976
- * Read by screen readers before the domain in a domain-bound agent's
2977
- * pill, which shows only the domain. Never "Verified": a domain binding
2978
- * names the client, it does not verify it.
2979
- */
2980
- domainPillPrefix: "Identified by",
2981
3073
  /**
2982
3074
  * The meta line under the agent's name is built from the parts that are
2983
3075
  * known, joined by `metaSeparator`: an unknown vendor or surface is left
@@ -3000,9 +3092,6 @@ var CONSENT_COPY_TOKENS = {
3000
3092
  connectedMinutesAgo: "Connected {Minutes} min ago"
3001
3093
  },
3002
3094
  section: {
3003
- /** `{Agent}` → agent display name (uppercased at render time). */
3004
- capabilitiesHeader: "WHAT {Agent} CAN DO FOR YOU",
3005
- tapToToggle: "Tap to toggle",
3006
3095
  /** Used in the dark gateway theme. */
3007
3096
  permissionsRequested: "PERMISSIONS REQUESTED"
3008
3097
  },
@@ -3133,12 +3222,28 @@ var CONSENT_COPY_TOKENS = {
3133
3222
  expiresTemplate: "This request expires in {Time}. Approve before then, or the agent will need to ask again.",
3134
3223
  expired: "This request expired. Ask the agent to try again."
3135
3224
  },
3225
+ /**
3226
+ * What a screen reader calls each region a person can edit in edit mode
3227
+ * (`preview` and `editable` together).
3228
+ */
3229
+ editRegions: {
3230
+ description: "Description",
3231
+ orgName: "Organization name",
3232
+ capabilityLabel: "Permission name",
3233
+ capabilityDescription: "Permission description",
3234
+ submitLabel: "Allow button label",
3235
+ cancelLabel: "Deny button label"
3236
+ },
3136
3237
  attribution: {
3137
- /** Light theme. */
3138
- protectedBy: "Protected by Checkpoint",
3139
- /** Dark theme. */
3140
- securedBy: "Secured by Checkpoint",
3141
- howThisWorks: "How does this work?"
3238
+ /** consent-footer's line, in both themes. */
3239
+ byLine: "by Vouched KYA",
3240
+ howThisWorks: "How does this work?",
3241
+ /** Before the Vouched lockup under the capabilities screen's card. */
3242
+ securedBy: "Secured by",
3243
+ /** The lockup's accessible name. */
3244
+ lockup: "Vouched",
3245
+ /** Under the lockup's letters. */
3246
+ tagline: "Know Your Agent"
3142
3247
  },
3143
3248
  /**
3144
3249
  * `consent-passkey` defaults. `PasskeyConfig.instructions`, `buttonText`
@@ -3180,20 +3285,6 @@ function formatToken(template, values) {
3180
3285
  });
3181
3286
  }
3182
3287
 
3183
- // src/types/capabilities.types.ts
3184
- var AGENT_VERIFICATIONS = [
3185
- "verified",
3186
- "domain",
3187
- "unverified"
3188
- ];
3189
- function agentVerification(agent) {
3190
- const stated = agent.verification;
3191
- if (stated !== void 0 && AGENT_VERIFICATIONS.includes(stated)) {
3192
- return stated === "domain" && !agent.domain?.trim() ? "unverified" : stated;
3193
- }
3194
- return agent.verified === true ? "verified" : "unverified";
3195
- }
3196
-
3197
3288
  // src/components/consent-agent-header.ts
3198
3289
  var ConsentAgentHeader = class extends i4 {
3199
3290
  constructor() {
@@ -3201,8 +3292,6 @@ var ConsentAgentHeader = class extends i4 {
3201
3292
  this.agentName = "";
3202
3293
  this.vendor = "";
3203
3294
  this.surfaceLabel = "";
3204
- this.domain = "";
3205
- this.verified = false;
3206
3295
  this.logoUrl = "";
3207
3296
  this.connectedAt = "";
3208
3297
  }
@@ -3234,23 +3323,6 @@ var ConsentAgentHeader = class extends i4 {
3234
3323
  this.renderConnectedFragment()
3235
3324
  ].filter(Boolean).join(tokens.metaSeparator);
3236
3325
  }
3237
- renderPill() {
3238
- const tokens = CONSENT_COPY_TOKENS.agentTile;
3239
- const state = agentVerification({
3240
- verification: this.verification,
3241
- verified: this.verified,
3242
- domain: this.domain
3243
- });
3244
- if (state === "domain") {
3245
- return b2`<span class="pill domain" part="pill"
3246
- ><span class="visually-hidden">${tokens.domainPillPrefix} </span
3247
- >${this.domain.trim()}</span
3248
- >`;
3249
- }
3250
- return b2`<span class="pill ${state}" part="pill">
3251
- ${state === "verified" ? tokens.verifiedPill : tokens.unverifiedPill}
3252
- </span>`;
3253
- }
3254
3326
  render() {
3255
3327
  const initial = (this.agentName || "?").trim().charAt(0).toUpperCase();
3256
3328
  return b2`
@@ -3259,10 +3331,7 @@ var ConsentAgentHeader = class extends i4 {
3259
3331
  ${this.logoUrl ? b2`<img src="${this.logoUrl}" alt="" />` : b2`<div class="placeholder">${initial}</div>`}
3260
3332
  </div>
3261
3333
  <div class="body">
3262
- <div class="row-name">
3263
- <span class="name">${this.agentName || A}</span>
3264
- ${this.renderPill()}
3265
- </div>
3334
+ <span class="name">${this.agentName || A}</span>
3266
3335
  <div class="meta">${this.renderMeta()}</div>
3267
3336
  </div>
3268
3337
  </div>
@@ -3276,7 +3345,7 @@ ConsentAgentHeader.styles = i`
3276
3345
  }
3277
3346
 
3278
3347
  /* In a narrow card the name moves under the logo rather than squeezing
3279
- into a column too thin for its pill (see .body's basis). */
3348
+ into a column too thin to read (see .body's basis). */
3280
3349
  .tile {
3281
3350
  display: flex;
3282
3351
  flex-wrap: wrap;
@@ -3330,13 +3399,6 @@ ConsentAgentHeader.styles = i`
3330
3399
  min-width: 0;
3331
3400
  }
3332
3401
 
3333
- .row-name {
3334
- display: flex;
3335
- align-items: center;
3336
- gap: 10px;
3337
- flex-wrap: wrap;
3338
- }
3339
-
3340
3402
  .name {
3341
3403
  font-size: 16px;
3342
3404
  font-weight: 600;
@@ -3344,64 +3406,9 @@ ConsentAgentHeader.styles = i`
3344
3406
  letter-spacing: -0.01em;
3345
3407
  }
3346
3408
 
3347
- .pill {
3348
- display: inline-flex;
3349
- align-items: center;
3350
- gap: 4px;
3351
- padding: 2px 8px;
3352
- border-radius: 999px;
3353
- font-size: 11px;
3354
- font-weight: 600;
3355
- letter-spacing: 0.04em;
3356
- }
3357
-
3358
- .pill.verified {
3359
- background: var(--cs-pill-verified-bg, #dcfce7);
3360
- color: var(--cs-pill-verified-text, #166534);
3361
- }
3362
-
3363
- .pill.unverified {
3364
- background: var(--cs-pill-unverified-bg, #f1f5f9);
3365
- color: var(--cs-pill-unverified-text, #475569);
3366
- letter-spacing: 0.08em;
3367
- }
3368
-
3369
- /*
3370
- * Domain-bound: a tint and an outline from the brand primary, with the
3371
- * theme's own text color, so the domain reads in light and dark
3372
- * whatever the brand color is.
3373
- */
3374
- .pill.domain {
3375
- background: var(
3376
- --cs-pill-domain-bg,
3377
- color-mix(in srgb, var(--consent-primary, #2563eb) 14%, transparent)
3378
- );
3379
- box-shadow: inset 0 0 0 1px
3380
- var(
3381
- --cs-pill-domain-border,
3382
- color-mix(in srgb, var(--consent-primary, #2563eb) 40%, transparent)
3383
- );
3384
- color: var(--cs-pill-domain-text, var(--cs-text-primary, #0f172a));
3385
- font-weight: 500;
3386
- letter-spacing: 0;
3387
- overflow-wrap: anywhere;
3388
- }
3389
-
3390
- .visually-hidden {
3391
- position: absolute;
3392
- width: 1px;
3393
- height: 1px;
3394
- margin: -1px;
3395
- padding: 0;
3396
- overflow: hidden;
3397
- clip: rect(0, 0, 0, 0);
3398
- white-space: nowrap;
3399
- border: 0;
3400
- }
3401
-
3402
3409
  .meta {
3403
3410
  font-size: 12px;
3404
- color: var(--cs-text-tertiary, #64748b);
3411
+ color: var(--cs-text-tertiary, #5d6c82);
3405
3412
  line-height: 1.5;
3406
3413
  }
3407
3414
  `;
@@ -3414,15 +3421,6 @@ __decorateClass([
3414
3421
  __decorateClass([
3415
3422
  n4({ type: String })
3416
3423
  ], ConsentAgentHeader.prototype, "surfaceLabel", 2);
3417
- __decorateClass([
3418
- n4({ type: String })
3419
- ], ConsentAgentHeader.prototype, "verification", 2);
3420
- __decorateClass([
3421
- n4({ type: String })
3422
- ], ConsentAgentHeader.prototype, "domain", 2);
3423
- __decorateClass([
3424
- n4({ type: Boolean })
3425
- ], ConsentAgentHeader.prototype, "verified", 2);
3426
3424
  __decorateClass([
3427
3425
  n4({ type: String })
3428
3426
  ], ConsentAgentHeader.prototype, "logoUrl", 2);
@@ -3433,46 +3431,515 @@ ConsentAgentHeader = __decorateClass([
3433
3431
  t3("consent-agent-header")
3434
3432
  ], ConsentAgentHeader);
3435
3433
 
3434
+ // src/types/capabilities.types.ts
3435
+ var AGENT_VERIFICATIONS = [
3436
+ "verified",
3437
+ "domain",
3438
+ "unverified"
3439
+ ];
3440
+ function agentVerification(agent) {
3441
+ const stated = agent.verification;
3442
+ if (stated !== void 0 && AGENT_VERIFICATIONS.includes(stated)) {
3443
+ return stated === "domain" && !agent.domain?.trim() ? "unverified" : stated;
3444
+ }
3445
+ return agent.verified === true ? "verified" : "unverified";
3446
+ }
3447
+
3448
+ // src/types/edit.types.ts
3449
+ var CONSENT_EDIT_KEYS = {
3450
+ /** The subhead under the headline. */
3451
+ description: "description",
3452
+ /** The organization's name in the headline. */
3453
+ orgName: "org-name",
3454
+ /** The Allow button's label. */
3455
+ submitLabel: "submit-label",
3456
+ /** The Deny button's label. */
3457
+ cancelLabel: "cancel-label",
3458
+ /** A headline a host words itself, in the `headline` slot. */
3459
+ headline: "headline",
3460
+ /** The title of a page a host draws after the decision. */
3461
+ terminalTitle: "terminal:title",
3462
+ /** The body of a page a host draws after the decision. */
3463
+ terminalBody: "terminal:body",
3464
+ /** A capability row's label, by the capability's id. */
3465
+ capabilityLabel: (id) => `capability:${id}:label`,
3466
+ /** A capability row's description, by the capability's id. */
3467
+ capabilityDescription: (id) => `capability:${id}:description`
3468
+ };
3469
+ var CONSENT_EDIT_EVENTS = {
3470
+ /** On every change to a region's text. */
3471
+ edit: "consent-edit",
3472
+ /** When a person leaves a region they changed, for hosts that group undo. */
3473
+ end: "consent-edit-end"
3474
+ };
3475
+ var FIXED_KEYS = /* @__PURE__ */ new Set([
3476
+ CONSENT_EDIT_KEYS.description,
3477
+ CONSENT_EDIT_KEYS.orgName,
3478
+ CONSENT_EDIT_KEYS.submitLabel,
3479
+ CONSENT_EDIT_KEYS.cancelLabel,
3480
+ CONSENT_EDIT_KEYS.headline,
3481
+ CONSENT_EDIT_KEYS.terminalTitle,
3482
+ CONSENT_EDIT_KEYS.terminalBody
3483
+ ]);
3484
+ var CAPABILITY_PREFIX = "capability:";
3485
+ var CAPABILITY_SUFFIXES = [
3486
+ [":label", "capability-label"],
3487
+ [":description", "capability-description"]
3488
+ ];
3489
+ function parseConsentEditKey(key) {
3490
+ if (FIXED_KEYS.has(key)) {
3491
+ return { kind: key };
3492
+ }
3493
+ if (!key.startsWith(CAPABILITY_PREFIX)) return null;
3494
+ for (const [suffix, kind] of CAPABILITY_SUFFIXES) {
3495
+ if (key.endsWith(suffix) && key.length > CAPABILITY_PREFIX.length + suffix.length) {
3496
+ return {
3497
+ kind,
3498
+ capabilityId: key.slice(CAPABILITY_PREFIX.length, -suffix.length)
3499
+ };
3500
+ }
3501
+ }
3502
+ return null;
3503
+ }
3504
+
3505
+ // src/components/edit-region.ts
3506
+ var regions = /* @__PURE__ */ new WeakMap();
3507
+ var editableValue;
3508
+ function contentEditableValue() {
3509
+ if (editableValue) return editableValue;
3510
+ if (typeof document === "undefined") return "true";
3511
+ try {
3512
+ const probe = document.createElement("span");
3513
+ probe.contentEditable = "plaintext-only";
3514
+ editableValue = probe.contentEditable === "plaintext-only" ? "plaintext-only" : "true";
3515
+ } catch {
3516
+ editableValue = "true";
3517
+ }
3518
+ return editableValue;
3519
+ }
3520
+ function hasFocus(el) {
3521
+ const root = el.getRootNode();
3522
+ return root.activeElement === el;
3523
+ }
3524
+ function lineOf(text) {
3525
+ return text.replace(/ /g, " ").replace(/\s*[\r\n]+\s*/g, " ");
3526
+ }
3527
+ function emit(el, type, detail) {
3528
+ el.dispatchEvent(
3529
+ new CustomEvent(type, {
3530
+ detail,
3531
+ bubbles: true,
3532
+ composed: true
3533
+ })
3534
+ );
3535
+ }
3536
+ function caretToEnd(el) {
3537
+ el.ownerDocument.getSelection()?.collapse(el, el.childNodes.length);
3538
+ }
3539
+ function insertPlainText(el, text) {
3540
+ if (!text) return;
3541
+ const doc = el.ownerDocument;
3542
+ if (typeof doc.execCommand === "function") {
3543
+ try {
3544
+ if (doc.execCommand("insertText", false, text)) return;
3545
+ } catch {
3546
+ }
3547
+ }
3548
+ const selection = doc.getSelection();
3549
+ if (!selection || selection.rangeCount === 0) return;
3550
+ const range = selection.getRangeAt(0);
3551
+ if (!el.contains(range.commonAncestorContainer)) return;
3552
+ range.deleteContents();
3553
+ const node = doc.createTextNode(text);
3554
+ range.insertNode(node);
3555
+ range.setStartAfter(node);
3556
+ range.collapse(true);
3557
+ selection.removeAllRanges();
3558
+ selection.addRange(range);
3559
+ el.dispatchEvent(
3560
+ new InputEvent("input", {
3561
+ bubbles: true,
3562
+ composed: true,
3563
+ inputType: "insertText",
3564
+ data: text
3565
+ })
3566
+ );
3567
+ }
3568
+ function onPointerDown(event) {
3569
+ const state = regions.get(event.currentTarget);
3570
+ if (state) state.pointer = true;
3571
+ }
3572
+ function onMouseDown(event) {
3573
+ const el = event.currentTarget;
3574
+ const state = regions.get(el);
3575
+ if (!state || event.button !== 0 || hasFocus(el)) return;
3576
+ if (el.textContent === state.source) return;
3577
+ event.preventDefault();
3578
+ state.pointer = false;
3579
+ el.focus();
3580
+ }
3581
+ function onFocus(event) {
3582
+ const el = event.currentTarget;
3583
+ const state = regions.get(el);
3584
+ if (!state) return;
3585
+ state.changed = false;
3586
+ const swapped = el.textContent !== state.source;
3587
+ if (swapped) el.textContent = state.source;
3588
+ state.value = lineOf(el.textContent ?? "");
3589
+ if (swapped || !state.pointer) caretToEnd(el);
3590
+ state.pointer = false;
3591
+ }
3592
+ function onInput(event) {
3593
+ const el = event.currentTarget;
3594
+ const state = regions.get(el);
3595
+ if (!state) return;
3596
+ for (const br of el.querySelectorAll("br")) br.remove();
3597
+ state.changed = true;
3598
+ state.value = lineOf(el.textContent ?? "");
3599
+ emit(el, CONSENT_EDIT_EVENTS.edit, { key: state.key, value: state.value });
3600
+ }
3601
+ function onBlur(event) {
3602
+ const el = event.currentTarget;
3603
+ const state = regions.get(el);
3604
+ if (!state) return;
3605
+ state.pointer = false;
3606
+ if (el.textContent !== state.text) el.textContent = state.text;
3607
+ if (!state.changed) return;
3608
+ state.changed = false;
3609
+ emit(el, CONSENT_EDIT_EVENTS.end, { key: state.key, value: state.value });
3610
+ }
3611
+ function isImeKey(event) {
3612
+ return event.isComposing || event.keyCode === 229;
3613
+ }
3614
+ function onKeyDown(event) {
3615
+ event.stopPropagation();
3616
+ if (isImeKey(event)) return;
3617
+ if (event.key === "Enter" || event.key === "Escape") {
3618
+ event.preventDefault();
3619
+ event.currentTarget.blur();
3620
+ }
3621
+ }
3622
+ function onBeforeInput(event) {
3623
+ if (event.inputType.startsWith("format") || event.inputType === "insertParagraph" || event.inputType === "insertLineBreak") {
3624
+ event.preventDefault();
3625
+ }
3626
+ }
3627
+ function onPaste(event) {
3628
+ event.preventDefault();
3629
+ insertPlainText(
3630
+ event.currentTarget,
3631
+ lineOf(event.clipboardData?.getData("text/plain") ?? "")
3632
+ );
3633
+ }
3634
+ function onDrop(event) {
3635
+ event.preventDefault();
3636
+ }
3637
+ var EditableTextDirective = class extends i5 {
3638
+ constructor(partInfo) {
3639
+ super(partInfo);
3640
+ if (partInfo.type !== t4.ELEMENT) {
3641
+ throw new Error(
3642
+ "editableText goes on an element, as an attribute-less binding"
3643
+ );
3644
+ }
3645
+ }
3646
+ render(_key, _text, _source) {
3647
+ return E;
3648
+ }
3649
+ update(part, [key, text, source]) {
3650
+ const el = part.element;
3651
+ const state = regions.get(el);
3652
+ if (state) {
3653
+ state.key = key;
3654
+ state.text = text;
3655
+ state.source = source;
3656
+ } else {
3657
+ regions.set(el, {
3658
+ key,
3659
+ text,
3660
+ source,
3661
+ changed: false,
3662
+ value: text,
3663
+ pointer: false
3664
+ });
3665
+ }
3666
+ if (!hasFocus(el) && el.textContent !== text) el.textContent = text;
3667
+ return E;
3668
+ }
3669
+ };
3670
+ var editableText = e7(EditableTextDirective);
3671
+ function editRegion(key, label, text, source) {
3672
+ return b2`<span
3673
+ class="edit-region"
3674
+ data-edit-key=${key}
3675
+ role="textbox"
3676
+ aria-label=${label}
3677
+ contenteditable=${contentEditableValue()}
3678
+ spellcheck="true"
3679
+ ${editableText(key, text, source?.[key] ?? text)}
3680
+ @pointerdown=${onPointerDown}
3681
+ @mousedown=${onMouseDown}
3682
+ @focus=${onFocus}
3683
+ @blur=${onBlur}
3684
+ @keydown=${onKeyDown}
3685
+ @beforeinput=${onBeforeInput}
3686
+ @input=${onInput}
3687
+ @paste=${onPaste}
3688
+ @drop=${onDrop}
3689
+ ></span>`;
3690
+ }
3691
+ var editRegionStyles = i`
3692
+ .edit-region {
3693
+ cursor: text;
3694
+ border-radius: 3px;
3695
+ outline: 1px dashed transparent;
3696
+ outline-offset: 2px;
3697
+ transition:
3698
+ outline-color 0.12s ease,
3699
+ background-color 0.12s ease;
3700
+ }
3701
+
3702
+ .edit-region:hover {
3703
+ outline-color: var(
3704
+ --cs-edit-hover-ring,
3705
+ color-mix(in srgb, currentColor 45%, transparent)
3706
+ );
3707
+ }
3708
+
3709
+ .edit-region:focus {
3710
+ outline: 2px solid var(--cs-edit-focus-ring, currentColor);
3711
+ background-color: var(
3712
+ --cs-edit-wash,
3713
+ color-mix(in srgb, currentColor 8%, transparent)
3714
+ );
3715
+ }
3716
+
3717
+ /* An emptied region keeps room for the caret and something to click. */
3718
+ .edit-region:empty {
3719
+ display: inline-block;
3720
+ min-width: 1ch;
3721
+ }
3722
+ `;
3723
+
3436
3724
  // src/components/consent-headline.ts
3437
- var PLACEHOLDER = /(\{Agent\}|\{Verb\}|\{Org\})/;
3725
+ var PLACEHOLDER = /(\{Agent\}|\{Verb\})/;
3726
+ var DETAILS_WIDTH_PX = 304;
3727
+ var DETAILS_GAP_PX = 8;
3728
+ var DETAILS_GUTTER_PX = 16;
3729
+ function initialOf(name) {
3730
+ return name.match(/[\p{L}\p{N}]/u)?.[0]?.toUpperCase() ?? "?";
3731
+ }
3732
+ function vouchingHost(agent) {
3733
+ return agentVerification(agent) === "domain" ? agent.domain?.trim() || void 0 : void 0;
3734
+ }
3735
+ var CHECK_ICON = w`<path d="M20 6 9 17l-5-5" />`;
3736
+ var GLOBE_ICON = w`<circle cx="12" cy="12" r="10" /><path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" /><path d="M2 12h20" />`;
3438
3737
  var ConsentHeadline = class extends i4 {
3439
3738
  constructor() {
3440
3739
  super(...arguments);
3441
3740
  this.agentName = "";
3442
- this.orgName = "";
3443
3741
  this.verb = "";
3444
3742
  this.description = "";
3445
3743
  this.eyebrow = "";
3744
+ this.preview = false;
3745
+ this.editable = false;
3746
+ this.hostHeadline = false;
3747
+ /**
3748
+ * Reads the slot itself, not the event's target: when a screen forwards its
3749
+ * own slot here, the event comes from that slot, and a host that fills the
3750
+ * screen's slot later is seen only through the flattened list.
3751
+ */
3752
+ this.readHeadlineSlot = () => {
3753
+ const slot = this.renderRoot.querySelector(
3754
+ 'slot[name="headline"]'
3755
+ );
3756
+ this.hostHeadline = (slot?.assignedElements({ flatten: true }).length ?? 0) > 0;
3757
+ };
3758
+ /** Places the popover under the name, inside the window, while it is open. */
3759
+ this.onDetailsToggle = (event) => {
3760
+ const opening = event.newState === "open";
3761
+ if (opening) {
3762
+ this.placeDetails();
3763
+ window.addEventListener("scroll", this.placeDetails, true);
3764
+ window.addEventListener("resize", this.placeDetails);
3765
+ } else {
3766
+ window.removeEventListener("scroll", this.placeDetails, true);
3767
+ window.removeEventListener("resize", this.placeDetails);
3768
+ }
3769
+ };
3770
+ this.placeDetails = () => {
3771
+ const name = this.renderRoot.querySelector(".agent");
3772
+ const details = this.renderRoot.querySelector(".details");
3773
+ if (!name || !details) return;
3774
+ const anchor = name.getBoundingClientRect();
3775
+ const width = Math.min(
3776
+ DETAILS_WIDTH_PX,
3777
+ window.innerWidth - 2 * DETAILS_GUTTER_PX
3778
+ );
3779
+ details.style.top = `${anchor.bottom + DETAILS_GAP_PX}px`;
3780
+ details.style.left = `${Math.max(
3781
+ DETAILS_GUTTER_PX,
3782
+ Math.min(anchor.left, window.innerWidth - width - DETAILS_GUTTER_PX)
3783
+ )}px`;
3784
+ };
3446
3785
  }
3447
3786
  render() {
3448
3787
  const tokens = CONSENT_COPY_TOKENS;
3449
- const subhead = this.description.trim() || formatToken(tokens.subhead.template, {
3450
- Agent: this.agentName.trim() || "this agent"
3451
- });
3788
+ const subhead = this.subheadText();
3452
3789
  return b2`
3453
3790
  <span class="eyebrow" part="eyebrow"
3454
3791
  >${this.eyebrow.trim() || tokens.eyebrow.permissionRequest}</span
3455
3792
  >
3456
- <h1 class="headline" part="headline">${this.headlinePieces()}</h1>
3457
- <p class="subhead" part="subhead">${subhead}</p>
3793
+ <h1 class="headline" part="headline">
3794
+ <slot name="headline" @slotchange=${this.readHeadlineSlot}></slot>${this.hostHeadline ? A : this.headlinePieces()}
3795
+ </h1>
3796
+ ${subhead === A ? A : b2`<p class="subhead" part="subhead">${subhead}</p>`}
3797
+ ${this.agent && !this.hostHeadline ? this.renderDetails(this.agent) : A}
3458
3798
  `;
3459
3799
  }
3460
- /** The headline, with each name as text in its own `em`. */
3800
+ /** The name the headline gives the agent. */
3801
+ get displayName() {
3802
+ return this.agent?.name?.trim() || this.agentName.trim() || "An assistant";
3803
+ }
3804
+ /**
3805
+ * The subhead: the host's, as a region in edit mode. With none, nothing,
3806
+ * except in edit mode, where the region starts from the standard line.
3807
+ */
3808
+ subheadText() {
3809
+ const given = this.description.trim();
3810
+ if (!isEditing(this)) return given || A;
3811
+ return editRegion(
3812
+ CONSENT_EDIT_KEYS.description,
3813
+ CONSENT_COPY_TOKENS.editRegions.description,
3814
+ given || formatToken(CONSENT_COPY_TOKENS.subhead.template, {
3815
+ Agent: this.displayName
3816
+ }),
3817
+ this.editSource
3818
+ );
3819
+ }
3820
+ /**
3821
+ * Before the first render, reads what the slot will hold from the light DOM,
3822
+ * so the first render is already the right one. A change made here does not
3823
+ * schedule another update, where one made after the first update would.
3824
+ */
3825
+ willUpdate() {
3826
+ if (!this.hasUpdated) this.hostHeadline = this.lightHeadlineFilled();
3827
+ warnIfEditableWithoutPreview(this);
3828
+ }
3829
+ /**
3830
+ * The children the `headline` slot will be given, flattened: a screen's
3831
+ * forwarded slot counts only when something is assigned to it.
3832
+ */
3833
+ lightHeadlineFilled() {
3834
+ return [...this.children].some((child) => {
3835
+ if (child.getAttribute("slot") !== "headline") return false;
3836
+ if (child instanceof HTMLSlotElement) {
3837
+ return child.assignedElements({ flatten: true }).length > 0;
3838
+ }
3839
+ return true;
3840
+ });
3841
+ }
3842
+ /** The headline, with the agent's name as a button when the agent is given. */
3461
3843
  headlinePieces() {
3462
3844
  const tokens = CONSENT_COPY_TOKENS;
3463
3845
  const verb = this.verb.trim();
3464
3846
  const template = verb && verb !== "use" ? tokens.headline.template : tokens.headline.fallbackTemplate;
3465
- const agent = this.agentName.trim() || "An assistant";
3466
- const org = this.orgName.trim() || "this site";
3467
3847
  return template.split(PLACEHOLDER).map((piece) => {
3468
- if (piece === "{Agent}") return b2`<em>${agent}</em>`;
3469
- if (piece === "{Org}") return b2`<em>${org}</em>`;
3848
+ if (piece === "{Agent}") return this.renderName();
3470
3849
  if (piece === "{Verb}") return verb;
3471
3850
  return piece;
3472
3851
  });
3473
3852
  }
3853
+ renderName() {
3854
+ const name = this.displayName;
3855
+ if (!this.agent) return b2`<em part="agent-name">${name}</em>`;
3856
+ const host = vouchingHost(this.agent);
3857
+ return b2`<button
3858
+ class="agent"
3859
+ part="agent-name"
3860
+ type="button"
3861
+ aria-haspopup="dialog"
3862
+ popovertarget="agent-details"
3863
+ >
3864
+ ${name}</button
3865
+ >${host ? b2` <span class="host" part="host"
3866
+ ><svg
3867
+ viewBox="0 0 24 24"
3868
+ fill="none"
3869
+ stroke="currentColor"
3870
+ stroke-width="2"
3871
+ stroke-linecap="round"
3872
+ stroke-linejoin="round"
3873
+ aria-hidden="true"
3874
+ >
3875
+ ${CHECK_ICON}</svg
3876
+ ><span class="sr-only"
3877
+ >${CONSENT_COPY_TOKENS.agentDetails.identifiedByPrefix}</span
3878
+ >${host}</span
3879
+ >` : A}`;
3880
+ }
3881
+ /** What the agent's name opens: who it is and how its name was checked. */
3882
+ renderDetails(agent) {
3883
+ const copy = CONSENT_COPY_TOKENS.agentDetails;
3884
+ const name = this.displayName;
3885
+ const host = vouchingHost(agent);
3886
+ const verified = agentVerification(agent) === "verified";
3887
+ const identity = host ? formatToken(copy.identifiedBy, { Host: host }) : verified ? copy.verified : copy.unverified;
3888
+ const explanation = host ? formatToken(copy.identifiedExplanation, { Host: host }) : verified ? copy.verifiedExplanation : copy.unverifiedExplanation;
3889
+ const logo = agent.logoUrl?.trim();
3890
+ return b2`<div
3891
+ id="agent-details"
3892
+ class="details"
3893
+ part="agent-details"
3894
+ popover="auto"
3895
+ role="dialog"
3896
+ aria-label=${formatToken(copy.about, { Agent: name })}
3897
+ @beforetoggle=${this.onDetailsToggle}
3898
+ >
3899
+ <div class="details-head">
3900
+ <span class="mark" aria-hidden="true"
3901
+ >${logo ? b2`<img src=${logo} alt="" />` : initialOf(name)}</span
3902
+ >
3903
+ <span class="who"
3904
+ ><span class="name">${name}</span
3905
+ ><span class="small">${copy.kind}</span></span
3906
+ >
3907
+ </div>
3908
+ <dl>
3909
+ <div class="fact">
3910
+ <svg
3911
+ viewBox="0 0 24 24"
3912
+ fill="none"
3913
+ stroke="currentColor"
3914
+ stroke-width="2"
3915
+ stroke-linecap="round"
3916
+ stroke-linejoin="round"
3917
+ aria-hidden="true"
3918
+ >
3919
+ ${GLOBE_ICON}
3920
+ </svg>
3921
+ <div>
3922
+ <dt class="small">${copy.identity}</dt>
3923
+ <dd class="value">${identity}</dd>
3924
+ <dd class="small">${explanation}</dd>
3925
+ </div>
3926
+ </div>
3927
+ ${agent.did?.trim() ? b2`<div class="agent-id">
3928
+ <dt class="small">${copy.agentId}</dt>
3929
+ <dd><code>${agent.did.trim()}</code></dd>
3930
+ </div>` : A}
3931
+ </dl>
3932
+ </div>`;
3933
+ }
3934
+ disconnectedCallback() {
3935
+ super.disconnectedCallback();
3936
+ window.removeEventListener("scroll", this.placeDetails, true);
3937
+ window.removeEventListener("resize", this.placeDetails);
3938
+ }
3474
3939
  };
3475
3940
  ConsentHeadline.styles = i`
3941
+ ${editRegionStyles}
3942
+
3476
3943
  :host {
3477
3944
  display: flex;
3478
3945
  flex-direction: column;
@@ -3484,17 +3951,20 @@ ConsentHeadline.styles = i`
3484
3951
  font-size: 11px;
3485
3952
  letter-spacing: 0.16em;
3486
3953
  font-weight: 600;
3487
- color: var(--cs-text-tertiary, #64748b);
3954
+ color: var(--cs-text-tertiary, #5d6c82);
3488
3955
  text-transform: uppercase;
3489
3956
  }
3490
3957
 
3491
3958
  .headline {
3492
- font-family: "Times New Roman", Georgia, serif;
3493
- font-size: var(--cs-headline-font-size, clamp(24px, 5vw, 30px));
3494
- line-height: 1.18;
3959
+ font-family: var(--cs-headline-font, "Instrument Serif", Georgia, serif);
3960
+ font-size: var(--cs-headline-font-size, 32px);
3961
+ font-weight: var(--cs-headline-weight, 600);
3962
+ line-height: 1.1;
3495
3963
  letter-spacing: -0.01em;
3496
3964
  color: var(--cs-text-primary, #0f172a);
3497
3965
  margin: 0;
3966
+ text-align: left;
3967
+ text-wrap: pretty;
3498
3968
  overflow-wrap: anywhere;
3499
3969
  }
3500
3970
 
@@ -3502,19 +3972,199 @@ ConsentHeadline.styles = i`
3502
3972
  font-style: italic;
3503
3973
  }
3504
3974
 
3505
- .subhead {
3506
- font-size: var(--cs-subhead-font-size, 14.5px);
3507
- color: var(--cs-text-secondary, #334155);
3508
- line-height: 1.55;
3975
+ .agent {
3976
+ font: inherit;
3977
+ font-style: italic;
3978
+ color: var(--cs-action, currentColor);
3979
+ background: none;
3980
+ border: 0;
3981
+ padding: 0;
3509
3982
  margin: 0;
3983
+ text-align: left;
3984
+ cursor: pointer;
3985
+ border-radius: 4px;
3986
+ text-decoration: underline dotted 2px;
3987
+ text-underline-offset: 0.3em;
3510
3988
  }
3511
- `;
3512
- __decorateClass([
3513
- n4({ type: String, attribute: "agent-name" })
3514
- ], ConsentHeadline.prototype, "agentName", 2);
3515
- __decorateClass([
3516
- n4({ type: String, attribute: "org-name" })
3517
- ], ConsentHeadline.prototype, "orgName", 2);
3989
+
3990
+ .agent:hover {
3991
+ text-decoration-style: solid;
3992
+ }
3993
+
3994
+ .agent:focus-visible {
3995
+ outline: 2px solid var(--cs-focus-ring, #0f172a);
3996
+ outline-offset: 2px;
3997
+ }
3998
+
3999
+ .host {
4000
+ display: inline-flex;
4001
+ max-width: 100%;
4002
+ align-items: center;
4003
+ gap: 4px;
4004
+ padding: 2px 6px;
4005
+ border-radius: 4px;
4006
+ border: 1px solid var(--cs-tint-line, rgba(15, 23, 42, 0.18));
4007
+ background: var(--cs-tint, rgba(15, 23, 42, 0.07));
4008
+ color: var(--cs-text-primary, #0f172a);
4009
+ font-family: var(
4010
+ --cs-font,
4011
+ system-ui,
4012
+ -apple-system,
4013
+ "Segoe UI",
4014
+ sans-serif
4015
+ );
4016
+ font-size: 14px;
4017
+ font-style: normal;
4018
+ font-weight: 500;
4019
+ line-height: 1.45;
4020
+ letter-spacing: 0;
4021
+ vertical-align: middle;
4022
+ overflow-wrap: anywhere;
4023
+ }
4024
+
4025
+ .host svg {
4026
+ width: 14px;
4027
+ height: 14px;
4028
+ flex-shrink: 0;
4029
+ color: var(--cs-mark, currentColor);
4030
+ }
4031
+
4032
+ .sr-only {
4033
+ position: absolute;
4034
+ width: 1px;
4035
+ height: 1px;
4036
+ margin: -1px;
4037
+ padding: 0;
4038
+ overflow: hidden;
4039
+ clip-path: inset(50%);
4040
+ white-space: nowrap;
4041
+ border: 0;
4042
+ }
4043
+
4044
+ .subhead {
4045
+ font-size: var(--cs-subhead-font-size, 14.5px);
4046
+ color: var(--cs-text-secondary, #334155);
4047
+ line-height: 1.55;
4048
+ margin: 0;
4049
+ text-align: left;
4050
+ text-wrap: pretty;
4051
+ }
4052
+
4053
+ .details {
4054
+ position: fixed;
4055
+ inset: auto;
4056
+ margin: 0;
4057
+ box-sizing: border-box;
4058
+ width: min(
4059
+ ${DETAILS_WIDTH_PX}px,
4060
+ calc(100vw - ${2 * DETAILS_GUTTER_PX}px)
4061
+ );
4062
+ padding: 16px;
4063
+ border-radius: 12px;
4064
+ border: 1px solid var(--cs-surface-border, rgba(15, 23, 42, 0.1));
4065
+ background: var(--cs-surface-card, #ffffff);
4066
+ color: var(--cs-text-primary, #0f172a);
4067
+ box-shadow: var(--cs-card-shadow, 0 6px 20px -6px rgba(15, 23, 42, 0.1));
4068
+ font-size: 14px;
4069
+ line-height: 1.45;
4070
+ }
4071
+
4072
+ .details-head {
4073
+ display: flex;
4074
+ align-items: center;
4075
+ gap: 12px;
4076
+ }
4077
+
4078
+ .mark {
4079
+ display: grid;
4080
+ place-items: center;
4081
+ width: 40px;
4082
+ height: 40px;
4083
+ flex-shrink: 0;
4084
+ border-radius: 6px;
4085
+ border: 1px solid var(--cs-surface-border, rgba(15, 23, 42, 0.1));
4086
+ background: var(--cs-surface-card, #ffffff);
4087
+ font-size: 16px;
4088
+ font-weight: 600;
4089
+ overflow: hidden;
4090
+ }
4091
+
4092
+ .mark img {
4093
+ width: 28px;
4094
+ height: 28px;
4095
+ object-fit: contain;
4096
+ }
4097
+
4098
+ .who {
4099
+ display: flex;
4100
+ flex-direction: column;
4101
+ min-width: 0;
4102
+ }
4103
+
4104
+ .who .name {
4105
+ font-weight: 600;
4106
+ overflow-wrap: anywhere;
4107
+ }
4108
+
4109
+ .small {
4110
+ font-size: 12px;
4111
+ color: var(--cs-text-tertiary, #5d6c82);
4112
+ }
4113
+
4114
+ .details dl {
4115
+ display: flex;
4116
+ flex-direction: column;
4117
+ gap: 12px;
4118
+ margin: 16px 0 0;
4119
+ }
4120
+
4121
+ .details dd {
4122
+ margin: 0;
4123
+ }
4124
+
4125
+ .fact {
4126
+ display: flex;
4127
+ align-items: flex-start;
4128
+ gap: 10px;
4129
+ }
4130
+
4131
+ .fact svg {
4132
+ width: 16px;
4133
+ height: 16px;
4134
+ flex-shrink: 0;
4135
+ margin-top: 2px;
4136
+ color: var(--cs-mark, currentColor);
4137
+ }
4138
+
4139
+ .fact .value {
4140
+ font-weight: 500;
4141
+ }
4142
+
4143
+ .agent-id {
4144
+ display: flex;
4145
+ flex-direction: column;
4146
+ gap: 4px;
4147
+ }
4148
+
4149
+ .agent-id code {
4150
+ word-break: break-all;
4151
+ border-radius: 4px;
4152
+ border: 1px solid var(--cs-surface-border, rgba(15, 23, 42, 0.1));
4153
+ background: color-mix(
4154
+ in srgb,
4155
+ var(--cs-text-primary, #0f172a) 4%,
4156
+ transparent
4157
+ );
4158
+ padding: 0 4px;
4159
+ font-size: 12px;
4160
+ }
4161
+ `;
4162
+ __decorateClass([
4163
+ n4({ type: String, attribute: "agent-name" })
4164
+ ], ConsentHeadline.prototype, "agentName", 2);
4165
+ __decorateClass([
4166
+ n4({ attribute: false })
4167
+ ], ConsentHeadline.prototype, "agent", 2);
3518
4168
  __decorateClass([
3519
4169
  n4({ type: String })
3520
4170
  ], ConsentHeadline.prototype, "verb", 2);
@@ -3524,6 +4174,18 @@ __decorateClass([
3524
4174
  __decorateClass([
3525
4175
  n4({ type: String })
3526
4176
  ], ConsentHeadline.prototype, "eyebrow", 2);
4177
+ __decorateClass([
4178
+ n4({ type: Boolean, reflect: true })
4179
+ ], ConsentHeadline.prototype, "preview", 2);
4180
+ __decorateClass([
4181
+ n4({ type: Boolean, reflect: true })
4182
+ ], ConsentHeadline.prototype, "editable", 2);
4183
+ __decorateClass([
4184
+ n4({ attribute: false })
4185
+ ], ConsentHeadline.prototype, "editSource", 2);
4186
+ __decorateClass([
4187
+ r5()
4188
+ ], ConsentHeadline.prototype, "hostHeadline", 2);
3527
4189
  ConsentHeadline = __decorateClass([
3528
4190
  t3("consent-headline")
3529
4191
  ], ConsentHeadline);
@@ -3579,6 +4241,21 @@ function extractConditions(cedar) {
3579
4241
  }
3580
4242
 
3581
4243
  // src/components/consent-capability-card.ts
4244
+ var CAPABILITY_ROW_PARTS = [
4245
+ "row",
4246
+ "checkbox",
4247
+ "check",
4248
+ "icon",
4249
+ "body",
4250
+ "label-row",
4251
+ "label-text",
4252
+ "label",
4253
+ "description",
4254
+ "risk",
4255
+ "scopes",
4256
+ "scope",
4257
+ "policy"
4258
+ ];
3582
4259
  var ConsentCapabilityCard = class extends i4 {
3583
4260
  constructor() {
3584
4261
  super(...arguments);
@@ -3591,10 +4268,16 @@ var ConsentCapabilityCard = class extends i4 {
3591
4268
  this.disabled = false;
3592
4269
  this.scopes = [];
3593
4270
  this.compiledCedar = "";
4271
+ this.showIcon = false;
4272
+ this.preview = false;
4273
+ this.editable = false;
3594
4274
  this.policyOpen = false;
3595
4275
  }
4276
+ willUpdate() {
4277
+ warnIfEditableWithoutPreview(this);
4278
+ }
3596
4279
  toggleChecked() {
3597
- if (this.disabled) return;
4280
+ if (this.disabled || isEditing(this)) return;
3598
4281
  this.checked = !this.checked;
3599
4282
  const detail = {
3600
4283
  id: this.capabilityId,
@@ -3612,17 +4295,19 @@ var ConsentCapabilityCard = class extends i4 {
3612
4295
  * Row-level click handler. Makes the entire row a click target for
3613
4296
  * toggling the checkbox — a UX nicety that matches Plaid/Apple-style
3614
4297
  * consent rows. Skips when the user clicks the per-row "View policy"
3615
- * button, the policy disclosure, or any link inside the description, so
3616
- * those interactive children retain their own behavior.
4298
+ * button, the policy disclosure, any link inside the description, or
4299
+ * anything the host put in the `extra` slot, so those children retain their
4300
+ * own behavior.
3617
4301
  */
3618
4302
  onRowClick(event) {
3619
4303
  const target = event.target;
3620
4304
  if (!target) return;
4305
+ const extra = this.renderRoot.querySelector('slot[name="extra"]');
3621
4306
  const path = event.composedPath?.() || [];
3622
4307
  for (const node of path) {
3623
4308
  if (!(node instanceof HTMLElement)) continue;
3624
4309
  if (node === this) break;
3625
- if (node.classList?.contains("policy-toggle") || node.classList?.contains("policy-disclosure") || node.tagName === "A" || node.tagName === "BUTTON") {
4310
+ if (node === extra || node.classList?.contains("policy-toggle") || node.classList?.contains("policy-disclosure") || node.tagName === "A" || node.tagName === "BUTTON") {
3626
4311
  return;
3627
4312
  }
3628
4313
  }
@@ -3632,6 +4317,26 @@ var ConsentCapabilityCard = class extends i4 {
3632
4317
  event?.stopPropagation();
3633
4318
  this.policyOpen = !this.policyOpen;
3634
4319
  }
4320
+ /** The label, as a region in edit mode. */
4321
+ labelText() {
4322
+ if (!isEditing(this)) return this.label;
4323
+ return editRegion(
4324
+ CONSENT_EDIT_KEYS.capabilityLabel(this.capabilityId),
4325
+ CONSENT_COPY_TOKENS.editRegions.capabilityLabel,
4326
+ this.label,
4327
+ this.editSource
4328
+ );
4329
+ }
4330
+ /** The description, as a region in edit mode. */
4331
+ descriptionText() {
4332
+ if (!isEditing(this)) return this.description;
4333
+ return editRegion(
4334
+ CONSENT_EDIT_KEYS.capabilityDescription(this.capabilityId),
4335
+ CONSENT_COPY_TOKENS.editRegions.capabilityDescription,
4336
+ this.description,
4337
+ this.editSource
4338
+ );
4339
+ }
3635
4340
  isHigherRisk() {
3636
4341
  return this.riskLevel === "high" || this.riskLevel === "critical";
3637
4342
  }
@@ -3659,13 +4364,16 @@ var ConsentCapabilityCard = class extends i4 {
3659
4364
  }
3660
4365
  render() {
3661
4366
  const tokens = CONSENT_COPY_TOKENS.capabilityRow;
4367
+ const editing = isEditing(this);
3662
4368
  return b2`
3663
4369
  <div
3664
- class="row"
4370
+ class="row${editing ? " editing" : ""}"
3665
4371
  part="row"
3666
- role="button"
3667
- tabindex=${this.disabled ? "-1" : "0"}
3668
- aria-disabled=${String(this.disabled)}
4372
+ role=${editing ? A : "button"}
4373
+ aria-labelledby=${editing ? A : this.isHigherRisk() ? "label risk" : "label"}
4374
+ aria-describedby=${editing ? A : "description"}
4375
+ tabindex=${editing ? A : this.disabled ? "-1" : "0"}
4376
+ aria-disabled=${editing ? A : String(this.disabled)}
3669
4377
  @click=${this.onRowClick}
3670
4378
  @keydown=${(e10) => {
3671
4379
  if (e10.target === e10.currentTarget && (e10.key === " " || e10.key === "Enter")) {
@@ -3688,35 +4396,58 @@ var ConsentCapabilityCard = class extends i4 {
3688
4396
  type="button"
3689
4397
  tabindex="-1"
3690
4398
  >
3691
- ${this.checked ? b2`<span class="check-mark">✓</span>` : A}
4399
+ ${this.checked ? b2`<svg
4400
+ class="check-mark"
4401
+ part="check"
4402
+ viewBox="0 0 24 24"
4403
+ fill="none"
4404
+ stroke="currentColor"
4405
+ stroke-width="3"
4406
+ stroke-linecap="round"
4407
+ stroke-linejoin="round"
4408
+ aria-hidden="true"
4409
+ >
4410
+ <path d="M20 6 9 17l-5-5" />
4411
+ </svg>` : A}
3692
4412
  </button>
3693
- <div class="icon-tile" aria-hidden="true">${this.renderIcon()}</div>
3694
- <div class="body">
3695
- <div class="row-label">
3696
- <span
3697
- ><strong>${this.label}</strong>
3698
- <span class="description">${this.description}</span></span
4413
+ ${this.showIcon ? b2`<div class="icon-tile" part="icon" aria-hidden="true">
4414
+ ${this.renderIcon()}
4415
+ </div>` : A}
4416
+ <div class="body" part="body">
4417
+ <div class="row-label" part="label-row">
4418
+ <span class="label-text" part="label-text"
4419
+ ><strong id="label" part="label">${this.labelText()}</strong>
4420
+ <span id="description" class="description" part="description"
4421
+ >${this.descriptionText()}</span
4422
+ ></span
3699
4423
  >
3700
- ${this.isHigherRisk() ? b2`<span class="risk-chip">${tokens.higherRiskChip}</span>` : A}
4424
+ ${this.isHigherRisk() ? b2`<span id="risk" class="risk-chip" part="risk"
4425
+ >${tokens.higherRiskChip}</span
4426
+ >` : A}
3701
4427
  </div>
3702
- ${this.scopes.length > 0 ? b2`<ul class="scopes" aria-label="Scopes">${this.scopes.map(
4428
+ ${this.scopes.length > 0 ? b2`<ul class="scopes" part="scopes" aria-label="Scopes">
4429
+ ${this.scopes.map(
3703
4430
  (scope) => b2`<li><code part="scope">${scope}</code></li>`
3704
- )}</ul>` : A}
4431
+ )}
4432
+ </ul>` : A}
3705
4433
  ${this.compiledCedar.trim() ? b2`<button
3706
- class="policy-toggle"
3707
- type="button"
3708
- @click=${this.togglePolicy}
3709
- aria-expanded="${String(this.policyOpen)}"
3710
- >
3711
- ${tokens.viewPolicyLink}
3712
- </button>` : A}
4434
+ class="policy-toggle"
4435
+ type="button"
4436
+ @click=${this.togglePolicy}
4437
+ aria-expanded="${String(this.policyOpen)}"
4438
+ >
4439
+ ${tokens.viewPolicyLink}
4440
+ </button>` : A}
3713
4441
  ${this.renderPolicy()}
4442
+ <slot name="extra"></slot>
3714
4443
  </div>
3715
4444
  </div>
3716
4445
  `;
3717
4446
  }
3718
4447
  };
3719
4448
  ConsentCapabilityCard.styles = i`
4449
+ ${editRegionStyles}
4450
+
3720
4451
  :host {
3721
4452
  display: block;
3722
4453
  border-bottom: 1px solid var(--cs-surface-border, rgba(15, 23, 42, 0.08));
@@ -3728,7 +4459,7 @@ ConsentCapabilityCard.styles = i`
3728
4459
 
3729
4460
  .row {
3730
4461
  display: grid;
3731
- grid-template-columns: 22px 36px 1fr;
4462
+ grid-template-columns: 22px minmax(0, 1fr);
3732
4463
  gap: 14px;
3733
4464
  padding: 16px 0;
3734
4465
  align-items: flex-start;
@@ -3740,11 +4471,16 @@ ConsentCapabilityCard.styles = i`
3740
4471
  border-radius: 8px;
3741
4472
  }
3742
4473
 
4474
+ :host([show-icon]) .row {
4475
+ grid-template-columns: 22px 36px minmax(0, 1fr);
4476
+ }
4477
+
3743
4478
  .row:hover {
3744
4479
  background: var(--cs-row-hover-bg, rgba(15, 23, 42, 0.025));
3745
4480
  }
3746
4481
 
3747
- .row[aria-disabled="true"], .checkbox:disabled {
4482
+ .row[aria-disabled="true"],
4483
+ .checkbox:disabled {
3748
4484
  cursor: not-allowed;
3749
4485
  }
3750
4486
 
@@ -3760,6 +4496,19 @@ ConsentCapabilityCard.styles = i`
3760
4496
  overflow-wrap: anywhere;
3761
4497
  }
3762
4498
 
4499
+ .scopes code {
4500
+ display: inline-block;
4501
+ padding: 0 4px;
4502
+ border-radius: 4px;
4503
+ border: 1px solid
4504
+ var(--cs-scope-border, var(--cs-surface-border, rgba(15, 23, 42, 0.1)));
4505
+ background: var(
4506
+ --cs-scope-bg,
4507
+ color-mix(in srgb, var(--cs-text-primary, #0f172a) 4%, transparent)
4508
+ );
4509
+ color: var(--cs-text-primary, #0f172a);
4510
+ }
4511
+
3763
4512
  .checkbox {
3764
4513
  width: 22px;
3765
4514
  height: 22px;
@@ -3787,9 +4536,10 @@ ConsentCapabilityCard.styles = i`
3787
4536
  }
3788
4537
 
3789
4538
  .check-mark {
4539
+ display: block;
4540
+ width: 16px;
4541
+ height: 16px;
3790
4542
  color: var(--cs-surface-accent-text, #fff);
3791
- font-size: 14px;
3792
- line-height: 1;
3793
4543
  }
3794
4544
 
3795
4545
  .icon-tile {
@@ -3800,7 +4550,7 @@ ConsentCapabilityCard.styles = i`
3800
4550
  display: flex;
3801
4551
  align-items: center;
3802
4552
  justify-content: center;
3803
- color: var(--cs-text-secondary, #334155);
4553
+ color: var(--cs-icon, var(--cs-text-secondary, #334155));
3804
4554
  }
3805
4555
 
3806
4556
  .icon-tile svg {
@@ -3816,27 +4566,40 @@ ConsentCapabilityCard.styles = i`
3816
4566
  }
3817
4567
 
3818
4568
  .row-label {
3819
- display: flex;
4569
+ display: grid;
4570
+ grid-template-columns: minmax(0, 1fr) auto;
4571
+ grid-template-areas:
4572
+ "label risk"
4573
+ "description description";
4574
+ column-gap: 12px;
4575
+ row-gap: 0;
3820
4576
  align-items: center;
3821
- gap: 10px;
3822
- flex-wrap: wrap;
3823
4577
  font-size: 14.5px;
3824
4578
  color: var(--cs-text-primary, #0f172a);
3825
4579
  line-height: 1.45;
3826
4580
  }
3827
4581
 
4582
+ .label-text {
4583
+ display: contents;
4584
+ }
4585
+
3828
4586
  .row-label strong {
4587
+ grid-area: label;
3829
4588
  font-weight: 600;
3830
4589
  }
3831
4590
 
3832
4591
  .description {
4592
+ grid-area: description;
4593
+ font-size: 14px;
3833
4594
  color: var(--cs-text-secondary, #334155);
3834
4595
  }
3835
4596
 
3836
4597
  .risk-chip {
4598
+ grid-area: risk;
4599
+ justify-self: end;
3837
4600
  display: inline-flex;
3838
4601
  padding: 2px 8px;
3839
- border-radius: 999px;
4602
+ border-radius: 4px;
3840
4603
  font-size: 10.5px;
3841
4604
  font-weight: 700;
3842
4605
  letter-spacing: 0.06em;
@@ -3851,7 +4614,7 @@ ConsentCapabilityCard.styles = i`
3851
4614
  padding: 0;
3852
4615
  font-size: 12px;
3853
4616
  font-weight: 500;
3854
- color: var(--cs-text-tertiary, #64748b);
4617
+ color: var(--cs-text-tertiary, #5d6c82);
3855
4618
  text-decoration: underline;
3856
4619
  text-underline-offset: 2px;
3857
4620
  cursor: pointer;
@@ -3879,7 +4642,7 @@ ConsentCapabilityCard.styles = i`
3879
4642
  font-size: 11px;
3880
4643
  letter-spacing: 0.08em;
3881
4644
  text-transform: uppercase;
3882
- color: var(--cs-text-tertiary, #64748b);
4645
+ color: var(--cs-text-tertiary, #5d6c82);
3883
4646
  }
3884
4647
 
3885
4648
  .policy-disclosure pre {
@@ -3896,6 +4659,16 @@ ConsentCapabilityCard.styles = i`
3896
4659
  margin: 0;
3897
4660
  padding-left: 18px;
3898
4661
  }
4662
+
4663
+ /* In edit mode the row is not a toggle, so it does not look like one. */
4664
+ .row.editing,
4665
+ .row.editing .checkbox {
4666
+ cursor: default;
4667
+ }
4668
+
4669
+ .row.editing:hover {
4670
+ background: transparent;
4671
+ }
3899
4672
  `;
3900
4673
  __decorateClass([
3901
4674
  n4({ type: String })
@@ -3924,6 +4697,18 @@ __decorateClass([
3924
4697
  __decorateClass([
3925
4698
  n4({ type: String, attribute: "compiled-cedar" })
3926
4699
  ], ConsentCapabilityCard.prototype, "compiledCedar", 2);
4700
+ __decorateClass([
4701
+ n4({ type: Boolean, reflect: true, attribute: "show-icon" })
4702
+ ], ConsentCapabilityCard.prototype, "showIcon", 2);
4703
+ __decorateClass([
4704
+ n4({ type: Boolean, reflect: true })
4705
+ ], ConsentCapabilityCard.prototype, "preview", 2);
4706
+ __decorateClass([
4707
+ n4({ type: Boolean, reflect: true })
4708
+ ], ConsentCapabilityCard.prototype, "editable", 2);
4709
+ __decorateClass([
4710
+ n4({ attribute: false })
4711
+ ], ConsentCapabilityCard.prototype, "editSource", 2);
3927
4712
  __decorateClass([
3928
4713
  r5()
3929
4714
  ], ConsentCapabilityCard.prototype, "policyOpen", 2);
@@ -4138,15 +4923,20 @@ var ConsentActionBar = class extends i4 {
4138
4923
  this.cancelLabel = "";
4139
4924
  this.submitIcon = "";
4140
4925
  this.loadingLabel = "";
4926
+ this.preview = false;
4927
+ this.editable = false;
4928
+ }
4929
+ willUpdate() {
4930
+ warnIfEditableWithoutPreview(this);
4141
4931
  }
4142
4932
  emitAllow() {
4143
- if (this.disabled || this.loading) return;
4933
+ if (this.disabled || this.loading || this.preview) return;
4144
4934
  this.dispatchEvent(
4145
4935
  new CustomEvent("consent-allow", { bubbles: true, composed: true })
4146
4936
  );
4147
4937
  }
4148
4938
  emitDeny() {
4149
- if (this.loading) return;
4939
+ if (this.loading || this.preview) return;
4150
4940
  this.dispatchEvent(
4151
4941
  new CustomEvent("consent-deny", { bubbles: true, composed: true })
4152
4942
  );
@@ -4157,30 +4947,19 @@ var ConsentActionBar = class extends i4 {
4157
4947
  })} \u2192`);
4158
4948
  const submitLabel = this.loading && this.loadingLabel ? this.loadingLabel : allowLabel;
4159
4949
  const denyLabel = this.cancelLabel || (this.theme === "dark" ? CONSENT_COPY_TOKENS.actions.deny : CONSENT_COPY_TOKENS.actions.notNow);
4950
+ if (isEditing(this)) return this.renderBoxes(allowLabel, denyLabel);
4160
4951
  return b2`
4161
4952
  <button
4162
- class="primary"
4953
+ class="action primary"
4163
4954
  part="submit"
4164
4955
  type="button"
4165
4956
  ?disabled=${this.disabled || this.loading}
4166
4957
  @click=${this.emitAllow}
4167
4958
  >
4168
- ${this.submitIcon === "passkey" ? b2`<svg
4169
- part="submit-icon"
4170
- class="submit-icon"
4171
- viewBox="0 0 24 24"
4172
- fill="none"
4173
- stroke="currentColor"
4174
- stroke-width="2"
4175
- stroke-linecap="round"
4176
- stroke-linejoin="round"
4177
- aria-hidden="true"
4178
- >
4179
- ${fingerprintIcon}
4180
- </svg>` : A}${submitLabel}
4959
+ ${this.renderSubmitIcon()}${submitLabel}
4181
4960
  </button>
4182
4961
  <button
4183
- class="secondary"
4962
+ class="action secondary"
4184
4963
  part="cancel"
4185
4964
  type="button"
4186
4965
  ?disabled=${this.loading}
@@ -4190,8 +4969,57 @@ var ConsentActionBar = class extends i4 {
4190
4969
  </button>
4191
4970
  `;
4192
4971
  }
4972
+ /**
4973
+ * Edit mode: the buttons as boxes with the same classes and parts, each
4974
+ * label a region. A disabled Allow looks disabled, as it would live.
4975
+ */
4976
+ renderBoxes(allowLabel, denyLabel) {
4977
+ const tokens = CONSENT_COPY_TOKENS.editRegions;
4978
+ return b2`
4979
+ <div
4980
+ class="action primary${this.disabled || this.loading ? " disabled" : ""}"
4981
+ part="submit"
4982
+ >
4983
+ ${this.renderSubmitIcon()}${editRegion(
4984
+ CONSENT_EDIT_KEYS.submitLabel,
4985
+ tokens.submitLabel,
4986
+ allowLabel,
4987
+ this.editSource
4988
+ )}
4989
+ </div>
4990
+ <div
4991
+ class="action secondary${this.loading ? " disabled" : ""}"
4992
+ part="cancel"
4993
+ >
4994
+ ${editRegion(
4995
+ CONSENT_EDIT_KEYS.cancelLabel,
4996
+ tokens.cancelLabel,
4997
+ denyLabel,
4998
+ this.editSource
4999
+ )}
5000
+ </div>
5001
+ `;
5002
+ }
5003
+ renderSubmitIcon() {
5004
+ if (this.submitIcon !== "passkey") return A;
5005
+ return b2`<svg
5006
+ part="submit-icon"
5007
+ class="submit-icon"
5008
+ viewBox="0 0 24 24"
5009
+ fill="none"
5010
+ stroke="currentColor"
5011
+ stroke-width="2"
5012
+ stroke-linecap="round"
5013
+ stroke-linejoin="round"
5014
+ aria-hidden="true"
5015
+ >
5016
+ ${fingerprintIcon}
5017
+ </svg>`;
5018
+ }
4193
5019
  };
4194
5020
  ConsentActionBar.styles = i`
5021
+ ${editRegionStyles}
5022
+
4195
5023
  :host {
4196
5024
  display: flex;
4197
5025
  flex-direction: column;
@@ -4199,13 +5027,25 @@ ConsentActionBar.styles = i`
4199
5027
  width: 100%;
4200
5028
  }
4201
5029
 
4202
- button {
5030
+ /* A button, or in edit mode a box, set out in full so both draw alike. */
5031
+ .action {
5032
+ box-sizing: border-box;
5033
+ display: block;
4203
5034
  width: 100%;
5035
+ margin: 0;
4204
5036
  padding: 14px 18px;
4205
- border-radius: var(--cs-action-radius, 999px);
5037
+ border-radius: var(--cs-action-radius, 6px);
4206
5038
  font-size: var(--cs-action-font-size, 15px);
4207
5039
  font-weight: 500;
4208
5040
  font-family: inherit;
5041
+ font-style: normal;
5042
+ line-height: normal;
5043
+ letter-spacing: normal;
5044
+ word-spacing: normal;
5045
+ text-align: center;
5046
+ text-indent: 0;
5047
+ text-transform: none;
5048
+ text-shadow: none;
4209
5049
  cursor: pointer;
4210
5050
  transition:
4211
5051
  opacity 0.15s ease,
@@ -4213,11 +5053,17 @@ ConsentActionBar.styles = i`
4213
5053
  border: none;
4214
5054
  }
4215
5055
 
4216
- button:disabled {
5056
+ .action:disabled,
5057
+ .action.disabled {
4217
5058
  opacity: 0.5;
4218
5059
  cursor: not-allowed;
4219
5060
  }
4220
5061
 
5062
+ div.action,
5063
+ div.action.disabled {
5064
+ cursor: default;
5065
+ }
5066
+
4221
5067
  button:focus-visible {
4222
5068
  outline: 2px solid var(--cs-focus-ring, #0f172a);
4223
5069
  outline-offset: 3px;
@@ -4233,7 +5079,7 @@ ConsentActionBar.styles = i`
4233
5079
  color: var(--cs-surface-accent-text, #ffffff);
4234
5080
  }
4235
5081
 
4236
- .primary:hover:not(:disabled) {
5082
+ button.primary:hover:not(:disabled) {
4237
5083
  opacity: 0.92;
4238
5084
  }
4239
5085
 
@@ -4250,7 +5096,7 @@ ConsentActionBar.styles = i`
4250
5096
  font-weight: 500;
4251
5097
  }
4252
5098
 
4253
- .secondary:hover:not(:disabled) {
5099
+ button.secondary:hover:not(:disabled) {
4254
5100
  color: var(--cs-text-primary, #0f172a);
4255
5101
  }
4256
5102
  `;
@@ -4278,6 +5124,15 @@ __decorateClass([
4278
5124
  __decorateClass([
4279
5125
  n4({ type: String, attribute: "loading-label" })
4280
5126
  ], ConsentActionBar.prototype, "loadingLabel", 2);
5127
+ __decorateClass([
5128
+ n4({ type: Boolean, reflect: true })
5129
+ ], ConsentActionBar.prototype, "preview", 2);
5130
+ __decorateClass([
5131
+ n4({ type: Boolean, reflect: true })
5132
+ ], ConsentActionBar.prototype, "editable", 2);
5133
+ __decorateClass([
5134
+ n4({ attribute: false })
5135
+ ], ConsentActionBar.prototype, "editSource", 2);
4281
5136
  ConsentActionBar = __decorateClass([
4282
5137
  t3("consent-action-bar")
4283
5138
  ], ConsentActionBar);
@@ -4285,12 +5140,12 @@ ConsentActionBar = __decorateClass([
4285
5140
  // src/components/consent-footer.ts
4286
5141
  var ConsentFooter = class extends i4 {
4287
5142
  constructor() {
4288
- super(...arguments);
4289
- this.theme = "light";
5143
+ super();
4290
5144
  this.howItWorksUrl = "";
5145
+ this.preview = false;
5146
+ guardPreviewNavigation(this);
4291
5147
  }
4292
5148
  render() {
4293
- const attribution = this.theme === "dark" ? CONSENT_COPY_TOKENS.attribution.securedBy : CONSENT_COPY_TOKENS.attribution.protectedBy;
4294
5149
  return b2`
4295
5150
  <span class="left">
4296
5151
  <svg
@@ -4305,7 +5160,7 @@ var ConsentFooter = class extends i4 {
4305
5160
  >
4306
5161
  <path d="m3.5 8.5 3 3 6-6.5" />
4307
5162
  </svg>
4308
- ${attribution}
5163
+ ${CONSENT_COPY_TOKENS.attribution.byLine}
4309
5164
  </span>
4310
5165
  ${sanitizeLinkUrl(this.howItWorksUrl) ? b2`<a
4311
5166
  class="how"
@@ -4331,7 +5186,7 @@ ConsentFooter.styles = i`
4331
5186
  gap: 6px 16px;
4332
5187
  padding-top: 12px;
4333
5188
  font-size: 12px;
4334
- color: var(--cs-text-tertiary, #64748b);
5189
+ color: var(--cs-text-tertiary, #5d6c82);
4335
5190
  border-top: 1px solid var(--cs-surface-border, transparent);
4336
5191
  }
4337
5192
 
@@ -4362,16 +5217,96 @@ ConsentFooter.styles = i`
4362
5217
  color: var(--cs-text-primary, #0f172a);
4363
5218
  }
4364
5219
  `;
4365
- __decorateClass([
4366
- n4({ type: String })
4367
- ], ConsentFooter.prototype, "theme", 2);
4368
5220
  __decorateClass([
4369
5221
  n4({ type: String })
4370
5222
  ], ConsentFooter.prototype, "howItWorksUrl", 2);
5223
+ __decorateClass([
5224
+ n4({ type: Boolean, reflect: true })
5225
+ ], ConsentFooter.prototype, "preview", 2);
4371
5226
  ConsentFooter = __decorateClass([
4372
5227
  t3("consent-footer")
4373
5228
  ], ConsentFooter);
4374
5229
 
5230
+ // src/components/consent-secured-by.ts
5231
+ var ARTWORK_WIDTH = 676.3;
5232
+ var ARTWORK_HEIGHT = 272.2;
5233
+ var LOCKUP_HEIGHT = 40;
5234
+ var LETTER_BASELINE = 141;
5235
+ var TAGLINE_LEFT = 252;
5236
+ var LOCKUP_ART = w`<g><path opacity=".4" d="M175.7,252.4c-3.2-5.6-6.4-11.1-9.6-16.7-1.7-3.1-3.3-6.3-5.1-9.4-3.9-6.8-7.8-13.7-11.7-20.5-2.6-4.7-5.3-9.4-7.9-14.1-.2-.3-.4-.5-.7-.9-.2.2-.4.4-.4.5-4.1,7.2-8.2,14.3-12.3,21.4-5,8.6-9.9,17.2-14.8,25.8-4.4,7.8-8.9,15.5-13.3,23.3-2,3.4-3.9,6.9-5.9,10.4h28.8-.2c5.6-9.9,11.3-19.7,16.9-29.6.3-.4.5-.7.9-1.2h0c.3.5.6.8.8,1.1,2.1,3.8,4.2,7.7,6.3,11.5,3.4,6,6.8,12,10.1,18.1h28.9l-5.6-9.9c-1.8-3.2-3.6-6.5-5.4-9.7h.2Z" /><path opacity=".6" d="M86.1,189.9H16l14.3,24.7c11.8,0,23.6-.1,35.5-.2.4,0,.8,0,1.4.2,0,.1,0,.2,0,.3h.2c-.3.5-.4.9-.6,1.2h0c-2.3,3.7-4.6,7.4-6.8,11.2-3.8,6.3-7.5,12.7-11.3,19l-.2-.3h0l14.6,25.1,6.6-11h0l.2.2c1.9-3.2,3.8-6.4,5.7-9.6,3.3-5.5,6.4-11.1,9.7-16.7,1.8-3.1,3.8-6.1,5.6-9.2,4-6.8,7.9-13.6,11.9-20.4,2.7-4.6,5.5-9.3,8.2-13.9l.3-.6h-25.2,0Z" /><path opacity=".8" d="M85,142.3c-5-8.6-9.9-17.1-14.9-25.7-4.5-7.8-9-15.5-13.5-23.2-2.8-4.8-5.6-9.6-8.4-14.4v-.2q0,0,0,0l-14.5,25.3c0,.2.2.4.4.6,6.3,10.8,12.6,21.7,19,32.5.2.4.3.8.6,1.3h-1.4c-4.3,0-8.4-.2-12.7-.3h-1.4c-7.3,0-14.7-.2-22-.3h-1.9L0,162.7l.3.4,15.1.2h0c3.7,0,7.4.1,11.2.2h19.3c3.6,0,7.2.2,10.8.3,7.9,0,15.7,0,23.6.1,5.4,0,10.8,0,16.2.2h.9c0-.2,0-.3,0-.4-4.2-7.1-8.3-14.2-12.4-21.3h0Z" /><path opacity=".2" d="M238.1,166.4c-3.8-.2-7.5-.2-11.2-.2h-19.3c-3.6-.1-7.2-.3-10.8-.3h-23.6c-5.4,0-10.8-.2-16.2-.2s-.7,0-1.1,0v.4c4.1,7.1,8.2,14.2,12.4,21.3,5,8.6,9.9,17.1,14.9,25.7,4.5,7.7,9,15.5,13.5,23.2,2.3,4,4.6,8,7,12l14.5-25.3c-6-10.2-11.9-20.4-17.9-30.6-.2-.4-.4-.8-.6-1.3.6,0,.9-.1,1.3-.1s.2,0,.3,0h.2c4.2,0,8.3.2,12.5.3h.5c7.2,0,14.5.2,21.8.2l14.2-24.8-12.3-.2h-.1,0Z" /></g><path d="M676.4,36.5c0-.8,0-1.2-1.1-1.2h-18.8c-6.3,0-1.2.2-1.2,1.2v31.6c0,9.7-.2.6-.2,1h0c-.5-.5-.9-.7-1.2-1-2.6-2.4-5.6-4.2-8.8-5.5-6.8-2.7-13.8-2.8-20.9-1.5-10.2,1.9-18.1,7.5-23.5,16.4-5.7,9.2-7.3,19.3-5.9,30,.6,5,1.9,9.8,4.4,14.3,2.9,5.1,6.4,9.7,11.3,13.2,5,3.5,10.6,5.4,16.5,6.3,4.1.6,8.2.5,12.2-.3,6.6-1.2,12.3-4.1,16.7-9.3.2-.4.5-.7.8-1,.2.4.2.7.2,1.1v7c0,.7.2,1,1,1h17.5c.8,0,.9-.3.9-1.1-.2-1.5-.2-3-.2-4.5V40.3c0-1.3.2-2.5.2-3.8h0ZM651.1,114.9c-4.5,5.5-10.4,7.9-17.5,7.1-9.6-1.1-16.6-8.8-17.6-18.7-.4-4.6.3-8.9,2.2-12.9,2.8-5.8,7.5-9.4,13.8-10.6,7.3-1.4,13.7.6,18.6,6.3,3.6,4.1,5,9.2,5,13.1,0,6.8-1.2,11.6-4.5,15.7Z" /><path d="M477.7,63.2c-6.1-3.1-12.5-3.4-19.1-2.5-5.7.8-10.8,3.2-15.1,7.1-.2,0-.4.3-.6.4h0c0,0-.3,0-.3,0v-32c0-.6-.2-.9-.9-.9h-19.4c-.8,0-1.1.3-1.1,1.1v102.4c0,.8,0,1.1,1,1.1h19.4c.7,0,1,0,1-.9v-43.3c0-1.7.2-3.5.6-5.2,2.8-11,15.5-13.7,23-8,3.9,2.9,5.4,7.2,5.4,12v44.2c0,.9.2,1.2,1.2,1.2h19.1c.8,0,1.1-.2,1.1-1v-45.2c0-4.6-.4-9.2-1.7-13.7-2.2-7.6-6.7-13.1-13.7-16.7h.1Z" /><path d="M561.6,63.2c-7.5-3.4-15.4-3.9-23.4-2.5-12.8,2.3-22.4,9.2-28.5,20.8-4.1,7.7-5.4,15.9-4.3,24.5.8,6,2.5,11.6,6,16.7,4.8,7,11,12.1,18.8,15.4,3.1,1.4,6.3,2,9.6,2.6,4.8.9,9.6.9,14.4.3,9.1-1.2,17-4.9,24-10.6.5-.4.6-.8.2-1.4-2.7-4.3-5.4-8.7-8-13.1-.4-.6-.6-.7-1.2-.2-2.9,2.3-6.1,4.1-9.5,5.5-5.1,2.1-10.3,2.3-15.7,1.7-3.1-.3-6-1.2-8.7-2.9-3.1-2-5.6-4.6-7.2-7.9-.6-1.3-1-2.6-1.6-4.1v-.2h53.4c.6,0,1.2,0,1.2-.8.4-3.3,1.1-6.5,1.1-9.8s-.3-6.2-.9-9.3c-2.2-11.7-9.1-19.8-19.7-24.7h0ZM559.8,92.9h-33.3v-.6c1.8-5.1,4.3-9.7,9.3-12.5,3.7-2.1,7.7-2.8,11.9-2.2,2.9.4,5.6,1.5,8,3.3,3.3,2.6,5.2,6.1,5.7,10.2.3,1.8.2,1.8-1.6,1.8h0Z" /><path d="M322.4,63c0-.9-.2-1.2-1.1-1.2-6.3,0-12.5,0-18.8,0s-1.3,0-1.3,1.3v44.3c0,4-1.3,7.7-4.3,10.4-4.8,4.5-10.4,5.2-16.4,2.7-5-2.1-8.2-7.4-8.2-13.2v-44.2c0-1.4,4.8-1.4-1.5-1.4h-19.1c-.7,0-.9.3-.9,1v41c0,3.4.3,6.8.9,10.1.4,2.6,1.3,5.1,2.4,7.5,4.2,9.4,11.4,15.5,21.2,18.5,8.1,2.5,16.3,2.4,24.3-.3,6.6-2.2,12-6,16.1-11.6,4.6-6.4,6.8-13.6,6.8-21.4v-20.7h0v-22.9h-.1Z" /><path d="M409.3,78c-3.9-6.5-9.4-11.4-16.3-14.5-9.1-4.1-18.5-4.5-28-2.1-11.2,2.8-19.8,9.3-25.5,19.4-2.8,5-4.3,10.4-4.8,16.1-.6,6-.1,12,2.1,17.6,3,7.7,7.6,14.1,14.5,18.9,3.7,2.7,7.8,4.8,12.2,6.1,5.6,1.7,11.2,2.2,17,1.6,7.1-.6,13.5-3,19.2-7.2,3.9-2.9,7.1-6.5,9.6-10.7.5-.8.5-1.4-.4-2-2.4-1.7-4.7-3.5-7-5.3-2-1.6-4-3.2-6-4.8-.4-.4-.9-.6-1.3,0-1.6,2.7-3.8,4.9-6.4,6.7-4.4,3.1-9,4.6-14.4,3.8-4.4-.7-8.3-2.3-11.4-5.5-6.1-6.3-7.5-13.8-5.3-22.1,3.3-12.1,16.2-17.3,26.8-13.1,3.7,1.5,6.5,4.1,9,7.1.7.9,1.4,1.9,2.2,2.9v-.2c4.7-3.6,9.2-7.2,13.8-10.7,1.1-.9,1.2-.9.4-2.1h0Z" /><path d="M237.5,89.5c-1.7-5.8-4.3-11.2-8.5-15.5-8.5-8.8-18.8-13.6-31.2-13.6s-6.5.3-9.6.9c-3.4.7-6.7,1.8-9.8,3.3-6.1,2.9-11.2,7.1-15.1,12.6-6.2,8.8-8.4,18.7-7,29.4.3,2.2.8,4.3,1.4,6.4.7,2.2,1.5,4.3,2.6,6.4,1.3,2.4,2.9,4.7,4.6,6.8,6,7.3,13.3,11.8,21.8,13.9,3.3.8,6.8,1.2,10.5,1.3v.2c4.2,0,8.2-.4,12.2-1.6,1.5-.4,3-1,4.5-1.6,13.4-5.7,21.6-15.7,24.5-29.9,1.3-6.4,1-12.7-.9-19ZM217.1,104.3c-.5,3.5-1.7,6.7-3.8,9.5-3.9,5.2-9.2,7.6-14.1,8-11.5,0-19.8-7-21.5-17-.8-4.8-.3-9.5,1.8-13.9,2.8-5.9,7.5-9.7,14-10.9,8.5-1.7,16.5,2,20.9,9.4,2.7,4.6,3.5,9.6,2.7,14.9h0Z" /><path d="M64,52.7l8.3,14.9c1.8,3.2,3.6,6.5,5.4,9.8,3.2,5.6,6.4,11.1,9.6,16.7,1.8,3.1,3.4,6.3,5.2,9.4,3.9,6.8,7.8,13.7,11.7,20.5,2.7,4.7,5.3,9.4,7.9,14.1.2.3.4.6.7.9.2-.3.3-.4.4-.5,4.1-7.1,8.2-14.2,12.3-21.3,4.9-8.6,9.9-17.2,14.8-25.8,4.4-7.8,8.9-15.5,13.3-23.3,4.4-7.8,8.9-15.5,13.3-23.3,1.9-3.4,3.8-6.9,5.7-10.3,3.6-6.2,7.3-12.5,10.9-18.7,2.9-5,5.6-10.1,8.5-15.1.2-.3.3-.6.3-.8h-28.9s0,.1-.1.2h0c-.8,1.4-1.6,2.8-2.4,4.1-.8,1.4-1.6,2.8-2.5,4.3-1.5,2.5-2.9,5.1-4.4,7.6-1,1.7-2,3.5-3,5.2-6.3,10.9-12.4,21.9-18.7,32.9v.2c-6.2,10.9-12.4,21.8-18.7,32.7-.2.4-.5.7-.8,1.2-.3-.5-.6-.8-.8-1.1-2.1-3.8-4.2-7.7-6.3-11.5-3.8-6.8-7.6-13.6-11.4-20.4h0l-1.2-2.3v-.2h-29.1Z" />`;
5237
+ var ConsentSecuredBy = class extends i4 {
5238
+ render() {
5239
+ const copy = CONSENT_COPY_TOKENS.attribution;
5240
+ return b2`<p class="secured-by" part="secured-by">
5241
+ <span class="label">${copy.securedBy}</span
5242
+ ><span class="lockup"
5243
+ ><svg
5244
+ part="lockup"
5245
+ viewBox="0 0 ${ARTWORK_WIDTH} ${ARTWORK_HEIGHT}"
5246
+ role="img"
5247
+ aria-label=${copy.lockup}
5248
+ >
5249
+ ${LOCKUP_ART}</svg
5250
+ ><span class="tagline" part="tagline">${copy.tagline}</span></span
5251
+ >
5252
+ </p>`;
5253
+ }
5254
+ };
5255
+ ConsentSecuredBy.styles = i`
5256
+ :host {
5257
+ display: block;
5258
+ }
5259
+
5260
+ .secured-by {
5261
+ display: flex;
5262
+ align-items: flex-start;
5263
+ justify-content: center;
5264
+ gap: 6px;
5265
+ margin: 0;
5266
+ font-size: 12px;
5267
+ line-height: 16px;
5268
+ color: var(--cs-text-tertiary, #5d6c82);
5269
+ }
5270
+
5271
+ /* Drops "Secured by" onto the baseline of the lockup's letters. */
5272
+ .label {
5273
+ margin-top: calc(
5274
+ ${LOCKUP_HEIGHT}px * ${LETTER_BASELINE} / ${ARTWORK_HEIGHT} - 0.5lh -
5275
+ 0.375em
5276
+ );
5277
+ }
5278
+
5279
+ .lockup {
5280
+ display: grid;
5281
+ }
5282
+
5283
+ .lockup > * {
5284
+ grid-area: 1 / 1;
5285
+ }
5286
+
5287
+ .lockup svg {
5288
+ display: block;
5289
+ height: ${LOCKUP_HEIGHT}px;
5290
+ width: ${Math.round(ARTWORK_WIDTH * LOCKUP_HEIGHT / ARTWORK_HEIGHT)}px;
5291
+ fill: var(--cs-lockup, #0810fe);
5292
+ }
5293
+
5294
+ .tagline {
5295
+ align-self: end;
5296
+ margin-left: ${Math.round(
5297
+ TAGLINE_LEFT * LOCKUP_HEIGHT / ARTWORK_HEIGHT
5298
+ )}px;
5299
+ white-space: nowrap;
5300
+ font-size: 12px;
5301
+ font-weight: 600;
5302
+ line-height: 1;
5303
+ color: var(--cs-text-tertiary, #5d6c82);
5304
+ }
5305
+ `;
5306
+ ConsentSecuredBy = __decorateClass([
5307
+ t3("consent-secured-by")
5308
+ ], ConsentSecuredBy);
5309
+
4375
5310
  // src/components/consent-revocation-notice.ts
4376
5311
  var ConsentRevocationNotice = class extends i4 {
4377
5312
  constructor() {
@@ -4438,7 +5373,7 @@ ConsentRevocationNotice.styles = i`
4438
5373
  height: 16px;
4439
5374
  flex-shrink: 0;
4440
5375
  margin-top: 2px;
4441
- color: var(--cs-text-tertiary, #64748b);
5376
+ color: var(--cs-icon, var(--cs-text-tertiary, #5d6c82));
4442
5377
  }
4443
5378
 
4444
5379
  .content {
@@ -4473,6 +5408,30 @@ ConsentRevocationNotice = __decorateClass([
4473
5408
  ], ConsentRevocationNotice);
4474
5409
 
4475
5410
  // src/components/consent-connector-header.ts
5411
+ var SHIELD_CHECK = b2`<svg
5412
+ viewBox="0 0 24 24"
5413
+ fill="none"
5414
+ stroke="currentColor"
5415
+ stroke-width="2"
5416
+ stroke-linecap="round"
5417
+ stroke-linejoin="round"
5418
+ >
5419
+ <path
5420
+ d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"
5421
+ />
5422
+ <path d="m9 12 2 2 4-4" />
5423
+ </svg>`;
5424
+ var DOTS_SHIELD = b2`<svg
5425
+ viewBox="0 0 24 24"
5426
+ fill="none"
5427
+ stroke="currentColor"
5428
+ stroke-width="2.2"
5429
+ stroke-linecap="round"
5430
+ stroke-linejoin="round"
5431
+ >
5432
+ <path d="M12 3l8 3v5c0 4.5-3.5 8.5-8 10-4.5-1.5-8-5.5-8-10V6l8-3z" />
5433
+ <path d="m9 12 2 2 4-4" />
5434
+ </svg>`;
4476
5435
  var ConsentConnectorHeader = class extends i4 {
4477
5436
  constructor() {
4478
5437
  super(...arguments);
@@ -4483,9 +5442,20 @@ var ConsentConnectorHeader = class extends i4 {
4483
5442
  this.serverDomain = "";
4484
5443
  this.serverLogoUrl = "";
4485
5444
  this.logoDevToken = "";
5445
+ this.variant = "bridge";
5446
+ this.via = "";
4486
5447
  this.clientImageOk = true;
4487
5448
  this.serverImageOk = true;
4488
5449
  }
5450
+ /** A logo that failed is tried again when its URL changes. */
5451
+ willUpdate(changed) {
5452
+ if (changed.has("clientLogoUrl") || changed.has("clientDid")) {
5453
+ this.clientImageOk = true;
5454
+ }
5455
+ if (changed.has("serverLogoUrl") || changed.has("serverDomain") || changed.has("logoDevToken")) {
5456
+ this.serverImageOk = true;
5457
+ }
5458
+ }
4489
5459
  /**
4490
5460
  * Derive a logo URL for an agent DID via KTA hosting convention.
4491
5461
  * `did:web:knowthat.ai:agents:claude` → `https://knowthat.ai/img/agents/claude.png`
@@ -4517,37 +5487,57 @@ var ConsentConnectorHeader = class extends i4 {
4517
5487
  return this.logoDevLogo(this.serverDomain);
4518
5488
  }
4519
5489
  monogram(name) {
4520
- return (name || "?").trim().charAt(0).toUpperCase();
5490
+ return (name.trim().charAt(0) || "?").toUpperCase();
5491
+ }
5492
+ /** What a screen reader hears in place of the picture. */
5493
+ description() {
5494
+ const client = this.clientName.trim() || "An agent";
5495
+ const server = this.serverName.trim() || "this site";
5496
+ const via = this.via.trim();
5497
+ return `${client} is connecting to ${server}${via ? ` via ${via}` : ""}`;
5498
+ }
5499
+ renderBridge() {
5500
+ const title = this.via.trim() ? `Protected by ${this.via.trim()}` : A;
5501
+ if (this.variant === "bridge") {
5502
+ return b2`<div class="bridge" aria-hidden="true">
5503
+ <span class="dash"></span>
5504
+ <span class="shield" title=${title}>${SHIELD_CHECK}</span>
5505
+ <span class="dash"></span>
5506
+ </div>`;
5507
+ }
5508
+ return b2`<div class="bridge" aria-hidden="true">
5509
+ <span class="dots"><span></span><span></span><span></span></span>
5510
+ <span class="shield" title=${title}>${DOTS_SHIELD}</span>
5511
+ <span class="dots"><span></span><span></span><span></span></span>
5512
+ </div>`;
4521
5513
  }
4522
5514
  render() {
4523
5515
  const clientLogo = this.resolveClientLogo();
4524
- const serverLogo = this.resolveServerLogo();
5516
+ const serverLogo = this.serverImageOk ? this.resolveServerLogo() : void 0;
4525
5517
  return b2`
4526
5518
  <div class="tile client" aria-hidden="true">
4527
5519
  ${clientLogo && this.clientImageOk ? b2`<img
4528
5520
  src="${clientLogo}"
4529
5521
  alt=""
4530
5522
  @error=${() => this.clientImageOk = false}
4531
- />` : b2`<span class="monogram">${this.monogram(this.clientName)}</span>`}
5523
+ />` : b2`<span class="monogram"
5524
+ >${this.monogram(this.clientName)}</span
5525
+ >`}
4532
5526
  </div>
4533
- <div class="bridge" aria-hidden="true">
4534
- <span class="dots"><span></span><span></span><span></span></span>
4535
- <span class="shield" title="Protected by Checkpoint">
4536
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
4537
- <path d="M12 3l8 3v5c0 4.5-3.5 8.5-8 10-4.5-1.5-8-5.5-8-10V6l8-3z" />
4538
- <path d="m9 12 2 2 4-4" />
4539
- </svg>
4540
- </span>
4541
- <span class="dots"><span></span><span></span><span></span></span>
4542
- </div>
4543
- <div class="tile server" aria-hidden="true">
4544
- ${serverLogo && this.serverImageOk ? b2`<img
5527
+ ${this.renderBridge()}
5528
+ <div
5529
+ class="tile server ${serverLogo ? "has-logo" : ""}"
5530
+ aria-hidden="true"
5531
+ >
5532
+ ${serverLogo ? b2`<img
4545
5533
  src="${serverLogo}"
4546
5534
  alt=""
4547
5535
  @error=${() => this.serverImageOk = false}
4548
- />` : b2`<span class="monogram">${this.monogram(this.serverName)}</span>`}
5536
+ />` : b2`<span class="monogram"
5537
+ >${this.monogram(this.serverName)}</span
5538
+ >`}
4549
5539
  </div>
4550
- <span style="position:absolute;left:-9999px">${this.clientName || ""} connecting to ${this.serverName || ""} via Checkpoint</span>
5540
+ <span class="visually-hidden">${this.description()}</span>
4551
5541
  `;
4552
5542
  }
4553
5543
  };
@@ -4560,10 +5550,16 @@ ConsentConnectorHeader.styles = i`
4560
5550
  padding: 22px 0 4px;
4561
5551
  }
4562
5552
 
5553
+ :host([variant="bridge"]) {
5554
+ gap: 8px;
5555
+ padding: 20px 0 14px;
5556
+ }
5557
+
4563
5558
  .tile {
4564
- width: 56px;
5559
+ box-sizing: border-box;
4565
5560
  height: 56px;
4566
- border-radius: 14px;
5561
+ min-width: 56px;
5562
+ border-radius: var(--cs-tile-radius, 14px);
4567
5563
  overflow: hidden;
4568
5564
  display: flex;
4569
5565
  align-items: center;
@@ -4573,30 +5569,46 @@ ConsentConnectorHeader.styles = i`
4573
5569
  border: 1px solid var(--cs-surface-border, rgba(15, 23, 42, 0.08));
4574
5570
  }
4575
5571
 
4576
- /* Agent tile: white with a light border in every theme. border-box keeps
4577
- it 56px outside; the shared .tile (server) box is left unchanged. */
5572
+ /* The agent's tile is white with a light border in every theme. */
4578
5573
  .tile.client {
4579
- box-sizing: border-box;
4580
- background: var(--cs-agent-tile-bg, #FFFFFF);
5574
+ width: 56px;
5575
+ background: var(--cs-agent-tile-bg, #ffffff);
4581
5576
  border: 1px solid var(--cs-agent-tile-border, rgba(15, 23, 42, 0.08));
4582
5577
  }
4583
5578
 
4584
- .tile img {
4585
- width: 100%;
4586
- height: 100%;
4587
- object-fit: cover;
4588
- }
4589
-
4590
- /* Agent marks are contained, not cropped: 36px leaves a 10px inset inside
4591
- the centred 56px tile, so non-square logos keep their full shape. */
5579
+ /* Marks are contained, not cropped: 36px leaves a 10px inset inside the
5580
+ 56px tile, so a non-square logo keeps its whole shape. */
4592
5581
  .tile.client img {
4593
5582
  width: 36px;
4594
5583
  height: 36px;
4595
5584
  object-fit: contain;
4596
5585
  }
4597
5586
 
5587
+ /* The server's logo at the mark's height: a square logo in a square tile,
5588
+ a wordmark widening the tile up to 126px and contained past that (a
5589
+ 3.75:1 wordmark draws 108 by 29). Where the row is short of room the
5590
+ tile gives some back, down to square, and the wordmark is contained in
5591
+ what is left. */
5592
+ .tile.server {
5593
+ flex-shrink: 1;
5594
+ max-width: 126px;
5595
+ }
5596
+
5597
+ .tile.server.has-logo {
5598
+ padding: 0 8px;
5599
+ }
5600
+
5601
+ .tile.server img {
5602
+ display: block;
5603
+ height: 36px;
5604
+ width: auto;
5605
+ min-width: 36px;
5606
+ max-width: 100%;
5607
+ object-fit: contain;
5608
+ }
5609
+
4598
5610
  .tile .monogram {
4599
- width: 100%;
5611
+ width: 54px;
4600
5612
  height: 100%;
4601
5613
  display: flex;
4602
5614
  align-items: center;
@@ -4606,11 +5618,11 @@ ConsentConnectorHeader.styles = i`
4606
5618
  }
4607
5619
 
4608
5620
  .tile.client .monogram {
4609
- color: var(--cs-agent-tile-text, #0F172A);
5621
+ color: var(--cs-agent-tile-text, #0f172a);
4610
5622
  }
4611
5623
 
4612
5624
  .tile.server .monogram {
4613
- color: var(--cs-text-primary, #0F172A);
5625
+ color: var(--cs-text-primary, #0f172a);
4614
5626
  }
4615
5627
 
4616
5628
  .bridge {
@@ -4628,7 +5640,7 @@ ConsentConnectorHeader.styles = i`
4628
5640
  width: 4px;
4629
5641
  height: 4px;
4630
5642
  border-radius: 50%;
4631
- background: var(--cs-text-tertiary, #94A3B8);
5643
+ background: var(--cs-text-tertiary, #94a3b8);
4632
5644
  opacity: 0.55;
4633
5645
  }
4634
5646
 
@@ -4640,7 +5652,7 @@ ConsentConnectorHeader.styles = i`
4640
5652
  display: inline-flex;
4641
5653
  align-items: center;
4642
5654
  justify-content: center;
4643
- color: #15803D;
5655
+ color: #15803d;
4644
5656
  flex-shrink: 0;
4645
5657
  }
4646
5658
 
@@ -4648,6 +5660,58 @@ ConsentConnectorHeader.styles = i`
4648
5660
  width: 16px;
4649
5661
  height: 16px;
4650
5662
  }
5663
+
5664
+ /* 144px where there is room; it gives way first where there is not. */
5665
+ :host([variant="bridge"]) .bridge {
5666
+ flex: 0 4 144px;
5667
+ height: 56px;
5668
+ gap: 6px;
5669
+ }
5670
+
5671
+ .dash {
5672
+ flex: 1;
5673
+ min-width: 12px;
5674
+ height: 0;
5675
+ border-top: 1px dashed var(--cs-text-tertiary, #5d6c82);
5676
+ opacity: 0.5;
5677
+ }
5678
+
5679
+ :host([variant="bridge"]) .shield {
5680
+ box-sizing: border-box;
5681
+ width: 32px;
5682
+ height: 32px;
5683
+ background: var(
5684
+ --cs-tint,
5685
+ color-mix(
5686
+ in srgb,
5687
+ var(--cs-text-primary, #0f172a) 7%,
5688
+ var(--cs-surface-card, #fff)
5689
+ )
5690
+ );
5691
+ border: 1px solid
5692
+ var(
5693
+ --cs-tint-line,
5694
+ color-mix(
5695
+ in srgb,
5696
+ var(--cs-text-primary, #0f172a) 18%,
5697
+ var(--cs-surface-card, #fff)
5698
+ )
5699
+ );
5700
+ color: var(--cs-mark, var(--cs-text-primary, #0f172a));
5701
+ }
5702
+
5703
+ .visually-hidden {
5704
+ position: absolute;
5705
+ width: 1px;
5706
+ height: 1px;
5707
+ padding: 0;
5708
+ margin: -1px;
5709
+ overflow: hidden;
5710
+ clip: rect(0 0 0 0);
5711
+ clip-path: inset(50%);
5712
+ white-space: nowrap;
5713
+ border: 0;
5714
+ }
4651
5715
  `;
4652
5716
  __decorateClass([
4653
5717
  n4({ type: String })
@@ -4670,6 +5734,12 @@ __decorateClass([
4670
5734
  __decorateClass([
4671
5735
  n4({ type: String, attribute: "logo-dev-token" })
4672
5736
  ], ConsentConnectorHeader.prototype, "logoDevToken", 2);
5737
+ __decorateClass([
5738
+ n4({ type: String, reflect: true })
5739
+ ], ConsentConnectorHeader.prototype, "variant", 2);
5740
+ __decorateClass([
5741
+ n4({ type: String })
5742
+ ], ConsentConnectorHeader.prototype, "via", 2);
4673
5743
  __decorateClass([
4674
5744
  r5()
4675
5745
  ], ConsentConnectorHeader.prototype, "clientImageOk", 2);
@@ -4683,9 +5753,13 @@ ConsentConnectorHeader = __decorateClass([
4683
5753
  // src/styles/theme.ts
4684
5754
  var FIXED_RISK_CHIP_BG = "#FCE7B6";
4685
5755
  var FIXED_RISK_CHIP_TEXT = "#7A4F00";
5756
+ var LIGHT_RISK_CHIP_BG = "rgba(140, 74, 0, 0.10)";
5757
+ var LIGHT_RISK_CHIP_TEXT = "#8C4A00";
4686
5758
  var FIXED_AGENT_TILE_BG = "#FFFFFF";
4687
5759
  var FIXED_AGENT_TILE_BORDER = "rgba(15, 23, 42, 0.08)";
4688
5760
  var FIXED_AGENT_TILE_TEXT = "#0F172A";
5761
+ var TINT_PERCENT = 7;
5762
+ var TINT_LINE_PERCENT = 18;
4689
5763
  var lightTheme = {
4690
5764
  surfaceBg: "#F4F1EA",
4691
5765
  surfaceCard: "#FFFFFF",
@@ -4693,20 +5767,17 @@ var lightTheme = {
4693
5767
  surfaceInset: "#F1ECE2",
4694
5768
  textPrimary: "#0F172A",
4695
5769
  textSecondary: "#334155",
4696
- textTertiary: "#64748B",
5770
+ textTertiary: "#5D6C82",
4697
5771
  surfaceAccent: "#0F172A",
4698
5772
  surfaceAccentText: "#FFFFFF",
4699
- pillVerifiedBg: "#DCFCE7",
4700
- pillVerifiedText: "#166534",
4701
- pillUnverifiedBg: "#F1F5F9",
4702
- pillUnverifiedText: "#475569",
4703
- chipRiskBg: FIXED_RISK_CHIP_BG,
4704
- chipRiskText: FIXED_RISK_CHIP_TEXT,
4705
- focusRing: "rgba(15, 23, 42, 0.35)",
4706
- cardShadow: "0 30px 80px -40px rgba(15, 23, 42, 0.40)",
5773
+ chipRiskBg: LIGHT_RISK_CHIP_BG,
5774
+ chipRiskText: LIGHT_RISK_CHIP_TEXT,
5775
+ focusRing: "#0F172A",
5776
+ cardShadow: "0 6px 20px -6px rgba(15, 23, 42, 0.10)",
4707
5777
  agentTileBg: FIXED_AGENT_TILE_BG,
4708
5778
  agentTileBorder: FIXED_AGENT_TILE_BORDER,
4709
- agentTileText: FIXED_AGENT_TILE_TEXT
5779
+ agentTileText: FIXED_AGENT_TILE_TEXT,
5780
+ lockup: "#0810FE"
4710
5781
  };
4711
5782
  var darkTheme = {
4712
5783
  surfaceBg: "#0B0808",
@@ -4718,36 +5789,64 @@ var darkTheme = {
4718
5789
  textTertiary: "#94A3B8",
4719
5790
  surfaceAccent: "#F8FAFC",
4720
5791
  surfaceAccentText: "#0F172A",
4721
- pillVerifiedBg: "rgba(34, 197, 94, 0.16)",
4722
- pillVerifiedText: "#86EFAC",
4723
- pillUnverifiedBg: "rgba(148, 163, 184, 0.18)",
4724
- pillUnverifiedText: "#CBD5E1",
4725
5792
  chipRiskBg: FIXED_RISK_CHIP_BG,
4726
5793
  chipRiskText: FIXED_RISK_CHIP_TEXT,
4727
5794
  focusRing: "rgba(248, 250, 252, 0.55)",
4728
5795
  cardShadow: "0 40px 90px -40px rgba(0, 0, 0, 0.85)",
4729
5796
  agentTileBg: FIXED_AGENT_TILE_BG,
4730
5797
  agentTileBorder: FIXED_AGENT_TILE_BORDER,
4731
- agentTileText: FIXED_AGENT_TILE_TEXT
5798
+ agentTileText: FIXED_AGENT_TILE_TEXT,
5799
+ warningText: "#FCD34D"
4732
5800
  };
4733
5801
  function getConsentTheme(theme) {
4734
5802
  return theme === "dark" ? darkTheme : lightTheme;
4735
5803
  }
4736
- function themeToCssVariables(tokens) {
4737
- const resolved = {
4738
- ...tokens,
4739
- agentTileBg: tokens.agentTileBg ?? FIXED_AGENT_TILE_BG,
4740
- agentTileBorder: tokens.agentTileBorder ?? FIXED_AGENT_TILE_BORDER,
4741
- agentTileText: tokens.agentTileText ?? FIXED_AGENT_TILE_TEXT
4742
- };
4743
- const declarations = [];
4744
- for (const [key, value] of Object.entries(resolved)) {
4745
- declarations.push(` --cs-${camelToKebab(key)}: ${value};`);
5804
+ function resolveThemeTokens(tokens) {
5805
+ const resolved = { ...tokens };
5806
+ for (const key of FIXED_KEYS2) {
5807
+ resolved[key] = tokens[key] ?? FIXED_TOKENS[key];
5808
+ }
5809
+ for (const key of DERIVED_KEYS) {
5810
+ resolved[key] = tokens[key] ?? DERIVED_TOKENS[key]((base) => tokens[base]);
4746
5811
  }
4747
- return declarations.join("\n");
5812
+ return resolved;
4748
5813
  }
4749
- function camelToKebab(value) {
4750
- return value.replace(/[A-Z]/g, (c5) => `-${c5.toLowerCase()}`);
5814
+ function themeScopeStyle(tokens, scope) {
5815
+ const resolved = resolveThemeTokens(tokens);
5816
+ const keys = Object.keys(resolved);
5817
+ const resolvedName = (key) => `--_${themeTokenProperty(key).slice(2)}`;
5818
+ const isDerived = (key) => DERIVED_KEYS.includes(key);
5819
+ const fallback = (key) => isDerived(key) && tokens[key] === void 0 ? DERIVED_TOKENS[key]((base) => `var(${resolvedName(base)})`) : resolved[key];
5820
+ const resolve = keys.map(
5821
+ (key) => ` ${resolvedName(key)}: var(${themeTokenProperty(key)}, ${fallback(key)});`
5822
+ );
5823
+ const publish = keys.map(
5824
+ (key) => ` ${themeTokenProperty(key)}: var(${resolvedName(key)});`
5825
+ );
5826
+ return `:host {
5827
+ ${resolve.join("\n")}
5828
+ }
5829
+ ${scope} {
5830
+ ${publish.join("\n")}
5831
+ }`;
5832
+ }
5833
+ var FIXED_TOKENS = {
5834
+ agentTileBg: FIXED_AGENT_TILE_BG,
5835
+ agentTileBorder: FIXED_AGENT_TILE_BORDER,
5836
+ agentTileText: FIXED_AGENT_TILE_TEXT
5837
+ };
5838
+ var FIXED_KEYS2 = Object.keys(FIXED_TOKENS);
5839
+ var DERIVED_TOKENS = {
5840
+ tint: (token) => `color-mix(in srgb, ${token("textPrimary")} ${TINT_PERCENT}%, ${token("surfaceCard")})`,
5841
+ tintLine: (token) => `color-mix(in srgb, ${token("textPrimary")} ${TINT_LINE_PERCENT}%, ${token("surfaceCard")})`,
5842
+ mark: (token) => token("textPrimary"),
5843
+ action: (token) => token("textPrimary"),
5844
+ lockup: (token) => token("textPrimary"),
5845
+ warningText: (token) => token("chipRiskText")
5846
+ };
5847
+ var DERIVED_KEYS = Object.keys(DERIVED_TOKENS);
5848
+ function themeTokenProperty(key) {
5849
+ return `--cs-${key.replace(/[A-Z]/g, (c5) => `-${c5.toLowerCase()}`)}`;
4751
5850
  }
4752
5851
 
4753
5852
  // src/identity/entity-card.ts
@@ -5105,11 +6204,52 @@ function capabilitySeedKey(capabilities, allSelected) {
5105
6204
 
5106
6205
  // src/constants/capabilities.ts
5107
6206
  var CONSENT_CAPABILITIES_FEATURES = Object.freeze({
5108
- version: 1,
6207
+ /**
6208
+ * 2 adds the `headline` slot, a slot per row and the row parts.
6209
+ * 3 lets the page theme the screen from any ancestor: a `--cs-*` property
6210
+ * set above the screen wins over its theme, and adds the card, action and
6211
+ * headline tokens and the tint, mark and action colors.
6212
+ * 4 draws Checkpoint's page by default: the agent's name opens its
6213
+ * details, an unverified agent is flagged, `approver` and `grantDetails`
6214
+ * draw their boxes, rows have no icon unless `show-icons`, and the `footer`
6215
+ * slot sits under the card beside the new `legal` slot.
6216
+ */
6217
+ version: 4,
5109
6218
  scopesOnly: true,
5110
- slots: Object.freeze(["identity", "details", "notice", "footer"])
6219
+ slots: Object.freeze([
6220
+ "identity",
6221
+ "details",
6222
+ "notice",
6223
+ "footer",
6224
+ "legal",
6225
+ "headline"
6226
+ ]),
6227
+ /** A row's slot is this prefix and the capability's id. */
6228
+ capabilitySlotPrefix: "capability-"
5111
6229
  });
5112
6230
 
6231
+ // src/components/decision-icons.ts
6232
+ var PATHS = {
6233
+ warning: w`<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" /><path d="M12 9v4" /><path d="M12 17h.01" />`,
6234
+ check: w`<path d="M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z" /><path d="m9 12 2 2 4-4" />`,
6235
+ resource: w`<rect width="20" height="8" x="2" y="2" rx="2" ry="2" /><rect width="20" height="8" x="2" y="14" rx="2" ry="2" /><line x1="6" x2="6.01" y1="6" y2="6" /><line x1="6" x2="6.01" y1="18" y2="18" />`,
6236
+ duration: w`<path d="M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5" /><path d="M16 2v4" /><path d="M8 2v4" /><path d="M3 10h5" /><path d="M17.5 17.5 16 16.3V14" /><circle cx="16" cy="16" r="6" />`,
6237
+ budget: w`<path d="M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1" /><path d="M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4" />`,
6238
+ amountLimits: w`<rect width="20" height="14" x="2" y="5" rx="2" /><line x1="2" x2="22" y1="10" y2="10" />`,
6239
+ alreadyGranted: w`<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /><path d="M3 3v5h5" /><path d="M12 7v5l4 2" />`
6240
+ };
6241
+ function decisionIcon(name) {
6242
+ return w`<svg
6243
+ viewBox="0 0 24 24"
6244
+ fill="none"
6245
+ stroke="currentColor"
6246
+ stroke-width="2"
6247
+ stroke-linecap="round"
6248
+ stroke-linejoin="round"
6249
+ aria-hidden="true"
6250
+ >${PATHS[name]}</svg>`;
6251
+ }
6252
+
5113
6253
  // src/grant/terms.ts
5114
6254
  var MINUTE = 60;
5115
6255
  var HOUR = 60 * MINUTE;
@@ -5210,7 +6350,7 @@ var fieldStyles = i`
5210
6350
  }
5211
6351
 
5212
6352
  input::placeholder {
5213
- color: var(--cs-text-tertiary, #64748b);
6353
+ color: var(--cs-text-tertiary, #5d6c82);
5214
6354
  opacity: 1;
5215
6355
  }
5216
6356
 
@@ -5239,7 +6379,7 @@ var fieldStyles = i`
5239
6379
  }
5240
6380
 
5241
6381
  .hint {
5242
- color: var(--cs-text-tertiary, #64748b);
6382
+ color: var(--cs-text-tertiary, #5d6c82);
5243
6383
  }
5244
6384
 
5245
6385
  .error {
@@ -5365,7 +6505,7 @@ ConsentDuration.styles = [
5365
6505
  width: 14px;
5366
6506
  height: 14px;
5367
6507
  margin-top: -7px;
5368
- color: var(--cs-text-tertiary, #64748b);
6508
+ color: var(--cs-text-tertiary, #5d6c82);
5369
6509
  pointer-events: none;
5370
6510
  }
5371
6511
  `
@@ -5786,6 +6926,19 @@ ConsentGrantTerms = __decorateClass([
5786
6926
  ], ConsentGrantTerms);
5787
6927
 
5788
6928
  // src/components/consent-capabilities-screen.ts
6929
+ var CAPABILITY_ROW_EXPORT_PARTS = CAPABILITY_ROW_PARTS.map(
6930
+ (part) => `${part}: capability-${part}`
6931
+ ).join(", ");
6932
+ function capabilitySlotName(capabilityId) {
6933
+ return `${CONSENT_CAPABILITIES_FEATURES.capabilitySlotPrefix}${capabilityId}`;
6934
+ }
6935
+ function cameThroughARowSlot(event) {
6936
+ const path = event.composedPath();
6937
+ const listener = event.currentTarget ? path.indexOf(event.currentTarget) : -1;
6938
+ return path.slice(0, listener === -1 ? path.length : listener).some(
6939
+ (node) => node instanceof HTMLSlotElement && node.name.startsWith(CONSENT_CAPABILITIES_FEATURES.capabilitySlotPrefix)
6940
+ );
6941
+ }
5789
6942
  var ConsentCapabilitiesScreen = class extends i4 {
5790
6943
  constructor() {
5791
6944
  super();
@@ -5801,14 +6954,20 @@ var ConsentCapabilitiesScreen = class extends i4 {
5801
6954
  this.disabled = false;
5802
6955
  this.description = "";
5803
6956
  this.submitLabel = "";
6957
+ this.showIcons = false;
5804
6958
  this.cancelLabel = "";
5805
6959
  this.allSelected = false;
5806
6960
  this.allowDisabled = false;
5807
6961
  this.serverDomain = "";
5808
6962
  this.logoDevToken = "";
5809
6963
  this.serverLogoUrl = "";
6964
+ this.connectorVariant = "bridge";
6965
+ this.via = "";
5810
6966
  this.requireAll = false;
6967
+ this.preview = false;
6968
+ this.editable = false;
5811
6969
  this.selected = /* @__PURE__ */ new Set();
6970
+ this.hasLegal = false;
5812
6971
  /**
5813
6972
  * Last capability set this component seeded `selected` from, per
5814
6973
  * `capabilitySeedKey`. Re-seeding is keyed on this value rather than on
@@ -5818,6 +6977,7 @@ var ConsentCapabilitiesScreen = class extends i4 {
5818
6977
  this.onCapabilityToggle = (event) => {
5819
6978
  if (this.loading || this.disabled || !(event instanceof CustomEvent))
5820
6979
  return;
6980
+ if (cameThroughARowSlot(event)) return;
5821
6981
  const detail = event.detail;
5822
6982
  if (!detail || typeof detail !== "object" || !("id" in detail) || typeof detail.id !== "string" || !("checked" in detail) || typeof detail.checked !== "boolean" || !this.capabilities.some((capability) => capability.id === detail.id))
5823
6983
  return;
@@ -5827,7 +6987,7 @@ var ConsentCapabilitiesScreen = class extends i4 {
5827
6987
  this.selected = next;
5828
6988
  };
5829
6989
  this.onAllow = () => {
5830
- if (this.loading || this.approvalDisabled) return;
6990
+ if (this.preview || this.loading || this.approvalDisabled) return;
5831
6991
  const selectedCapabilities = this.capabilities.filter(
5832
6992
  (c5) => this.selected.has(c5.id)
5833
6993
  );
@@ -5851,14 +7011,18 @@ var ConsentCapabilitiesScreen = class extends i4 {
5851
7011
  );
5852
7012
  };
5853
7013
  this.onDeny = () => {
5854
- if (this.loading) return;
7014
+ if (this.preview || this.loading) return;
5855
7015
  this.dispatchEvent(
5856
7016
  new CustomEvent("capabilities-deny", { bubbles: true, composed: true })
5857
7017
  );
5858
7018
  };
7019
+ this.readLegalSlot = (event) => {
7020
+ this.hasLegal = event.target.assignedNodes({ flatten: true }).length > 0;
7021
+ };
5859
7022
  const refresh = () => this.requestUpdate();
5860
7023
  this.addEventListener("consent-grant-terms-change", refresh);
5861
7024
  for (const type of GRANT_FIELD_EVENTS) this.addEventListener(type, refresh);
7025
+ guardPreviewNavigation(this);
5862
7026
  }
5863
7027
  connectedCallback() {
5864
7028
  super.connectedCallback();
@@ -5868,6 +7032,7 @@ var ConsentCapabilitiesScreen = class extends i4 {
5868
7032
  if (changed.has("capabilities") || changed.has("allSelected")) {
5869
7033
  this.seedDefaults();
5870
7034
  }
7035
+ warnIfEditableWithoutPreview(this);
5871
7036
  }
5872
7037
  /**
5873
7038
  * Seed `selected` from the capability defaults, but only when the
@@ -5885,8 +7050,15 @@ var ConsentCapabilitiesScreen = class extends i4 {
5885
7050
  capabilityIdsFor(this.capabilities, this.allSelected)
5886
7051
  );
5887
7052
  }
7053
+ /**
7054
+ * The theme, as values the page can override: a `--cs-*` property set on
7055
+ * this element or on any ancestor wins over the theme's own.
7056
+ */
5888
7057
  hostStyle() {
5889
- return `:host { ${themeToCssVariables(getConsentTheme(this.theme))} }`;
7058
+ return themeScopeStyle(
7059
+ getConsentTheme(this.theme),
7060
+ ".card, consent-connector-header, .below"
7061
+ );
5890
7062
  }
5891
7063
  /** Grant terms in the `details` slot. None when rendered without a DOM. */
5892
7064
  get slottedTerms() {
@@ -5926,12 +7098,9 @@ var ConsentCapabilitiesScreen = class extends i4 {
5926
7098
  }
5927
7099
  }
5928
7100
  render() {
5929
- const tokens = CONSENT_COPY_TOKENS;
5930
7101
  const agent = this.resolveAgent();
7102
+ const editing = isEditing(this);
5931
7103
  const agentName = agent?.name || "this agent";
5932
- const sectionHeader = formatToken(tokens.section.capabilitiesHeader, {
5933
- Agent: agentName.toUpperCase()
5934
- });
5935
7104
  return b2`
5936
7105
  <style>
5937
7106
  ${this.hostStyle()}
@@ -5945,33 +7114,27 @@ var ConsentCapabilitiesScreen = class extends i4 {
5945
7114
  server-logo-url="${this.serverLogoUrl}"
5946
7115
  server-domain="${this.serverDomain}"
5947
7116
  logo-dev-token="${this.logoDevToken}"
7117
+ variant=${this.connectorVariant}
7118
+ via=${this.via}
5948
7119
  ></consent-connector-header>
5949
7120
  <div class="card" part="card">
5950
7121
  <consent-headline
5951
- exportparts="eyebrow, headline, subhead"
7122
+ exportparts="eyebrow, headline, agent-name, host, subhead, agent-details"
5952
7123
  agent-name="${agent?.name ?? ""}"
5953
- org-name="${this.orgName}"
7124
+ .agent=${agent}
5954
7125
  verb="${this.headlineVerb}"
5955
7126
  description="${this.description}"
7127
+ ?preview=${this.preview}
7128
+ ?editable=${editing}
7129
+ .editSource=${this.editSource}
7130
+ ><slot name="headline" slot="headline"></slot
5956
7131
  ></consent-headline>
5957
7132
  <slot name="recovery"></slot>
7133
+ ${this.renderUnverified(agent)}
5958
7134
  <slot name="identity"></slot>
5959
- ${agent ? b2`<consent-agent-header
5960
- part="agent"
5961
- agentName="${agent.name}"
5962
- vendor="${agent.vendor || ""}"
5963
- surfaceLabel="${agent.surfaceLabel || ""}"
5964
- verification="${agentVerification(agent)}"
5965
- domain="${agent.domain || ""}"
5966
- logoUrl="${agent.logoUrl || ""}"
5967
- connectedAt="${agent.connectedAt || ""}"
5968
- ></consent-agent-header>` : A}
7135
+ ${this.renderApprover()}
5969
7136
  <slot name="agent-key"></slot>
5970
7137
  <div part="permissions">
5971
- <div class="section-header">
5972
- <span>${sectionHeader}</span>
5973
- <span class="hint">${tokens.section.tapToToggle}</span>
5974
- </div>
5975
7138
  <div class="rows" @capability-toggle=${this.onCapabilityToggle}>
5976
7139
  ${this.capabilities.map(
5977
7140
  (capability) => b2`
@@ -5983,8 +7146,17 @@ var ConsentCapabilitiesScreen = class extends i4 {
5983
7146
  riskLevel="${capability.riskLevel}"
5984
7147
  ?checked=${this.selected.has(capability.id)}
5985
7148
  ?disabled=${this.loading || this.disabled}
7149
+ ?show-icon=${this.showIcons}
5986
7150
  .scopes=${capability.scopes}
5987
7151
  compiled-cedar="${this.compileCapabilityCedar(capability)}"
7152
+ ?preview=${this.preview}
7153
+ ?editable=${editing}
7154
+ .editSource=${this.editSource}
7155
+ exportparts=${CAPABILITY_ROW_EXPORT_PARTS}
7156
+ ><slot
7157
+ name=${capabilitySlotName(capability.id)}
7158
+ slot="extra"
7159
+ ></slot
5988
7160
  ></consent-capability-card>
5989
7161
  `
5990
7162
  )}
@@ -5992,15 +7164,16 @@ var ConsentCapabilitiesScreen = class extends i4 {
5992
7164
  </div>
5993
7165
  <slot name="auth"></slot>
5994
7166
  <slot name="details"></slot>
7167
+ ${this.renderGrantDetails(editing)}
5995
7168
  <slot name="notice"
5996
- ><consent-revocation-notice
5997
- revocationPath="${this.revocationPath}"
5998
- orgName="${this.orgName || "this site"}"
5999
- inactivityDays=${this.inactivityDays}
6000
- ?fixed-expiry=${this.fixedExpiry}
6001
- fixed-expiry-days=${this.fixedExpiryDays ?? A}
6002
- ></consent-revocation-notice
6003
- ></slot>
7169
+ >${this.grantDetails ? A : b2`<consent-revocation-notice
7170
+ revocationPath="${this.revocationPath}"
7171
+ orgName="${this.orgName || "this site"}"
7172
+ inactivityDays=${this.inactivityDays}
7173
+ ?fixed-expiry=${this.fixedExpiry}
7174
+ fixed-expiry-days=${this.fixedExpiryDays ?? A}
7175
+ ></consent-revocation-notice>`}</slot
7176
+ >
6004
7177
  <consent-action-bar
6005
7178
  part="actions"
6006
7179
  agentName="${agentName}"
@@ -6009,27 +7182,151 @@ var ConsentCapabilitiesScreen = class extends i4 {
6009
7182
  ?disabled=${this.approvalDisabled}
6010
7183
  submit-label=${this.submitLabel}
6011
7184
  cancel-label=${this.cancelLabel}
7185
+ ?preview=${this.preview}
7186
+ ?editable=${editing}
7187
+ .editSource=${this.editSource}
6012
7188
  exportparts="submit, cancel"
6013
7189
  @consent-allow=${this.onAllow}
6014
7190
  @consent-deny=${this.onDeny}
6015
7191
  ></consent-action-bar>
6016
- <slot name="footer"
6017
- ><consent-footer
6018
- theme="${this.theme}"
6019
- howItWorksUrl="${this.howItWorksUrl}"
6020
- ></consent-footer
6021
- ></slot>
7192
+ </div>
7193
+ <div class="below" part="below">
7194
+ <slot name="footer"><consent-secured-by></consent-secured-by></slot>
7195
+ ${this.renderLegal()}
6022
7196
  </div>
6023
7197
  `;
6024
7198
  }
7199
+ /** The warning for an agent that registered itself: its name is not checked. */
7200
+ renderUnverified(agent) {
7201
+ if (!agent || agentVerification(agent) !== "unverified") return A;
7202
+ const copy = CONSENT_COPY_TOKENS;
7203
+ return b2`<div class="unverified" part="unverified">
7204
+ <p class="unverified-heading">
7205
+ ${decisionIcon("warning")}${copy.unverifiedAgent.heading}
7206
+ </p>
7207
+ <p class="unverified-body">
7208
+ ${copy.agentDetails.unverifiedExplanation}
7209
+ ${copy.unverifiedAgent.advice}
7210
+ </p>
7211
+ </div>`;
7212
+ }
7213
+ /** Who is signing in, and the checks they passed; nothing when there is neither. */
7214
+ renderApprover() {
7215
+ const identifier = this.approver?.identifier?.trim() ?? "";
7216
+ const checks = (this.approver?.checks ?? []).filter(
7217
+ (check) => check.label.trim()
7218
+ );
7219
+ if (!identifier && checks.length === 0) return A;
7220
+ return b2`<div class="approver tinted" part="approver">
7221
+ ${identifier ? b2`<div class="signed-in">
7222
+ <span class="avatar" aria-hidden="true"
7223
+ >${initialOf(identifier)}</span
7224
+ >
7225
+ <span class="who">
7226
+ <span class="small"
7227
+ >${CONSENT_COPY_TOKENS.approver.signedIn}</span
7228
+ >
7229
+ <span class="identifier">${identifier}</span>
7230
+ </span>
7231
+ </div>` : A}
7232
+ ${checks.map(
7233
+ (check, index) => b2`<div class="check${identifier || index > 0 ? " ruled" : ""}">
7234
+ <span class="check-icon">${decisionIcon("check")}</span>
7235
+ <span class="who">
7236
+ <span class="strong">${check.label}</span>
7237
+ ${check.summary ? b2`<span>${check.summary}</span>` : A}
7238
+ ${check.source ? b2`<span class="small">${check.source}</span>` : A}
7239
+ </span>
7240
+ </div>`
7241
+ )}
7242
+ </div>`;
7243
+ }
7244
+ /** The "Permission details" box, when the host gives `grantDetails`. */
7245
+ renderGrantDetails(editing) {
7246
+ const details = this.grantDetails;
7247
+ if (!details) return A;
7248
+ const copy = CONSENT_COPY_TOKENS.grantDetails;
7249
+ const org = this.orgName.trim();
7250
+ const resource = details.resource?.trim() ?? "";
7251
+ const orgValue = editing ? editRegion(
7252
+ CONSENT_EDIT_KEYS.orgName,
7253
+ CONSENT_COPY_TOKENS.editRegions.orgName,
7254
+ org,
7255
+ this.editSource
7256
+ ) : org;
7257
+ const rows = [];
7258
+ if (org || resource || editing) {
7259
+ rows.push({
7260
+ icon: "resource",
7261
+ label: copy.connectsTo,
7262
+ values: org || editing ? [orgValue] : [resource],
7263
+ ...resource && (org || editing) ? { note: resource } : {}
7264
+ });
7265
+ }
7266
+ const fact = (icon, label, given) => {
7267
+ const values = (given?.values ?? []).filter((value) => value.trim());
7268
+ const note = given?.note?.trim();
7269
+ if (values.length > 0 || note) {
7270
+ rows.push({ icon, label, values, ...note ? { note } : {} });
7271
+ }
7272
+ };
7273
+ fact("duration", copy.duration, details.duration);
7274
+ if (details.budget?.trim()) {
7275
+ rows.push({
7276
+ icon: "budget",
7277
+ label: copy.budget,
7278
+ values: [details.budget.trim()]
7279
+ });
7280
+ }
7281
+ fact("amountLimits", copy.amountLimits, details.amountLimits);
7282
+ fact("alreadyGranted", copy.alreadyGranted, details.alreadyGranted);
7283
+ if (rows.length === 0) return A;
7284
+ return b2`<section
7285
+ class="grant-details tinted"
7286
+ part="grant-details"
7287
+ aria-labelledby="grant-details-heading"
7288
+ >
7289
+ <h2 id="grant-details-heading">${copy.heading}</h2>
7290
+ <dl>
7291
+ ${rows.map(
7292
+ (row) => b2`<div class="fact">
7293
+ <span class="fact-icon">${decisionIcon(row.icon)}</span>
7294
+ <div class="fact-text">
7295
+ <dt class="small">${row.label}</dt>
7296
+ ${row.values.map(
7297
+ (value) => b2`<dd class="value">${value}</dd>`
7298
+ )}
7299
+ ${row.note ? b2`<dd class="note small">${row.note}</dd>` : A}
7300
+ </div>
7301
+ </div>`
7302
+ )}
7303
+ </dl>
7304
+ </section>`;
7305
+ }
7306
+ /**
7307
+ * The host's legal links, or a "How does this work?" link when the host
7308
+ * gives its address; nothing when there is neither.
7309
+ */
7310
+ renderLegal() {
7311
+ const howItWorks = sanitizeLinkUrl(this.howItWorksUrl);
7312
+ return b2`<div class="legal" ?hidden=${!this.hasLegal && !howItWorks}>
7313
+ <slot name="legal" @slotchange=${this.readLegalSlot}
7314
+ >${howItWorks ? b2`<a href=${howItWorks} target="_blank" rel="noopener noreferrer"
7315
+ >${CONSENT_COPY_TOKENS.attribution.howThisWorks}</a
7316
+ >` : A}</slot
7317
+ >
7318
+ </div>`;
7319
+ }
6025
7320
  };
6026
7321
  ConsentCapabilitiesScreen.features = CONSENT_CAPABILITIES_FEATURES;
6027
7322
  ConsentCapabilitiesScreen.styles = i`
7323
+ ${editRegionStyles}
7324
+
6028
7325
  :host {
6029
7326
  display: block;
6030
7327
  box-sizing: border-box;
6031
7328
  width: 100%;
6032
- max-width: var(--cs-screen-max-width, 560px);
7329
+ max-width: var(--cs-screen-max-width, 576px);
6033
7330
  margin: 0 auto;
6034
7331
  }
6035
7332
 
@@ -6037,43 +7334,231 @@ ConsentCapabilitiesScreen.styles = i`
6037
7334
  min-width: 0;
6038
7335
  background: var(--cs-surface-card);
6039
7336
  border: 1px solid var(--cs-surface-border);
6040
- border-radius: 22px;
7337
+ border-radius: var(--cs-card-radius, 12px);
6041
7338
  box-shadow: var(--cs-card-shadow);
6042
- padding: var(--cs-card-padding, 28px 28px 22px);
7339
+ padding: var(--cs-card-padding, 28px 28px 24px);
6043
7340
  display: flex;
6044
7341
  flex-direction: column;
6045
7342
  gap: var(--cs-card-gap, 22px);
6046
7343
  color: var(--cs-text-primary);
6047
7344
  }
6048
7345
 
6049
- .section-header {
7346
+ .rows {
7347
+ display: flex;
7348
+ flex-direction: column;
7349
+ }
7350
+
7351
+ svg {
7352
+ flex-shrink: 0;
7353
+ }
7354
+
7355
+ .unverified {
7356
+ display: flex;
7357
+ flex-direction: column;
7358
+ gap: 2px;
7359
+ margin-top: 12px;
7360
+ font-size: 14px;
7361
+ line-height: 1.45;
7362
+ }
7363
+
7364
+ .unverified p {
7365
+ margin: 0;
7366
+ }
7367
+
7368
+ .unverified-heading {
6050
7369
  display: flex;
6051
7370
  align-items: center;
6052
- justify-content: space-between;
6053
- font-size: 11px;
6054
- letter-spacing: 0.14em;
7371
+ gap: 6px;
7372
+ font-weight: 500;
7373
+ color: var(--cs-warning-text, #8c4a00);
7374
+ }
7375
+
7376
+ .unverified-heading svg {
7377
+ width: 16px;
7378
+ height: 16px;
7379
+ }
7380
+
7381
+ .unverified-body {
7382
+ color: var(--cs-text-secondary);
7383
+ }
7384
+
7385
+ .tinted {
7386
+ border-radius: 12px;
7387
+ border: 1px solid var(--cs-tint-line);
7388
+ background: var(--cs-tint);
7389
+ }
7390
+
7391
+ .approver {
7392
+ margin-top: 16px;
7393
+ padding: 12px 16px;
7394
+ font-size: 14px;
7395
+ line-height: 1.45;
7396
+ }
7397
+
7398
+ .signed-in,
7399
+ .check {
7400
+ display: flex;
7401
+ align-items: center;
7402
+ gap: 12px;
7403
+ }
7404
+
7405
+ .check {
7406
+ align-items: flex-start;
7407
+ }
7408
+
7409
+ .ruled {
7410
+ margin-top: 12px;
7411
+ padding-top: 12px;
7412
+ border-top: 1px solid var(--cs-tint-line);
7413
+ }
7414
+
7415
+ .avatar,
7416
+ .check-icon {
7417
+ display: grid;
7418
+ place-items: center;
7419
+ width: 40px;
7420
+ height: 40px;
7421
+ flex-shrink: 0;
7422
+ }
7423
+
7424
+ .avatar {
7425
+ border-radius: 50%;
7426
+ background: var(--cs-surface-accent);
7427
+ color: var(--cs-surface-accent-text);
6055
7428
  font-weight: 600;
7429
+ }
7430
+
7431
+ .check-icon {
7432
+ color: var(--cs-mark);
7433
+ }
7434
+
7435
+ .check-icon svg {
7436
+ width: 20px;
7437
+ height: 20px;
7438
+ }
7439
+
7440
+ .who {
7441
+ display: flex;
7442
+ flex-direction: column;
7443
+ gap: 2px;
7444
+ min-width: 0;
7445
+ }
7446
+
7447
+ .identifier {
7448
+ font-weight: 500;
7449
+ overflow: hidden;
7450
+ text-overflow: ellipsis;
7451
+ white-space: nowrap;
7452
+ }
7453
+
7454
+ .small {
7455
+ font-size: 12px;
6056
7456
  color: var(--cs-text-tertiary);
6057
- text-transform: uppercase;
7457
+ }
7458
+
7459
+ .strong {
7460
+ font-weight: 500;
7461
+ }
7462
+
7463
+ .grant-details {
7464
+ margin-top: 16px;
7465
+ padding: 16px;
7466
+ font-size: 14px;
7467
+ line-height: 1.45;
7468
+ }
7469
+
7470
+ .grant-details h2 {
7471
+ margin: 0 0 12px;
7472
+ font-size: 14px;
7473
+ font-weight: 600;
7474
+ }
7475
+
7476
+ .grant-details dl {
7477
+ display: flex;
7478
+ flex-direction: column;
6058
7479
  gap: 12px;
6059
- flex-wrap: wrap;
7480
+ margin: 0;
6060
7481
  }
6061
7482
 
6062
- .section-header .hint {
6063
- letter-spacing: 0;
6064
- font-weight: 400;
6065
- text-transform: none;
6066
- font-size: 12px;
7483
+ .fact {
7484
+ display: flex;
7485
+ align-items: flex-start;
7486
+ gap: 12px;
6067
7487
  }
6068
7488
 
6069
- .rows {
7489
+ .fact-icon {
7490
+ display: grid;
7491
+ place-items: center;
7492
+ width: 32px;
7493
+ height: 32px;
7494
+ flex-shrink: 0;
7495
+ border-radius: 6px;
7496
+ border: 1px solid var(--cs-surface-border);
7497
+ background: var(--cs-surface-card);
7498
+ color: var(--cs-mark);
7499
+ }
7500
+
7501
+ .fact-icon svg {
7502
+ width: 16px;
7503
+ height: 16px;
7504
+ }
7505
+
7506
+ .fact-text {
7507
+ display: flex;
7508
+ flex: 1;
7509
+ flex-direction: column;
7510
+ gap: 2px;
7511
+ min-width: 0;
7512
+ }
7513
+
7514
+ .fact dd {
7515
+ margin: 0;
7516
+ }
7517
+
7518
+ .fact .value {
7519
+ font-weight: 500;
7520
+ overflow-wrap: anywhere;
7521
+ }
7522
+
7523
+ .fact .note {
7524
+ overflow-wrap: break-word;
7525
+ }
7526
+
7527
+ .below {
6070
7528
  display: flex;
6071
7529
  flex-direction: column;
7530
+ align-items: center;
7531
+ margin-top: 16px;
7532
+ color: var(--cs-text-tertiary);
7533
+ }
7534
+
7535
+ .legal {
7536
+ display: flex;
7537
+ justify-content: center;
7538
+ gap: 20px;
7539
+ padding-top: 48px;
7540
+ font-size: 12px;
7541
+ }
7542
+
7543
+ .legal a {
7544
+ color: inherit;
7545
+ text-decoration: underline;
7546
+ text-underline-offset: 2px;
7547
+ border-radius: 2px;
7548
+ }
7549
+
7550
+ .legal a:hover {
7551
+ color: var(--cs-text-primary);
7552
+ }
7553
+
7554
+ .legal a:focus-visible {
7555
+ outline: 2px solid var(--cs-focus-ring);
7556
+ outline-offset: 2px;
6072
7557
  }
6073
7558
 
6074
- @media (max-width: 480px) {
7559
+ @media (max-width: 640px) {
6075
7560
  .card {
6076
- padding: var(--cs-card-padding-mobile, 20px 18px);
7561
+ padding: var(--cs-card-padding-mobile, 20px 20px 24px);
6077
7562
  }
6078
7563
  }
6079
7564
  `;
@@ -6125,6 +7610,15 @@ __decorateClass([
6125
7610
  __decorateClass([
6126
7611
  n4({ type: String, attribute: "submit-label" })
6127
7612
  ], ConsentCapabilitiesScreen.prototype, "submitLabel", 2);
7613
+ __decorateClass([
7614
+ n4({ attribute: false })
7615
+ ], ConsentCapabilitiesScreen.prototype, "approver", 2);
7616
+ __decorateClass([
7617
+ n4({ attribute: false })
7618
+ ], ConsentCapabilitiesScreen.prototype, "grantDetails", 2);
7619
+ __decorateClass([
7620
+ n4({ type: Boolean, attribute: "show-icons" })
7621
+ ], ConsentCapabilitiesScreen.prototype, "showIcons", 2);
6128
7622
  __decorateClass([
6129
7623
  n4({ type: String, attribute: "cancel-label" })
6130
7624
  ], ConsentCapabilitiesScreen.prototype, "cancelLabel", 2);
@@ -6143,12 +7637,30 @@ __decorateClass([
6143
7637
  __decorateClass([
6144
7638
  n4({ type: String, attribute: "server-logo-url" })
6145
7639
  ], ConsentCapabilitiesScreen.prototype, "serverLogoUrl", 2);
7640
+ __decorateClass([
7641
+ n4({ type: String, attribute: "connector-variant" })
7642
+ ], ConsentCapabilitiesScreen.prototype, "connectorVariant", 2);
7643
+ __decorateClass([
7644
+ n4({ type: String })
7645
+ ], ConsentCapabilitiesScreen.prototype, "via", 2);
6146
7646
  __decorateClass([
6147
7647
  n4({ type: Boolean, attribute: "require-all" })
6148
7648
  ], ConsentCapabilitiesScreen.prototype, "requireAll", 2);
7649
+ __decorateClass([
7650
+ n4({ type: Boolean, reflect: true })
7651
+ ], ConsentCapabilitiesScreen.prototype, "preview", 2);
7652
+ __decorateClass([
7653
+ n4({ type: Boolean, reflect: true })
7654
+ ], ConsentCapabilitiesScreen.prototype, "editable", 2);
7655
+ __decorateClass([
7656
+ n4({ attribute: false })
7657
+ ], ConsentCapabilitiesScreen.prototype, "editSource", 2);
6149
7658
  __decorateClass([
6150
7659
  r5()
6151
7660
  ], ConsentCapabilitiesScreen.prototype, "selected", 2);
7661
+ __decorateClass([
7662
+ r5()
7663
+ ], ConsentCapabilitiesScreen.prototype, "hasLegal", 2);
6152
7664
  ConsentCapabilitiesScreen = __decorateClass([
6153
7665
  t3("consent-capabilities-screen")
6154
7666
  ], ConsentCapabilitiesScreen);
@@ -6165,15 +7677,16 @@ var ConsentRevoke = class extends i4 {
6165
7677
  this.error = "";
6166
7678
  this.confirmLabel = "";
6167
7679
  this.keepLabel = "";
7680
+ this.preview = false;
6168
7681
  }
6169
7682
  onConfirm() {
6170
- if (this.loading) return;
7683
+ if (this.loading || this.preview) return;
6171
7684
  this.dispatchEvent(
6172
7685
  new CustomEvent("consent-revoke", { bubbles: true, composed: true })
6173
7686
  );
6174
7687
  }
6175
7688
  onKeep() {
6176
- if (this.loading) return;
7689
+ if (this.loading || this.preview) return;
6177
7690
  this.dispatchEvent(
6178
7691
  new CustomEvent("consent-keep", { bubbles: true, composed: true })
6179
7692
  );
@@ -6286,7 +7799,7 @@ ConsentRevoke.styles = i`
6286
7799
 
6287
7800
  .ends-title {
6288
7801
  margin: 0;
6289
- color: var(--cs-text-tertiary, #64748b);
7802
+ color: var(--cs-text-tertiary, #5d6c82);
6290
7803
  font-size: 12px;
6291
7804
  font-weight: 500;
6292
7805
  }
@@ -6327,7 +7840,7 @@ ConsentRevoke.styles = i`
6327
7840
  width: 100%;
6328
7841
  padding: 13px 18px;
6329
7842
  border: none;
6330
- border-radius: 999px;
7843
+ border-radius: var(--cs-action-radius, 6px);
6331
7844
  font: inherit;
6332
7845
  font-size: var(--cs-action-font-size, 15px);
6333
7846
  font-weight: 500;
@@ -6409,6 +7922,9 @@ __decorateClass([
6409
7922
  __decorateClass([
6410
7923
  n4({ type: String, attribute: "keep-label" })
6411
7924
  ], ConsentRevoke.prototype, "keepLabel", 2);
7925
+ __decorateClass([
7926
+ n4({ type: Boolean, reflect: true })
7927
+ ], ConsentRevoke.prototype, "preview", 2);
6412
7928
  ConsentRevoke = __decorateClass([
6413
7929
  t3("consent-revoke")
6414
7930
  ], ConsentRevoke);
@@ -6656,7 +8172,7 @@ ConsentWalletOrb.styles = i`
6656
8172
  .frame {
6657
8173
  --_ink: var(--cs-wallet-accent, var(--cs-surface-accent, #0f172a));
6658
8174
  --_success: var(--cs-wallet-success, #10b981);
6659
- --_muted: var(--cs-wallet-muted, var(--cs-text-tertiary, #64748b));
8175
+ --_muted: var(--cs-wallet-muted, var(--cs-text-tertiary, #5d6c82));
6660
8176
  position: relative;
6661
8177
  width: 100%;
6662
8178
  height: 100%;
@@ -6846,7 +8362,7 @@ ConsentWalletCheck.styles = i`
6846
8362
 
6847
8363
  .caption {
6848
8364
  margin: 0;
6849
- color: var(--cs-text-tertiary, #64748b);
8365
+ color: var(--cs-text-tertiary, #5d6c82);
6850
8366
  font-size: 12px;
6851
8367
  line-height: 1.35;
6852
8368
  }
@@ -6957,7 +8473,7 @@ ConsentWalletNotice.styles = i`
6957
8473
  .body,
6958
8474
  .more {
6959
8475
  margin: 0;
6960
- color: var(--cs-text-tertiary, #64748b);
8476
+ color: var(--cs-text-tertiary, #5d6c82);
6961
8477
  font-size: 12px;
6962
8478
  line-height: 1.375;
6963
8479
  }
@@ -7047,7 +8563,7 @@ ConsentWalletSignature.styles = i`
7047
8563
 
7048
8564
  .frame {
7049
8565
  margin: 0;
7050
- color: var(--cs-text-tertiary, #64748b);
8566
+ color: var(--cs-text-tertiary, #5d6c82);
7051
8567
  font-size: 12px;
7052
8568
  line-height: 1.5;
7053
8569
  }
@@ -7171,7 +8687,7 @@ ConsentRequestExpiry.styles = i`
7171
8687
 
7172
8688
  p {
7173
8689
  margin: 0;
7174
- color: var(--cs-text-tertiary, #64748b);
8690
+ color: var(--cs-text-tertiary, #5d6c82);
7175
8691
  font-size: 12px;
7176
8692
  line-height: 1.4;
7177
8693
  }
@@ -7539,12 +9055,12 @@ ConsentPhoneHandoff.styles = i`
7539
9055
  width: 16px;
7540
9056
  height: 16px;
7541
9057
  margin-top: calc((1.3em - 16px) / 2);
7542
- color: var(--cs-text-tertiary, #64748b);
9058
+ color: var(--cs-text-tertiary, #5d6c82);
7543
9059
  }
7544
9060
 
7545
9061
  .body {
7546
9062
  margin: 0;
7547
- color: var(--cs-text-tertiary, #64748b);
9063
+ color: var(--cs-text-tertiary, #5d6c82);
7548
9064
  font-size: 14px;
7549
9065
  line-height: 1.45;
7550
9066
  }
@@ -7572,7 +9088,7 @@ ConsentPhoneHandoff.styles = i`
7572
9088
  .scan {
7573
9089
  justify-self: stretch;
7574
9090
  margin: 0;
7575
- color: var(--cs-text-tertiary, #64748b);
9091
+ color: var(--cs-text-tertiary, #5d6c82);
7576
9092
  font-size: 12px;
7577
9093
  line-height: 1.4;
7578
9094
  }
@@ -7817,8 +9333,9 @@ var AUTH_REQUIRED_MODES = /* @__PURE__ */ new Set([
7817
9333
  AUTH_MODES.MAGIC_LINK
7818
9334
  ]);
7819
9335
  var McpConsent = class extends i4 {
9336
+ // === LIFECYCLE ===
7820
9337
  constructor() {
7821
- super(...arguments);
9338
+ super();
7822
9339
  this.tool = "";
7823
9340
  this.scopes = [];
7824
9341
  this.agentDid = "";
@@ -7829,6 +9346,7 @@ var McpConsent = class extends i4 {
7829
9346
  this.agentName = "";
7830
9347
  this.provider = "";
7831
9348
  this.csrfToken = "";
9349
+ this.preview = false;
7832
9350
  this.credentialProviderType = "";
7833
9351
  this.credentialProvider = "";
7834
9352
  this.userDid = "";
@@ -7844,6 +9362,8 @@ var McpConsent = class extends i4 {
7844
9362
  this.inactivityDays = 90;
7845
9363
  this.consentTheme = "light";
7846
9364
  this.howItWorksUrl = "";
9365
+ this.via = "";
9366
+ this.connectorVariant = "bridge";
7847
9367
  this.authorizationType = "password";
7848
9368
  this.oauthProviderType = "";
7849
9369
  this.currentMode = AUTH_MODES.CONSENT_ONLY;
@@ -7855,7 +9375,7 @@ var McpConsent = class extends i4 {
7855
9375
  this.selectedScopes = [];
7856
9376
  this.closeFailed = false;
7857
9377
  this.restartApprovalPage = () => {
7858
- if (!this.approvalRecovery?.reload || !this.anchorSid || typeof window === "undefined")
9378
+ if (this.preview || !this.approvalRecovery?.reload || !this.anchorSid || typeof window === "undefined")
7859
9379
  return;
7860
9380
  const target = new URL("/consent", window.location.origin);
7861
9381
  target.searchParams.set("sid", this.anchorSid);
@@ -7877,6 +9397,7 @@ var McpConsent = class extends i4 {
7877
9397
  this.termsAccepted = true;
7878
9398
  void this.handleApprove();
7879
9399
  };
9400
+ guardPreviewNavigation(this);
7880
9401
  }
7881
9402
  /**
7882
9403
  * Flattened capability list, memoized against `this.capabilities` array
@@ -7904,13 +9425,12 @@ var McpConsent = class extends i4 {
7904
9425
  }
7905
9426
  return this.requestedCapabilitiesCache.result;
7906
9427
  }
7907
- // === LIFECYCLE ===
7908
9428
  connectedCallback() {
7909
9429
  super.connectedCallback();
7910
9430
  this.resolved = resolveConsentConfig(this.config, this.agentName);
7911
9431
  this.currentMode = this.mode ?? determineAuthMode(this.config) ?? AUTH_MODES.CONSENT_ONLY;
7912
9432
  this.selectedScopes = [...this.scopes];
7913
- this.readIdentityAssertionFromLocation();
9433
+ if (!this.preview) this.readIdentityAssertionFromLocation();
7914
9434
  this.scheduleRequestExpiry();
7915
9435
  }
7916
9436
  /**
@@ -8022,6 +9542,7 @@ var McpConsent = class extends i4 {
8022
9542
  */
8023
9543
  async handleApprove(e10) {
8024
9544
  e10?.preventDefault();
9545
+ if (this.preview) return;
8025
9546
  if (this.nativeScopeSelection && this.requestExpiresAt > 0 && Date.now() >= this.requestExpiresAt)
8026
9547
  this.setApprovalRecovery("kyaos/pickup-expired");
8027
9548
  if (this.approvalRecovery) return;
@@ -8168,6 +9689,7 @@ var McpConsent = class extends i4 {
8168
9689
  }
8169
9690
  }
8170
9691
  handleDeny() {
9692
+ if (this.preview) return;
8171
9693
  this.dispatchEvent(
8172
9694
  new CustomEvent("mcp-consent:deny", {
8173
9695
  bubbles: true,
@@ -8177,6 +9699,7 @@ var McpConsent = class extends i4 {
8177
9699
  window.close();
8178
9700
  }
8179
9701
  handleClose() {
9702
+ if (this.preview) return;
8180
9703
  window.close();
8181
9704
  setTimeout(() => {
8182
9705
  this.closeFailed = true;
@@ -8189,7 +9712,7 @@ var McpConsent = class extends i4 {
8189
9712
  this.formData = { ...this.formData, [name]: value };
8190
9713
  }
8191
9714
  handleResendOtp() {
8192
- if (this.resendCooldown > 0) {
9715
+ if (this.preview || this.resendCooldown > 0) {
8193
9716
  return;
8194
9717
  }
8195
9718
  const cooldownSeconds = this.resolved?.otp?.resendCooldown ?? 60;
@@ -8285,6 +9808,7 @@ var McpConsent = class extends i4 {
8285
9808
  return b2`
8286
9809
  <div class="terms">
8287
9810
  <consent-terms
9811
+ ?preview=${this.preview}
8288
9812
  name="termsAccepted"
8289
9813
  text=${this.resolved.terms.text}
8290
9814
  url=${this.resolved.terms.url ?? ""}
@@ -8313,7 +9837,7 @@ var McpConsent = class extends i4 {
8313
9837
  }
8314
9838
  scheduleRequestExpiry() {
8315
9839
  clearTimeout(this.requestExpiryTimer);
8316
- if (!this.nativeScopeSelection || !Number.isSafeInteger(this.requestExpiresAt) || this.requestExpiresAt <= 0)
9840
+ if (this.preview || !this.nativeScopeSelection || !Number.isSafeInteger(this.requestExpiresAt) || this.requestExpiresAt <= 0)
8317
9841
  return;
8318
9842
  const remaining = this.requestExpiresAt - Date.now();
8319
9843
  if (remaining <= 0) {
@@ -8341,6 +9865,7 @@ var McpConsent = class extends i4 {
8341
9865
  <p>${this.approvalRecovery.message}</p>
8342
9866
  ${this.approvalRecovery.reload ? b2`<consent-button
8343
9867
  variant="secondary"
9868
+ ?preview=${this.preview}
8344
9869
  @click=${this.restartApprovalPage}
8345
9870
  >Reload and sign in again</consent-button
8346
9871
  >` : A}
@@ -8366,12 +9891,17 @@ var McpConsent = class extends i4 {
8366
9891
  const { allowSubmit = true, submitText } = options;
8367
9892
  return b2`
8368
9893
  <div slot="footer">
8369
- <consent-button variant="secondary" @click=${this.handleDeny}>
9894
+ <consent-button
9895
+ variant="secondary"
9896
+ ?preview=${this.preview}
9897
+ @click=${this.handleDeny}
9898
+ >
8370
9899
  ${this.resolved?.ui.cancelButtonText ?? "Cancel"}
8371
9900
  </consent-button>
8372
9901
  ${allowSubmit ? b2`
8373
9902
  <consent-button
8374
9903
  variant="primary"
9904
+ ?preview=${this.preview}
8375
9905
  ?loading=${this.loading}
8376
9906
  ?disabled=${!!this.approvalRecovery || this.currentMode === AUTH_MODES.CONSENT_ONLY && this.resolved?.terms.required && !this.termsAccepted}
8377
9907
  @click=${this.handleApprove}
@@ -8486,6 +10016,7 @@ var McpConsent = class extends i4 {
8486
10016
  <div slot="content">
8487
10017
  ${this.renderError()} ${this.renderAgentInfo()}
8488
10018
  ${this.approvalRecovery ? A : b2`<consent-oauth-button
10019
+ ?preview=${this.preview}
8489
10020
  provider=${provider}
8490
10021
  provider-name=${providerName}
8491
10022
  url=${oauthButtonUrl}
@@ -8706,6 +10237,7 @@ var McpConsent = class extends i4 {
8706
10237
  <consent-button
8707
10238
  variant="primary"
8708
10239
  full-width
10240
+ ?preview=${this.preview}
8709
10241
  @click=${this.handleClose}
8710
10242
  >
8711
10243
  ${success?.continueButtonText ?? "Continue"}
@@ -8772,6 +10304,7 @@ var McpConsent = class extends i4 {
8772
10304
  const allSelected = this.requiresAllCapabilities;
8773
10305
  return b2`
8774
10306
  <consent-capabilities-screen
10307
+ ?preview=${this.preview}
8775
10308
  .capabilities=${flatCapabilities}
8776
10309
  .agentMetadata=${agent.agentMetadata}
8777
10310
  .agentIdentity=${agent.agentIdentity}
@@ -8785,6 +10318,8 @@ var McpConsent = class extends i4 {
8785
10318
  fixed-expiry-days=${this.resolved?.fixedExpiryDays ?? A}
8786
10319
  theme="${this.consentTheme}"
8787
10320
  how-it-works-url="${this.howItWorksUrl}"
10321
+ connector-variant=${this.connectorVariant}
10322
+ via=${this.via}
8788
10323
  ?loading=${this.loading}
8789
10324
  ?all-selected=${allSelected}
8790
10325
  ?disabled=${!!this.approvalRecovery}
@@ -8999,7 +10534,7 @@ McpConsent.styles = i`
8999
10534
  /* Success Container - Standalone layout without consent-shell */
9000
10535
  .success-container {
9001
10536
  background: white;
9002
- border-radius: 20px;
10537
+ border-radius: var(--cs-card-radius, 20px);
9003
10538
  border: 1px solid rgba(0, 0, 0, 0.1);
9004
10539
  box-shadow:
9005
10540
  0 20px 25px -5px rgba(0, 0, 0, 0.1),
@@ -9304,6 +10839,9 @@ __decorateClass([
9304
10839
  __decorateClass([
9305
10840
  n4({ type: String, attribute: "preview-step" })
9306
10841
  ], McpConsent.prototype, "previewStep", 2);
10842
+ __decorateClass([
10843
+ n4({ type: Boolean, reflect: true })
10844
+ ], McpConsent.prototype, "preview", 2);
9307
10845
  __decorateClass([
9308
10846
  n4({ type: String, attribute: "credential-provider-type" })
9309
10847
  ], McpConsent.prototype, "credentialProviderType", 2);
@@ -9400,6 +10938,12 @@ __decorateClass([
9400
10938
  __decorateClass([
9401
10939
  n4({ type: String, attribute: "how-it-works-url" })
9402
10940
  ], McpConsent.prototype, "howItWorksUrl", 2);
10941
+ __decorateClass([
10942
+ n4({ type: String })
10943
+ ], McpConsent.prototype, "via", 2);
10944
+ __decorateClass([
10945
+ n4({ type: String, attribute: "connector-variant" })
10946
+ ], McpConsent.prototype, "connectorVariant", 2);
9403
10947
  __decorateClass([
9404
10948
  n4({
9405
10949
  type: Object,
@@ -9479,7 +11023,216 @@ McpConsent = __decorateClass([
9479
11023
  t3("mcp-consent")
9480
11024
  ], McpConsent);
9481
11025
 
9482
- // ../../node_modules/.pnpm/@kya-os+id@0.8.0_@cfworker+json-schema@4.1.1_better-auth@1.7.7_@opentelemetry+api@1.9.0_e82dbb56096291ceb7712125c72d027a/node_modules/@kya-os/id/dist/base64url.js
11026
+ // src/styles/brand.ts
11027
+ var AA_GRAPHIC_CONTRAST = 3;
11028
+ var TEXT_CONTRAST = 4.5;
11029
+ var ICON_TILE_PERCENT = 8;
11030
+ var HOVERED_ROW_PERCENT = 4;
11031
+ var MUTED_TEXT_PERCENT = 64;
11032
+ var PANEL_TINT_PERCENT = 4;
11033
+ var LIGHTNESS_STEP = 5e-3;
11034
+ var LIGHT_DRAWN_COLORS = Object.freeze({
11035
+ surface: lightTheme.surfaceCard,
11036
+ panel: lightTheme.surfaceInset,
11037
+ text: lightTheme.textPrimary,
11038
+ mutedText: lightTheme.textTertiary
11039
+ });
11040
+ var PALETTE_FIELDS = [
11041
+ "surfaceColor",
11042
+ "panelColor",
11043
+ "borderColor",
11044
+ "textColor",
11045
+ "mutedTextColor",
11046
+ "focusColor"
11047
+ ];
11048
+ function rgbOf(hex) {
11049
+ return [1, 3, 5].map((at) => Number.parseInt(hex.slice(at, at + 2), 16));
11050
+ }
11051
+ function hexOf(channels2) {
11052
+ return `#${channels2.map((value) => Math.round(value).toString(16).padStart(2, "0")).join("")}`;
11053
+ }
11054
+ function mixOver(top, percent, under) {
11055
+ const share = percent / 100;
11056
+ const below = rgbOf(under);
11057
+ return hexOf(
11058
+ rgbOf(top).map((above, i7) => above * share + below[i7] * (1 - share))
11059
+ );
11060
+ }
11061
+ function hslOf(hex) {
11062
+ const [red, green, blue] = rgbOf(hex).map((value) => value / 255);
11063
+ const high = Math.max(red, green, blue);
11064
+ const low = Math.min(red, green, blue);
11065
+ const spread = high - low;
11066
+ const lightness = (high + low) / 2;
11067
+ if (spread === 0) return { hue: 0, saturation: 0, lightness };
11068
+ const saturation = spread / (1 - Math.abs(2 * lightness - 1));
11069
+ const sector = high === red ? (green - blue) / spread : high === green ? (blue - red) / spread + 2 : (red - green) / spread + 4;
11070
+ return { hue: (sector * 60 + 360) % 360, saturation, lightness };
11071
+ }
11072
+ function hexFromHsl({ hue, saturation, lightness }) {
11073
+ const reach = saturation * Math.min(lightness, 1 - lightness);
11074
+ const channel = (offset) => {
11075
+ const turn = (offset + hue / 30) % 12;
11076
+ return (lightness - reach * Math.max(-1, Math.min(turn - 3, 9 - turn, 1))) * 255;
11077
+ };
11078
+ return hexOf([channel(0), channel(8), channel(4)]);
11079
+ }
11080
+ function iconColorFor(hex, primary, drawn = LIGHT_DRAWN_COLORS) {
11081
+ const hoveredRow = mixOver(primary, HOVERED_ROW_PERCENT, drawn.surface);
11082
+ const surfaces = [
11083
+ drawn.surface,
11084
+ drawn.panel,
11085
+ mixOver(primary, ICON_TILE_PERCENT, drawn.surface),
11086
+ mixOver(primary, ICON_TILE_PERCENT, hoveredRow)
11087
+ ];
11088
+ const worstRatio = (candidate) => Math.min(...surfaces.map((surface) => contrastRatio(candidate, surface)));
11089
+ if (worstRatio(hex) >= AA_GRAPHIC_CONTRAST) return hex;
11090
+ const start = hslOf(hex);
11091
+ for (let steps = 1; steps * LIGHTNESS_STEP <= 1; steps++) {
11092
+ for (const lightness of [
11093
+ start.lightness - steps * LIGHTNESS_STEP,
11094
+ start.lightness + steps * LIGHTNESS_STEP
11095
+ ]) {
11096
+ if (lightness < 0 || lightness > 1) continue;
11097
+ const candidate = hexFromHsl({ ...start, lightness });
11098
+ if (worstRatio(candidate) >= AA_GRAPHIC_CONTRAST) return candidate;
11099
+ }
11100
+ }
11101
+ return worstRatio("#000000") >= worstRatio("#ffffff") ? "#000000" : "#ffffff";
11102
+ }
11103
+ function focusRingFor(hex, surface = LIGHT_DRAWN_COLORS.surface) {
11104
+ return contrastRatio(hex, surface) >= AA_GRAPHIC_CONTRAST ? "brand" : "ink";
11105
+ }
11106
+ function readsOnCardAndTint(hex, ratio, surface) {
11107
+ const tint = mixOver(hex, TINT_PERCENT, surface);
11108
+ return contrastRatio(hex, surface) >= ratio && contrastRatio(hex, tint) >= ratio;
11109
+ }
11110
+ function actionColorFor(hex, surface = LIGHT_DRAWN_COLORS.surface) {
11111
+ return readsOnCardAndTint(hex, TEXT_CONTRAST, surface) ? "brand" : "ink";
11112
+ }
11113
+ function markColorFor(hex, surface = LIGHT_DRAWN_COLORS.surface) {
11114
+ return readsOnCardAndTint(hex, AA_GRAPHIC_CONTRAST, surface) ? "brand" : "ink";
11115
+ }
11116
+ function onPrimaryFor(hex) {
11117
+ const luminance = relativeLuminance(hex);
11118
+ const againstWhite = 1.05 / (luminance + 0.05);
11119
+ const againstBlack = (luminance + 0.05) / 0.05;
11120
+ return againstBlack >= againstWhite ? "black" : "white";
11121
+ }
11122
+ function panelOf(palette, text, drawn) {
11123
+ if (palette.panelColor) return palette.panelColor;
11124
+ if (palette.surfaceColor)
11125
+ return mixOver(text, PANEL_TINT_PERCENT, palette.surfaceColor);
11126
+ return drawn.panel;
11127
+ }
11128
+ function mutedOn(palette, background, drawn) {
11129
+ if (palette.mutedTextColor) return palette.mutedTextColor;
11130
+ if (palette.textColor)
11131
+ return mixOver(palette.textColor, MUTED_TEXT_PERCENT, background);
11132
+ return drawn.mutedText;
11133
+ }
11134
+ function floorToHundredths(ratio) {
11135
+ return Math.floor(ratio * 100) / 100;
11136
+ }
11137
+ function paletteFailures(palette, drawn = {}) {
11138
+ const colors = { ...LIGHT_DRAWN_COLORS, ...drawn };
11139
+ const text = palette.textColor ?? colors.text;
11140
+ const backgrounds = [
11141
+ {
11142
+ background: "surfaceColor",
11143
+ color: palette.surfaceColor ?? colors.surface
11144
+ },
11145
+ { background: "panelColor", color: panelOf(palette, text, colors) }
11146
+ ];
11147
+ return backgrounds.flatMap(({ background, color }) => {
11148
+ const pairs = [
11149
+ { foreground: "textColor", color: text, needs: TEXT_CONTRAST },
11150
+ {
11151
+ foreground: "mutedTextColor",
11152
+ color: mutedOn(palette, color, colors),
11153
+ needs: TEXT_CONTRAST
11154
+ },
11155
+ ...palette.focusColor ? [
11156
+ {
11157
+ foreground: "focusColor",
11158
+ color: palette.focusColor,
11159
+ needs: AA_GRAPHIC_CONTRAST
11160
+ }
11161
+ ] : []
11162
+ ];
11163
+ return pairs.flatMap(({ foreground, color: ink, needs }) => {
11164
+ const ratio = contrastRatio(ink, color);
11165
+ return ratio >= needs ? [] : [{ foreground, background, ratio: floorToHundredths(ratio), needs }];
11166
+ });
11167
+ });
11168
+ }
11169
+ function drawablePalette(chosen, drawn = {}) {
11170
+ const { focusColor, borderColor, ...surfacesAndText } = chosen;
11171
+ const kept = paletteFailures(surfacesAndText, drawn).length === 0 ? surfacesAndText : {};
11172
+ const focusShows = focusColor !== void 0 && paletteFailures({ ...kept, focusColor }, drawn).length === 0;
11173
+ return {
11174
+ ...kept,
11175
+ ...borderColor ? { borderColor } : {},
11176
+ ...focusShows ? { focusColor } : {}
11177
+ };
11178
+ }
11179
+ function brandTokens(brand) {
11180
+ for (const [field, value] of Object.entries(brand)) {
11181
+ if (value !== void 0 && !isHexColor(value)) {
11182
+ throw new RangeError(
11183
+ `${field} must be a #rrggbb color, got ${JSON.stringify(value)}`
11184
+ );
11185
+ }
11186
+ }
11187
+ const { primaryColor: primary, secondaryColor, ...chosen } = brand;
11188
+ const palette = drawablePalette(chosen);
11189
+ const surface = palette.surfaceColor ?? LIGHT_DRAWN_COLORS.surface;
11190
+ const panel = panelOf(
11191
+ palette,
11192
+ palette.textColor ?? LIGHT_DRAWN_COLORS.text,
11193
+ LIGHT_DRAWN_COLORS
11194
+ );
11195
+ const ink = palette.textColor ?? LIGHT_DRAWN_COLORS.text;
11196
+ const onPrimary = onPrimaryFor(primary);
11197
+ const inBrand = (pick) => pick === "brand" ? primary : ink;
11198
+ const tokens = {
11199
+ "--consent-primary": primary,
11200
+ "--consent-on-primary": onPrimary,
11201
+ "--consent-link": inBrand(actionColorFor(primary, surface)),
11202
+ "--cs-surface-accent": primary,
11203
+ "--cs-surface-accent-text": onPrimary,
11204
+ "--cs-tint": mixOver(primary, TINT_PERCENT, surface),
11205
+ "--cs-tint-line": mixOver(primary, TINT_LINE_PERCENT, surface),
11206
+ "--cs-mark": inBrand(markColorFor(primary, surface)),
11207
+ "--cs-action": inBrand(actionColorFor(primary, surface)),
11208
+ "--cs-focus-ring": palette.focusColor ?? inBrand(focusRingFor(primary, surface))
11209
+ };
11210
+ if (secondaryColor) {
11211
+ tokens["--cs-icon"] = iconColorFor(secondaryColor, primary, {
11212
+ surface,
11213
+ panel
11214
+ });
11215
+ }
11216
+ if (palette.surfaceColor) tokens["--cs-surface-card"] = palette.surfaceColor;
11217
+ if (palette.surfaceColor || palette.panelColor)
11218
+ tokens["--cs-surface-inset"] = panel;
11219
+ if (palette.borderColor) tokens["--cs-surface-border"] = palette.borderColor;
11220
+ if (palette.textColor) {
11221
+ tokens["--cs-text-primary"] = palette.textColor;
11222
+ tokens["--cs-text-secondary"] = palette.textColor;
11223
+ }
11224
+ if (palette.mutedTextColor) {
11225
+ tokens["--cs-text-tertiary"] = palette.mutedTextColor;
11226
+ } else if (palette.textColor) {
11227
+ tokens["--cs-text-tertiary"] = `color-mix(in srgb, ${palette.textColor} ${MUTED_TEXT_PERCENT}%, transparent)`;
11228
+ }
11229
+ return tokens;
11230
+ }
11231
+ function brandStyle(brand) {
11232
+ return Object.entries(brandTokens(brand)).map(([property, value]) => `${property}: ${value};`).join(" ");
11233
+ }
11234
+
11235
+ // ../../node_modules/.pnpm/@kya-os+id@0.8.0_@cfworker+json-schema@4.1.1_better-auth@1.7.7_@opentelemetry+api@1.9.0_98d979a42ec866ed3ae12afd77bd7a00/node_modules/@kya-os/id/dist/base64url.js
9483
11236
  function bytesToBase64Url(bytes) {
9484
11237
  let b642;
9485
11238
  if (typeof Buffer !== "undefined") {
@@ -9514,14 +11267,14 @@ function base64UrlToBytesStrict(s5) {
9514
11267
  return bytesToBase64Url(bytes) === s5 ? bytes : null;
9515
11268
  }
9516
11269
 
9517
- // ../../node_modules/.pnpm/@kya-os+id@0.8.0_@cfworker+json-schema@4.1.1_better-auth@1.7.7_@opentelemetry+api@1.9.0_e82dbb56096291ceb7712125c72d027a/node_modules/@kya-os/id/dist/passkey/types.js
11270
+ // ../../node_modules/.pnpm/@kya-os+id@0.8.0_@cfworker+json-schema@4.1.1_better-auth@1.7.7_@opentelemetry+api@1.9.0_98d979a42ec866ed3ae12afd77bd7a00/node_modules/@kya-os/id/dist/passkey/types.js
9518
11271
  var PASSKEY_COSE_ALGORITHMS = Object.freeze([
9519
11272
  -8,
9520
11273
  -7,
9521
11274
  -257
9522
11275
  ]);
9523
11276
 
9524
- // ../../node_modules/.pnpm/@kya-os+id@0.8.0_@cfworker+json-schema@4.1.1_better-auth@1.7.7_@opentelemetry+api@1.9.0_e82dbb56096291ceb7712125c72d027a/node_modules/@kya-os/id/dist/wallet/passkey.js
11277
+ // ../../node_modules/.pnpm/@kya-os+id@0.8.0_@cfworker+json-schema@4.1.1_better-auth@1.7.7_@opentelemetry+api@1.9.0_98d979a42ec866ed3ae12afd77bd7a00/node_modules/@kya-os/id/dist/wallet/passkey.js
9525
11278
  var PasskeyCeremonyError = class extends Error {
9526
11279
  constructor(code, message, options) {
9527
11280
  super(message, options);
@@ -9734,6 +11487,7 @@ var ConsentPasskey = class extends i4 {
9734
11487
  constructor() {
9735
11488
  super(...arguments);
9736
11489
  this.disabled = false;
11490
+ this.preview = false;
9737
11491
  this.supportResult = null;
9738
11492
  this.phase = "checking";
9739
11493
  /** Bumped on every start and every new step, so a stale result is dropped. */
@@ -9789,6 +11543,7 @@ var ConsentPasskey = class extends i4 {
9789
11543
  }
9790
11544
  /** The button's click handler: the only path that starts a ceremony. */
9791
11545
  async handleClick() {
11546
+ if (this.preview) return;
9792
11547
  const ceremony = this.validCeremony();
9793
11548
  const options = this.options;
9794
11549
  if (!this.canStart() || ceremony === void 0 || !options) return;
@@ -9871,12 +11626,17 @@ var ConsentPasskey = class extends i4 {
9871
11626
  <button
9872
11627
  part="button"
9873
11628
  type="button"
9874
- ?disabled=${!this.canStart()}
11629
+ ?disabled=${!this.preview && !this.canStart()}
9875
11630
  @click=${this.handleClick}
9876
11631
  >
9877
- ${this.config?.buttonText || ceremonyCopy.button}
11632
+ ${renderButtonIcon()}${this.config?.buttonText || ceremonyCopy.button}
9878
11633
  </button>
9879
- <p class="status" part="status" role="status" aria-live="polite">
11634
+ <p
11635
+ class="status${status ? "" : " quiet"}"
11636
+ part="status"
11637
+ role="status"
11638
+ aria-live="polite"
11639
+ >
9880
11640
  ${status}
9881
11641
  </p>
9882
11642
  ${errorCode ? b2`<p class="error" part="error" role="alert">
@@ -9897,6 +11657,7 @@ ConsentPasskey.styles = i`
9897
11657
  }
9898
11658
 
9899
11659
  .container {
11660
+ position: relative;
9900
11661
  display: flex;
9901
11662
  flex-direction: column;
9902
11663
  gap: 12px;
@@ -9937,11 +11698,17 @@ ConsentPasskey.styles = i`
9937
11698
  color: var(--cs-text-secondary, #334155);
9938
11699
  }
9939
11700
 
11701
+ /* Set out like the action bar's passkey Allow: the fingerprint, then the label. */
9940
11702
  button {
11703
+ display: flex;
11704
+ align-items: center;
11705
+ justify-content: center;
11706
+ gap: 8px;
11707
+ box-sizing: border-box;
9941
11708
  width: 100%;
9942
11709
  padding: 14px 18px;
9943
11710
  border: none;
9944
- border-radius: 999px;
11711
+ border-radius: var(--cs-action-radius, 6px);
9945
11712
  min-height: var(--cs-action-min-height, 0px);
9946
11713
  background: var(--cs-surface-accent, #0f172a);
9947
11714
  color: var(--cs-surface-accent-text, #ffffff);
@@ -9956,6 +11723,12 @@ ConsentPasskey.styles = i`
9956
11723
  opacity: 0.92;
9957
11724
  }
9958
11725
 
11726
+ .button-icon {
11727
+ flex: none;
11728
+ width: 16px;
11729
+ height: 16px;
11730
+ }
11731
+
9959
11732
  button:disabled {
9960
11733
  opacity: 0.5;
9961
11734
  cursor: not-allowed;
@@ -9968,13 +11741,25 @@ ConsentPasskey.styles = i`
9968
11741
 
9969
11742
  .status {
9970
11743
  margin: 0;
9971
- min-height: 1em;
9972
11744
  font-size: 12.5px;
9973
- color: var(--cs-text-tertiary, #64748b);
11745
+ color: var(--cs-text-tertiary, #5d6c82);
9974
11746
  }
9975
11747
 
9976
- .status:empty {
9977
- display: none;
11748
+ /*
11749
+ * With nothing to say, the line takes no room and no gap, so the button
11750
+ * sits as far from the card's bottom as the heading from its top. It is
11751
+ * hidden from sight only, not with display: none, so it stays a live
11752
+ * region a screen reader watches and what it says next is announced.
11753
+ * A class marks it, not :empty: the template's whitespace around the
11754
+ * text keeps :empty from ever matching.
11755
+ */
11756
+ .status.quiet {
11757
+ position: absolute;
11758
+ width: 1px;
11759
+ height: 1px;
11760
+ overflow: hidden;
11761
+ clip-path: inset(50%);
11762
+ white-space: nowrap;
9978
11763
  }
9979
11764
 
9980
11765
  .error {
@@ -9991,7 +11776,7 @@ ConsentPasskey.styles = i`
9991
11776
  margin: 0;
9992
11777
  font-size: 12.5px;
9993
11778
  line-height: 1.5;
9994
- color: var(--cs-text-tertiary, #64748b);
11779
+ color: var(--cs-text-tertiary, #5d6c82);
9995
11780
  }
9996
11781
  `;
9997
11782
  __decorateClass([
@@ -10006,6 +11791,9 @@ __decorateClass([
10006
11791
  __decorateClass([
10007
11792
  n4({ type: Boolean, reflect: true })
10008
11793
  ], ConsentPasskey.prototype, "disabled", 2);
11794
+ __decorateClass([
11795
+ n4({ type: Boolean, reflect: true })
11796
+ ], ConsentPasskey.prototype, "preview", 2);
10009
11797
  __decorateClass([
10010
11798
  r5()
10011
11799
  ], ConsentPasskey.prototype, "supportResult", 2);
@@ -10027,6 +11815,21 @@ function toErrorDetail(error) {
10027
11815
  message: error instanceof Error ? error.message : String(error)
10028
11816
  };
10029
11817
  }
11818
+ function renderButtonIcon() {
11819
+ return b2`<svg
11820
+ part="button-icon"
11821
+ class="button-icon"
11822
+ viewBox="0 0 24 24"
11823
+ fill="none"
11824
+ stroke="currentColor"
11825
+ stroke-width="2"
11826
+ stroke-linecap="round"
11827
+ stroke-linejoin="round"
11828
+ aria-hidden="true"
11829
+ >
11830
+ ${fingerprintIcon}
11831
+ </svg>`;
11832
+ }
10030
11833
  function renderIcon() {
10031
11834
  return b2`
10032
11835
  <svg
@@ -10046,6 +11849,8 @@ function renderIcon() {
10046
11849
  }
10047
11850
  export {
10048
11851
  CONSENT_CAPABILITIES_FEATURES,
11852
+ CONSENT_EDIT_EVENTS,
11853
+ CONSENT_EDIT_KEYS,
10049
11854
  ConsentActionBar,
10050
11855
  ConsentAgentHeader,
10051
11856
  ConsentButton,
@@ -10063,7 +11868,13 @@ export {
10063
11868
  ConsentRevocationNotice,
10064
11869
  ConsentShell,
10065
11870
  ConsentTerms,
10066
- McpConsent
11871
+ McpConsent,
11872
+ PALETTE_FIELDS,
11873
+ brandStyle,
11874
+ brandTokens,
11875
+ drawablePalette,
11876
+ paletteFailures,
11877
+ parseConsentEditKey
10067
11878
  };
10068
11879
  /*! Bundled license information:
10069
11880