@redacto.io/consent-sdk-js 2.0.1 → 2.1.0-beta.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 (60) hide show
  1. package/dist/montserrat.generated-75WXFSY6.mjs +22 -0
  2. package/dist/poweredByRedacto-VYZHZOZ5.mjs +5 -0
  3. package/dist/privacy-center/images/poweredByRedacto.svg +9 -0
  4. package/dist/privacy-center/images/sentImg.svg +9 -0
  5. package/dist/privacy-center/locales/as.js +1 -0
  6. package/dist/privacy-center/locales/bn.js +1 -0
  7. package/dist/privacy-center/locales/brx.js +1 -0
  8. package/dist/privacy-center/locales/doi.js +1 -0
  9. package/dist/privacy-center/locales/gom.js +1 -0
  10. package/dist/privacy-center/locales/gu.js +1 -0
  11. package/dist/privacy-center/locales/hi.js +1 -0
  12. package/dist/privacy-center/locales/kn.js +1 -0
  13. package/dist/privacy-center/locales/ks.js +1 -0
  14. package/dist/privacy-center/locales/mai.js +1 -0
  15. package/dist/privacy-center/locales/ml.js +1 -0
  16. package/dist/privacy-center/locales/mni-Mtei.js +1 -0
  17. package/dist/privacy-center/locales/mr.js +1 -0
  18. package/dist/privacy-center/locales/ne.js +1 -0
  19. package/dist/privacy-center/locales/or.js +1 -0
  20. package/dist/privacy-center/locales/pa.js +1 -0
  21. package/dist/privacy-center/locales/sa.js +1 -0
  22. package/dist/privacy-center/locales/sat.js +1 -0
  23. package/dist/privacy-center/locales/sd.js +1 -0
  24. package/dist/privacy-center/locales/ta.js +1 -0
  25. package/dist/privacy-center/locales/te.js +1 -0
  26. package/dist/privacy-center/locales/ur.js +1 -0
  27. package/dist/redacto-privacy-center.d.mts +230 -0
  28. package/dist/redacto-privacy-center.d.ts +230 -0
  29. package/dist/redacto-privacy-center.global.js +3852 -0
  30. package/dist/redacto-privacy-center.global.js.map +1 -0
  31. package/dist/redacto-privacy-center.js +39562 -0
  32. package/dist/redacto-privacy-center.mjs +31831 -0
  33. package/dist/redacto.global.js +107 -107
  34. package/dist/redacto.global.js.map +1 -1
  35. package/dist/redacto.js +337 -92
  36. package/dist/redacto.mjs +337 -92
  37. package/dist/sentImg-RN2XSS4V.mjs +5 -0
  38. package/dist/translation-3IAUHBQO.mjs +1020 -0
  39. package/dist/translation-3TCIC57D.mjs +1020 -0
  40. package/dist/translation-4VNBLMFS.mjs +1020 -0
  41. package/dist/translation-54VF5MY3.mjs +1020 -0
  42. package/dist/translation-5O732WWG.mjs +1020 -0
  43. package/dist/translation-62B5PCBT.mjs +1020 -0
  44. package/dist/translation-7MGWGIAV.mjs +1020 -0
  45. package/dist/translation-BEC2RYFD.mjs +1020 -0
  46. package/dist/translation-BQABMEQU.mjs +1020 -0
  47. package/dist/translation-BX3FJA6E.mjs +1020 -0
  48. package/dist/translation-C4EA7NR6.mjs +1020 -0
  49. package/dist/translation-DBJE52UX.mjs +1020 -0
  50. package/dist/translation-DRTKVWFD.mjs +1020 -0
  51. package/dist/translation-FNXKSX4V.mjs +1020 -0
  52. package/dist/translation-GTONCNVZ.mjs +1029 -0
  53. package/dist/translation-HUUSKQB5.mjs +1020 -0
  54. package/dist/translation-ITVO7LSO.mjs +1020 -0
  55. package/dist/translation-MBGE7KYU.mjs +1020 -0
  56. package/dist/translation-NAWDRQYM.mjs +1020 -0
  57. package/dist/translation-TP6K4SC4.mjs +1020 -0
  58. package/dist/translation-W6HTCTKZ.mjs +1020 -0
  59. package/dist/translation-WFBFKNV5.mjs +1020 -0
  60. package/package.json +6 -1
