@tantainnovative/ndpr-toolkit 4.0.0 → 4.1.0
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/CHANGELOG.md +56 -0
- package/dist/chunk-3APT25XO.mjs +1 -0
- package/dist/chunk-45D7AMB3.js +1 -0
- package/dist/chunk-65J4P5ID.js +1 -0
- package/dist/{chunk-NB6SKG76.mjs → chunk-6H6IXTHA.mjs} +1 -1
- package/dist/{chunk-GUERZD4O.mjs → chunk-6OPGI27L.mjs} +1 -1
- package/dist/{chunk-3XU6FL2I.js → chunk-6YFPDGNB.js} +1 -1
- package/dist/{chunk-IHNAFXDM.mjs → chunk-7Z7NURIA.mjs} +1 -1
- package/dist/chunk-D3HHDWBR.js +1 -0
- package/dist/chunk-DSIIEUAD.mjs +1 -0
- package/dist/chunk-H2FDWK4F.js +6 -0
- package/dist/chunk-HLFS3NXG.js +1 -0
- package/dist/chunk-JGY65SHX.mjs +1 -0
- package/dist/chunk-NI54X543.mjs +1 -0
- package/dist/{chunk-5F2IAUWJ.js → chunk-O4ATGGVK.js} +1 -1
- package/dist/chunk-P5MPUC5F.js +1 -0
- package/dist/{chunk-BGV2AKT7.mjs → chunk-PSPYIRIF.mjs} +1 -1
- package/dist/{chunk-HOAC5VUF.js → chunk-ROOUYQD4.js} +1 -1
- package/dist/{chunk-WMISQDSV.js → chunk-UJGNW6CH.js} +1 -1
- package/dist/chunk-UTXDZDYF.mjs +6 -0
- package/dist/chunk-W6VVLHRQ.mjs +1 -0
- package/dist/consent.d.mts +2 -0
- package/dist/consent.d.ts +2 -0
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +13 -0
- package/dist/core.d.ts +13 -0
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.d.mts +24 -0
- package/dist/cross-border.d.ts +24 -0
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/dsr.d.mts +3 -0
- package/dist/dsr.d.ts +3 -0
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/headless.d.mts +22 -1
- package/dist/headless.d.ts +22 -1
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/hooks.d.mts +22 -1
- package/dist/hooks.d.ts +22 -1
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +215 -1
- package/dist/index.d.ts +215 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis.d.mts +21 -0
- package/dist/lawful-basis.d.ts +21 -0
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/presets.d.mts +93 -0
- package/dist/presets.d.ts +93 -0
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/ropa-lite.d.mts +13 -1
- package/dist/ropa-lite.d.ts +13 -1
- package/dist/ropa-lite.js +1 -1
- package/dist/ropa-lite.mjs +1 -1
- package/dist/ropa.d.mts +43 -1
- package/dist/ropa.d.ts +43 -1
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/server.d.mts +135 -0
- package/dist/server.d.ts +135 -0
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/dist/styles.css +18 -16
- package/package.json +1 -1
- package/dist/chunk-42JPSNVV.mjs +0 -6
- package/dist/chunk-7FXNGGMO.js +0 -1
- package/dist/chunk-B46SJB5V.js +0 -1
- package/dist/chunk-BL5W472Q.js +0 -1
- package/dist/chunk-O2WEABB3.js +0 -1
- package/dist/chunk-OZHUINWS.js +0 -1
- package/dist/chunk-PJNKQPQP.mjs +0 -1
- package/dist/chunk-RBKFNCGO.mjs +0 -1
- package/dist/chunk-VPNK7OID.mjs +0 -1
- package/dist/chunk-WKUC65HL.mjs +0 -1
- package/dist/chunk-XYGGUGTO.js +0 -6
- package/dist/chunk-Z2M5VJX2.mjs +0 -1
package/dist/server.d.ts
CHANGED
|
@@ -152,6 +152,10 @@ declare interface ApiAdapterSuccessContext<T = unknown> {
|
|
|
152
152
|
*/
|
|
153
153
|
export declare function appendAuditEntry(entry: ConsentAuditEntry, storageKey?: string): void;
|
|
154
154
|
|
|
155
|
+
export declare const arabicLocale: Required<{
|
|
156
|
+
[K in keyof NDPRLocale]: Required<NonNullable<NDPRLocale[K]>>;
|
|
157
|
+
}>;
|
|
158
|
+
|
|
155
159
|
/**
|
|
156
160
|
* Assemble an ordered, NDPA-aligned array of privacy-policy sections from
|
|
157
161
|
* a {@link TemplateContext}. This is the canonical "compute the policy"
|
|
@@ -1199,6 +1203,7 @@ export declare function findUnfilledTokens(rendered: string): string[];
|
|
|
1199
1203
|
* Formats a DSR request for display or submission
|
|
1200
1204
|
* @param request The DSR request to format
|
|
1201
1205
|
* @returns Formatted request data
|
|
1206
|
+
* @deprecated Use `formatDSRRequestStructured()` for typed `{ field, code, message }[]` errors. The legacy string-returning shape will be removed in 5.0.
|
|
1202
1207
|
*/
|
|
1203
1208
|
export declare function formatDSRRequest(request: DSRRequest): {
|
|
1204
1209
|
formattedRequest: Record<string, unknown>;
|
|
@@ -1206,6 +1211,35 @@ export declare function formatDSRRequest(request: DSRRequest): {
|
|
|
1206
1211
|
validationErrors: string[];
|
|
1207
1212
|
};
|
|
1208
1213
|
|
|
1214
|
+
/**
|
|
1215
|
+
* Structured-result variant of {@link formatDSRRequest}. Same formatting
|
|
1216
|
+
* output, but `validationErrors` is replaced with a typed `errors` array
|
|
1217
|
+
* of `{ field, code, message }`.
|
|
1218
|
+
*
|
|
1219
|
+
* Codes emitted:
|
|
1220
|
+
* - `request_id_required`
|
|
1221
|
+
* - `request_type_required`
|
|
1222
|
+
* - `request_status_required`
|
|
1223
|
+
* - `created_at_required`
|
|
1224
|
+
* - `subject_name_required`
|
|
1225
|
+
* - `subject_email_required`
|
|
1226
|
+
*/
|
|
1227
|
+
export declare function formatDSRRequestStructured(request: DSRRequest): FormatDSRRequestStructuredResult;
|
|
1228
|
+
|
|
1229
|
+
/** Result of {@link formatDSRRequestStructured}. */
|
|
1230
|
+
export declare interface FormatDSRRequestStructuredResult {
|
|
1231
|
+
valid: boolean;
|
|
1232
|
+
errors: StructuredValidationError[];
|
|
1233
|
+
/** Formatted request payload — always populated regardless of `valid`. */
|
|
1234
|
+
formattedRequest: Record<string, unknown>;
|
|
1235
|
+
/** Narrowed input — populated only on `valid: true`. */
|
|
1236
|
+
data?: DSRRequest;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
export declare const frenchLocale: Required<{
|
|
1240
|
+
[K in keyof NDPRLocale]: Required<NonNullable<NDPRLocale[K]>>;
|
|
1241
|
+
}>;
|
|
1242
|
+
|
|
1209
1243
|
/**
|
|
1210
1244
|
* Generates a summary of all lawful basis documentation across processing activities.
|
|
1211
1245
|
*
|
|
@@ -2302,6 +2336,30 @@ export declare interface StorageAdapter<T = unknown> {
|
|
|
2302
2336
|
remove(): void | Promise<void>;
|
|
2303
2337
|
}
|
|
2304
2338
|
|
|
2339
|
+
/**
|
|
2340
|
+
* Single structured validation error with a stable, locale-independent
|
|
2341
|
+
* `code` consumers can switch on programmatically.
|
|
2342
|
+
*/
|
|
2343
|
+
export declare interface StructuredValidationError {
|
|
2344
|
+
/** Dot-path of the offending field (e.g. `'timestamp'`, `'dataSubject.email'`, `'options[0].purpose'`). */
|
|
2345
|
+
field: string;
|
|
2346
|
+
/** Stable, snake_case error code — safe to switch on across locales. */
|
|
2347
|
+
code: string;
|
|
2348
|
+
/** Human-readable English message — informational only; do not regex-match. */
|
|
2349
|
+
message: string;
|
|
2350
|
+
}
|
|
2351
|
+
|
|
2352
|
+
/**
|
|
2353
|
+
* Result of a structured validator. `errors` is an array (one entry per
|
|
2354
|
+
* failed rule). `data` is the narrowed, typed payload, only populated on
|
|
2355
|
+
* `valid: true`.
|
|
2356
|
+
*/
|
|
2357
|
+
export declare interface StructuredValidationResult<T> {
|
|
2358
|
+
valid: boolean;
|
|
2359
|
+
errors: StructuredValidationError[];
|
|
2360
|
+
data?: T;
|
|
2361
|
+
}
|
|
2362
|
+
|
|
2305
2363
|
/** Full context used to generate an adaptive privacy policy. */
|
|
2306
2364
|
export declare interface TemplateContext {
|
|
2307
2365
|
/** Organisation details, extended with industry and size. */
|
|
@@ -2444,6 +2502,7 @@ export declare const UNFILLED_SUFFIX = "\u00BB";
|
|
|
2444
2502
|
* Validates consent settings to ensure they meet NDPA requirements
|
|
2445
2503
|
* @param settings The consent settings to validate
|
|
2446
2504
|
* @returns An object containing validation result and any error messages
|
|
2505
|
+
* @deprecated Use `validateConsentStructured()` for typed `{ field, code, message }[]` errors. The legacy string-returning shape will be removed in 5.0.
|
|
2447
2506
|
*/
|
|
2448
2507
|
export declare function validateConsent(settings: ConsentSettings): {
|
|
2449
2508
|
valid: boolean;
|
|
@@ -2456,12 +2515,50 @@ export declare function validateConsent(settings: ConsentSettings): {
|
|
|
2456
2515
|
* as consent must be specific and informed per the Nigeria Data Protection Act.
|
|
2457
2516
|
* @param options The consent options to validate
|
|
2458
2517
|
* @returns An object containing validation result and any error messages
|
|
2518
|
+
* @deprecated Use `validateConsentOptionsStructured()` for typed `{ field, code, message }[]` errors. The legacy string-returning shape will be removed in 5.0.
|
|
2459
2519
|
*/
|
|
2460
2520
|
export declare function validateConsentOptions(options: ConsentOption[]): {
|
|
2461
2521
|
valid: boolean;
|
|
2462
2522
|
errors: string[];
|
|
2463
2523
|
};
|
|
2464
2524
|
|
|
2525
|
+
/**
|
|
2526
|
+
* Structured-result variant of {@link validateConsentOptions}. Each option
|
|
2527
|
+
* is checked for a non-empty `purpose` (NDPA Section 26). Failing options
|
|
2528
|
+
* are reported with `field: 'options[i].purpose'` so consumers can map
|
|
2529
|
+
* errors back to the originating option index.
|
|
2530
|
+
*
|
|
2531
|
+
* Codes emitted:
|
|
2532
|
+
* - `options_required` — empty / missing options array
|
|
2533
|
+
* - `purpose_required` — single option missing a purpose
|
|
2534
|
+
*/
|
|
2535
|
+
export declare function validateConsentOptionsStructured(options: ConsentOption[]): StructuredValidationResult<ConsentOption[]>;
|
|
2536
|
+
|
|
2537
|
+
/**
|
|
2538
|
+
* Structured-result variant of {@link validateConsent}. Returns the same
|
|
2539
|
+
* checks as `{ field, code, message }[]` so consumers can switch on `code`
|
|
2540
|
+
* across locales without regex-matching English strings.
|
|
2541
|
+
*
|
|
2542
|
+
* Codes emitted:
|
|
2543
|
+
* - `consents_required`
|
|
2544
|
+
* - `timestamp_required`
|
|
2545
|
+
* - `timestamp_invalid`
|
|
2546
|
+
* - `version_required`
|
|
2547
|
+
* - `method_required`
|
|
2548
|
+
* - `has_interacted_required`
|
|
2549
|
+
* - `consent_stale`
|
|
2550
|
+
*
|
|
2551
|
+
* @example
|
|
2552
|
+
* ```ts
|
|
2553
|
+
* const { valid, errors, data } = validateConsentStructured(settings);
|
|
2554
|
+
* if (!valid) {
|
|
2555
|
+
* const stale = errors.find((e) => e.code === 'consent_stale');
|
|
2556
|
+
* if (stale) showRefreshBanner();
|
|
2557
|
+
* }
|
|
2558
|
+
* ```
|
|
2559
|
+
*/
|
|
2560
|
+
export declare function validateConsentStructured(settings: ConsentSettings): StructuredValidationResult<ConsentSettings>;
|
|
2561
|
+
|
|
2465
2562
|
/**
|
|
2466
2563
|
* Validate a raw DSR submission payload against the same rules
|
|
2467
2564
|
* `<DSRRequestForm />` enforces client-side. Designed to be called from a
|
|
@@ -2497,6 +2594,8 @@ export declare function validateConsentOptions(options: ConsentOption[]): {
|
|
|
2497
2594
|
* ```ts
|
|
2498
2595
|
* validateDsrSubmission(payload, { requireIdentityVerification: false });
|
|
2499
2596
|
* ```
|
|
2597
|
+
*
|
|
2598
|
+
* @deprecated Use `validateDsrSubmissionStructured()` for typed `{ field, code, message }[]` errors. The legacy string-returning shape will be removed in 5.0.
|
|
2500
2599
|
*/
|
|
2501
2600
|
export declare function validateDsrSubmission(payload: unknown, options?: ValidateDsrSubmissionOptions): DsrSubmissionValidationResult;
|
|
2502
2601
|
|
|
@@ -2517,6 +2616,42 @@ export declare interface ValidateDsrSubmissionOptions {
|
|
|
2517
2616
|
allowedRequestTypes?: string[];
|
|
2518
2617
|
}
|
|
2519
2618
|
|
|
2619
|
+
/**
|
|
2620
|
+
* Structured-result variant of {@link validateDsrSubmission}. Same rules,
|
|
2621
|
+
* but returns an array of `{ field, code, message }` so callers can switch
|
|
2622
|
+
* on `code` programmatically across locales.
|
|
2623
|
+
*
|
|
2624
|
+
* Codes emitted:
|
|
2625
|
+
* - `payload_not_object`
|
|
2626
|
+
* - `request_type_required`
|
|
2627
|
+
* - `request_type_not_allowed`
|
|
2628
|
+
* - `data_subject_required`
|
|
2629
|
+
* - `full_name_required`
|
|
2630
|
+
* - `email_required`
|
|
2631
|
+
* - `email_invalid_format`
|
|
2632
|
+
* - `phone_invalid_type`
|
|
2633
|
+
* - `identifier_type_required`
|
|
2634
|
+
* - `identifier_value_required`
|
|
2635
|
+
* - `submitted_at_invalid`
|
|
2636
|
+
* - `additional_info_invalid_type`
|
|
2637
|
+
* - `payload_final_narrowing_failed`
|
|
2638
|
+
*
|
|
2639
|
+
* @example **Next.js Route Handler**
|
|
2640
|
+
* ```ts
|
|
2641
|
+
* import { validateDsrSubmissionStructured } from '@tantainnovative/ndpr-toolkit/server';
|
|
2642
|
+
*
|
|
2643
|
+
* export async function POST(req: Request) {
|
|
2644
|
+
* const { valid, errors, data } = validateDsrSubmissionStructured(await req.json());
|
|
2645
|
+
* if (!valid) {
|
|
2646
|
+
* return Response.json({ errors }, { status: 422 });
|
|
2647
|
+
* }
|
|
2648
|
+
* await dsrStore.create(data);
|
|
2649
|
+
* return Response.json({ ok: true }, { status: 201 });
|
|
2650
|
+
* }
|
|
2651
|
+
* ```
|
|
2652
|
+
*/
|
|
2653
|
+
export declare function validateDsrSubmissionStructured(payload: unknown, options?: ValidateDsrSubmissionOptions): StructuredValidationResult<DsrSubmissionPayload>;
|
|
2654
|
+
|
|
2520
2655
|
/**
|
|
2521
2656
|
* Validates that all required fields are present on a processing activity
|
|
2522
2657
|
* and that the lawful basis is properly documented.
|
package/dist/server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunkR3CU7DTT_js=require('./chunk-R3CU7DTT.js'),
|
|
1
|
+
'use strict';var chunkR3CU7DTT_js=require('./chunk-R3CU7DTT.js'),chunk6YFPDGNB_js=require('./chunk-6YFPDGNB.js'),chunkNUOHT3LO_js=require('./chunk-NUOHT3LO.js'),chunkJS7SYL5P_js=require('./chunk-JS7SYL5P.js'),chunkRDALAH3Y_js=require('./chunk-RDALAH3Y.js'),chunk3YTAOT5O_js=require('./chunk-3YTAOT5O.js'),chunkD2ZKDQVL_js=require('./chunk-D2ZKDQVL.js'),chunk6LJHLE6G_js=require('./chunk-6LJHLE6G.js'),chunkYFBDJ4FH_js=require('./chunk-YFBDJ4FH.js'),chunkWZYCBW2R_js=require('./chunk-WZYCBW2R.js'),chunk4CVBQC66_js=require('./chunk-4CVBQC66.js'),chunk3IA3KDII_js=require('./chunk-3IA3KDII.js'),chunkC2KEXHRX_js=require('./chunk-C2KEXHRX.js'),chunkD3HHDWBR_js=require('./chunk-D3HHDWBR.js'),chunkUXUMYP4L_js=require('./chunk-UXUMYP4L.js'),chunk45D7AMB3_js=require('./chunk-45D7AMB3.js'),chunkTQZWJGJ2_js=require('./chunk-TQZWJGJ2.js'),chunkZVOIR4QH_js=require('./chunk-ZVOIR4QH.js'),chunkTTMGFC6C_js=require('./chunk-TTMGFC6C.js'),chunkVWED6UTN_js=require('./chunk-VWED6UTN.js');require('./chunk-RFPLZDIO.js');Object.defineProperty(exports,"apiAdapter",{enumerable:true,get:function(){return chunkR3CU7DTT_js.a}});Object.defineProperty(exports,"composeAdapters",{enumerable:true,get:function(){return chunkR3CU7DTT_js.c}});Object.defineProperty(exports,"memoryAdapter",{enumerable:true,get:function(){return chunkR3CU7DTT_js.b}});Object.defineProperty(exports,"arabicLocale",{enumerable:true,get:function(){return chunk6YFPDGNB_js.e}});Object.defineProperty(exports,"frenchLocale",{enumerable:true,get:function(){return chunk6YFPDGNB_js.f}});Object.defineProperty(exports,"hausaLocale",{enumerable:true,get:function(){return chunk6YFPDGNB_js.c}});Object.defineProperty(exports,"igboLocale",{enumerable:true,get:function(){return chunk6YFPDGNB_js.b}});Object.defineProperty(exports,"pidginLocale",{enumerable:true,get:function(){return chunk6YFPDGNB_js.d}});Object.defineProperty(exports,"yorubaLocale",{enumerable:true,get:function(){return chunk6YFPDGNB_js.a}});Object.defineProperty(exports,"ORG_POLICY_TEMPLATE_REGISTRY",{enumerable:true,get:function(){return chunkNUOHT3LO_js.a}});Object.defineProperty(exports,"createOrgTemplate",{enumerable:true,get:function(){return chunkNUOHT3LO_js.b}});Object.defineProperty(exports,"templateContextFor",{enumerable:true,get:function(){return chunkNUOHT3LO_js.b}});Object.defineProperty(exports,"exportDOCX",{enumerable:true,get:function(){return chunkJS7SYL5P_js.d}});Object.defineProperty(exports,"exportHTML",{enumerable:true,get:function(){return chunkJS7SYL5P_js.a}});Object.defineProperty(exports,"exportMarkdown",{enumerable:true,get:function(){return chunkJS7SYL5P_js.b}});Object.defineProperty(exports,"exportPDF",{enumerable:true,get:function(){return chunkJS7SYL5P_js.c}});Object.defineProperty(exports,"getComplianceScore",{enumerable:true,get:function(){return chunkRDALAH3Y_js.a}});Object.defineProperty(exports,"calculateBreachSeverity",{enumerable:true,get:function(){return chunk3YTAOT5O_js.a}});Object.defineProperty(exports,"DEFAULT_POLICY_SECTIONS",{enumerable:true,get:function(){return chunkD2ZKDQVL_js.c}});Object.defineProperty(exports,"DEFAULT_POLICY_VARIABLES",{enumerable:true,get:function(){return chunkD2ZKDQVL_js.d}});Object.defineProperty(exports,"createBusinessPolicyTemplate",{enumerable:true,get:function(){return chunkD2ZKDQVL_js.e}});Object.defineProperty(exports,"findUnfilledTokens",{enumerable:true,get:function(){return chunkD2ZKDQVL_js.a}});Object.defineProperty(exports,"generatePolicyText",{enumerable:true,get:function(){return chunkD2ZKDQVL_js.b}});Object.defineProperty(exports,"DEFAULT_DATA_CATEGORIES",{enumerable:true,get:function(){return chunk6LJHLE6G_js.d}});Object.defineProperty(exports,"UNFILLED_PREFIX",{enumerable:true,get:function(){return chunk6LJHLE6G_js.a}});Object.defineProperty(exports,"UNFILLED_SUFFIX",{enumerable:true,get:function(){return chunk6LJHLE6G_js.b}});Object.defineProperty(exports,"assemblePolicy",{enumerable:true,get:function(){return chunk6LJHLE6G_js.c}});Object.defineProperty(exports,"createDefaultContext",{enumerable:true,get:function(){return chunk6LJHLE6G_js.e}});Object.defineProperty(exports,"evaluatePolicyCompliance",{enumerable:true,get:function(){return chunk6LJHLE6G_js.f}});Object.defineProperty(exports,"assessTransferRisk",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.h}});Object.defineProperty(exports,"getTransferMechanismDescription",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.f}});Object.defineProperty(exports,"isNDPCApprovalRequired",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.e}});Object.defineProperty(exports,"validateTransfer",{enumerable:true,get:function(){return chunkYFBDJ4FH_js.g}});Object.defineProperty(exports,"assessComplianceGaps",{enumerable:true,get:function(){return chunkWZYCBW2R_js.c}});Object.defineProperty(exports,"generateLawfulBasisSummary",{enumerable:true,get:function(){return chunkWZYCBW2R_js.d}});Object.defineProperty(exports,"getLawfulBasisDescription",{enumerable:true,get:function(){return chunkWZYCBW2R_js.b}});Object.defineProperty(exports,"validateProcessingActivity",{enumerable:true,get:function(){return chunkWZYCBW2R_js.a}});Object.defineProperty(exports,"exportROPAToCSV",{enumerable:true,get:function(){return chunk4CVBQC66_js.c}});Object.defineProperty(exports,"generateROPASummary",{enumerable:true,get:function(){return chunk4CVBQC66_js.b}});Object.defineProperty(exports,"identifyComplianceGaps",{enumerable:true,get:function(){return chunk4CVBQC66_js.d}});Object.defineProperty(exports,"validateProcessingRecord",{enumerable:true,get:function(){return chunk4CVBQC66_js.a}});Object.defineProperty(exports,"appendAuditEntry",{enumerable:true,get:function(){return chunk3IA3KDII_js.c}});Object.defineProperty(exports,"createAuditEntry",{enumerable:true,get:function(){return chunk3IA3KDII_js.a}});Object.defineProperty(exports,"getAuditLog",{enumerable:true,get:function(){return chunk3IA3KDII_js.b}});Object.defineProperty(exports,"cookieAdapter",{enumerable:true,get:function(){return chunkC2KEXHRX_js.b}});Object.defineProperty(exports,"sessionStorageAdapter",{enumerable:true,get:function(){return chunkC2KEXHRX_js.a}});Object.defineProperty(exports,"validateConsent",{enumerable:true,get:function(){return chunkD3HHDWBR_js.a}});Object.defineProperty(exports,"validateConsentOptions",{enumerable:true,get:function(){return chunkD3HHDWBR_js.c}});Object.defineProperty(exports,"validateConsentOptionsStructured",{enumerable:true,get:function(){return chunkD3HHDWBR_js.d}});Object.defineProperty(exports,"validateConsentStructured",{enumerable:true,get:function(){return chunkD3HHDWBR_js.b}});Object.defineProperty(exports,"sanitizeInput",{enumerable:true,get:function(){return chunkUXUMYP4L_js.a}});Object.defineProperty(exports,"formatDSRRequest",{enumerable:true,get:function(){return chunk45D7AMB3_js.b}});Object.defineProperty(exports,"formatDSRRequestStructured",{enumerable:true,get:function(){return chunk45D7AMB3_js.d}});Object.defineProperty(exports,"validateDsrSubmission",{enumerable:true,get:function(){return chunk45D7AMB3_js.a}});Object.defineProperty(exports,"validateDsrSubmissionStructured",{enumerable:true,get:function(){return chunk45D7AMB3_js.c}});Object.defineProperty(exports,"assessDPIARisk",{enumerable:true,get:function(){return chunkTQZWJGJ2_js.a}});Object.defineProperty(exports,"LEGAL_DISCLAIMER_LONG",{enumerable:true,get:function(){return chunkZVOIR4QH_js.b}});Object.defineProperty(exports,"LEGAL_DISCLAIMER_SHORT",{enumerable:true,get:function(){return chunkZVOIR4QH_js.a}});Object.defineProperty(exports,"legalDisclaimerBlock",{enumerable:true,get:function(){return chunkZVOIR4QH_js.c}});Object.defineProperty(exports,"defaultLocale",{enumerable:true,get:function(){return chunkTTMGFC6C_js.a}});Object.defineProperty(exports,"mergeLocale",{enumerable:true,get:function(){return chunkTTMGFC6C_js.b}});Object.defineProperty(exports,"localStorageAdapter",{enumerable:true,get:function(){return chunkVWED6UTN_js.a}});
|
package/dist/server.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as apiAdapter,c as composeAdapters,b as memoryAdapter}from'./chunk-7PMPKVY3.mjs';export{c as hausaLocale,b as igboLocale,d as pidginLocale,a as yorubaLocale}from'./chunk-
|
|
1
|
+
export{a as apiAdapter,c as composeAdapters,b as memoryAdapter}from'./chunk-7PMPKVY3.mjs';export{e as arabicLocale,f as frenchLocale,c as hausaLocale,b as igboLocale,d as pidginLocale,a as yorubaLocale}from'./chunk-PSPYIRIF.mjs';export{a as ORG_POLICY_TEMPLATE_REGISTRY,b as createOrgTemplate,b as templateContextFor}from'./chunk-CWY2FMIC.mjs';export{d as exportDOCX,a as exportHTML,b as exportMarkdown,c as exportPDF}from'./chunk-IVSNHT24.mjs';export{a as getComplianceScore}from'./chunk-7RBO42IW.mjs';export{a as calculateBreachSeverity}from'./chunk-WTGKZX7J.mjs';export{c as DEFAULT_POLICY_SECTIONS,d as DEFAULT_POLICY_VARIABLES,e as createBusinessPolicyTemplate,a as findUnfilledTokens,b as generatePolicyText}from'./chunk-NBQQ2GN3.mjs';export{d as DEFAULT_DATA_CATEGORIES,a as UNFILLED_PREFIX,b as UNFILLED_SUFFIX,c as assemblePolicy,e as createDefaultContext,f as evaluatePolicyCompliance}from'./chunk-BIJSMSUU.mjs';export{h as assessTransferRisk,f as getTransferMechanismDescription,e as isNDPCApprovalRequired,g as validateTransfer}from'./chunk-7BJXI2HI.mjs';export{c as assessComplianceGaps,d as generateLawfulBasisSummary,b as getLawfulBasisDescription,a as validateProcessingActivity}from'./chunk-LWIKDDSU.mjs';export{c as exportROPAToCSV,b as generateROPASummary,d as identifyComplianceGaps,a as validateProcessingRecord}from'./chunk-XP5PL6K7.mjs';export{c as appendAuditEntry,a as createAuditEntry,b as getAuditLog}from'./chunk-V7UFP6QU.mjs';export{b as cookieAdapter,a as sessionStorageAdapter}from'./chunk-XC3DLYEG.mjs';export{a as validateConsent,c as validateConsentOptions,d as validateConsentOptionsStructured,b as validateConsentStructured}from'./chunk-NI54X543.mjs';export{a as sanitizeInput}from'./chunk-EWVK45Z3.mjs';export{b as formatDSRRequest,d as formatDSRRequestStructured,a as validateDsrSubmission,c as validateDsrSubmissionStructured}from'./chunk-3APT25XO.mjs';export{a as assessDPIARisk}from'./chunk-LRRENTT5.mjs';export{b as LEGAL_DISCLAIMER_LONG,a as LEGAL_DISCLAIMER_SHORT,c as legalDisclaimerBlock}from'./chunk-ITCY2Z66.mjs';export{a as defaultLocale,b as mergeLocale}from'./chunk-V5TZJJWU.mjs';export{a as localStorageAdapter}from'./chunk-DBZSN4WP.mjs';import'./chunk-ZJYULEER.mjs';
|
package/dist/styles.css
CHANGED
|
@@ -197,8 +197,7 @@
|
|
|
197
197
|
.ndpr-consent-banner--bottom,
|
|
198
198
|
.ndpr-consent-banner--top {
|
|
199
199
|
position: fixed;
|
|
200
|
-
|
|
201
|
-
right: 0;
|
|
200
|
+
inset-inline: 0;
|
|
202
201
|
z-index: var(--ndpr-z-banner);
|
|
203
202
|
border-radius: 0;
|
|
204
203
|
}
|
|
@@ -206,16 +205,16 @@
|
|
|
206
205
|
.ndpr-consent-banner--bottom {
|
|
207
206
|
bottom: 0;
|
|
208
207
|
border-bottom: none;
|
|
209
|
-
border-
|
|
210
|
-
border-
|
|
208
|
+
border-inline-start: none;
|
|
209
|
+
border-inline-end: none;
|
|
211
210
|
animation: ndpr-slide-in-bottom var(--ndpr-transition-slow);
|
|
212
211
|
}
|
|
213
212
|
|
|
214
213
|
.ndpr-consent-banner--top {
|
|
215
214
|
top: 0;
|
|
216
215
|
border-top: none;
|
|
217
|
-
border-
|
|
218
|
-
border-
|
|
216
|
+
border-inline-start: none;
|
|
217
|
+
border-inline-end: none;
|
|
219
218
|
animation: ndpr-slide-in-top var(--ndpr-transition-slow);
|
|
220
219
|
}
|
|
221
220
|
|
|
@@ -232,14 +231,14 @@
|
|
|
232
231
|
|
|
233
232
|
.ndpr-consent-banner--card.ndpr-consent-banner--bottom {
|
|
234
233
|
bottom: var(--ndpr-space-4);
|
|
235
|
-
|
|
236
|
-
|
|
234
|
+
inset-inline-start: auto;
|
|
235
|
+
inset-inline-end: var(--ndpr-space-4);
|
|
237
236
|
}
|
|
238
237
|
|
|
239
238
|
.ndpr-consent-banner--card.ndpr-consent-banner--top {
|
|
240
239
|
top: var(--ndpr-space-4);
|
|
241
|
-
|
|
242
|
-
|
|
240
|
+
inset-inline-start: auto;
|
|
241
|
+
inset-inline-end: var(--ndpr-space-4);
|
|
243
242
|
}
|
|
244
243
|
|
|
245
244
|
.ndpr-consent-banner--modal {
|
|
@@ -359,7 +358,7 @@
|
|
|
359
358
|
|
|
360
359
|
.ndpr-consent-banner__required-marker {
|
|
361
360
|
color: rgb(var(--ndpr-destructive));
|
|
362
|
-
margin-
|
|
361
|
+
margin-inline-start: var(--ndpr-space-1);
|
|
363
362
|
}
|
|
364
363
|
|
|
365
364
|
.ndpr-consent-banner__option-description {
|
|
@@ -539,6 +538,9 @@
|
|
|
539
538
|
content: '';
|
|
540
539
|
position: absolute;
|
|
541
540
|
top: 1px;
|
|
541
|
+
/* Physical `left` kept (paired with `translateX` below); switching to
|
|
542
|
+
* inset-inline-start without a logical transform would desync the resting
|
|
543
|
+
* position from the checked-state translation in RTL contexts. */
|
|
542
544
|
left: 1px;
|
|
543
545
|
width: 1.25rem;
|
|
544
546
|
height: 1.25rem;
|
|
@@ -574,7 +576,7 @@
|
|
|
574
576
|
}
|
|
575
577
|
|
|
576
578
|
.ndpr-consent-manager__required-marker {
|
|
577
|
-
margin-
|
|
579
|
+
margin-inline-start: var(--ndpr-space-1);
|
|
578
580
|
font-size: var(--ndpr-font-size-xs);
|
|
579
581
|
color: rgb(var(--ndpr-destructive));
|
|
580
582
|
}
|
|
@@ -660,7 +662,7 @@
|
|
|
660
662
|
}
|
|
661
663
|
|
|
662
664
|
.ndpr-form-field__required {
|
|
663
|
-
margin-
|
|
665
|
+
margin-inline-start: var(--ndpr-space-1);
|
|
664
666
|
color: rgb(var(--ndpr-destructive));
|
|
665
667
|
}
|
|
666
668
|
|
|
@@ -1094,7 +1096,7 @@
|
|
|
1094
1096
|
|
|
1095
1097
|
.ndpr-table__head {
|
|
1096
1098
|
background: rgb(var(--ndpr-surface));
|
|
1097
|
-
text-align:
|
|
1099
|
+
text-align: start;
|
|
1098
1100
|
font-size: var(--ndpr-font-size-xs);
|
|
1099
1101
|
font-weight: 600;
|
|
1100
1102
|
text-transform: uppercase;
|
|
@@ -1123,7 +1125,7 @@
|
|
|
1123
1125
|
}
|
|
1124
1126
|
|
|
1125
1127
|
.ndpr-table__cell--actions {
|
|
1126
|
-
text-align:
|
|
1128
|
+
text-align: end;
|
|
1127
1129
|
white-space: nowrap;
|
|
1128
1130
|
}
|
|
1129
1131
|
|
|
@@ -1298,7 +1300,7 @@
|
|
|
1298
1300
|
content: '';
|
|
1299
1301
|
position: absolute;
|
|
1300
1302
|
top: 1rem;
|
|
1301
|
-
|
|
1303
|
+
inset-inline-start: 50%;
|
|
1302
1304
|
width: 100%;
|
|
1303
1305
|
height: 2px;
|
|
1304
1306
|
background: rgb(var(--ndpr-border));
|
package/package.json
CHANGED
package/dist/chunk-42JPSNVV.mjs
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import {e,g,h,f}from'./chunk-7BJXI2HI.mjs';import {a as a$1}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-FRQFU44F.mjs';import {b,a}from'./chunk-ZJYULEER.mjs';import {useState,useMemo,useEffect,useCallback}from'react';import {jsxs,jsx}from'react/jsx-runtime';var z=[{value:"adequacy_decision",label:"Adequacy Decision (Section 41)"},{value:"standard_clauses",label:"Standard Contractual Clauses (Section 42)"},{value:"binding_corporate_rules",label:"Binding Corporate Rules (Section 43)"},{value:"ndpc_authorization",label:"NDPC Authorization (Section 44)"},{value:"explicit_consent",label:"Explicit Consent (Section 45(a))"},{value:"contract_performance",label:"Contract Performance (Section 45(b))"},{value:"public_interest",label:"Public Interest (Section 45(c))"},{value:"legal_claims",label:"Legal Claims (Section 45(d))"},{value:"vital_interests",label:"Vital Interests (Section 45(e))"}],ae=[{value:"adequate",label:"Adequate"},{value:"inadequate",label:"Inadequate"},{value:"pending_review",label:"Pending Review"},{value:"unknown",label:"Unknown"}],ne=[{value:"one_time",label:"One-Time"},{value:"periodic",label:"Periodic"},{value:"continuous",label:"Continuous"}],ie=[{value:"active",label:"Active"},{value:"suspended",label:"Suspended"},{value:"terminated",label:"Terminated"},{value:"pending_approval",label:"Pending Approval"}],ye={low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--destructive"},Se={active:"ndpr-badge ndpr-badge--success",suspended:"ndpr-badge ndpr-badge--warning",terminated:"ndpr-badge ndpr-badge--neutral",pending_approval:"ndpr-badge ndpr-badge--info"},ke={active:"Active",suspended:"Suspended",terminated:"Terminated",pending_approval:"Pending Approval"},de={destinationCountry:"",destinationCountryCode:"",adequacyStatus:"unknown",transferMechanism:"adequacy_decision",dataCategories:"",includesSensitiveData:false,estimatedDataSubjects:"",recipientOrganization:"",recipientContactName:"",recipientContactEmail:"",recipientContactPhone:"",recipientContactAddress:"",purpose:"",safeguards:"",riskAssessment:"",riskLevel:"medium",frequency:"one_time",status:"active",tiaCompleted:false,tiaReference:"",ndpcApprovalApplied:false,ndpcApprovalApproved:false,ndpcApprovalReference:""},Be=({transfers:g$1,onAddTransfer:q,onUpdateTransfer:w,onRemoveTransfer:F,summary:B,title:M,description:P,className:pe="",buttonClassName:I="",showSummary:oe=true,showTIA:le=true,classNames:r,unstyled:d})=>{var J,X;let $=c(),se=(J=M!=null?M:$.crossBorder.title)!=null?J:"Cross-Border Data Transfer Manager",ce=(X=P!=null?P:$.crossBorder.description)!=null?X:"Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VIII (Sections 41-43).",[f$1,y]=useState(null),[U,S]=useState(false),[h$1,V]=useState(null),[i,N]=useState(de),[C,G]=useState(null),[k,ue]=useState("all"),[T,me]=useState("all"),A=useMemo(()=>{let t=[...g$1];return k!=="all"&&(t=t.filter(a=>a.status===k)),T!=="all"&&(t=t.filter(a=>a.transferMechanism===T)),t.sort((a,o)=>o.updatedAt-a.updatedAt),t},[g$1,k,T]);useEffect(()=>{A.length>0&&!f$1&&y(A[0].id);},[A,f$1]);let H=useMemo(()=>{var t;return f$1&&(t=g$1.find(a=>a.id===f$1))!=null?t:null},[g$1,f$1]),x=useCallback(t=>new Date(t).toLocaleDateString(),[]),_=useCallback(()=>{N(de),V(null),G(null);},[]),ve=useCallback(()=>{_(),S(true);},[_]),fe=useCallback(t=>{var a,o,u,v;V(t.id),N({destinationCountry:t.destinationCountry,destinationCountryCode:t.destinationCountryCode||"",adequacyStatus:t.adequacyStatus,transferMechanism:t.transferMechanism,dataCategories:t.dataCategories.join(", "),includesSensitiveData:t.includesSensitiveData,estimatedDataSubjects:((a=t.estimatedDataSubjects)==null?void 0:a.toString())||"",recipientOrganization:t.recipientOrganization,recipientContactName:t.recipientContact.name,recipientContactEmail:t.recipientContact.email,recipientContactPhone:t.recipientContact.phone||"",recipientContactAddress:t.recipientContact.address||"",purpose:t.purpose,safeguards:t.safeguards.join(`
|
|
2
|
-
`),riskAssessment:t.riskAssessment,riskLevel:t.riskLevel,frequency:t.frequency,status:t.status,tiaCompleted:t.tiaCompleted,tiaReference:t.tiaReference||"",ndpcApprovalApplied:((o=t.ndpcApproval)==null?void 0:o.applied)||false,ndpcApprovalApproved:((u=t.ndpcApproval)==null?void 0:u.approved)||false,ndpcApprovalReference:((v=t.ndpcApproval)==null?void 0:v.referenceNumber)||""}),S(true);},[]),l=useCallback((t,a$1)=>{N(o=>b(a({},o),{[t]:a$1}));},[]),K=useCallback(()=>{let t=e(i.transferMechanism),a=Date.now();return {destinationCountry:i.destinationCountry.trim(),destinationCountryCode:i.destinationCountryCode.trim()||void 0,adequacyStatus:i.adequacyStatus,transferMechanism:i.transferMechanism,dataCategories:i.dataCategories.split(",").map(o=>o.trim()).filter(Boolean),includesSensitiveData:i.includesSensitiveData,estimatedDataSubjects:i.estimatedDataSubjects?parseInt(i.estimatedDataSubjects,10):void 0,recipientOrganization:i.recipientOrganization.trim(),recipientContact:{name:i.recipientContactName.trim(),email:i.recipientContactEmail.trim(),phone:i.recipientContactPhone.trim()||void 0,address:i.recipientContactAddress.trim()||void 0},purpose:i.purpose.trim(),safeguards:i.safeguards.split(`
|
|
3
|
-
`).map(o=>o.trim()).filter(Boolean),riskAssessment:i.riskAssessment.trim(),riskLevel:i.riskLevel,frequency:i.frequency,status:t&&!i.ndpcApprovalApproved?"pending_approval":i.status,tiaCompleted:i.tiaCompleted,tiaReference:i.tiaReference.trim()||void 0,ndpcApproval:t?{required:true,applied:i.ndpcApprovalApplied,approved:i.ndpcApprovalApproved||void 0,referenceNumber:i.ndpcApprovalReference.trim()||void 0,appliedAt:i.ndpcApprovalApplied?a:void 0,approvedAt:i.ndpcApprovalApproved?a:void 0}:void 0,startDate:a,reviewDate:a+365*24*60*60*1e3}},[i]),be=useCallback(()=>{let t=K(),a$1=a({id:h$1||"temp",createdAt:Date.now(),updatedAt:Date.now()},t),o=g(a$1);G(o),o.isValid&&(h$1?w&&w(h$1,t):q&&q(t),_(),S(false));},[K,h$1,w,q,_]),Y=useCallback(()=>{_(),S(false);},[_]),ge=useCallback(t=>{F&&F(t),f$1===t&&y(null);},[F,f$1]),Q=useCallback(t=>jsxs("span",{className:a$1(`px-2 py-1 rounded text-xs font-medium ${ye[t]}`,r==null?void 0:r.riskBadge,d),children:[t.charAt(0).toUpperCase()+t.slice(1)," Risk"]}),[r==null?void 0:r.riskBadge,d]),W=useCallback(t=>jsx("span",{className:a$1(`px-2 py-1 rounded text-xs font-medium ${Se[t]}`,r==null?void 0:r.statusBadge,d),children:ke[t]}),[r==null?void 0:r.statusBadge,d]),he=useCallback(t=>{var u;e(t);let o=((u=z.find(v=>v.value===t))==null?void 0:u.label)||t;return jsx("span",{className:"px-2 py-1 rounded text-xs font-medium ndpr-badge ndpr-badge--info",children:o})},[]),D=useMemo(()=>{var v,c;if(B)return B;let t=0,a=[],o=[],u=[];for(let s of g$1){let O=s.status==="active";O&&t++,(s.status==="pending_approval"||(v=s.ndpcApproval)!=null&&v.required&&!((c=s.ndpcApproval)!=null&&c.approved))&&a.push(s),s.riskLevel==="high"&&O&&o.push(s),!s.tiaCompleted&&O&&u.push(s);}return {totalActiveTransfers:t,pendingApproval:a,highRiskTransfers:o,missingTIA:u,byMechanism:{},byAdequacy:{},dueForReview:[],lastUpdated:Date.now()}},[B,g$1]),Ce=()=>jsxs("div",{"data-ndpr-component":"cross-border-transfer-manager",role:"status","aria-label":"Transfer compliance summary",className:a$1("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",r==null?void 0:r.summary,d),children:[jsxs("div",{className:a$1("ndpr-alert ndpr-alert--info",r==null?void 0:r.summaryCard,d),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:D.totalActiveTransfers}),jsx("p",{className:"text-sm ndpr-text-info",children:"Active Transfers"})]}),jsxs("div",{className:a$1("ndpr-alert ndpr-alert--info",r==null?void 0:r.summaryCard,d),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:D.pendingApproval.length}),jsx("p",{className:"text-sm ndpr-text-info",children:"Pending Approval"})]}),jsxs("div",{className:a$1("ndpr-alert ndpr-alert--destructive",r==null?void 0:r.summaryCard,d),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-destructive",children:D.highRiskTransfers.length}),jsx("p",{className:"text-sm ndpr-text-destructive",children:"High Risk"})]}),jsxs("div",{className:a$1("ndpr-alert ndpr-alert--warning",r==null?void 0:r.summaryCard,d),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:D.missingTIA.length}),jsx("p",{className:"text-sm ndpr-text-warning",children:"Missing TIA"})]})]}),_e=()=>{let t=e(i.transferMechanism);return jsxs("div",{className:a$1("bg-gray-50 dark:bg-gray-700 p-6 rounded-lg mb-6",r==null?void 0:r.form,d),children:[jsxs("div",{className:a$1("flex justify-between items-center mb-4",r==null?void 0:r.header,d),children:[jsx("h3",{className:"ndpr-section-heading",children:h$1?"Edit Transfer":"Add New Transfer"}),jsx("button",{onClick:Y,"aria-label":"Cancel form",className:"text-gray-600 hover:ndpr-text-muted dark:hover:text-gray-200",children:"Cancel"})]}),C&&!C.isValid&&jsxs("div",{id:"cb-form-errors",role:"alert",className:"ndpr-alert ndpr-alert--destructive",children:[jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Please fix the following errors:"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-destructive",children:C.errors.map((a,o)=>jsx("li",{children:a},o))})]}),C&&C.warnings.length>0&&jsxs("div",{id:"cb-form-warnings",role:"alert",className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm font-medium ndpr-text-warning mb-1",children:"Warnings:"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-warning",children:C.warnings.map((a,o)=>jsx("li",{children:a},o))})]}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"cb-destinationCountry",className:"ndpr-form-field__label",children:["Destination Country ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-destinationCountry",type:"text",value:i.destinationCountry,onChange:a=>l("destinationCountry",a.target.value),placeholder:"e.g. United Kingdom","aria-required":"true","aria-describedby":"cb-form-errors","aria-label":"Destination country",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-destinationCountryCode",className:"ndpr-form-field__label",children:"Country Code (ISO)"}),jsx("input",{id:"cb-destinationCountryCode",type:"text",value:i.destinationCountryCode,onChange:a=>l("destinationCountryCode",a.target.value),placeholder:"e.g. GB",maxLength:3,"aria-label":"Country code in ISO format",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-recipientOrganization",className:"ndpr-form-field__label",children:["Recipient Organization ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-recipientOrganization",type:"text",value:i.recipientOrganization,onChange:a=>l("recipientOrganization",a.target.value),placeholder:"Organization name","aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-transferMechanism",className:"ndpr-form-field__label",children:["Transfer Mechanism ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("select",{id:"cb-transferMechanism",value:i.transferMechanism,onChange:a=>l("transferMechanism",a.target.value),"aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:z.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-adequacyStatus",className:"ndpr-form-field__label",children:"Adequacy Status"}),jsx("select",{id:"cb-adequacyStatus",value:i.adequacyStatus,onChange:a=>l("adequacyStatus",a.target.value),"aria-label":"Select adequacy status of destination country",className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:ae.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-riskLevel",className:"ndpr-form-field__label",children:"Risk Level"}),jsxs("select",{id:"cb-transfer-riskLevel",value:i.riskLevel,onChange:a=>l("riskLevel",a.target.value),className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:[jsx("option",{value:"low",children:"Low"}),jsx("option",{value:"medium",children:"Medium"}),jsx("option",{value:"high",children:"High"})]})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-dataCategories",className:"ndpr-form-field__label",children:["Data Categories ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-dataCategories",type:"text",value:i.dataCategories,onChange:a=>l("dataCategories",a.target.value),placeholder:"Comma-separated, e.g. Names, Email addresses, Phone numbers","aria-required":"true","aria-describedby":"cb-dataCategories-help",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)}),jsx("p",{id:"cb-dataCategories-help",className:"text-xs text-gray-500 mt-1",children:"Separate categories with commas"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"includesSensitiveData",checked:i.includesSensitiveData,onChange:a=>l("includesSensitiveData",a.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"includesSensitiveData",className:"ndpr-text-sm ndpr-font-medium",children:"Includes sensitive personal data"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-estimatedDataSubjects",className:"ndpr-form-field__label",children:"Estimated Data Subjects"}),jsx("input",{id:"cb-transfer-estimatedDataSubjects",type:"number",value:i.estimatedDataSubjects,onChange:a=>l("estimatedDataSubjects",a.target.value),placeholder:"Number of data subjects",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-recipientContactName",className:"ndpr-form-field__label",children:["Recipient Contact Name ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-recipientContactName",type:"text",value:i.recipientContactName,onChange:a=>l("recipientContactName",a.target.value),placeholder:"Contact person name","aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"cb-recipientContactEmail",className:"ndpr-form-field__label",children:["Recipient Contact Email ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("input",{id:"cb-recipientContactEmail",type:"email",value:i.recipientContactEmail,onChange:a=>l("recipientContactEmail",a.target.value),placeholder:"contact@example.com","aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-recipientContactPhone",className:"ndpr-form-field__label",children:"Recipient Contact Phone"}),jsx("input",{id:"cb-transfer-recipientContactPhone",type:"text",value:i.recipientContactPhone,onChange:a=>l("recipientContactPhone",a.target.value),placeholder:"Phone number",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-recipientContactAddress",className:"ndpr-form-field__label",children:"Recipient Contact Address"}),jsx("input",{id:"cb-transfer-recipientContactAddress",type:"text",value:i.recipientContactAddress,onChange:a=>l("recipientContactAddress",a.target.value),placeholder:"Address",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-purpose",className:"ndpr-form-field__label",children:["Purpose of Transfer ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"cb-purpose",value:i.purpose,onChange:a=>l("purpose",a.target.value),placeholder:"Describe the purpose of this data transfer",rows:2,"aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-safeguards",className:"ndpr-form-field__label",children:["Safeguards ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"cb-safeguards",value:i.safeguards,onChange:a=>l("safeguards",a.target.value),placeholder:`One safeguard per line, e.g.
|
|
4
|
-
End-to-end encryption
|
|
5
|
-
Access control policies
|
|
6
|
-
Regular security audits`,rows:3,"aria-required":"true","aria-describedby":"cb-safeguards-help",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)}),jsx("p",{id:"cb-safeguards-help",className:"text-xs text-gray-500 mt-1",children:"Enter one safeguard per line"})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"cb-riskAssessment",className:"ndpr-form-field__label",children:["Risk Assessment Summary ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"cb-riskAssessment",value:i.riskAssessment,onChange:a=>l("riskAssessment",a.target.value),placeholder:"Summarize the risk assessment for this transfer",rows:2,"aria-required":"true","aria-describedby":"cb-form-errors",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-frequency",className:"ndpr-form-field__label",children:"Transfer Frequency"}),jsx("select",{id:"cb-transfer-frequency",value:i.frequency,onChange:a=>l("frequency",a.target.value),className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:ne.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-status",className:"ndpr-form-field__label",children:"Status"}),jsx("select",{id:"cb-transfer-status",value:i.status,onChange:a=>l("status",a.target.value),className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:ie.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]})]}),t&&jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h4",{className:"text-sm font-medium ndpr-text-info mb-3",children:"NDPC Approval Required"}),jsx("p",{className:"text-xs ndpr-text-info mb-3",children:"The selected transfer mechanism requires approval from the Nigeria Data Protection Commission."}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"ndpcApprovalApplied",checked:i.ndpcApprovalApplied,onChange:a=>l("ndpcApprovalApplied",a.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"ndpcApprovalApplied",className:"ndpr-text-sm",children:"Application submitted"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"ndpcApprovalApproved",checked:i.ndpcApprovalApproved,onChange:a=>l("ndpcApprovalApproved",a.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"ndpcApprovalApproved",className:"ndpr-text-sm",children:"Approval granted"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"cb-transfer-ndpcApprovalReference",className:"ndpr-form-field__label",children:"NDPC Reference Number"}),jsx("input",{id:"cb-transfer-ndpcApprovalReference",type:"text",value:i.ndpcApprovalReference,onChange:a=>l("ndpcApprovalReference",a.target.value),placeholder:"Reference number (if available)",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]})]})]}),le&&jsxs("div",{className:"mt-4 p-4 bg-gray-100 dark:bg-gray-600 rounded-md",children:[jsx("h4",{className:"text-sm font-medium mb-3",children:"Transfer Impact Assessment"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"tiaCompleted",checked:i.tiaCompleted,onChange:a=>l("tiaCompleted",a.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"tiaCompleted",className:"ndpr-text-sm",children:"TIA completed"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cb-transfer-tiaReference",className:"ndpr-form-field__label",children:"TIA Reference"}),jsx("input",{id:"cb-transfer-tiaReference",type:"text",value:i.tiaReference,onChange:a=>l("tiaReference",a.target.value),placeholder:"Document reference",className:a$1("ndpr-form-field__input",r==null?void 0:r.input,d)})]})]})]}),jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[jsx("button",{onClick:Y,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600",children:"Cancel"}),jsx("button",{onClick:be,className:a$1(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${I}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),d),children:h$1?"Update Transfer":"Add Transfer"})]})]})},Ae=t=>{var u,v;let a=h(t),o=g(t);return jsxs("div",{role:"status","aria-label":"Transfer details",className:a$1("",r==null?void 0:r.detailPanel,d),children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxs("h3",{className:"ndpr-section-heading",children:[t.destinationCountry," \u2014 ",t.recipientOrganization]}),jsxs("div",{className:"flex gap-2",children:[W(t.status),Q(t.riskLevel)]})]}),!o.isValid&&jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",children:[jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Compliance Issues"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-destructive",children:o.errors.map((c,s)=>jsx("li",{children:c},s))})]}),o.warnings.length>0&&jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm font-medium ndpr-text-warning mb-1",children:"Warnings"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-warning",children:o.warnings.map((c,s)=>jsx("li",{children:c},s))})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Destination:"})," ",t.destinationCountry,t.destinationCountryCode?` (${t.destinationCountryCode})`:""]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Adequacy:"})," ",(u=ae.find(c=>c.value===t.adequacyStatus))==null?void 0:u.label]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Frequency:"})," ",(v=ne.find(c=>c.value===t.frequency))==null?void 0:v.label]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Start Date:"})," ",x(t.startDate)]}),t.endDate&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"End Date:"})," ",x(t.endDate)]}),t.reviewDate&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Next Review:"})," ",x(t.reviewDate)]})]}),jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Recipient:"})," ",t.recipientOrganization]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Contact:"})," ",t.recipientContact.name," (",t.recipientContact.email,")"]}),t.estimatedDataSubjects&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Data Subjects:"})," ",t.estimatedDataSubjects.toLocaleString()]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",t.includesSensitiveData?"Yes":"No"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Transfer Mechanism"}),jsx("div",{className:"ndpr-panel",children:jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:f(t.transferMechanism)})})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Purpose"}),jsx("p",{className:"text-sm ndpr-text-muted bg-gray-50 dark:bg-gray-700 p-2 rounded-md",children:t.purpose})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Data Categories"}),jsx("div",{className:"flex flex-wrap gap-1",children:t.dataCategories.map((c,s)=>jsx("span",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-600 rounded text-xs",children:c},s))})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Safeguards"}),jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-muted",children:t.safeguards.map((c,s)=>jsx("li",{children:c},s))})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Risk Assessment"}),jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200 mb-2",children:t.riskAssessment}),jsxs("div",{className:"mt-2",role:"status","aria-label":"Automated risk assessment result",children:[jsxs("p",{className:"text-xs font-medium ndpr-text-muted mb-1",children:["Automated Assessment (Score: ",a.riskScore,")"]}),a.factors.length>0&&jsx("ul",{className:"list-disc list-inside text-xs ndpr-text-muted",children:a.factors.map((c,s)=>jsx("li",{children:c},s))}),a.recommendations.length>0&&jsxs("div",{className:"mt-2",children:[jsx("p",{className:"text-xs font-medium ndpr-text-muted mb-1",children:"Recommendations:"}),jsx("ul",{className:"list-disc list-inside text-xs ndpr-text-muted",children:a.recommendations.map((c,s)=>jsx("li",{children:c},s))})]})]})]})]}),t.ndpcApproval&&jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"NDPC Approval"}),jsxs("div",{className:a$1(`p-3 rounded-md ${t.ndpcApproval.approved?"ndpr-alert ndpr-alert--success":t.ndpcApproval.applied?"ndpr-alert ndpr-alert--warning":"ndpr-alert ndpr-alert--destructive"}`,r==null?void 0:r.approvalStatus,d),children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",t.ndpcApproval.approved?"Approved":t.ndpcApproval.applied?"Application Submitted":"Not Applied"]}),t.ndpcApproval.referenceNumber&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Reference:"})," ",t.ndpcApproval.referenceNumber]}),t.ndpcApproval.appliedAt&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Applied:"})," ",x(t.ndpcApproval.appliedAt)]}),t.ndpcApproval.approvedAt&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Approved:"})," ",x(t.ndpcApproval.approvedAt)]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-form-field__label",children:"Transfer Impact Assessment"}),jsxs("div",{className:`p-3 rounded-md ${t.tiaCompleted?"ndpr-alert ndpr-alert--success":"ndpr-alert ndpr-alert--warning"}`,children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",t.tiaCompleted?"Completed":"Not Completed"]}),t.tiaReference&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Reference:"})," ",t.tiaReference]})]})]}),jsxs("div",{className:"flex gap-3 mt-6",children:[jsx("button",{onClick:()=>fe(t),"aria-label":`Edit transfer to ${t.destinationCountry}`,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${I}`,children:"Edit"}),jsx("button",{onClick:()=>ge(t.id),"aria-label":`Remove transfer to ${t.destinationCountry}`,className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",children:"Remove"})]})]})};return jsxs("div",{className:a$1(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${pe}`,r==null?void 0:r.root,d),children:[jsx("h2",{className:a$1("ndpr-section-heading",r==null?void 0:r.title,d),children:se}),jsx("p",{className:"ndpr-card__subtitle",children:ce}),oe&&Ce(),!U&&jsx("div",{className:"mb-6",children:jsx("button",{onClick:ve,className:a$1(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${I}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),d),children:"Add Transfer"})}),U&&_e(),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"cbStatusFilter",className:"ndpr-form-field__label",children:"Status Filter"}),jsxs("select",{id:"cbStatusFilter",value:k,onChange:t=>ue(t.target.value),"aria-label":"Filter transfers by status",className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:[jsx("option",{value:"all",children:"All Statuses"}),ie.map(t=>jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cbMechanismFilter",className:"ndpr-form-field__label",children:"Mechanism Filter"}),jsxs("select",{id:"cbMechanismFilter",value:T,onChange:t=>me(t.target.value),"aria-label":"Filter transfers by mechanism",className:a$1("ndpr-form-field__input",r==null?void 0:r.select,d),children:[jsx("option",{value:"all",children:"All Mechanisms"}),z.map(t=>jsx("option",{value:t.value,children:t.label},t.value))]})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxs("div",{className:"md:col-span-1",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Transfers"}),A.length===0?jsx("p",{className:"ndpr-card__subtitle",children:"No cross-border transfers found."}):jsx("div",{className:a$1("space-y-2 max-h-96 overflow-y-auto pr-2",r==null?void 0:r.transferList,d),children:A.map(t=>{var a,o;return jsxs("div",{className:a$1(`p-3 rounded-md cursor-pointer ${f$1===t.id?"ndpr-alert ndpr-alert--info":"ndpr-panel"}`,r==null?void 0:r.transferItem,d),role:"button",tabIndex:0,"aria-label":`View transfer to ${t.destinationCountry}`,onClick:()=>y(t.id),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),y(t.id));},children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:t.destinationCountry}),Q(t.riskLevel)]}),jsx("p",{className:"text-xs ndpr-text-muted mb-1",children:t.recipientOrganization}),jsx("p",{className:"text-xs ndpr-text-muted mb-1",children:he(t.transferMechanism)}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[W(t.status),((a=t.ndpcApproval)==null?void 0:a.required)&&!((o=t.ndpcApproval)!=null&&o.approved)&&jsx("span",{className:"text-xs ndpr-text-info",children:"NDPC Pending"})]})]},t.id)})})]}),jsx("div",{className:"md:col-span-2",children:H?Ae(H):jsx("div",{className:"ndpr-empty-state",children:jsx("p",{className:"ndpr-card__subtitle",children:"Select a transfer to view details"})})})]})]})};export{Be as a};
|
package/dist/chunk-7FXNGGMO.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkWZYCBW2R_js=require('./chunk-WZYCBW2R.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkYDKWD6MQ_js=require('./chunk-YDKWD6MQ.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var V={name:"",description:"",lawfulBasis:"consent",lawfulBasisJustification:"",dataCategories:"",involvesSensitiveData:false,sensitiveDataCondition:"",dataSubjectCategories:"",purposes:"",retentionPeriod:"",retentionJustification:"",recipients:"",crossBorderTransfer:false,reviewDate:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""},re=[{value:"consent",label:"Consent"},{value:"contract",label:"Contract"},{value:"legal_obligation",label:"Legal Obligation"},{value:"vital_interests",label:"Vital Interests"},{value:"public_interest",label:"Public Interest"},{value:"legitimate_interests",label:"Legitimate Interests"}],ae=[{value:"explicit_consent",label:"Explicit Consent"},{value:"employment_law",label:"Employment Law"},{value:"vital_interests_incapable",label:"Vital Interests (Incapable)"},{value:"nonprofit_legitimate",label:"Nonprofit Legitimate Activities"},{value:"publicly_available",label:"Publicly Available Data"},{value:"legal_claims",label:"Legal Claims"},{value:"substantial_public_interest",label:"Substantial Public Interest"},{value:"health_purposes",label:"Health Purposes"},{value:"public_health",label:"Public Health"},{value:"archiving_research",label:"Archiving / Research"}],Ae={active:"ndpr-badge ndpr-badge--success",inactive:"ndpr-badge ndpr-badge--neutral",under_review:"ndpr-badge ndpr-badge--warning",archived:"ndpr-badge ndpr-badge--destructive"},Be={active:"Active",inactive:"Inactive",under_review:"Under Review",archived:"Archived"},De={consent:"ndpr-badge ndpr-badge--info",contract:"ndpr-badge ndpr-badge--info",legal_obligation:"ndpr-badge ndpr-badge--info",vital_interests:"ndpr-badge ndpr-badge--destructive",public_interest:"ndpr-badge ndpr-badge--warning",legitimate_interests:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},Se={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"},je=({activities:g,onAddActivity:T,onUpdateActivity:F,onArchiveActivity:I,title:j,description:E,className:ne="",buttonClassName:m="",showSummary:oe=true,showComplianceGaps:de=true,classNames:i,unstyled:o})=>{var X,Z;let M=chunkYDKWD6MQ_js.c(),le=(X=j!=null?j:M.lawfulBasis.title)!=null?X:"Lawful Basis Tracker",se=(Z=E!=null?E:M.lawfulBasis.description)!=null?Z:"Document and track the lawful basis for each processing activity as required by NDPA 2023 Section 25.",[x,f]=react.useState("list"),[a,w]=react.useState(V),[b,J]=react.useState(null),[R,pe]=react.useState(null),[B,ue]=react.useState("all"),[D,ce]=react.useState("all"),[S,ge]=react.useState(""),[c,C]=react.useState([]),U=react.useMemo(()=>{let e=[...g];if(B!=="all"&&(e=e.filter(l=>l.status===B)),D!=="all"&&(e=e.filter(l=>l.lawfulBasis===D)),S){let l=S.toLowerCase();e=e.filter(p=>p.name.toLowerCase().includes(l)||p.description.toLowerCase().includes(l)||p.purposes.some($=>$.toLowerCase().includes(l)));}return e.sort((l,p)=>p.updatedAt-l.updatedAt),e},[g,B,D,S]),y=react.useCallback(e=>new Date(e).toLocaleDateString(),[]),P=react.useMemo(()=>chunkWZYCBW2R_js.d(g),[g]),h=react.useMemo(()=>chunkWZYCBW2R_js.c(g),[g]),A=react.useCallback(e=>e.split(",").map(l=>l.trim()).filter(l=>l.length>0),[]),ve=react.useCallback(()=>{w(V),J(null),C([]),f("form");},[]),H=react.useCallback(e=>{w({name:e.name,description:e.description,lawfulBasis:e.lawfulBasis,lawfulBasisJustification:e.lawfulBasisJustification,dataCategories:e.dataCategories.join(", "),involvesSensitiveData:e.involvesSensitiveData,sensitiveDataCondition:e.sensitiveDataCondition||"",dataSubjectCategories:e.dataSubjectCategories.join(", "),purposes:e.purposes.join(", "),retentionPeriod:e.retentionPeriod,retentionJustification:e.retentionJustification||"",recipients:(e.recipients||[]).join(", "),crossBorderTransfer:e.crossBorderTransfer,reviewDate:e.reviewDate?new Date(e.reviewDate).toISOString().split("T")[0]:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""}),J(e.id),C([]),f("form");},[]),me=react.useCallback(()=>{let e={name:a.name,description:a.description,lawfulBasis:a.lawfulBasis,lawfulBasisJustification:a.lawfulBasisJustification,dataCategories:A(a.dataCategories),involvesSensitiveData:a.involvesSensitiveData,sensitiveDataCondition:a.sensitiveDataCondition||void 0,dataSubjectCategories:A(a.dataSubjectCategories),purposes:A(a.purposes),retentionPeriod:a.retentionPeriod,retentionJustification:a.retentionJustification||void 0,recipients:a.recipients?A(a.recipients):void 0,crossBorderTransfer:a.crossBorderTransfer,reviewDate:a.reviewDate?new Date(a.reviewDate).getTime():void 0,status:"active"},l=chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},e),{id:b||"temp",createdAt:Date.now(),updatedAt:Date.now()}),p=chunkWZYCBW2R_js.a(l);if(!p.isValid){C(p.errors);return}b&&F?F(b,e):T&&T(e),w(V),J(null),C([]),f("list");},[a,b,F,T,A]),Y=react.useCallback(e=>{I&&I(e);},[I]),fe=react.useCallback(e=>{pe(e),f("detail");},[]),n=react.useMemo(()=>R?g.find(e=>e.id===R):null,[g,R]),W=react.useCallback(e=>jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(`px-2 py-1 rounded text-xs font-medium ${Ae[e]}`,i==null?void 0:i.statusBadge,o),children:Be[e]}),[i==null?void 0:i.statusBadge,o]),z=react.useCallback(e=>jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${De[e]}`,children:Se[e]}),[]),K=react.useCallback(e=>e.dpoApproval?e.dpoApproval.approved?jsxRuntime.jsx("span",{className:"ndpr-badge ndpr-badge--success",children:"Approved"}):jsxRuntime.jsx("span",{className:"ndpr-badge ndpr-badge--warning",children:"Pending Approval"}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400",children:"No DPO Review"}),[]),be=()=>jsxRuntime.jsxs("div",{"data-ndpr-component":"lawful-basis-tracker",className:chunkAME4HJR4_js.a("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",i==null?void 0:i.summary,o),role:"status","aria-label":"Compliance summary",children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--info",i==null?void 0:i.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:P.totalActivities}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-info",children:"Total Activities"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("bg-orange-50 dark:bg-orange-900/20 p-4 rounded-lg",i==null?void 0:i.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:P.sensitiveDataActivities}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-warning",children:"Sensitive Data"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--info",i==null?void 0:i.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:P.crossBorderActivities}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-info",children:"Cross-Border Transfers"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--destructive",i==null?void 0:i.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-destructive",children:P.activitiesWithoutApproval.length}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-destructive",children:"Pending Approval"})]})]}),N=react.useMemo(()=>h.filter(e=>e.severity==="high"),[h]),O=react.useMemo(()=>h.filter(e=>e.severity==="medium"),[h]),he=()=>h.length===0?jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-4 rounded-lg mb-6",role:"status","aria-label":"No compliance gaps",children:[jsxRuntime.jsx("p",{className:"text-sm ndpr-text-success font-medium",children:"No compliance gaps detected."}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-success mt-1",children:"All processing activities appear to be properly documented."})]}):jsxRuntime.jsxs("div",{className:"mb-6",role:"status","aria-label":`${h.length} compliance gaps detected`,children:[N.length>0&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-3",i==null?void 0:i.gapAlert,o),children:[jsxRuntime.jsxs("p",{className:"text-sm ndpr-text-destructive font-medium mb-2",children:["High Priority (",N.length,")"]}),jsxRuntime.jsx("ul",{className:"space-y-1",children:N.map((e,l)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-destructive",children:e.description},l))})]}),O.length>0&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--warning",i==null?void 0:i.gapAlert,o),children:[jsxRuntime.jsxs("p",{className:"text-sm ndpr-text-warning font-medium mb-2",children:["Medium Priority (",O.length,")"]}),jsxRuntime.jsx("ul",{className:"space-y-1",children:O.map((e,l)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-warning",children:e.description},l))})]})]}),Q=react.useCallback(()=>{f("list"),C([]);},[]),_e=react.useCallback(()=>{f("list");},[]),s=react.useCallback((e,l)=>{w(p=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},p),{[e]:l}));},[]),xe=react.useCallback(e=>{w(l=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},l),{involvesSensitiveData:e,sensitiveDataCondition:e?l.sensitiveDataCondition:""}));},[]),we=()=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("",i==null?void 0:i.form,o),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex justify-between items-center mb-4",i==null?void 0:i.header,o),children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:b?"Edit Processing Activity":"New Processing Activity"}),jsxRuntime.jsx("button",{onClick:Q,className:`px-4 py-2 ndpr-text-muted bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${m}`,children:"Cancel"})]}),c.length>0&&jsxRuntime.jsxs("div",{id:"form-errors",className:"bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-4",role:"alert",children:[jsxRuntime.jsx("p",{className:"text-sm ndpr-text-destructive font-medium mb-2",children:"Please correct the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside space-y-1",children:c.map((e,l)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-destructive",children:e},l))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-section",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"activityName",className:"ndpr-form-field__label",children:"Activity Name *"}),jsxRuntime.jsx("input",{type:"text",id:"activityName",value:a.name,onChange:e=>s("name",e.target.value),placeholder:"e.g., Customer Account Management","aria-required":"true","aria-describedby":c.length>0?"form-errors":void 0,className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"activityDescription",className:"ndpr-form-field__label",children:"Description *"}),jsxRuntime.jsx("textarea",{id:"activityDescription",value:a.description,onChange:e=>s("description",e.target.value),placeholder:"Describe what processing is performed...",rows:3,"aria-required":"true","aria-describedby":c.length>0?"form-errors":void 0,className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasis",className:"ndpr-form-field__label",children:"Lawful Basis (NDPA Section 25) *"}),jsxRuntime.jsx("select",{id:"lawfulBasis",value:a.lawfulBasis,onChange:e=>s("lawfulBasis",e.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.select,o),children:re.map(e=>jsxRuntime.jsx("option",{value:e.value,children:e.label},e.value))}),jsxRuntime.jsx("p",{className:"mt-1 text-xs ndpr-text-muted",children:chunkWZYCBW2R_js.b(a.lawfulBasis)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"justification",className:"ndpr-form-field__label",children:"Lawful Basis Justification *"}),jsxRuntime.jsx("textarea",{id:"justification",value:a.lawfulBasisJustification,onChange:e=>s("lawfulBasisJustification",e.target.value),placeholder:"Document why this lawful basis applies to this processing activity...",rows:3,"aria-required":"true","aria-describedby":c.length>0?"form-errors":void 0,className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.input,o)})]}),a.lawfulBasis==="legitimate_interests"&&jsxRuntime.jsxs("div",{className:"border border-indigo-200 dark:border-indigo-800 rounded-lg p-4 bg-indigo-50 dark:bg-indigo-900/20",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-indigo-800 dark:text-indigo-200 mb-3",children:"Legitimate Interest Assessment (LIA)"}),jsxRuntime.jsx("p",{className:"text-xs text-indigo-600 dark:text-indigo-300 mb-4",children:"NDPA Section 25(1)(f) requires a balancing test when relying on legitimate interests."}),jsxRuntime.jsxs("div",{className:"ndpr-form-section",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaPurpose",className:"ndpr-form-field__label",children:"Purpose Test"}),jsxRuntime.jsx("textarea",{id:"liaPurpose",value:a.liaPurposeTest,onChange:e=>s("liaPurposeTest",e.target.value),placeholder:"Describe the legitimate interest being pursued...",rows:2,className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaNecessity",className:"ndpr-form-field__label",children:"Necessity Test"}),jsxRuntime.jsx("textarea",{id:"liaNecessity",value:a.liaNecessityTest,onChange:e=>s("liaNecessityTest",e.target.value),placeholder:"Explain why this processing is necessary for the stated purpose...",rows:2,className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaBalancing",className:"ndpr-form-field__label",children:"Balancing Test"}),jsxRuntime.jsx("textarea",{id:"liaBalancing",value:a.liaBalancingTest,onChange:e=>s("liaBalancingTest",e.target.value),placeholder:"Assess the impact on data subjects' rights and interests...",rows:2,className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaSafeguards",className:"ndpr-form-field__label",children:"Safeguards"}),jsxRuntime.jsx("input",{type:"text",id:"liaSafeguards",value:a.liaSafeguards,onChange:e=>s("liaSafeguards",e.target.value),placeholder:"List safeguards (comma-separated)...",className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaConclusion",className:"ndpr-form-field__label",children:"Conclusion"}),jsxRuntime.jsx("textarea",{id:"liaConclusion",value:a.liaConclusion,onChange:e=>s("liaConclusion",e.target.value),placeholder:"State your overall conclusion...",rows:2,className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.input,o)})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataCategories",className:"ndpr-form-field__label",children:"Data Categories *"}),jsxRuntime.jsx("input",{type:"text",id:"dataCategories",value:a.dataCategories,onChange:e=>s("dataCategories",e.target.value),placeholder:"e.g., Name, Email, Phone Number (comma-separated)","aria-required":"true","aria-describedby":c.length>0?"form-errors":void 0,className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.input,o)})]}),jsxRuntime.jsx("div",{children:jsxRuntime.jsxs("label",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:a.involvesSensitiveData,onChange:e=>xe(e.target.checked),className:"rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("span",{className:"ndpr-text-sm ndpr-font-medium",children:"Involves Sensitive Personal Data (NDPA Section 27)"})]})}),a.involvesSensitiveData&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sensitiveCondition",className:"ndpr-form-field__label",children:"Sensitive Data Condition (NDPA Section 27) *"}),jsxRuntime.jsxs("select",{id:"sensitiveCondition",value:a.sensitiveDataCondition,onChange:e=>s("sensitiveDataCondition",e.target.value),"aria-required":"true",className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.select,o),children:[jsxRuntime.jsx("option",{value:"",children:"Select a condition..."}),ae.map(e=>jsxRuntime.jsx("option",{value:e.value,children:e.label},e.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataSubjectCategories",className:"ndpr-form-field__label",children:"Data Subject Categories *"}),jsxRuntime.jsx("input",{type:"text",id:"dataSubjectCategories",value:a.dataSubjectCategories,onChange:e=>s("dataSubjectCategories",e.target.value),placeholder:"e.g., Customers, Employees, Vendors (comma-separated)","aria-required":"true","aria-describedby":c.length>0?"form-errors":void 0,className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"purposes",className:"ndpr-form-field__label",children:"Processing Purposes *"}),jsxRuntime.jsx("input",{type:"text",id:"purposes",value:a.purposes,onChange:e=>s("purposes",e.target.value),placeholder:"e.g., Account management, Service delivery (comma-separated)","aria-required":"true","aria-describedby":c.length>0?"form-errors":void 0,className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.input,o)})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionPeriod",className:"ndpr-form-field__label",children:"Retention Period *"}),jsxRuntime.jsx("input",{type:"text",id:"retentionPeriod",value:a.retentionPeriod,onChange:e=>s("retentionPeriod",e.target.value),placeholder:"e.g., 3 years after account closure","aria-required":"true","aria-describedby":c.length>0?"form-errors":void 0,className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionJustification",className:"ndpr-form-field__label",children:"Retention Justification"}),jsxRuntime.jsx("input",{type:"text",id:"retentionJustification",value:a.retentionJustification,onChange:e=>s("retentionJustification",e.target.value),placeholder:"Reason for the retention period",className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.input,o)})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recipients",className:"ndpr-form-field__label",children:"Recipients"}),jsxRuntime.jsx("input",{type:"text",id:"recipients",value:a.recipients,onChange:e=>s("recipients",e.target.value),placeholder:"e.g., Payment processor, Cloud provider (comma-separated)",className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.input,o)})]}),jsxRuntime.jsx("div",{children:jsxRuntime.jsxs("label",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:a.crossBorderTransfer,onChange:e=>s("crossBorderTransfer",e.target.checked),className:"rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("span",{className:"ndpr-text-sm ndpr-font-medium",children:"Involves Cross-Border Transfer Outside Nigeria"})]})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"reviewDate",className:"ndpr-form-field__label",children:"Next Review Date"}),jsxRuntime.jsx("input",{type:"date",id:"reviewDate",value:a.reviewDate,onChange:e=>s("reviewDate",e.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.input,o)})]}),jsxRuntime.jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[jsxRuntime.jsx("button",{onClick:Q,className:`px-4 py-2 ndpr-text-muted bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${m}`,children:"Cancel"}),jsxRuntime.jsx("button",{onClick:me,className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${m}`,(i==null?void 0:i.primaryButton)||(i==null?void 0:i.submitButton),o),children:b?"Update Activity":"Create Activity"})]})]})]}),Ce=()=>{var l;if(!n)return jsxRuntime.jsx("div",{className:"ndpr-empty-state",children:jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:"Activity not found."})});let e=chunkWZYCBW2R_js.a(n);return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{onClick:_e,className:"text-sm ndpr-text-primary hover:underline mb-2","aria-label":"Back to activities list",children:"Back to list"}),jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:n.name})]}),jsxRuntime.jsxs("div",{className:"ndpr-card__footer",children:[z(n.lawfulBasis),W(n.status),K(n)]})]}),e.warnings.length>0&&jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm ndpr-text-warning font-medium mb-1",children:"Warnings"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside space-y-1",children:e.warnings.map((p,$)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-warning",children:p},$))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Description:"})," ",n.description]}),jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Lawful Basis:"})," ",chunkWZYCBW2R_js.b(n.lawfulBasis)]}),jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})," ",n.lawfulBasisJustification]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Categories:"})," ",n.dataCategories.join(", ")]}),jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subject Categories:"})," ",n.dataSubjectCategories.join(", ")]}),jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Purposes:"})," ",n.purposes.join(", ")]}),jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Retention Period:"})," ",n.retentionPeriod,n.retentionJustification&&jsxRuntime.jsxs("span",{className:"ndpr-card__subtitle",children:[" ","(",n.retentionJustification,")"]})]})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",n.involvesSensitiveData?"Yes":"No",n.sensitiveDataCondition&&jsxRuntime.jsxs("span",{children:[" ","(Condition:"," ",((l=ae.find(p=>p.value===n.sensitiveDataCondition))==null?void 0:l.label)||n.sensitiveDataCondition,")"]})]}),jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Cross-Border Transfer:"})," ",n.crossBorderTransfer?"Yes":"No"]}),n.recipients&&n.recipients.length>0&&jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Recipients:"})," ",n.recipients.join(", ")]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Created:"})," ",y(n.createdAt)]}),jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Last Updated:"})," ",y(n.updatedAt)]}),n.reviewDate&&jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next Review:"})," ",y(n.reviewDate),n.reviewDate<Date.now()&&jsxRuntime.jsx("span",{className:"ndpr-text-destructive font-medium",children:" (Overdue)"})]})]})]}),n.dpoApproval&&jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-6",children:[jsxRuntime.jsx("h4",{className:"ndpr-section-heading",children:"DPO Approval"}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",n.dpoApproval.approved?"Approved":"Not Approved"]}),jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Approved By:"})," ",n.dpoApproval.approvedBy]}),jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Date:"})," ",y(n.dpoApproval.approvedAt)]}),n.dpoApproval.notes&&jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notes:"})," ",n.dpoApproval.notes]})]}),jsxRuntime.jsxs("div",{className:"flex space-x-3",children:[jsxRuntime.jsx("button",{onClick:()=>H(n),"aria-label":`Edit ${n.name}`,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${m}`,children:"Edit"}),n.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>Y(n.id),"aria-label":`Archive ${n.name}`,className:`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 ${m}`,children:"Archive"})]})]})},ye=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"basisFilter",className:"ndpr-form-field__label",children:"Lawful Basis"}),jsxRuntime.jsxs("select",{id:"basisFilter",value:D,onChange:e=>ce(e.target.value),"aria-label":"Filter by lawful basis",className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Bases"}),re.map(e=>jsxRuntime.jsx("option",{value:e.value,children:e.label},e.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"statusFilterSelect",className:"ndpr-form-field__label",children:"Status"}),jsxRuntime.jsxs("select",{id:"statusFilterSelect",value:B,onChange:e=>ue(e.target.value),"aria-label":"Filter by status",className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),jsxRuntime.jsx("option",{value:"active",children:"Active"}),jsxRuntime.jsx("option",{value:"inactive",children:"Inactive"}),jsxRuntime.jsx("option",{value:"under_review",children:"Under Review"}),jsxRuntime.jsx("option",{value:"archived",children:"Archived"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"searchInput",className:"ndpr-form-field__label",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"searchInput",value:S,onChange:e=>ge(e.target.value),placeholder:"Search activities...",className:chunkAME4HJR4_js.a("ndpr-form-field__input",i==null?void 0:i.input,o)})]}),jsxRuntime.jsx("div",{className:"flex items-end",children:jsxRuntime.jsx("button",{onClick:ve,className:chunkAME4HJR4_js.a(`w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${m}`,(i==null?void 0:i.primaryButton)||(i==null?void 0:i.submitButton),o),children:"Add Activity"})})]}),U.length===0?jsxRuntime.jsx("div",{className:"flex items-center justify-center h-32 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:"No processing activities found."})}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:chunkAME4HJR4_js.a("w-full text-sm text-left",i==null?void 0:i.table,o),children:[jsxRuntime.jsx("thead",{className:chunkAME4HJR4_js.a("ndpr-table__head",i==null?void 0:i.tableHeader,o),children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Activity"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Lawful Basis"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Status"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"DPO Approval"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Sensitive Data"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Last Updated"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{children:U.map(e=>jsxRuntime.jsxs("tr",{className:chunkAME4HJR4_js.a("border-b border-gray-200 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-700",i==null?void 0:i.tableRow,o),children:[jsxRuntime.jsxs("td",{className:"ndpr-table__cell",children:[jsxRuntime.jsx("button",{onClick:()=>fe(e.id),className:"font-medium ndpr-text-primary hover:underline text-left",children:e.name}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mt-1 truncate max-w-xs",children:e.description})]}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:z(e.lawfulBasis)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:W(e.status)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:K(e)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsx("span",{className:`text-xs ${e.involvesSensitiveData?"ndpr-text-warning font-medium":"ndpr-card__subtitle"}`,children:e.involvesSensitiveData?"Yes":"No"})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:y(e.updatedAt)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsxs("div",{className:"ndpr-card__footer",children:[jsxRuntime.jsx("button",{onClick:()=>H(e),"aria-label":`Edit ${e.name}`,className:"text-xs ndpr-text-primary hover:underline",children:"Edit"}),e.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>Y(e.id),"aria-label":`Archive ${e.name}`,className:"text-xs ndpr-text-muted hover:underline",children:"Archive"})]})})]},e.id))})]})})]});return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ne}`,i==null?void 0:i.root,o),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",i==null?void 0:i.title,o),children:le}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:se}),oe&&x==="list"&&be(),de&&x==="list"&&he(),x==="list"&&ye(),x==="form"&&we(),x==="detail"&&Ce()]})};exports.a=je;
|
package/dist/chunk-B46SJB5V.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict';function o(e){let t=[];if((!e.consents||Object.keys(e.consents).length===0)&&t.push("Consent settings must include at least one consent option"),e.timestamp?(typeof e.timestamp!="number"||isNaN(e.timestamp))&&t.push("Consent timestamp must be a valid number"):t.push("Consent timestamp is required"),e.version||t.push("Consent version is required"),e.method||t.push("Consent collection method is required"),e.hasInteracted===void 0&&t.push("User interaction status is required"),e.timestamp){let n=new Date;n.setMonth(n.getMonth()-13);let s=n.getTime();e.timestamp<s&&t.push("Consent is older than 13 months and should be refreshed");}return {valid:t.length===0,errors:t}}function i(e){let t=[];return (!e||e.length===0)&&t.push("At least one consent option is required"),e==null||e.forEach(n=>{(!n.purpose||n.purpose.trim()==="")&&t.push(`Consent option "${n.id}" is missing a purpose. NDPA Section 26 requires consent to be specific to a stated purpose.`);}),{valid:t.length===0,errors:t}}exports.a=o;exports.b=i;
|