@tantainnovative/ndpr-toolkit 3.3.1 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/CHANGELOG.md +542 -0
  2. package/README.md +80 -38
  3. package/dist/{ConsentBanner-CDRT0o2k.d.mts → ConsentBanner-F5ayys5K.d.mts} +10 -0
  4. package/dist/{ConsentBanner-Vxyt8SCX.d.ts → ConsentBanner-VqIPophc.d.ts} +10 -0
  5. package/dist/{styling-B7CBzYG7.d.ts → ConsentManager-C7I3PDe8.d.mts} +2 -62
  6. package/dist/{styling-uJLsBbER.d.mts → ConsentManager-CQ2IZtUU.d.ts} +2 -62
  7. package/dist/{sanitize-B0AzEm1D.d.mts → NDPRProvider-DYFb8xEl.d.ts} +2 -94
  8. package/dist/{sanitize-B0AzEm1D.d.ts → NDPRProvider-U3QNu6MA.d.mts} +2 -94
  9. package/dist/adapters.js +1 -1
  10. package/dist/adapters.mjs +1 -1
  11. package/dist/breach.js +2 -1
  12. package/dist/breach.mjs +2 -1
  13. package/dist/chunk-2L7BSG7G.mjs +2 -0
  14. package/dist/chunk-3NQQSU4P.js +2 -0
  15. package/dist/chunk-3VQAYQR7.js +7 -0
  16. package/dist/chunk-4BOEFDDE.js +4 -0
  17. package/dist/chunk-5HL4UBFV.js +2 -0
  18. package/dist/chunk-6HZL2WDU.mjs +2 -0
  19. package/dist/chunk-6QPRDQZF.js +2 -0
  20. package/dist/chunk-74Z23WUA.mjs +2 -0
  21. package/dist/chunk-AHSMDPG5.js +132 -0
  22. package/dist/chunk-ASLMPY54.js +3 -0
  23. package/dist/chunk-BN77GP4W.mjs +2 -0
  24. package/dist/chunk-C5QO3SX4.js +2 -0
  25. package/dist/chunk-CISJAQ6W.mjs +2 -0
  26. package/dist/chunk-DUY6F3GT.mjs +94 -0
  27. package/dist/chunk-EHAZIKDX.js +81 -0
  28. package/dist/chunk-EPT2K355.mjs +2 -0
  29. package/dist/chunk-HGGLW5TE.js +2 -0
  30. package/dist/chunk-HQSU7LGM.js +94 -0
  31. package/dist/chunk-I557S566.mjs +15 -0
  32. package/dist/chunk-IZCWCE7W.mjs +2 -0
  33. package/dist/chunk-JBSCER34.js +2 -0
  34. package/dist/chunk-JFFOPHU3.mjs +318 -0
  35. package/dist/chunk-KF3EFJEF.mjs +3 -0
  36. package/dist/chunk-LJNNPAFU.mjs +2 -0
  37. package/dist/{chunk-UXMGBIX6.js → chunk-LSCMXAPY.mjs} +4 -4
  38. package/dist/chunk-LSNL4XR5.js +2 -0
  39. package/dist/chunk-MLOWRZXO.mjs +4 -0
  40. package/dist/chunk-NFJ4CB63.mjs +3 -0
  41. package/dist/chunk-NQNFS3QI.js +7 -0
  42. package/dist/{chunk-ZEOQYWOE.mjs → chunk-P2YV6DR3.js} +4 -4
  43. package/dist/chunk-P6QAFBCV.js +2 -0
  44. package/dist/chunk-R5FW5XUQ.mjs +2 -0
  45. package/dist/chunk-RLYTX3MM.js +2 -0
  46. package/dist/chunk-RRVKUCFR.mjs +2 -0
  47. package/dist/chunk-RXL6CZAI.js +2 -0
  48. package/dist/chunk-RY3PGVLZ.mjs +2 -0
  49. package/dist/chunk-SUEGUY35.js +2 -0
  50. package/dist/chunk-SYMQJO2W.mjs +7 -0
  51. package/dist/chunk-TCN22KYP.mjs +7 -0
  52. package/dist/chunk-UHTJ6UFW.js +2 -0
  53. package/dist/chunk-VTITKWGX.mjs +2 -0
  54. package/dist/chunk-WH6ZMUOS.mjs +81 -0
  55. package/dist/chunk-WTJGLNTB.js +3 -0
  56. package/dist/chunk-XHROISIF.mjs +2 -0
  57. package/dist/chunk-YPKUHSK4.js +15 -0
  58. package/dist/chunk-Z73T6MWY.js +318 -0
  59. package/dist/chunk-ZLSWOFAY.mjs +132 -0
  60. package/dist/chunk-ZPKVLTSX.js +2 -0
  61. package/dist/consent.d.mts +6 -4
  62. package/dist/consent.d.ts +6 -4
  63. package/dist/consent.js +2 -1
  64. package/dist/consent.mjs +2 -1
  65. package/dist/core.d.mts +6 -29
  66. package/dist/core.d.ts +6 -29
  67. package/dist/core.js +1 -1
  68. package/dist/core.mjs +1 -1
  69. package/dist/cross-border.js +2 -1
  70. package/dist/cross-border.mjs +2 -1
  71. package/dist/docx-4n8g4zul.d.mts +64 -0
  72. package/dist/docx-VvcTLYZM.d.ts +64 -0
  73. package/dist/dpia.js +2 -1
  74. package/dist/dpia.mjs +2 -1
  75. package/dist/dsr.js +2 -1
  76. package/dist/dsr.mjs +2 -1
  77. package/dist/hooks.d.mts +3 -3
  78. package/dist/hooks.d.ts +3 -3
  79. package/dist/hooks.js +2 -1
  80. package/dist/hooks.mjs +2 -1
  81. package/dist/index.d.mts +7 -5
  82. package/dist/index.d.ts +7 -5
  83. package/dist/index.js +2 -1
  84. package/dist/index.mjs +2 -1
  85. package/dist/lawful-basis.js +2 -1
  86. package/dist/lawful-basis.mjs +2 -1
  87. package/dist/locale-CxJx2tzn.d.mts +25 -0
  88. package/dist/locale-DSkrtf-c.d.ts +25 -0
  89. package/dist/{policy-engine-DefZcX3R.d.mts → policy-engine-5qTfp2z4.d.mts} +21 -1
  90. package/dist/{policy-engine-C6nC2t3a.d.ts → policy-engine-DzPxskOK.d.ts} +21 -1
  91. package/dist/{policy-sections-DFDPVCCg.d.ts → policy-sections-9tCb7VU7.d.ts} +4 -2
  92. package/dist/{policy-sections-Bylm31kZ.d.mts → policy-sections-CBWcJv-R.d.mts} +4 -2
  93. package/dist/{policy-templates-CIKcV0i1.d.ts → policy-templates-DhLwq4R-.d.ts} +8 -1
  94. package/dist/{policy-templates-DMsPwOSZ.d.mts → policy-templates-DwYl2329.d.mts} +8 -1
  95. package/dist/policy.d.mts +36 -71
  96. package/dist/policy.d.ts +36 -71
  97. package/dist/policy.js +2 -1
  98. package/dist/policy.mjs +2 -1
  99. package/dist/presets.d.mts +2 -2
  100. package/dist/presets.d.ts +2 -2
  101. package/dist/presets.js +2 -1
  102. package/dist/presets.mjs +2 -1
  103. package/dist/ropa.js +2 -1
  104. package/dist/ropa.mjs +2 -1
  105. package/dist/sanitize-CxxwKxAx.d.mts +94 -0
  106. package/dist/sanitize-CxxwKxAx.d.ts +94 -0
  107. package/dist/server.d.mts +24 -0
  108. package/dist/server.d.ts +24 -0
  109. package/dist/server.js +2 -0
  110. package/dist/server.mjs +2 -0
  111. package/dist/styles.css +1423 -31
  112. package/dist/styling-BMDGQDgS.d.mts +64 -0
  113. package/dist/styling-BaoQtV06.d.ts +64 -0
  114. package/dist/unstyled.d.mts +52 -19
  115. package/dist/unstyled.d.ts +52 -19
  116. package/dist/unstyled.js +2 -1
  117. package/dist/unstyled.mjs +2 -1
  118. package/dist/{useAdaptivePolicyWizard-A1PyOy6P.d.mts → useAdaptivePolicyWizard-BSLyltzZ.d.mts} +1 -1
  119. package/dist/{useAdaptivePolicyWizard-LVIKhAxw.d.ts → useAdaptivePolicyWizard-CL7C7MTZ.d.ts} +1 -1
  120. package/dist/{useDefaultPrivacyPolicy-ySWU7nc-.d.mts → useDefaultPrivacyPolicy-Cs2WQSYQ.d.mts} +30 -9
  121. package/dist/{useDefaultPrivacyPolicy-DvCbeEl1.d.ts → useDefaultPrivacyPolicy-DkOqMg2e.d.ts} +30 -9
  122. package/package.json +14 -2
  123. package/dist/chunk-25OOUES4.js +0 -2
  124. package/dist/chunk-4JKTIR33.mjs +0 -2
  125. package/dist/chunk-5BUS6AI7.js +0 -2
  126. package/dist/chunk-5ECDPRSZ.js +0 -7
  127. package/dist/chunk-6YN73KR7.mjs +0 -2
  128. package/dist/chunk-CDZDT2OS.mjs +0 -320
  129. package/dist/chunk-CWUPGY3M.mjs +0 -3
  130. package/dist/chunk-CYU6YUJQ.mjs +0 -81
  131. package/dist/chunk-EKHBORAH.js +0 -81
  132. package/dist/chunk-ENIMJ6SQ.js +0 -2
  133. package/dist/chunk-FLKJSGR7.mjs +0 -94
  134. package/dist/chunk-FWLPJ5YI.js +0 -94
  135. package/dist/chunk-GCQRHMTQ.mjs +0 -144
  136. package/dist/chunk-GMLCWGNJ.js +0 -7
  137. package/dist/chunk-GXLSOZCH.mjs +0 -2
  138. package/dist/chunk-LETEUS5X.mjs +0 -2
  139. package/dist/chunk-LU4PFST7.js +0 -144
  140. package/dist/chunk-NBSVFQ5G.js +0 -2
  141. package/dist/chunk-OYR3L4XS.mjs +0 -7
  142. package/dist/chunk-QF6XNKU6.mjs +0 -2
  143. package/dist/chunk-QJ3JNHO7.js +0 -2
  144. package/dist/chunk-QNCGRCAX.mjs +0 -2
  145. package/dist/chunk-SAA7UVI2.js +0 -3
  146. package/dist/chunk-TI2M7H6R.mjs +0 -7
  147. package/dist/chunk-TXXWCB5O.js +0 -320
  148. package/dist/chunk-UGY5ZYUG.js +0 -2
  149. package/dist/chunk-UO6QPJLH.js +0 -2
  150. package/dist/chunk-UX6ZZNEM.mjs +0 -3
  151. package/dist/chunk-XFUEZ3MP.mjs +0 -2
  152. package/dist/chunk-XHSHPB74.js +0 -2
  153. package/dist/chunk-YCX6BFOQ.js +0 -2
  154. package/dist/chunk-YURSF2YO.mjs +0 -2
  155. package/dist/chunk-YZXUAIYN.js +0 -3
  156. package/dist/chunk-ZT7KNFAU.mjs +0 -2
