@redacto.io/consent-sdk-react 10.0.0-beta.3 → 10.0.0-beta.5

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 (29) hide show
  1. package/.turbo/turbo-build.log +11 -11
  2. package/CHANGELOG.md +39 -0
  3. package/dist/index.d.mts +3 -1
  4. package/dist/index.d.ts +3 -1
  5. package/dist/index.js +135 -101
  6. package/dist/index.mjs +135 -101
  7. package/dist/privacy-center.js +461 -778
  8. package/dist/privacy-center.mjs +311 -628
  9. package/package.json +1 -1
  10. package/src/RedactoNoticeAssisted/RedactoNoticeAssisted.test.tsx +87 -0
  11. package/src/RedactoNoticeAssisted/RedactoNoticeAssisted.tsx +27 -0
  12. package/src/RedactoNoticeAssisted/api/index.ts +7 -1
  13. package/src/RedactoNoticeAssisted/api/types.ts +2 -0
  14. package/src/RedactoNoticeAssisted/i18n.ts +0 -55
  15. package/src/RedactoNoticeAssisted/types.ts +2 -0
  16. package/src/RedactoNoticeConsent/api/index.ts +5 -66
  17. package/src/RedactoNoticeConsent/api/types.ts +9 -30
  18. package/src/RedactoNoticeConsent/language-codes.ts +0 -2
  19. package/src/RedactoNoticeConsentInline/RedactoNoticeConsentInline.tsx +59 -1
  20. package/src/RedactoPrivacyCenter/components/AppShell/UserMenu.tsx +22 -27
  21. package/src/RedactoPrivacyCenter/lib/constants.ts +0 -1
  22. package/src/RedactoPrivacyCenter/lib/locales.ts +0 -3
  23. package/src/RedactoPrivacyCenter/locales/en/translation.json +2 -1
  24. package/src/RedactoPrivacyCenter/styles/injectStyles.ts +7 -2
  25. package/src/RedactoPrivacyCenter/styles/pcStyles.ts +17 -0
  26. package/src/RedactoPrivacyCenter/ui/PCAvatar.test.tsx +83 -0
  27. package/src/RedactoPrivacyCenter/ui/PCAvatar.tsx +33 -9
  28. package/src/shared/notice-consent-status.ts +190 -0
  29. package/src/RedactoPrivacyCenter/locales/bho/translation.json +0 -343
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
7
7
 
8
8
  // src/RedactoNoticeConsent/api/index.ts
9
- import { jwtDecode } from "jwt-decode";
9
+ import { jwtDecode as jwtDecode2 } from "jwt-decode";
10
10
 
11
11
  // src/shared/api-errors.ts
12
12
  var ApiError = class extends Error {
@@ -66,6 +66,83 @@ async function parseApiError(response, fallbackMessage) {
66
66
  });
67
67
  }
68
68
 
