@kya-os/consent 0.4.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.
- package/README.md +182 -22
- package/dist/bundle/index.d.ts +4 -0
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/index.js +6 -0
- package/dist/bundle/index.js.map +1 -1
- package/dist/bundle/inline.d.ts.map +1 -1
- package/dist/bundle/inline.js +4 -4
- package/dist/bundle/inline.js.map +1 -1
- package/dist/cjs/bundle/index.js +15 -1
- package/dist/cjs/bundle/index.js.map +1 -1
- package/dist/cjs/bundle/inline.js +4 -4
- package/dist/cjs/bundle/inline.js.map +1 -1
- package/dist/cjs/components/consent-action-bar.js +97 -25
- package/dist/cjs/components/consent-action-bar.js.map +1 -1
- package/dist/cjs/components/consent-agent-header.js +7 -105
- package/dist/cjs/components/consent-agent-header.js.map +1 -1
- package/dist/cjs/components/consent-button.js +6 -1
- package/dist/cjs/components/consent-button.js.map +1 -1
- package/dist/cjs/components/consent-capabilities-screen.js +454 -68
- package/dist/cjs/components/consent-capabilities-screen.js.map +1 -1
- package/dist/cjs/components/consent-capability-card.js +131 -27
- package/dist/cjs/components/consent-capability-card.js.map +1 -1
- package/dist/cjs/components/consent-checkbox.js +7 -0
- package/dist/cjs/components/consent-checkbox.js.map +1 -1
- package/dist/cjs/components/consent-connector-header.js +206 -43
- package/dist/cjs/components/consent-connector-header.js.map +1 -1
- package/dist/cjs/components/consent-duration.js +1 -1
- package/dist/cjs/components/consent-footer.js +13 -12
- package/dist/cjs/components/consent-footer.js.map +1 -1
- package/dist/cjs/components/consent-headline.js +399 -33
- package/dist/cjs/components/consent-headline.js.map +1 -1
- package/dist/cjs/components/consent-oauth-button.js +71 -62
- package/dist/cjs/components/consent-oauth-button.js.map +1 -1
- package/dist/cjs/components/consent-otp-input.js +5 -0
- package/dist/cjs/components/consent-otp-input.js.map +1 -1
- package/dist/cjs/components/consent-phone-handoff.js +3 -3
- package/dist/cjs/components/consent-request-expiry.js +1 -1
- package/dist/cjs/components/consent-revocation-notice.js +4 -2
- package/dist/cjs/components/consent-revocation-notice.js.map +1 -1
- package/dist/cjs/components/consent-revoke.js +9 -4
- package/dist/cjs/components/consent-revoke.js.map +1 -1
- package/dist/cjs/components/consent-secured-by.js +106 -0
- package/dist/cjs/components/consent-secured-by.js.map +1 -0
- package/dist/cjs/components/consent-shell.js +1 -1
- package/dist/cjs/components/consent-terms.js +7 -0
- package/dist/cjs/components/consent-terms.js.map +1 -1
- package/dist/cjs/components/consent-wallet-check.js +1 -1
- package/dist/cjs/components/consent-wallet-notice.js +1 -1
- package/dist/cjs/components/consent-wallet-orb.js +1 -1
- package/dist/cjs/components/consent-wallet-signature.js +1 -1
- package/dist/cjs/components/decision-icons.js +33 -0
- package/dist/cjs/components/decision-icons.js.map +1 -0
- package/dist/cjs/components/edit-region.js +309 -0
- package/dist/cjs/components/edit-region.js.map +1 -0
- package/dist/cjs/components/grant-field-styles.js +2 -2
- package/dist/cjs/components/index.js +4 -1
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/mcp-consent.js +81 -36
- package/dist/cjs/components/mcp-consent.js.map +1 -1
- package/dist/cjs/components/preview.js +67 -0
- package/dist/cjs/components/preview.js.map +1 -0
- package/dist/cjs/constants/capabilities.js +12 -2
- package/dist/cjs/constants/capabilities.js.map +1 -1
- package/dist/cjs/copy/tokens.js +60 -21
- package/dist/cjs/copy/tokens.js.map +1 -1
- package/dist/cjs/identity/agent-identity.js +3 -2
- package/dist/cjs/identity/agent-identity.js.map +1 -1
- package/dist/cjs/mcp-app/inline.js +2 -2
- package/dist/cjs/mcp-app/inline.js.map +1 -1
- package/dist/cjs/react/index.js +11 -2
- package/dist/cjs/react/index.js.map +1 -1
- package/dist/cjs/styles/brand.js +385 -0
- package/dist/cjs/styles/brand.js.map +1 -0
- package/dist/cjs/styles/index.js +1 -0
- package/dist/cjs/styles/index.js.map +1 -1
- package/dist/cjs/styles/theme.js +100 -30
- package/dist/cjs/styles/theme.js.map +1 -1
- package/dist/cjs/types/capabilities.types.js +1 -2
- package/dist/cjs/types/capabilities.types.js.map +1 -1
- package/dist/cjs/types/decision.types.js +13 -0
- package/dist/cjs/types/decision.types.js.map +1 -0
- package/dist/cjs/types/edit.types.js +80 -0
- package/dist/cjs/types/edit.types.js.map +1 -0
- package/dist/cjs/types/index.js +2 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/components/consent-action-bar.d.ts +20 -1
- package/dist/components/consent-action-bar.d.ts.map +1 -1
- package/dist/components/consent-action-bar.js +97 -25
- package/dist/components/consent-action-bar.js.map +1 -1
- package/dist/components/consent-agent-header.d.ts +4 -17
- package/dist/components/consent-agent-header.d.ts.map +1 -1
- package/dist/components/consent-agent-header.js +7 -105
- package/dist/components/consent-agent-header.js.map +1 -1
- package/dist/components/consent-button.d.ts +2 -0
- package/dist/components/consent-button.d.ts.map +1 -1
- package/dist/components/consent-button.js +6 -1
- package/dist/components/consent-button.js.map +1 -1
- package/dist/components/consent-capabilities-screen.d.ts +85 -17
- package/dist/components/consent-capabilities-screen.d.ts.map +1 -1
- package/dist/components/consent-capabilities-screen.js +456 -70
- package/dist/components/consent-capabilities-screen.js.map +1 -1
- package/dist/components/consent-capability-card.d.ts +23 -3
- package/dist/components/consent-capability-card.d.ts.map +1 -1
- package/dist/components/consent-capability-card.js +131 -27
- package/dist/components/consent-capability-card.js.map +1 -1
- package/dist/components/consent-checkbox.d.ts +2 -0
- package/dist/components/consent-checkbox.d.ts.map +1 -1
- package/dist/components/consent-checkbox.js +7 -0
- package/dist/components/consent-checkbox.js.map +1 -1
- package/dist/components/consent-connector-header.d.ts +39 -7
- package/dist/components/consent-connector-header.d.ts.map +1 -1
- package/dist/components/consent-connector-header.js +206 -43
- package/dist/components/consent-connector-header.js.map +1 -1
- package/dist/components/consent-duration.js +1 -1
- package/dist/components/consent-footer.d.ts +6 -4
- package/dist/components/consent-footer.d.ts.map +1 -1
- package/dist/components/consent-footer.js +13 -12
- package/dist/components/consent-footer.js.map +1 -1
- package/dist/components/consent-headline.d.ts +55 -16
- package/dist/components/consent-headline.d.ts.map +1 -1
- package/dist/components/consent-headline.js +398 -34
- package/dist/components/consent-headline.js.map +1 -1
- package/dist/components/consent-oauth-button.d.ts +7 -3
- package/dist/components/consent-oauth-button.d.ts.map +1 -1
- package/dist/components/consent-oauth-button.js +74 -65
- package/dist/components/consent-oauth-button.js.map +1 -1
- package/dist/components/consent-otp-input.d.ts.map +1 -1
- package/dist/components/consent-otp-input.js +5 -0
- package/dist/components/consent-otp-input.js.map +1 -1
- package/dist/components/consent-passkey.d.ts +6 -0
- package/dist/components/consent-passkey.d.ts.map +1 -1
- package/dist/components/consent-passkey.js +67 -9
- package/dist/components/consent-passkey.js.map +1 -1
- package/dist/components/consent-phone-handoff.js +3 -3
- package/dist/components/consent-request-expiry.js +1 -1
- package/dist/components/consent-revocation-notice.d.ts.map +1 -1
- package/dist/components/consent-revocation-notice.js +4 -2
- package/dist/components/consent-revocation-notice.js.map +1 -1
- package/dist/components/consent-revoke.d.ts +2 -0
- package/dist/components/consent-revoke.d.ts.map +1 -1
- package/dist/components/consent-revoke.js +9 -4
- package/dist/components/consent-revoke.js.map +1 -1
- package/dist/components/consent-secured-by.d.ts +25 -0
- package/dist/components/consent-secured-by.d.ts.map +1 -0
- package/dist/components/consent-secured-by.js +103 -0
- package/dist/components/consent-secured-by.js.map +1 -0
- package/dist/components/consent-shell.js +1 -1
- package/dist/components/consent-terms.d.ts +2 -0
- package/dist/components/consent-terms.d.ts.map +1 -1
- package/dist/components/consent-terms.js +7 -0
- package/dist/components/consent-terms.js.map +1 -1
- package/dist/components/consent-wallet-check.js +1 -1
- package/dist/components/consent-wallet-notice.js +1 -1
- package/dist/components/consent-wallet-orb.js +1 -1
- package/dist/components/consent-wallet-signature.js +1 -1
- package/dist/components/decision-icons.d.ts +22 -0
- package/dist/components/decision-icons.d.ts.map +1 -0
- package/dist/components/decision-icons.js +30 -0
- package/dist/components/decision-icons.js.map +1 -0
- package/dist/components/edit-region.d.ts +50 -0
- package/dist/components/edit-region.d.ts.map +1 -0
- package/dist/components/edit-region.js +305 -0
- package/dist/components/edit-region.js.map +1 -0
- package/dist/components/grant-field-styles.js +2 -2
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/mcp-consent.d.ts +15 -0
- package/dist/components/mcp-consent.d.ts.map +1 -1
- package/dist/components/mcp-consent.js +81 -36
- package/dist/components/mcp-consent.js.map +1 -1
- package/dist/components/preview.d.ts +38 -0
- package/dist/components/preview.d.ts.map +1 -0
- package/dist/components/preview.js +61 -0
- package/dist/components/preview.js.map +1 -0
- package/dist/consent.js +2104 -389
- package/dist/consent.min.js +1289 -497
- package/dist/constants/capabilities.d.ts +12 -3
- package/dist/constants/capabilities.d.ts.map +1 -1
- package/dist/constants/capabilities.js +12 -2
- package/dist/constants/capabilities.js.map +1 -1
- package/dist/copy/tokens.d.ts +60 -21
- package/dist/copy/tokens.d.ts.map +1 -1
- package/dist/copy/tokens.js +60 -21
- package/dist/copy/tokens.js.map +1 -1
- package/dist/identity/agent-identity.d.ts +3 -2
- package/dist/identity/agent-identity.d.ts.map +1 -1
- package/dist/identity/agent-identity.js +3 -2
- package/dist/identity/agent-identity.js.map +1 -1
- package/dist/mcp-app/inline.d.ts.map +1 -1
- package/dist/mcp-app/inline.js +2 -2
- package/dist/mcp-app/inline.js.map +1 -1
- package/dist/react/index.d.ts +6 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +10 -1
- package/dist/react/index.js.map +1 -1
- package/dist/styles/brand.d.ts +184 -0
- package/dist/styles/brand.d.ts.map +1 -0
- package/dist/styles/brand.js +372 -0
- package/dist/styles/brand.js.map +1 -0
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/index.d.ts.map +1 -1
- package/dist/styles/index.js +1 -0
- package/dist/styles/index.js.map +1 -1
- package/dist/styles/theme.d.ts +73 -13
- package/dist/styles/theme.d.ts.map +1 -1
- package/dist/styles/theme.js +96 -29
- package/dist/styles/theme.js.map +1 -1
- package/dist/types/capabilities.types.d.ts +12 -14
- package/dist/types/capabilities.types.d.ts.map +1 -1
- package/dist/types/capabilities.types.js +1 -2
- package/dist/types/capabilities.types.js.map +1 -1
- package/dist/types/decision.types.d.ts +57 -0
- package/dist/types/decision.types.d.ts.map +1 -0
- package/dist/types/decision.types.js +12 -0
- package/dist/types/decision.types.js.map +1 -0
- package/dist/types/edit.types.d.ts +73 -0
- package/dist/types/edit.types.d.ts.map +1 -0
- package/dist/types/edit.types.js +76 -0
- package/dist/types/edit.types.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline.js","sourceRoot":"","sources":["../../../src/mcp-app/inline.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,sEAAsE;AACzD,QAAA,oBAAoB,GAAW,
|
|
1
|
+
{"version":3,"file":"inline.js","sourceRoot":"","sources":["../../../src/mcp-app/inline.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,sEAAsE;AACzD,QAAA,oBAAoB,GAAW,02x3BAA02x3B,CAAC;AAEv5x3B,4CAA4C;AAC/B,QAAA,yBAAyB,GAAW,MAAM,CAAC"}
|
package/dist/cjs/react/index.js
CHANGED
|
@@ -50,7 +50,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
50
50
|
};
|
|
51
51
|
})();
|
|
52
52
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
-
exports.ConsentPhoneHandoffReact = exports.ConsentRequestExpiryReact = exports.ConsentWalletSignatureReact = exports.ConsentWalletNoticeReact = exports.ConsentWalletCheckReact = exports.ConsentWalletOrbReact = exports.ConsentRevokeReact = exports.ConsentGrantTermsReact = exports.ConsentFolderScopeReact = exports.ConsentDurationReact = exports.ConsentFooterReact = exports.ConsentRevocationNoticeReact = exports.ConsentActionBarReact = exports.ConsentConnectorHeaderReact = exports.ConsentHeadlineReact = exports.ConsentAgentHeaderReact = exports.ConsentCapabilityCardReact = exports.ConsentCapabilitiesScreenReact = exports.McpConsentReact = exports.ConsentOTPInputReact = exports.ConsentOAuthButtonReact = exports.ConsentTermsReact = exports.ConsentPermissionsReact = exports.ConsentShellReact = exports.ConsentInputReact = exports.ConsentCheckboxReact = exports.ConsentButtonReact = void 0;
|
|
53
|
+
exports.ConsentPhoneHandoffReact = exports.ConsentRequestExpiryReact = exports.ConsentWalletSignatureReact = exports.ConsentWalletNoticeReact = exports.ConsentWalletCheckReact = exports.ConsentWalletOrbReact = exports.ConsentRevokeReact = exports.ConsentGrantTermsReact = exports.ConsentFolderScopeReact = exports.ConsentDurationReact = exports.ConsentSecuredByReact = exports.ConsentFooterReact = exports.ConsentRevocationNoticeReact = exports.ConsentActionBarReact = exports.ConsentConnectorHeaderReact = exports.ConsentHeadlineReact = exports.ConsentAgentHeaderReact = exports.ConsentCapabilityCardReact = exports.ConsentCapabilitiesScreenReact = exports.McpConsentReact = exports.ConsentOTPInputReact = exports.ConsentOAuthButtonReact = exports.ConsentTermsReact = exports.ConsentPermissionsReact = exports.ConsentShellReact = exports.ConsentInputReact = exports.ConsentCheckboxReact = exports.ConsentButtonReact = void 0;
|
|
54
54
|
const react_1 = require("@lit/react");
|
|
55
55
|
const React = __importStar(require("react"));
|
|
56
56
|
// Core components
|
|
@@ -74,6 +74,7 @@ const consent_connector_header_js_1 = require("../components/consent-connector-h
|
|
|
74
74
|
const consent_action_bar_js_1 = require("../components/consent-action-bar.js");
|
|
75
75
|
const consent_revocation_notice_js_1 = require("../components/consent-revocation-notice.js");
|
|
76
76
|
const consent_footer_js_1 = require("../components/consent-footer.js");
|
|
77
|
+
const consent_secured_by_js_1 = require("../components/consent-secured-by.js");
|
|
77
78
|
// Grant terms and taking a grant back
|
|
78
79
|
const consent_duration_js_1 = require("../components/consent-duration.js");
|
|
79
80
|
const consent_folder_scope_js_1 = require("../components/consent-folder-scope.js");
|
|
@@ -262,7 +263,7 @@ exports.ConsentCapabilityCardReact = (0, react_1.createComponent)({
|
|
|
262
263
|
},
|
|
263
264
|
});
|
|
264
265
|
/**
|
|
265
|
-
* React wrapper for consent-agent-header, the agent's name,
|
|
266
|
+
* React wrapper for consent-agent-header, the agent's name, logo and meta line.
|
|
266
267
|
*/
|
|
267
268
|
exports.ConsentAgentHeaderReact = (0, react_1.createComponent)({
|
|
268
269
|
tagName: "consent-agent-header",
|
|
@@ -315,6 +316,14 @@ exports.ConsentFooterReact = (0, react_1.createComponent)({
|
|
|
315
316
|
elementClass: consent_footer_js_1.ConsentFooter,
|
|
316
317
|
react: React,
|
|
317
318
|
});
|
|
319
|
+
/**
|
|
320
|
+
* React wrapper for consent-secured-by, "Secured by" and the Vouched lockup.
|
|
321
|
+
*/
|
|
322
|
+
exports.ConsentSecuredByReact = (0, react_1.createComponent)({
|
|
323
|
+
tagName: "consent-secured-by",
|
|
324
|
+
elementClass: consent_secured_by_js_1.ConsentSecuredBy,
|
|
325
|
+
react: React,
|
|
326
|
+
});
|
|
318
327
|
// ============================================================================
|
|
319
328
|
// Grant Terms and Revoke Wrappers
|
|
320
329
|
// ============================================================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/react/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,sCAA6D;AAC7D,6CAA+B;AAE/B,kBAAkB;AAClB,uEAAgE;AAChE,2EAAoE;AACpE,qEAA8D;AAC9D,qEAA8D;AAE9D,sBAAsB;AACtB,iFAA0E;AAC1E,qEAA8D;AAC9D,mFAA2E;AAC3E,6EAAqE;AAErE,sB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,wBAAwB;IACjC,YAAY,EAAE,gDAAoB;IAClC,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,SAAS,EAAE,yBAEV;KACF;CACF,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,wBAAwB,GAAG,IAAA,uBAAe,EAAC;IACtD,OAAO,EAAE,uBAAuB;IAChC,YAAY,EAAE,8CAAmB;IACjC,KAAK,EAAE,KAAK;CACb,CAAC,CAAC"}
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Brand Colors on the Consent Screens
|
|
4
|
+
*
|
|
5
|
+
* A host's brand is operator data: a primary color, maybe a secondary, and
|
|
6
|
+
* maybe the page's own colors (card, panel, border, text, quieter text, focus
|
|
7
|
+
* ring). These turn it into the `--cs-*` properties the screens read, each
|
|
8
|
+
* one checked so it reads:
|
|
9
|
+
*
|
|
10
|
+
* - a word in the brand (an action) reaches 4.5:1 (WCAG 1.4.3) on the card
|
|
11
|
+
* and on the brand's tint, else it is drawn in the text color;
|
|
12
|
+
* - a mark or focus ring in the brand reaches 3:1 (WCAG 1.4.11), else the
|
|
13
|
+
* text color;
|
|
14
|
+
* - an icon in the secondary keeps its hue and moves darker or lighter,
|
|
15
|
+
* whichever is nearer, until it reaches 3:1 on every surface an icon sits on;
|
|
16
|
+
* - a page color that would not read is dropped, and the theme's is drawn.
|
|
17
|
+
*
|
|
18
|
+
* `brandTokens(brand)` returns the properties; set them on any element above
|
|
19
|
+
* the screens (a style attribute is enough) and the screens take them.
|
|
20
|
+
* Everything here is pure: importing it defines no element.
|
|
21
|
+
*
|
|
22
|
+
* Unless a brand chooses its own page colors, these judge against the light
|
|
23
|
+
* theme's surfaces.
|
|
24
|
+
*
|
|
25
|
+
* @module @kya-os/consent/styles/brand
|
|
26
|
+
*/
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.PALETTE_FIELDS = exports.LIGHT_DRAWN_COLORS = exports.PANEL_TINT_PERCENT = exports.MUTED_TEXT_PERCENT = exports.HOVERED_ROW_PERCENT = exports.ICON_TILE_PERCENT = exports.AA_GRAPHIC_CONTRAST = void 0;
|
|
29
|
+
exports.mixOver = mixOver;
|
|
30
|
+
exports.iconColorFor = iconColorFor;
|
|
31
|
+
exports.focusRingFor = focusRingFor;
|
|
32
|
+
exports.actionColorFor = actionColorFor;
|
|
33
|
+
exports.markColorFor = markColorFor;
|
|
34
|
+
exports.onPrimaryFor = onPrimaryFor;
|
|
35
|
+
exports.paletteFailures = paletteFailures;
|
|
36
|
+
exports.drawablePalette = drawablePalette;
|
|
37
|
+
exports.brandTokens = brandTokens;
|
|
38
|
+
exports.brandStyle = brandStyle;
|
|
39
|
+
const contrast_js_1 = require("./contrast.js");
|
|
40
|
+
const theme_js_1 = require("./theme.js");
|
|
41
|
+
/** WCAG 1.4.11's ratio for a graphic or a focus indicator. */
|
|
42
|
+
exports.AA_GRAPHIC_CONTRAST = 3;
|
|
43
|
+
/** WCAG 1.4.3's ratio for text at body size. */
|
|
44
|
+
const TEXT_CONTRAST = 4.5;
|
|
45
|
+
/** The share of the primary in an icon's tile. */
|
|
46
|
+
exports.ICON_TILE_PERCENT = 8;
|
|
47
|
+
/** The share of the primary in a hovered row under that tile. */
|
|
48
|
+
exports.HOVERED_ROW_PERCENT = 4;
|
|
49
|
+
/** The share of the text in the quieter text the page draws from it. */
|
|
50
|
+
exports.MUTED_TEXT_PERCENT = 64;
|
|
51
|
+
/** The share of the text in a panel made for a chosen card with no panel chosen. */
|
|
52
|
+
exports.PANEL_TINT_PERCENT = 4;
|
|
53
|
+
/** How far each try lowers an icon's lightness: about 0.03 of contrast. */
|
|
54
|
+
const LIGHTNESS_STEP = 0.005;
|
|
55
|
+
/** The light theme's own colors, all `#rrggbb`. */
|
|
56
|
+
exports.LIGHT_DRAWN_COLORS = Object.freeze({
|
|
57
|
+
surface: theme_js_1.lightTheme.surfaceCard,
|
|
58
|
+
panel: theme_js_1.lightTheme.surfaceInset,
|
|
59
|
+
text: theme_js_1.lightTheme.textPrimary,
|
|
60
|
+
mutedText: theme_js_1.lightTheme.textTertiary,
|
|
61
|
+
});
|
|
62
|
+
/** The page colors a brand may choose, one color per field. */
|
|
63
|
+
exports.PALETTE_FIELDS = [
|
|
64
|
+
"surfaceColor",
|
|
65
|
+
"panelColor",
|
|
66
|
+
"borderColor",
|
|
67
|
+
"textColor",
|
|
68
|
+
"mutedTextColor",
|
|
69
|
+
"focusColor",
|
|
70
|
+
];
|
|
71
|
+
function rgbOf(hex) {
|
|
72
|
+
return [1, 3, 5].map((at) => Number.parseInt(hex.slice(at, at + 2), 16));
|
|
73
|
+
}
|
|
74
|
+
function hexOf(channels) {
|
|
75
|
+
return `#${channels
|
|
76
|
+
.map((value) => Math.round(value).toString(16).padStart(2, "0"))
|
|
77
|
+
.join("")}`;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* `top` at `percent` over the opaque `under`, as a browser composites it
|
|
81
|
+
* (both `#rrggbb`).
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* mixOver("#000000", 50, "#ffffff"); // "#808080"
|
|
85
|
+
*/
|
|
86
|
+
function mixOver(top, percent, under) {
|
|
87
|
+
const share = percent / 100;
|
|
88
|
+
const below = rgbOf(under);
|
|
89
|
+
return hexOf(rgbOf(top).map((above, i) => above * share + below[i] * (1 - share)));
|
|
90
|
+
}
|
|
91
|
+
function hslOf(hex) {
|
|
92
|
+
const [red, green, blue] = rgbOf(hex).map((value) => value / 255);
|
|
93
|
+
const high = Math.max(red, green, blue);
|
|
94
|
+
const low = Math.min(red, green, blue);
|
|
95
|
+
const spread = high - low;
|
|
96
|
+
const lightness = (high + low) / 2;
|
|
97
|
+
if (spread === 0)
|
|
98
|
+
return { hue: 0, saturation: 0, lightness };
|
|
99
|
+
const saturation = spread / (1 - Math.abs(2 * lightness - 1));
|
|
100
|
+
const sector = high === red
|
|
101
|
+
? (green - blue) / spread
|
|
102
|
+
: high === green
|
|
103
|
+
? (blue - red) / spread + 2
|
|
104
|
+
: (red - green) / spread + 4;
|
|
105
|
+
return { hue: (sector * 60 + 360) % 360, saturation, lightness };
|
|
106
|
+
}
|
|
107
|
+
function hexFromHsl({ hue, saturation, lightness }) {
|
|
108
|
+
const reach = saturation * Math.min(lightness, 1 - lightness);
|
|
109
|
+
const channel = (offset) => {
|
|
110
|
+
const turn = (offset + hue / 30) % 12;
|
|
111
|
+
return ((lightness - reach * Math.max(-1, Math.min(turn - 3, 9 - turn, 1))) * 255);
|
|
112
|
+
};
|
|
113
|
+
return hexOf([channel(0), channel(8), channel(4)]);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* What an icon is drawn in, for a chosen secondary (`hex`) under a primary:
|
|
117
|
+
* the secondary itself when it shows at 3:1 on everything an icon sits on
|
|
118
|
+
* (the card, the panel, and the primary's icon tile at rest and on a hovered
|
|
119
|
+
* row), else the same hue and saturation at the nearest lightness that does,
|
|
120
|
+
* darker or lighter. Light surfaces push it darker and dark ones lighter, so a
|
|
121
|
+
* dark palette gets a light icon. When no lightness shows on all of them, the
|
|
122
|
+
* icon is black or white, whichever reads better on the worst of them.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* iconColorFor("#1e3a5f", "#111111"); // "#1e3a5f", it already shows
|
|
126
|
+
* iconColorFor("#b08d57", "#111111"); // a darker gold
|
|
127
|
+
* iconColorFor("#333344", "#2563eb", { surface: "#1b1d24", panel: "#25272e" });
|
|
128
|
+
* // a lighter slate
|
|
129
|
+
*/
|
|
130
|
+
function iconColorFor(hex, primary, drawn = exports.LIGHT_DRAWN_COLORS) {
|
|
131
|
+
const hoveredRow = mixOver(primary, exports.HOVERED_ROW_PERCENT, drawn.surface);
|
|
132
|
+
const surfaces = [
|
|
133
|
+
drawn.surface,
|
|
134
|
+
drawn.panel,
|
|
135
|
+
mixOver(primary, exports.ICON_TILE_PERCENT, drawn.surface),
|
|
136
|
+
mixOver(primary, exports.ICON_TILE_PERCENT, hoveredRow),
|
|
137
|
+
];
|
|
138
|
+
const worstRatio = (candidate) => Math.min(...surfaces.map((surface) => (0, contrast_js_1.contrastRatio)(candidate, surface)));
|
|
139
|
+
if (worstRatio(hex) >= exports.AA_GRAPHIC_CONTRAST)
|
|
140
|
+
return hex;
|
|
141
|
+
// Step away from the chosen lightness both ways at once, darker first, so
|
|
142
|
+
// the first lightness that shows is the nearest one.
|
|
143
|
+
const start = hslOf(hex);
|
|
144
|
+
for (let steps = 1; steps * LIGHTNESS_STEP <= 1; steps++) {
|
|
145
|
+
for (const lightness of [
|
|
146
|
+
start.lightness - steps * LIGHTNESS_STEP,
|
|
147
|
+
start.lightness + steps * LIGHTNESS_STEP,
|
|
148
|
+
]) {
|
|
149
|
+
if (lightness < 0 || lightness > 1)
|
|
150
|
+
continue;
|
|
151
|
+
const candidate = hexFromHsl({ ...start, lightness });
|
|
152
|
+
if (worstRatio(candidate) >= exports.AA_GRAPHIC_CONTRAST)
|
|
153
|
+
return candidate;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return worstRatio("#000000") >= worstRatio("#ffffff") ? "#000000" : "#ffffff";
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* What a focus ring on the card is drawn in: the brand when it shows on the
|
|
160
|
+
* card at 3:1, else the text color. A light brand (#ffd23f is 1.44:1 on
|
|
161
|
+
* white) gets the text color.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* focusRingFor("#1e3a5f"); // "brand"
|
|
165
|
+
* focusRingFor("#ffd23f"); // "ink"
|
|
166
|
+
*/
|
|
167
|
+
function focusRingFor(hex, surface = exports.LIGHT_DRAWN_COLORS.surface) {
|
|
168
|
+
return (0, contrast_js_1.contrastRatio)(hex, surface) >= exports.AA_GRAPHIC_CONTRAST ? "brand" : "ink";
|
|
169
|
+
}
|
|
170
|
+
/** Whether `hex` reaches `ratio` on the card and on its own tint over the card. */
|
|
171
|
+
function readsOnCardAndTint(hex, ratio, surface) {
|
|
172
|
+
const tint = mixOver(hex, theme_js_1.TINT_PERCENT, surface);
|
|
173
|
+
return ((0, contrast_js_1.contrastRatio)(hex, surface) >= ratio && (0, contrast_js_1.contrastRatio)(hex, tint) >= ratio);
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* What words in the brand are drawn in (a link, the agent's name): the brand
|
|
177
|
+
* when it reads at 4.5:1 on the card and on its tint, else the text color.
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* actionColorFor("#1e3a5f"); // "brand"
|
|
181
|
+
* actionColorFor("#2b9348"); // "ink", 3.91:1 on white
|
|
182
|
+
*/
|
|
183
|
+
function actionColorFor(hex, surface = exports.LIGHT_DRAWN_COLORS.surface) {
|
|
184
|
+
return readsOnCardAndTint(hex, TEXT_CONTRAST, surface) ? "brand" : "ink";
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* What marks in the brand are drawn in (a shield, the icons in the details):
|
|
188
|
+
* the brand when it shows at 3:1 on the card and on its tint, else the text
|
|
189
|
+
* color.
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* markColorFor("#2b9348"); // "brand", 3.91:1 on white
|
|
193
|
+
* markColorFor("#ffd23f"); // "ink"
|
|
194
|
+
*/
|
|
195
|
+
function markColorFor(hex, surface = exports.LIGHT_DRAWN_COLORS.surface) {
|
|
196
|
+
return readsOnCardAndTint(hex, exports.AA_GRAPHIC_CONTRAST, surface)
|
|
197
|
+
? "brand"
|
|
198
|
+
: "ink";
|
|
199
|
+
}
|
|
200
|
+
/** Black or white, whichever reads better on `hex`; a tie gives black. */
|
|
201
|
+
function onPrimaryFor(hex) {
|
|
202
|
+
const luminance = (0, contrast_js_1.relativeLuminance)(hex);
|
|
203
|
+
const againstWhite = 1.05 / (luminance + 0.05);
|
|
204
|
+
const againstBlack = (luminance + 0.05) / 0.05;
|
|
205
|
+
return againstBlack >= againstWhite ? "black" : "white";
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* The panel drawn inside the card: a chosen panel as it is; with none, the
|
|
209
|
+
* theme's own when the card is the theme's too, else the text at
|
|
210
|
+
* {@link PANEL_TINT_PERCENT} over the chosen card, so a chosen card never
|
|
211
|
+
* sits around a panel it was not chosen for.
|
|
212
|
+
*/
|
|
213
|
+
function panelOf(palette, text, drawn) {
|
|
214
|
+
if (palette.panelColor)
|
|
215
|
+
return palette.panelColor;
|
|
216
|
+
if (palette.surfaceColor)
|
|
217
|
+
return mixOver(text, exports.PANEL_TINT_PERCENT, palette.surfaceColor);
|
|
218
|
+
return drawn.panel;
|
|
219
|
+
}
|
|
220
|
+
/** The quieter text drawn on `background`. */
|
|
221
|
+
function mutedOn(palette, background, drawn) {
|
|
222
|
+
if (palette.mutedTextColor)
|
|
223
|
+
return palette.mutedTextColor;
|
|
224
|
+
if (palette.textColor)
|
|
225
|
+
return mixOver(palette.textColor, exports.MUTED_TEXT_PERCENT, background);
|
|
226
|
+
return drawn.mutedText;
|
|
227
|
+
}
|
|
228
|
+
/** A ratio rounded down to two places: 4.4995 is 4.49, never 4.50. */
|
|
229
|
+
function floorToHundredths(ratio) {
|
|
230
|
+
return Math.floor(ratio * 100) / 100;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Every pair of the page's colors that would not read: the text and the
|
|
234
|
+
* quieter text at 4.5:1 and the focus ring at 3:1, each on the card and on
|
|
235
|
+
* the panel. A color the brand did not choose is judged as the page draws it
|
|
236
|
+
* (`drawn`, the light theme unless given). The border is decorative and has
|
|
237
|
+
* no ratio to meet.
|
|
238
|
+
*
|
|
239
|
+
* An editor can use the list to refuse a pair before it is saved;
|
|
240
|
+
* `drawablePalette` drops what fails.
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* paletteFailures({ surfaceColor: "#f8f5f0", textColor: "#2f3440", mutedTextColor: "#5a5f6a" });
|
|
244
|
+
* // []
|
|
245
|
+
* paletteFailures({ surfaceColor: "#1b1d24" });
|
|
246
|
+
* // [{ foreground: "textColor", background: "surfaceColor", ratio: 1.11, needs: 4.5 }, ...]
|
|
247
|
+
*/
|
|
248
|
+
function paletteFailures(palette, drawn = {}) {
|
|
249
|
+
const colors = { ...exports.LIGHT_DRAWN_COLORS, ...drawn };
|
|
250
|
+
const text = palette.textColor ?? colors.text;
|
|
251
|
+
const backgrounds = [
|
|
252
|
+
{
|
|
253
|
+
background: "surfaceColor",
|
|
254
|
+
color: palette.surfaceColor ?? colors.surface,
|
|
255
|
+
},
|
|
256
|
+
{ background: "panelColor", color: panelOf(palette, text, colors) },
|
|
257
|
+
];
|
|
258
|
+
return backgrounds.flatMap(({ background, color }) => {
|
|
259
|
+
const pairs = [
|
|
260
|
+
{ foreground: "textColor", color: text, needs: TEXT_CONTRAST },
|
|
261
|
+
{
|
|
262
|
+
foreground: "mutedTextColor",
|
|
263
|
+
color: mutedOn(palette, color, colors),
|
|
264
|
+
needs: TEXT_CONTRAST,
|
|
265
|
+
},
|
|
266
|
+
...(palette.focusColor
|
|
267
|
+
? [
|
|
268
|
+
{
|
|
269
|
+
foreground: "focusColor",
|
|
270
|
+
color: palette.focusColor,
|
|
271
|
+
needs: exports.AA_GRAPHIC_CONTRAST,
|
|
272
|
+
},
|
|
273
|
+
]
|
|
274
|
+
: []),
|
|
275
|
+
];
|
|
276
|
+
return pairs.flatMap(({ foreground, color: ink, needs }) => {
|
|
277
|
+
const ratio = (0, contrast_js_1.contrastRatio)(ink, color);
|
|
278
|
+
return ratio >= needs
|
|
279
|
+
? []
|
|
280
|
+
: [{ foreground, background, ratio: floorToHundredths(ratio), needs }];
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* The part of a chosen palette the page can draw. The card, the panel and the
|
|
286
|
+
* text on them stand or fall together: dropping one alone could leave the
|
|
287
|
+
* rest unreadable (light text kept on a dark card that was dropped), so a
|
|
288
|
+
* failing pair among them leaves the theme's look for all four. The focus
|
|
289
|
+
* ring is then judged on what is kept, and dropped alone. The border needs no
|
|
290
|
+
* ratio.
|
|
291
|
+
*/
|
|
292
|
+
function drawablePalette(chosen, drawn = {}) {
|
|
293
|
+
const { focusColor, borderColor, ...surfacesAndText } = chosen;
|
|
294
|
+
const kept = paletteFailures(surfacesAndText, drawn).length === 0 ? surfacesAndText : {};
|
|
295
|
+
const focusShows = focusColor !== undefined &&
|
|
296
|
+
paletteFailures({ ...kept, focusColor }, drawn).length === 0;
|
|
297
|
+
return {
|
|
298
|
+
...kept,
|
|
299
|
+
...(borderColor ? { borderColor } : {}),
|
|
300
|
+
...(focusShows ? { focusColor } : {}),
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* The custom properties that draw a brand on the consent screens. Set them on
|
|
305
|
+
* any element above the screens: the screens take a property the page sets
|
|
306
|
+
* over their theme's own.
|
|
307
|
+
*
|
|
308
|
+
* - The brand fills the primary action and the selected checkboxes, with
|
|
309
|
+
* black or white on it, whichever reads.
|
|
310
|
+
* - The tint (`--cs-tint`, `--cs-tint-line`) is the brand over the card.
|
|
311
|
+
* - Marks, actions (and `--consent-link`, the older primitives' links) and
|
|
312
|
+
* the focus ring are the brand where it reads, else the text color.
|
|
313
|
+
* - Icons are the secondary, made darker or lighter to read, when the brand
|
|
314
|
+
* has one.
|
|
315
|
+
* - The page colors are drawn where they read ({@link drawablePalette}).
|
|
316
|
+
*
|
|
317
|
+
* @throws RangeError when a color is not `#rrggbb`.
|
|
318
|
+
*
|
|
319
|
+
* @example
|
|
320
|
+
* brandTokens({ primaryColor: "#1e3a5f" });
|
|
321
|
+
* // { "--consent-primary": "#1e3a5f", "--cs-surface-accent": "#1e3a5f",
|
|
322
|
+
* // "--cs-tint": "#eef0f3", "--cs-mark": "#1e3a5f", ... }
|
|
323
|
+
*/
|
|
324
|
+
function brandTokens(brand) {
|
|
325
|
+
for (const [field, value] of Object.entries(brand)) {
|
|
326
|
+
if (value !== undefined && !(0, contrast_js_1.isHexColor)(value)) {
|
|
327
|
+
throw new RangeError(`${field} must be a #rrggbb color, got ${JSON.stringify(value)}`);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
const { primaryColor: primary, secondaryColor, ...chosen } = brand;
|
|
331
|
+
const palette = drawablePalette(chosen);
|
|
332
|
+
const surface = palette.surfaceColor ?? exports.LIGHT_DRAWN_COLORS.surface;
|
|
333
|
+
const panel = panelOf(palette, palette.textColor ?? exports.LIGHT_DRAWN_COLORS.text, exports.LIGHT_DRAWN_COLORS);
|
|
334
|
+
const ink = palette.textColor ?? exports.LIGHT_DRAWN_COLORS.text;
|
|
335
|
+
const onPrimary = onPrimaryFor(primary);
|
|
336
|
+
const inBrand = (pick) => (pick === "brand" ? primary : ink);
|
|
337
|
+
const tokens = {
|
|
338
|
+
"--consent-primary": primary,
|
|
339
|
+
"--consent-on-primary": onPrimary,
|
|
340
|
+
"--consent-link": inBrand(actionColorFor(primary, surface)),
|
|
341
|
+
"--cs-surface-accent": primary,
|
|
342
|
+
"--cs-surface-accent-text": onPrimary,
|
|
343
|
+
"--cs-tint": mixOver(primary, theme_js_1.TINT_PERCENT, surface),
|
|
344
|
+
"--cs-tint-line": mixOver(primary, theme_js_1.TINT_LINE_PERCENT, surface),
|
|
345
|
+
"--cs-mark": inBrand(markColorFor(primary, surface)),
|
|
346
|
+
"--cs-action": inBrand(actionColorFor(primary, surface)),
|
|
347
|
+
"--cs-focus-ring": palette.focusColor ?? inBrand(focusRingFor(primary, surface)),
|
|
348
|
+
};
|
|
349
|
+
if (secondaryColor) {
|
|
350
|
+
tokens["--cs-icon"] = iconColorFor(secondaryColor, primary, {
|
|
351
|
+
surface,
|
|
352
|
+
panel,
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
if (palette.surfaceColor)
|
|
356
|
+
tokens["--cs-surface-card"] = palette.surfaceColor;
|
|
357
|
+
if (palette.surfaceColor || palette.panelColor)
|
|
358
|
+
tokens["--cs-surface-inset"] = panel;
|
|
359
|
+
if (palette.borderColor)
|
|
360
|
+
tokens["--cs-surface-border"] = palette.borderColor;
|
|
361
|
+
if (palette.textColor) {
|
|
362
|
+
tokens["--cs-text-primary"] = palette.textColor;
|
|
363
|
+
tokens["--cs-text-secondary"] = palette.textColor;
|
|
364
|
+
}
|
|
365
|
+
if (palette.mutedTextColor) {
|
|
366
|
+
tokens["--cs-text-tertiary"] = palette.mutedTextColor;
|
|
367
|
+
}
|
|
368
|
+
else if (palette.textColor) {
|
|
369
|
+
tokens["--cs-text-tertiary"] =
|
|
370
|
+
`color-mix(in srgb, ${palette.textColor} ${exports.MUTED_TEXT_PERCENT}%, transparent)`;
|
|
371
|
+
}
|
|
372
|
+
return tokens;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* `brandTokens(brand)` as a declaration list for a style attribute.
|
|
376
|
+
*
|
|
377
|
+
* @example
|
|
378
|
+
* `<main style="${brandStyle({ primaryColor: "#1e3a5f" })}">`
|
|
379
|
+
*/
|
|
380
|
+
function brandStyle(brand) {
|
|
381
|
+
return Object.entries(brandTokens(brand))
|
|
382
|
+
.map(([property, value]) => `${property}: ${value};`)
|
|
383
|
+
.join(" ");
|
|
384
|
+
}
|
|
385
|
+
//# sourceMappingURL=brand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand.js","sourceRoot":"","sources":["../../../src/styles/brand.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;;;AAiGH,0BAMC;AAuDD,oCA8BC;AAWD,oCAKC;AAsBD,wCAKC;AAWD,oCAOC;AAGD,oCAKC;AAoDD,0CA0CC;AAUD,0CAeC;AA6BD,kCAsDC;AAQD,gCAIC;AArdD,+CAA6E;AAC7E,yCAAyE;AAEzE,8DAA8D;AACjD,QAAA,mBAAmB,GAAG,CAAC,CAAC;AACrC,gDAAgD;AAChD,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,kDAAkD;AACrC,QAAA,iBAAiB,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Ac,EAAE,CAAC;QAC3B,MAAM,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IACxD,CAAC;SAAM,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QAC7B,MAAM,CAAC,oBAAoB,CAAC;YAC1B,sBAAsB,OAAO,CAAC,SAAS,IAAI,0BAAkB,iBAAiB,CAAC;IACnF,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,KAAyB;IAClD,OAAO,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;SACtC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,QAAQ,KAAK,KAAK,GAAG,CAAC;SACpD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
|
package/dist/cjs/styles/index.js
CHANGED
|
@@ -27,4 +27,5 @@ __exportStar(require("./contrast.js"), exports);
|
|
|
27
27
|
__exportStar(require("./css-variables.js"), exports);
|
|
28
28
|
__exportStar(require("./stylesheet.js"), exports);
|
|
29
29
|
__exportStar(require("./theme.js"), exports);
|
|
30
|
+
__exportStar(require("./brand.js"), exports);
|
|
30
31
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/styles/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;AAEH,8CAA4B;AAC5B,gDAA8B;AAC9B,qDAAmC;AACnC,kDAAgC;AAChC,6CAA2B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/styles/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;AAEH,8CAA4B;AAC5B,gDAA8B;AAC9B,qDAAmC;AACnC,kDAAgC;AAChC,6CAA2B;AAC3B,6CAA2B"}
|