@@ -0,0 +1,7 @@
1
+ import {a}from'./chunk-AYKLAEOU.mjs';import I,{useMemo}from'react';import {jsxs,jsx}from'react/jsx-runtime';var B=({result:a$1,sections:m,showFullReport:g=true,allowPrint:u=true,allowExport:v=true,onExport:f,className:N="",buttonClassName:x="",classNames:b={},unstyled:y=false})=>{let o=useMemo(()=>new Date().toLocaleDateString(),[]),d=(r,s)=>{let i=s?b[s]:void 0;return !i&&s==="printButton"&&(i=b.primaryButton),a(r,i,y)},l=r=>new Date(r).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),w=r=>{let s=a$1.answers[r];return s==null?"Not answered":typeof s=="boolean"?s?"Yes":"No":Array.isArray(s)?s.join(", "):String(s)},k=()=>{window.print();},C=r=>{f&&f(r);},R=r=>jsx("span",{className:d(`px-2 py-1 rounded text-xs font-medium ${{low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--warning",critical:"ndpr-badge ndpr-badge--destructive"}[r]}`,"riskBadge"),children:r.charAt(0).toUpperCase()+r.slice(1)});return jsxs("div",{"data-ndpr-component":"dpia-report",className:`${d("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 print:shadow-none print:p-0","root")} ${N}`,children:[jsxs("div",{className:d("mb-8 border-b border-gray-200 dark:border-gray-700 pb-6 print:pb-4","header"),children:[jsxs("div",{className:"flex justify-between items-start",children:[jsxs("div",{children:[jsx("h1",{className:d("ndpr-card__title","title"),children:"Data Protection Impact Assessment Report"}),jsx("h2",{className:"text-xl ndpr-text-muted mb-4",children:a$1.title})]}),(u||v)&&jsxs("div",{className:"flex space-x-2 print:hidden",children:[u&&jsx("button",{onClick:k,className:`${d("px-3 py-1 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600","printButton")} ${x}`,children:jsxs("span",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})}),"Print"]})}),v&&jsx("div",{className:"relative inline-block",children:jsx("button",{onClick:()=>C("pdf"),className:`px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${x}`,children:jsxs("span",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Export PDF"]})})})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[jsxs("div",{children:[jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Assessor:"})," ",a$1.assessor.name,", ",a$1.assessor.role]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Contact:"})," ",a$1.assessor.email]})]}),jsxs("div",{children:[jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Started:"})," ",l(a$1.startedAt)]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Completed:"})," ",a$1.completedAt?l(a$1.completedAt):"In progress"]}),jsxs("p",{className:"ndpr-form-field__hint",children:[jsx("span",{className:"font-medium",children:"Next review:"})," ",a$1.reviewDate?l(a$1.reviewDate):"Not scheduled"]})]})]})]}),jsxs("div",{className:d("mb-8","summary"),children:[jsx("h2",{className:"ndpr-section-heading",children:"Executive Summary"}),jsxs("div",{className:"ndpr-panel",children:[jsxs("div",{className:"flex items-center mb-2",role:"status","aria-live":"polite",children:[jsx("span",{className:"font-medium mr-2",children:"Overall Risk Level:"}),R(a$1.overallRiskLevel)]}),jsxs("div",{className:d("mb-2","conclusion"),children:[jsx("span",{className:"font-medium",children:"Conclusion:"})," ",a$1.conclusion]}),jsxs("div",{role:"status","aria-live":"polite",children:[jsx("span",{className:"font-medium",children:"Can Proceed:"})," ",a$1.canProceed?"Yes":"No"]})]}),jsxs("div",{children:[jsx("h3",{className:"font-medium ndpr-text-foreground mb-2",children:"Processing Activity Description"}),jsx("p",{className:"ndpr-text-muted mb-4",children:a$1.processingDescription}),a$1.recommendations&&a$1.recommendations.length>0&&jsxs("div",{children:[jsx("h3",{className:"font-medium ndpr-text-foreground mb-2",children:"Key Recommendations"}),jsx("ul",{className:"list-disc pl-5 ndpr-text-muted",children:a$1.recommendations.map((r,s)=>jsx("li",{className:d("","recommendation"),children:r},s))})]})]})]}),jsxs("div",{className:"mb-8",children:[jsx("h2",{className:"ndpr-section-heading",children:"Identified Risks"}),a$1.risks.length===0?jsx("p",{className:"ndpr-text-muted",children:"No risks identified."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:d("min-w-full divide-y divide-gray-200 dark:divide-gray-700","riskTable"),children:[jsx("thead",{className:"ndpr-panel",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Risk"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Likelihood"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Impact"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Risk Level"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Mitigated"})]})}),jsx("tbody",{className:"ndpr-table",children:a$1.risks.map(r=>jsxs("tr",{className:d("","riskRow"),children:[jsx("td",{className:"ndpr-table__cell",children:r.description}),jsxs("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:[r.likelihood," / 5"]}),jsxs("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:[r.impact," / 5"]}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:R(r.level)}),jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:r.mitigated?jsx("span",{className:"ndpr-text-success",children:"Yes"}):jsx("span",{className:"ndpr-text-destructive",children:"No"})})]},r.id))})]})})]}),g&&jsxs("div",{children:[jsx("h2",{className:"ndpr-section-heading",children:"Full Assessment Details"}),m.map(r=>{let s=r.questions.filter(i=>a$1.answers[i.id]!==void 0);return s.length===0?null:jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium ndpr-text-foreground mb-2",children:r.title}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[jsx("thead",{className:"ndpr-panel",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Question"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Answer"})]})}),jsx("tbody",{className:"ndpr-table",children:s.map(i=>jsxs("tr",{children:[jsx("td",{className:"ndpr-table__cell",children:i.text}),jsx("td",{className:"px-6 py-4 whitespace-normal text-sm ndpr-text-muted",children:w(i.id)})]},i.id))})]})})]},r.id)})]}),jsxs("div",{className:"mt-8 pt-4 border-t border-gray-200 dark:border-gray-700 text-sm ndpr-text-muted",children:[jsx("p",{children:"This DPIA was conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023."}),jsxs("p",{children:["DPIA Report Version: ",a$1.version]}),jsxs("p",{children:["Generated on: ",o]})]})]})};var M=({steps:a$1,onStepClick:m,clickable:g=true,orientation:u="horizontal",className:v="",activeStepClassName:f="",completedStepClassName:N="",incompleteStepClassName:x="",classNames:b={},unstyled:y=false})=>{let o=(n,p)=>a(n,p?b[p]:void 0,y),d=n=>{g&&m&&m(n);},l=u==="vertical";return jsx("div",{"data-ndpr-component":"dpia-step-indicator",role:"navigation","aria-label":"Step progress",className:`${o(l?"flex flex-col space-y-4":"flex items-center justify-between","root")} ${v}`,children:a$1.map((n,p)=>{let w=p===a$1.length-1,k=n.active?o(`font-medium ${f||"ndpr-text-primary"}`,"label"):n.completed?o(N||"ndpr-text-success","label"):o(x||"ndpr-card__subtitle","label"),C=n.active?o("flex items-center justify-center w-8 h-8 rounded-full bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)] ndpr-text-primary border-2 border-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]","stepActive"):n.completed?o("flex items-center justify-center w-8 h-8 rounded-full bg-green-100 dark:bg-green-900 ndpr-text-success border-2 border-green-600 dark:border-green-400","stepCompleted"):o("flex items-center justify-center w-8 h-8 rounded-full bg-gray-100 dark:bg-gray-700 ndpr-text-muted border-2 border-gray-300 dark:border-gray-600","stepPending");return jsxs(I.Fragment,{children:[jsxs("div",{className:o(`${l?"flex items-start":"flex flex-col items-center"} ${g?"cursor-pointer":""}`,"step"),onClick:()=>d(n.id),"aria-current":n.active?"step":void 0,children:[jsx("div",{className:`
2
+ flex items-center justify-center
3
+ ${l?"mr-4":""}
4
+ `,children:jsx("div",{className:C,children:n.icon?n.icon:n.completed?jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):jsx("span",{children:p+1})})}),jsxs("div",{className:`
5
+ ${l?"flex-1":"mt-2 text-center"}
6
+ `,children:[jsx("div",{className:`text-sm font-medium ${k}`,children:n.label}),n.description&&jsx("div",{className:"ndpr-form-field__hint",children:n.description})]})]}),!w&&jsx("div",{className:o(l?"ml-4 h-8 border-l-2 border-gray-300 dark:border-gray-600":"w-full border-t-2 border-gray-300 dark:border-gray-600 hidden sm:block","connector")})]},n.id)})})};export{B as a,M as b};//# sourceMappingURL=chunk-TCN22KYP.mjs.map
7
+ //# sourceMappingURL=chunk-TCN22KYP.mjs.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkP2YV6DR3_js=require('./chunk-P2YV6DR3.js'),chunkELKB2AFZ_js=require('./chunk-ELKB2AFZ.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function H(e,s){return s?chunkELKB2AFZ_js.a(e):{load:()=>null,save:()=>{},remove:()=>{}}}function N({templates:e,initialPolicy:s,adapter:P,storageKey:l="ndpr_privacy_policy",useLocalStorage:m=true,onGenerate:T}){let w=P!=null?P:H(l,m),c=react.useRef(w);c.current=w;let[r,f]=react.useState(s||null),[o,p]=react.useState(null),[y,E]=react.useState({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),[A,O]=react.useState(true),D=react.useRef(e);D.current=e,react.useEffect(()=>{if(s){O(false);return}let t=false;try{let n=c.current.load(),i=a=>{if(a){if(f(a),a.templateId){let g=D.current.find(b=>b.id===a.templateId);g&&p(g);}a.organizationInfo&&E(a.organizationInfo);}O(!1);};n instanceof Promise?n.then(a=>{t||i(a);},()=>{t||O(!1);}):i(n);}catch(n){t||O(false);}return ()=>{t=true;}},[s]);let q=t=>{Promise.resolve(c.current.save(t)).catch(n=>{console.warn("[ndpr-toolkit] Failed to save policy:",n);});},_=react.useCallback(t=>{let n=e.find(b=>b.id===t);if(!n)return false;p(n);let i=n.sections.map(b=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},b),{customContent:void 0})),a={};Object.keys(n.variables).forEach(b=>{a[b]=n.variables[b].defaultValue||"";});let g=Date.now();return f({id:"policy_"+g+"_"+Math.random().toString(36).substr(2,9),title:"",templateId:n.id,organizationInfo:y,sections:i,variableValues:a,effectiveDate:g,lastUpdated:g,version:"1.0"}),true},[e,y]),C=react.useCallback(t=>{E(n=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},n),t));},[]),k=react.useCallback((t,n)=>{o&&(r?f(i=>i&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{sections:i.sections.map(a=>a.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{included:n}):a)})):p(i=>i&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{sections:i.sections.map(a=>a.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{included:n}):a)})));},[o,r]),j=react.useCallback((t,n)=>{o&&(r?f(i=>i&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{sections:i.sections.map(a=>a.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{customContent:n}):a)})):p(i=>i&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{sections:i.sections.map(a=>a.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{customContent:n}):a)})));},[o,r]),I=react.useCallback((t,n)=>{r&&f(i=>i&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{variableValues:chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i.variableValues),{[t]:n})}));},[r]),F=()=>"policy_"+Date.now()+"_"+Math.random().toString(36).substr(2,9),M=react.useCallback(()=>{if(!o)return null;let t=Date.now(),n={id:(r==null?void 0:r.id)||F(),title:`Privacy Policy for ${y.name}`,templateId:o.id,organizationInfo:y,sections:o.sections.map(i=>{var a;return chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{customContent:(a=r==null?void 0:r.sections.find(g=>g.id===i.id))==null?void 0:a.customContent})}),variableValues:(r==null?void 0:r.variableValues)||{},effectiveDate:t,lastUpdated:t,version:"1.0"};return f(n),q(n),T&&T(n),n},[o,r,y,T]),$=react.useCallback(()=>{if(!r)return {fullText:"",sectionTexts:{},missingVariables:[]};let t=chunkP2YV6DR3_js.b(r.sections,r.organizationInfo);return typeof t=="string"?{fullText:t,sectionTexts:{full:t},missingVariables:[]}:t},[r]),B=react.useCallback(()=>{f(null),p(null),E({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),Promise.resolve(c.current.remove()).catch(t=>{console.warn("[ndpr-toolkit] Failed to remove policy:",t);});},[]),G=react.useCallback(()=>{let t=[];if(o||t.push("No template selected"),y.name||t.push("Organization name is required"),y.website||t.push("Organization website is required"),y.privacyEmail||t.push("Privacy contact email is required"),o){let n=o.sections.filter(a=>a.required),i=(r==null?void 0:r.sections.filter(a=>a.included))||[];n.forEach(a=>{i.some(g=>g.id===a.id)||t.push(`Required section "${a.title}" must be included`);});}return o&&r&&Object.entries(o.variables).forEach(([n,i])=>{i.required&&!r.variableValues[n]&&t.push(`Required variable "${i.name}" must have a value`);}),{valid:t.length===0,errors:t}},[o,y,r]);return {policy:r,selectedTemplate:o,organizationInfo:y,selectTemplate:_,updateOrganizationInfo:C,toggleSection:k,updateSectionContent:j,updateVariableValue:I,generatePolicy:M,getPolicyText:$,resetPolicy:B,isValid:G,isLoading:A}}var x="default-business";function J(e){return e.toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"})}function Q(e){let{sections:s,variables:P}=chunkP2YV6DR3_js.e(),l={};return e&&(e.name&&(l.orgName=e.name),e.email&&(l.privacyEmail=e.email),e.website&&(l.website=e.website),e.address&&(l.address=e.address),e.industry&&(l.industry=e.industry),e.dpoName&&(l.dpoName=e.dpoName),e.dpoEmail&&(l.dpoEmail=e.dpoEmail)),l.effectiveDate||(l.effectiveDate=J(new Date)),{id:x,name:"Default Business Policy",description:"NDPA-compliant privacy policy template for businesses.",organizationType:"business",sections:s,variables:Object.fromEntries(P.map(m=>[m.name,{name:m.name,description:m.description,required:m.required,defaultValue:l[m.name]||m.value||void 0}])),version:"1.0",lastUpdated:Date.now(),ndpaCompliant:true}}function W(e){if(!e)return {};let s={};return e.name&&(s.name=e.name),e.email&&(s.privacyEmail=e.email),e.website&&(s.website=e.website),e.address&&(s.address=e.address),e.industry&&(s.industry=e.industry),e.dpoName&&(s.dpoName=e.dpoName),e.dpoEmail&&(s.dpoEmail=e.dpoEmail),s}function se(e={}){let{orgInfo:s,autoGenerate:P=true,storageKey:l,useLocalStorage:m,adapter:T}=e,w=react.useRef(null);w.current===null&&(w.current=Q(s));let c=N({templates:[w.current],adapter:T,storageKey:l,useLocalStorage:m}),r=react.useRef(false),f=react.useRef(false);return react.useEffect(()=>{if(!P||c.isLoading||r.current)return;if(!T&&m!==false&&typeof window!="undefined"&&typeof window.localStorage!="undefined")try{if(window.localStorage.getItem(l!=null?l:"ndpr_privacy_policy")){r.current=!0,f.current=!0;return}}catch(y){}if(c.policy){r.current=true,f.current=true;return}r.current=true;let p=W(s);Object.keys(p).length>0&&c.updateOrganizationInfo(p),c.selectedTemplate||c.selectTemplate(x);},[P,c.isLoading]),react.useEffect(()=>{var p;if(!P||f.current||!r.current||!c.selectedTemplate)return;let o=(p=s==null?void 0:s.name)!=null?p:"";o&&c.organizationInfo.name!==o||(f.current=true,c.generatePolicy());},[P,c.selectedTemplate,c.organizationInfo]),c}exports.a=N;exports.b=se;//# sourceMappingURL=chunk-UHTJ6UFW.js.map
2
+ //# sourceMappingURL=chunk-UHTJ6UFW.js.map
@@ -0,0 +1,2 @@
1
+ import {b,d,a as a$1,c}from'./chunk-SHMJNRHO.mjs';import {a as a$2}from'./chunk-AYKLAEOU.mjs';import {a,b as b$1}from'./chunk-WWT2ZSNU.mjs';import {useState,useMemo,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var T=[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_interest",label:"Public Interest (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}],ee=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"archived",label:"Archived"}],Ee=[{value:"data_subject",label:"Directly from Data Subject"},{value:"third_party",label:"Third Party"},{value:"public_source",label:"Public Source"},{value:"other",label:"Other"}];function Oe(){let l=Date.now();return {id:`proc_${l}_${Math.random().toString(36).substring(2,11)}`,name:"",description:"",controllerDetails:{name:"",contact:"",address:""},lawfulBasis:"consent",lawfulBasisJustification:"",purposes:[],dataCategories:[],dataSubjectCategories:[],recipients:[],retentionPeriod:"",securityMeasures:[],dataSource:"data_subject",dpiaRequired:false,automatedDecisionMaking:false,status:"active",createdAt:l,updatedAt:l}}function te(l){return l?new Date(l).toLocaleDateString():"N/A"}var $e=({ropa:l,onAddRecord:R,onUpdateRecord:D,onArchiveRecord:w,title:re="Record of Processing Activities (ROPA)",description:ie="Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",className:ae="",buttonClassName:B="",classNames:e,unstyled:n})=>{let[f,b$2]=useState("list"),[S,ne]=useState(""),[P,de]=useState("all"),[k,le]=useState("all"),[o,h]=useState(null),[U,C]=useState([]),[F,$]=useState(""),[I,H]=useState(""),[M,V]=useState(""),[L,J]=useState(""),[E,z]=useState(""),[O,G]=useState(""),[j,W]=useState(""),g=useMemo(()=>b(l),[l]),_=useMemo(()=>d(l),[l]),K=useMemo(()=>{let r=[...l.records];if(P!=="all"&&(r=r.filter(a=>a.status===P)),k!=="all"&&(r=r.filter(a=>a.lawfulBasis===k)),S){let a=S.toLowerCase();r=r.filter(p=>p.name.toLowerCase().includes(a)||p.description.toLowerCase().includes(a)||p.dataCategories.some(m=>m.toLowerCase().includes(a))||p.department&&p.department.toLowerCase().includes(a));}return r},[l.records,P,k,S]);useEffect(()=>{o&&($(o.purposes.join(", ")),H(o.dataCategories.join(", ")),V((o.sensitiveDataCategories||[]).join(", ")),J(o.dataSubjectCategories.join(", ")),z(o.recipients.join(", ")),G(o.securityMeasures.join(", ")),W((o.systemsUsed||[]).join(", ")));},[o==null?void 0:o.id]);let oe=useCallback(()=>{let r=Oe();r.controllerDetails.name=l.organizationName,r.controllerDetails.contact=l.organizationContact,r.controllerDetails.address=l.organizationAddress,l.ndpcRegistrationNumber&&(r.controllerDetails.registrationNumber=l.ndpcRegistrationNumber),l.dpoDetails&&(r.controllerDetails.dpoContact=l.dpoDetails.email),h(r),C([]),b$2("form");},[l.organizationName,l.organizationContact,l.organizationAddress,l.ndpcRegistrationNumber,l.dpoDetails]),pe=useCallback(r=>{h(a({},r)),C([]),b$2("form");},[]),v=r=>r.split(",").map(a=>a.trim()).filter(a=>a.length>0),ue=useCallback(()=>{if(!o)return;let r=b$1(a({},o),{purposes:v(F),dataCategories:v(I),sensitiveDataCategories:v(M),dataSubjectCategories:v(L),recipients:v(E),securityMeasures:v(O),systemsUsed:v(j),updatedAt:Date.now()});r.sensitiveDataCategories&&r.sensitiveDataCategories.length===0&&(r.sensitiveDataCategories=void 0),r.systemsUsed&&r.systemsUsed.length===0&&(r.systemsUsed=void 0);let a$2=a$1(r);if(!a$2.valid){C(a$2.errors);return}l.records.find(m=>m.id===r.id)?D==null||D(r.id,r):R==null||R(r),h(null),C([]),b$2("list");},[o,F,I,M,L,E,O,j,l.records,D,R]),ce=useCallback(r=>{w==null||w(r);},[w]),se=useCallback(()=>{let r=c(l),a=new Blob([r],{type:"text/csv;charset=utf-8;"}),p=URL.createObjectURL(a),m=document.createElement("a");m.href=p,m.download=`ropa_${l.organizationName.replace(/\s+/g,"_").toLowerCase()}_${new Date().toISOString().slice(0,10)}.csv`,m.click(),setTimeout(()=>URL.revokeObjectURL(p),100);},[l]),Q=useCallback(()=>{h(null),C([]),b$2("list");},[]),c$1=useCallback((r,a$1)=>{h(p=>p&&b$1(a({},p),{[r]:a$1}));},[]),q=useCallback((r,a$1)=>{h(p=>p&&b$1(a({},p),{controllerDetails:b$1(a({},p.controllerDetails),{[r]:a$1})}));},[]),ge=useCallback(r=>!!r.nextReviewDate&&r.nextReviewDate<=Date.now(),[]),me=useCallback(r=>{ne(r.target.value);},[]),ve=useCallback(r=>{de(r.target.value);},[]),fe=useCallback(r=>{le(r.target.value);},[]),be=useCallback(r=>{$(r.target.value);},[]),he=useCallback(r=>{H(r.target.value);},[]),_e=useCallback(r=>{V(r.target.value);},[]),xe=useCallback(r=>{J(r.target.value);},[]),Ce=useCallback(r=>{z(r.target.value);},[]),ye=useCallback(r=>{G(r.target.value);},[]),Re=useCallback(r=>{W(r.target.value);},[]),De=useCallback(()=>b$2("list"),[]),we=useCallback(()=>b$2("summary"),[]),Se=useCallback(r=>{let a={active:"ndpr-badge ndpr-badge--success",inactive:"ndpr-badge ndpr-badge--warning",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},p={active:"Active",inactive:"Inactive",archived:"Archived"};return jsx("span",{className:a$2(`px-2 py-1 rounded text-xs font-medium ${a[r]}`,e==null?void 0:e.statusBadge,n),children:p[r]})},[e==null?void 0:e.statusBadge,n]),Pe=useCallback(r=>jsx("span",{className:"ndpr-badge ndpr-badge--info",children:{consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"}[r]}),[]),ke=()=>jsxs("div",{className:a$2("mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",e==null?void 0:e.orgInfo,n),children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxs("div",{children:[jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"Organization"}),jsx("p",{className:"ndpr-section-heading",children:l.organizationName})]}),l.dpoDetails&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"Data Protection Officer"}),jsx("p",{className:"ndpr-section-heading",children:l.dpoDetails.name}),jsx("p",{className:"ndpr-form-field__hint",children:l.dpoDetails.email})]}),l.ndpcRegistrationNumber&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"NDPC Registration No."}),jsx("p",{className:"ndpr-section-heading",children:l.ndpcRegistrationNumber})]})]}),jsxs("div",{className:"mt-2 text-xs ndpr-text-muted",children:["Version ",l.version," | Last Updated: ",te(l.lastUpdated)]})]}),Ae=()=>jsxs("div",{className:a$2("mb-6",e==null?void 0:e.summary,n),children:[jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[jsxs("div",{className:a$2("p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:g.totalRecords}),jsx("p",{className:"text-xs ndpr-text-info",children:"Total Records"})]}),jsxs("div",{className:a$2("p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-success",children:g.activeRecords}),jsx("p",{className:"text-xs ndpr-text-success",children:"Active"})]}),jsxs("div",{className:a$2("p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:g.crossBorderRecords}),jsx("p",{className:"text-xs ndpr-text-info",children:"Cross-Border"})]}),jsxs("div",{className:a$2("p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:_.length}),jsx("p",{className:"text-xs ndpr-text-warning",children:"Records with Gaps"})]})]}),jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"ndpr-form-field__label",children:"By Lawful Basis"}),T.map(r=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:r.label.split(" (")[0]}),jsx("span",{className:"font-medium",children:g.byLawfulBasis[r.value]||0})]},r.value))]}),jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"ndpr-form-field__label",children:"Risk Indicators"}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:"Sensitive Data"}),jsx("span",{className:"font-medium",children:g.sensitiveDataRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:"DPIA Required"}),jsx("span",{className:"font-medium",children:g.dpiaRequiredRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:"Automated Decisions"}),jsx("span",{className:"font-medium",children:g.automatedDecisionRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:"Due for Review"}),jsx("span",{className:`font-medium ${g.recordsDueForReview.length>0?"ndpr-text-destructive":""}`,children:g.recordsDueForReview.length})]})]}),g.topDepartments.length>0&&jsxs("div",{className:"ndpr-panel",children:[jsx("p",{className:"ndpr-form-field__label",children:"Top Departments"}),g.topDepartments.slice(0,5).map(r=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"ndpr-card__subtitle",children:r.department}),jsx("span",{className:"font-medium",children:r.count})]},r.department))]})]}),_.length>0&&jsxs("div",{className:a$2("p-3 bg-red-50 dark:bg-red-900/20 rounded-md",e==null?void 0:e.complianceGap,n),role:"status","aria-live":"polite",children:[jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-2",children:"Compliance Gaps Detected"}),_.slice(0,5).map(r=>jsxs("div",{className:"mb-2",children:[jsx("p",{className:"text-xs font-medium ndpr-text-destructive",children:r.recordName}),jsx("ul",{className:"list-disc list-inside",children:r.gaps.map((a,p)=>jsx("li",{className:"text-xs ndpr-text-destructive",children:a},p))})]},r.recordId)),_.length>5&&jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["...and ",_.length-5," more record(s) with gaps."]})]})]}),Be=()=>jsxs("div",{children:[jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"ropaSearch",className:"ndpr-form-field__label",children:"Search"}),jsx("input",{type:"text",id:"ropaSearch",value:S,onChange:me,placeholder:"Search records...",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"ropaStatusFilter",className:"ndpr-form-field__label",children:"Status"}),jsxs("select",{id:"ropaStatusFilter",value:P,onChange:ve,className:a$2("ndpr-form-field__input",e==null?void 0:e.select,n),children:[jsx("option",{value:"all",children:"All Statuses"}),ee.map(r=>jsx("option",{value:r.value,children:r.label},r.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"ropaBasisFilter",className:"ndpr-form-field__label",children:"Lawful Basis"}),jsxs("select",{id:"ropaBasisFilter",value:k,onChange:fe,className:a$2("ndpr-form-field__input",e==null?void 0:e.select,n),children:[jsx("option",{value:"all",children:"All Bases"}),T.map(r=>jsx("option",{value:r.value,children:r.label.split(" (")[0]},r.value))]})]}),jsxs("div",{className:"flex items-end space-x-2",children:[jsx("button",{onClick:oe,className:a$2(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${B}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),n),children:"Add Record"}),jsx("button",{onClick:se,"aria-label":"Export ROPA records as CSV",className:a$2(`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 text-sm ${B}`,(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.exportButton),n),children:"Export CSV"})]})]}),K.length===0?jsx("p",{className:"ndpr-empty-state",children:"No processing records found."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:a$2("w-full text-sm text-left",e==null?void 0:e.table,n),children:[jsx("thead",{className:a$2("ndpr-table__head",e==null?void 0:e.tableHeader,n),children:jsxs("tr",{children:[jsx("th",{className:"ndpr-table__cell",children:"Name"}),jsx("th",{className:"ndpr-table__cell",children:"Lawful Basis"}),jsx("th",{className:"ndpr-table__cell",children:"Data Categories"}),jsx("th",{className:"ndpr-table__cell",children:"Status"}),jsx("th",{className:"ndpr-table__cell",children:"Last Reviewed"}),jsx("th",{className:"ndpr-table__cell",children:"Actions"})]})}),jsx("tbody",{children:K.map(r=>{let a=ge(r),p=_.some(m=>m.recordId===r.id);return jsxs("tr",{className:a$2(`border-b dark:border-gray-600 ${a?"bg-red-50 dark:bg-red-900/10":p?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} hover:bg-gray-50 dark:hover:bg-gray-700`,e==null?void 0:e.tableRow,n),children:[jsx("td",{className:"ndpr-table__cell",children:jsxs("div",{children:[jsx("p",{className:"font-medium",children:r.name}),r.department&&jsx("p",{className:"ndpr-form-field__hint",children:r.department}),a&&jsx("span",{className:"text-xs ndpr-text-destructive font-medium",children:"Review Overdue"})]})}),jsx("td",{className:"ndpr-table__cell",children:Pe(r.lawfulBasis)}),jsx("td",{className:"ndpr-table__cell",children:jsx("p",{className:"text-xs ndpr-text-muted max-w-xs truncate",children:r.dataCategories.join(", ")})}),jsx("td",{className:"ndpr-table__cell",children:Se(r.status)}),jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:te(r.lastReviewedAt)}),jsx("td",{className:"ndpr-table__cell",children:jsxs("div",{className:"ndpr-card__footer",children:[jsx("button",{onClick:()=>pe(r),"aria-label":`Edit record: ${r.name}`,className:"ndpr-text-primary hover:underline text-xs",children:"Edit"}),r.status!=="archived"&&jsx("button",{onClick:()=>ce(r.id),"aria-label":`Archive record: ${r.name}`,className:"ndpr-text-muted hover:underline text-xs",children:"Archive"})]})})]},r.id)})})]})})]}),Fe=useMemo(()=>o?!l.records.find(r=>r.id===o.id):true,[o,l.records]),Ie=()=>{if(!o)return null;let r=Fe;return jsxs("div",{"data-ndpr-component":"ropa-manager",className:a$2("",e==null?void 0:e.form,n),children:[jsxs("div",{className:a$2("flex justify-between items-center mb-4",e==null?void 0:e.header,n),children:[jsx("h3",{className:"ndpr-section-heading",children:r?"Add Processing Record":"Edit Processing Record"}),jsx("button",{onClick:Q,className:"ndpr-button ndpr-button--ghost ndpr-button--sm",children:"Cancel"})]}),U.length>0&&jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",role:"status","aria-live":"polite",children:[jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Please fix the following errors:"}),jsx("ul",{className:"list-disc list-inside",children:U.map((a,p)=>jsx("li",{className:"text-xs ndpr-text-destructive",children:a},p))})]}),jsxs("div",{className:"ndpr-form-section",children:[jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Basic Information"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsx("label",{htmlFor:"recordName",className:"ndpr-form-field__label",children:"Activity Name *"}),jsx("input",{type:"text",id:"recordName",value:o.name,onChange:a=>c$1("name",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Customer Account Management"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recordDepartment",className:"ndpr-form-field__label",children:"Department"}),jsx("input",{type:"text",id:"recordDepartment",value:o.department||"",onChange:a=>c$1("department",a.target.value||void 0),className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Marketing"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"recordDescription",className:"ndpr-form-field__label",children:"Description *"}),jsx("textarea",{id:"recordDescription",value:o.description,onChange:a=>c$1("description",a.target.value),rows:3,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe what personal data processing is performed..."})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recordStatus",className:"ndpr-form-field__label",children:"Status *"}),jsx("select",{id:"recordStatus",value:o.status,onChange:a=>c$1("status",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.select,n),children:ee.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]})]})]}),jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Controller Details"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsx("label",{htmlFor:"controllerName",className:"ndpr-form-field__label",children:"Controller Name *"}),jsx("input",{type:"text",id:"controllerName",value:o.controllerDetails.name,onChange:a=>q("name",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"controllerContact",className:"ndpr-form-field__label",children:"Controller Contact *"}),jsx("input",{type:"text",id:"controllerContact",value:o.controllerDetails.contact,onChange:a=>q("contact",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"controllerAddress",className:"ndpr-form-field__label",children:"Controller Address *"}),jsx("input",{type:"text",id:"controllerAddress",value:o.controllerDetails.address,onChange:a=>q("address",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n)})]})]})]}),jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Lawful Basis (NDPA Section 25)"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasis",className:"ndpr-form-field__label",children:"Lawful Basis *"}),jsx("select",{id:"lawfulBasis",value:o.lawfulBasis,onChange:a=>c$1("lawfulBasis",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.select,n),children:T.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasisJustification",className:"ndpr-form-field__label",children:"Justification *"}),jsx("textarea",{id:"lawfulBasisJustification",value:o.lawfulBasisJustification,onChange:a=>c$1("lawfulBasisJustification",a.target.value),rows:2,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Explain why this lawful basis applies..."})]})]})]}),jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Data Details"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsx("label",{htmlFor:"purposes",className:"ndpr-form-field__label",children:"Purposes * (comma-separated)"}),jsx("input",{type:"text",id:"purposes",value:F,onChange:be,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Account management, Service delivery"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataCategories",className:"ndpr-form-field__label",children:"Data Categories * (comma-separated)"}),jsx("input",{type:"text",id:"dataCategories",value:I,onChange:he,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Name, Email, Phone number"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sensitiveData",className:"ndpr-form-field__label",children:"Sensitive Data Categories (comma-separated)"}),jsx("input",{type:"text",id:"sensitiveData",value:M,onChange:_e,className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Health data, Biometric data"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"subjectCategories",className:"ndpr-form-field__label",children:"Data Subject Categories * (comma-separated)"}),jsx("input",{type:"text",id:"subjectCategories",value:L,onChange:xe,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Customers, Employees"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recipients",className:"ndpr-form-field__label",children:"Recipients * (comma-separated)"}),jsx("input",{type:"text",id:"recipients",value:E,onChange:Ce,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Payment processors, Cloud service providers"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataSource",className:"ndpr-form-field__label",children:"Data Source *"}),jsx("select",{id:"dataSource",value:o.dataSource,onChange:a=>c$1("dataSource",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.select,n),children:Ee.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),o.dataSource==="third_party"&&jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"thirdPartyDetails",className:"ndpr-form-field__label",children:"Third-Party Source Details *"}),jsx("input",{type:"text",id:"thirdPartyDetails",value:o.thirdPartySourceDetails||"",onChange:a=>c$1("thirdPartySourceDetails",a.target.value||void 0),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe the third-party data source..."})]})]})]}),jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Retention and Security"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsx("label",{htmlFor:"retentionPeriod",className:"ndpr-form-field__label",children:"Retention Period *"}),jsx("input",{type:"text",id:"retentionPeriod",value:o.retentionPeriod,onChange:a=>c$1("retentionPeriod",a.target.value),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., 5 years after account closure"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"retentionJustification",className:"ndpr-form-field__label",children:"Retention Justification"}),jsx("input",{type:"text",id:"retentionJustification",value:o.retentionJustification||"",onChange:a=>c$1("retentionJustification",a.target.value||void 0),className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Why this retention period is necessary..."})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"securityMeasures",className:"ndpr-form-field__label",children:"Security Measures * (comma-separated)"}),jsx("input",{type:"text",id:"securityMeasures",value:O,onChange:ye,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Encryption at rest, Access controls, Audit logging"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"systemsUsed",className:"ndpr-form-field__label",children:"Systems Used (comma-separated)"}),jsx("input",{type:"text",id:"systemsUsed",value:j,onChange:Re,className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., CRM, ERP, Cloud Storage"})]})]})]}),jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Risk Indicators"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:"dpiaRequired",checked:o.dpiaRequired,onChange:a=>c$1("dpiaRequired",a.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"dpiaRequired",className:"ndpr-text-sm ndpr-font-medium",children:"DPIA Required"})]}),o.dpiaRequired&&jsxs("div",{children:[jsx("label",{htmlFor:"dpiaReference",className:"ndpr-form-field__label",children:"DPIA Reference *"}),jsx("input",{type:"text",id:"dpiaReference",value:o.dpiaReference||"",onChange:a=>c$1("dpiaReference",a.target.value||void 0),"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Reference to the completed DPIA"})]}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:"automatedDecisionMaking",checked:o.automatedDecisionMaking,onChange:a=>c$1("automatedDecisionMaking",a.target.checked),className:"ndpr-form-field__checkbox"}),jsx("label",{htmlFor:"automatedDecisionMaking",className:"ndpr-text-sm ndpr-font-medium",children:"Automated Decision-Making"})]}),o.automatedDecisionMaking&&jsxs("div",{children:[jsx("label",{htmlFor:"automatedDecisionMakingDetails",className:"ndpr-form-field__label",children:"Automated Decision-Making Details *"}),jsx("textarea",{id:"automatedDecisionMakingDetails",value:o.automatedDecisionMakingDetails||"",onChange:a=>c$1("automatedDecisionMakingDetails",a.target.value||void 0),rows:2,"aria-required":"true",className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe the automated decision-making process..."})]})]})]}),jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsx("legend",{className:"ndpr-badge",children:"Review Schedule"}),jsx("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:jsxs("div",{children:[jsx("label",{htmlFor:"nextReviewDate",className:"ndpr-form-field__label",children:"Next Review Date"}),jsx("input",{type:"date",id:"nextReviewDate",value:o.nextReviewDate?new Date(o.nextReviewDate).toISOString().slice(0,10):"",onChange:a=>c$1("nextReviewDate",a.target.value?new Date(a.target.value).getTime():void 0),className:a$2("ndpr-form-field__input",e==null?void 0:e.input,n)})]})})]}),jsxs("div",{className:"flex justify-end space-x-3",children:[jsx("button",{onClick:Q,className:"ndpr-button ndpr-button--secondary ndpr-button--sm",children:"Cancel"}),jsx("button",{onClick:ue,className:a$2(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${B}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),n),children:r?"Add Record":"Save Changes"})]})]})]})},Me=()=>jsxs("div",{className:"ndpr-section-divider ndpr-text-sm",children:[jsx("button",{onClick:De,className:`pb-2 text-sm font-medium ${f==="list"?"border-b-2 border-[rgb(var(--ndpr-primary))] ndpr-text-primary":"ndpr-text-muted hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Processing Records"}),jsx("button",{onClick:we,className:`pb-2 text-sm font-medium ${f==="summary"?"border-b-2 border-[rgb(var(--ndpr-primary))] ndpr-text-primary":"ndpr-text-muted hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Compliance Summary"})]});return jsxs("div",{className:a$2(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ae}`,e==null?void 0:e.root,n),children:[jsx("h2",{className:a$2("ndpr-section-heading",e==null?void 0:e.title,n),children:re}),jsx("p",{className:"ndpr-card__subtitle",children:ie}),ke(),f!=="form"&&Me(),f==="list"&&Be(),f==="summary"&&Ae(),f==="form"&&Ie()]})};export{$e as a};//# sourceMappingURL=chunk-VTITKWGX.mjs.map
2
+ //# sourceMappingURL=chunk-VTITKWGX.mjs.map
@@ -0,0 +1,81 @@
1
+ import {a as a$1}from'./chunk-DJGS7SSN.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var xe=({breachData:u,initialAssessment:f={},onComplete:y,title:J="Breach Risk Assessment",description:K="Assess the risk level of this data breach to determine notification requirements under NDPA Section 40.",submitButtonText:Z="Complete Assessment",className:se="",buttonClassName:Q="",classNames:b={},unstyled:o=false,showBreachSummary:l=true,showNotificationRequirements:C=true})=>{let[$,ae]=useState(f.confidentialityImpact||3),[B,h]=useState(f.integrityImpact||3),[_,S]=useState(f.availabilityImpact||3),[L,I]=useState(f.harmLikelihood||3),[j,T]=useState(f.harmSeverity||3),[O,q]=useState(f.risksToRightsAndFreedoms!==void 0?f.risksToRightsAndFreedoms:false),[U,H]=useState(f.highRisksToRightsAndFreedoms!==void 0?f.highRisksToRightsAndFreedoms:false),[X,ie]=useState(f.justification||""),[V,ne]=useState(0),[k,g]=useState("low"),[x,N]=useState(false),[R,z]=useState(0),[E,ee]=useState(0),[p,w]=useState(false),[M]=useState(()=>Date.now());useEffect(()=>{let W=$*.2+B*.1+_*.1+L*.3+j*.3;ne(Number(W.toFixed(1)));let Y;W<2?Y="low":W<3?Y="medium":W<4?Y="high":Y="critical",g(Y),N(O||Y==="high"||Y==="critical");let de=u.discoveredAt+4320*60*1e3;z(de);let pe=Date.now(),ue=(de-pe)/(3600*1e3);ee(Number(ue.toFixed(1)));},[$,B,_,L,j,O,u.discoveredAt]);let P=d=>new Date(d).toLocaleString(),a$1=d=>{d.preventDefault();let D={id:f.id||`assessment_${Date.now()}`,breachId:u.id,assessedAt:Date.now(),assessor:f.assessor||{name:"Assessment User",role:"Data Protection Officer",email:"dpo@example.com"},confidentialityImpact:$,integrityImpact:B,availabilityImpact:_,harmLikelihood:L,harmSeverity:j,overallRiskScore:V,riskLevel:k,risksToRightsAndFreedoms:O,highRisksToRightsAndFreedoms:U,justification:X};y(D),w(true);},m=d=>{switch(d){case 1:return "Minimal";case 2:return "Low";case 3:return "Moderate";case 4:return "High";case 5:return "Severe";default:return "Unknown"}},v=d=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--warning",critical:"ndpr-badge ndpr-badge--destructive"}[d]}`,b.riskBadge,o),children:d.charAt(0).toUpperCase()+d.slice(1)});return jsxs("div",{"data-ndpr-component":"breach-risk-assessment",className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${se}`,b.root,o),children:[jsx("h2",{className:a("ndpr-section-heading",b.title,o),children:J}),jsx("p",{className:"ndpr-card__subtitle",children:K}),l&&jsxs("div",{className:"ndpr-panel",children:[jsx("h3",{className:"text-lg font-medium mb-2",children:"Breach Summary"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Title:"})," ",u.title]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Discovered:"})," ",P(u.discoveredAt)]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",u.status.charAt(0).toUpperCase()+u.status.slice(1)]})]}),jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Data Types:"})," ",u.dataTypes.join(", ")]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",u.affectedSystems.join(", ")]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",u.estimatedAffectedSubjects||"Unknown"]})]})]})]}),p?jsxs("div",{children:[jsxs("div",{className:"ndpr-alert ndpr-alert--info",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Assessment Results"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Overall Risk Level:"})," ",v(k)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risk Score:"})," ",V," / 5"]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Assessed On:"})," ",P(M)]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",O?"Yes":"No"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",U?"Yes":"No"]})]})]}),jsxs("div",{className:"mt-3",children:[jsx("p",{className:"text-sm mb-1",children:jsx("span",{className:"font-medium",children:"Justification:"})}),jsx("p",{className:"text-sm bg-white dark:bg-gray-800 p-2 rounded",children:X})]})]}),C&&jsxs("div",{className:a(`mb-6 p-4 rounded-md ${x?E>24?"ndpr-alert ndpr-alert--warning":"ndpr-alert ndpr-alert--destructive":"ndpr-alert ndpr-alert--success"}`,b.notificationStatus,o),children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Requirements"}),x?jsxs("div",{children:[jsx("p",{className:`text-sm font-bold mb-2 ${E>24?"ndpr-text-warning":"ndpr-text-destructive"}`,children:"NDPC Notification Required"}),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."}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Notification Deadline:"})," ",P(R)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Time Remaining:"})," ",jsx("span",{className:E<24?"ndpr-text-destructive font-bold":"",children:E>0?`${E} hours`:"Deadline passed"})]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Data Subject Notification:"})," ",U?"Required (NDPA Section 40(4))":"Not required unless directed by NDPC"]})]}):jsxs("div",{children:[jsx("p",{className:"text-sm font-bold mb-2 ndpr-text-success",children:"NDPC Notification Not Required"}),jsx("p",{className:"text-sm mb-2",children:"Based on this assessment, this breach does not need to be reported to the NDPC."}),jsx("p",{className:"text-sm mb-2",children:"However, the breach should still be documented internally for compliance purposes."})]}),jsxs("div",{className:"mt-3 text-sm",children:[jsx("p",{className:"font-medium",children:"Next Steps:"}),jsx("ul",{className:"list-disc pl-5 mt-1",children:x?jsxs(Fragment,{children:[jsx("li",{children:"Prepare a notification report for the NDPC"}),jsx("li",{children:"Document all aspects of the breach and your response"}),U&&jsx("li",{children:"Prepare communications for affected data subjects"}),jsx("li",{children:"Implement measures to mitigate the impact of the breach"})]}):jsxs(Fragment,{children:[jsx("li",{children:"Document the breach and this assessment in your internal records"}),jsx("li",{children:"Implement measures to prevent similar breaches in the future"}),jsx("li",{children:"Review and update security measures as needed"})]})})]})]}),jsx("button",{onClick:()=>w(false),className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${Q}`,b.primaryButton||b.submitButton,o),children:"Edit Assessment"})]}):jsx("form",{onSubmit:a$1,children:jsxs("div",{className:"ndpr-form-section",children:[jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Impact Assessment"}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"confidentialityImpact",className:"ndpr-form-field__label",children:["Confidentiality Impact (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",children:"How much has the confidentiality of data been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"confidentialityImpact",min:"1",max:"5",step:"1",value:$,onChange:d=>ae(parseInt(d.target.value)),className:a("ndpr-form-field__range",b.slider,o)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[m($)," (",$,")"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"integrityImpact",className:"ndpr-form-field__label",children:["Integrity Impact (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",children:"How much has the integrity of data been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"integrityImpact",min:"1",max:"5",step:"1",value:B,onChange:d=>h(parseInt(d.target.value)),className:a("ndpr-form-field__range",b.slider,o)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(B)," (",B,")"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"availabilityImpact",className:"ndpr-form-field__label",children:["Availability Impact (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",children:"How much has the availability of data or systems been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"availabilityImpact",min:"1",max:"5",step:"1",value:_,onChange:d=>S(parseInt(d.target.value)),className:a("ndpr-form-field__range",b.slider,o)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(_)," (",_,")"]})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Risk to Data Subjects"}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"harmLikelihood",className:"ndpr-form-field__label",children:["Likelihood of Harm (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",children:"How likely is it that data subjects will experience harm?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"harmLikelihood",min:"1",max:"5",step:"1",value:L,onChange:d=>I(parseInt(d.target.value)),className:a("ndpr-form-field__range",b.slider,o)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(L)," (",L,")"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"harmSeverity",className:"ndpr-form-field__label",children:["Severity of Harm (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",children:"How severe would the harm be to affected data subjects?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"harmSeverity",min:"1",max:"5",step:"1",value:j,onChange:d=>T(parseInt(d.target.value)),className:a("ndpr-form-field__range",b.slider,o)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(j)," (",j,")"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("input",{type:"checkbox",id:"risksToRightsAndFreedoms",checked:O,onChange:d=>q(d.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),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"})]}),jsx("p",{className:"text-xs ndpr-text-muted 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."})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("input",{type:"checkbox",id:"highRisksToRightsAndFreedoms",checked:U,onChange:d=>H(d.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),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"})]}),jsx("p",{className:"text-xs ndpr-text-muted 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."})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Overall Assessment"}),jsxs("div",{className:"ndpr-panel",children:[jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsx("span",{className:"font-medium",children:"Overall Risk Score:"}),jsxs("span",{className:a("",b.riskScore,o),children:[V," / 5"]})]}),jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:"font-medium",children:"Risk Level:"}),v(k)]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"justification",className:"ndpr-form-field__label",children:["Justification for Assessment ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"justification",value:X,onChange:d=>ie(d.target.value),rows:4,placeholder:"Explain the reasoning behind your assessment, including any factors that influenced your decision.",className:"ndpr-form-field__input",required:true})]})]}),jsxs("div",{className:"ndpr-alert ndpr-alert--info",children:[jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"ndpr-text-info 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."})]}),jsx("div",{className:"mt-6",children:jsx("button",{type:"submit",className: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 ${Q}`,b.primaryButton||b.submitButton,o),children:Z})})]})})]})};var Se=({breachReports:u,riskAssessments:f,regulatoryNotifications:y,onSelectBreach:J,onRequestAssessment:K,onRequestNotification:Z,title:se="Breach Notification Manager",description:Q="Manage data breach notifications and track compliance with NDPA Section 40 requirements.",className:b="",buttonClassName:o="",classNames:l={},unstyled:C=false,showBreachDetails:$=true,showNotificationTimeline:ae=true,showDeadlineAlerts:B=true})=>{var P;let[h,_]=useState(null),[S,L]=useState(u),[I,j]=useState("all"),[T,O]=useState(""),[q,U]=useState("discoveredAt"),[H,X]=useState("desc");useEffect(()=>{let a=[...u];if(I!=="all"&&(a=a.filter(m=>m.status===I)),T){let m=T.toLowerCase();a=a.filter(v=>v.title.toLowerCase().includes(m)||v.description.toLowerCase().includes(m)||v.affectedSystems.some(d=>d.toLowerCase().includes(m))||v.dataTypes.some(d=>d.toLowerCase().includes(m)));}a.sort((m,v)=>{let d=0;switch(q){case "title":d=m.title.localeCompare(v.title);break;case "discoveredAt":d=m.discoveredAt-v.discoveredAt;break;case "status":d=m.status.localeCompare(v.status);break;case "riskLevel":let D=f.find(W=>W.breachId===m.id),F=f.find(W=>W.breachId===v.id),re=(D==null?void 0:D.riskLevel)||"unknown",oe=(F==null?void 0:F.riskLevel)||"unknown";d=re.localeCompare(oe);break;default:d=m.discoveredAt-v.discoveredAt;}return H==="asc"?d:-d}),L(a);},[u,I,T,q,H,f]),useEffect(()=>{S.length>0&&(h&&S.some(m=>m.id===h)||_(S[0].id));},[S,h]);let ie=a=>{_(a),J&&J(a);},V=()=>{h&&K&&K(h);},ne=()=>{h&&Z&&Z(h);},k=a=>new Date(a).toLocaleString(),g=h?u.find(a=>a.id===h):null,x=h?f.find(a=>a.breachId===h):null,N=h?y.find(a=>a.breachId===h):null,R=g?z(g,x):null;function z(a,m){let v=a$1(a,m||void 0),d=a.discoveredAt+v.timeframeHours*60*60*1e3;return {ndpcNotificationRequired:v.notificationRequired,ndpcNotificationDeadline:d,dataSubjectNotificationRequired:(m==null?void 0:m.highRisksToRightsAndFreedoms)||false,justification:v.justification}}function E(a){let m=Date.now(),v=(a-m)/(3600*1e3);return Number(v.toFixed(1))}let ee=a$1=>a$1?jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--warning",critical:"ndpr-badge ndpr-badge--destructive"}[a$1]}`,l.statusBadge,C),children:a$1.charAt(0).toUpperCase()+a$1.slice(1)}):null,p=a$1=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{ongoing:"ndpr-badge ndpr-badge--destructive",contained:"ndpr-badge ndpr-badge--warning",resolved:"ndpr-badge ndpr-badge--success"}[a$1]||"ndpr-badge ndpr-badge--neutral"}`,l.statusBadge,C),children:a$1.charAt(0).toUpperCase()+a$1.slice(1)}),w=()=>{if(!g||!R)return null;if(!R.ndpcNotificationRequired)return jsxs("div",{"data-ndpr-component":"breach-notification-manager",className:"ndpr-alert ndpr-alert--success",children:[jsx("p",{className:"text-sm ndpr-text-success font-medium",children:"Notification Not Required"}),jsx("p",{className:"text-xs ndpr-text-success mt-1",children:"Based on the risk assessment, NDPC notification is not required for this breach."})]});if(N)return jsxs("div",{className:"ndpr-alert ndpr-alert--success",children:[jsx("p",{className:"text-sm ndpr-text-success font-medium",children:"Notification Sent"}),jsxs("p",{className:"text-xs ndpr-text-success mt-1",children:["Notification was sent to the NDPC on ",k(N.sentAt),"."]})]});let a=E(R.ndpcNotificationDeadline);return a<=0?jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",children:[jsx("p",{className:"text-sm ndpr-text-destructive font-medium",children:"Notification Deadline Passed"}),jsx("p",{className:"text-xs ndpr-text-destructive mt-1",children:"The 72-hour deadline for NDPC notification has passed. Notification should be sent immediately."})]}):a<=24?jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",children:[jsx("p",{className:"text-sm ndpr-text-destructive font-medium",children:"Urgent: Notification Due Soon"}),jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["Only ",a," hours remaining until the NDPC notification deadline."]})]}):jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm ndpr-text-warning font-medium",children:"Notification Required"}),jsxs("p",{className:"text-xs ndpr-text-warning mt-1",children:["NDPC notification is required by ",k(R.ndpcNotificationDeadline)," (",a," hours remaining)."]})]})},M=()=>{if(!g)return null;let a$1=[{title:"Breach Discovered",date:g.discoveredAt,completed:true,description:`Breach was discovered on ${k(g.discoveredAt)}.`},{title:"Risk Assessment",date:x==null?void 0:x.assessedAt,completed:!!x,description:x?`Risk assessment completed on ${k(x.assessedAt)}.`:"Risk assessment has not been completed yet."}];return R!=null&&R.ndpcNotificationRequired&&a$1.push({title:"NDPC Notification",date:N==null?void 0:N.sentAt,completed:!!N,description:N?`Notification sent to the NDPC on ${k(N.sentAt)}.`:`Notification must be sent to the NDPC by ${k(R.ndpcNotificationDeadline)}.`}),R!=null&&R.dataSubjectNotificationRequired&&a$1.push({title:"Data Subject Notification",date:void 0,completed:false,description:"Notification to affected data subjects is required but has not been sent yet."}),jsxs("div",{className:a("mt-6",l.timeline,C),children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Notification Timeline"}),jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:a$1.map((m,v)=>jsxs("li",{className:a("mb-6 ml-4",l.timelineStep,C),children:[jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${m.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"}`}),jsx("time",{className:"mb-1 text-sm font-normal leading-none ndpr-text-muted",children:m.date?k(m.date):"Pending"}),jsx("h4",{className:"ndpr-section-heading",children:m.title}),jsx("p",{className:"ndpr-form-field__hint",children:m.description})]},v))})]})};return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${b}`,l.root,C),children:[jsxs("div",{className:a("",l.header,C),children:[jsx("h2",{className:a("ndpr-section-heading",l.title,C),children:se}),jsx("p",{className:"ndpr-card__subtitle",children:Q})]}),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"statusFilter",className:"ndpr-form-field__label",children:"Status Filter"}),jsxs("select",{id:"statusFilter",value:I,onChange:a=>j(a.target.value),className:"ndpr-form-field__input",children:[jsx("option",{value:"all",children:"All Statuses"}),jsx("option",{value:"ongoing",children:"Ongoing"}),jsx("option",{value:"contained",children:"Contained"}),jsx("option",{value:"resolved",children:"Resolved"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sortBy",className:"ndpr-form-field__label",children:"Sort By"}),jsxs("select",{id:"sortBy",value:q,onChange:a=>U(a.target.value),className:"ndpr-form-field__input",children:[jsx("option",{value:"discoveredAt",children:"Discovery Date"}),jsx("option",{value:"title",children:"Title"}),jsx("option",{value:"status",children:"Status"}),jsx("option",{value:"riskLevel",children:"Risk Level"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"searchTerm",className:"ndpr-form-field__label",children:"Search"}),jsx("input",{type:"text",id:"searchTerm",value:T,onChange:a=>O(a.target.value),placeholder:"Search breaches...",className:"ndpr-form-field__input"})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxs("div",{className:"md:col-span-1",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Breach Reports"}),S.length===0?jsx("p",{className:"ndpr-card__subtitle",children:"No breach reports found."}):jsx("div",{className:a("space-y-2 max-h-96 overflow-y-auto pr-2",l.breachList,C),children:S.map(a$1=>{let m=f.find(F=>F.breachId===a$1.id),v=y.find(F=>F.breachId===a$1.id),d=z(a$1,m),D=null;if(d!=null&&d.ndpcNotificationRequired)if(v)D=jsx("span",{className:"text-xs ndpr-text-success",children:"Notified"});else {let F=E(d.ndpcNotificationDeadline);F<=0?D=jsx("span",{className:"text-xs ndpr-text-destructive font-bold",children:"Overdue"}):F<=24?D=jsx("span",{className:"text-xs ndpr-text-destructive",children:"Urgent"}):D=jsx("span",{className:"text-xs ndpr-text-warning",children:"Required"});}else D=jsx("span",{className:"text-xs ndpr-text-success",children:"Not Required"});return jsxs("div",{className:a(`p-3 rounded-md cursor-pointer ${h===a$1.id?"ndpr-alert ndpr-alert--info":"ndpr-panel"}`,l.breachItem,C),onClick:()=>ie(a$1.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:a$1.title}),p(a$1.status)]}),jsxs("p",{className:"text-xs ndpr-text-muted mb-1",children:["Discovered: ",new Date(a$1.discoveredAt).toLocaleDateString()]}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsx("div",{children:m&&ee(m.riskLevel)}),jsx("div",{children:D})]})]},a$1.id)})})]}),jsx("div",{className:a("md:col-span-2",l.detailPanel,C),children:g?jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsx("h3",{className:"ndpr-section-heading",children:g.title}),p(g.status)]}),B&&jsx("div",{className:"ndpr-form-field",children:w()}),$&&jsxs("div",{className:"mb-6",children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Discovered:"})," ",k(g.discoveredAt)]}),g.occurredAt&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Occurred:"})," ",k(g.occurredAt)]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Reporter:"})," ",g.reporter.name]})]}),jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",g.affectedSystems.join(", ")]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Data Types:"})," ",g.dataTypes.join(", ")]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",g.estimatedAffectedSubjects||"Unknown"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-text-sm ndpr-font-medium",children:"Description:"}),jsx("p",{className:"ndpr-panel",children:g.description})]}),g.initialActions&&jsxs("div",{children:[jsx("p",{className:"ndpr-text-sm ndpr-font-medium",children:"Initial Actions Taken:"}),jsx("p",{className:"ndpr-panel",children:g.initialActions})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Risk Assessment"}),x?jsxs("div",{className:"ndpr-panel",children:[jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsx("p",{className:"ndpr-text-sm ndpr-font-medium",children:"Risk Level:"}),ee(x.riskLevel)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risk Score:"})," ",x.overallRiskScore," / 5"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",x.risksToRightsAndFreedoms?"Yes":"No"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",x.highRisksToRightsAndFreedoms?"Yes":"No"]}),jsx("p",{className:"text-sm mb-1",children:jsx("span",{className:"font-medium",children:"Justification:"})}),jsx("p",{className:"text-xs ndpr-text-muted bg-white dark:bg-gray-800 p-2 rounded-md",children:x.justification})]}):jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm ndpr-text-warning",children:"Risk assessment has not been conducted yet."}),jsx("button",{onClick:V,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${o}`,children:"Conduct Risk Assessment"})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Status"}),N?jsxs("div",{className:"ndpr-panel",children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Notification Sent:"})," ",k(N.sentAt)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Method:"})," ",N.method.charAt(0).toUpperCase()+N.method.slice(1)]}),N.referenceNumber&&jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Reference Number:"})," ",N.referenceNumber]}),(N.ndpcContact||N.nitdaContact)&&jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"NDPC Contact:"})," ",(P=N.ndpcContact||N.nitdaContact)==null?void 0:P.name]})]}):jsx("div",{children:R!=null&&R.ndpcNotificationRequired?jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm ndpr-text-warning",children:"NDPC notification is required but has not been sent yet."}),jsx("button",{onClick:ne,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${o}`,children:"Generate Notification"})]}):jsx("div",{className:"ndpr-alert ndpr-alert--success",children:jsx("p",{className:"text-sm ndpr-text-success",children:"NDPC notification is not required for this breach."})})})]}),ae&&M()]}):jsx("div",{className:"ndpr-empty-state",children:jsx("p",{className:"ndpr-card__subtitle",children:"Select a breach to view details"})})})]})]})};var Te=({breachData:u,assessmentData:f,organizationInfo:y,onGenerate:J,title:K="Generate NDPC Notification Report",description:Z="Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements.",generateButtonText:se="Generate Report",className:Q="",buttonClassName:b="",classNames:o={},unstyled:l=false,showPreview:C=true,allowEditing:$=true,allowDownload:ae=true,downloadFormat:B="pdf"})=>{let[h,_]=useState(""),[S,L]=useState(""),[I,j]=useState(""),[T,O]=useState(""),[q,U]=useState("email"),[H,X]=useState(""),[ie,V]=useState(""),[ne,k]=useState(false),[g,x]=useState(false);useEffect(()=>{let p=R();_(p),k(true);},[u,f,y]);let N=p=>new Date(p).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),R=()=>`
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: ${y.name}
11
+ ${y.registrationNumber?`Registration Number: ${y.registrationNumber}`:""}
12
+ Address: ${y.address}
13
+ ${y.website?`Website: ${y.website}`:""}
14
+
15
+ DATA PROTECTION OFFICER
16
+ ----------------------
17
+ Name: ${y.dpoName}
18
+ Email: ${y.dpoEmail}
19
+ ${y.dpoPhone?`Phone: ${y.dpoPhone}`:""}
20
+
21
+ BREACH DETAILS
22
+ -------------
23
+ Breach Title: ${u.title}
24
+ Date Discovered: ${N(u.discoveredAt)}
25
+ ${u.occurredAt?`Date Occurred: ${N(u.occurredAt)}`:"Date Occurred: Unknown"}
26
+ Status: ${u.status.charAt(0).toUpperCase()+u.status.slice(1)}
27
+
28
+ Description of the Breach:
29
+ ${u.description}
30
+
31
+ Affected Systems/Applications:
32
+ ${u.affectedSystems.join(", ")}
33
+
34
+ Types of Personal Data Involved:
35
+ ${u.dataTypes.join(", ")}
36
+
37
+ Estimated Number of Data Subjects Affected:
38
+ ${u.estimatedAffectedSubjects||"Unknown"}
39
+
40
+ RISK ASSESSMENT
41
+ --------------
42
+ ${f?`
43
+ Overall Risk Level: ${f.riskLevel.charAt(0).toUpperCase()+f.riskLevel.slice(1)}
44
+ Risk to Rights and Freedoms of Data Subjects: ${f.risksToRightsAndFreedoms?"Yes":"No"}
45
+ High Risk to Rights and Freedoms of Data Subjects: ${f.highRisksToRightsAndFreedoms?"Yes":"No"}
46
+
47
+ Justification for Risk Assessment:
48
+ ${f.justification}
49
+ `:"Risk assessment has not been conducted yet."}
50
+
51
+ MEASURES TAKEN
52
+ -------------
53
+ Measures taken or proposed to address the breach:
54
+ ${u.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 w={id:`notification_${Date.now()}`,breachId:u.id,sentAt:Date.now(),method:q,referenceNumber:H||void 0,ndpcContact:S?{name:S,email:I,phone:T||void 0}:void 0,content:h,attachments:[]};J(w),x(true);},E=()=>{let p,w,M;switch(B){case "html":{p="text/html",w="html",M=`<!DOCTYPE html>
72
+ <html lang="en">
73
+ <head>
74
+ <meta charset="UTF-8">
75
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
76
+ <title>NDPC Breach Notification Report</title>
77
+ <style>body{font-family:monospace;white-space:pre-wrap;max-width:800px;margin:2rem auto;padding:0 1rem;}</style>
78
+ </head>
79
+ <body>${h.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}</body>
80
+ </html>`;break}case "pdf":p="text/plain",w="pdf.txt",M=h;break;case "docx":p="text/plain",w="docx.txt",M=h;break;default:p="text/plain",w="txt",M=h;}let P=document.createElement("a"),a=new Blob([M],{type:p});P.href=URL.createObjectURL(a),P.download=`NDPC_Breach_Notification_${new Date().toISOString().split("T")[0]}.${w}`,document.body.appendChild(P),P.click(),document.body.removeChild(P);},ee=()=>[{value:"email",label:"Email"},{value:"portal",label:"NDPC Portal"},{value:"letter",label:"Formal Letter"},{value:"other",label:"Other"}].map(w=>jsx("option",{value:w.value,children:w.label},w.value));return jsxs("div",{"data-ndpr-component":"regulatory-report-generator",className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,o.root,l),children:[jsxs("div",{className:a("",o.header,l),children:[jsx("h2",{className:a("ndpr-section-heading",o.title,l),children:K}),jsx("p",{className:"ndpr-card__subtitle",children:Z})]}),g?jsxs("div",{children:[jsxs("div",{className:"ndpr-alert ndpr-alert--success",children:[jsx("h3",{className:"text-lg font-bold ndpr-text-success mb-2",children:"Report Generated Successfully"}),jsx("p",{className:"ndpr-text-success",children:"Your NDPC notification report has been generated and is ready for submission. Please review the report carefully before submitting it to the NDPC."})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"ndpr-section-heading",children:"Submission Details"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:a("ndpr-text-sm",o.field,l),children:[jsx("span",{className:a("font-medium",o.fieldLabel,l),children:"Method:"})," ",jsx("span",{className:a("",o.fieldValue,l),children:q.charAt(0).toUpperCase()+q.slice(1)})]}),S&&jsxs("p",{className:a("ndpr-text-sm",o.field,l),children:[jsx("span",{className:a("font-medium",o.fieldLabel,l),children:"Contact Name:"})," ",jsx("span",{className:a("",o.fieldValue,l),children:S})]}),I&&jsxs("p",{className:a("ndpr-text-sm",o.field,l),children:[jsx("span",{className:a("font-medium",o.fieldLabel,l),children:"Contact Email:"})," ",jsx("span",{className:a("",o.fieldValue,l),children:I})]}),T&&jsxs("p",{className:a("ndpr-text-sm",o.field,l),children:[jsx("span",{className:a("font-medium",o.fieldLabel,l),children:"Contact Phone:"})," ",jsx("span",{className:a("",o.fieldValue,l),children:T})]})]}),jsxs("div",{children:[jsxs("p",{className:a("ndpr-text-sm",o.field,l),children:[jsx("span",{className:a("font-medium",o.fieldLabel,l),children:"Date Generated:"})," ",jsx("span",{className:a("",o.fieldValue,l),children:N(Date.now())})]}),jsxs("p",{className:a("ndpr-text-sm",o.field,l),children:[jsx("span",{className:a("font-medium",o.fieldLabel,l),children:"Breach ID:"})," ",jsx("span",{className:a("",o.fieldValue,l),children:u.id})]}),H&&jsxs("p",{className:a("ndpr-text-sm",o.field,l),children:[jsx("span",{className:a("font-medium",o.fieldLabel,l),children:"Reference Number:"})," ",jsx("span",{className:a("",o.fieldValue,l),children:H})]})]})]})]}),C&&jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"ndpr-section-heading",children:"Report Preview"}),jsx("div",{className:a("ndpr-panel",o.reportPreview,l),children:jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:h})})]}),jsxs("div",{className:"ndpr-card__footer",children:[ae&&jsxs("button",{onClick:E,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${b}`,o.secondaryButton||o.downloadButton,l),children:["Download Report (",B.toUpperCase(),")"]}),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 ${b}`,children:"Edit Report"})]})]}):jsx("form",{onSubmit:z,children:jsxs("div",{className:"ndpr-form-section",children:[jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Notification Method"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"method",className:"ndpr-form-field__label",children:["Method of Submission ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("select",{id:"method",value:q,onChange:p=>U(p.target.value),className:"ndpr-form-field__input",required:true,children:ee()})]}),jsxs("div",{children:[jsx("label",{htmlFor:"referenceNumber",className:"ndpr-form-field__label",children:"Reference Number (if available)"}),jsx("input",{type:"text",id:"referenceNumber",value:H,onChange:p=>X(p.target.value),placeholder:"e.g. NDPC/BR/2024/001",className:"ndpr-form-field__input"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"NDPC Contact (if known)"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[jsxs("div",{children:[jsx("label",{htmlFor:"contactName",className:"ndpr-form-field__label",children:"Contact Name"}),jsx("input",{type:"text",id:"contactName",value:S,onChange:p=>L(p.target.value),className:"ndpr-form-field__input"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"contactEmail",className:"ndpr-form-field__label",children:"Contact Email"}),jsx("input",{type:"email",id:"contactEmail",value:I,onChange:p=>j(p.target.value),className:"ndpr-form-field__input"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"contactPhone",className:"ndpr-form-field__label",children:"Contact Phone"}),jsx("input",{type:"tel",id:"contactPhone",value:T,onChange:p=>O(p.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Additional Information"}),jsxs("div",{children:[jsx("label",{htmlFor:"additionalInfo",className:"ndpr-form-field__label",children:"Additional Information to Include"}),jsx("textarea",{id:"additionalInfo",value:ie,onChange:p=>V(p.target.value),rows:3,placeholder:"Any additional information you want to include in the report",className:"ndpr-form-field__input"})]})]}),$&&jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Report Content"}),jsxs("div",{children:[jsxs("label",{htmlFor:"reportContent",className:"ndpr-form-field__label",children:["Edit Report Content ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"reportContent",value:h,onChange:p=>_(p.target.value),rows:20,className:"ndpr-form-field__input ndpr-form-field__input--mono",required:true})]})]}),jsxs("div",{className:"ndpr-alert ndpr-alert--info",children:[jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"ndpr-text-info 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."})]}),jsx("div",{className:"mt-6",children:jsx("button",{type:"submit",className: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 ${b}`,o.primaryButton||o.generateButton,l),children:se})})]})})]})};export{xe as a,Se as b,Te as c};//# sourceMappingURL=chunk-WH6ZMUOS.mjs.map
81
+ //# sourceMappingURL=chunk-WH6ZMUOS.mjs.map
@@ -0,0 +1,3 @@
1
+ 'use strict';var chunkI54CDQGN_js=require('./chunk-I54CDQGN.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var ke=({categories:pe,onSubmit:fe,onValidationError:y,title:ge="Report a Data Breach",formDescription:be="Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40. All fields marked with * are required.",submitButtonText:he="Submit Report",className:P="",buttonClassName:M="",classNames:d={},unstyled:c=false,isSubmitting:b=false,showConfirmation:ve=true,confirmationMessage:Ne="Your breach report has been submitted successfully. The data protection team has been notified.",allowAttachments:ue=true,maxAttachments:A=5,maxFileSize:x=5*1024*1024,allowedFileTypes:S=[".pdf",".jpg",".jpeg",".png",".doc",".docx",".xls",".xlsx",".txt"],defaultValues:t,onReset:D})=>{var ae,ne,oe,se,de;let z=r=>{if(!r)return "";let n=new Date(r),l=o=>String(o).padStart(2,"0");return `${n.getFullYear()}-${l(n.getMonth()+1)}-${l(n.getDate())}T${l(n.getHours())}:${l(n.getMinutes())}`},[C,L]=react.useState((t==null?void 0:t.title)||""),[w,O]=react.useState((t==null?void 0:t.description)||""),[F,Y]=react.useState((t==null?void 0:t.category)||""),[T,U]=react.useState(z(t==null?void 0:t.discoveredAt)),[R,H]=react.useState(z(t==null?void 0:t.occurredAt)),[q,Z]=react.useState(((ae=t==null?void 0:t.reporter)==null?void 0:ae.name)||""),[N,G]=react.useState(((ne=t==null?void 0:t.reporter)==null?void 0:ne.email)||""),[B,K]=react.useState(((oe=t==null?void 0:t.reporter)==null?void 0:oe.department)||""),[j,W]=react.useState(((se=t==null?void 0:t.reporter)==null?void 0:se.phone)||""),[J,Q]=react.useState((t==null?void 0:t.affectedSystems)||[]),[_e,X]=react.useState(((de=t==null?void 0:t.affectedSystems)==null?void 0:de.join(", "))||""),[k,V]=react.useState((t==null?void 0:t.dataTypes)||[]),[h,ee]=react.useState((t==null?void 0:t.estimatedAffectedSubjects)!=null?String(t.estimatedAffectedSubjects):""),[re,te]=react.useState((t==null?void 0:t.status)||"ongoing"),[E,ie]=react.useState((t==null?void 0:t.initialActions)||""),[u,I]=react.useState([]),[ye,$]=react.useState(false),[a,v]=react.useState({}),Ae=()=>{L(""),O(""),Y(""),U(""),H(""),Z(""),G(""),K(""),W(""),Q([]),X(""),V([]),ee(""),te("ongoing"),ie(""),I([]),$(false),v({}),D==null||D();},xe=r=>{let n=r.target.value;X(n);let l=n.split(",").map(o=>o.trim()).filter(Boolean);Q(l);},Se=r=>{V(n=>n.includes(r)?n.filter(l=>l!==r):[...n,r]);},De=r=>{var me;let n=r.target.files;if(!n)return;let l=[],o={};if(u.length+n.length>A){o.attachments=`Maximum of ${A} files allowed`,v(p=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},p),o));return}for(let p=0;p<n.length;p++){let _=n[p];if(_.size>x){o.attachments=`File ${_.name} exceeds the maximum size of ${x/(1024*1024)}MB`;continue}let ce="."+((me=_.name.split(".").pop())==null?void 0:me.toLowerCase());if(!S.includes(ce)){o.attachments=`File type ${ce} is not allowed`;continue}l.push(_);}l.length>0&&I(p=>[...p,...l]),Object.keys(o).length>0?v(p=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},p),o)):v(p=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},p),{attachments:""}));},Ce=r=>{I(n=>n.filter((l,o)=>o!==r));},we=()=>{let r={};return C.trim()||(r.breachTitle="Breach title is required"),w.trim()||(r.description="Description is required"),F||(r.category="Category is required"),T||(r.discoveredAt="Discovery date is required"),q.trim()||(r.reporterName="Reporter name is required"),N.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(N)||(r.reporterEmail="Reporter email is invalid"):r.reporterEmail="Reporter email is required",B.trim()||(r.reporterDepartment="Reporter department is required"),J.length===0&&(r.affectedSystems="At least one affected system is required"),k.length===0&&(r.dataTypes="At least one data type is required"),h&&isNaN(Number(h))&&(r.estimatedAffectedSubjects="Estimated affected subjects must be a number"),v(r),r},Fe=r=>{r.preventDefault();let n=we();if(Object.keys(n).length>0){y==null||y(n);return}let l={title:chunkI54CDQGN_js.a(C),description:chunkI54CDQGN_js.a(w),category:F,discoveredAt:new Date(T).getTime(),occurredAt:R?new Date(R).getTime():void 0,reportedAt:Date.now(),reporter:{name:chunkI54CDQGN_js.a(q),email:chunkI54CDQGN_js.a(N),department:chunkI54CDQGN_js.a(B),phone:j?chunkI54CDQGN_js.a(j):void 0},affectedSystems:J.map(o=>chunkI54CDQGN_js.a(o)),dataTypes:k,estimatedAffectedSubjects:h?Number(h):void 0,status:re,initialActions:E?chunkI54CDQGN_js.a(E):void 0,attachments:u.map(o=>({name:o.name,type:o.type,size:o.size,file:o}))};fe(l),ve&&$(true);};if(ye)return jsxRuntime.jsxs("div",{"data-ndpr-component":"breach-report-form",className:`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${P}`,children:[jsxRuntime.jsx("h2",{className:"text-lg font-bold ndpr-text-success mb-2",children:"Report Submitted"}),jsxRuntime.jsx("p",{className:"ndpr-text-success",children:Ne}),jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold ndpr-text-warning mb-2",children:"Important: Next Steps"}),jsxRuntime.jsx("p",{className:"ndpr-text-warning text-sm",children:"Under the 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. The data protection team will assess this breach and determine if notification is required."})]}),jsxRuntime.jsx("button",{onClick:()=>$(false),className:`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${M}`,children:"Report Another Breach"})]});let Te=[{id:"personal",label:"Personal Information (names, addresses)"},{id:"contact",label:"Contact Information (email, phone)"},{id:"financial",label:"Financial Information (bank details, payment info)"},{id:"health",label:"Health Information"},{id:"identification",label:"Identification Documents (ID cards, passports)"},{id:"login",label:"Login Credentials"},{id:"biometric",label:"Biometric Data"},{id:"children",label:"Children's Data"},{id:"location",label:"Location Data"},{id:"communications",label:"Communications Content"}];return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${P}`,d.root,c),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("ndpr-section-heading",d.title,c),children:ge}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:be}),jsxRuntime.jsx("form",{onSubmit:Fe,className:chunkE64TU6IU_js.a("",d.form,c),children:jsxRuntime.jsxs("div",{className:"ndpr-form-section",children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",d.fieldGroup,c),children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Breach Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"breachTitle",className:chunkE64TU6IU_js.a("ndpr-form-field__label",d.label,c),children:["Breach Title/Summary ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"breachTitle",value:C,onChange:r=>L(r.target.value),className:chunkE64TU6IU_js.a("ndpr-form-field__input",d.input,c),required:true,"aria-invalid":!!a.breachTitle,"aria-describedby":a.breachTitle?"breachTitle-error":void 0}),a.breachTitle&&jsxRuntime.jsx("p",{id:"breachTitle-error",role:"alert",className:"ndpr-form-field__error",children:a.breachTitle})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"category",className:chunkE64TU6IU_js.a("ndpr-form-field__label",d.label,c),children:["Breach Category ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsxs("select",{id:"category",value:F,onChange:r=>Y(r.target.value),className:chunkE64TU6IU_js.a("ndpr-form-field__input",d.select,c),required:true,"aria-invalid":!!a.category,"aria-describedby":a.category?"category-error":void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select a category"}),pe.map(r=>jsxRuntime.jsx("option",{value:r.id,children:r.name},r.id))]}),a.category&&jsxRuntime.jsx("p",{id:"category-error",role:"alert",className:"ndpr-form-field__error",children:a.category})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"description",className:chunkE64TU6IU_js.a("ndpr-form-field__label",d.label,c),children:["Detailed Description ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"description",value:w,onChange:r=>O(r.target.value),rows:4,className:chunkE64TU6IU_js.a("ndpr-form-field__input",d.textarea,c),required:true,"aria-invalid":!!a.description,"aria-describedby":a.description?"description-error":void 0}),a.description&&jsxRuntime.jsx("p",{id:"description-error",role:"alert",className:"ndpr-form-field__error",children:a.description})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"discoveredAt",className:"ndpr-form-field__label",children:["Date Discovered ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"datetime-local",id:"discoveredAt",value:T,onChange:r=>U(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.discoveredAt,"aria-describedby":a.discoveredAt?"discoveredAt-error":void 0}),a.discoveredAt&&jsxRuntime.jsx("p",{id:"discoveredAt-error",role:"alert",className:"ndpr-form-field__error",children:a.discoveredAt})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"occurredAt",className:"ndpr-form-field__label",children:"Date Occurred (if known)"}),jsxRuntime.jsx("input",{type:"datetime-local",id:"occurredAt",value:R,onChange:r=>H(r.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Reporter Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterName",className:"ndpr-form-field__label",children:["Your Name ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"reporterName",value:q,onChange:r=>Z(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.reporterName,"aria-describedby":a.reporterName?"reporterName-error":void 0}),a.reporterName&&jsxRuntime.jsx("p",{id:"reporterName-error",role:"alert",className:"ndpr-form-field__error",children:a.reporterName})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterEmail",className:"ndpr-form-field__label",children:["Your Email ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",id:"reporterEmail",value:N,onChange:r=>G(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.reporterEmail,"aria-describedby":a.reporterEmail?"reporterEmail-error":void 0}),a.reporterEmail&&jsxRuntime.jsx("p",{id:"reporterEmail-error",role:"alert",className:"ndpr-form-field__error",children:a.reporterEmail})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterDepartment",className:"ndpr-form-field__label",children:["Your Department ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"reporterDepartment",value:B,onChange:r=>K(r.target.value),className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.reporterDepartment,"aria-describedby":a.reporterDepartment?"reporterDepartment-error":void 0}),a.reporterDepartment&&jsxRuntime.jsx("p",{id:"reporterDepartment-error",role:"alert",className:"ndpr-form-field__error",children:a.reporterDepartment})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"reporterPhone",className:"ndpr-form-field__label",children:"Your Phone Number (Optional)"}),jsxRuntime.jsx("input",{type:"tel",id:"reporterPhone",value:j,onChange:r=>W(r.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Impact Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"affectedSystems",className:"ndpr-form-field__label",children:["Affected Systems/Applications ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"affectedSystems",value:_e,onChange:xe,placeholder:"e.g. CRM, Email Server, Website (comma separated)",className:"ndpr-form-field__input",required:true,"aria-invalid":!!a.affectedSystems,"aria-describedby":a.affectedSystems?"affectedSystems-error":void 0}),a.affectedSystems&&jsxRuntime.jsx("p",{id:"affectedSystems-error",role:"alert",className:"ndpr-form-field__error",children:a.affectedSystems})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"estimatedAffectedSubjects",className:"ndpr-form-field__label",children:"Estimated Number of Affected Data Subjects"}),jsxRuntime.jsx("input",{type:"text",id:"estimatedAffectedSubjects",value:h,onChange:r=>ee(r.target.value),placeholder:"e.g. 100",className:"ndpr-form-field__input","aria-invalid":!!a.estimatedAffectedSubjects,"aria-describedby":a.estimatedAffectedSubjects?"estimatedAffectedSubjects-error":void 0}),a.estimatedAffectedSubjects&&jsxRuntime.jsx("p",{id:"estimatedAffectedSubjects-error",role:"alert",className:"ndpr-form-field__error",children:a.estimatedAffectedSubjects})]}),jsxRuntime.jsxs("fieldset",{className:"md:col-span-2",children:[jsxRuntime.jsxs("legend",{className:"ndpr-form-field__label",children:["Types of Data Involved ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:Te.map(r=>jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"checkbox",id:`dataType_${r.id}`,checked:k.includes(r.id),onChange:()=>Se(r.id),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:`dataType_${r.id}`,className:"ml-2 text-sm ndpr-text-muted",children:r.label})]},r.id))}),a.dataTypes&&jsxRuntime.jsx("p",{id:"dataTypes-error",role:"alert",className:"ndpr-form-field__error",children:a.dataTypes})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"status",className:"ndpr-form-field__label",children:["Current Status ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsxs("select",{id:"status",value:re,onChange:r=>te(r.target.value),className:chunkE64TU6IU_js.a("ndpr-form-field__input",d.select,c),required:true,children:[jsxRuntime.jsx("option",{value:"ongoing",children:"Ongoing (breach is still active)"}),jsxRuntime.jsx("option",{value:"contained",children:"Contained (breach is stopped but not resolved)"}),jsxRuntime.jsx("option",{value:"resolved",children:"Resolved (breach is fully addressed)"})]})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"initialActions",className:"ndpr-form-field__label",children:"Initial Actions Taken"}),jsxRuntime.jsx("textarea",{id:"initialActions",value:E,onChange:r=>ie(r.target.value),placeholder:"Describe any immediate actions that have been taken to address the breach",rows:3,className:chunkE64TU6IU_js.a("ndpr-form-field__input",d.textarea,c)})]})]})]}),ue&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:"Attachments"}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("label",{className:"ndpr-form-field__label",children:"Upload Supporting Files (Optional)"}),jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-muted mb-2",children:["Max ",A," files, ",x/(1024*1024),"MB each. Allowed types: ",S.join(", ")]}),jsxRuntime.jsx("input",{type:"file",onChange:De,multiple:true,className:"ndpr-form-field__input",accept:S.join(",")}),a.attachments&&jsxRuntime.jsx("p",{id:"attachments-error",role:"alert",className:"ndpr-form-field__error",children:a.attachments})]}),u.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("h4",{className:"ndpr-form-field__label",children:"Attached Files:"}),jsxRuntime.jsx("ul",{className:"ndpr-form-section",children:u.map((r,n)=>jsxRuntime.jsxs("li",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 ndpr-text-muted mr-2",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M8 4a3 3 0 00-3 3v4a5 5 0 0010 0V7a1 1 0 112 0v4a7 7 0 11-14 0V7a5 5 0 0110 0v4a3 3 0 11-6 0V7a1 1 0 012 0v4a1 1 0 102 0V7a3 3 0 00-3-3z",clipRule:"evenodd"})}),jsxRuntime.jsx("span",{className:"text-sm ndpr-text-muted",children:r.name}),jsxRuntime.jsxs("span",{className:"ml-2 text-xs ndpr-text-muted",children:["(",(r.size/1024).toFixed(1)," KB)"]})]}),jsxRuntime.jsx("button",{type:"button",onClick:()=>Ce(n),className:"text-red-500 hover:ndpr-text-destructive",children:jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]},n))})]})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("ndpr-alert ndpr-alert--info",d.notice,c),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"ndpr-text-info 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. The data protection team will assess this breach and determine if notification is required."})]}),jsxRuntime.jsxs("div",{className:"mt-6 relative flex gap-3",children:[b&&d.loadingOverlay&&jsxRuntime.jsx("div",{className:d.loadingOverlay}),jsxRuntime.jsx("button",{type:"submit",disabled:b,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 ${M} ${b?"opacity-50 cursor-not-allowed":""}`,d.primaryButton||d.submitButton,c),children:b?"Submitting...":he}),jsxRuntime.jsx("button",{type:"button",onClick:Ae,disabled:b,className:chunkE64TU6IU_js.a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,c),children:"Reset"})]})]})})]})};
2
+ exports.a=ke;//# sourceMappingURL=chunk-WTJGLNTB.js.map
3
+ //# sourceMappingURL=chunk-WTJGLNTB.js.map
@@ -0,0 +1,2 @@
1
+ import {a as a$1}from'./chunk-WWT2ZSNU.mjs';var i={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 a(e){if(!e)return i;let r=a$1({},i);for(let t of Object.keys(e))e[t]&&(r[t]=a$1(a$1({},i[t]),e[t]));return r}export{i as a,a as b};//# sourceMappingURL=chunk-XHROISIF.mjs.map
2
+ //# sourceMappingURL=chunk-XHROISIF.mjs.map
@@ -0,0 +1,15 @@
1
+ 'use strict';var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js');var m=[{id:"full-name",label:"Full Name",group:"identity",dataPoints:["first name","last name","middle name","title"],selected:false},{id:"contact-details",label:"Contact Details",group:"identity",dataPoints:["email address","phone number","postal address"],selected:false},{id:"government-ids",label:"Government-Issued Identifiers",group:"identity",dataPoints:["NIN","passport number","driver's licence number","voter's card number"],selected:false},{id:"account-credentials",label:"Account Credentials",group:"identity",dataPoints:["username","hashed password","security questions"],selected:false},{id:"payment-info",label:"Payment Information",group:"financial",dataPoints:["credit/debit card number","bank account number","billing address"],selected:false},{id:"financial-records",label:"Financial Records",group:"financial",dataPoints:["transaction history","account balance","income details"],selected:false},{id:"bvn",label:"Bank Verification Number (BVN)",group:"financial",dataPoints:["BVN"],selected:false},{id:"device-info",label:"Device & Browser Information",group:"behavioral",dataPoints:["IP address","browser type","operating system","device identifiers"],selected:false},{id:"usage-data",label:"Usage & Analytics Data",group:"behavioral",dataPoints:["pages visited","click patterns","session duration","referral source"],selected:false},{id:"location-data",label:"Location Data",group:"behavioral",dataPoints:["GPS coordinates","city","country","timezone"],selected:false},{id:"cookies",label:"Cookies & Tracking Technologies",group:"behavioral",dataPoints:["cookie identifiers","pixel tags","local storage data"],selected:false},{id:"health-data",label:"Health & Medical Data",group:"sensitive",dataPoints:["medical history","prescriptions","health insurance details","disability status"],selected:false},{id:"biometric-data",label:"Biometric Data",group:"sensitive",dataPoints:["fingerprints","facial recognition data","voiceprints"],selected:false},{id:"ethnic-religious",label:"Ethnic Origin & Religious Beliefs",group:"sensitive",dataPoints:["ethnic origin","religious affiliation","political opinions"],selected:false},{id:"child-identity",label:"Child Identity Information",group:"children",dataPoints:["child's name","date of birth","school name","parent/guardian contact"],selected:false},{id:"child-activity",label:"Child Online Activity",group:"children",dataPoints:["content viewed","in-app activity","communications"],selected:false}];function f(){return {org:{name:"",website:"",privacyEmail:"",address:"",dpoName:"",dpoEmail:"",industry:"other",orgSize:"startup",country:"Nigeria"},dataCategories:m.map(e=>chunkMQFZHA2D_js.a({},e)),purposes:[],hasChildrenData:false,hasSensitiveData:false,hasFinancialData:false,hasCrossBorderTransfer:false,hasAutomatedDecisions:false,thirdPartyProcessors:[]}}function o(e,t){return e.sections.some(i=>i.id===t&&i.included)}function p(e,t){var a;let i=e.sections.find(s=>s.id===t&&s.included);return (a=i==null?void 0:i.template)!=null?a:""}function g(e){return e.sections.filter(t=>t.included).map(t=>t.template).join(`
2
+ `)}var u=[{id:"controller-identity",name:"Controller Identity",ndpaSection:"NDPA Section 24(1)(a)",severity:"critical",points:10,check:e=>{var t,i;return ((t=e.organizationInfo.name)!=null?t:"").trim().length>0&&((i=e.organizationInfo.privacyEmail)!=null?i:"").trim().length>0},gap:()=>({message:"The policy does not identify the data controller. The organisation name and contact email must be provided so data subjects know who is responsible for their data.",fixType:"fill_field",fixLabel:"Add organisation details",suggestedContent:"Provide your organisation's registered name and a valid privacy contact email address in the Organisation Info section."})},{id:"purpose-of-processing",name:"Purpose of Processing",ndpaSection:"NDPA Section 24(1)(b)",severity:"critical",points:10,check:(e,t)=>t.purposes.length>0,gap:()=>({message:"No processing purposes have been selected. The NDPA requires you to clearly state the specific purposes for which personal data is collected and processed.",fixType:"fill_field",fixLabel:"Select processing purposes",suggestedContent:"Select at least one processing purpose (e.g. service delivery, analytics, marketing) in the wizard."})},{id:"lawful-basis",name:"Lawful Basis Identified",ndpaSection:"NDPA Section 25",severity:"critical",points:10,check:e=>o(e,"legal-basis"),gap:()=>({message:"The policy does not include a section identifying the lawful basis for processing. Under the NDPA, every processing activity must be grounded in a lawful basis such as consent, contract, or legitimate interest.",fixType:"add_section",fixLabel:"Add legal basis section",suggestedContent:`We process personal data under one or more of the following lawful bases as prescribed by the NDPA 2023:
3
+
4
+ - Consent: where you have given clear, informed, and voluntary consent.
5
+ - Contract: where processing is necessary for the performance of a contract.
6
+ - Legal Obligation: where processing is required by Nigerian law.
7
+ - Legitimate Interest: where processing is necessary for our legitimate interests, provided they do not override your rights.`})},{id:"data-categories-disclosed",name:"Data Categories Disclosed",ndpaSection:"NDPA Section 24(1)(c)",severity:"critical",points:10,check:(e,t)=>t.dataCategories.some(i=>i.selected),gap:()=>({message:"No data categories have been selected. The NDPA requires you to disclose the categories of personal data you collect (e.g. identity, financial, behavioral data).",fixType:"fill_field",fixLabel:"Select data categories",suggestedContent:"Select the categories of personal data your organisation collects in the Data Collection step of the wizard."})},{id:"recipients-disclosed",name:"Recipients Disclosed",ndpaSection:"NDPA Section 24(1)(e)",severity:"critical",points:10,check:(e,t)=>{if(!o(e,"data-sharing"))return false;if(t.thirdPartyProcessors.length>0){let i=p(e,"data-sharing");return t.thirdPartyProcessors.every(a=>i.includes(a.name))}return true},gap:e=>({message:e.thirdPartyProcessors.length>0?"The data sharing section does not list all third-party processors. Each processor must be named with its purpose and location.":"The policy does not include a data sharing section. Even if you do not share data, you must state this clearly.",fixType:e.thirdPartyProcessors.length>0?"add_content":"add_section",fixLabel:e.thirdPartyProcessors.length>0?"Update sharing section":"Add data sharing section",suggestedContent:"We do not sell personal data. We may share your data with service providers under strict data processing agreements that comply with the NDPA 2023."})},{id:"retention-periods",name:"Retention Periods Specified",ndpaSection:"NDPA Section 24(1)(f)",severity:"critical",points:10,check:e=>o(e,"data-retention"),gap:()=>({message:"The policy does not include a data retention section. The NDPA requires you to specify the period for which personal data will be stored, or the criteria used to determine that period.",fixType:"add_section",fixLabel:"Add retention schedule",suggestedContent:"We retain personal data only for as long as necessary to fulfil the purposes for which it was collected, or as required by applicable Nigerian law. When personal data is no longer needed, it is securely deleted or anonymised."})},{id:"data-subject-rights",name:"Data Subject Rights Listed",ndpaSection:"NDPA Sections 34-39",severity:"important",points:7,check:e=>{if(!o(e,"data-subject-rights"))return false;let t=p(e,"data-subject-rights").toLowerCase();return ["access","rectification","erasure","portability","restrict","object"].every(a=>t.includes(a))},gap:()=>({message:"The data subject rights section is missing or does not cover all six NDPA rights: access, rectification, erasure, portability, restriction, and objection.",fixType:"add_content",fixLabel:"Add missing rights",suggestedContent:`Under the NDPA 2023, you have the following rights:
8
+ 1. Right of Access (Section 34)
9
+ 2. Right to Rectification (Section 35)
10
+ 3. Right to Erasure (Section 36)
11
+ 4. Right to Restrict Processing (Section 37)
12
+ 5. Right to Data Portability (Section 38)
13
+ 6. Right to Object (Section 37)`})},{id:"right-to-withdraw-consent",name:"Right to Withdraw Consent",ndpaSection:"NDPA Section 25(2)",severity:"important",points:7,check:e=>{let t=g(e).toLowerCase();return t.includes("withdraw")&&t.includes("consent")},gap:()=>({message:"The policy does not mention the right to withdraw consent. Data subjects must be informed that they can withdraw consent at any time without affecting the lawfulness of prior processing.",fixType:"add_content",fixLabel:"Add withdrawal clause",suggestedContent:"You have the right to withdraw your consent at any time, without affecting the lawfulness of processing carried out prior to withdrawal. To withdraw your consent, contact us at the email address provided in this policy."})},{id:"right-to-lodge-complaint",name:"Right to Lodge Complaint with NDPC",ndpaSection:"NDPA Section 40",severity:"important",points:7,check:e=>{let t=g(e).toLowerCase();return t.includes("ndpc")||t.includes("nigeria data protection commission")},gap:()=>({message:"The policy does not mention the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC). Data subjects must be informed of this right.",fixType:"add_content",fixLabel:"Add NDPC complaint reference",suggestedContent:"You have the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC) if you believe your data protection rights have been infringed. Website: https://ndpc.gov.ng"})},{id:"cross-border-safeguards",name:"Cross-Border Transfer Safeguards",ndpaSection:"NDPA Sections 43-44",severity:"important",points:7,check:(e,t)=>t.hasCrossBorderTransfer?o(e,"cross-border-transfers"):true,gap:()=>({message:"Cross-border data transfers are indicated but the policy lacks a section describing the safeguards in place. The NDPA requires disclosure of transfer mechanisms and adequacy assessments.",fixType:"add_section",fixLabel:"Add cross-border section",suggestedContent:"Where we transfer personal data outside Nigeria, we ensure compliance with Sections 43 and 44 of the NDPA 2023 by implementing appropriate safeguards, including adequacy assessments and Standard Contractual Clauses."})},{id:"automated-decision-disclosure",name:"Automated Decision-Making Disclosure",ndpaSection:"NDPA Section 39",severity:"important",points:7,check:(e,t)=>t.hasAutomatedDecisions?o(e,"automated-decision-making"):true,gap:()=>({message:"Automated decision-making is indicated but the policy does not include a section disclosing this. The NDPA requires you to inform data subjects about automated decisions, including the logic involved and the right to human intervention.",fixType:"add_section",fixLabel:"Add automated decisions section",suggestedContent:"We use automated decision-making in certain processes. You have the right to request human intervention, express your point of view, and contest automated decisions, in accordance with Section 39 of the NDPA 2023."})},{id:"children-data-protection",name:"Children's Data Protection",ndpaSection:"NDPA Section 31",severity:"recommended",points:5,check:(e,t)=>t.hasChildrenData?o(e,"children-data-protection"):true,gap:()=>({message:"Children's data processing is indicated but the policy does not include a dedicated children's data protection section. The NDPA requires enhanced protections including parental consent for children under 13.",fixType:"add_section",fixLabel:"Add children's data section",suggestedContent:"We do not knowingly collect personal data from children under the age of 13 without verifiable parental or guardian consent. Parents and guardians may request access to, correction of, or deletion of their child's data at any time."})},{id:"dpo-contact-info",name:"DPO Contact Information",ndpaSection:"NDPA Section 30",severity:"recommended",points:5,check:e=>{var t,i;return ((t=e.organizationInfo.dpoName)!=null?t:"").trim().length>0&&((i=e.organizationInfo.dpoEmail)!=null?i:"").trim().length>0},gap:()=>({message:"The Data Protection Officer (DPO) contact information is not provided. While not always mandatory, appointing a DPO and publishing their contact details is strongly recommended under the NDPA.",fixType:"fill_field",fixLabel:"Add DPO details",suggestedContent:"Provide the full name and email address of your Data Protection Officer in the Organisation Info section."})},{id:"security-measures",name:"Security Measures Described",ndpaSection:"NDPA Section 28",severity:"recommended",points:5,check:e=>o(e,"data-security"),gap:()=>({message:"The policy does not describe the technical and organisational security measures in place to protect personal data. Describing these measures builds trust and demonstrates NDPA compliance.",fixType:"add_section",fixLabel:"Add security section",suggestedContent:"We implement appropriate technical and organisational measures to protect personal data, including encryption in transit and at rest, access controls, regular security assessments, and incident response procedures aligned with NDPA breach notification requirements."})},{id:"policy-effective-date",name:"Policy Effective Date",ndpaSection:"NDPA Section 24",severity:"recommended",points:5,check:e=>e.effectiveDate>0,gap:()=>({message:"The policy does not have an effective date set. An effective date is important for version control and for data subjects to know when the policy was last updated.",fixType:"fill_field",fixLabel:"Set effective date",suggestedContent:"Set the policy's effective date to the date you intend to publish it."})}];function P(e,t){let i=u.reduce((n,d)=>n+d.points,0),a=0,s=[],l=[];for(let n of u)if(n.check(e,t))a+=n.points,l.push(n.id);else {let d=n.gap(t);s.push(chunkMQFZHA2D_js.a({requirementId:n.id,requirement:n.name,ndpaSection:n.ndpaSection,severity:n.severity},d));}let h=Math.round(a/i*100),r;return a>=100?r="compliant":a>=80?r="nearly_compliant":r="not_compliant",{score:a,maxScore:i,percentage:h,rating:r,gaps:s,passed:l}}
14
+ exports.a=m;exports.b=f;exports.c=P;//# sourceMappingURL=chunk-YPKUHSK4.js.map
15
+ //# sourceMappingURL=chunk-YPKUHSK4.js.map