69
+ // src/shared/notice-consent-status.ts
70
+ import { jwtDecode } from "jwt-decode";
71
+ var decodeNoticeConsentToken = (token) => {
72
+ try {
73
+ return jwtDecode(token);
74
+ } catch {
75
+ return null;
76
+ }
77
+ };
78
+ var fetchNoticeConsentStatusForScope = async ({
79
+ accessToken,
80
+ ledgerBaseUrl,
81
+ organisationUuid,
82
+ workspaceUuid,
83
+ noticeUuid,
84
+ signal
85
+ }) => {
86
+ if (!accessToken || !ledgerBaseUrl || !organisationUuid || !workspaceUuid || !noticeUuid) {
87
+ return null;
88
+ }
89
+ try {
90
+ const response = await fetch(
91
+ `${ledgerBaseUrl}/public/organisations/${organisationUuid}/workspaces/${workspaceUuid}/notices/${noticeUuid}/check-consent`,
92
+ {
93
+ method: "POST",
94
+ headers: {
95
+ Authorization: `Bearer ${accessToken}`,
96
+ "Content-Type": "application/json"
97
+ },
98
+ body: "{}",
99
+ signal
100
+ }
101
+ );
102
+ if (!response.ok) {
103
+ return null;
104
+ }
105
+ const data = await response.json();
106
+ const body = data && typeof data === "object" && "detail" in data && data.detail ? data.detail : data;
107
+ if (!body || !Array.isArray(body.purposes)) {
108
+ return null;
109
+ }
110
+ return body;
111
+ } catch {
112
+ return null;
113
+ }
114
+ };
115
+ var fetchNoticeConsentStatus = async ({
116
+ accessToken,
117
+ ledgerBaseUrl,
118
+ noticeUuid,
119
+ signal
120
+ }) => {
121
+ if (!accessToken || !ledgerBaseUrl || !noticeUuid) {
122
+ return null;
123
+ }
124
+ const decodedToken = decodeNoticeConsentToken(accessToken);
125
+ if (!decodedToken) {
126
+ return null;
127
+ }
128
+ const {
129
+ organisation_uuid: ORGANISATION_UUID,
130
+ workspace_uuid: WORKSPACE_UUID
131
+ } = decodedToken;
132
+ if (!ORGANISATION_UUID || !WORKSPACE_UUID) {
133
+ return null;
134
+ }
135
+ return fetchNoticeConsentStatusForScope({
136
+ accessToken,
137
+ ledgerBaseUrl,
138
+ organisationUuid: ORGANISATION_UUID,
139
+ workspaceUuid: WORKSPACE_UUID,
140
+ noticeUuid,
141
+ signal
142
+ });
143
+ };
144
+ var isNoticeFullyConsented = (status) => status.consented && status.all_mandatory_active;
145
+
69
146
  // src/RedactoNoticeConsent/api/index.ts
70
147
  var BASE_URL = "https://api.redacto.io/consent";
71
148
  var apiCache = /* @__PURE__ */ new Map();
@@ -85,7 +162,7 @@ function setCachedData(key, data, ttl = CACHE_TTL) {
85
162
  }
