@tantainnovative/ndpr-toolkit 3.2.0 → 3.3.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.
Files changed (200) hide show
  1. package/README.md +34 -1
  2. package/dist/{DPIAQuestionnaire-BkejviPj.d.mts → DPIAQuestionnaire-VXBoWFMC.d.ts} +3 -3
  3. package/dist/{DPIAQuestionnaire-DdSqXG3x.d.ts → DPIAQuestionnaire-jkt1Veb6.d.mts} +3 -3
  4. package/dist/{DSRRequestForm-BY8PogCU.d.mts → DSRRequestForm-D8rPTNmU.d.ts} +2 -2
  5. package/dist/{DSRRequestForm-CHUg9cZh.d.ts → DSRRequestForm-DRouEr9j.d.mts} +2 -2
  6. package/dist/{DSRTracker-Dr_aT0pg.d.ts → DSRTracker-Bl__d4df.d.ts} +1 -1
  7. package/dist/{DSRTracker-C6u_jAaK.d.mts → DSRTracker-CSVDfgQQ.d.mts} +1 -1
  8. package/dist/{StepIndicator-D9ZATz_O.d.ts → StepIndicator-CgrlokSV.d.ts} +1 -1
  9. package/dist/{StepIndicator-D-nwRTyo.d.mts → StepIndicator-W8S_QjgO.d.mts} +1 -1
  10. package/dist/adapters.js +1 -1
  11. package/dist/adapters.mjs +1 -1
  12. package/dist/breach.js +1 -1
  13. package/dist/breach.mjs +1 -1
  14. package/dist/chunk-256APOQM.js +2 -0
  15. package/dist/chunk-25OOUES4.js +2 -0
  16. package/dist/chunk-4JKTIR33.mjs +2 -0
  17. package/dist/chunk-5BUS6AI7.js +2 -0
  18. package/dist/chunk-5X32J5IA.mjs +2 -0
  19. package/dist/chunk-6BXUVS6E.js +81 -0
  20. package/dist/chunk-6JCRDJQI.mjs +2 -0
  21. package/dist/{chunk-KHRBU5K7.js → chunk-6RQGQZT2.js} +2 -2
  22. package/dist/chunk-6TA2MVTU.mjs +2 -0
  23. package/dist/chunk-6WIP33TW.mjs +2 -0
  24. package/dist/chunk-6YN73KR7.mjs +2 -0
  25. package/dist/chunk-75TJPK2N.mjs +2 -0
  26. package/dist/{chunk-2ORDHJRD.js → chunk-7AVN424U.js} +2 -2
  27. package/dist/chunk-7D2OIPHH.mjs +2 -0
  28. package/dist/{chunk-5VMHKNJY.js → chunk-7SMLHZ4B.js} +2 -2
  29. package/dist/chunk-A4PK7JB2.js +2 -0
  30. package/dist/chunk-ABDB7LEV.mjs +2 -0
  31. package/dist/chunk-BKRETVJ6.js +2 -0
  32. package/dist/chunk-C4YM4UMI.js +2 -0
  33. package/dist/chunk-CDZDT2OS.mjs +320 -0
  34. package/dist/chunk-CSIJCLGZ.mjs +2 -0
  35. package/dist/chunk-CWUPGY3M.mjs +3 -0
  36. package/dist/chunk-DJGS7SSN.mjs +2 -0
  37. package/dist/{chunk-SVCRYM4I.mjs → chunk-E4NCJ7RD.mjs} +2 -2
  38. package/dist/chunk-E63VPR7U.js +2 -0
  39. package/dist/chunk-ELKB2AFZ.js +2 -0
  40. package/dist/chunk-FDDI426Y.mjs +2 -0
  41. package/dist/chunk-GKKAK6ES.mjs +3 -0
  42. package/dist/chunk-GMLCWGNJ.js +7 -0
  43. package/dist/{chunk-SWF3YVE5.js → chunk-GOU6FU6Y.js} +3 -3
  44. package/dist/chunk-GQVNLUP2.js +94 -0
  45. package/dist/chunk-GXLSOZCH.mjs +2 -0
  46. package/dist/chunk-HO5M7M4M.js +2 -0
  47. package/dist/chunk-I4M2AA3N.js +2 -0
  48. package/dist/chunk-I54CDQGN.js +3 -0
  49. package/dist/chunk-IQJO7WIH.js +7 -0
  50. package/dist/chunk-JKKRPS4P.js +2 -0
  51. package/dist/chunk-LETEUS5X.mjs +2 -0
  52. package/dist/{chunk-P7BSBCB3.js → chunk-M6XETYNL.js} +2 -2
  53. package/dist/chunk-NBSVFQ5G.js +2 -0
  54. package/dist/chunk-NUDVUAD4.mjs +81 -0
  55. package/dist/chunk-NUULHXVL.mjs +7 -0
  56. package/dist/chunk-P42Z5CFE.js +2 -0
  57. package/dist/chunk-PATONNTZ.mjs +2 -0
  58. package/dist/{chunk-WLSW4Z4W.mjs → chunk-PM7O5IGE.mjs} +2 -2
  59. package/dist/chunk-Q7VHB64E.mjs +2 -0
  60. package/dist/chunk-QDHHD2KR.mjs +94 -0
  61. package/dist/chunk-R3OYAJI6.mjs +2 -0
  62. package/dist/chunk-S4GRSNB4.js +2 -0
  63. package/dist/chunk-SAA7UVI2.js +3 -0
  64. package/dist/{chunk-PYEX7DFR.mjs → chunk-SHMJNRHO.mjs} +3 -3
  65. package/dist/chunk-TI2M7H6R.mjs +7 -0
  66. package/dist/chunk-TKVJ3OOV.mjs +2 -0
  67. package/dist/chunk-TXXWCB5O.js +320 -0
  68. package/dist/chunk-U62QYKVG.mjs +2 -0
  69. package/dist/{chunk-44W4H2EY.js → chunk-UGY5ZYUG.js} +2 -2
  70. package/dist/chunk-UO6QPJLH.js +2 -0
  71. package/dist/chunk-UX6ZZNEM.mjs +3 -0
  72. package/dist/{chunk-5RSOLEEP.js → chunk-UXMGBIX6.js} +4 -4
  73. package/dist/chunk-VLSGE2YA.js +2 -0
  74. package/dist/{chunk-G26I6MP5.mjs → chunk-VWPGIES4.mjs} +2 -2
  75. package/dist/chunk-XFUEZ3MP.mjs +2 -0
  76. package/dist/chunk-XHSHPB74.js +2 -0
  77. package/dist/chunk-YCX6BFOQ.js +2 -0
  78. package/dist/chunk-YURSF2YO.mjs +2 -0
  79. package/dist/chunk-YZXUAIYN.js +3 -0
  80. package/dist/{chunk-CAB7O3GR.mjs → chunk-ZEOQYWOE.mjs} +4 -4
  81. package/dist/chunk-ZGJA7OO4.js +2 -0
  82. package/dist/chunk-ZT7KNFAU.mjs +2 -0
  83. package/dist/chunk-ZYLDLGFL.js +2 -0
  84. package/dist/consent.js +1 -1
  85. package/dist/consent.mjs +1 -1
  86. package/dist/core.d.mts +21 -9
  87. package/dist/core.d.ts +21 -9
  88. package/dist/core.js +1 -1
  89. package/dist/core.mjs +1 -1
  90. package/dist/cross-border.d.mts +68 -1
  91. package/dist/cross-border.d.ts +68 -1
  92. package/dist/cross-border.js +1 -1
  93. package/dist/cross-border.mjs +1 -1
  94. package/dist/{dpia-B0Pok5us.d.ts → dpia-D82hUrJe.d.ts} +1 -1
  95. package/dist/{dpia-CUfOmzvX.d.mts → dpia-DQDFw2_l.d.mts} +1 -1
  96. package/dist/{dpia-5OQVA1R_.d.mts → dpia-c9GiiOq0.d.mts} +2 -2
  97. package/dist/{dpia-5OQVA1R_.d.ts → dpia-c9GiiOq0.d.ts} +2 -2
  98. package/dist/dpia.d.mts +9 -9
  99. package/dist/dpia.d.ts +9 -9
  100. package/dist/dpia.js +1 -1
  101. package/dist/dpia.mjs +1 -1
  102. package/dist/{dsr-D_eTNc4S.d.mts → dsr-CIx5sd7e.d.ts} +2 -2
  103. package/dist/{dsr-pNtVb1BK.d.ts → dsr-XZ_HqTlA.d.mts} +2 -2
  104. package/dist/{dsr-Cm9lzWG7.d.mts → dsr-yKbqX531.d.mts} +1 -1
  105. package/dist/{dsr-Cm9lzWG7.d.ts → dsr-yKbqX531.d.ts} +1 -1
  106. package/dist/dsr.d.mts +9 -9
  107. package/dist/dsr.d.ts +9 -9
  108. package/dist/dsr.js +1 -1
  109. package/dist/dsr.mjs +1 -1
  110. package/dist/hooks.d.mts +6 -6
  111. package/dist/hooks.d.ts +6 -6
  112. package/dist/hooks.js +1 -1
  113. package/dist/hooks.mjs +1 -1
  114. package/dist/index.d.mts +11 -11
  115. package/dist/index.d.ts +11 -11
  116. package/dist/index.js +1 -1
  117. package/dist/index.mjs +1 -1
  118. package/dist/lawful-basis.js +1 -1
  119. package/dist/lawful-basis.mjs +1 -1
  120. package/dist/{policy-engine-DSQpT55_.d.ts → policy-engine-C6nC2t3a.d.ts} +1 -1
  121. package/dist/{policy-engine-C-tShzZH.d.mts → policy-engine-DefZcX3R.d.mts} +1 -1
  122. package/dist/{policy-sections-CfNVBLCh.d.mts → policy-sections-Bylm31kZ.d.mts} +1 -1
  123. package/dist/{policy-sections-DqH0iZRf.d.ts → policy-sections-DFDPVCCg.d.ts} +1 -1
  124. package/dist/policy.d.mts +4 -4
  125. package/dist/policy.d.ts +4 -4
  126. package/dist/policy.js +1 -1
  127. package/dist/policy.mjs +1 -1
  128. package/dist/presets.d.mts +5 -5
  129. package/dist/presets.d.ts +5 -5
  130. package/dist/presets.js +1 -1
  131. package/dist/presets.mjs +1 -1
  132. package/dist/ropa.js +1 -1
  133. package/dist/ropa.mjs +1 -1
  134. package/dist/{sanitize-9mOO_cJW.d.mts → sanitize-B0AzEm1D.d.mts} +14 -1
  135. package/dist/{sanitize-9mOO_cJW.d.ts → sanitize-B0AzEm1D.d.ts} +14 -1
  136. package/dist/{useAdaptivePolicyWizard-N4eUM4Tj.d.mts → useAdaptivePolicyWizard-A1PyOy6P.d.mts} +1 -1
  137. package/dist/{useAdaptivePolicyWizard-B9Op2gYM.d.ts → useAdaptivePolicyWizard-LVIKhAxw.d.ts} +1 -1
  138. package/dist/{useDPIA-DzWye8JB.d.mts → useDPIA-B6180UQn.d.mts} +9 -5
  139. package/dist/{useDPIA-Dl16Te3r.d.ts → useDPIA-CTqbNbww.d.ts} +9 -5
  140. package/dist/{useDSR-C1LksCfP.d.mts → useDSR-WvHk8_iu.d.mts} +2 -2
  141. package/dist/{useDSR-DZel52O1.d.ts → useDSR-wH4H6hSM.d.ts} +2 -2
  142. package/package.json +3 -2
  143. package/dist/chunk-27NYSWUG.mjs +0 -2
  144. package/dist/chunk-2SYNHRP6.mjs +0 -2
  145. package/dist/chunk-2W7ARAW2.js +0 -2
  146. package/dist/chunk-3F34NACG.js +0 -2
  147. package/dist/chunk-3UWT64FI.mjs +0 -2
  148. package/dist/chunk-3V23O4ZJ.js +0 -2
  149. package/dist/chunk-3XAUN5IM.mjs +0 -3
  150. package/dist/chunk-4JUDKBA2.mjs +0 -7
  151. package/dist/chunk-4VVARDN2.mjs +0 -2
  152. package/dist/chunk-6D3ZUGBB.mjs +0 -2
  153. package/dist/chunk-6E54NSAO.mjs +0 -2
  154. package/dist/chunk-7F5F5YWI.mjs +0 -2
  155. package/dist/chunk-BGHQTZAC.js +0 -94
  156. package/dist/chunk-CL53OI3I.js +0 -7
  157. package/dist/chunk-CMZTI7SG.js +0 -2
  158. package/dist/chunk-DQLDX5X6.js +0 -316
  159. package/dist/chunk-ELKEZEV5.mjs +0 -2
  160. package/dist/chunk-EPF7J2FK.js +0 -3
  161. package/dist/chunk-ER7X6E36.js +0 -2
  162. package/dist/chunk-FR7ZYZXB.js +0 -2
  163. package/dist/chunk-FXTZDKDC.mjs +0 -3
  164. package/dist/chunk-FY5G6DGZ.js +0 -7
  165. package/dist/chunk-GIV2OHE6.mjs +0 -2
  166. package/dist/chunk-GPJVTGHR.mjs +0 -2
  167. package/dist/chunk-GVANK6PL.js +0 -3
  168. package/dist/chunk-HNZK7LY3.mjs +0 -2
  169. package/dist/chunk-IKEPXHCZ.js +0 -2
  170. package/dist/chunk-IQF726GS.js +0 -2
  171. package/dist/chunk-IQQW52EF.js +0 -2
  172. package/dist/chunk-ISSGO2YT.mjs +0 -72
  173. package/dist/chunk-JZKH5RMC.js +0 -3
  174. package/dist/chunk-LFNA6WYQ.mjs +0 -2
  175. package/dist/chunk-NPI5T6NH.mjs +0 -7
  176. package/dist/chunk-NPLXE43Q.mjs +0 -2
  177. package/dist/chunk-PEH5GIMN.js +0 -2
  178. package/dist/chunk-PGSA2O5P.mjs +0 -2
  179. package/dist/chunk-QKK5S54L.mjs +0 -2
  180. package/dist/chunk-RGYK4VAY.mjs +0 -2
  181. package/dist/chunk-RSUDIFZV.mjs +0 -2
  182. package/dist/chunk-RYZEIDNR.js +0 -2
  183. package/dist/chunk-SBNAMPAP.mjs +0 -2
  184. package/dist/chunk-SKJCQKFL.mjs +0 -94
  185. package/dist/chunk-SSGJREE3.js +0 -2
  186. package/dist/chunk-TKBZRULW.mjs +0 -316
  187. package/dist/chunk-TVW6KBVV.mjs +0 -2
  188. package/dist/chunk-U6VWHC46.js +0 -72
  189. package/dist/chunk-UK656RCG.js +0 -2
  190. package/dist/chunk-UNKXYVXY.js +0 -2
  191. package/dist/chunk-UOSEH6DC.js +0 -2
  192. package/dist/chunk-UZ5EZOA7.js +0 -2
  193. package/dist/chunk-V37BM2LF.js +0 -2
  194. package/dist/chunk-V3MXWGXU.mjs +0 -2
  195. package/dist/chunk-VDZKGCAF.js +0 -2
  196. package/dist/chunk-XSK4BSZJ.mjs +0 -2
  197. package/dist/chunk-Y34DQYS7.js +0 -2
  198. package/dist/chunk-YJCGEOLO.mjs +0 -2
  199. package/dist/chunk-ZCZ5RRZO.js +0 -2
  200. package/dist/chunk-ZQSX5ZHB.mjs +0 -3