package/dist/redacto.js CHANGED
@@ -331,7 +331,7 @@ function toLanguageCode(lang) {
331
331
  function resolveDisplayLanguage(requested, defaultLanguage, translations) {
332
332
  const fallback = defaultLanguage || "en";
333
333
  const requestedCode = toLanguageCode(requested);
334
- if (!requestedCode) {
334
+ if (!requestedCode || requestedCode === "en") {
335
335
  return fallback;
336
336
  }
337
337
  for (const key of Object.keys(translations || {})) {
@@ -341,6 +341,13 @@ function resolveDisplayLanguage(requested, defaultLanguage, translations) {
341
341
  }
342
342
  return fallback;
343
343
  }
344
+ function noticeLanguageOptions(defaultLanguage, translations) {
345
+ const first = defaultLanguage || "English";
346
+ const rest = Object.keys(translations || {}).filter(
347
+ (language) => language !== first && toLanguageCode(language) !== "en"
348
+ );
349
+ return toLanguageCode(first) === "en" ? [first, ...rest] : ["English", first, ...rest];
350
+ }
344
351
 
345
352
  // src/api/submit-payload.ts
346
353
  var toSubmitPurposes = (purposes) => purposes.map((purpose) => {
@@ -1620,6 +1627,7 @@ var NOTICE_DESKTOP_POSITIONS = [
1620
1627
  ];
1621
1628
  var NOTICE_BACKDROPS = ["dim", "none"];
1622
1629
  var NOTICE_PHONE_FOOTERS = ["stacked", "paired"];
1630
+ var PURPOSE_DESCRIPTION_PLACEMENTS = ["always", "expanded", "hidden"];
1623
1631
  var NOTICE_TEXT_SCALES = ["sm", "md", "lg"];
1624
1632
  var DEFAULT_TEXT_SCALE = "md";
1625
1633
  var DEFAULT_DESKTOP_POSITION = "center";
@@ -1670,6 +1678,46 @@ var THEMED_CONTROL_OFF = `var(${NOTICE_THEME_VARS.controlOff}, #d0d5dd)`;
1670
1678
  var THEMED_TTS_BACKGROUND = `var(${NOTICE_THEME_VARS.ttsBackground}, ${DEFAULT_TTS_HIGHLIGHT_BG})`;
1671
1679
  var TTS_TEXT_ATTRIBUTE = "data-redacto-tts-text";
1672
1680
 
1681
+ // src/shared/appearance/noticeChrome.ts
1682
+ var DEFAULT_NOTICE_CHROME = {
1683
+ showsProductSection: true,
1684
+ showsDataElements: true,
1685
+ descriptionPlacement: "always",
1686
+ showsPurposeSectionHeading: true,
1687
+ controlPosition: "right",
1688
+ headerAlign: "left",
1689
+ showsTitle: true,
1690
+ showsAudioButton: true,
1691
+ showsLogo: true,
1692
+ inlinesPolicyLink: false,
1693
+ privacyCenterAsText: false,
1694
+ showsRequiredHint: true
1695
+ };
1696
+ var noticeChromeOptions = (served) => {
1697
+ if (!served) return DEFAULT_NOTICE_CHROME;
1698
+ const placement = PURPOSE_DESCRIPTION_PLACEMENTS.find(
1699
+ (value) => value === served.purpose_description
1700
+ );
1701
+ return {
1702
+ showsProductSection: served.show_product_section !== false,
1703
+ showsDataElements: served.show_data_elements !== false,
1704
+ descriptionPlacement: placement != null ? placement : DEFAULT_NOTICE_CHROME.descriptionPlacement,
1705
+ showsPurposeSectionHeading: served.show_purpose_section_heading !== false,
1706
+ controlPosition: served.control_position === "left" ? "left" : "right",
1707
+ headerAlign: served.header_align === "center" ? "center" : "left",
1708
+ showsTitle: served.show_title !== false,
1709
+ showsAudioButton: served.show_audio_button !== false,
1710
+ showsLogo: served.show_logo !== false,
1711
+ inlinesPolicyLink: served.privacy_policy_inline === true,
1712
+ privacyCenterAsText: served.privacy_center_as_text === true,
1713
+ showsRequiredHint: served.show_required_hint !== false
1714
+ };
1715
+ };
1716
+ var leadsWithControl = (chrome) => chrome.controlPosition === "left";
1717
+ var centresHeader = (chrome) => chrome.headerAlign === "center";
1718
+ var headerHoldsOnlyControls = (chrome, hasLogo) => !chrome.showsTitle && !(chrome.showsLogo && hasLogo);
1719
+ var showsPrivacyCenter = (chrome, url, anchorText) => chrome.privacyCenterAsText ? Boolean(anchorText == null ? void 0 : anchorText.trim()) : Boolean(url);
1720
+
1673
1721
  // src/shared/appearance/ttsCssVariables.ts
1674
1722
  var buildTtsCssVariables = (colors) => Object.fromEntries(
1675
1723
  [
@@ -2231,6 +2279,18 @@ var injectCheckboxStyles = (root) => {
2231
2279
  };
2232
2280
 
2233
2281
  // src/styles/modal.ts
2282
+ var visuallyHidden = {
2283
+ position: "absolute",
2284
+ width: "1px",
2285
+ height: "1px",
2286
+ margin: "-1px",
2287
+ padding: 0,
2288
+ overflow: "hidden",
2289
+ clip: "rect(0 0 0 0)",
2290
+ clipPath: "inset(50%)",
2291
+ whiteSpace: "nowrap",
2292
+ border: 0
2293
+ };
2234
2294
  var styles = {
2235
2295
  overlay: {
2236
2296
  position: "fixed",
@@ -2337,6 +2397,37 @@ var styles = {
2337
2397
  padding: 0,
2338
2398
  boxSizing: "border-box"
2339
2399
  },
2400
+ // With no logo and no title the header holds nothing but the controls, and
2401
+ // the padding sized for a masthead reads as dead space above the notice text.
2402
+ headerStackControlsOnly: {
2403
+ paddingBottom: 0
2404
+ },
2405
+ // A hidden title leaves the flex row, so without this the controls it used
2406
+ // to push along would collapse to the leading edge.
2407
+ headerRowTrailing: {
2408
+ justifyContent: "flex-end"
2409
+ },
2410
+ // The centred title owns its row: the controls that normally share it would
2411
+ // pull it off centre, so they move below the notice text.
2412
+ headerRowCentred: {
2413
+ display: "flex",
2414
+ alignItems: "center",
2415
+ justifyContent: "center",
2416
+ gap: "10px",
2417
+ width: "100%",
2418
+ margin: 0,
2419
+ padding: 0,
2420
+ boxSizing: "border-box"
2421
+ },
2422
+ headerControlsRow: {
2423
+ display: "flex",
2424
+ alignItems: "center",
2425
+ justifyContent: "flex-end",
2426
+ width: "100%",
2427
+ margin: 0,
2428
+ padding: 0,
2429
+ boxSizing: "border-box"
2430
+ },
2340
2431
  logo: {
2341
2432
  height: "32px",
2342
2433
  width: "auto",
@@ -2347,6 +2438,13 @@ var styles = {
2347
2438
  padding: 0,
2348
2439
  display: "block"
2349
2440
  },
2441
+ titleCentred: {
2442
+ textAlign: "center",
2443
+ width: "100%"
2444
+ },
2445
+ // Hidden from sight, kept for the screen reader: the dialog is named by this
2446
+ // heading through aria-labelledby, and focus enters the notice on it.
2447
+ titleHidden: visuallyHidden,
2350
2448
  title: {
2351
2449
  fontSize: "18px",
2352
2450
  fontWeight: 700,
@@ -2404,6 +2502,9 @@ var styles = {
2404
2502
  padding: 0,
2405
2503
  textAlign: "left"
2406
2504
  },
2505
+ privacyTextCentred: {
2506
+ textAlign: "center"
2507
+ },
2407
2508
  link: {
2408
2509
  color: "#4f87ff",
2409
2510
  textDecoration: "none",
@@ -2437,6 +2538,11 @@ var styles = {
2437
2538
  padding: 0,
2438
2539
  boxSizing: "border-box"
2439
2540
  },
2541
+ // The row is space-between with the text block growing, so a leading tick
2542
+ // would otherwise sit flush against the label.
2543
+ optionItemLeading: {
2544
+ gap: "12px"
2545
+ },
2440
2546
  optionLeft: {
2441
2547
  display: "flex",
2442
2548
  gap: "12px",
@@ -2516,6 +2622,11 @@ var styles = {
2516
2622
  boxSizing: "border-box",
2517
2623
  minHeight: "24px"
2518
2624
  },
2625
+ // The tick leads, so the label follows it instead of being pushed to the
2626
+ // opposite edge by the row's space-between.
2627
+ dataElementItemLeading: {
2628
+ justifyContent: "flex-start"
2629
+ },
2519
2630
  // Applied only where the control is taller than a checkbox: a yes/no pair,
2520
2631
  // a dropdown or a switch. Unconditionally these leave the checkbox rows
2521
2632
  // loose.
@@ -2795,7 +2906,10 @@ var styles = {
2795
2906
  margin: 0,
2796
2907
  paddingTop: "12px",
2797
2908
  boxSizing: "border-box"
2798
- }
2909
+ },
2910
+ // The required-purposes hint the console switched off: it still describes
2911
+ // the held Accept selected button.
2912
+ confirmHintHidden: visuallyHidden
2799
2913
  };
2800
2914
 
2801
2915
  // src/core/required-marker.ts
@@ -3284,7 +3398,8 @@ var CLASSIC_PURPOSE_LOOK = {
3284
3398
  textColor: DEFAULT_TEXT_COLOR,
3285
3399
  selectionControl: DEFAULT_SELECTION_CONTROL,
3286
3400
  roomyControls: false,
3287
- drawsSwitches: false
3401
+ drawsSwitches: false,
3402
+ chrome: DEFAULT_NOTICE_CHROME
3288
3403
  };
3289
3404
  var settledMark = (consented, label) => consented ? createGreenCheckmark(16, label) : el("div", {
3290
3405
  role: "img",
@@ -3320,6 +3435,8 @@ function renderModalPurposes(purposes, options) {
3320
3435
  onDataElementToggle
3321
3436
  } = options;
3322
3437
  const { styles: styles2, responsive, headingColor, textColor } = look;
3438
+ const chrome = look.chrome;
3439
+ const controlLeads = leadsWithControl(chrome);
3323
3440
  const elementControls = /* @__PURE__ */ new Map();
3324
3441
  const purposeControls = /* @__PURE__ */ new Map();
3325
3442
  const collapseButtons = /* @__PURE__ */ new Map();
@@ -3334,7 +3451,15 @@ function renderModalPurposes(purposes, options) {
3334
3451
  const stateKey = productPurposeKey(productUuid, purpose.uuid);
3335
3452
  const locked = isRowLocked ? isRowLocked(purpose.uuid) : isAlreadyConsented;
3336
3453
  const purposeName = getTranslatedText("purposes.name", purpose.name, purpose.uuid);
3337
- const chevron = svg(
3454
+ const descriptionText = getTranslatedText(
3455
+ "purposes.description",
3456
+ purpose.description,
3457
+ purpose.uuid
3458
+ );
3459
+ const hasDataElements = chrome.showsDataElements && ((_d = (_c = purpose.data_elements) == null ? void 0 : _c.length) != null ? _d : 0) > 0;
3460
+ const disclosesDescription = chrome.descriptionPlacement === "expanded" && descriptionText.trim() !== "";
3461
+ const hasDisclosure = hasDataElements || disclosesDescription;
3462
+ const chevron = hasDisclosure ? svg(
3338
3463
  "svg",
3339
3464
  {
3340
3465
  width: "7",
@@ -3353,13 +3478,13 @@ function renderModalPurposes(purposes, options) {
3353
3478
  "aria-hidden": "true"
3354
3479
  },
3355
3480
  svg("path", { d: "M1 1L6 6L1 11" })
3356
- );
3357
- chevrons.set(stateKey, chevron);
3358
- const chevronContainer = el(
3481
+ ) : null;
3482
+ if (chevron) chevrons.set(stateKey, chevron);
3483
+ const chevronContainer = chevron ? el(
3359
3484
  "div",
3360
3485
  { style: { display: "flex", alignItems: "center", justifyContent: "center", marginLeft: "5px" } },
3361
3486
  chevron
3362
- );
3487
+ ) : null;
3363
3488
  const titleEl = el("h2", {
3364
3489
  id: `purpose-name-${stateKey}`,
3365
3490
  ...part("purpose-title"),
@@ -3374,33 +3499,48 @@ function renderModalPurposes(purposes, options) {
3374
3499
  titleEl.appendChild(createRequiredMarker());
3375
3500
  }
3376
3501
  titleElements.set(stateKey, titleEl);
3377
- const descEl = el("h3", {
3502
+ const descEl = chrome.descriptionPlacement === "hidden" ? null : el("h3", {
3378
3503
  id: `purpose-description-${stateKey}`,
3379
3504
  style: {
3380
3505
  ...styles2.optionDescription,
3381
3506
  ...responsive.optionDescription,
3382
- color: (_c = look.mutedTextColor) != null ? _c : textColor
3507
+ color: (_e = look.mutedTextColor) != null ? _e : textColor
3383
3508
  }
3384
3509
  });
3385
- descEl.textContent = getTranslatedText("purposes.description", purpose.description, purpose.uuid);
3386
- descriptionElements.set(stateKey, descEl);
3387
- const textContainer = el("div", { style: styles2.optionTextContainer }, titleEl, descEl);
3388
- const collapseBtn = el("div", {
3389
- style: styles2.optionLeft,
3390
- role: "button",
3391
- tabIndex: "0",
3392
- "aria-expanded": String(!collapsedPurposes[stateKey]),
3393
- "aria-controls": `purpose-${stateKey}`,
3394
- "aria-label": `${collapsedPurposes[stateKey] ? "Expand" : "Collapse"} ${purposeName} details`,
3395
- onClick: () => onPurposeCollapse(purpose.uuid, productUuid),
3396
- onKeydown: (e) => {
3397
- if (e.key === "Enter" || e.key === " ") {
3398
- e.preventDefault();
3399
- onPurposeCollapse(purpose.uuid, productUuid);
3400
- }
3401
- }
3402
- }, chevronContainer, textContainer);
3403
- collapseButtons.set(stateKey, collapseBtn);
3510
+ if (descEl) {
3511
+ descEl.textContent = descriptionText;
3512
+ descriptionElements.set(stateKey, descEl);
3513
+ }
3514
+ const textContainer = el(
3515
+ "div",
3516
+ { style: styles2.optionTextContainer },
3517
+ titleEl,
3518
+ chrome.descriptionPlacement === "always" ? descEl : null
3519
+ );
3520
+ const collapseBtn = el(
3521
+ "div",
3522
+ {
3523
+ style: styles2.optionLeft,
3524
+ ...hasDisclosure ? {
3525
+ role: "button",
3526
+ tabIndex: "0",
3527
+ "aria-expanded": String(!collapsedPurposes[stateKey]),
3528
+ "aria-controls": `purpose-${stateKey}`,
3529
+ "aria-label": `${collapsedPurposes[stateKey] ? "Expand" : "Collapse"} ${purposeName} details`,
3530
+ onClick: () => onPurposeCollapse(purpose.uuid, productUuid),
3531
+ onKeydown: (e) => {
3532
+ if (e.key === "Enter" || e.key === " ") {
3533
+ e.preventDefault();
3534
+ onPurposeCollapse(purpose.uuid, productUuid);
3535
+ }
3536
+ }
3537
+ } : {}
3538
+ },
3539
+ controlLeads ? null : chevronContainer,
3540
+ textContainer,
3541
+ controlLeads ? chevronContainer : null
3542
+ );
3543
+ if (hasDisclosure) collapseButtons.set(stateKey, collapseBtn);
3404
3544
  const purposeControl = renderSelectionControl({
3405
3545
  control: look.selectionControl,
3406
3546
  checked: selectedPurposes[stateKey] || false,
@@ -3419,9 +3559,16 @@ function renderModalPurposes(purposes, options) {
3419
3559
  }
3420
3560
  const optionRow = el(
3421
3561
  "div",
3422
- { ...part("purpose"), style: styles2.optionItem },
3562
+ {
3563
+ ...part("purpose"),
3564
+ style: {
3565
+ ...styles2.optionItem,
3566
+ ...controlLeads ? styles2.optionItemLeading : {}
3567
+ }
3568
+ },
3569
+ controlLeads ? purposeControl.element : null,
3423
3570
  collapseBtn,
3424
- purposeControl.element
3571
+ controlLeads ? null : purposeControl.element
3425
3572
  );
3426
3573
  const deContainer = el("div", {
3427
3574
  id: `purpose-${stateKey}`,
@@ -3430,7 +3577,10 @@ function renderModalPurposes(purposes, options) {
3430
3577
  ...look.roomyControls ? styles2.dataElementsContainerRoomy : {}
3431
3578
  }
3432
3579
  });
3433
- if (((_d = purpose.data_elements) == null ? void 0 : _d.length) > 0) {
3580
+ if (disclosesDescription && descEl) {
3581
+ deContainer.appendChild(descEl);
3582
+ }
3583
+ if (hasDataElements) {
3434
3584
  for (const dataElement of purpose.data_elements) {
3435
3585
  const combinedId = `${stateKey}-${dataElement.uuid}`;
3436
3586
  const elementName = getTranslatedText("data_elements.name", dataElement.name, dataElement.uuid);
@@ -3475,19 +3625,25 @@ function renderModalPurposes(purposes, options) {
3475
3625
  ...part("data-element"),
3476
3626
  style: {
3477
3627
  ...styles2.dataElementItem,
3478
- ...look.roomyControls ? styles2.dataElementItemRoomy : {}
3628
+ ...look.roomyControls ? styles2.dataElementItemRoomy : {},
3629
+ // space-between would push a leading tick's label to the far
3630
+ // edge, leaving the two at opposite ends of an empty row.
3631
+ ...controlLeads ? styles2.dataElementItemLeading : {}
3479
3632
  }
3480
3633
  },
3634
+ controlLeads ? deRightElement : null,
3481
3635
  labelSpan,
3482
- deRightElement
3636
+ controlLeads ? null : deRightElement
3483
3637
  );
3484
3638
  deContainer.appendChild(deRow);
3485
3639
  }
3486
3640
  }
3487
- dataElementContainers.set(stateKey, deContainer);
3488
- deContainer.style.display = !collapsedPurposes[stateKey] && ((_e = purpose.data_elements) == null ? void 0 : _e.length) > 0 ? "flex" : "none";
3489
3641
  purposeWrapper.appendChild(optionRow);
3490
- purposeWrapper.appendChild(deContainer);
3642
+ if (hasDisclosure) {
3643
+ dataElementContainers.set(stateKey, deContainer);
3644
+ deContainer.style.display = collapsedPurposes[stateKey] ? "none" : "flex";
3645
+ purposeWrapper.appendChild(deContainer);
3646
+ }
3491
3647
  container.appendChild(purposeWrapper);
3492
3648
  }
3493
3649
  return {
@@ -3890,7 +4046,7 @@ var TTSManager = class {
3890
4046
  workspaceUuid: params.workspaceUuid
3891
4047
  });
3892
4048
  this.audioUrls = response.detail;
3893
- this.buildSequences(params.content, params.purposes);
4049
+ this.buildSequences(params.content, params.purposes, params.chrome);
3894
4050
  this._isAvailable = this.audioSequence.length > 0;
3895
4051
  this.onStateChange();
3896
4052
  } catch (error) {
@@ -3903,7 +4059,7 @@ var TTSManager = class {
3903
4059
  }
3904
4060
  }
3905
4061
  }
3906
- buildSequences(content, ordered) {
4062
+ buildSequences(content, ordered, chrome = DEFAULT_NOTICE_CHROME) {
3907
4063
  var _a, _b;
3908
4064
  if (!this.audioUrls) return;
3909
4065
  const urls = this.audioUrls;
@@ -3919,7 +4075,9 @@ var TTSManager = class {
3919
4075
  push(urls.notice_text_audio_url, "privacy-notice-text");
3920
4076
  push(urls.privacy_policy_prefix_text_audio_url, "privacy-policy-text");
3921
4077
  push(urls.privacy_policy_anchor_text_audio_url, "privacy-policy-link");
3922
- push(urls.purpose_section_heading_audio_url, "purpose-section-heading");
4078
+ if (chrome.showsPurposeSectionHeading) {
4079
+ push(urls.purpose_section_heading_audio_url, "purpose-section-heading");
4080
+ }
3923
4081
  const purposes = ordered != null ? ordered : purposesInRenderOrder(
3924
4082
  content.products,
3925
4083
  content.purposes,
@@ -3929,8 +4087,14 @@ var TTSManager = class {
3929
4087
  const purposeAudio = (_a = urls.purposes_audio) == null ? void 0 : _a[purpose.uuid];
3930
4088
  if (purposeAudio) {
3931
4089
  push(purposeAudio.name_audio_url, `purpose-name-${purpose.uuid}`);
3932
- push(purposeAudio.description_audio_url, `purpose-description-${purpose.uuid}`);
4090
+ if (chrome.descriptionPlacement !== "hidden") {
4091
+ push(
4092
+ purposeAudio.description_audio_url,
4093
+ chrome.descriptionPlacement === "always" ? `purpose-description-${purpose.uuid}` : ""
4094
+ );
4095
+ }
3933
4096
  }
4097
+ if (!chrome.showsDataElements) continue;
3934
4098
  for (const de of purpose.data_elements) {
3935
4099
  const deAudio = (_b = urls.data_elements_audio) == null ? void 0 : _b[de.uuid];
3936
4100
  if (deAudio) {
@@ -3941,7 +4105,7 @@ var TTSManager = class {
3941
4105
  if (content.additional_text) {
3942
4106
  push(urls.additional_text_audio_url, "additional-text");
3943
4107
  }
3944
- if (content.privacy_center_url) {
4108
+ if (showsPrivacyCenter(chrome, content.privacy_center_url, content.privacy_center_anchor_text)) {
3945
4109
  push(urls.privacy_center_anchor_text_audio_url, "privacy-center-link");
3946
4110
  }
3947
4111
  if (urls.dpo_info_audio) {
@@ -5056,6 +5220,11 @@ var confirmHint = (verdict, products, productName, copy = CONFIRM_HINT_COPY) =>
5056
5220
  });
5057
5221
  return copy.productsIncomplete(names);
5058
5222
  };
5223
+ var REQUIRED_HINT_REASONS = /* @__PURE__ */ new Set([
5224
+ "required-outstanding",
5225
+ "product-incomplete"
5226
+ ]);
5227
+ var drawsConfirmHint = (verdict, showsRequiredHint) => showsRequiredHint || !REQUIRED_HINT_REASONS.has(verdict.reason);
5059
5228
  var submissionPurposes = (rows, selection) => rows.map(({ purpose, productUuid }) => {
5060
5229
  const key = productPurposeKey(productUuid, purpose.uuid);
5061
5230
  return {
@@ -5146,6 +5315,7 @@ function renderProductSection(options) {
5146
5315
  } = options;
5147
5316
  const look = (_a = options.look) != null ? _a : CLASSIC_PURPOSE_LOOK;
5148
5317
  const styles2 = look.styles;
5318
+ const controlLeads = leadsWithControl(look.chrome);
5149
5319
  const name = getTranslatedText("products.name", product.name, product.uuid);
5150
5320
  const headingColor = look.headingColor;
5151
5321
  const boxPurposes = productBoxPurposes(purposes);
@@ -5222,9 +5392,22 @@ function renderProductSection(options) {
5222
5392
  );
5223
5393
  const header = el(
5224
5394
  "div",
5225
- { ...part("product"), style: styles2.sectionHeader },
5226
- el("div", { style: styles2.optionLeft }, collapseButton, heading),
5227
- selection.element
5395
+ {
5396
+ ...part("product"),
5397
+ style: {
5398
+ ...styles2.sectionHeader,
5399
+ ...controlLeads ? styles2.optionItemLeading : {}
5400
+ }
5401
+ },
5402
+ controlLeads ? selection.element : null,
5403
+ el(
5404
+ "div",
5405
+ { style: styles2.optionLeft },
5406
+ controlLeads ? null : collapseButton,
5407
+ heading,
5408
+ controlLeads ? collapseButton : null
5409
+ ),
5410
+ controlLeads ? null : selection.element
5228
5411
  );
5229
5412
  const body = el("div", { id: `product-${product.uuid}`, style: styles2.sectionBody });
5230
5413
  body.hidden = collapsed;
@@ -5313,14 +5496,23 @@ function mergePurposeRefs(container, parts) {
5313
5496
  function renderConfirmHint(style) {
5314
5497
  return el("p", { id: CONFIRM_HINT_ID, role: "status", style: style != null ? style : styles.confirmHint });
5315
5498
  }
5316
- function updateConfirmHint(hintEl, anchor, describedButton, text) {
5499
+ function updateConfirmHint(hintEl, anchor, describedButton, text, style, drawn = true) {
5317
5500
  var _a;
5318
5501
  if (!text) {
5319
5502
  hintEl.remove();
5320
5503
  describedButton == null ? void 0 : describedButton.removeAttribute("aria-describedby");
5321
5504
  return;
5322
5505
  }
5323
- hintEl.textContent = text;
5506
+ if (style) {
5507
+ hintEl.removeAttribute("style");
5508
+ applyStyles(hintEl, style);
5509
+ }
5510
+ if (drawn) {
5511
+ hintEl.setAttribute("role", "status");
5512
+ } else {
5513
+ hintEl.removeAttribute("role");
5514
+ }
5515
+ if (hintEl.textContent !== text) hintEl.textContent = text;
5324
5516
  if (hintEl.nextSibling !== anchor) {
5325
5517
  (_a = anchor.parentNode) == null ? void 0 : _a.insertBefore(hintEl, anchor);
5326
5518
  }
@@ -6992,6 +7184,7 @@ var buildModalLook = ({
6992
7184
  settings,
6993
7185
  prefersDark
6994
7186
  );
7187
+ const chrome = noticeChromeOptions(content ? content.appearance : cachedAppearance);
6995
7188
  const style = appearance.style;
6996
7189
  const colors = appearance.colors;
6997
7190
  const layout = resolveNoticeLayout(appearance);
@@ -7096,6 +7289,7 @@ var buildModalLook = ({
7096
7289
  return {
7097
7290
  appearance,
7098
7291
  layout,
7292
+ chrome,
7099
7293
  skin,
7100
7294
  styles: styles2,
7101
7295
  responsive: scaleFontSizes(responsive, textScale),
@@ -8060,7 +8254,8 @@ var ModalController = class {
8060
8254
  controlSkin: look.controlSkin,
8061
8255
  rowClassName: (_a = look.skin) == null ? void 0 : _a.parts.rowClassName,
8062
8256
  roomyControls: look.roomyControls,
8063
- drawsSwitches: look.drawsSwitches
8257
+ drawsSwitches: look.drawsSwitches,
8258
+ chrome: look.chrome
8064
8259
  };
8065
8260
  }
8066
8261
  disposeSections() {
@@ -8150,7 +8345,7 @@ var ModalController = class {
8150
8345
  this.store.setState({ collapsedPurposes });
8151
8346
  }
8152
8347
  rebuildUI() {
8153
- var _a, _b, _c, _d, _e, _f;
8348
+ var _a, _b, _c, _d, _e, _f, _g;
8154
8349
  const state = this.store.getState();
8155
8350
  if (!state.content || !this.modalEl) return;
8156
8351
  const activeConfig = state.content.detail.active_config;
@@ -8244,18 +8439,20 @@ var ModalController = class {
8244
8439
  this.modalEl.setAttribute("aria-labelledby", "privacy-notice-title");
8245
8440
  this.modalEl.setAttribute("aria-describedby", "privacy-notice-description");
8246
8441
  const { styles: styles2, responsive, sheetParts, parts, headingColor, textColor } = look;
8442
+ const chromeOptions = look.chrome;
8247
8443
  const chrome = noticeChromeCopy(state.selectedLanguage);
8248
8444
  const purposeLook = this.purposeLook(look, state.selectedLanguage);
8249
8445
  const linkStyle = { ...styles2.link, color: look.linkColor };
8250
8446
  const textStyle2 = {
8251
8447
  ...styles2.privacyText,
8252
8448
  ...responsive.privacyText,
8253
- color: textColor
8449
+ color: textColor,
8450
+ ...centresHeader(chromeOptions) ? styles2.privacyTextCentred : {}
8254
8451
  };
8255
8452
  if (look.docked && isMobile) {
8256
8453
  this.modalEl.appendChild(el("div", { style: parts.grabber, "aria-hidden": "true" }));
8257
8454
  }
8258
- const logoImg = activeConfig.logo_url ? el("img", {
8455
+ const logoImg = chromeOptions.showsLogo && activeConfig.logo_url ? el("img", {
8259
8456
  ...part("logo"),
8260
8457
  src: activeConfig.logo_url,
8261
8458
  style: { ...styles2.logo, ...responsive.logo },
@@ -8264,7 +8461,14 @@ var ModalController = class {
8264
8461
  this.noticeTitleEl = el("h2", {
8265
8462
  id: "privacy-notice-title",
8266
8463
  ...part("title"),
8267
- style: { ...styles2.title, ...responsive.title, color: headingColor }
8464
+ tabIndex: "-1",
8465
+ style: {
8466
+ ...styles2.title,
8467
+ ...responsive.title,
8468
+ color: headingColor,
8469
+ ...centresHeader(chromeOptions) ? styles2.titleCentred : {},
8470
+ ...chromeOptions.showsTitle ? {} : styles2.titleHidden
8471
+ }
8268
8472
  });
8269
8473
  this.noticeTitleEl.textContent = this.getTranslatedText(
8270
8474
  "notice_banner_heading",
@@ -8274,11 +8478,10 @@ var ModalController = class {
8274
8478
  this.langSelectorRefs.close();
8275
8479
  this.shadowRoot.removeChild(this.langSelectorRefs.dropdown);
8276
8480
  }
8277
- const supportedLangs = Object.keys(activeConfig.supported_languages_and_translations || {});
8278
- const allLanguages = [
8279
- activeConfig.default_language || "English",
8280
- ...supportedLangs.filter((l) => l !== activeConfig.default_language)
8281
- ];
8481
+ const allLanguages = noticeLanguageOptions(
8482
+ activeConfig.default_language,
8483
+ activeConfig.supported_languages_and_translations
8484
+ );
8282
8485
  this.langSelectorRefs = renderLanguageSelector({
8283
8486
  languages: allLanguages,
8284
8487
  selectedLanguage: state.selectedLanguage,
@@ -8293,7 +8496,7 @@ var ModalController = class {
8293
8496
  onSelect: (lang) => this.handleLanguageSelect(lang),
8294
8497
  dropdownContainer: this.shadowRoot
8295
8498
  });
8296
- this.ttsButton = el("button", {
8499
+ this.ttsButton = chromeOptions.showsAudioButton ? el("button", {
8297
8500
  style: {
8298
8501
  ...styles2.topRight,
8299
8502
  ...responsive.topRight,
@@ -8310,9 +8513,9 @@ var ModalController = class {
8310
8513
  var _a2;
8311
8514
  return (_a2 = this.ttsManager) == null ? void 0 : _a2.toggle();
8312
8515
  }
8313
- });
8314
- this.ttsButton.appendChild(this.speakerIcon(false));
8315
- (_e = this.ttsManager) == null ? void 0 : _e.fetchAudioUrls({
8516
+ }) : null;
8517
+ (_e = this.ttsButton) == null ? void 0 : _e.appendChild(this.speakerIcon(false));
8518
+ (_f = this.ttsManager) == null ? void 0 : _f.fetchAudioUrls({
8316
8519
  accessToken: this.options.accessToken,
8317
8520
  baseUrl: this.endpoints.baseUrl,
8318
8521
  ledgerBaseUrl: this.endpoints.ledgerBaseUrl,
@@ -8321,6 +8524,7 @@ var ModalController = class {
8321
8524
  language: this.getLanguageCode(state.selectedLanguage),
8322
8525
  content: activeConfig,
8323
8526
  purposes: this.talkbackPurposes(state),
8527
+ chrome: chromeOptions,
8324
8528
  ...this.sandboxParams()
8325
8529
  });
8326
8530
  const topRight = el("div", {
@@ -8337,7 +8541,19 @@ var ModalController = class {
8337
8541
  )
8338
8542
  );
8339
8543
  }
8340
- headerRows.push(el("div", { style: styles2.headerRow }, this.noticeTitleEl, topRight));
8544
+ headerRows.push(
8545
+ centresHeader(chromeOptions) ? el("div", { style: styles2.headerRowCentred }, this.noticeTitleEl) : el(
8546
+ "div",
8547
+ {
8548
+ style: {
8549
+ ...styles2.headerRow,
8550
+ ...chromeOptions.showsTitle ? {} : styles2.headerRowTrailing
8551
+ }
8552
+ },
8553
+ this.noticeTitleEl,
8554
+ topRight
8555
+ )
8556
+ );
8341
8557
  const topSection = el(
8342
8558
  "div",
8343
8559
  {
@@ -8345,6 +8561,7 @@ var ModalController = class {
8345
8561
  style: {
8346
8562
  ...styles2.headerStack,
8347
8563
  ...responsive.headerStack,
8564
+ ...headerHoldsOnlyControls(chromeOptions, Boolean(activeConfig.logo_url)) ? styles2.headerStackControlsOnly : {},
8348
8565
  ...sheetParts == null ? void 0 : sheetParts.sheetHeader,
8349
8566
  color: textColor
8350
8567
  }
@@ -8396,7 +8613,7 @@ var ModalController = class {
8396
8613
  "p",
8397
8614
  { ...part("notice-text"), style: textStyle2 },
8398
8615
  noticeTextSpan,
8399
- showNoticePolicyLink && el("br"),
8616
+ showNoticePolicyLink && (chromeOptions.inlinesPolicyLink ? " " : el("br")),
8400
8617
  showNoticePolicyLink && policySpan
8401
8618
  );
8402
8619
  const dpoPreview = activeConfig.dpo_info ? this.getTranslatedDpoText("grievance_text", activeConfig.dpo_info.grievance_text || "") : activeConfig.additional_text ? this.getTranslatedText("additional_text", activeConfig.additional_text) : "";
@@ -8408,15 +8625,22 @@ var ModalController = class {
8408
8625
  fallback: activeConfig.privacy_policy_anchor_text ? policyAnchorText : ""
8409
8626
  })
8410
8627
  );
8411
- this.purposeHeadingEl = el("h2", {
8628
+ if (centresHeader(chromeOptions)) {
8629
+ this.middleSection.appendChild(
8630
+ el("div", { style: styles2.headerControlsRow }, topRight)
8631
+ );
8632
+ }
8633
+ this.purposeHeadingEl = chromeOptions.showsPurposeSectionHeading ? el("h2", {
8412
8634
  id: "purpose-section-heading",
8413
8635
  style: { ...styles2.subTitle, ...responsive.subTitle, color: headingColor }
8414
- });
8415
- this.purposeHeadingEl.textContent = this.getTranslatedText(
8416
- "purpose_section_heading",
8417
- activeConfig.purpose_section_heading || DEFAULT_PURPOSE_SECTION_HEADING
8418
- );
8419
- this.middleSection.appendChild(this.purposeHeadingEl);
8636
+ }) : null;
8637
+ if (this.purposeHeadingEl) {
8638
+ this.purposeHeadingEl.textContent = this.getTranslatedText(
8639
+ "purpose_section_heading",
8640
+ activeConfig.purpose_section_heading || DEFAULT_PURPOSE_SECTION_HEADING
8641
+ );
8642
+ this.middleSection.appendChild(this.purposeHeadingEl);
8643
+ }
8420
8644
  const purposesGroup = el("div", {
8421
8645
  ...part("purposes"),
8422
8646
  style: sheetParts || look.layout.collapsibleSections ? parts.sheetGroup : null
@@ -8490,7 +8714,11 @@ var ModalController = class {
8490
8714
  this.mountOtpGate();
8491
8715
  const dpoBlock = this.renderDpoBlock(look, productPolicyLinks, chrome.productPoliciesLabel);
8492
8716
  if (dpoBlock) {
8493
- const centerTitle = activeConfig.privacy_center_url && activeConfig.privacy_center_anchor_text ? this.getTranslatedText(
8717
+ const centerTitle = showsPrivacyCenter(
8718
+ look.chrome,
8719
+ activeConfig.privacy_center_url,
8720
+ activeConfig.privacy_center_anchor_text
8721
+ ) && activeConfig.privacy_center_anchor_text ? this.getTranslatedText(
8494
8722
  "privacy_center_anchor_text",
8495
8723
  activeConfig.privacy_center_anchor_text
8496
8724
  ) : "";
@@ -8536,7 +8764,7 @@ var ModalController = class {
8536
8764
  this.confirmHintEl = renderConfirmHint(styles2.confirmHint);
8537
8765
  this.updateAcceptButtonState(state);
8538
8766
  this.updateErrorMessage(state);
8539
- (_f = this.keyboardCleanup) == null ? void 0 : _f.call(this);
8767
+ (_g = this.keyboardCleanup) == null ? void 0 : _g.call(this);
8540
8768
  this.keyboardCleanup = setupKeyboardTrap(this.modalEl, () => this.handleDecline());
8541
8769
  }
8542
8770
  /** The purposes in the order talkback reads them: as the notice shows them. */
@@ -8557,9 +8785,12 @@ var ModalController = class {
8557
8785
  var _a;
8558
8786
  const activeConfig = (_a = this.store.getState().content) == null ? void 0 : _a.detail.active_config;
8559
8787
  if (!activeConfig) return null;
8560
- const hasPrivacyCenterLine = Boolean(
8561
- activeConfig.privacy_center_url || activeConfig.additional_text
8788
+ const showsCenter = showsPrivacyCenter(
8789
+ look.chrome,
8790
+ activeConfig.privacy_center_url,
8791
+ activeConfig.privacy_center_anchor_text
8562
8792
  );
8793
+ const hasPrivacyCenterLine = Boolean(showsCenter || activeConfig.additional_text);
8563
8794
  if (!hasPrivacyCenterLine && !activeConfig.dpo_info && productPolicyLinks.length === 0) {
8564
8795
  return null;
8565
8796
  }
@@ -8590,21 +8821,25 @@ var ModalController = class {
8590
8821
  addlSpan.textContent = this.getTranslatedText("additional_text", activeConfig.additional_text);
8591
8822
  footerP.appendChild(addlSpan);
8592
8823
  }
8593
- if (activeConfig.privacy_center_url) {
8824
+ if (showsCenter) {
8594
8825
  if (activeConfig.additional_text) footerP.appendChild(document.createTextNode(" "));
8595
8826
  const pcAnchorText = this.getTranslatedText(
8596
8827
  "privacy_center_anchor_text",
8597
8828
  activeConfig.privacy_center_anchor_text || "Privacy Center"
8598
8829
  );
8599
- this.privacyCenterLinkEl = el("a", {
8600
- id: "privacy-center-link",
8601
- href: activeConfig.privacy_center_url,
8602
- target: "_blank",
8603
- rel: "noopener noreferrer",
8604
- style: linkStyle
8605
- });
8606
- this.privacyCenterLinkEl.textContent = pcAnchorText;
8607
- footerP.appendChild(this.privacyCenterLinkEl);
8830
+ if (look.chrome.privacyCenterAsText) {
8831
+ footerP.appendChild(el("span", { id: "privacy-center-link" }, pcAnchorText));
8832
+ } else {
8833
+ this.privacyCenterLinkEl = el("a", {
8834
+ id: "privacy-center-link",
8835
+ href: activeConfig.privacy_center_url,
8836
+ target: "_blank",
8837
+ rel: "noopener noreferrer",
8838
+ style: linkStyle
8839
+ });
8840
+ this.privacyCenterLinkEl.textContent = pcAnchorText;
8841
+ footerP.appendChild(this.privacyCenterLinkEl);
8842
+ }
8608
8843
  footerP.appendChild(document.createTextNode("."));
8609
8844
  }
8610
8845
  }
@@ -8985,6 +9220,7 @@ var ModalController = class {
8985
9220
  const content = (_a = state.content) == null ? void 0 : _a.detail.active_config;
8986
9221
  const products = content == null ? void 0 : content.products;
8987
9222
  if (!content || !products || products.length !== 1) return null;
9223
+ if (!look.chrome.showsProductSection) return null;
8988
9224
  const product = products[0];
8989
9225
  const section = renderProductSection({
8990
9226
  product,
@@ -9150,7 +9386,10 @@ var ModalController = class {
9150
9386
  "required-outstanding": chrome.hintRequiredOutstanding
9151
9387
  }
9152
9388
  );
9153
- updateConfirmHint(this.confirmHintEl, this.bottomSectionEl, this.acceptBtn, text);
9389
+ const look = this.look;
9390
+ const drawn = !look || drawsConfirmHint(verdict, look.chrome.showsRequiredHint);
9391
+ const style = look ? { ...look.styles.confirmHint, ...drawn ? {} : look.styles.confirmHintHidden } : void 0;
9392
+ updateConfirmHint(this.confirmHintEl, this.bottomSectionEl, this.acceptBtn, text, style, drawn);
9154
9393
  }
9155
9394
  updateAcceptButtonState(state) {
9156
9395
  if (!this.acceptBtn || state.isFullyConsentedReviewMode) return;
@@ -12569,7 +12808,13 @@ var renderPurposes = (ctx, locked) => {
12569
12808
  var renderDpoFooter = (ctx) => {
12570
12809
  const { content, t, tDpo, styles: styles2, responsive, productPolicyLinks } = ctx;
12571
12810
  const dpo = content.dpo_info;
12572
- const hasPrivacyCenterLine = Boolean(content.privacy_center_url || content.additional_text);
12811
+ const chrome = noticeChromeOptions(content.appearance);
12812
+ const showsCenter = showsPrivacyCenter(
12813
+ chrome,
12814
+ content.privacy_center_url,
12815
+ content.privacy_center_anchor_text
12816
+ );
12817
+ const hasPrivacyCenterLine = Boolean(showsCenter || content.additional_text);
12573
12818
  if (!hasPrivacyCenterLine && !dpo && productPolicyLinks.length === 0) return null;
12574
12819
  const paragraph = el("p", { style: { margin: 0, opacity: "0.6" } });
12575
12820
  const linkStyle = { ...styles2.link, color: ctx.linkColor };
@@ -12581,14 +12826,14 @@ var renderDpoFooter = (ctx) => {
12581
12826
  t("additional_text", content.additional_text || "Manage or withdraw consent anytime at")
12582
12827
  )
12583
12828
  );
12584
- if (content.privacy_center_url) {
12829
+ if (showsCenter) {
12830
+ const centerText = t(
12831
+ "privacy_center_anchor_text",
12832
+ content.privacy_center_anchor_text || "Privacy Center"
12833
+ );
12585
12834
  paragraph.appendChild(document.createTextNode(" "));
12586
12835
  paragraph.appendChild(
12587
- el(
12588
- "a",
12589
- linkAttrs(ctx, "privacy-center-link", content.privacy_center_url),
12590
- t("privacy_center_anchor_text", content.privacy_center_anchor_text || "Privacy Center")
12591
- )
12836
+ chrome.privacyCenterAsText ? el("span", { id: "privacy-center-link" }, centerText) : el("a", linkAttrs(ctx, "privacy-center-link", content.privacy_center_url), centerText)
12592
12837
  );
12593
12838
  paragraph.appendChild(document.createTextNode("."));
12594
12839
  }