86
163
  function decodeTokenSafely(token) {
87
164
  try {
88
- return jwtDecode(token);
165
+ return jwtDecode2(token);
89
166
  } catch (error) {
90
167
  console.warn("Failed to decode JWT token:", error);
91
168
  return null;
@@ -223,49 +300,6 @@ var submitConsentEvent = async ({
223
300
  }
224
301
  apiCache.clear();
225
302
  };
226
- var fetchNoticeConsentStatus = async ({
227
- accessToken,
228
- ledgerBaseUrl,
229
- noticeUuid,
230
- signal
231
- }) => {
232
- if (!accessToken || !ledgerBaseUrl || !noticeUuid) {
233
- return null;
234
- }
235
- const decodedToken = decodeTokenSafely(accessToken);
236
- if (!decodedToken) {
237
- return null;
238
- }
239
- const { organisation_uuid: ORGANISATION_UUID, workspace_uuid: WORKSPACE_UUID } = decodedToken;
240
- if (!ORGANISATION_UUID || !WORKSPACE_UUID) {
241
- return null;
242
- }
243
- try {
244
- const response = await fetch(
245
- `${ledgerBaseUrl}/public/organisations/${ORGANISATION_UUID}/workspaces/${WORKSPACE_UUID}/notices/${noticeUuid}/check-consent`,
246
- {
247
- method: "POST",
248
- headers: {
249
- Authorization: `Bearer ${accessToken}`,
250
- "Content-Type": "application/json"
251
- },
252
- body: "{}",
253
- signal
254
- }
255
- );
256
- if (!response.ok) {
257
- return null;
258
- }
259
- const data = await response.json();
260
- const body = data && typeof data === "object" && "detail" in data && data.detail ? data.detail : data;
261
- if (!body || !Array.isArray(body.purposes)) {
262
- return null;
263
- }
264
- return body;
265
- } catch {
266
- return null;
267
- }
268
- };
269
303
  var buildLedgerConsentOverlay = (status, configPurposes) => {
270
304
  var _a, _b;
271
305
  const byUuid = new Map(status.purposes.map((p) => [p.uuid, p]));
@@ -502,7 +536,6 @@ var LANGUAGE_NATIVE_LABELS = {
502
536
  English: "English",
503
537
  Assamese: "\u0985\u09B8\u09AE\u09C0\u09AF\u09BC\u09BE (Assamese)",
504
538
  Bengali: "\u09AC\u09BE\u0982\u09B2\u09BE (Bengali)",
505
- Bhojpuri: "\u092D\u094B\u091C\u092A\u0941\u0930\u0940 (Bhojpuri)",
506
539
  Bodo: "\u092C\u0921\u093C\u094B (Bodo)",
507
540
  Dogri: "\u0921\u094B\u0917\u0930\u0940 (Dogri)",
508
541
  Gujarati: "\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0 (Gujarati)",
@@ -532,7 +565,6 @@ var LANGUAGE_NAME_TO_BCP47 = {
532
565
  English: "en",
533
566
  Assamese: "as",
534
567
  Bengali: "bn",
535
- Bhojpuri: "bho",
536
568
  Bodo: "brx",
537
569
  Dogri: "doi",
538
570
  Gujarati: "gu",
@@ -5199,6 +5231,9 @@ var RedactoConsentInlineComponent = ({
5199
5231
  const [selectedPurposes, setSelectedPurposes] = useState3({});
5200
5232
  const [selectedDataElements, setSelectedDataElements] = useState3({});
5201
5233
  const [hasAlreadyConsented, setHasAlreadyConsented] = useState3(false);
5234
+ const [isCheckingConsent, setIsCheckingConsent] = useState3(
5235
+ Boolean(ledgerBaseUrl) && !applicationId
5236
+ );
5202
5237
  const [fetchError, setFetchError] = useState3(null);
5203
5238
  const [errorMessage, setErrorMessage] = useState3(null);
5204
5239
  const hasSubmittedRef = useRef2(false);
@@ -5341,6 +5376,38 @@ var RedactoConsentInlineComponent = ({
5341
5376
  useEffect3(() => {
5342
5377
  fetchNotice();
5343
5378
  }, [org_uuid, workspace_uuid, notice_uuid, language, applicationId]);
5379
+ useEffect3(() => {
5380
+ if (!ledgerBaseUrl || applicationId) {
5381
+ return;
5382
+ }
5383
+ if (!accessToken || !content) {
5384
+ return;
5385
+ }
5386
+ let active = true;
5387
+ const controller = new AbortController();
5388
+ const checkLedgerConsent = async () => {
5389
+ try {
5390
+ const ledgerStatus = await fetchNoticeConsentStatus({
5391
+ accessToken,
5392
+ ledgerBaseUrl,
5393
+ noticeUuid: notice_uuid,
5394
+ signal: controller.signal
5395
+ });
5396
+ if (active && ledgerStatus && isNoticeFullyConsented(ledgerStatus)) {
5397
+ setHasAlreadyConsented(true);
5398
+ }
5399
+ } finally {
5400
+ if (active) {
5401
+ setIsCheckingConsent(false);
5402
+ }
5403
+ }
5404
+ };
5405
+ checkLedgerConsent();
5406
+ return () => {
5407
+ active = false;
5408
+ controller.abort();
5409
+ };
5410
+ }, [ledgerBaseUrl, applicationId, accessToken, content, notice_uuid]);
5344
5411
  const togglePurposeCollapse = (purposeUuid) => {
5345
5412
  setCollapsedPurposes((prev) => ({
5346
5413
  ...prev,
@@ -5464,7 +5531,7 @@ var RedactoConsentInlineComponent = ({
5464
5531
  ]
5465
5532
  );
5466
5533
  useEffect3(() => {
5467
- if (accessToken && content && areAllRequiredElementsChecked && !isSubmitting && !hasSubmittedRef.current) {
5534
+ if (accessToken && content && areAllRequiredElementsChecked && !isSubmitting && !isCheckingConsent && !hasAlreadyConsented && !hasSubmittedRef.current) {
5468
5535
  hasSubmittedRef.current = true;
5469
5536
  const autoSubmit = async () => {
5470
5537
  try {
@@ -5481,6 +5548,8 @@ var RedactoConsentInlineComponent = ({
5481
5548
  content,
5482
5549
  areAllRequiredElementsChecked,
5483
5550
  isSubmitting,
5551
+ isCheckingConsent,
5552
+ hasAlreadyConsented,
5484
5553
  handleAcceptWithToken
5485
5554
  ]);
5486
5555
  useEffect3(() => {
@@ -6741,6 +6810,7 @@ var submitAssistedConsent = async ({
6741
6810
  organisationUuid,
6742
6811
  workspaceUuid,
6743
6812
  baseUrl,
6813
+ ledgerBaseUrl,
6744
6814
  noticeUuid,
6745
6815
  purposes,
6746
6816
  language,
@@ -6771,7 +6841,7 @@ var submitAssistedConsent = async ({
6771
6841
  declined: false,
6772
6842
  language: language || void 0
6773
6843
  };
6774
- const url = `${publicScope(baseUrl, organisationUuid, workspaceUuid)}/submit-consent`;
6844
+ const url = `${publicScope(ledgerBaseUrl || baseUrl, organisationUuid, workspaceUuid)}/submit-consent`;
6775
6845
  const response = await fetch(url, {
6776
6846
  method: "POST",
6777
6847
  headers: {
@@ -7898,57 +7968,6 @@ var as = {
7898
7968
  tryAgain: "\u0985\u09A8\u09C1\u0997\u09CD\u09F0\u09B9 \u0995\u09F0\u09BF \u09AA\u09C1\u09A8\u09F0 \u099A\u09C7\u09B7\u09CD\u099F\u09BE \u0995\u09F0\u0995\u0964",
7899
7969
  close: "\u09AC\u09A8\u09CD\u09A7 \u0995\u09F0\u0995"
7900
7970
  };
7901
- var bho = {
7902
- useEmailInstead: "\u0908\u092E\u0947\u0932 \u0907\u0938\u094D\u0924\u0947\u092E\u093E\u0932 \u0915\u0930\u0940\u0902",
7903
- useMobileInstead: "\u092E\u094B\u092C\u093E\u0907\u0932 \u0907\u0938\u094D\u0924\u0947\u092E\u093E\u0932 \u0915\u0930\u0940\u0902",
7904
- emailAddress: "\u0908\u092E\u0947\u0932 \u092A\u0924\u093E",
7905
- otpHelperEmail: "\u0939\u092E\u0928\u0940 \u090F\u0939 \u0908\u092E\u0947\u0932 \u092A\u0930 \u090F\u0915 \u092C\u0947\u0930 \u0907\u0938\u094D\u0924\u0947\u092E\u093E\u0932 \u0939\u094B\u0916\u0947 \u0935\u093E\u0932\u093E \u092A\u093E\u0938\u0935\u0930\u094D\u0921 \u092D\u0947\u091C\u092C\u0964",
7906
- changeEmail: "\u0908\u092E\u0947\u0932 \u092C\u0926\u0932\u0940\u0902",
7907
- expandDetails: "{name} \u0915\u0947 \u0935\u093F\u0935\u0930\u0923 \u092B\u0948\u0932\u093E\u0908\u0902",
7908
- collapseDetails: "{name} \u0915\u0947 \u0935\u093F\u0935\u0930\u0923 \u0938\u092E\u0947\u091F\u0940\u0902",
7909
- selectAllFor: "{name} \u0916\u093E\u0924\u093F\u0930 \u0938\u092D \u0921\u0947\u091F\u093E \u0924\u0924\u094D\u0935 \u091A\u0941\u0928\u0940\u0902",
7910
- selectElement: "{name} \u091A\u0941\u0928\u0940\u0902",
7911
- selectElementRequired: "{name} \u091A\u0941\u0928\u0940\u0902 (\u091C\u0930\u0942\u0930\u0940)",
7912
- required: "\u091C\u0930\u0942\u0930\u0940",
7913
- logoAlt: "\u0932\u094B\u0917\u094B",
7914
- selectLanguage: "\u092D\u093E\u0937\u093E \u091A\u0941\u0928\u0940\u0902",
7915
- selectLanguageCurrent: "\u092D\u093E\u0937\u093E \u091A\u0941\u0928\u0940\u0902. \u092E\u094C\u091C\u0942\u0926\u093E \u092D\u093E\u0937\u093E: {lang}",
7916
- opensInNewTab: "\u0928\u092F\u093E \u091F\u0948\u092C \u092E\u0947\u0902 \u0916\u0941\u0932\u0947\u0932\u093E",
7917
- audioStart: "\u0911\u0921\u093F\u092F\u094B \u092A\u094D\u0932\u0947\u092C\u0948\u0915 \u0936\u0941\u0930\u0942 \u0915\u0930\u0940\u0902",
7918
- audioPause: "\u0911\u0921\u093F\u092F\u094B \u092A\u094D\u0932\u0947\u092C\u0948\u0915 \u0930\u094B\u0915\u0940\u0902",
7919
- talkbackStart: "\u091F\u0949\u0915\u092C\u0948\u0915 \u0936\u0941\u0930\u0942 \u0915\u0930\u0940\u0902",
7920
- talkbackPause: "\u091F\u0949\u0915\u092C\u0948\u0915 \u0930\u094B\u0915\u0940\u0902",
7921
- mobileNumber: "\u092E\u094B\u092C\u093E\u0907\u0932 \u0928\u0902\u092C\u0930",
7922
- otpHelper: "\u0939\u092E\u0928\u0940 \u090F\u0939 \u0928\u0902\u092C\u0930 \u092A\u0930 \u090F\u0915 \u092C\u0947\u0930 \u0907\u0938\u094D\u0924\u0947\u092E\u093E\u0932 \u0939\u094B\u0916\u0947 \u0935\u093E\u0932\u093E \u092A\u093E\u0938\u0935\u0930\u094D\u0921 \u092D\u0947\u091C\u092C\u0964",
7923
- otpSentTo: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u092D\u0947\u091C\u0932 \u0917\u0907\u0932",
7924
- changeMobile: "\u092E\u094B\u092C\u093E\u0907\u0932 \u0928\u0902\u092C\u0930 \u092C\u0926\u0932\u0940\u0902",
7925
- enterNDigitOtp: "{count}-\u0905\u0902\u0915 \u0915\u0947 \u0913\u091F\u0940\u092A\u0940 (OTP) \u0921\u093E\u0932\u0940\u0902",
7926
- otpDigit: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u0905\u0902\u0915 {index}",
7927
- resendIn: "{seconds} \u0938\u0947\u0915\u0902\u0921 \u092E\u0947\u0902 \u0913\u091F\u0940\u092A\u0940 (OTP) \u092B\u0947\u0930 \u0938\u0947 \u092D\u0947\u091C\u0940\u0902",
7928
- sending: "\u092D\u0947\u091C\u0932 \u091C\u093E \u0930\u0939\u0932 \u092C\u093E\u2026",
7929
- resendOtp: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u092B\u0947\u0930 \u0938\u0947 \u092D\u0947\u091C\u0940\u0902",
7930
- getOtp: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u092A\u093E\u0908\u0902",
7931
- verifying: "\u0938\u0924\u094D\u092F\u093E\u092A\u093F\u0924 \u0915\u0907\u0932 \u091C\u093E \u0930\u0939\u0932 \u092C\u093E\u2026",
7932
- verifyOtp: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u0938\u0924\u094D\u092F\u093E\u092A\u093F\u0924 \u0915\u0930\u0940\u0902",
7933
- sendOtp: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u092D\u0947\u091C\u0940\u0902",
7934
- confirmOtp: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u0915\u0947 \u092A\u0941\u0937\u094D\u091F\u093F \u0915\u0930\u0940\u0902",
7935
- verifyWithOtp: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u0938\u0947 \u0938\u0924\u094D\u092F\u093E\u092A\u093F\u0924 \u0915\u0930\u0940\u0902",
7936
- editSelections: "\u091A\u0941\u0928\u093E\u0935 \u092E\u0947\u0902 \u092C\u0926\u0932\u093E\u0935 \u0915\u0930\u0940\u0902",
7937
- otpIncorrect: "\u0930\u0909\u0930\u093E \u0921\u093E\u0932\u0932 \u0938\u0924\u094D\u092F\u093E\u092A\u0928 \u0915\u094B\u0921 \u0917\u0932\u0924 \u092C\u093E\u0964 \u0915\u0943\u092A\u092F\u093E \u091C\u093E\u0901\u091A \u0915\u0930\u0940\u0902 \u0906 \u092B\u0947\u0930 \u0938\u0947 \u0915\u094B\u0936\u093F\u0936 \u0915\u0930\u0940\u0902\u0964",
7938
- otpExpired: "\u0930\u0909\u0930\u093E \u0938\u0924\u094D\u092F\u093E\u092A\u0928 \u0915\u094B\u0921 \u0915\u0947 \u092E\u093F\u092F\u093E\u0926 \u0916\u0924\u092E \u0939\u094B \u0917\u0907\u0932 \u092C\u093E\u0964 \u0915\u0943\u092A\u092F\u093E \u0928\u092F\u093E \u0915\u094B\u0921 \u092E\u093E\u0902\u0917\u0940\u0902\u0964",
7939
- otpNotFound: "\u0938\u0924\u094D\u092F\u093E\u092A\u0928 \u0915\u094B\u0921 \u0928\u093E \u092E\u093F\u0932\u0932\u0964 \u0915\u0943\u092A\u092F\u093E \u0928\u092F\u093E \u0915\u094B\u0921 \u092E\u093E\u0902\u0917\u0940\u0902\u0964",
7940
- otpVerifyFailed: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u0915\u0947 \u0938\u0924\u094D\u092F\u093E\u092A\u0928 \u0928\u093E \u0939\u094B \u0938\u0915\u0932\u0964 \u0915\u0943\u092A\u092F\u093E \u092B\u0947\u0930 \u0938\u0947 \u0915\u094B\u0936\u093F\u0936 \u0915\u0930\u0940\u0902\u0964",
7941
- otpSendFailed: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u0928\u093E \u092D\u0947\u091C\u0932 \u091C\u093E \u0938\u0915\u0932\u0964 \u0915\u0943\u092A\u092F\u093E \u092B\u0947\u0930 \u0938\u0947 \u0915\u094B\u0936\u093F\u0936 \u0915\u0930\u0940\u0902\u0964",
7942
- consentConfirmed: "\u0938\u0939\u092E\u0924\u093F \u0915\u0947 \u092A\u0941\u0937\u094D\u091F\u093F \u092D\u0907\u0932",
7943
- recordedUnder: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u0938\u0924\u094D\u092F\u093E\u092A\u093F\u0924 \xB7 {regulation} \u0915\u0947 \u0924\u0939\u0924 \u0926\u0930\u094D\u091C \u092D\u0907\u0932",
7944
- recordedUnderAt: "\u0913\u091F\u0940\u092A\u0940 (OTP) \u0938\u0924\u094D\u092F\u093E\u092A\u093F\u0924 \xB7 {regulation} \u0915\u0947 \u0924\u0939\u0924 {time} \u092C\u091C\u0947 \u0926\u0930\u094D\u091C \u092D\u0907\u0932",
7945
- consentReferenceId: "\u0938\u0939\u092E\u0924\u093F \u0938\u0902\u0926\u0930\u094D\u092D \u0906\u0908\u0921\u0940",
7946
- proceed: "\u0906\u0917\u0947 \u092C\u0922\u093C\u0940\u0902",
7947
- loadingNotice: "\u0928\u094B\u091F\u093F\u0938 \u0932\u094B\u0921 \u0939\u094B \u0930\u0939\u0932 \u092C\u093E",
7948
- loadFailedTitle: "\u0938\u0939\u092E\u0924\u093F \u0928\u094B\u091F\u093F\u0938 \u0932\u094B\u0921 \u0928\u093E \u0939\u094B \u0938\u0915\u0932",
7949
- tryAgain: "\u0915\u0943\u092A\u092F\u093E \u092B\u0947\u0930 \u0938\u0947 \u0915\u094B\u0938\u093F\u0938 \u0915\u0930\u0940\u0902\u0964",
7950
- close: "\u092C\u0902\u0926 \u0915\u0930\u0940\u0902"
7951
- };
7952
7971
  var brx = {
7953
7972
  useEmailInstead: "\u0907\u092E\u0947\u0932 \u092C\u093E\u0939\u093E\u092F",
7954
7973
  useMobileInstead: "\u092E\u092C\u093E\u0907\u0932 \u092C\u093E\u0939\u093E\u092F",
@@ -8073,7 +8092,6 @@ var STATIC_STRINGS = {
8073
8092
  te,
8074
8093
  ur,
8075
8094
  as,
8076
- bho,
8077
8095
  brx,
8078
8096
  doi
8079
8097
  };
@@ -8258,6 +8276,7 @@ var RedactoNoticeAssisted = ({
8258
8276
  workspaceUuid,
8259
8277
  noticeUuid,
8260
8278
  baseUrl,
8279
+ ledgerBaseUrl,
8261
8280
  onDecline,
8262
8281
  onComplete
8263
8282
  }) => {
@@ -8993,6 +9012,19 @@ var RedactoNoticeAssisted = ({
8993
9012
  return;
8994
9013
  }
8995
9014
  const token = verifyDetail.access_token;
9015
+ if (ledgerBaseUrl) {
9016
+ const ledgerStatus = await fetchNoticeConsentStatusForScope({
9017
+ accessToken: token,
9018
+ ledgerBaseUrl,
9019
+ organisationUuid,
9020
+ workspaceUuid,
9021
+ noticeUuid: content.notice_uuid
9022
+ });
9023
+ if (ledgerStatus && isNoticeFullyConsented(ledgerStatus)) {
9024
+ handleSuccess();
9025
+ return;
9026
+ }
9027
+ }
8996
9028
  const submitPurposes = content.purposes.map((purpose) => ({
8997
9029
  ...purpose,
8998
9030
  selected: selectedPurposes[purpose.uuid] || false,
@@ -9006,6 +9038,7 @@ var RedactoNoticeAssisted = ({
9006
9038
  organisationUuid,
9007
9039
  workspaceUuid,
9008
9040
  baseUrl,
9041
+ ledgerBaseUrl,
9009
9042
  noticeUuid: content.notice_uuid,
9010
9043
  purposes: submitPurposes,
9011
9044
  language: toBcp47Code(selectedLanguage)
@@ -9029,6 +9062,7 @@ var RedactoNoticeAssisted = ({
9029
9062
  otpUuid,
9030
9063
  otpValue,
9031
9064
  baseUrl,
9065
+ ledgerBaseUrl,
9032
9066
  selectedPurposes,
9033
9067
  selectedDataElements,
9034
9068
  selectedLanguage,