@@ -1,316 +0,0 @@
1
- import {b,d as d$1,c}from'./chunk-GCQRHMTQ.mjs';import {a}from'./chunk-SBNAMPAP.mjs';import {d,b as b$1,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useMemo,useCallback}from'react';function R(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function le(r){return r.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function Ne(r){let m=r.split(`
2
- `),v=[],e=false;for(let a of m){let s=a.trimEnd();s.startsWith("- ")||s.startsWith("\u2022 ")?(e||(v.push("<ul>"),e=true),v.push(` <li>${R(s.replace(/^[-•]\s*/,""))}</li>`)):(e&&(v.push("</ul>"),e=false),s.trim()===""||v.push(`<p>${R(s)}</p>`));}return e&&v.push("</ul>"),v.join(`
3
- `)}var Ie=`
4
- /* \u2500\u2500 Reset & Base \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
5
- *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
6
-
7
- /* \u2500\u2500 Design tokens \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
8
- :root {
9
- --color-bg: #ffffff;
10
- --color-surface: #f9fafb;
11
- --color-border: #e5e7eb;
12
- --color-text: #111827;
13
- --color-text-muted: #6b7280;
14
- --color-accent: #16a34a;
15
- --color-accent-light: #dcfce7;
16
- --color-heading: #064e3b;
17
- --color-link: #15803d;
18
- --color-link-hover: #166534;
19
- --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
20
- --font-mono: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, monospace;
21
- --radius: 8px;
22
- --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
23
- --max-width: 860px;
24
- }
25
-
26
- @media (prefers-color-scheme: dark) {
27
- :root {
28
- --color-bg: #0f172a;
29
- --color-surface: #1e293b;
30
- --color-border: #334155;
31
- --color-text: #f1f5f9;
32
- --color-text-muted: #94a3b8;
33
- --color-accent: #22c55e;
34
- --color-accent-light: #14532d;
35
- --color-heading: #86efac;
36
- --color-link: #4ade80;
37
- --color-link-hover: #86efac;
38
- }
39
- }
40
-
41
- /* \u2500\u2500 Layout \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
42
- html { font-size: 16px; scroll-behavior: smooth; }
43
-
44
- body {
45
- font-family: var(--font-sans);
46
- background: var(--color-bg);
47
- color: var(--color-text);
48
- line-height: 1.7;
49
- padding: 2rem 1.25rem;
50
- }
51
-
52
- .policy-wrapper {
53
- max-width: var(--max-width);
54
- margin: 0 auto;
55
- }
56
-
57
- /* \u2500\u2500 Header \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
58
- .policy-header {
59
- background: var(--color-surface);
60
- border: 1px solid var(--color-border);
61
- border-radius: var(--radius);
62
- padding: 2.5rem 2.5rem 2rem;
63
- margin-bottom: 2rem;
64
- box-shadow: var(--shadow);
65
- }
66
-
67
- .policy-header h1 {
68
- font-size: 2rem;
69
- font-weight: 700;
70
- color: var(--color-heading);
71
- line-height: 1.2;
72
- margin-bottom: 0.75rem;
73
- letter-spacing: -0.025em;
74
- }
75
-
76
- .policy-meta {
77
- display: flex;
78
- flex-wrap: wrap;
79
- gap: 0.5rem 1.5rem;
80
- font-size: 0.875rem;
81
- color: var(--color-text-muted);
82
- margin-top: 0.5rem;
83
- }
84
-
85
- .policy-meta span { white-space: nowrap; }
86
-
87
- .compliance-badge {
88
- display: inline-flex;
89
- align-items: center;
90
- gap: 0.35rem;
91
- background: var(--color-accent-light);
92
- color: var(--color-accent);
93
- font-size: 0.75rem;
94
- font-weight: 600;
95
- padding: 0.25rem 0.75rem;
96
- border-radius: 9999px;
97
- margin-top: 1rem;
98
- letter-spacing: 0.01em;
99
- border: 1px solid var(--color-accent);
100
- }
101
-
102
- /* \u2500\u2500 Navigation / TOC \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
103
- .policy-toc {
104
- background: var(--color-surface);
105
- border: 1px solid var(--color-border);
106
- border-left: 4px solid var(--color-accent);
107
- border-radius: var(--radius);
108
- padding: 1.5rem 2rem;
109
- margin-bottom: 2.5rem;
110
- box-shadow: var(--shadow);
111
- }
112
-
113
- .policy-toc h2 {
114
- font-size: 1rem;
115
- font-weight: 700;
116
- text-transform: uppercase;
117
- letter-spacing: 0.08em;
118
- color: var(--color-text-muted);
119
- margin-bottom: 1rem;
120
- }
121
-
122
- .policy-toc ol {
123
- list-style: decimal;
124
- padding-left: 1.25rem;
125
- column-count: 1;
126
- }
127
-
128
- @media (min-width: 600px) {
129
- .policy-toc ol { column-count: 2; column-gap: 2rem; }
130
- }
131
-
132
- .policy-toc li { margin-bottom: 0.35rem; break-inside: avoid; }
133
-
134
- .policy-toc a {
135
- color: var(--color-link);
136
- text-decoration: none;
137
- font-size: 0.9375rem;
138
- transition: color 0.15s ease;
139
- }
140
-
141
- .policy-toc a:hover { color: var(--color-link-hover); text-decoration: underline; }
142
-
143
- /* \u2500\u2500 Article / Sections \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
144
- article.policy-body { display: flex; flex-direction: column; gap: 2.5rem; }
145
-
146
- .policy-section {
147
- background: var(--color-surface);
148
- border: 1px solid var(--color-border);
149
- border-radius: var(--radius);
150
- padding: 2rem 2.5rem;
151
- box-shadow: var(--shadow);
152
- scroll-margin-top: 1.5rem;
153
- }
154
-
155
- .policy-section h2 {
156
- font-size: 1.25rem;
157
- font-weight: 700;
158
- color: var(--color-heading);
159
- margin-bottom: 1.25rem;
160
- padding-bottom: 0.75rem;
161
- border-bottom: 2px solid var(--color-accent-light);
162
- display: flex;
163
- align-items: baseline;
164
- gap: 0.5rem;
165
- line-height: 1.3;
166
- }
167
-
168
- .section-number {
169
- font-size: 0.75rem;
170
- font-weight: 700;
171
- background: var(--color-accent);
172
- color: #fff;
173
- width: 1.5rem;
174
- height: 1.5rem;
175
- display: inline-flex;
176
- align-items: center;
177
- justify-content: center;
178
- border-radius: 50%;
179
- flex-shrink: 0;
180
- }
181
-
182
- .policy-section p {
183
- margin-bottom: 0.875rem;
184
- font-size: 0.9375rem;
185
- color: var(--color-text);
186
- }
187
-
188
- .policy-section p:last-child { margin-bottom: 0; }
189
-
190
- .policy-section ul {
191
- margin: 0.75rem 0 0.875rem 1.5rem;
192
- display: flex;
193
- flex-direction: column;
194
- gap: 0.35rem;
195
- }
196
-
197
- .policy-section ul li {
198
- font-size: 0.9375rem;
199
- color: var(--color-text);
200
- position: relative;
201
- }
202
-
203
- .policy-section ul li::marker { color: var(--color-accent); }
204
-
205
- /* \u2500\u2500 Footer \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
206
- .policy-footer {
207
- margin-top: 3rem;
208
- padding: 1.5rem 2rem;
209
- border-top: 1px solid var(--color-border);
210
- text-align: center;
211
- font-size: 0.8125rem;
212
- color: var(--color-text-muted);
213
- display: flex;
214
- flex-direction: column;
215
- gap: 0.35rem;
216
- }
217
-
218
- .policy-footer a { color: var(--color-link); text-decoration: none; }
219
- .policy-footer a:hover { text-decoration: underline; }
220
-
221
- /* \u2500\u2500 Print styles \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
222
- @media print {
223
- :root {
224
- --color-bg: #fff;
225
- --color-surface: #fff;
226
- --color-border: #d1d5db;
227
- --color-text: #000;
228
- --color-text-muted: #374151;
229
- --color-accent: #16a34a;
230
- --color-accent-light: #f0fdf4;
231
- --color-heading: #064e3b;
232
- --color-link: #15803d;
233
- }
234
-
235
- body { padding: 0; font-size: 10pt; }
236
- .policy-wrapper { max-width: 100%; }
237
-
238
- .policy-toc { break-inside: avoid; }
239
- .policy-section { break-inside: avoid; box-shadow: none; border: 1px solid #d1d5db; }
240
-
241
- .policy-toc ol { column-count: 2; }
242
- .policy-footer { border-top: 1px solid #d1d5db; }
243
-
244
- a { color: inherit; text-decoration: none; }
245
- }
246
- `.trim();function te(r,m){var L;let v=(m==null?void 0:m.includeStyles)!==false,e=(L=m==null?void 0:m.customCSS)!=null?L:"",a=r.sections.filter(D=>D.included),s=R(r.organizationInfo.name||"Organisation"),t=R(r.title||"Privacy Policy"),l=R(r.version||"1.0"),c=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),y=r.lastUpdated?new Date(r.lastUpdated).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):c,w=r.organizationInfo.website?`<a href="${R(r.organizationInfo.website)}" target="_blank" rel="noopener">${R(r.organizationInfo.website)}</a>`:"",x=r.organizationInfo.privacyEmail?`<a href="mailto:${R(r.organizationInfo.privacyEmail)}">${R(r.organizationInfo.privacyEmail)}</a>`:"",k=`
247
- <nav class="policy-toc" aria-label="Table of Contents">
248
- <h2>Table of Contents</h2>
249
- <ol>
250
- ${a.map((D,f)=>` <li><a href="#${le(D.title)}">${R(D.title)}</a></li>`).join(`
251
- `)}
252
- </ol>
253
- </nav>`,A=a.map((D,f)=>{let P=le(D.title),p=D.template||D.defaultContent||"",E=Ne(p);return ` <section class="policy-section" id="${P}" aria-labelledby="section-heading-${P}">
254
- <h2 id="section-heading-${P}">
255
- <span class="section-number" aria-hidden="true">${f+1}</span>
256
- ${R(D.title)}
257
- </h2>
258
- ${E}
259
- </section>`}).join(`
260
-
261
- `),N=v?`<style>
262
- ${Ie}
263
- ${e?`
264
- /* \u2500\u2500 Custom styles \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
265
- ${e}`:""}
266
- </style>`:e?`<style>${e}</style>`:"";return `<!DOCTYPE html>
267
- <html lang="en">
268
- <head>
269
- <meta charset="UTF-8" />
270
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
271
- <meta name="description" content="Privacy Policy for ${s}" />
272
- <meta name="generator" content="NDPA Toolkit" />
273
- <title>${t} \u2014 ${s}</title>
274
- ${N}
275
- </head>
276
- <body>
277
- <div class="policy-wrapper">
278
-
279
- <header class="policy-header">
280
- <h1>${t}</h1>
281
- <div class="policy-meta">
282
- <span><strong>Organisation:</strong> ${s}</span>
283
- <span><strong>Effective:</strong> ${c}</span>
284
- <span><strong>Version:</strong> ${l}</span>
285
- ${y!==c?`<span><strong>Last updated:</strong> ${y}</span>`:""}
286
- </div>
287
- <div>
288
- <span class="compliance-badge" role="img" aria-label="NDPA compliant">&#10003; NDPA 2023 Compliant</span>
289
- </div>
290
- </header>
291
-
292
- ${k}
293
-
294
- <article class="policy-body" aria-label="Policy content">
295
-
296
- ${A}
297
-
298
- </article>
299
-
300
- <footer class="policy-footer" role="contentinfo">
301
- <div>${s}${w?` &mdash; ${w}`:""}</div>
302
- ${x?`<div>Privacy contact: ${x}</div>`:""}
303
- <div>Effective ${c} &bull; Version ${l}</div>
304
- <div>Generated by <strong>NDPA Toolkit</strong> &mdash; Nigeria Data Protection Act 2023</div>
305
- </footer>
306
-
307
- </div>
308
- </body>
309
- </html>`}function Me(r){return r.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}function oe(r){let m=r.sections.filter(l=>l.included),v=r.title||"Privacy Policy",e=r.organizationInfo.name||"Organisation",a=r.version||"1.0",s=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),t=[];return t.push(`# ${v}`),t.push(""),t.push(`_Effective: ${s} | Version: ${a} | ${e}_`),t.push(""),r.organizationInfo.website&&t.push(`**Website:** ${r.organizationInfo.website} `),r.organizationInfo.privacyEmail&&t.push(`**Privacy contact:** ${r.organizationInfo.privacyEmail} `),(r.organizationInfo.website||r.organizationInfo.privacyEmail)&&t.push(""),t.push("> This privacy policy is compliant with the **Nigeria Data Protection Act (NDPA) 2023**."),t.push(""),t.push("---"),t.push(""),m.length>0&&(t.push("## Table of Contents"),t.push(""),m.forEach((l,c)=>{let y=Me(`${c+1} ${l.title}`);t.push(`${c+1}. [${l.title}](#${y})`);}),t.push(""),t.push("---"),t.push("")),m.forEach((l,c)=>{t.push(`## ${c+1}. ${l.title}`),t.push("");let y=(l.template||l.defaultContent||"").trim();if(y){let w=y.split(`
310
- `);for(let x of w){let S=x.trimEnd();S.startsWith("-")||S.startsWith("\u2022")||S===""?t.push(S.replace(/^•/,"-")):t.push(S);}}t.push(""),t.push("---"),t.push("");}),t.push(`_Generated by **NDPA Toolkit** &mdash; ${e} &bull; Version ${a}_`),t.push(""),t.join(`
311
- `)}function re(r,m){return d(this,null,function*(){var D;let v;try{let f=yield import('jspdf');v=(D=f.jsPDF)!=null?D:f.default;}catch(f){throw new Error('The "jspdf" package is required for PDF export. Install it with: pnpm add jspdf')}let e=new v({unit:"mm",format:"a4"}),a=e.internal.pageSize.getWidth(),s=e.internal.pageSize.getHeight(),t=20,l=a-t*2,c=t,y=r.organizationInfo.name||"",w=r.title||"Privacy Policy",x=r.version||"1.0",S=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString():new Date().toLocaleDateString(),k=()=>{e.setFontSize(8),e.setFont("helvetica","italic"),e.setTextColor(150,150,150),e.text(y?`${y} \u2014 ${w}`:w,t,12),e.setDrawColor(220,220,220),e.setLineWidth(.3),e.line(t,14,a-t,14),e.setTextColor(0,0,0);},A=f=>{c+f>s-t-10&&(e.addPage(),c=t+8,k());};if((m==null?void 0:m.includeCoverPage)!==false){e.setFillColor(22,163,74),e.rect(0,0,a,12,"F"),e.setFontSize(28),e.setFont("helvetica","bold"),e.setTextColor(22,163,74);let f=e.splitTextToSize(w,l-10),P=72;f.forEach(E=>{e.text(E,a/2,P,{align:"center"}),P+=11;}),e.setDrawColor(22,163,74),e.setLineWidth(.6);let p=P+6;if(e.line(a/2-30,p,a/2+30,p),e.setFontSize(14),e.setFont("helvetica","normal"),e.setTextColor(40,40,40),e.text(y,a/2,p+14,{align:"center"}),e.setFontSize(10),e.setTextColor(100,100,100),e.text(`Effective Date: ${S}`,a/2,p+26,{align:"center"}),e.text(`Version ${x}`,a/2,p+34,{align:"center"}),(m==null?void 0:m.includeComplianceBadge)!==false){let E=p+52,u="Compliant with the Nigeria Data Protection Act (NDPA) 2023";e.setFontSize(8.5),e.setFont("helvetica","bold"),e.setTextColor(255,255,255);let d=e.getTextWidth(u),z=7,H=3.5,I=(a-d-z*2)/2;e.setFillColor(22,163,74),e.roundedRect(I,E-H-1,d+z*2,7+H,2,2,"F"),e.text(u,a/2,E+1.5,{align:"center"}),e.setTextColor(0,0,0);}e.setFillColor(22,163,74),e.rect(0,s-12,a,12,"F"),e.addPage(),c=t+8,k();}let N=r.sections.filter(f=>f.included);(m==null?void 0:m.includeTOC)!==false&&(e.setFontSize(18),e.setFont("helvetica","bold"),e.setTextColor(22,163,74),e.text("Table of Contents",t,c+4),e.setDrawColor(22,163,74),e.setLineWidth(.5),e.line(t,c+8,t+80,c+8),c+=18,e.setFontSize(10.5),e.setFont("helvetica","normal"),e.setTextColor(40,40,40),N.forEach((f,P)=>{A(7);let p=`${P+1}. ${f.title}`;e.text(p,t+4,c),c+=6.5;}),e.addPage(),c=t+8,k()),N.forEach((f,P)=>{A(18),e.setFillColor(22,163,74),e.circle(t+3.5,c-1.5,3.8,"F"),e.setFontSize(8),e.setFont("helvetica","bold"),e.setTextColor(255,255,255),e.text(String(P+1),t+3.5,c-.5,{align:"center"}),e.setFontSize(13),e.setFont("helvetica","bold"),e.setTextColor(22,163,74),e.text(f.title,t+11,c),c+=3,e.setDrawColor(200,200,200),e.setLineWidth(.25),e.line(t+11,c,a-t,c),c+=6;let p=(f.template||f.defaultContent||"").trim();if(p){let E=p.split(`
312
- `);e.setFontSize(9.5),e.setFont("helvetica","normal"),e.setTextColor(50,50,50),E.forEach(u=>{let d=u.trimEnd();if(d===""){c+=3;return}let z=d.startsWith("-")||d.startsWith("\u2022"),H=z?t+8:t+4,I=z?d.replace(/^[-•]\s*/,""):d,O=l-(z?12:8);e.splitTextToSize(I,O).forEach((X,Z)=>{A(5),z&&Z===0&&(e.setFillColor(22,163,74),e.circle(t+4,c-1,.9,"F")),e.text(X,H,c),c+=5;});});}c+=10;});let L=e.getNumberOfPages();for(let f=1;f<=L;f++)e.setPage(f),e.setFontSize(7.5),e.setFont("helvetica","normal"),e.setTextColor(160,160,160),e.setDrawColor(220,220,220),e.setLineWidth(.3),e.line(t,s-12,a-t,s-12),e.text(y?`${y} \u2014 Privacy Policy`:"Privacy Policy",t,s-8),e.text(`Page ${f} of ${L}`,a-t,s-8,{align:"right"}),e.setTextColor(0,0,0);return e.setProperties({title:w,author:y,subject:"Privacy Policy \u2014 NDPA 2023 Compliant",keywords:"privacy policy, NDPA, Nigeria, data protection"}),e.output("blob")})}function ne(r,m){return d(this,null,function*(){let v;try{v=yield import('docx');}catch(u){throw new Error('The "docx" package is required for Word export. Install it with: pnpm add docx')}let{Document:e,Paragraph:a,TextRun:s,HeadingLevel:t,Packer:l,Header:c,Footer:y,PageNumber:w,AlignmentType:x,BorderStyle:S,ShadingType:k,TableOfContents:A}=v,N=r.organizationInfo.name||"",L=r.title||"Privacy Policy",D=r.version||"1.0",f=r.effectiveDate?new Date(r.effectiveDate).toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}):new Date().toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"}),P=r.sections.filter(u=>u.included),p=[];if(p.push(new a({children:[new s({text:L,bold:true,size:52,color:"064e3b"})],heading:t.TITLE,spacing:{after:160},alignment:x.CENTER})),p.push(new a({children:[new s({text:`${N}${N?" \u2022 ":""}Version ${D} \u2022 Effective ${f}`,size:20,color:"6b7280",italics:true})],spacing:{after:120},alignment:x.CENTER})),p.push(new a({children:[new s({text:"Compliant with the Nigeria Data Protection Act (NDPA) 2023",size:18,color:"16a34a",bold:true})],spacing:{after:400},alignment:x.CENTER})),p.push(new a({children:[],spacing:{after:200},border:{bottom:{color:"16a34a",style:S.SINGLE,size:6,space:1}}})),(m==null?void 0:m.includeTOC)!==false){if(p.push(new a({children:[new s({text:"Table of Contents",bold:true,size:28,color:"064e3b"})],heading:t.HEADING_1,spacing:{before:400,after:200}})),typeof A=="function")try{p.push(new A("Table of Contents",{hyperlink:!0,headingStyleRange:"1-1"}));}catch(u){P.forEach((d,z)=>{p.push(new a({children:[new s({text:`${z+1}. ${d.title}`,size:22,color:"15803d"})],spacing:{after:80}}));});}else P.forEach((u,d)=>{p.push(new a({children:[new s({text:`${d+1}. ${u.title}`,size:22,color:"15803d"})],spacing:{after:80}}));});p.push(new a({children:[],pageBreakBefore:true}));}P.forEach((u,d)=>{p.push(new a({children:[new s({text:`${d+1}. ${u.title}`,bold:true,size:28,color:"064e3b"})],heading:t.HEADING_1,spacing:{before:400,after:200},border:{bottom:{color:"dcfce7",style:S.SINGLE,size:4,space:1}}}));let z=(u.template||u.defaultContent||"").trim();z&&z.split(`
313
- `).forEach(I=>{let O=I.trimEnd();if(O===""){p.push(new a({children:[],spacing:{after:60}}));return}let B=O.startsWith("- ")||O.startsWith("\u2022 "),X=B?O.replace(/^[-•]\s*/,""):O;B?p.push(new a({children:[new s({text:X,size:22})],spacing:{after:80},bullet:{level:0}})):p.push(new a({children:[new s({text:X,size:22})],spacing:{after:100}}));});}),p.push(new a({children:[new s({text:`Generated by NDPA Toolkit \u2014 ${N}${N?" \u2014 ":""}Privacy Policy v${D}`,size:16,color:"9ca3af",italics:true})],spacing:{before:600},alignment:x.CENTER}));let E=new e({title:L,description:"Privacy Policy \u2014 NDPA 2023 Compliant",styles:{paragraphStyles:[{id:"Normal",name:"Normal",run:{font:"Calibri",size:22}}]},sections:[{headers:{default:new c({children:[new a({children:[new s({text:N||"Privacy Policy",size:16,color:"9ca3af"})],alignment:x.RIGHT})]})},footers:{default:new y({children:[new a({children:[new s({text:"Page ",size:16,color:"9ca3af"}),new s({children:[w.CURRENT],size:16,color:"9ca3af"}),new s({text:" of ",size:16,color:"9ca3af"}),new s({children:[w.TOTAL_PAGES],size:16,color:"9ca3af"})],alignment:x.CENTER})]})},children:p}]});return l.toBlob(E)})}var de=10,pe="ndpr_policy_draft",Re=2e3;function me(){return `section_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function ue(){return `draft_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function U(r,m,v){let e=Date.now();return {id:v,title:`Privacy Policy${r.org.name?` \u2014 ${r.org.name}`:""}`,templateId:"adaptive-policy-wizard",organizationInfo:{name:r.org.name,website:r.org.website,privacyEmail:r.org.privacyEmail,address:r.org.address,dpoName:r.org.dpoName,dpoEmail:r.org.dpoEmail,industry:r.org.industry},sections:m,variableValues:{},effectiveDate:e,lastUpdated:e,version:"1.0",applicableFrameworks:["ndpa","ndpr"]}}function ot(r={}){var ie,ae;let{onComplete:m,onComplianceChange:v}=r,e=useRef((ie=r.adapter)!=null?ie:a(pe));e.current=(ae=r.adapter)!=null?ae:a(pe);let a$2=useRef(ue()),[s,t]=useState(1),[l,c$1]=useState(b),[y,w]=useState([]),[x,S]=useState({}),[k,A]=useState([]),[N,L]=useState(false),[D,f]=useState(null),[P,p]=useState(true),E=useRef(null);useEffect(()=>{let o=false,n=i=>{i&&(a$2.current=i.id,c$1(i.templateContext),w(i.customSections),S(i.sectionOverrides),A(i.sectionOrder),t(i.currentStep),f(i.lastSavedAt),L(true));};try{let i=e.current.load();i instanceof Promise?i.then(h=>{o||(n(h),p(!1));},()=>{o||p(!1);}):(n(i),p(!1));}catch(i){o||p(false);}return ()=>{o=true;}},[]);let u=useMemo(()=>{let n=d$1(l).map(g=>x[g.id]?b$1(a$1({},g),{template:x[g.id]}):g),i=y.map(g=>{var T;return {id:g.id,title:g.title,template:(T=x[g.id])!=null?T:g.content,order:g.order,required:false,included:true}}),h=[...n,...i];if(k.length>0){let g=new Map(k.map((T,$)=>[T,$]));return [...h].sort((T,$)=>{let F=g.has(T.id)?g.get(T.id):h.length,W=g.has($.id)?g.get($.id):h.length;return F-W})}return [...h].sort((g,T)=>{var $,F;return (($=g.order)!=null?$:0)-((F=T.order)!=null?F:0)})},[l,y,x,k]),d$2=useMemo(()=>!l.org.name&&!l.org.privacyEmail?null:U(l,u,a$2.current),[l,u]),z=useMemo(()=>U(b(),[],a$2.current),[]),H=useMemo(()=>c(d$2!=null?d$2:z,l),[d$2,l,z]),I=H.percentage,O=H.gaps,B=useRef({score:-1,gaps:[]});useEffect(()=>{let o=B.current;v&&(I!==o.score||O!==o.gaps)&&v(I,O),B.current={score:I,gaps:O};},[I,O,v]);let X=useMemo(()=>{switch(s){case 1:return l.org.name.trim().length>0&&l.org.privacyEmail.trim().length>0;case 2:return l.dataCategories.some(o=>o.selected);case 3:return l.purposes.length>0;case 4:return true;default:return false}},[s,l]),Z=useCallback(o=>{t(Math.min(Math.max(1,o),4));},[]),fe=useCallback(()=>{t(o=>Math.min(o+1,4));},[]),ge=useCallback(()=>{t(o=>Math.max(o-1,1));},[]),he=useCallback(o=>{c$1(n=>a$1(a$1({},n),o));},[]),ye=useCallback(o=>{c$1(n=>b$1(a$1({},n),{org:a$1(a$1({},n.org),o)}));},[]),ve=useCallback(o=>{c$1(n=>b$1(a$1({},n),{dataCategories:n.dataCategories.map(i=>i.id===o?b$1(a$1({},i),{selected:!i.selected}):i)}));},[]),xe=useCallback(o=>{c$1(n=>{let i=n.purposes.includes(o);return b$1(a$1({},n),{purposes:i?n.purposes.filter(h=>h!==o):[...n.purposes,o]})});},[]),be=useCallback(o=>{c$1(n=>b$1(a$1({},n),{thirdPartyProcessors:[...n.thirdPartyProcessors,o]}));},[]),Pe=useCallback(o=>{c$1(n=>b$1(a$1({},n),{thirdPartyProcessors:n.thirdPartyProcessors.filter((i,h)=>h!==o)}));},[]),we=useCallback(o=>{w(n=>n.length>=de?n:[...n,b$1(a$1({},o),{id:me(),required:false})]);},[]),Ce=useCallback((o,n)=>{w(i=>i.map(h=>h.id===o?a$1(a$1({},h),n):h));},[]),Se=useCallback(o=>{w(n=>n.filter(i=>i.id!==o)),A(n=>n.filter(i=>i!==o)),S(n=>{let i=a$1({},n);return delete i[o],i});},[]),De=useCallback((o,n)=>{A(i=>{let h=i.length>0?i:u.map(F=>F.id),g=h.indexOf(o);if(g===-1){let F=u.map(Le=>Le.id),W=F.indexOf(o);if(W===-1)return i;let Y=n==="up"?W-1:W+1;if(Y<0||Y>=F.length)return F;let j=[...F];return [j[W],j[Y]]=[j[Y],j[W]],j}let T=n==="up"?g-1:g+1;if(T<0||T>=h.length)return h;let $=[...h];return [$[g],$[T]]=[$[T],$[g]],$});},[u]),Te=useCallback((o,n)=>{S(i=>b$1(a$1({},i),{[o]:n}));},[]),Ee=useCallback(o=>{let n=O.find(i=>i.requirementId===o);if(n)switch(n.fixType){case "fill_field":{let h=["data-categories-disclosed"],g=["purpose-of-processing"];h.includes(o)?t(2):g.includes(o)?t(3):(t(1));break}case "add_section":{if(!n.suggestedContent)break;w(i=>i.length>=de?i:[...i,{id:me(),title:n.requirement,content:n.suggestedContent,order:999,required:false}]);break}case "add_content":{if(!n.suggestedContent)break;let i="data-subject-rights";S(h=>{var T,$,F;let g=(F=($=h[i])!=null?$:(T=u.find(W=>W.id===i))==null?void 0:T.template)!=null?F:"";return b$1(a$1({},h),{[i]:`${g}
314
-
315
- ${n.suggestedContent}`.trim()})});break}}},[O,u]),V=useCallback(o=>({id:a$2.current,templateContext:l,customSections:y,sectionOverrides:x,sectionOrder:k,currentStep:o,lastSavedAt:Date.now(),status:"draft"}),[l,y,x,k]),$e=useCallback(()=>d(null,null,function*(){let o=V(s);try{yield Promise.resolve(e.current.save(o)),f(o.lastSavedAt),L(!0);}catch(n){console.warn("[ndpr-toolkit] Failed to save draft:",n);}}),[V,s]),ze=useCallback(()=>{Promise.resolve(e.current.remove()).catch(o=>{console.warn("[ndpr-toolkit] Failed to remove draft:",o);}),a$2.current=ue(),c$1(b()),w([]),S({}),A([]),t(1),L(false),f(null);},[]);useEffect(()=>{if(!P)return E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{let o=V(s);Promise.resolve(e.current.save(o)).then(()=>{f(o.lastSavedAt),L(true);}).catch(n=>{console.warn("[ndpr-toolkit] Auto-save failed:",n);});},Re),()=>{E.current&&clearTimeout(E.current);}},[l,y,x,k,s,P,V]),useEffect(()=>{s===4&&d$2&&m&&m(d$2);},[s,d$2,m]);let Oe=useCallback(o=>d(null,null,function*(){let n=d$2!=null?d$2:U(l,u,a$2.current);return re(n,o)}),[d$2,l,u]),Fe=useCallback(o=>d(null,null,function*(){let n=d$2!=null?d$2:U(l,u,a$2.current);return ne(n,o)}),[d$2,l,u]),ke=useCallback(o=>{let n=d$2!=null?d$2:U(l,u,a$2.current);return te(n,o)},[d$2,l,u]),Ae=useCallback(()=>{let o=d$2!=null?d$2:U(l,u,a$2.current);return oe(o)},[d$2,l,u]);return {currentStep:s,goToStep:Z,nextStep:fe,prevStep:ge,canProceed:X,context:l,updateContext:he,updateOrg:ye,toggleDataCategory:ve,togglePurpose:xe,addProcessor:be,removeProcessor:Pe,policy:d$2,sections:u,customSections:y,addCustomSection:we,updateCustomSection:Ce,removeCustomSection:Se,reorderSections:De,editSectionContent:Te,sectionOverrides:x,complianceScore:I,complianceResult:H,complianceGaps:O,applyFix:Ee,handleExportPDF:Oe,handleExportDOCX:Fe,handleExportHTML:ke,handleExportMarkdown:Ae,isDraftSaved:N,lastSavedAt:D,saveDraft:$e,discardDraft:ze,isLoading:P}}export{te as a,oe as b,re as c,ne as d,ot as e};//# sourceMappingURL=chunk-TKBZRULW.mjs.map
316
- //# sourceMappingURL=chunk-TKBZRULW.mjs.map
@@ -1,2 +0,0 @@
1
- import {a as a$1,c}from'./chunk-WWT2ZSNU.mjs';import {createContext,useMemo,useContext}from'react';import {jsx}from'react/jsx-runtime';var a={consent:{title:"We Value Your Privacy",description:"We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",acceptAll:"Accept All",rejectAll:"Reject All",customize:"Customize",savePreferences:"Save Preferences",selectAll:"Select All",deselectAll:"Deselect All",required:"Required",cookieNotice:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'},dsr:{title:"Submit a Data Subject Request",description:"Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",submitRequest:"Submit Request",reset:"Reset",fullName:"Full Name",email:"Email Address",phone:"Phone Number (Optional)",requestType:"Request Type",additionalInfo:"Additional Information",identityVerification:"Identity Verification",identifierType:"Identifier Type",identifierValue:"Identifier Value",privacyNotice:"The information you provide in this form will be used solely for the purpose of processing your data subject request.",successMessage:"Your request has been submitted successfully."},breach:{title:"Report a Data Breach",description:"Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40.",submitReport:"Submit Report",breachTitle:"Breach Title/Summary",category:"Category",discoveredAt:"Date Discovered",detailedDescription:"Detailed Description"},dpia:{title:"Data Protection Impact Assessment",next:"Next",previous:"Previous",complete:"Complete Assessment",progress:"Progress"},policy:{title:"Privacy Policy Generator",generate:"Generate Policy",preview:"Preview",export:"Export",sections:"Sections",variables:"Variables"},compliance:{score:"Compliance Score",excellent:"Excellent",good:"Good",needsWork:"Needs Work",critical:"Critical",recommendations:"Recommendations",passed:"Passed",gaps:"Gaps"},common:{loading:"Loading...",error:"An error occurred",save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",add:"Add",back:"Back",next:"Next",search:"Search",noResults:"No results found"}};function d(t){if(!t)return a;let e=a$1({},a);for(let r of Object.keys(t))t[r]&&(e[r]=a$1(a$1({},a[r]),t[r]));return e}var s=createContext({}),v=r=>{var c$1=r,{children:t}=c$1,e=c(c$1,["children"]);let n=useMemo(()=>{if(!e.theme)return;let o={};return e.theme.primary&&(o["--ndpr-primary"]=e.theme.primary),e.theme.primaryHover&&(o["--ndpr-primary-hover"]=e.theme.primaryHover),e.theme.primaryForeground&&(o["--ndpr-primary-foreground"]=e.theme.primaryForeground),Object.keys(o).length>0?o:void 0},[e.theme]);return jsx(s.Provider,{value:e,children:n?jsx("div",{style:n,children:t}):t})};function A(){return useContext(s)}function b(){let{locale:t}=useContext(s);return useMemo(()=>d(t),[t])}export{a,d as b,v as c,A as d,b as e};//# sourceMappingURL=chunk-TVW6KBVV.mjs.map
2
- //# sourceMappingURL=chunk-TVW6KBVV.mjs.map
@@ -1,72 +0,0 @@
1
- 'use strict';var chunkRYZEIDNR_js=require('./chunk-RYZEIDNR.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var ve=({breachData:g,initialAssessment:u={},onComplete:k,title:V="Breach Risk Assessment",description:Y="Assess the risk level of this data breach to determine notification requirements under NDPA Section 40.",submitButtonText:J="Complete Assessment",className:ee="",buttonClassName:_="",classNames:h={},unstyled:d=false,showBreachSummary:l=true,showNotificationRequirements:R=true})=>{let[L,te]=react.useState(u.confidentialityImpact||3),[$,v]=react.useState(u.integrityImpact||3),[D,C]=react.useState(u.availabilityImpact||3),[j,B]=react.useState(u.harmLikelihood||3),[q,P]=react.useState(u.harmSeverity||3),[U,E]=react.useState(u.risksToRightsAndFreedoms!==void 0?u.risksToRightsAndFreedoms:false),[H,M]=react.useState(u.highRisksToRightsAndFreedoms!==void 0?u.highRisksToRightsAndFreedoms:false),[K,ae]=react.useState(u.justification||""),[W,se]=react.useState(0),[w,f]=react.useState("low"),[x,b]=react.useState(false),[y,Z]=react.useState(0),[O,Q]=react.useState(0),[p,S]=react.useState(false);react.useEffect(()=>{let X=L*.2+$*.1+D*.1+j*.3+q*.3;se(Number(X.toFixed(1)));let F;X<2?F="low":X<3?F="medium":X<4?F="high":F="critical",f(F),b(U||F==="high"||F==="critical");let ne=g.discoveredAt+4320*60*1e3;Z(ne);let ce=Date.now(),pe=(ne-ce)/(3600*1e3);Q(Number(pe.toFixed(1)));},[L,$,D,j,q,U,g.discoveredAt]);let ie=o=>new Date(o).toLocaleString(),re=o=>{o.preventDefault();let N={id:u.id||`assessment_${Date.now()}`,breachId:g.id,assessedAt:Date.now(),assessor:u.assessor||{name:"Assessment User",role:"Data Protection Officer",email:"dpo@example.com"},confidentialityImpact:L,integrityImpact:$,availabilityImpact:D,harmLikelihood:j,harmSeverity:q,overallRiskScore:W,riskLevel:w,risksToRightsAndFreedoms:U,highRisksToRightsAndFreedoms:H,justification:K};k(N),S(true);},s=o=>{switch(o){case 1:return "Minimal";case 2:return "Low";case 3:return "Moderate";case 4:return "High";case 5:return "Severe";default:return "Unknown"}},c=o=>jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[o]}`,h.riskBadge,d),children:o.charAt(0).toUpperCase()+o.slice(1)});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ee}`,h.root,d),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",h.title,d),children:V}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:Y}),l&&jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-2",children:"Breach Summary"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Title:"})," ",g.title]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Discovered:"})," ",ie(g.discoveredAt)]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",g.status.charAt(0).toUpperCase()+g.status.slice(1)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Types:"})," ",g.dataTypes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",g.affectedSystems.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",g.estimatedAffectedSubjects||"Unknown"]})]})]})]}),p?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Assessment Results"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Overall Risk Level:"})," ",c(w)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Score:"})," ",W," / 5"]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Assessed On:"})," ",ie(Date.now())]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",U?"Yes":"No"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",H?"Yes":"No"]})]})]}),jsxRuntime.jsxs("div",{className:"mt-3",children:[jsxRuntime.jsx("p",{className:"text-sm mb-1",children:jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})}),jsxRuntime.jsx("p",{className:"text-sm bg-white dark:bg-gray-800 p-2 rounded",children:K})]})]}),R&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`mb-6 p-4 rounded-md ${x?O>24?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20":"bg-green-50 dark:bg-green-900/20"}`,h.notificationStatus,d),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Requirements"}),x?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:`text-sm font-bold mb-2 ${O>24?"text-yellow-800 dark:text-yellow-200":"text-red-800 dark:text-red-200"}`,children:"NDPC Notification Required"}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"Under the NDPA (Section 40), this breach must be reported to the NDPC within 72 hours of discovery."}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notification Deadline:"})," ",ie(y)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Time Remaining:"})," ",jsxRuntime.jsx("span",{className:O<24?"text-red-600 dark:text-red-400 font-bold":"",children:O>0?`${O} hours`:"Deadline passed"})]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subject Notification:"})," ",H?"Required (NDPA Section 40(4))":"Not required unless directed by NDPC"]})]}):jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-bold mb-2 text-green-800 dark:text-green-200",children:"NDPC Notification Not Required"}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"Based on this assessment, this breach does not need to be reported to the NDPC."}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"However, the breach should still be documented internally for compliance purposes."})]}),jsxRuntime.jsxs("div",{className:"mt-3 text-sm",children:[jsxRuntime.jsx("p",{className:"font-medium",children:"Next Steps:"}),jsxRuntime.jsx("ul",{className:"list-disc pl-5 mt-1",children:x?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("li",{children:"Prepare a notification report for the NDPC"}),jsxRuntime.jsx("li",{children:"Document all aspects of the breach and your response"}),H&&jsxRuntime.jsx("li",{children:"Prepare communications for affected data subjects"}),jsxRuntime.jsx("li",{children:"Implement measures to mitigate the impact of the breach"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("li",{children:"Document the breach and this assessment in your internal records"}),jsxRuntime.jsx("li",{children:"Implement measures to prevent similar breaches in the future"}),jsxRuntime.jsx("li",{children:"Review and update security measures as needed"})]})})]})]}),jsxRuntime.jsx("button",{onClick:()=>S(false),className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${_}`,h.primaryButton||h.submitButton,d),children:"Edit Assessment"})]}):jsxRuntime.jsx("form",{onSubmit:re,children:jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Assessment"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"confidentialityImpact",className:"block text-sm font-medium mb-1",children:["Confidentiality Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the confidentiality of data been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"confidentialityImpact",min:"1",max:"5",step:"1",value:L,onChange:o=>te(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",h.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(L)," (",L,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"integrityImpact",className:"block text-sm font-medium mb-1",children:["Integrity Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the integrity of data been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"integrityImpact",min:"1",max:"5",step:"1",value:$,onChange:o=>v(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",h.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s($)," (",$,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"availabilityImpact",className:"block text-sm font-medium mb-1",children:["Availability Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the availability of data or systems been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"availabilityImpact",min:"1",max:"5",step:"1",value:D,onChange:o=>C(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",h.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(D)," (",D,")"]})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Risk to Data Subjects"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"harmLikelihood",className:"block text-sm font-medium mb-1",children:["Likelihood of Harm (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How likely is it that data subjects will experience harm?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"harmLikelihood",min:"1",max:"5",step:"1",value:j,onChange:o=>B(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",h.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(j)," (",j,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"harmSeverity",className:"block text-sm font-medium mb-1",children:["Severity of Harm (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How severe would the harm be to affected data subjects?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"harmSeverity",min:"1",max:"5",step:"1",value:q,onChange:o=>P(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",h.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(q)," (",q,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"risksToRightsAndFreedoms",checked:U,onChange:o=>E(o.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"risksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a risk to the rights and freedoms of data subjects"})]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40), breaches that pose a risk to rights and freedoms must be reported to the NDPC within 72 hours."})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"highRisksToRightsAndFreedoms",checked:H,onChange:o=>M(o.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"highRisksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a high risk to the rights and freedoms of data subjects"})]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40(4)), breaches that pose a high risk to rights and freedoms also require notification to affected data subjects without undue delay."})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Overall Assessment"}),jsxRuntime.jsxs("div",{className:"mb-4 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Overall Risk Score:"}),jsxRuntime.jsxs("span",{className:chunkE64TU6IU_js.a("",h.riskScore,d),children:[W," / 5"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Level:"}),c(w)]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:["Justification for Assessment ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"justification",value:K,onChange:o=>ae(o.target.value),rows:4,placeholder:"Explain the reasoning behind your assessment, including any factors that influenced your decision.",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true})]})]}),jsxRuntime.jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This assessment will determine if notification is required for this breach."})]}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{type:"submit",className:chunkE64TU6IU_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${_}`,h.primaryButton||h.submitButton,d),children:J})})]})})]})};var Ce=({breachReports:g,riskAssessments:u,regulatoryNotifications:k,onSelectBreach:V,onRequestAssessment:Y,onRequestNotification:J,title:ee="Breach Notification Manager",description:_="Manage data breach notifications and track compliance with NDPA Section 40 requirements.",className:h="",buttonClassName:d="",classNames:l={},unstyled:R=false,showBreachDetails:L=true,showNotificationTimeline:te=true,showDeadlineAlerts:$=true})=>{var re;let[v,D]=react.useState(null),[C,j]=react.useState(g),[B,q]=react.useState("all"),[P,U]=react.useState(""),[E,H]=react.useState("discoveredAt"),[M,K]=react.useState("desc");react.useEffect(()=>{let s=[...g];if(B!=="all"&&(s=s.filter(c=>c.status===B)),P){let c=P.toLowerCase();s=s.filter(o=>o.title.toLowerCase().includes(c)||o.description.toLowerCase().includes(c)||o.affectedSystems.some(N=>N.toLowerCase().includes(c))||o.dataTypes.some(N=>N.toLowerCase().includes(c)));}s.sort((c,o)=>{let N=0;switch(E){case "title":N=c.title.localeCompare(o.title);break;case "discoveredAt":N=c.discoveredAt-o.discoveredAt;break;case "status":N=c.status.localeCompare(o.status);break;case "riskLevel":let I=u.find(F=>F.breachId===c.id),T=u.find(F=>F.breachId===o.id),oe=(I==null?void 0:I.riskLevel)||"unknown",X=(T==null?void 0:T.riskLevel)||"unknown";N=oe.localeCompare(X);break;default:N=c.discoveredAt-o.discoveredAt;}return M==="asc"?N:-N}),j(s);},[g,B,P,E,M,u]),react.useEffect(()=>{C.length>0&&!v&&D(C[0].id);},[C,v]);let ae=s=>{D(s),V&&V(s);},W=()=>{v&&Y&&Y(v);},se=()=>{v&&J&&J(v);},w=s=>new Date(s).toLocaleString(),f=v?g.find(s=>s.id===v):null,x=v?u.find(s=>s.breachId===v):null,b=v?k.find(s=>s.breachId===v):null,y=f?Z(f,x):null;function Z(s,c){let o=chunkRYZEIDNR_js.a(s,c||void 0),N=s.discoveredAt+o.timeframeHours*60*60*1e3;return {ndpcNotificationRequired:o.notificationRequired,ndpcNotificationDeadline:N,dataSubjectNotificationRequired:(c==null?void 0:c.highRisksToRightsAndFreedoms)||false,justification:o.justification}}function O(s){let c=Date.now(),o=(s-c)/(3600*1e3);return Number(o.toFixed(1))}let Q=s=>s?jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[s]}`,l.statusBadge,R),children:s.charAt(0).toUpperCase()+s.slice(1)}):null,p=s=>jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{ongoing:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",contained:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",resolved:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"}[s]||"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200"}`,l.statusBadge,R),children:s.charAt(0).toUpperCase()+s.slice(1)}),S=()=>{if(!f||!y)return null;if(!y.ndpcNotificationRequired)return jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Not Required"}),jsxRuntime.jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"Based on the risk assessment, NDPC notification is not required for this breach."})]});if(b)return jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Sent"}),jsxRuntime.jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:["Notification was sent to the NDPC on ",w(b.sentAt),"."]})]});let s=O(y.ndpcNotificationDeadline);return s<=0?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Notification Deadline Passed"}),jsxRuntime.jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The 72-hour deadline for NDPC notification has passed. Notification should be sent immediately."})]}):s<=24?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Notification Due Soon"}),jsxRuntime.jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",s," hours remaining until the NDPC notification deadline."]})]}):jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Notification Required"}),jsxRuntime.jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:["NDPC notification is required by ",w(y.ndpcNotificationDeadline)," (",s," hours remaining)."]})]})},ie=()=>{if(!f)return null;let s=[{title:"Breach Discovered",date:f.discoveredAt,completed:true,description:`Breach was discovered on ${w(f.discoveredAt)}.`},{title:"Risk Assessment",date:x==null?void 0:x.assessedAt,completed:!!x,description:x?`Risk assessment completed on ${w(x.assessedAt)}.`:"Risk assessment has not been completed yet."}];return y!=null&&y.ndpcNotificationRequired&&s.push({title:"NDPC Notification",date:b==null?void 0:b.sentAt,completed:!!b,description:b?`Notification sent to the NDPC on ${w(b.sentAt)}.`:`Notification must be sent to the NDPC by ${w(y.ndpcNotificationDeadline)}.`}),y!=null&&y.dataSubjectNotificationRequired&&s.push({title:"Data Subject Notification",date:void 0,completed:false,description:"Notification to affected data subjects is required but has not been sent yet."}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-6",l.timeline,R),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Notification Timeline"}),jsxRuntime.jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:s.map((c,o)=>jsxRuntime.jsxs("li",{className:chunkE64TU6IU_js.a("mb-6 ml-4",l.timelineStep,R),children:[jsxRuntime.jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${c.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsxRuntime.jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-600 dark:text-gray-500",children:c.date?w(c.date):"Pending"}),jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:c.title}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:c.description})]},o))})]})};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${h}`,l.root,R),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",l.header,R),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",l.title,R),children:ee}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:_})]}),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxRuntime.jsxs("select",{id:"statusFilter",value:B,onChange:s=>q(s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),jsxRuntime.jsx("option",{value:"ongoing",children:"Ongoing"}),jsxRuntime.jsx("option",{value:"contained",children:"Contained"}),jsxRuntime.jsx("option",{value:"resolved",children:"Resolved"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxRuntime.jsxs("select",{id:"sortBy",value:E,onChange:s=>H(s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"discoveredAt",children:"Discovery Date"}),jsxRuntime.jsx("option",{value:"title",children:"Title"}),jsxRuntime.jsx("option",{value:"status",children:"Status"}),jsxRuntime.jsx("option",{value:"riskLevel",children:"Risk Level"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"searchTerm",value:P,onChange:s=>U(s.target.value),placeholder:"Search breaches...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxRuntime.jsxs("div",{className:"md:col-span-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Breach Reports"}),C.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No breach reports found."}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",l.breachList,R),children:C.map(s=>{let c=u.find(T=>T.breachId===s.id),o=k.find(T=>T.breachId===s.id),N=Z(s,c),I=null;if(N!=null&&N.ndpcNotificationRequired)if(o)I=jsxRuntime.jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Notified"});else {let T=O(N.ndpcNotificationDeadline);T<=0?I=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):T<=24?I=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):I=jsxRuntime.jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Required"});}else I=jsxRuntime.jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Not Required"});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md cursor-pointer ${v===s.id?"bg-[rgb(var(--ndpr-primary)/0.05)] dark:bg-[rgb(var(--ndpr-primary)/0.1)] border border-[rgb(var(--ndpr-primary)/0.2)] dark:border-[rgb(var(--ndpr-primary)/0.3)]":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,l.breachItem,R),onClick:()=>ae(s.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:s.title}),p(s.status)]}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:["Discovered: ",new Date(s.discoveredAt).toLocaleDateString()]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsxRuntime.jsx("div",{children:c&&Q(c.riskLevel)}),jsxRuntime.jsx("div",{children:I})]})]},s.id)})})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("md:col-span-2",l.detailPanel,R),children:f?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:f.title}),p(f.status)]}),$&&jsxRuntime.jsx("div",{className:"mb-4",children:S()}),L&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Discovered:"})," ",w(f.discoveredAt)]}),f.occurredAt&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Occurred:"})," ",w(f.occurredAt)]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reporter:"})," ",f.reporter.name]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",f.affectedSystems.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Types:"})," ",f.dataTypes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",f.estimatedAffectedSubjects||"Unknown"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Description:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:f.description})]}),f.initialActions&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Initial Actions Taken:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:f.initialActions})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Risk Assessment"}),x?jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Risk Level:"}),Q(x.riskLevel)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Score:"})," ",x.overallRiskScore," / 5"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",x.risksToRightsAndFreedoms?"Yes":"No"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",x.highRisksToRightsAndFreedoms?"Yes":"No"]}),jsxRuntime.jsx("p",{className:"text-sm mb-1",children:jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300 bg-white dark:bg-gray-800 p-2 rounded-md",children:x.justification})]}):jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"Risk assessment has not been conducted yet."}),jsxRuntime.jsx("button",{onClick:W,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${d}`,children:"Conduct Risk Assessment"})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Status"}),b?jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notification Sent:"})," ",w(b.sentAt)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Method:"})," ",b.method.charAt(0).toUpperCase()+b.method.slice(1)]}),b.referenceNumber&&jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference Number:"})," ",b.referenceNumber]}),(b.ndpcContact||b.nitdaContact)&&jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"NDPC Contact:"})," ",(re=b.ndpcContact||b.nitdaContact)==null?void 0:re.name]})]}):jsxRuntime.jsx("div",{children:y!=null&&y.ndpcNotificationRequired?jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"NDPC notification is required but has not been sent yet."}),jsxRuntime.jsx("button",{onClick:se,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${d}`,children:"Generate Notification"})]}):jsxRuntime.jsx("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:"NDPC notification is not required for this breach."})})})]}),te&&ie()]}):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Select a breach to view details"})})})]})]})};var Te=({breachData:g,assessmentData:u,organizationInfo:k,onGenerate:V,title:Y="Generate NDPC Notification Report",description:J="Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements.",generateButtonText:ee="Generate Report",className:_="",buttonClassName:h="",classNames:d={},unstyled:l=false,showPreview:R=true,allowEditing:L=true,allowDownload:te=true,downloadFormat:$="pdf"})=>{let[v,D]=react.useState(""),[C,j]=react.useState(""),[B,q]=react.useState(""),[P,U]=react.useState(""),[E,H]=react.useState("email"),[M,K]=react.useState(""),[ae,W]=react.useState(""),[se,w]=react.useState(false),[f,x]=react.useState(false);react.useEffect(()=>{if(!se){let p=y();D(p),w(true);}},[g,u,k]);let b=p=>new Date(p).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),y=()=>`
2
- NDPC DATA BREACH NOTIFICATION
3
-
4
- Date: ${new Date().toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})}
5
-
6
- Reference: NDPA Section 40 - Breach Notification
7
-
8
- ORGANIZATION DETAILS
9
- -------------------
10
- Organization Name: ${k.name}
11
- ${k.registrationNumber?`Registration Number: ${k.registrationNumber}`:""}
12
- Address: ${k.address}
13
- ${k.website?`Website: ${k.website}`:""}
14
-
15
- DATA PROTECTION OFFICER
16
- ----------------------
17
- Name: ${k.dpoName}
18
- Email: ${k.dpoEmail}
19
- ${k.dpoPhone?`Phone: ${k.dpoPhone}`:""}
20
-
21
- BREACH DETAILS
22
- -------------
23
- Breach Title: ${g.title}
24
- Date Discovered: ${b(g.discoveredAt)}
25
- ${g.occurredAt?`Date Occurred: ${b(g.occurredAt)}`:"Date Occurred: Unknown"}
26
- Status: ${g.status.charAt(0).toUpperCase()+g.status.slice(1)}
27
-
28
- Description of the Breach:
29
- ${g.description}
30
-
31
- Affected Systems/Applications:
32
- ${g.affectedSystems.join(", ")}
33
-
34
- Types of Personal Data Involved:
35
- ${g.dataTypes.join(", ")}
36
-
37
- Estimated Number of Data Subjects Affected:
38
- ${g.estimatedAffectedSubjects||"Unknown"}
39
-
40
- RISK ASSESSMENT
41
- --------------
42
- ${u?`
43
- Overall Risk Level: ${u.riskLevel.charAt(0).toUpperCase()+u.riskLevel.slice(1)}
44
- Risk to Rights and Freedoms of Data Subjects: ${u.risksToRightsAndFreedoms?"Yes":"No"}
45
- High Risk to Rights and Freedoms of Data Subjects: ${u.highRisksToRightsAndFreedoms?"Yes":"No"}
46
-
47
- Justification for Risk Assessment:
48
- ${u.justification}
49
- `:"Risk assessment has not been conducted yet."}
50
-
51
- MEASURES TAKEN
52
- -------------
53
- Measures taken or proposed to address the breach:
54
- ${g.initialActions||"To be determined"}
55
-
56
- Measures taken or proposed to mitigate possible adverse effects:
57
- [Please specify measures taken to mitigate adverse effects]
58
-
59
- NOTIFICATION TO DATA SUBJECTS (NDPA Section 40(4))
60
- ----------------------------
61
- Have data subjects been notified: [Yes/No]
62
- If yes, date of notification: [Date]
63
- If no, planned date of notification: [Date]
64
- Reason for delay (if applicable): [Reason]
65
-
66
- ADDITIONAL INFORMATION
67
- ---------------------
68
- [Any additional information relevant to the breach]
69
-
70
- This notification is made in compliance with the Nigeria Data Protection Act (NDPA), Section 40.
71
- `,Z=p=>{p.preventDefault();let S={id:`notification_${Date.now()}`,breachId:g.id,sentAt:Date.now(),method:E,referenceNumber:M||void 0,ndpcContact:C?{name:C,email:B,phone:P||void 0}:void 0,content:v,attachments:[]};V(S),x(true);},O=()=>{let p=document.createElement("a"),S=new Blob([v],{type:"text/plain"});p.href=URL.createObjectURL(S),p.download=`NDPC_Breach_Notification_${new Date().toISOString().split("T")[0]}.txt`,document.body.appendChild(p),p.click(),document.body.removeChild(p);},Q=()=>[{value:"email",label:"Email"},{value:"portal",label:"NDPC Portal"},{value:"letter",label:"Formal Letter"},{value:"other",label:"Other"}].map(S=>jsxRuntime.jsx("option",{value:S.value,children:S.label},S.value));return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${_}`,d.root,l),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",d.header,l),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",d.title,l),children:Y}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:J})]}),f?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-green-50 dark:bg-green-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Generated Successfully"}),jsxRuntime.jsx("p",{className:"text-green-700 dark:text-green-300",children:"Your NDPC notification report has been generated and is ready for submission. Please review the report carefully before submitting it to the NDPC."})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Submission Details"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Method:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:E.charAt(0).toUpperCase()+E.slice(1)})]}),C&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Contact Name:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:C})]}),B&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Contact Email:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:B})]}),P&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Contact Phone:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:P})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Date Generated:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:b(Date.now())})]}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Breach ID:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:g.id})]}),M&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Reference Number:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:M})]})]})]})]}),R&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Preview"}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("bg-gray-50 dark:bg-gray-700 p-4 rounded-md",d.reportPreview,l),children:jsxRuntime.jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:v})})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-3",children:[te&&jsxRuntime.jsxs("button",{onClick:O,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${h}`,d.secondaryButton||d.downloadButton,l),children:["Download Report (",$.toUpperCase(),")"]}),jsxRuntime.jsx("button",{onClick:()=>x(false),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${h}`,children:"Edit Report"})]})]}):jsxRuntime.jsx("form",{onSubmit:Z,children:jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Notification Method"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"method",className:"block text-sm font-medium mb-1",children:["Method of Submission ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("select",{id:"method",value:E,onChange:p=>H(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,children:Q()})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"referenceNumber",className:"block text-sm font-medium mb-1",children:"Reference Number (if available)"}),jsxRuntime.jsx("input",{type:"text",id:"referenceNumber",value:M,onChange:p=>K(p.target.value),placeholder:"e.g. NDPC/BR/2024/001",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"NDPC Contact (if known)"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactName",className:"block text-sm font-medium mb-1",children:"Contact Name"}),jsxRuntime.jsx("input",{type:"text",id:"contactName",value:C,onChange:p=>j(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactEmail",className:"block text-sm font-medium mb-1",children:"Contact Email"}),jsxRuntime.jsx("input",{type:"email",id:"contactEmail",value:B,onChange:p=>q(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactPhone",className:"block text-sm font-medium mb-1",children:"Contact Phone"}),jsxRuntime.jsx("input",{type:"tel",id:"contactPhone",value:P,onChange:p=>U(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"additionalInfo",className:"block text-sm font-medium mb-1",children:"Additional Information to Include"}),jsxRuntime.jsx("textarea",{id:"additionalInfo",value:ae,onChange:p=>W(p.target.value),rows:3,placeholder:"Any additional information you want to include in the report",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),L&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Content"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reportContent",className:"block text-sm font-medium mb-1",children:["Edit Report Content ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"reportContent",value:v,onChange:p=>D(p.target.value),rows:20,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] font-mono text-sm",required:true})]})]}),jsxRuntime.jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This report will help you comply with this requirement."})]}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{type:"submit",className:chunkE64TU6IU_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${h}`,d.primaryButton||d.generateButton,l),children:ee})})]})})]})};exports.a=ve;exports.b=Ce;exports.c=Te;//# sourceMappingURL=chunk-U6VWHC46.js.map
72
- //# sourceMappingURL=chunk-U6VWHC46.js.map
@@ -1,2 +0,0 @@
1
- 'use strict';function r(t){return {load(){if(typeof window=="undefined")return null;try{let e=localStorage.getItem(t);return e?JSON.parse(e):null}catch(e){return null}},save(e){typeof window!="undefined"&&localStorage.setItem(t,JSON.stringify(e));},remove(){typeof window!="undefined"&&localStorage.removeItem(t);}}}exports.a=r;//# sourceMappingURL=chunk-UK656RCG.js.map
2
- //# sourceMappingURL=chunk-UK656RCG.js.map
@@ -1,2 +0,0 @@
1
- 'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),jsxRuntime=require('react/jsx-runtime');var T=({sections:o,answers:p,onAnswerChange:n,currentSectionIndex:g,onNextSection:k,onPrevSection:h,validationErrors:N={},readOnly:i=false,className:w="",buttonClassName:y="",nextButtonText:$="Next",prevButtonText:P="Previous",submitButtonText:B="Submit",showProgress:A=true,progress:u,classNames:v={},unstyled:C=false})=>{let c=o[g],D=g===o.length-1,l=(e,s)=>{let r=s?v[s]:void 0;return !r&&s==="nextButton"&&(r=v.primaryButton),!r&&s==="prevButton"&&(r=v.secondaryButton),chunkE64TU6IU_js.a(e,r,C)},I=e=>e.showWhen?e.showWhen.every(s=>{let r=p[s.questionId];switch(s.operator){case "equals":return r===s.value;case "contains":return Array.isArray(r)?r.includes(s.value):false;case "greaterThan":return typeof r=="number"?r>s.value:false;case "lessThan":return typeof r=="number"?r<s.value:false;default:return true}}):true,m=e=>l(`w-full px-3 py-2 border rounded-md ${e?"border-red-500":"border-gray-300 dark:border-gray-600"} focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100`,"input"),Q=e=>{if(!I(e))return null;let s=N[e.id],r=p[e.id];return jsxRuntime.jsxs("div",{className:l("mb-6","question"),children:[jsxRuntime.jsxs("div",{className:"mb-2",children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:l("block text-sm font-medium text-gray-900 dark:text-gray-100","questionText"),children:[e.text,e.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),e.guidance&&jsxRuntime.jsx("p",{className:l("mt-1 text-sm text-gray-600 dark:text-gray-400","guidance"),children:e.guidance})]}),e.type==="text"&&jsxRuntime.jsx("input",{type:"text",id:e.id,value:r||"",onChange:a=>n(e.id,a.target.value),disabled:i,className:m(s)}),e.type==="textarea"&&jsxRuntime.jsx("textarea",{id:e.id,value:r||"",onChange:a=>n(e.id,a.target.value),disabled:i,rows:4,className:m(s)}),e.type==="select"&&e.options&&jsxRuntime.jsxs("select",{id:e.id,value:r||"",onChange:a=>n(e.id,a.target.value),disabled:i,className:m(s),children:[jsxRuntime.jsx("option",{value:"",children:"Select an option"}),e.options.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))]}),e.type==="radio"&&e.options&&jsxRuntime.jsx("div",{className:l("space-y-2","radioGroup"),children:e.options.map(a=>jsxRuntime.jsxs("div",{className:l("flex items-center","radioOption"),children:[jsxRuntime.jsx("input",{type:"radio",id:`${e.id}_${a.value}`,name:e.id,value:a.value,checked:r===a.value,onChange:()=>n(e.id,a.value),disabled:i,className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] border-gray-300 dark:border-gray-600"}),jsxRuntime.jsxs("label",{htmlFor:`${e.id}_${a.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:[a.label,a.riskLevel&&jsxRuntime.jsxs("span",{className:`ml-2 text-xs px-2 py-1 rounded ${a.riskLevel==="low"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":a.riskLevel==="medium"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:[a.riskLevel.charAt(0).toUpperCase()+a.riskLevel.slice(1)," Risk"]})]})]},a.value))}),e.type==="checkbox"&&e.options&&jsxRuntime.jsx("div",{className:"space-y-2",children:e.options.map(a=>jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"checkbox",id:`${e.id}_${a.value}`,value:a.value,checked:Array.isArray(r)?r.includes(a.value):false,onChange:b=>{let x=Array.isArray(r)?[...r]:[];b.target.checked?n(e.id,[...x,a.value]):n(e.id,x.filter(L=>L!==a.value));},disabled:i,className:"h-4 w-4 rounded text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] border-gray-300 dark:border-gray-600"}),jsxRuntime.jsx("label",{htmlFor:`${e.id}_${a.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:a.label})]},a.value))}),e.type==="scale"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"flex justify-between mb-2",children:e.scaleLabels&&Object.entries(e.scaleLabels).map(([a,b])=>jsxRuntime.jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 text-center",style:{width:`${100/Object.keys(e.scaleLabels||{}).length}%`},children:b},a))}),jsxRuntime.jsx("input",{type:"range",id:e.id,min:e.minValue||1,max:e.maxValue||5,value:r||e.minValue||1,onChange:a=>n(e.id,parseInt(a.target.value,10)),disabled:i,className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"}),jsxRuntime.jsxs("div",{className:"mt-1 text-sm text-gray-600 dark:text-gray-400 text-center",children:["Selected value: ",r||e.minValue||1]})]}),s&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:s})]},e.id)};return c?jsxRuntime.jsxs("div",{className:`${l("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6","root")} ${w}`,children:[A&&jsxRuntime.jsxs("div",{className:l("mb-6","header"),children:[jsxRuntime.jsxs("div",{className:"flex justify-between text-sm text-gray-600 dark:text-gray-400 mb-1",children:[jsxRuntime.jsxs("span",{children:["Section ",g+1," of ",o.length]}),jsxRuntime.jsx("span",{children:u!==void 0?`${u}% Complete`:""})]}),jsxRuntime.jsx("div",{className:l("w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700","progressBar"),children:jsxRuntime.jsx("div",{className:"bg-[rgb(var(--ndpr-primary))] h-2.5 rounded-full",style:{width:`${u!==void 0?u:(g+1)/o.length*100}%`}})})]}),jsxRuntime.jsx("h2",{className:l("text-xl font-bold mb-2 text-gray-900 dark:text-white","title"),children:c.title}),c.description&&jsxRuntime.jsx("p",{className:l("mb-6 text-gray-600 dark:text-gray-300","sectionTitle"),children:c.description}),jsxRuntime.jsx("div",{className:l("space-y-6","section"),children:c.questions.map(e=>Q(e))}),jsxRuntime.jsxs("div",{className:l("mt-8 flex justify-between","navigation"),children:[jsxRuntime.jsx("button",{type:"button",onClick:h,disabled:g===0||i,className:`${l("px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed","prevButton")} ${y}`,children:P}),jsxRuntime.jsx("button",{type:"button",onClick:k,disabled:i,className:`${l("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] disabled:opacity-50 disabled:cursor-not-allowed","nextButton")} ${y}`,children:D?B:$})]})]}):jsxRuntime.jsx("div",{children:"No section found."})};exports.a=T;//# sourceMappingURL=chunk-UNKXYVXY.js.map
2
- //# sourceMappingURL=chunk-UNKXYVXY.js.map
@@ -1,2 +0,0 @@
1
- 'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),reactDom=require('react-dom'),jsxRuntime=require('react/jsx-runtime');var lt=({options:d,onSave:J,title:M="We Value Your Privacy",description:W="We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",acceptAllButtonText:Y="Accept All",rejectAllButtonText:K="Reject All",customizeButtonText:Q="Customize",saveButtonText:U="Save Preferences",position:A="bottom",zIndex:T=9999,version:f="1.0",show:p,manageStorage:R=true,storageKey:E="ndpr_consent",className:X="",buttonClassName:y="",primaryButtonClassName:q="",secondaryButtonClassName:Z="",classNames:t,unstyled:o,onAnalytics:h})=>{let[g,u]=react.useState(false),[v,a]=react.useState(false),[C,B]=react.useState({}),z=react.useRef(null),$=react.useRef(null),j=react.useRef(false),b=react.useCallback((e,n)=>{h==null||h(chunkMQFZHA2D_js.a({action:e,timestamp:Date.now(),version:f},n!==void 0?{categories:n}:{}));},[h,f]);react.useEffect(()=>{let e={};if(d.forEach(n=>{e[n.id]=n.defaultValue||false;}),B(e),p===void 0)if(!R)u(true);else {let n=localStorage.getItem(E);if(n)try{JSON.parse(n).version!==f?u(!0):u(!1);}catch(D){u(true);}else u(true);}else u(p);},[d,E,f,R]),react.useEffect(()=>{p!==void 0&&u(p);},[p]);let s=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),b("accepted_all",e),P(e);},N=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),b("rejected_all",e),P(e);},tt=(e,n)=>{B(D=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},D),{[e]:n}));},et=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),B(e);},nt=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),B(e);},H=d.length>0&&d.every(e=>C[e.id]),rt=()=>{b("customized",C),P(C);},P=e=>{let n={consents:e,timestamp:Date.now(),version:f,method:v?"customize":"banner",hasInteracted:true};R&&localStorage.setItem(E,JSON.stringify(n)),J(n),u(false),a(false);},_=react.useCallback(()=>{b("dismissed"),u(false),a(false);},[b]);if(react.useEffect(()=>{if(!g)return;let e=n=>{n.key==="Escape"&&_();};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[g,_]),react.useEffect(()=>{g&&!j.current&&(j.current=true,b("shown")),g||(j.current=false);},[g,b]),react.useEffect(()=>{g&&z.current&&z.current.focus();},[g]),react.useEffect(()=>{if(v&&$.current){let e=$.current;e.style.maxHeight="0px",e.style.opacity="0",e.offsetHeight,e.style.maxHeight=`${e.scrollHeight}px`,e.style.opacity="1";}},[v]),!g)return null;let ot=(t==null?void 0:t.primaryButton)||(t==null?void 0:t.acceptButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${y} ${q}`,m=(t==null?void 0:t.secondaryButton)||(t==null?void 0:t.rejectButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${y} ${Z}`,it=(t==null?void 0:t.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${y}`,dt=(t==null?void 0:t.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${y} ${q}`,k=A==="inline",w=A==="center",x;k||w?x="":A==="top"?x="fixed inset-x-0 top-0":x="fixed inset-x-0 bottom-0";let S=jsxRuntime.jsx("div",{ref:z,tabIndex:-1,"data-ndpr-component":"consent-banner",className:chunkE64TU6IU_js.a(`${k?"":x} bg-white dark:bg-gray-800 shadow-lg p-3 sm:p-4 border border-gray-200 dark:border-gray-700 ${w?"max-w-lg w-full":""} ${X}`,t==null?void 0:t.root,o),style:!k&&!w?{zIndex:T}:void 0,role:"dialog","aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("max-w-6xl mx-auto",t==null?void 0:t.container,o),children:[jsxRuntime.jsx("h2",{id:"consent-banner-title",className:chunkE64TU6IU_js.a("text-lg font-bold mb-2",t==null?void 0:t.title,o),children:M}),jsxRuntime.jsx("p",{id:"consent-banner-description",className:chunkE64TU6IU_js.a("text-sm sm:text-base mb-4",t==null?void 0:t.description,o),children:W}),v&&jsxRuntime.jsxs("div",{ref:$,className:chunkE64TU6IU_js.a("mb-4 p-3 sm:p-4 rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50",t==null?void 0:t.customizePanel,o),style:{overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out"},children:[jsxRuntime.jsx("div",{className:"mb-3 flex items-center justify-end",children:jsxRuntime.jsx("button",{type:"button",onClick:H?nt:et,className:chunkE64TU6IU_js.a("text-sm font-medium text-[rgb(var(--ndpr-primary))] hover:underline",t==null?void 0:t.selectAllButton,o),children:H?"Deselect All":"Select All"})}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-3",t==null?void 0:t.optionsList,o),children:d.map(e=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start",t==null?void 0:t.optionItem,o),children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:`consent-${e.id}`,type:"checkbox",checked:C[e.id]||false,onChange:n=>tt(e.id,n.target.checked),disabled:e.required,className:chunkE64TU6IU_js.a("h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",t==null?void 0:t.optionCheckbox,o)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:`consent-${e.id}`,className:chunkE64TU6IU_js.a("font-medium",t==null?void 0:t.optionLabel,o),children:[e.label," ",e.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-400",t==null?void 0:t.optionDescription,o),children:e.description})]})]},e.id))}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-4 flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:rt,className:chunkE64TU6IU_js.a(dt,t==null?void 0:t.saveButton,o),children:U}),jsxRuntime.jsx("button",{onClick:()=>a(false),className:chunkE64TU6IU_js.a(m,t==null?void 0:t.rejectButton,o),children:"Back"})]})]}),!v&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:s,className:chunkE64TU6IU_js.a(ot,t==null?void 0:t.acceptButton,o),children:Y}),jsxRuntime.jsx("button",{onClick:N,className:chunkE64TU6IU_js.a(m,t==null?void 0:t.rejectButton,o),children:K}),jsxRuntime.jsx("button",{onClick:()=>a(true),className:chunkE64TU6IU_js.a(it,t==null?void 0:t.customizeButton,o),children:Q})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("mt-2 text-xs text-gray-600 dark:text-gray-400",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(k)return S;if(w){let e=jsxRuntime.jsxs("div",{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:T},children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"relative",children:S})]});return typeof document!="undefined"?reactDom.createPortal(e,document.body):e}return typeof document!="undefined"?reactDom.createPortal(S,document.body):S};exports.a=lt;//# sourceMappingURL=chunk-UOSEH6DC.js.map
2
- //# sourceMappingURL=chunk-UOSEH6DC.js.map