@tantainnovative/ndpr-toolkit 3.0.0 → 3.2.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.
- package/dist/{PolicyExporter-BIqSVjfC.d.mts → PolicyExporter-Bgi6nz82.d.mts} +93 -1
- package/dist/{PolicyExporter-BNWaPBGU.d.ts → PolicyExporter-BnvuFncj.d.ts} +93 -1
- package/dist/adapters.js +1 -1
- package/dist/adapters.mjs +1 -1
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-256APOQM.js +2 -0
- package/dist/chunk-2FWCVWKN.js +2 -0
- package/dist/chunk-3DJGO6WG.js +2 -0
- package/dist/chunk-44W4H2EY.js +2 -0
- package/dist/chunk-4XCL62MJ.mjs +2 -0
- package/dist/chunk-555WWZ3W.js +2 -0
- package/dist/chunk-6BXUVS6E.js +81 -0
- package/dist/{chunk-KHRBU5K7.js → chunk-6RQGQZT2.js} +2 -2
- package/dist/chunk-6TA2MVTU.mjs +2 -0
- package/dist/chunk-6WIP33TW.mjs +2 -0
- package/dist/{chunk-2ORDHJRD.js → chunk-7AVN424U.js} +2 -2
- package/dist/{chunk-5VMHKNJY.js → chunk-7SMLHZ4B.js} +2 -2
- package/dist/chunk-A4PK7JB2.js +2 -0
- package/dist/chunk-ABDB7LEV.mjs +2 -0
- package/dist/chunk-BKRETVJ6.js +2 -0
- package/dist/chunk-CWUPGY3M.mjs +3 -0
- package/dist/chunk-DJGS7SSN.mjs +2 -0
- package/dist/{chunk-SVCRYM4I.mjs → chunk-E4NCJ7RD.mjs} +2 -2
- package/dist/chunk-E63VPR7U.js +2 -0
- package/dist/chunk-EH2I4L7M.mjs +316 -0
- package/dist/chunk-ELKB2AFZ.js +2 -0
- package/dist/chunk-FDDI426Y.mjs +2 -0
- package/dist/chunk-FOXZRRMW.mjs +2 -0
- package/dist/chunk-GCQRHMTQ.mjs +144 -0
- package/dist/chunk-GKKAK6ES.mjs +3 -0
- package/dist/chunk-GOD4LA2J.mjs +2 -0
- package/dist/{chunk-SWF3YVE5.js → chunk-GOU6FU6Y.js} +3 -3
- package/dist/chunk-HO5M7M4M.js +2 -0
- package/dist/chunk-I23WPZNQ.mjs +94 -0
- package/dist/chunk-I4M2AA3N.js +2 -0
- package/dist/chunk-I54CDQGN.js +3 -0
- package/dist/{chunk-6D3ZUGBB.mjs → chunk-IR7VCBWV.mjs} +2 -2
- package/dist/{chunk-4VVARDN2.mjs → chunk-K45S6YQV.mjs} +2 -2
- package/dist/chunk-KBAFOVE3.js +2 -0
- package/dist/{chunk-P7BSBCB3.js → chunk-KBP26GLC.js} +2 -2
- package/dist/chunk-KVOGOLIR.js +316 -0
- package/dist/chunk-LU4PFST7.js +144 -0
- package/dist/chunk-MDWG2KDA.mjs +2 -0
- package/dist/chunk-NN233SGA.mjs +3 -0
- package/dist/chunk-NRQELKAE.js +2 -0
- package/dist/chunk-NUDVUAD4.mjs +81 -0
- package/dist/chunk-NXQMU36Z.mjs +2 -0
- package/dist/chunk-P42Z5CFE.js +2 -0
- package/dist/chunk-PATONNTZ.mjs +2 -0
- package/dist/{chunk-WLSW4Z4W.mjs → chunk-PM7O5IGE.mjs} +2 -2
- package/dist/chunk-Q7VHB64E.mjs +2 -0
- package/dist/{chunk-PEH5GIMN.js → chunk-QH6YUVJS.js} +2 -2
- package/dist/chunk-QY7PD5XB.js +94 -0
- package/dist/chunk-R3OYAJI6.mjs +2 -0
- package/dist/chunk-S4GRSNB4.js +2 -0
- package/dist/chunk-SAA7UVI2.js +3 -0
- package/dist/{chunk-PYEX7DFR.mjs → chunk-SHMJNRHO.mjs} +3 -3
- package/dist/chunk-TVW6KBVV.mjs +2 -0
- package/dist/chunk-U62QYKVG.mjs +2 -0
- package/dist/chunk-UDNRAQLE.js +3 -0
- package/dist/{chunk-5RSOLEEP.js → chunk-UXMGBIX6.js} +4 -4
- package/dist/{chunk-UZ5EZOA7.js → chunk-VK27WVV3.js} +2 -2
- package/dist/{chunk-G26I6MP5.mjs → chunk-VWPGIES4.mjs} +2 -2
- package/dist/{chunk-NPLXE43Q.mjs → chunk-XQ4M5FHC.mjs} +2 -2
- package/dist/{chunk-CAB7O3GR.mjs → chunk-ZEOQYWOE.mjs} +4 -4
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +9 -46
- package/dist/core.d.ts +9 -46
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +2 -0
- package/dist/hooks.d.ts +2 -0
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/policy-engine-C-tShzZH.d.mts +154 -0
- package/dist/policy-engine-DSQpT55_.d.ts +154 -0
- package/dist/policy-sections-CfNVBLCh.d.mts +54 -0
- package/dist/policy-sections-DqH0iZRf.d.ts +54 -0
- package/dist/policy.d.mts +86 -5
- package/dist/policy.d.ts +86 -5
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets.d.mts +5 -15
- package/dist/presets.d.ts +5 -15
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/sanitize-9mOO_cJW.d.mts +147 -0
- package/dist/sanitize-9mOO_cJW.d.ts +147 -0
- package/dist/useAdaptivePolicyWizard-B9Op2gYM.d.ts +52 -0
- package/dist/useAdaptivePolicyWizard-N4eUM4Tj.d.mts +52 -0
- package/package.json +9 -3
- package/dist/PolicyGenerator-BvcWPbxp.d.mts +0 -96
- package/dist/PolicyGenerator-BzRwtlgn.d.ts +0 -96
- package/dist/chunk-27NYSWUG.mjs +0 -2
- package/dist/chunk-2SYNHRP6.mjs +0 -2
- package/dist/chunk-2W7ARAW2.js +0 -2
- package/dist/chunk-3F34NACG.js +0 -2
- package/dist/chunk-3RGJV3VF.js +0 -7
- package/dist/chunk-3V23O4ZJ.js +0 -2
- package/dist/chunk-3XAUN5IM.mjs +0 -3
- package/dist/chunk-6E54NSAO.mjs +0 -2
- package/dist/chunk-7F5F5YWI.mjs +0 -2
- package/dist/chunk-7FIUX3ZM.js +0 -89
- package/dist/chunk-CMZTI7SG.js +0 -2
- package/dist/chunk-EPF7J2FK.js +0 -3
- package/dist/chunk-FR7ZYZXB.js +0 -2
- package/dist/chunk-FXTZDKDC.mjs +0 -3
- package/dist/chunk-GIV2OHE6.mjs +0 -2
- package/dist/chunk-GPJVTGHR.mjs +0 -2
- package/dist/chunk-GVANK6PL.js +0 -3
- package/dist/chunk-HNZK7LY3.mjs +0 -2
- package/dist/chunk-IKEPXHCZ.js +0 -2
- package/dist/chunk-ILCNDOBU.js +0 -2
- package/dist/chunk-IQQW52EF.js +0 -2
- package/dist/chunk-ISSGO2YT.mjs +0 -72
- package/dist/chunk-J6IKAGUP.mjs +0 -89
- package/dist/chunk-KNE4NXCY.mjs +0 -7
- package/dist/chunk-LFNA6WYQ.mjs +0 -2
- package/dist/chunk-PGSA2O5P.mjs +0 -2
- package/dist/chunk-RGYK4VAY.mjs +0 -2
- package/dist/chunk-RSUDIFZV.mjs +0 -2
- package/dist/chunk-RYZEIDNR.js +0 -2
- package/dist/chunk-SBNAMPAP.mjs +0 -2
- package/dist/chunk-SSGJREE3.js +0 -2
- package/dist/chunk-U6VWHC46.js +0 -72
- package/dist/chunk-UK656RCG.js +0 -2
- package/dist/chunk-UOSEH6DC.js +0 -2
- package/dist/chunk-VDZKGCAF.js +0 -2
- package/dist/chunk-WSHSHIIM.mjs +0 -2
- package/dist/chunk-XSK4BSZJ.mjs +0 -2
- package/dist/chunk-Y34DQYS7.js +0 -2
- package/dist/chunk-YJCGEOLO.mjs +0 -2
- package/dist/chunk-ZCZ5RRZO.js +0 -2
package/dist/chunk-J6IKAGUP.mjs
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-AYKLAEOU.mjs';import {d}from'./chunk-WWT2ZSNU.mjs';import {useState}from'react';import {jsxs,jsx}from'react/jsx-runtime';var it=({content:u,sections:R,variables:v,onExport:D,onEdit:C,title:H="Privacy Policy Preview",description:U="Preview your NDPA-compliant privacy policy before exporting.",className:M="",buttonClassName:y="",showExportOptions:B=true,showEditButton:L=true,showTableOfContents:W=true,showMetadata:T=true,organizationName:F,lastUpdated:r=new Date,classNames:t,unstyled:g=false})=>{let[P,h]=useState("preview"),k=(()=>{let n=u.split(`
|
|
2
|
-
`),d=[];return n.forEach(c=>{if(c.startsWith("## ")){let s=c.substring(3).trim(),$=s.toLowerCase().replace(/[^a-z0-9]+/g,"-");d.push({id:$,title:s,level:2});}else if(c.startsWith("### ")){let s=c.substring(4).trim(),$=s.toLowerCase().replace(/[^a-z0-9]+/g,"-");d.push({id:$,title:s,level:3});}}),d})(),f=n=>{if(D)D(n);else if(n==="markdown"){let d=document.createElement("a"),c=new Blob([u],{type:"text/markdown"});d.href=URL.createObjectURL(c),d.download=`privacy-policy-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(d),d.click(),document.body.removeChild(d);}},A=()=>!W||k.length===0?null:jsxs("div",{className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Table of Contents"}),jsx("ul",{className:"space-y-1",children:k.map((n,d)=>jsx("li",{style:{marginLeft:`${(n.level-2)*1.5}rem`},children:jsx("a",{href:`#${n.id}`,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline",children:n.title})},d))})]}),O=()=>T?jsxs("div",{className:"mb-6",children:[jsx("h1",{className:"text-2xl font-bold mb-2",children:F?`${F} Privacy Policy`:"Privacy Policy"}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Last Updated: ",r.toLocaleDateString()]})]}):null,w=()=>jsx("div",{className:a("prose dark:prose-invert max-w-none",t==null?void 0:t.sectionContent,g),children:u.split(`
|
|
3
|
-
`).map((n,d)=>{if(n.startsWith("## ")){let c=n.substring(3).trim(),s=c.toLowerCase().replace(/[^a-z0-9]+/g,"-");return jsx("h2",{id:s,className:a("text-xl font-bold mt-6 mb-3",t==null?void 0:t.sectionTitle,g),children:c},d)}else if(n.startsWith("### ")){let c=n.substring(4).trim(),s=c.toLowerCase().replace(/[^a-z0-9]+/g,"-");return jsx("h3",{id:s,className:a("text-lg font-bold mt-4 mb-2",t==null?void 0:t.sectionTitle,g),children:c},d)}else return n===""?jsx("br",{},d):jsx("p",{className:"mb-2",children:n},d)})}),z=()=>B?jsxs("div",{className:"mt-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Export Options"}),jsxs("div",{className:"flex flex-wrap gap-3",children:[jsx("button",{onClick:()=>f("pdf"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${y}`,children:"Export as PDF"}),jsx("button",{onClick:()=>f("docx"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${y}`,children:"Export as DOCX"}),jsx("button",{onClick:()=>f("html"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${y}`,children:"Export as HTML"}),jsx("button",{onClick:()=>f("markdown"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${y}`,children:"Export as Markdown"})]})]}):null;return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${M}`,t==null?void 0:t.root,g),children:[jsxs("div",{className:a("flex justify-between items-start mb-6",t==null?void 0:t.header,g),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-bold mb-2",t==null?void 0:t.title,g),children:H}),jsx("p",{className:a("text-gray-600 dark:text-gray-300",t==null?void 0:t.description,g),children:U})]}),L&&C&&jsx("button",{onClick:C,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 ${y}`,children:"Edit Policy"})]}),jsxs("div",{className:a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",t==null?void 0:t.complianceNotice,g),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"This privacy policy has been generated to align with the Nigeria Data Protection Act (NDPA) 2023. We recommend having the final policy reviewed by a legal professional familiar with NDPA requirements before publishing it on your website or sharing it with your users."})]}),jsx("div",{className:"mb-6 border-b border-gray-200 dark:border-gray-700",children:jsxs("ul",{className:"flex flex-wrap -mb-px",children:[jsx("li",{className:"mr-2",children:jsx("button",{onClick:()=>h("preview"),className:`inline-block p-4 ${P==="preview"?"text-[rgb(var(--ndpr-primary))] border-b-2 border-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]":"text-gray-600 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Preview"})}),jsx("li",{className:"mr-2",children:jsx("button",{onClick:()=>h("markdown"),className:`inline-block p-4 ${P==="markdown"?"text-[rgb(var(--ndpr-primary))] border-b-2 border-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]":"text-gray-600 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Markdown"})})]})}),jsx("div",{className:a("bg-white dark:bg-gray-800 p-4 rounded-md",t==null?void 0:t.content,g),children:P==="preview"?jsxs("div",{children:[O(),A(),jsx("div",{className:a("bg-gray-50 dark:bg-gray-700 p-6 rounded-md",t==null?void 0:t.section,g),children:w()})]}):jsx("div",{children:jsx("pre",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md overflow-auto whitespace-pre-wrap font-mono text-sm text-gray-800 dark:text-gray-200",children:u})})}),z()]})};var ct=({content:u,title:R="Privacy Policy",organizationName:v,lastUpdated:D=new Date,onExportComplete:C,componentTitle:H="Export Privacy Policy",description:U="Export your NDPA-compliant privacy policy in various formats.",className:M="",buttonClassName:y="",showExportHistory:B=true,includeComplianceNotice:L=true,includeLogo:W=false,logoUrl:T,customStyles:F,classNames:r,unstyled:t=false})=>{let[g,P]=useState([]),[h,N]=useState("pdf"),[k,f]=useState(false),[A,O]=useState(null),[w,z]=useState(""),[n,d$1]=useState(""),[c,s]=useState(""),[$,j]=useState(false),q=o=>{let l=new Date().toISOString().split("T")[0];return `${v?v.toLowerCase().replace(/[^a-z0-9]+/g,"-"):"privacy-policy"}-privacy-policy-${l}.${o.toLowerCase()}`},Y=o=>w?w.endsWith(`.${o.toLowerCase()}`)?w:`${w}.${o.toLowerCase()}`:q(o),V=()=>{let o=v?`${v} ${R}`:R,l=D.toLocaleDateString(),m=`<!DOCTYPE html>
|
|
4
|
-
<html lang="en">
|
|
5
|
-
<head>
|
|
6
|
-
<meta charset="UTF-8">
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
|
-
<title>${o}</title>
|
|
9
|
-
<style>
|
|
10
|
-
body {
|
|
11
|
-
font-family: Arial, sans-serif;
|
|
12
|
-
line-height: 1.6;
|
|
13
|
-
color: #333;
|
|
14
|
-
max-width: 800px;
|
|
15
|
-
margin: 0 auto;
|
|
16
|
-
padding: 20px;
|
|
17
|
-
}
|
|
18
|
-
h1 {
|
|
19
|
-
font-size: 24px;
|
|
20
|
-
margin-bottom: 10px;
|
|
21
|
-
}
|
|
22
|
-
h2 {
|
|
23
|
-
font-size: 20px;
|
|
24
|
-
margin-top: 30px;
|
|
25
|
-
margin-bottom: 10px;
|
|
26
|
-
border-bottom: 1px solid #eee;
|
|
27
|
-
padding-bottom: 5px;
|
|
28
|
-
}
|
|
29
|
-
h3 {
|
|
30
|
-
font-size: 18px;
|
|
31
|
-
margin-top: 20px;
|
|
32
|
-
margin-bottom: 10px;
|
|
33
|
-
}
|
|
34
|
-
p {
|
|
35
|
-
margin-bottom: 15px;
|
|
36
|
-
}
|
|
37
|
-
.header {
|
|
38
|
-
text-align: center;
|
|
39
|
-
margin-bottom: 30px;
|
|
40
|
-
}
|
|
41
|
-
.footer {
|
|
42
|
-
margin-top: 50px;
|
|
43
|
-
text-align: center;
|
|
44
|
-
font-size: 12px;
|
|
45
|
-
color: #666;
|
|
46
|
-
border-top: 1px solid #eee;
|
|
47
|
-
padding-top: 20px;
|
|
48
|
-
}
|
|
49
|
-
.logo {
|
|
50
|
-
max-width: 200px;
|
|
51
|
-
margin-bottom: 20px;
|
|
52
|
-
}
|
|
53
|
-
.last-updated {
|
|
54
|
-
font-size: 12px;
|
|
55
|
-
color: #666;
|
|
56
|
-
margin-bottom: 30px;
|
|
57
|
-
}
|
|
58
|
-
.compliance-notice {
|
|
59
|
-
background-color: #f8f9fa;
|
|
60
|
-
border: 1px solid #e9ecef;
|
|
61
|
-
padding: 15px;
|
|
62
|
-
margin-bottom: 30px;
|
|
63
|
-
font-size: 14px;
|
|
64
|
-
}
|
|
65
|
-
${F||""}
|
|
66
|
-
</style>
|
|
67
|
-
</head>
|
|
68
|
-
<body>
|
|
69
|
-
<div class="header">
|
|
70
|
-
${W&&T?`<img src="${T}" alt="${v||"Company"} Logo" class="logo">`:""}
|
|
71
|
-
${n?`<div class="custom-header">${n}</div>`:""}
|
|
72
|
-
<h1>${o}</h1>
|
|
73
|
-
<div class="last-updated">Last Updated: ${l}</div>
|
|
74
|
-
</div>`;L&&(m+=`
|
|
75
|
-
<div class="compliance-notice">
|
|
76
|
-
<strong>NDPA Compliance Notice:</strong> This privacy policy has been created to comply with the Nigeria Data Protection Act (NDPA) 2023.
|
|
77
|
-
It outlines how we collect, use, disclose, and protect your personal information in accordance with NDPA requirements.
|
|
78
|
-
</div>`);let S=u.replace(/^## (.*?)$/gm,"<h2>$1</h2>").replace(/^### (.*?)$/gm,"<h3>$1</h3>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>");return m+=`
|
|
79
|
-
<div class="content">
|
|
80
|
-
<p>${S}</p>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<div class="footer">
|
|
84
|
-
${c?`<div class="custom-footer">${c}</div>`:""}
|
|
85
|
-
<p>© ${new Date().getFullYear()} ${v||"Company"}. All rights reserved.</p>
|
|
86
|
-
</div>
|
|
87
|
-
</body>
|
|
88
|
-
</html>`,m},_=()=>d(null,null,function*(){f(true),O(null);try{let o=h.toLowerCase(),l="",m;switch(o){case "pdf":let I=V();m=new Blob([I],{type:"text/html"}),l=URL.createObjectURL(m);break;case "docx":m=new Blob([u],{type:"text/plain"}),l=URL.createObjectURL(m);break;case "html":let Z=V();m=new Blob([Z],{type:"text/html"}),l=URL.createObjectURL(m);break;default:m=new Blob([u],{type:"text/markdown"}),l=URL.createObjectURL(m);break}let S=Y(o),E=document.createElement("a");E.href=l,E.download=S,document.body.appendChild(E),E.click(),document.body.removeChild(E);let Q={id:`export_${Date.now()}`,format:o,timestamp:Date.now(),url:l,filename:S};P(I=>[Q,...I]),C&&C(o,l);}catch(o){console.error("Export error:",o),O("An error occurred during export. Please try again.");}finally{f(false);}}),G=()=>{let o=[{value:"pdf",label:"PDF Document (.pdf)"},{value:"docx",label:"Word Document (.docx)"},{value:"html",label:"Web Page (.html)"},{value:"markdown",label:"Markdown (.md)"}];return jsxs("div",{className:a("mb-6",r==null?void 0:r.formatSelector,t),children:[jsx("label",{htmlFor:"export-format",className:"block text-sm font-medium mb-1",children:"Export Format"}),jsx("select",{id:"export-format",value:h,onChange:l=>N(l.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.formatOption,t),children:o.map(l=>jsx("option",{value:l.value,children:l.label},l.value))})]})},J=()=>$?jsxs("div",{className:"mb-6 space-y-4 border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsxs("div",{className:"flex justify-between items-center",children:[jsx("h3",{className:"text-md font-medium",children:"Advanced Export Options"}),jsx("button",{type:"button",onClick:()=>j(false),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] text-sm",children:"Hide Advanced Options"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"custom-filename",className:"block text-sm font-medium mb-1",children:"Custom Filename"}),jsx("input",{type:"text",id:"custom-filename",value:w,onChange:o=>z(o.target.value),placeholder:q(h),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:"Leave blank to use the default filename format."})]}),jsxs("div",{children:[jsx("label",{htmlFor:"custom-header",className:"block text-sm font-medium mb-1",children:"Custom Header HTML (for HTML/PDF exports)"}),jsx("textarea",{id:"custom-header",value:n,onChange:o=>d$1(o.target.value),rows:3,placeholder:"<div>Custom header content</div>",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"custom-footer",className:"block text-sm font-medium mb-1",children:"Custom Footer HTML (for HTML/PDF exports)"}),jsx("textarea",{id:"custom-footer",value:c,onChange:o=>s(o.target.value),rows:3,placeholder:"<div>Custom footer content</div>",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:"include-compliance-notice",type:"checkbox",checked:L,onChange:o=>j(o.target.checked),className:"w-4 h-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))] dark:focus:ring-[rgb(var(--ndpr-ring))] dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"})}),jsxs("div",{className:"ml-3 text-sm",children:[jsx("label",{htmlFor:"include-compliance-notice",className:"font-medium text-gray-900 dark:text-white",children:"Include NDPA Compliance Notice"}),jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Adds a notice explaining that this policy complies with NDPA requirements."})]})]})]}):jsx("button",{type:"button",onClick:()=>j(true),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] text-sm mb-6",children:"Show Advanced Options"}),K=()=>!B||g.length===0?null:jsxs("div",{className:a("mt-6",r==null?void 0:r.preview,t),children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Export History"}),jsx("div",{className:"bg-gray-50 dark:bg-gray-700 rounded-md overflow-hidden",children:jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-600",children:[jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Date"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Format"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Filename"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Actions"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-700 divide-y divide-gray-200 dark:divide-gray-600",children:g.map(o=>jsxs("tr",{children:[jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:new Date(o.timestamp).toLocaleString()}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:o.format.toUpperCase()}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:o.filename}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:jsx("a",{href:o.url,download:o.filename,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:text-[rgb(var(--ndpr-primary-hover))] dark:hover:text-[rgb(var(--ndpr-primary-hover))] mr-4",children:"Download"})})]},o.id))})]})})]});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${M}`,r==null?void 0:r.root,t),children:[jsxs("div",{className:a("mb-6",r==null?void 0:r.header,t),children:[jsx("h2",{className:a("text-xl font-bold mb-2",r==null?void 0:r.title,t),children:H}),jsx("p",{className:a("text-gray-600 dark:text-gray-300",r==null?void 0:r.description,t),children:U})]}),G(),J(),jsxs("div",{className:"mb-6",children:[jsx("button",{onClick:_,disabled:k,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 ${y} ${k?"opacity-70 cursor-not-allowed":""}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.exportButton),t),children:k?"Exporting...":`Export as ${h.toUpperCase()}`}),A&&jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-500",children:A})]}),jsxs("div",{className:a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",r==null?void 0:r.complianceNotice,t),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"Export Tips"}),jsxs("ul",{className:"text-blue-700 dark:text-blue-300 text-sm list-disc list-inside space-y-1",children:[jsx("li",{children:"PDF format is recommended for printing or sharing with stakeholders."}),jsx("li",{children:"HTML format is ideal for publishing on your website."}),jsx("li",{children:"DOCX format allows for further editing in Microsoft Word or similar applications."}),jsx("li",{children:"Markdown format is useful for version control systems or technical documentation."})]})]}),K()]})};export{it as a,ct as b};//# sourceMappingURL=chunk-J6IKAGUP.mjs.map
|
|
89
|
-
//# sourceMappingURL=chunk-J6IKAGUP.mjs.map
|
package/dist/chunk-KNE4NXCY.mjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import {b,c,a as a$2}from'./chunk-CAB7O3GR.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {b as b$1,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var tr=({sections:x=b,variables:h=c,onGenerate:F,title:L="NDPA Privacy Policy Generator",description:I="Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 24.",className:R="",buttonClassName:y="",generateButtonText:O="Generate Policy",showPreview:K=true,allowEditing:P=true,classNames:r,unstyled:p=false})=>{let[f,$]=useState(x),[s,S]=useState(h),[l,m]=useState("sections"),[C,j]=useState(""),[E,G]=useState(""),[Q,_]=useState(false),[b,V]=useState({});useEffect(()=>{$(x);},[x]),useEffect(()=>{S(h);},[h]);let W=t=>{$(d=>d.map(n=>n.id===t?b$1(a$1({},n),{included:!n.included}):n));},k=(t,d)=>{S(n=>n.map(a=>a.id===t?b$1(a$1({},a),{value:d}):a)),b[t]&&V(n=>{let a=a$1({},n);return delete a[t],a});},U=()=>{let t={},d=true;return s.forEach(n=>{n.required&&!n.value&&(t[n.id]=`${n.name} is required`,d=false);}),V(t),d},Y=()=>{if(!U()){m("variables");return}let t=f.filter(a=>a.included),d=Object.fromEntries(s.map(a=>[a.name,a.value])),n="";t.forEach(a=>{n+=`## ${a.title}
|
|
2
|
-
|
|
3
|
-
`,n+=a$2(a.template,d),n+=`
|
|
4
|
-
|
|
5
|
-
`;}),j(n),G(n),_(true),m("preview");},z=()=>{F({sections:f,variables:s,content:P?E:C});},q=()=>jsxs("div",{className:a("space-y-4",r==null?void 0:r.sectionList,p),children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Select Policy Sections"}),f.map(t=>jsx("div",{className:a("border border-gray-200 dark:border-gray-700 rounded-md p-4",r==null?void 0:r.sectionItem,p),children:jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:`section-${t.id}`,type:"checkbox",checked:t.included,onChange:()=>W(t.id),disabled:t.required,className:a("w-4 h-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))] dark:focus:ring-[rgb(var(--ndpr-ring))] dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600",r==null?void 0:r.input,p)})}),jsxs("div",{className:"ml-3 text-sm",children:[jsxs("label",{htmlFor:`section-${t.id}`,className:"font-medium text-gray-900 dark:text-white",children:[t.title," ",t.required&&jsx("span",{className:"text-red-500",children:"*"})]}),t.description&&jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:t.description})]})]})},t.id)),jsx("div",{className:"mt-6",children:jsx("button",{onClick:()=>m("variables"),className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${y}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),p),children:"Next: Fill Variables"})})]}),M=()=>{let t={};return s.forEach(d=>{let n=d.id.split(".")[0];t[n]||(t[n]=[]),t[n].push(d);}),jsxs("div",{className:a("",r==null?void 0:r.form,p),children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Fill Policy Variables"}),jsx("div",{className:"space-y-6",children:Object.entries(t).map(([d,n])=>{let a$1=f.find(i=>i.id===d);return a$1&&!a$1.included?null:jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsx("h4",{className:"font-medium text-lg mb-3",children:a$1?a$1.title:"General Information"}),jsx("div",{className:"space-y-4",children:n.map(i=>jsxs("div",{children:[jsxs("label",{htmlFor:`var-${i.id}`,className:"block text-sm font-medium mb-1",children:[i.name," ",i.required&&jsx("span",{className:"text-red-500",children:"*"})]}),i.description&&jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-2",children:i.description}),i.inputType==="textarea"?jsx("textarea",{id:`var-${i.id}`,value:i.value,onChange:c=>k(i.id,c.target.value),rows:4,className:a(`w-full px-3 py-2 border ${b[i.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,p),required:i.required}):i.inputType==="select"&&i.options?jsxs("select",{id:`var-${i.id}`,value:i.value,onChange:c=>k(i.id,c.target.value),className:a(`w-full px-3 py-2 border ${b[i.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,p),required:i.required,children:[jsx("option",{value:"",children:"Select an option"}),i.options.map(c=>jsx("option",{value:c,children:c},c))]}):jsx("input",{id:`var-${i.id}`,type:i.inputType,value:i.value,onChange:c=>k(i.id,c.target.value),className:a(`w-full px-3 py-2 border ${b[i.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,p),required:i.required}),b[i.id]&&jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-500",children:b[i.id]})]},i.id))})]},d)})}),jsxs("div",{className:"mt-6 flex space-x-4",children:[jsx("button",{onClick:()=>m("sections"),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 ${y}`,children:"Back to Sections"}),jsx("button",{onClick:Y,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${y}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),p),children:O})]})]})},H=()=>jsxs("div",{children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Preview Generated Policy"}),P?jsxs("div",{className:"mb-4",children:[jsx("label",{htmlFor:"policy-content",className:"block text-sm font-medium mb-1",children:"Edit Policy Content"}),jsx("textarea",{id:"policy-content",value:E,onChange:t=>G(t.target.value),rows:20,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] font-mono text-sm"})]}):jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4",children:jsx("div",{className:"prose dark:prose-invert max-w-none",children:C.split(`
|
|
6
|
-
`).map((t,d)=>t.startsWith("## ")?jsx("h2",{className:"text-xl font-bold mt-6 mb-3",children:t.substring(3)},d):t.startsWith("### ")?jsx("h3",{className:"text-lg font-bold mt-4 mb-2",children:t.substring(4)},d):t===""?jsx("br",{},d):jsx("p",{className:"mb-2",children:t},d))})}),jsxs("div",{className:"mt-6 flex space-x-4",children:[jsx("button",{onClick:()=>m("variables"),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 ${y}`,children:"Back to Variables"}),jsx("button",{onClick:z,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${y}`,children:"Save Policy"})]})]}),J=()=>{switch(l){case "sections":return q();case "variables":return M();case "preview":return H();default:return q()}};return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${R}`,r==null?void 0:r.root,p),children:[jsxs("div",{className:a("mb-6",r==null?void 0:r.header,p),children:[jsx("h2",{className:a("text-xl font-bold mb-2",r==null?void 0:r.title,p),children:L}),jsx("p",{className:a("text-gray-600 dark:text-gray-300",r==null?void 0:r.description,p),children:I})]}),jsx("div",{className:"mb-8",children:jsxs("ol",{className:"flex items-center w-full",children:[jsxs("li",{className:`flex w-full items-center ${l==="sections"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsx("span",{className:`flex items-center justify-center w-8 h-8 ${l==="sections"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"1"}),jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Sections"})]}),jsxs("li",{className:`flex w-full items-center ${l==="variables"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsx("span",{className:`flex items-center justify-center w-8 h-8 ${l==="variables"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"2"}),jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Variables"})]}),jsxs("li",{className:`flex items-center ${l==="preview"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"}`,children:[jsx("span",{className:`flex items-center justify-center w-8 h-8 ${l==="preview"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"3"}),jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Preview"})]})]})}),jsxs("div",{className:a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",r==null?void 0:r.complianceNotice,p),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"This tool helps you generate a privacy policy that aligns with the Nigeria Data Protection Act (NDPA) 2023. While we strive to ensure compliance, we recommend having the final policy reviewed by a legal professional familiar with NDPA requirements."})]}),J()]})};export{tr as a};//# sourceMappingURL=chunk-KNE4NXCY.mjs.map
|
|
7
|
-
//# sourceMappingURL=chunk-KNE4NXCY.mjs.map
|
package/dist/chunk-LFNA6WYQ.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-RGYK4VAY.mjs';import {a as a$2}from'./chunk-SBNAMPAP.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect}from'react';function K(q,h){return h?a$2(q):{load:()=>null,save:()=>{},remove:()=>{}}}function W({categories:q,initialReports:h=[],adapter:g,storageKey:L="ndpr_breach_data",useLocalStorage:P=true,onReport:v,onAssessment:S,onNotification:I}){let D=g!=null?g:K(L,P),d=useRef(D);d.current=D;let[a$2,m]=useState(h),[u,A]=useState([]),[c,B]=useState([]),[U,N]=useState(true);useEffect(()=>{let e=false;try{let s=d.current.load(),r=t=>{var i,n,l;t&&(m((i=t.reports)!=null?i:[]),A((n=t.assessments)!=null?n:[]),B((l=t.notifications)!=null?l:[])),N(!1);};s instanceof Promise?s.then(t=>{e||r(t);},()=>{e||N(!1);}):r(s);}catch(s){e||N(false);}return ()=>{e=true;}},[]);let f=(e,s,r)=>{Promise.resolve(d.current.save({reports:e,assessments:s,notifications:r})).catch(t=>{console.warn("[ndpr-toolkit] Failed to save breach data:",t);});},y=e=>`${e}_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,_=e=>{let s=a({id:y("breach"),reportedAt:Date.now()},e),r=[...a$2,s];return m(r),f(r,u,c),v&&v(s),s},$=(e,s)=>{let r=a$2.findIndex(n=>n.id===e);if(r===-1)return null;let t=a(a({},a$2[r]),s),i=[...a$2];return i[r]=t,m(i),f(i,u,c),t},w=e=>a$2.find(s=>s.id===e)||null,j=(e,s)=>{let r=u.find(n=>n.breachId===e),t,i;return r?(i=b(a(a({},r),s),{assessedAt:Date.now()}),t=u.map(n=>n.id===r.id?i:n)):(i=a({id:y("assessment"),breachId:e,assessedAt:Date.now()},s),t=[...u,i]),A(t),f(a$2,t,c),S&&S(i),i},b$1=e=>u.find(s=>s.breachId===e)||null,x=e=>{let s=w(e),r=b$1(e);if(!s)return null;let{severityLevel:t,notificationRequired:i,timeframeHours:n,justification:l}=a$1(s,r||void 0),R=s.discoveredAt+n*60*60*1e3;return {ndpcNotificationRequired:i,ndpcNotificationDeadline:R,dataSubjectNotificationRequired:t==="high"||t==="critical",justification:l}};return {reports:a$2,assessments:u,notifications:c,reportBreach:_,updateReport:$,getReport:w,assessRisk:j,getAssessment:b$1,calculateNotificationRequirements:x,sendNotification:(e,s)=>{let r=c.find(n=>n.breachId===e),t,i;return r?(i=b(a(a({},r),s),{sentAt:Date.now()}),t=c.map(n=>n.id===r.id?i:n)):(i=a({id:y("notification"),breachId:e,sentAt:Date.now()},s),t=[...c,i]),B(t),f(a$2,u,t),I&&I(i),i},getNotification:e=>c.find(s=>s.breachId===e)||null,getBreachesRequiringNotification:(e=24)=>{let s=Date.now(),r=[];return a$2.forEach(t=>{if(c.some(E=>E.breachId===t.id))return;let i=b$1(t.id);if(!i)return;let n=x(t.id);if(!n||!n.ndpcNotificationRequired)return;let R=(n.ndpcNotificationDeadline-s)/(3600*1e3);R<=e&&r.push({report:t,assessment:i,requirements:n,hoursRemaining:R});}),r.sort((t,i)=>t.hoursRemaining-i.hoursRemaining)},clearBreachData:()=>{m([]),A([]),B([]),Promise.resolve(d.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove breach data:",e);});},isLoading:U}}export{W as a};//# sourceMappingURL=chunk-LFNA6WYQ.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-LFNA6WYQ.mjs.map
|
package/dist/chunk-PGSA2O5P.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function a(c){let i={low:0,medium:0,high:0,critical:0},l=0,o=[];c.risks.forEach(e=>{i[e.level]++,e.score>l&&(l=e.score),(e.level==="high"||e.level==="critical")&&!e.mitigated&&o.push(e);});let s;i.critical>0?s="critical":i.high>2||i.high>0&&i.medium>3?s="high":i.high>0||i.medium>1?s="medium":s="low";let r=s==="high"||s==="critical",n=o.length===0,t=[];return o.length>0&&t.push(`Mitigate the following high/critical risks before proceeding: ${o.map(e=>e.description).join(", ")}`),r&&t.push("Consult with the NDPC (Nigeria Data Protection Commission) before proceeding with this processing activity, as required by NDPA Section 39."),i.medium>0&&t.push("Implement additional safeguards to reduce medium-level risks where possible."),s!=="low"?t.push("Schedule a review of this DPIA in 6 months to reassess risks and effectiveness of mitigation measures."):t.push("Schedule a review of this DPIA in 12 months as part of regular compliance activities."),{overallRiskLevel:s,requiresConsultation:r,canProceed:n,recommendations:t}}export{a};//# sourceMappingURL=chunk-PGSA2O5P.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-PGSA2O5P.mjs.map
|
package/dist/chunk-RGYK4VAY.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function v(t,r){if(r){let{riskLevel:o,risksToRightsAndFreedoms:n,highRisksToRightsAndFreedoms:f}=r;return {severityLevel:o,notificationRequired:n,urgentNotificationRequired:f,timeframeHours:72,justification:r.justification||"Based on risk assessment results"}}let s={ongoing:t.status==="ongoing",sensitiveData:["health","financial","biometric","children","location","religious","political","ethnic"].some(o=>t.dataTypes.includes(o)),largeScale:(t.estimatedAffectedSubjects||0)>1e3,delayedDiscovery:t.occurredAt&&t.discoveredAt-t.occurredAt>10080*60*1e3},a=Object.values(s).filter(Boolean).length,i;a===0?i="low":a===1?i="medium":a===2?i="high":i="critical";let l=i!=="low",u=i==="high"||i==="critical",d=72,c=Object.entries(s).filter(([o,n])=>n).map(([o,n])=>o).join(", "),e="";return i==="low"?e="Low risk due to minimal data exposure and effective containment":i==="medium"?s.ongoing?e=`Medium risk due to personal data exposure (ongoing: ${s.ongoing})`:e="Medium risk due to personal data exposure":i==="high"?e="High risk due to sensitive financial data":i==="critical"&&(e="Critical risk due to large-scale sensitive data exposure"),c&&(i==="medium"||i==="high"||i==="critical")&&(e.includes(c)||(e+=` (factors: ${c})`)),{severityLevel:i,notificationRequired:l,urgentNotificationRequired:u,timeframeHours:d,justification:e}}export{v as a};//# sourceMappingURL=chunk-RGYK4VAY.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-RGYK4VAY.mjs.map
|
package/dist/chunk-RSUDIFZV.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-2SYNHRP6.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var oe=({requests:k,onSelectRequest:T,onUpdateStatus:$,onAssignRequest:I,title:H="Data Subject Request Dashboard",description:X="Track and manage data subject requests in compliance with NDPA Part IV requirements.",className:J="",buttonClassName:V="",showRequestDetails:K=true,showRequestTimeline:Y=true,showDeadlineAlerts:F=true,assignees:i=[],classNames:s,unstyled:f=false})=>{let[R,y]=useState(null),[N,B]=useState(k),[j,O]=useState("all"),[C,M]=useState("all"),[A,_]=useState(""),[P,z]=useState("createdAt"),[L,Z]=useState("desc"),[D,G]=useState("");useEffect(()=>{let e=[...k];if(j!=="all"&&(e=e.filter(r=>r.status===j)),C!=="all"&&(e=e.filter(r=>r.type===C)),A){let r=A.toLowerCase();e=e.filter(p=>p.subject.name.toLowerCase().includes(r)||p.subject.email.toLowerCase().includes(r)||p.description&&p.description.toLowerCase().includes(r));}e.sort((r,p)=>{let w=0;switch(P){case "createdAt":w=r.createdAt-p.createdAt;break;case "dueDate":w=(r.dueDate||0)-(p.dueDate||0);break;case "type":w=r.type.localeCompare(p.type);break;case "status":w=r.status.localeCompare(p.status);break;default:w=r.createdAt-p.createdAt;}return L==="asc"?w:-w}),B(e);},[k,j,C,A,P,L]),useEffect(()=>{N.length>0&&!R&&y(N[0].id);},[N,R]);let Q=e=>{y(e),T&&T(e);},U=e=>{R&&$&&$(R,e);},W=()=>{R&&D&&I&&(I(R,D),G(""));},h=e=>new Date(e).toLocaleDateString(),E=e=>{let r=Date.now(),p=(e-r)/(1440*60*1e3);return Math.ceil(p)},m=R?k.find(e=>e.id===R):null,t=e=>{let r={information:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",access:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",rectification:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",erasure:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",restriction:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",portability:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",objection:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",automated_decision_making:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},p={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${r[e]}`,children:p[e]})},l=e=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{pending:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",inProgress:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",completed:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",rejected:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",awaitingVerification:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200"}[e]}`,s==null?void 0:s.statusBadge,f),children:e==="inProgress"?"In Progress":e==="awaitingVerification"?"Awaiting Verification":e.charAt(0).toUpperCase()+e.slice(1)}),g=e=>{if(!e.dueDate)return null;let r=E(e.dueDate);return r<=0?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Deadline Passed"}),jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The response deadline has passed. Immediate action is required."})]}):r<=3?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Deadline Approaching"}),jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",r," day",r!==1?"s":""," remaining until the response deadline."]})]}):r<=7?jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Deadline Approaching"}),jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:[r," days remaining until the response deadline."]})]}):jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Deadline Tracking"}),jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:[r," days remaining until the response deadline."]})]})},x=e=>{let r=[{title:"Request Received",date:e.createdAt,completed:true,description:`Request was received on ${h(e.createdAt)}.`}];return e.verifiedAt?r.push({title:"Identity Verified",date:e.verifiedAt,completed:true,description:`Data subject's identity was verified on ${h(e.verifiedAt)}.`}):e.status==="awaitingVerification"&&r.push({title:"Identity Verification",date:Date.now(),completed:false,description:"Awaiting verification of data subject's identity."}),(e.status==="inProgress"||e.status==="completed"||e.status==="rejected")&&r.push({title:"Processing Started",date:e.updatedAt,completed:true,description:`Request processing started on ${h(e.updatedAt)}.`}),e.status==="completed"?r.push({title:"Request Completed",date:e.completedAt||Date.now(),completed:true,description:`Request was completed on ${h(e.completedAt||Date.now())}.`}):e.status==="rejected"&&r.push({title:"Request Rejected",date:e.completedAt||Date.now(),completed:true,description:`Request was rejected on ${h(e.completedAt||Date.now())}.${e.rejectionReason?` Reason: ${e.rejectionReason}`:""}`}),e.dueDate&&r.push({title:"Response Deadline",date:e.dueDate,completed:Date.now()>e.dueDate,description:`Response is due by ${h(e.dueDate)}.`}),jsxs("div",{className:"mt-6",children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Request Timeline"}),jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:r.map((p,w)=>jsxs("li",{className:"mb-6 ml-4",children:[jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${p.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 text-gray-600 dark:text-gray-500",children:p.date?h(p.date):"Pending"}),jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:p.title}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:p.description})]},w))})]})},o=()=>[{value:"all",label:"All Types"},{value:"information",label:"Information (NDPA Section 29)"},{value:"access",label:"Access (NDPA Section 30)"},{value:"rectification",label:"Rectification (NDPA Section 31)"},{value:"erasure",label:"Erasure (NDPA Section 32)"},{value:"restriction",label:"Restriction (NDPA Section 33)"},{value:"portability",label:"Portability (NDPA Section 34)"},{value:"objection",label:"Objection (NDPA Section 35)"},{value:"automated_decision_making",label:"Automated Decision-Making (NDPA Section 36)"}].map(r=>jsx("option",{value:r.value,children:r.label},r.value)),u=()=>[{value:"all",label:"All Statuses"},{value:"pending",label:"Pending"},{value:"awaitingVerification",label:"Awaiting Verification"},{value:"inProgress",label:"In Progress"},{value:"completed",label:"Completed"},{value:"rejected",label:"Rejected"}].map(r=>jsx("option",{value:r.value,children:r.label},r.value)),v=()=>[{value:"pending",label:"Pending"},{value:"awaitingVerification",label:"Awaiting Verification"},{value:"inProgress",label:"In Progress"},{value:"completed",label:"Completed"},{value:"rejected",label:"Rejected"}].map(r=>jsx("option",{value:r.value,children:r.label},r.value));return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${J}`,s==null?void 0:s.root,f),children:[jsxs("div",{className:a("",s==null?void 0:s.header,f),children:[jsx("h2",{className:a("text-xl font-bold mb-2",s==null?void 0:s.title,f),children:H}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:X})]}),jsxs("div",{className:a("mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",s==null?void 0:s.filters,f),children:[jsxs("div",{children:[jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsx("select",{id:"statusFilter",value:j,onChange:e=>O(e.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:u()})]}),jsxs("div",{children:[jsx("label",{htmlFor:"typeFilter",className:"block text-sm font-medium mb-1",children:"Request Type Filter"}),jsx("select",{id:"typeFilter",value:C,onChange:e=>M(e.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:o()})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxs("select",{id:"sortBy",value:P,onChange:e=>z(e.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsx("option",{value:"createdAt",children:"Date Received"}),jsx("option",{value:"dueDate",children:"Due Date"}),jsx("option",{value:"type",children:"Request Type"}),jsx("option",{value:"status",children:"Status"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsx("input",{type:"text",id:"searchTerm",value:A,onChange:e=>_(e.target.value),placeholder:"Search requests...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),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:"DSR Requests"}),N.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data subject requests found."}):jsx("div",{className:a("space-y-2 max-h-96 overflow-y-auto pr-2",s==null?void 0:s.requestList,f),children:N.map(e=>{let r=e.dueDate?E(e.dueDate):null,p=null;return r!==null&&(r<=0?p=jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):r<=3?p=jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):r<=7&&(p=jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Soon"}))),jsxs("div",{className:a(`p-3 rounded-md cursor-pointer ${R===e.id?"bg-[rgb(var(--ndpr-primary)/0.05)] dark:bg-[rgb(var(--ndpr-primary)/0.1)] border border-[rgb(var(--ndpr-primary)/0.2)] dark:border-[rgb(var(--ndpr-primary)/0.3)]":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,s==null?void 0:s.requestItem,f),onClick:()=>Q(e.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:e.subject.name}),t(e.type)]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:e.subject.email}),jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:["Received: ",h(e.createdAt)]}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsx("div",{children:l(e.status)}),jsx("div",{children:p})]})]},e.id)})})]}),jsx("div",{className:a("md:col-span-2",s==null?void 0:s.detailPanel,f),children:m?jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsx("h3",{className:"text-lg font-medium",children:m.subject.name}),jsxs("div",{className:"flex space-x-2",children:[t(m.type),l(m.status)]})]}),F&&m.dueDate&&jsx("div",{className:"mb-4",children:g(m)}),K&&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:"text-sm",children:[jsx("span",{className:"font-medium",children:"Email:"})," ",m.subject.email]}),m.subject.phone&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Phone:"})," ",m.subject.phone]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Received:"})," ",h(m.createdAt)]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Request Type:"})," ",{information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"}[m.type]||m.type]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",m.status==="inProgress"?"In Progress":m.status==="awaitingVerification"?"Awaiting Verification":m.status.charAt(0).toUpperCase()+m.status.slice(1)]}),m.dueDate&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Due Date:"})," ",h(m.dueDate)]})]})]}),m.description&&jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium",children:"Request Details:"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:m.description})]}),m.additionalInfo&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium",children:"Additional Information:"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:typeof m.additionalInfo=="object"?JSON.stringify(m.additionalInfo,null,2):String(m.additionalInfo||"No additional information provided")})]})]}),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("h3",{className:"text-md font-medium mb-2",children:"Update Status"}),jsxs("div",{className:"flex space-x-2",children:[jsx("select",{value:m.status,onChange:e=>U(e.target.value),className:"flex-grow px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:v()}),jsx("button",{onClick:()=>U(m.status),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${V}`,children:"Update"})]})]}),i.length>0&&jsxs("div",{children:[jsx("h3",{className:"text-md font-medium mb-2",children:"Assign Request"}),jsxs("div",{className:"flex space-x-2",children:[jsxs("select",{value:D,onChange:e=>G(e.target.value),className:"flex-grow px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsx("option",{value:"",children:"Select Assignee"}),i.map(e=>jsx("option",{value:e,children:e},e))]}),jsx("button",{onClick:W,disabled:!D,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] disabled:bg-gray-300 disabled:text-gray-500 ${V}`,children:"Assign"})]})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Request Summary"}),jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:jsx("pre",{children:JSON.stringify(a$1(m),null,2)})})})]}),Y&&x(m)]}):jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Select a request to view details"})})})]})]})};var ue=({requests:k,onSelectRequest:T,title:$="DSR Request Tracker",description:I="Track the status and progress of data subject requests as required by NDPA Part IV.",className:H="",buttonClassName:X="",showSummaryStats:J=true,showTypeBreakdown:V=true,showStatusBreakdown:K=true,showTimelineChart:Y=true,showOverdueRequests:F=true,classNames:i,unstyled:s=false})=>{let[f,R]=useState("30days"),[y,N]=useState(k),[B,j]=useState([]),[O,C]=useState([]);useEffect(()=>{let t=Date.now(),l;switch(f){case "7days":l=k.filter(o=>t-o.createdAt<=10080*60*1e3);break;case "30days":l=k.filter(o=>t-o.createdAt<=720*60*60*1e3);break;case "90days":l=k.filter(o=>t-o.createdAt<=2160*60*60*1e3);break;default:l=[...k];}N(l);let g=l.filter(o=>o.dueDate&&t>o.dueDate&&o.status!=="completed"&&o.status!=="rejected");j(g);let x=l.filter(o=>o.dueDate&&t<o.dueDate&&o.dueDate-t<=10080*60*1e3&&o.status!=="completed"&&o.status!=="rejected");C(x);},[k,f]);let M=t=>{T&&T(t);},A=t=>new Date(t).toLocaleDateString(),_=t=>{let l=Date.now(),g=(t-l)/(1440*60*1e3);return Math.ceil(g)},P=()=>{let t=y.filter(g=>g.status==="completed"&&g.completedAt&&g.createdAt);if(t.length===0)return null;let l=t.reduce((g,x)=>{let o=((x.completedAt||0)-x.createdAt)/864e5;return g+o},0);return Number((l/t.length).toFixed(1))},z=()=>{let t=y.filter(g=>(g.status==="completed"||g.status==="rejected")&&g.completedAt&&g.dueDate);if(t.length===0)return null;let l=t.filter(g=>(g.completedAt||0)<=(g.dueDate||0));return Math.round(l.length/t.length*100)},L=()=>{let t={};return y.forEach(l=>{t[l.type]=(t[l.type]||0)+1;}),{information:t.information||0,access:t.access||0,rectification:t.rectification||0,erasure:t.erasure||0,restriction:t.restriction||0,portability:t.portability||0,objection:t.objection||0,automated_decision_making:t.automated_decision_making||0}},Z=()=>{let t={};return y.forEach(l=>{t[l.status]=(t[l.status]||0)+1;}),{pending:t.pending||0,awaitingVerification:t.awaitingVerification||0,inProgress:t.inProgress||0,completed:t.completed||0,rejected:t.rejected||0}},D=t=>{let l={information:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",access:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",rectification:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",erasure:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",restriction:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",portability:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",objection:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",automated_decision_making:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},g={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${l[t]}`,children:g[t]})},Q=()=>{let t=y.length,l=y.filter(u=>u.status!=="completed"&&u.status!=="rejected").length;y.filter(u=>u.status==="completed"||u.status==="rejected").length;let x=P(),o=z();return jsxs("div",{className:a("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",i==null?void 0:i.stats,s),children:[jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,s),children:[jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Total Requests"}),jsx("p",{className:"text-2xl font-bold",children:t})]}),jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,s),children:[jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Pending Requests"}),jsx("p",{className:"text-2xl font-bold",children:l})]}),jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,s),children:[jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Avg. Response Time"}),jsx("p",{className:"text-2xl font-bold",children:x!==null?`${x} days`:"N/A"})]}),jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,s),children:[jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Compliance Rate"}),jsx("p",{className:"text-2xl font-bold",children:o!==null?`${o}%`:"N/A"})]})]})},U=()=>{let t=L(),l=y.length,g=Object.entries(t).sort(([,x],[,o])=>o-x).map(([x])=>x);return jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",i==null?void 0:i.table,s),children:[jsx("h3",{className:a("text-lg font-medium mb-4",i==null?void 0:i.tableHeader,s),children:"Request Types"}),l===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsx("div",{className:"space-y-4",children:g.map(x=>{let o=t[x],u=Math.round(o/l*100);return jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-center mb-1",children:[jsxs("div",{className:"flex items-center",children:[D(x),jsxs("span",{className:"ml-2 text-sm",children:[o," requests"]})]}),jsxs("span",{className:"text-sm font-medium",children:[u,"%"]})]}),jsx("div",{className:"w-full bg-gray-200 dark:bg-gray-600 rounded-full h-2.5",children:jsx("div",{className:"bg-[rgb(var(--ndpr-primary))] h-2.5 rounded-full",style:{width:`${u}%`}})})]},x)})})]})},W=()=>{let t=Z(),l=y.length,g=["pending","awaitingVerification","inProgress","completed","rejected"],x={pending:"bg-yellow-500",awaitingVerification:"bg-purple-500",inProgress:"bg-blue-500",completed:"bg-green-500",rejected:"bg-red-500"};return jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",i==null?void 0:i.table,s),children:[jsx("h3",{className:a("text-lg font-medium mb-4",i==null?void 0:i.tableHeader,s),children:"Request Status"}),l===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxs("div",{children:[jsx("div",{className:"flex h-4 mb-2",children:g.map(o=>{let u=t[o],v=u/l*100;return v>0?jsx("div",{className:`${x[o]} first:rounded-l-full last:rounded-r-full`,style:{width:`${v}%`},title:`${o}: ${u} (${Math.round(v)}%)`},o):null})}),jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 mt-4",children:g.map(o=>{let u=t[o],v=Math.round(u/l*100);return jsxs("div",{className:"flex items-center",children:[jsx("div",{className:`w-3 h-3 rounded-full ${x[o]} mr-2`}),jsxs("div",{children:[jsx("p",{className:"text-xs font-medium",children:o==="inProgress"?"In Progress":o==="awaitingVerification"?"Awaiting Verification":o.charAt(0).toUpperCase()+o.slice(1)}),jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:[u," (",v,"%)"]})]})]},o)})})]})]})},h=()=>{let t={};y.forEach(u=>{let v=new Date(u.createdAt),e=`${v.getFullYear()}-${String(v.getMonth()+1).padStart(2,"0")}`;t[e]=(t[e]||0)+1;});let g=Object.keys(t).sort().slice(-6),x=Math.max(...Object.values(t).filter(u=>u>0),1),o=u=>{let[v,e]=u.split("-");return `${e}/${v.slice(2)}`};return jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Request Timeline"}),g.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxs("div",{className:"h-40",children:[jsx("div",{className:"flex h-32 items-end justify-between space-x-2",children:g.map(u=>{let v=t[u],e=`${v/x*100}%`;return jsx("div",{className:"flex flex-col items-center flex-1",children:jsx("div",{className:"w-full bg-[rgb(var(--ndpr-primary))] rounded-t",style:{height:e},title:`${o(u)}: ${v} requests`})},u)})}),jsx("div",{className:"flex justify-between mt-2",children:g.map(u=>jsx("div",{className:"text-xs text-center",children:o(u)},u))})]})]})},E=()=>jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Overdue Requests"}),B.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No overdue requests."}):jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:B.map(t=>jsxs("div",{className:a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md cursor-pointer hover:bg-red-100 dark:hover:bg-red-900/30",i==null?void 0:i.tableRow,s),onClick:()=>M(t.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:t.subject.name}),D(t.type)]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:t.subject.email}),jsxs("div",{className:"flex justify-between items-center",children:[jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:["Due: ",A(t.dueDate||0)]}),jsxs("p",{className:"text-xs font-bold text-red-600 dark:text-red-400",children:["Overdue by ",Math.abs(_(t.dueDate||0))," days"]})]})]},t.id))})]}),m=()=>jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Upcoming Deadlines"}),O.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No upcoming deadlines in the next 7 days."}):jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:O.map(t=>{let l=_(t.dueDate||0);return jsxs("div",{className:a("p-3 bg-yellow-50 dark:bg-yellow-900/20 rounded-md cursor-pointer hover:bg-yellow-100 dark:hover:bg-yellow-900/30",i==null?void 0:i.tableRow,s),onClick:()=>M(t.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:t.subject.name}),D(t.type)]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:t.subject.email}),jsxs("div",{className:"flex justify-between items-center",children:[jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:["Due: ",A(t.dueDate||0)]}),jsxs("p",{className:`text-xs font-bold ${l<=3?"text-red-600 dark:text-red-400":"text-yellow-600 dark:text-yellow-400"}`,children:["Due in ",l," days"]})]})]},t.id)})})]});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${H}`,i==null?void 0:i.root,s),children:[jsxs("div",{className:a("flex flex-col md:flex-row md:justify-between md:items-center mb-6",i==null?void 0:i.header,s),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-bold mb-2",i==null?void 0:i.title,s),children:$}),jsx("p",{className:"text-gray-600 dark:text-gray-300",children:I})]}),jsxs("div",{className:"mt-4 md:mt-0",children:[jsx("label",{htmlFor:"timeframe",className:"block text-sm font-medium mb-1",children:"Timeframe"}),jsxs("select",{id:"timeframe",value:f,onChange:t=>R(t.target.value),className:"px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsx("option",{value:"7days",children:"Last 7 Days"}),jsx("option",{value:"30days",children:"Last 30 Days"}),jsx("option",{value:"90days",children:"Last 90 Days"}),jsx("option",{value:"all",children:"All Time"})]})]})]}),J&&Q(),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[jsxs("div",{children:[V&&U(),K&&W()]}),jsxs("div",{children:[Y&&h(),F&&E(),F&&m()]})]})]})};export{oe as a,ue as b};//# sourceMappingURL=chunk-RSUDIFZV.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-RSUDIFZV.mjs.map
|
package/dist/chunk-RYZEIDNR.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';function v(t,r){if(r){let{riskLevel:o,risksToRightsAndFreedoms:n,highRisksToRightsAndFreedoms:f}=r;return {severityLevel:o,notificationRequired:n,urgentNotificationRequired:f,timeframeHours:72,justification:r.justification||"Based on risk assessment results"}}let s={ongoing:t.status==="ongoing",sensitiveData:["health","financial","biometric","children","location","religious","political","ethnic"].some(o=>t.dataTypes.includes(o)),largeScale:(t.estimatedAffectedSubjects||0)>1e3,delayedDiscovery:t.occurredAt&&t.discoveredAt-t.occurredAt>10080*60*1e3},a=Object.values(s).filter(Boolean).length,i;a===0?i="low":a===1?i="medium":a===2?i="high":i="critical";let l=i!=="low",u=i==="high"||i==="critical",d=72,c=Object.entries(s).filter(([o,n])=>n).map(([o,n])=>o).join(", "),e="";return i==="low"?e="Low risk due to minimal data exposure and effective containment":i==="medium"?s.ongoing?e=`Medium risk due to personal data exposure (ongoing: ${s.ongoing})`:e="Medium risk due to personal data exposure":i==="high"?e="High risk due to sensitive financial data":i==="critical"&&(e="Critical risk due to large-scale sensitive data exposure"),c&&(i==="medium"||i==="high"||i==="critical")&&(e.includes(c)||(e+=` (factors: ${c})`)),{severityLevel:i,notificationRequired:l,urgentNotificationRequired:u,timeframeHours:d,justification:e}}exports.a=v;//# sourceMappingURL=chunk-RYZEIDNR.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-RYZEIDNR.js.map
|
package/dist/chunk-SBNAMPAP.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function r(t){return {load(){if(typeof window=="undefined")return null;try{let e=localStorage.getItem(t);return e?JSON.parse(e):null}catch(e){return null}},save(e){typeof window!="undefined"&&localStorage.setItem(t,JSON.stringify(e));},remove(){typeof window!="undefined"&&localStorage.removeItem(t);}}}export{r as a};//# sourceMappingURL=chunk-SBNAMPAP.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-SBNAMPAP.mjs.map
|
package/dist/chunk-SSGJREE3.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';function a(c){let i={low:0,medium:0,high:0,critical:0},l=0,o=[];c.risks.forEach(e=>{i[e.level]++,e.score>l&&(l=e.score),(e.level==="high"||e.level==="critical")&&!e.mitigated&&o.push(e);});let s;i.critical>0?s="critical":i.high>2||i.high>0&&i.medium>3?s="high":i.high>0||i.medium>1?s="medium":s="low";let r=s==="high"||s==="critical",n=o.length===0,t=[];return o.length>0&&t.push(`Mitigate the following high/critical risks before proceeding: ${o.map(e=>e.description).join(", ")}`),r&&t.push("Consult with the NDPC (Nigeria Data Protection Commission) before proceeding with this processing activity, as required by NDPA Section 39."),i.medium>0&&t.push("Implement additional safeguards to reduce medium-level risks where possible."),s!=="low"?t.push("Schedule a review of this DPIA in 6 months to reassess risks and effectiveness of mitigation measures."):t.push("Schedule a review of this DPIA in 12 months as part of regular compliance activities."),{overallRiskLevel:s,requiresConsultation:r,canProceed:n,recommendations:t}}exports.a=a;//# sourceMappingURL=chunk-SSGJREE3.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-SSGJREE3.js.map
|
package/dist/chunk-U6VWHC46.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkRYZEIDNR_js=require('./chunk-RYZEIDNR.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var ve=({breachData:g,initialAssessment:u={},onComplete:k,title:V="Breach Risk Assessment",description:Y="Assess the risk level of this data breach to determine notification requirements under NDPA Section 40.",submitButtonText:J="Complete Assessment",className:ee="",buttonClassName:_="",classNames:h={},unstyled:d=false,showBreachSummary:l=true,showNotificationRequirements:R=true})=>{let[L,te]=react.useState(u.confidentialityImpact||3),[$,v]=react.useState(u.integrityImpact||3),[D,C]=react.useState(u.availabilityImpact||3),[j,B]=react.useState(u.harmLikelihood||3),[q,P]=react.useState(u.harmSeverity||3),[U,E]=react.useState(u.risksToRightsAndFreedoms!==void 0?u.risksToRightsAndFreedoms:false),[H,M]=react.useState(u.highRisksToRightsAndFreedoms!==void 0?u.highRisksToRightsAndFreedoms:false),[K,ae]=react.useState(u.justification||""),[W,se]=react.useState(0),[w,f]=react.useState("low"),[x,b]=react.useState(false),[y,Z]=react.useState(0),[O,Q]=react.useState(0),[p,S]=react.useState(false);react.useEffect(()=>{let X=L*.2+$*.1+D*.1+j*.3+q*.3;se(Number(X.toFixed(1)));let F;X<2?F="low":X<3?F="medium":X<4?F="high":F="critical",f(F),b(U||F==="high"||F==="critical");let ne=g.discoveredAt+4320*60*1e3;Z(ne);let ce=Date.now(),pe=(ne-ce)/(3600*1e3);Q(Number(pe.toFixed(1)));},[L,$,D,j,q,U,g.discoveredAt]);let ie=o=>new Date(o).toLocaleString(),re=o=>{o.preventDefault();let N={id:u.id||`assessment_${Date.now()}`,breachId:g.id,assessedAt:Date.now(),assessor:u.assessor||{name:"Assessment User",role:"Data Protection Officer",email:"dpo@example.com"},confidentialityImpact:L,integrityImpact:$,availabilityImpact:D,harmLikelihood:j,harmSeverity:q,overallRiskScore:W,riskLevel:w,risksToRightsAndFreedoms:U,highRisksToRightsAndFreedoms:H,justification:K};k(N),S(true);},s=o=>{switch(o){case 1:return "Minimal";case 2:return "Low";case 3:return "Moderate";case 4:return "High";case 5:return "Severe";default:return "Unknown"}},c=o=>jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[o]}`,h.riskBadge,d),children:o.charAt(0).toUpperCase()+o.slice(1)});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ee}`,h.root,d),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",h.title,d),children:V}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:Y}),l&&jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-2",children:"Breach Summary"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Title:"})," ",g.title]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Discovered:"})," ",ie(g.discoveredAt)]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",g.status.charAt(0).toUpperCase()+g.status.slice(1)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Types:"})," ",g.dataTypes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",g.affectedSystems.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",g.estimatedAffectedSubjects||"Unknown"]})]})]})]}),p?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Assessment Results"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Overall Risk Level:"})," ",c(w)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Score:"})," ",W," / 5"]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Assessed On:"})," ",ie(Date.now())]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",U?"Yes":"No"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",H?"Yes":"No"]})]})]}),jsxRuntime.jsxs("div",{className:"mt-3",children:[jsxRuntime.jsx("p",{className:"text-sm mb-1",children:jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})}),jsxRuntime.jsx("p",{className:"text-sm bg-white dark:bg-gray-800 p-2 rounded",children:K})]})]}),R&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`mb-6 p-4 rounded-md ${x?O>24?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20":"bg-green-50 dark:bg-green-900/20"}`,h.notificationStatus,d),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Requirements"}),x?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:`text-sm font-bold mb-2 ${O>24?"text-yellow-800 dark:text-yellow-200":"text-red-800 dark:text-red-200"}`,children:"NDPC Notification Required"}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"Under the NDPA (Section 40), this breach must be reported to the NDPC within 72 hours of discovery."}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notification Deadline:"})," ",ie(y)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Time Remaining:"})," ",jsxRuntime.jsx("span",{className:O<24?"text-red-600 dark:text-red-400 font-bold":"",children:O>0?`${O} hours`:"Deadline passed"})]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subject Notification:"})," ",H?"Required (NDPA Section 40(4))":"Not required unless directed by NDPC"]})]}):jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-bold mb-2 text-green-800 dark:text-green-200",children:"NDPC Notification Not Required"}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"Based on this assessment, this breach does not need to be reported to the NDPC."}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"However, the breach should still be documented internally for compliance purposes."})]}),jsxRuntime.jsxs("div",{className:"mt-3 text-sm",children:[jsxRuntime.jsx("p",{className:"font-medium",children:"Next Steps:"}),jsxRuntime.jsx("ul",{className:"list-disc pl-5 mt-1",children:x?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("li",{children:"Prepare a notification report for the NDPC"}),jsxRuntime.jsx("li",{children:"Document all aspects of the breach and your response"}),H&&jsxRuntime.jsx("li",{children:"Prepare communications for affected data subjects"}),jsxRuntime.jsx("li",{children:"Implement measures to mitigate the impact of the breach"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("li",{children:"Document the breach and this assessment in your internal records"}),jsxRuntime.jsx("li",{children:"Implement measures to prevent similar breaches in the future"}),jsxRuntime.jsx("li",{children:"Review and update security measures as needed"})]})})]})]}),jsxRuntime.jsx("button",{onClick:()=>S(false),className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${_}`,h.primaryButton||h.submitButton,d),children:"Edit Assessment"})]}):jsxRuntime.jsx("form",{onSubmit:re,children:jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Assessment"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"confidentialityImpact",className:"block text-sm font-medium mb-1",children:["Confidentiality Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the confidentiality of data been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"confidentialityImpact",min:"1",max:"5",step:"1",value:L,onChange:o=>te(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",h.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(L)," (",L,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"integrityImpact",className:"block text-sm font-medium mb-1",children:["Integrity Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the integrity of data been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"integrityImpact",min:"1",max:"5",step:"1",value:$,onChange:o=>v(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",h.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s($)," (",$,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"availabilityImpact",className:"block text-sm font-medium mb-1",children:["Availability Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the availability of data or systems been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"availabilityImpact",min:"1",max:"5",step:"1",value:D,onChange:o=>C(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",h.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(D)," (",D,")"]})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Risk to Data Subjects"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"harmLikelihood",className:"block text-sm font-medium mb-1",children:["Likelihood of Harm (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How likely is it that data subjects will experience harm?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"harmLikelihood",min:"1",max:"5",step:"1",value:j,onChange:o=>B(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",h.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(j)," (",j,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"harmSeverity",className:"block text-sm font-medium mb-1",children:["Severity of Harm (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How severe would the harm be to affected data subjects?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"harmSeverity",min:"1",max:"5",step:"1",value:q,onChange:o=>P(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",h.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(q)," (",q,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"risksToRightsAndFreedoms",checked:U,onChange:o=>E(o.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"risksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a risk to the rights and freedoms of data subjects"})]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40), breaches that pose a risk to rights and freedoms must be reported to the NDPC within 72 hours."})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"highRisksToRightsAndFreedoms",checked:H,onChange:o=>M(o.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"highRisksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a high risk to the rights and freedoms of data subjects"})]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40(4)), breaches that pose a high risk to rights and freedoms also require notification to affected data subjects without undue delay."})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Overall Assessment"}),jsxRuntime.jsxs("div",{className:"mb-4 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Overall Risk Score:"}),jsxRuntime.jsxs("span",{className:chunkE64TU6IU_js.a("",h.riskScore,d),children:[W," / 5"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Level:"}),c(w)]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:["Justification for Assessment ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"justification",value:K,onChange:o=>ae(o.target.value),rows:4,placeholder:"Explain the reasoning behind your assessment, including any factors that influenced your decision.",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true})]})]}),jsxRuntime.jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This assessment will determine if notification is required for this breach."})]}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{type:"submit",className:chunkE64TU6IU_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${_}`,h.primaryButton||h.submitButton,d),children:J})})]})})]})};var Ce=({breachReports:g,riskAssessments:u,regulatoryNotifications:k,onSelectBreach:V,onRequestAssessment:Y,onRequestNotification:J,title:ee="Breach Notification Manager",description:_="Manage data breach notifications and track compliance with NDPA Section 40 requirements.",className:h="",buttonClassName:d="",classNames:l={},unstyled:R=false,showBreachDetails:L=true,showNotificationTimeline:te=true,showDeadlineAlerts:$=true})=>{var re;let[v,D]=react.useState(null),[C,j]=react.useState(g),[B,q]=react.useState("all"),[P,U]=react.useState(""),[E,H]=react.useState("discoveredAt"),[M,K]=react.useState("desc");react.useEffect(()=>{let s=[...g];if(B!=="all"&&(s=s.filter(c=>c.status===B)),P){let c=P.toLowerCase();s=s.filter(o=>o.title.toLowerCase().includes(c)||o.description.toLowerCase().includes(c)||o.affectedSystems.some(N=>N.toLowerCase().includes(c))||o.dataTypes.some(N=>N.toLowerCase().includes(c)));}s.sort((c,o)=>{let N=0;switch(E){case "title":N=c.title.localeCompare(o.title);break;case "discoveredAt":N=c.discoveredAt-o.discoveredAt;break;case "status":N=c.status.localeCompare(o.status);break;case "riskLevel":let I=u.find(F=>F.breachId===c.id),T=u.find(F=>F.breachId===o.id),oe=(I==null?void 0:I.riskLevel)||"unknown",X=(T==null?void 0:T.riskLevel)||"unknown";N=oe.localeCompare(X);break;default:N=c.discoveredAt-o.discoveredAt;}return M==="asc"?N:-N}),j(s);},[g,B,P,E,M,u]),react.useEffect(()=>{C.length>0&&!v&&D(C[0].id);},[C,v]);let ae=s=>{D(s),V&&V(s);},W=()=>{v&&Y&&Y(v);},se=()=>{v&&J&&J(v);},w=s=>new Date(s).toLocaleString(),f=v?g.find(s=>s.id===v):null,x=v?u.find(s=>s.breachId===v):null,b=v?k.find(s=>s.breachId===v):null,y=f?Z(f,x):null;function Z(s,c){let o=chunkRYZEIDNR_js.a(s,c||void 0),N=s.discoveredAt+o.timeframeHours*60*60*1e3;return {ndpcNotificationRequired:o.notificationRequired,ndpcNotificationDeadline:N,dataSubjectNotificationRequired:(c==null?void 0:c.highRisksToRightsAndFreedoms)||false,justification:o.justification}}function O(s){let c=Date.now(),o=(s-c)/(3600*1e3);return Number(o.toFixed(1))}let Q=s=>s?jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[s]}`,l.statusBadge,R),children:s.charAt(0).toUpperCase()+s.slice(1)}):null,p=s=>jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{ongoing:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",contained:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",resolved:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"}[s]||"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200"}`,l.statusBadge,R),children:s.charAt(0).toUpperCase()+s.slice(1)}),S=()=>{if(!f||!y)return null;if(!y.ndpcNotificationRequired)return jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Not Required"}),jsxRuntime.jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"Based on the risk assessment, NDPC notification is not required for this breach."})]});if(b)return jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Sent"}),jsxRuntime.jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:["Notification was sent to the NDPC on ",w(b.sentAt),"."]})]});let s=O(y.ndpcNotificationDeadline);return s<=0?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Notification Deadline Passed"}),jsxRuntime.jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The 72-hour deadline for NDPC notification has passed. Notification should be sent immediately."})]}):s<=24?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Notification Due Soon"}),jsxRuntime.jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",s," hours remaining until the NDPC notification deadline."]})]}):jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Notification Required"}),jsxRuntime.jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:["NDPC notification is required by ",w(y.ndpcNotificationDeadline)," (",s," hours remaining)."]})]})},ie=()=>{if(!f)return null;let s=[{title:"Breach Discovered",date:f.discoveredAt,completed:true,description:`Breach was discovered on ${w(f.discoveredAt)}.`},{title:"Risk Assessment",date:x==null?void 0:x.assessedAt,completed:!!x,description:x?`Risk assessment completed on ${w(x.assessedAt)}.`:"Risk assessment has not been completed yet."}];return y!=null&&y.ndpcNotificationRequired&&s.push({title:"NDPC Notification",date:b==null?void 0:b.sentAt,completed:!!b,description:b?`Notification sent to the NDPC on ${w(b.sentAt)}.`:`Notification must be sent to the NDPC by ${w(y.ndpcNotificationDeadline)}.`}),y!=null&&y.dataSubjectNotificationRequired&&s.push({title:"Data Subject Notification",date:void 0,completed:false,description:"Notification to affected data subjects is required but has not been sent yet."}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-6",l.timeline,R),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Notification Timeline"}),jsxRuntime.jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:s.map((c,o)=>jsxRuntime.jsxs("li",{className:chunkE64TU6IU_js.a("mb-6 ml-4",l.timelineStep,R),children:[jsxRuntime.jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${c.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsxRuntime.jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-600 dark:text-gray-500",children:c.date?w(c.date):"Pending"}),jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:c.title}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:c.description})]},o))})]})};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${h}`,l.root,R),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",l.header,R),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",l.title,R),children:ee}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:_})]}),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxRuntime.jsxs("select",{id:"statusFilter",value:B,onChange:s=>q(s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),jsxRuntime.jsx("option",{value:"ongoing",children:"Ongoing"}),jsxRuntime.jsx("option",{value:"contained",children:"Contained"}),jsxRuntime.jsx("option",{value:"resolved",children:"Resolved"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxRuntime.jsxs("select",{id:"sortBy",value:E,onChange:s=>H(s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"discoveredAt",children:"Discovery Date"}),jsxRuntime.jsx("option",{value:"title",children:"Title"}),jsxRuntime.jsx("option",{value:"status",children:"Status"}),jsxRuntime.jsx("option",{value:"riskLevel",children:"Risk Level"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"searchTerm",value:P,onChange:s=>U(s.target.value),placeholder:"Search breaches...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxRuntime.jsxs("div",{className:"md:col-span-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Breach Reports"}),C.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No breach reports found."}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",l.breachList,R),children:C.map(s=>{let c=u.find(T=>T.breachId===s.id),o=k.find(T=>T.breachId===s.id),N=Z(s,c),I=null;if(N!=null&&N.ndpcNotificationRequired)if(o)I=jsxRuntime.jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Notified"});else {let T=O(N.ndpcNotificationDeadline);T<=0?I=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):T<=24?I=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):I=jsxRuntime.jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Required"});}else I=jsxRuntime.jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Not Required"});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md cursor-pointer ${v===s.id?"bg-[rgb(var(--ndpr-primary)/0.05)] dark:bg-[rgb(var(--ndpr-primary)/0.1)] border border-[rgb(var(--ndpr-primary)/0.2)] dark:border-[rgb(var(--ndpr-primary)/0.3)]":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,l.breachItem,R),onClick:()=>ae(s.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:s.title}),p(s.status)]}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:["Discovered: ",new Date(s.discoveredAt).toLocaleDateString()]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsxRuntime.jsx("div",{children:c&&Q(c.riskLevel)}),jsxRuntime.jsx("div",{children:I})]})]},s.id)})})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("md:col-span-2",l.detailPanel,R),children:f?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:f.title}),p(f.status)]}),$&&jsxRuntime.jsx("div",{className:"mb-4",children:S()}),L&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Discovered:"})," ",w(f.discoveredAt)]}),f.occurredAt&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Occurred:"})," ",w(f.occurredAt)]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reporter:"})," ",f.reporter.name]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",f.affectedSystems.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Types:"})," ",f.dataTypes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",f.estimatedAffectedSubjects||"Unknown"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Description:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:f.description})]}),f.initialActions&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Initial Actions Taken:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:f.initialActions})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Risk Assessment"}),x?jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Risk Level:"}),Q(x.riskLevel)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Score:"})," ",x.overallRiskScore," / 5"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",x.risksToRightsAndFreedoms?"Yes":"No"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",x.highRisksToRightsAndFreedoms?"Yes":"No"]}),jsxRuntime.jsx("p",{className:"text-sm mb-1",children:jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300 bg-white dark:bg-gray-800 p-2 rounded-md",children:x.justification})]}):jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"Risk assessment has not been conducted yet."}),jsxRuntime.jsx("button",{onClick:W,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${d}`,children:"Conduct Risk Assessment"})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Status"}),b?jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notification Sent:"})," ",w(b.sentAt)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Method:"})," ",b.method.charAt(0).toUpperCase()+b.method.slice(1)]}),b.referenceNumber&&jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference Number:"})," ",b.referenceNumber]}),(b.ndpcContact||b.nitdaContact)&&jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"NDPC Contact:"})," ",(re=b.ndpcContact||b.nitdaContact)==null?void 0:re.name]})]}):jsxRuntime.jsx("div",{children:y!=null&&y.ndpcNotificationRequired?jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"NDPC notification is required but has not been sent yet."}),jsxRuntime.jsx("button",{onClick:se,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${d}`,children:"Generate Notification"})]}):jsxRuntime.jsx("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:"NDPC notification is not required for this breach."})})})]}),te&&ie()]}):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Select a breach to view details"})})})]})]})};var Te=({breachData:g,assessmentData:u,organizationInfo:k,onGenerate:V,title:Y="Generate NDPC Notification Report",description:J="Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements.",generateButtonText:ee="Generate Report",className:_="",buttonClassName:h="",classNames:d={},unstyled:l=false,showPreview:R=true,allowEditing:L=true,allowDownload:te=true,downloadFormat:$="pdf"})=>{let[v,D]=react.useState(""),[C,j]=react.useState(""),[B,q]=react.useState(""),[P,U]=react.useState(""),[E,H]=react.useState("email"),[M,K]=react.useState(""),[ae,W]=react.useState(""),[se,w]=react.useState(false),[f,x]=react.useState(false);react.useEffect(()=>{if(!se){let p=y();D(p),w(true);}},[g,u,k]);let b=p=>new Date(p).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),y=()=>`
|
|
2
|
-
NDPC DATA BREACH NOTIFICATION
|
|
3
|
-
|
|
4
|
-
Date: ${new Date().toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})}
|
|
5
|
-
|
|
6
|
-
Reference: NDPA Section 40 - Breach Notification
|
|
7
|
-
|
|
8
|
-
ORGANIZATION DETAILS
|
|
9
|
-
-------------------
|
|
10
|
-
Organization Name: ${k.name}
|
|
11
|
-
${k.registrationNumber?`Registration Number: ${k.registrationNumber}`:""}
|
|
12
|
-
Address: ${k.address}
|
|
13
|
-
${k.website?`Website: ${k.website}`:""}
|
|
14
|
-
|
|
15
|
-
DATA PROTECTION OFFICER
|
|
16
|
-
----------------------
|
|
17
|
-
Name: ${k.dpoName}
|
|
18
|
-
Email: ${k.dpoEmail}
|
|
19
|
-
${k.dpoPhone?`Phone: ${k.dpoPhone}`:""}
|
|
20
|
-
|
|
21
|
-
BREACH DETAILS
|
|
22
|
-
-------------
|
|
23
|
-
Breach Title: ${g.title}
|
|
24
|
-
Date Discovered: ${b(g.discoveredAt)}
|
|
25
|
-
${g.occurredAt?`Date Occurred: ${b(g.occurredAt)}`:"Date Occurred: Unknown"}
|
|
26
|
-
Status: ${g.status.charAt(0).toUpperCase()+g.status.slice(1)}
|
|
27
|
-
|
|
28
|
-
Description of the Breach:
|
|
29
|
-
${g.description}
|
|
30
|
-
|
|
31
|
-
Affected Systems/Applications:
|
|
32
|
-
${g.affectedSystems.join(", ")}
|
|
33
|
-
|
|
34
|
-
Types of Personal Data Involved:
|
|
35
|
-
${g.dataTypes.join(", ")}
|
|
36
|
-
|
|
37
|
-
Estimated Number of Data Subjects Affected:
|
|
38
|
-
${g.estimatedAffectedSubjects||"Unknown"}
|
|
39
|
-
|
|
40
|
-
RISK ASSESSMENT
|
|
41
|
-
--------------
|
|
42
|
-
${u?`
|
|
43
|
-
Overall Risk Level: ${u.riskLevel.charAt(0).toUpperCase()+u.riskLevel.slice(1)}
|
|
44
|
-
Risk to Rights and Freedoms of Data Subjects: ${u.risksToRightsAndFreedoms?"Yes":"No"}
|
|
45
|
-
High Risk to Rights and Freedoms of Data Subjects: ${u.highRisksToRightsAndFreedoms?"Yes":"No"}
|
|
46
|
-
|
|
47
|
-
Justification for Risk Assessment:
|
|
48
|
-
${u.justification}
|
|
49
|
-
`:"Risk assessment has not been conducted yet."}
|
|
50
|
-
|
|
51
|
-
MEASURES TAKEN
|
|
52
|
-
-------------
|
|
53
|
-
Measures taken or proposed to address the breach:
|
|
54
|
-
${g.initialActions||"To be determined"}
|
|
55
|
-
|
|
56
|
-
Measures taken or proposed to mitigate possible adverse effects:
|
|
57
|
-
[Please specify measures taken to mitigate adverse effects]
|
|
58
|
-
|
|
59
|
-
NOTIFICATION TO DATA SUBJECTS (NDPA Section 40(4))
|
|
60
|
-
----------------------------
|
|
61
|
-
Have data subjects been notified: [Yes/No]
|
|
62
|
-
If yes, date of notification: [Date]
|
|
63
|
-
If no, planned date of notification: [Date]
|
|
64
|
-
Reason for delay (if applicable): [Reason]
|
|
65
|
-
|
|
66
|
-
ADDITIONAL INFORMATION
|
|
67
|
-
---------------------
|
|
68
|
-
[Any additional information relevant to the breach]
|
|
69
|
-
|
|
70
|
-
This notification is made in compliance with the Nigeria Data Protection Act (NDPA), Section 40.
|
|
71
|
-
`,Z=p=>{p.preventDefault();let S={id:`notification_${Date.now()}`,breachId:g.id,sentAt:Date.now(),method:E,referenceNumber:M||void 0,ndpcContact:C?{name:C,email:B,phone:P||void 0}:void 0,content:v,attachments:[]};V(S),x(true);},O=()=>{let p=document.createElement("a"),S=new Blob([v],{type:"text/plain"});p.href=URL.createObjectURL(S),p.download=`NDPC_Breach_Notification_${new Date().toISOString().split("T")[0]}.txt`,document.body.appendChild(p),p.click(),document.body.removeChild(p);},Q=()=>[{value:"email",label:"Email"},{value:"portal",label:"NDPC Portal"},{value:"letter",label:"Formal Letter"},{value:"other",label:"Other"}].map(S=>jsxRuntime.jsx("option",{value:S.value,children:S.label},S.value));return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${_}`,d.root,l),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",d.header,l),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",d.title,l),children:Y}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:J})]}),f?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-green-50 dark:bg-green-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Generated Successfully"}),jsxRuntime.jsx("p",{className:"text-green-700 dark:text-green-300",children:"Your NDPC notification report has been generated and is ready for submission. Please review the report carefully before submitting it to the NDPC."})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Submission Details"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Method:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:E.charAt(0).toUpperCase()+E.slice(1)})]}),C&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Contact Name:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:C})]}),B&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Contact Email:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:B})]}),P&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Contact Phone:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:P})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Date Generated:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:b(Date.now())})]}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Breach ID:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:g.id})]}),M&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Reference Number:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:M})]})]})]})]}),R&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Preview"}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("bg-gray-50 dark:bg-gray-700 p-4 rounded-md",d.reportPreview,l),children:jsxRuntime.jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:v})})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-3",children:[te&&jsxRuntime.jsxs("button",{onClick:O,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${h}`,d.secondaryButton||d.downloadButton,l),children:["Download Report (",$.toUpperCase(),")"]}),jsxRuntime.jsx("button",{onClick:()=>x(false),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${h}`,children:"Edit Report"})]})]}):jsxRuntime.jsx("form",{onSubmit:Z,children:jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Notification Method"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"method",className:"block text-sm font-medium mb-1",children:["Method of Submission ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("select",{id:"method",value:E,onChange:p=>H(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,children:Q()})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"referenceNumber",className:"block text-sm font-medium mb-1",children:"Reference Number (if available)"}),jsxRuntime.jsx("input",{type:"text",id:"referenceNumber",value:M,onChange:p=>K(p.target.value),placeholder:"e.g. NDPC/BR/2024/001",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"NDPC Contact (if known)"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactName",className:"block text-sm font-medium mb-1",children:"Contact Name"}),jsxRuntime.jsx("input",{type:"text",id:"contactName",value:C,onChange:p=>j(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactEmail",className:"block text-sm font-medium mb-1",children:"Contact Email"}),jsxRuntime.jsx("input",{type:"email",id:"contactEmail",value:B,onChange:p=>q(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactPhone",className:"block text-sm font-medium mb-1",children:"Contact Phone"}),jsxRuntime.jsx("input",{type:"tel",id:"contactPhone",value:P,onChange:p=>U(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"additionalInfo",className:"block text-sm font-medium mb-1",children:"Additional Information to Include"}),jsxRuntime.jsx("textarea",{id:"additionalInfo",value:ae,onChange:p=>W(p.target.value),rows:3,placeholder:"Any additional information you want to include in the report",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),L&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Content"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reportContent",className:"block text-sm font-medium mb-1",children:["Edit Report Content ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"reportContent",value:v,onChange:p=>D(p.target.value),rows:20,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] font-mono text-sm",required:true})]})]}),jsxRuntime.jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This report will help you comply with this requirement."})]}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{type:"submit",className:chunkE64TU6IU_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${h}`,d.primaryButton||d.generateButton,l),children:ee})})]})})]})};exports.a=ve;exports.b=Ce;exports.c=Te;//# sourceMappingURL=chunk-U6VWHC46.js.map
|
|
72
|
-
//# sourceMappingURL=chunk-U6VWHC46.js.map
|
package/dist/chunk-UK656RCG.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';function r(t){return {load(){if(typeof window=="undefined")return null;try{let e=localStorage.getItem(t);return e?JSON.parse(e):null}catch(e){return null}},save(e){typeof window!="undefined"&&localStorage.setItem(t,JSON.stringify(e));},remove(){typeof window!="undefined"&&localStorage.removeItem(t);}}}exports.a=r;//# sourceMappingURL=chunk-UK656RCG.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-UK656RCG.js.map
|
package/dist/chunk-UOSEH6DC.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),reactDom=require('react-dom'),jsxRuntime=require('react/jsx-runtime');var lt=({options:d,onSave:J,title:M="We Value Your Privacy",description:W="We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",acceptAllButtonText:Y="Accept All",rejectAllButtonText:K="Reject All",customizeButtonText:Q="Customize",saveButtonText:U="Save Preferences",position:A="bottom",zIndex:T=9999,version:f="1.0",show:p,manageStorage:R=true,storageKey:E="ndpr_consent",className:X="",buttonClassName:y="",primaryButtonClassName:q="",secondaryButtonClassName:Z="",classNames:t,unstyled:o,onAnalytics:h})=>{let[g,u]=react.useState(false),[v,a]=react.useState(false),[C,B]=react.useState({}),z=react.useRef(null),$=react.useRef(null),j=react.useRef(false),b=react.useCallback((e,n)=>{h==null||h(chunkMQFZHA2D_js.a({action:e,timestamp:Date.now(),version:f},n!==void 0?{categories:n}:{}));},[h,f]);react.useEffect(()=>{let e={};if(d.forEach(n=>{e[n.id]=n.defaultValue||false;}),B(e),p===void 0)if(!R)u(true);else {let n=localStorage.getItem(E);if(n)try{JSON.parse(n).version!==f?u(!0):u(!1);}catch(D){u(true);}else u(true);}else u(p);},[d,E,f,R]),react.useEffect(()=>{p!==void 0&&u(p);},[p]);let s=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),b("accepted_all",e),P(e);},N=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),b("rejected_all",e),P(e);},tt=(e,n)=>{B(D=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},D),{[e]:n}));},et=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),B(e);},nt=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),B(e);},H=d.length>0&&d.every(e=>C[e.id]),rt=()=>{b("customized",C),P(C);},P=e=>{let n={consents:e,timestamp:Date.now(),version:f,method:v?"customize":"banner",hasInteracted:true};R&&localStorage.setItem(E,JSON.stringify(n)),J(n),u(false),a(false);},_=react.useCallback(()=>{b("dismissed"),u(false),a(false);},[b]);if(react.useEffect(()=>{if(!g)return;let e=n=>{n.key==="Escape"&&_();};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[g,_]),react.useEffect(()=>{g&&!j.current&&(j.current=true,b("shown")),g||(j.current=false);},[g,b]),react.useEffect(()=>{g&&z.current&&z.current.focus();},[g]),react.useEffect(()=>{if(v&&$.current){let e=$.current;e.style.maxHeight="0px",e.style.opacity="0",e.offsetHeight,e.style.maxHeight=`${e.scrollHeight}px`,e.style.opacity="1";}},[v]),!g)return null;let ot=(t==null?void 0:t.primaryButton)||(t==null?void 0:t.acceptButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${y} ${q}`,m=(t==null?void 0:t.secondaryButton)||(t==null?void 0:t.rejectButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${y} ${Z}`,it=(t==null?void 0:t.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${y}`,dt=(t==null?void 0:t.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${y} ${q}`,k=A==="inline",w=A==="center",x;k||w?x="":A==="top"?x="fixed inset-x-0 top-0":x="fixed inset-x-0 bottom-0";let S=jsxRuntime.jsx("div",{ref:z,tabIndex:-1,"data-ndpr-component":"consent-banner",className:chunkE64TU6IU_js.a(`${k?"":x} bg-white dark:bg-gray-800 shadow-lg p-3 sm:p-4 border border-gray-200 dark:border-gray-700 ${w?"max-w-lg w-full":""} ${X}`,t==null?void 0:t.root,o),style:!k&&!w?{zIndex:T}:void 0,role:"dialog","aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("max-w-6xl mx-auto",t==null?void 0:t.container,o),children:[jsxRuntime.jsx("h2",{id:"consent-banner-title",className:chunkE64TU6IU_js.a("text-lg font-bold mb-2",t==null?void 0:t.title,o),children:M}),jsxRuntime.jsx("p",{id:"consent-banner-description",className:chunkE64TU6IU_js.a("text-sm sm:text-base mb-4",t==null?void 0:t.description,o),children:W}),v&&jsxRuntime.jsxs("div",{ref:$,className:chunkE64TU6IU_js.a("mb-4 p-3 sm:p-4 rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50",t==null?void 0:t.customizePanel,o),style:{overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out"},children:[jsxRuntime.jsx("div",{className:"mb-3 flex items-center justify-end",children:jsxRuntime.jsx("button",{type:"button",onClick:H?nt:et,className:chunkE64TU6IU_js.a("text-sm font-medium text-[rgb(var(--ndpr-primary))] hover:underline",t==null?void 0:t.selectAllButton,o),children:H?"Deselect All":"Select All"})}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-3",t==null?void 0:t.optionsList,o),children:d.map(e=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start",t==null?void 0:t.optionItem,o),children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:`consent-${e.id}`,type:"checkbox",checked:C[e.id]||false,onChange:n=>tt(e.id,n.target.checked),disabled:e.required,className:chunkE64TU6IU_js.a("h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",t==null?void 0:t.optionCheckbox,o)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:`consent-${e.id}`,className:chunkE64TU6IU_js.a("font-medium",t==null?void 0:t.optionLabel,o),children:[e.label," ",e.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-400",t==null?void 0:t.optionDescription,o),children:e.description})]})]},e.id))}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-4 flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:rt,className:chunkE64TU6IU_js.a(dt,t==null?void 0:t.saveButton,o),children:U}),jsxRuntime.jsx("button",{onClick:()=>a(false),className:chunkE64TU6IU_js.a(m,t==null?void 0:t.rejectButton,o),children:"Back"})]})]}),!v&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:s,className:chunkE64TU6IU_js.a(ot,t==null?void 0:t.acceptButton,o),children:Y}),jsxRuntime.jsx("button",{onClick:N,className:chunkE64TU6IU_js.a(m,t==null?void 0:t.rejectButton,o),children:K}),jsxRuntime.jsx("button",{onClick:()=>a(true),className:chunkE64TU6IU_js.a(it,t==null?void 0:t.customizeButton,o),children:Q})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("mt-2 text-xs text-gray-600 dark:text-gray-400",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(k)return S;if(w){let e=jsxRuntime.jsxs("div",{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:T},children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"relative",children:S})]});return typeof document!="undefined"?reactDom.createPortal(e,document.body):e}return typeof document!="undefined"?reactDom.createPortal(S,document.body):S};exports.a=lt;//# sourceMappingURL=chunk-UOSEH6DC.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-UOSEH6DC.js.map
|
package/dist/chunk-VDZKGCAF.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var p=["critical","high","medium","low"];function m(e){let i=new Date(e).getTime();return (Date.now()-i)/(1e3*60*60*24*30.44)}function u(e){if(e.length===0)return 100;let i=e.filter(t=>t.pass).length;return Math.round(i/e.length*100)}function f(e){return [{key:"hasConsentMechanism",label:"Consent collection mechanism",priority:"critical",effort:"high",recommendation:"Implement a clear, affirmative consent collection mechanism before processing personal data.",ndpaSection:"Section 25",pass:e.hasConsentMechanism},{key:"hasPurposeSpecification",label:"Purpose specification at collection",priority:"critical",effort:"medium",recommendation:"Specify and communicate the purpose of data collection at the point of consent.",ndpaSection:"Section 25",pass:e.hasPurposeSpecification},{key:"hasWithdrawalMechanism",label:"Consent withdrawal mechanism",priority:"high",effort:"medium",recommendation:"Provide a simple mechanism for data subjects to withdraw consent at any time.",ndpaSection:"Section 26",pass:e.hasWithdrawalMechanism},{key:"hasMinorProtection",label:"Minor (child) data protection controls",priority:"high",effort:"high",recommendation:"Implement age-verification and parental-consent controls for processing data of minors.",ndpaSection:"Section 26",pass:e.hasMinorProtection},{key:"consentRecordsRetained",label:"Consent records retained",priority:"medium",effort:"low",recommendation:"Retain records of all consents obtained, including what was agreed to and when.",ndpaSection:"Section 25",pass:e.consentRecordsRetained}]}function g(e){let i=e.responseTimelineDays<=30;return [{key:"hasRequestMechanism",label:"DSR submission mechanism",priority:"critical",effort:"high",recommendation:"Implement a formal channel (e.g. a web form or email address) for data subjects to submit requests.",ndpaSection:"Section 34",pass:e.hasRequestMechanism},{key:"supportsAccess",label:"Right of access supported",priority:"high",effort:"medium",recommendation:"Enable data subjects to request and receive a copy of their personal data.",ndpaSection:"Section 34",pass:e.supportsAccess},{key:"supportsRectification",label:"Right to rectification supported",priority:"high",effort:"medium",recommendation:"Allow data subjects to request correction of inaccurate or incomplete personal data.",ndpaSection:"Section 35",pass:e.supportsRectification},{key:"supportsErasure",label:"Right to erasure supported",priority:"high",effort:"high",recommendation:"Implement processes to delete personal data upon valid erasure requests.",ndpaSection:"Section 36",pass:e.supportsErasure},{key:"supportsPortability",label:"Right to data portability supported",priority:"medium",effort:"high",recommendation:"Provide personal data in a structured, machine-readable format upon request.",ndpaSection:"Section 37",pass:e.supportsPortability},{key:"supportsObjection",label:"Right to object supported",priority:"medium",effort:"medium",recommendation:"Honour objections to processing where no compelling legitimate grounds override the data subject's interests.",ndpaSection:"Section 38",pass:e.supportsObjection},{key:"responseTimeline",label:"DSR response within 30 days",priority:"high",effort:"medium",recommendation:"Reduce DSR response time to 30 days or less as required by the NDPA.",ndpaSection:"Section 39",pass:i}]}function y(e){return [{key:"conductedForHighRisk",label:"DPIA conducted for high-risk processing",priority:"critical",effort:"high",recommendation:"Conduct a Data Protection Impact Assessment before undertaking high-risk processing activities.",ndpaSection:"Section 28",pass:e.conductedForHighRisk},{key:"documentedRisks",label:"Risks documented in DPIA",priority:"high",effort:"medium",recommendation:"Document identified risks to data subjects' rights and freedoms within the DPIA.",ndpaSection:"Section 28",pass:e.documentedRisks},{key:"mitigationMeasures",label:"Mitigation measures documented",priority:"high",effort:"medium",recommendation:"Document mitigation measures and residual risk acceptance within the DPIA.",ndpaSection:"Section 28",pass:e.mitigationMeasures}]}function b(e){return [{key:"hasNotificationProcess",label:"Breach notification process in place",priority:"critical",effort:"high",recommendation:"Establish a documented breach notification process covering detection, assessment, and reporting.",ndpaSection:"Section 40",pass:e.hasNotificationProcess},{key:"notifiesWithin72Hours",label:"NDPC notified within 72 hours",priority:"critical",effort:"medium",recommendation:"Ensure the NDPC is notified of qualifying breaches within 72 hours of discovery.",ndpaSection:"Section 40",pass:e.notifiesWithin72Hours},{key:"hasRiskAssessment",label:"Breach risk assessment performed",priority:"high",effort:"medium",recommendation:"Perform a risk assessment for every identified breach to determine notification obligations.",ndpaSection:"Section 40",pass:e.hasRiskAssessment},{key:"hasRecordKeeping",label:"Breach records maintained",priority:"medium",effort:"low",recommendation:"Maintain a breach register documenting all incidents, assessments, and actions taken.",ndpaSection:"Section 40",pass:e.hasRecordKeeping}]}function S(e){let t=m(e.lastUpdated)<=13;return [{key:"hasPrivacyPolicy",label:"Privacy policy exists",priority:"critical",effort:"high",recommendation:"Draft and publish a comprehensive privacy policy that satisfies NDPA requirements.",ndpaSection:"Section 29",pass:e.hasPrivacyPolicy},{key:"isPubliclyAccessible",label:"Privacy policy publicly accessible",priority:"high",effort:"low",recommendation:"Make the privacy policy easily accessible to data subjects on your website or app.",ndpaSection:"Section 29",pass:e.isPubliclyAccessible},{key:"policyUpToDate",label:"Privacy policy reviewed within 13 months",priority:"medium",effort:"medium",recommendation:"Review and update the privacy policy at least annually to reflect current practices.",ndpaSection:"Section 29",pass:t},{key:"coversAllSections",label:"Privacy policy covers all required sections",priority:"high",effort:"medium",recommendation:"Ensure the privacy policy addresses all NDPA-mandated disclosures including lawful basis, retention, and subject rights.",ndpaSection:"Section 29",pass:e.coversAllSections}]}function R(e){return [{key:"documentedForAllProcessing",label:"Lawful basis documented for all processing",priority:"critical",effort:"high",recommendation:"Identify and document a valid lawful basis for every processing activity before it begins.",ndpaSection:"Section 25(1)",pass:e.documentedForAllProcessing},{key:"hasLegitimateInterestAssessment",label:"Legitimate interest assessment completed",priority:"medium",effort:"medium",recommendation:"Complete a Legitimate Interest Assessment (LIA) where legitimate interests is the chosen lawful basis.",ndpaSection:"Section 25(1)",pass:e.hasLegitimateInterestAssessment}]}function v(e){return [{key:"hasTransferMechanisms",label:"Transfer mechanisms in place",priority:"critical",effort:"high",recommendation:"Implement appropriate transfer mechanisms (SCCs, BCRs, or adequacy decisions) for all cross-border transfers.",ndpaSection:"Section 43",pass:e.hasTransferMechanisms},{key:"adequacyAssessed",label:"Adequacy of destination country assessed",priority:"high",effort:"medium",recommendation:"Assess whether the destination country provides an adequate level of data protection before transferring.",ndpaSection:"Section 43",pass:e.adequacyAssessed},{key:"ndpcApprovalObtained",label:"NDPC approval obtained where required",priority:"high",effort:"high",recommendation:"Obtain NDPC approval for transfers to countries without adequacy decisions where required.",ndpaSection:"Section 44",pass:e.ndpcApprovalObtained}]}function w(e){let t=m(e.lastReviewed)<=6;return [{key:"maintained",label:"Record of Processing Activities maintained",priority:"critical",effort:"high",recommendation:"Create and maintain a comprehensive Record of Processing Activities (ROPA) as required by the NDPA.",ndpaSection:"Section 30",pass:e.maintained},{key:"includesAllProcessing",label:"ROPA includes all processing activities",priority:"high",effort:"medium",recommendation:"Ensure the ROPA captures every processing activity across all departments and systems.",ndpaSection:"Section 30",pass:e.includesAllProcessing},{key:"ropaUpToDate",label:"ROPA reviewed within 6 months",priority:"medium",effort:"low",recommendation:"Review and update the ROPA at least every six months to reflect changes in processing activities.",ndpaSection:"Section 30",pass:t}]}var k=[{name:"consent",weight:.2,ndpaSections:["Section 25","Section 26"],evaluate:e=>f(e.consent)},{name:"dsr",weight:.15,ndpaSections:["Section 34","Section 35","Section 36","Section 37","Section 38","Section 39"],evaluate:e=>g(e.dsr)},{name:"breach",weight:.15,ndpaSections:["Section 40"],evaluate:e=>b(e.breach)},{name:"policy",weight:.12,ndpaSections:["Section 29"],evaluate:e=>S(e.policy)},{name:"dpia",weight:.12,ndpaSections:["Section 28"],evaluate:e=>y(e.dpia)},{name:"lawfulBasis",weight:.1,ndpaSections:["Section 25(1)"],evaluate:e=>R(e.lawfulBasis)},{name:"crossBorder",weight:.08,ndpaSections:["Section 43","Section 44"],evaluate:e=>v(e.crossBorder)},{name:"ropa",weight:.08,ndpaSections:["Section 30"],evaluate:e=>w(e.ropa)}];function P(e){return e>=90?"excellent":e>=70?"good":e>=40?"needs-work":"critical"}function A(e){let i={},t=[],s=0;for(let o of k){let a=o.evaluate(e),c=u(a),l=c*o.weight;s+=l;let d=[];for(let n of a)n.pass||(d.push(n.label),t.push({module:o.name,key:n.key,label:n.label,priority:n.priority,effort:n.effort,recommendation:n.recommendation,ndpaSection:n.ndpaSection}));i[o.name]={name:o.name,score:c,maxScore:100,weightedScore:Math.round(l*100)/100,ndpaSections:o.ndpaSections,gaps:d};}t.sort((o,a)=>p.indexOf(o.priority)-p.indexOf(a.priority));let r=Math.round(s),h=[{section:"Section 25",title:"Consent and lawful basis for processing"},{section:"Section 26",title:"Withdrawal of consent and minor protection"},{section:"Section 28",title:"Data Protection Impact Assessment"},{section:"Section 29",title:"Privacy notice requirements"},{section:"Section 30",title:"Records of processing activities"},{section:"Section 34",title:"Right of access"},{section:"Section 35",title:"Right to rectification"},{section:"Section 36",title:"Right to erasure"},{section:"Section 37",title:"Right to data portability"},{section:"Section 38",title:"Right to object"},{section:"Section 39",title:"Response timelines for data subject requests"},{section:"Section 40",title:"Data breach notification"},{section:"Section 43",title:"Cross-border transfer restrictions"},{section:"Section 44",title:"NDPC approval for cross-border transfers"}];return {score:r,rating:P(r),modules:i,recommendations:t,regulatoryReferences:h,generatedAt:new Date().toISOString()}}exports.a=A;//# sourceMappingURL=chunk-VDZKGCAF.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-VDZKGCAF.js.map
|
package/dist/chunk-WSHSHIIM.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {c}from'./chunk-WWT2ZSNU.mjs';import {createContext,useMemo,useContext}from'react';import {jsx}from'react/jsx-runtime';var m=createContext({}),g=u=>{var i=u,{children:t}=i,e=c(i,["children"]);let n=useMemo(()=>{if(!e.theme)return;let r={};return e.theme.primary&&(r["--ndpr-primary"]=e.theme.primary),e.theme.primaryHover&&(r["--ndpr-primary-hover"]=e.theme.primaryHover),e.theme.primaryForeground&&(r["--ndpr-primary-foreground"]=e.theme.primaryForeground),Object.keys(r).length>0?r:void 0},[e.theme]);return jsx(m.Provider,{value:e,children:n?jsx("div",{style:n,children:t}):t})};function P(){return useContext(m)}export{g as a,P as b};//# sourceMappingURL=chunk-WSHSHIIM.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-WSHSHIIM.mjs.map
|
package/dist/chunk-XSK4BSZJ.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-2SYNHRP6.mjs';import {a as a$2}from'./chunk-SBNAMPAP.mjs';import {b,a as a$1,c}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function _(c,a){return a?a$2(c):{load:()=>null,save:()=>{},remove:()=>{}}}function Q({initialRequests:c$1=[],requestTypes:a$2,adapter:S,storageKey:h="ndpr_dsr_requests",useLocalStorage:P=true,onSubmit:D,onUpdate:f}){let m=S!=null?S:_(h,P),i=useRef(m);i.current=m;let[q,r]=useState(c$1),[x,d]=useState(true);useEffect(()=>{let e=false;try{let t=i.current.load();t instanceof Promise?t.then(s=>{e||(s&&r(s),d(!1));},()=>{e||d(!1);}):(t&&r(t),d(!1));}catch(t){e||d(false);}return ()=>{e=true;}},[]);let g=useCallback(e=>{Promise.resolve(i.current.save(e)).catch(t=>{console.warn("[ndpr-toolkit] Failed to save DSR requests:",t);});},[]),I=()=>"dsr_"+Date.now()+"_"+Math.random().toString(36).substr(2,9);return {requests:q,submitRequest:e=>{let t=a$2.find(p=>p.id===e.type),s=(t==null?void 0:t.estimatedCompletionTime)||30,u=Date.now(),n=u+s*24*60*60*1e3,A=e,{createdAt:y}=A,o=c(A,["createdAt"]),R=a$1({id:I(),status:"pending",createdAt:u,updatedAt:u,dueDate:n},o);return r(p=>{let b=[...p,R];return g(b),b}),D&&D(R),R},updateRequest:(e,t)=>{let s=null;return r(u=>{let n=u.findIndex(R=>R.id===e);if(n===-1)return u;let y=u[n];s=b(a$1(a$1({},y),t),{updatedAt:Date.now()});let o=[...u];return o[n]=s,g(o),o}),s&&f&&f(s),s},getRequest:e=>q.find(t=>t.id===e)||null,getRequestsByStatus:e=>q.filter(t=>t.status===e),getRequestsByType:e=>q.filter(t=>t.type===e),getRequestType:e=>a$2.find(t=>t.id===e),formatRequest:e=>{let{formattedRequest:t}=a(e);return t},clearRequests:()=>{r([]),Promise.resolve(i.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove DSR requests:",e);});},isLoading:x}}export{Q as a};//# sourceMappingURL=chunk-XSK4BSZJ.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-XSK4BSZJ.mjs.map
|
package/dist/chunk-Y34DQYS7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';function s(e){let n=[];(!e.consents||Object.keys(e.consents).length===0)&&n.push("Consent settings must include at least one consent option"),e.timestamp?(typeof e.timestamp!="number"||isNaN(e.timestamp))&&n.push("Consent timestamp must be a valid number"):n.push("Consent timestamp is required"),e.version||n.push("Consent version is required"),e.method||n.push("Consent collection method is required"),e.hasInteracted===void 0&&n.push("User interaction status is required");let t=Date.now()-390*24*60*60*1e3;return e.timestamp<t&&n.push("Consent is older than 13 months and should be refreshed"),{valid:n.length===0,errors:n}}function r(e){let n=[];return (!e||e.length===0)&&n.push("At least one consent option is required"),e==null||e.forEach(t=>{(!t.purpose||t.purpose.trim()==="")&&n.push(`Consent option "${t.id}" is missing a purpose. NDPA Section 26 requires consent to be specific to a stated purpose.`);}),{valid:n.length===0,errors:n}}exports.a=s;exports.b=r;//# sourceMappingURL=chunk-Y34DQYS7.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-Y34DQYS7.js.map
|
package/dist/chunk-YJCGEOLO.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function p(t){return {load(){if(typeof window=="undefined")return null;try{let n=sessionStorage.getItem(t);return n?JSON.parse(n):null}catch(n){return null}},save(n){typeof window!="undefined"&&sessionStorage.setItem(t,JSON.stringify(n));},remove(){typeof window!="undefined"&&sessionStorage.removeItem(t);}}}function f(t,n={}){let{domain:r,path:a="/",expires:s=365,secure:d=true,sameSite:u="Lax"}=n;return {load(){if(typeof document=="undefined")return null;try{let e=document.cookie.split(";").map(o=>o.trim()).find(o=>o.startsWith(`${t}=`));return e?JSON.parse(decodeURIComponent(e.split("=")[1])):null}catch(e){return null}},save(e){if(typeof document=="undefined")return;let o=new Date;o.setDate(o.getDate()+s);let i=`${t}=${encodeURIComponent(JSON.stringify(e))}; path=${a}; expires=${o.toUTCString()}; samesite=${u}`;r&&(i+=`; domain=${r}`),d&&(i+="; secure"),document.cookie=i;},remove(){if(typeof document=="undefined")return;let e=`${t}=; path=${a}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;r&&(e+=`; domain=${r}`),document.cookie=e;}}}export{p as a,f as b};//# sourceMappingURL=chunk-YJCGEOLO.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-YJCGEOLO.mjs.map
|
package/dist/chunk-ZCZ5RRZO.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkSSGJREE3_js=require('./chunk-SSGJREE3.js'),chunkUK656RCG_js=require('./chunk-UK656RCG.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function H(a,A){return A?chunkUK656RCG_js.a(a):{load:()=>null,save:()=>{},remove:()=>{}}}function Y({sections:a,initialAnswers:A={},adapter:h,storageKey:E="ndpr_dpia_data",useLocalStorage:T=true,onComplete:I}){let w=h!=null?h:H(E,T),d=react.useRef(w);d.current=w;let[f,g]=react.useState(0),[o,p]=react.useState(A),[C,m]=react.useState(true);react.useEffect(()=>{let r=false;try{let s=d.current.load();s instanceof Promise?s.then(e=>{r||(e&&p(e),m(!1));},()=>{r||m(!1);}):(s&&p(s),m(!1));}catch(s){r||m(false);}return ()=>{r=true;}},[]);let c=a[f]||null,W=r=>{Promise.resolve(d.current.save(r)).catch(s=>{console.warn("[ndpr-toolkit] Failed to save DPIA answers:",s);});},_=(r,s)=>{p(e=>{let t=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{[r]:s});return W(t),t});},b=r=>r.showWhen?r.showWhen.every(s=>{let e=o[s.questionId];switch(s.operator){case "equals":return e===s.value;case "contains":return Array.isArray(e)?e.includes(s.value):false;case "greaterThan":return typeof e=="number"?e>s.value:false;case "lessThan":return typeof e=="number"?e<s.value:false;default:return true}}):true,v=()=>c?c.questions.filter(b):[],P=()=>c?v().every(s=>{if(!s.required)return true;let e=o[s.id];return !(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0)}):false,$=()=>{let r={};return c&&v().forEach(e=>{if(!e.required)return;let t=o[e.id];t==null||typeof t=="string"&&t.trim()===""?r[e.id]="This question is required":Array.isArray(t)&&t.length===0&&(r[e.id]="At least one option must be selected");}),r},O=()=>P()&&f<a.length-1?(g(r=>r+1),true):false,U=()=>f>0?(g(r=>r-1),true):false,V=r=>r>=0&&r<a.length?(g(r),true):false,B=()=>a.every(r=>r.questions.filter(e=>!e.showWhen||e.showWhen.length===0?true:e.showWhen.some(t=>{let n=o[t.questionId];switch(t.operator){case "equals":return n===t.value;case "contains":return Array.isArray(n)&&n.includes(t.value);case "greaterThan":return typeof n=="number"&&n>t.value;case "lessThan":return typeof n=="number"&&n<t.value;default:return false}})).every(e=>{if(!e.required)return true;let t=o[e.id];return !(t==null||typeof t=="string"&&t.trim()===""||Array.isArray(t)&&t.length===0)})),F=()=>{let r=[];return a.forEach(s=>{s.questions.forEach(e=>{let t=o[e.id];if(t!=null&&e.riskLevel)if(["select","radio","checkbox"].includes(e.type)&&e.options)(Array.isArray(t)?t:[t]).forEach(i=>{var D;let l=(D=e.options)==null?void 0:D.find(u=>u.value===i);if(l!=null&&l.riskLevel){let u=l.riskLevel,R=u==="low"?1:u==="medium"?3:5,S=u==="low"?1:u==="medium"?3:5;r.push({id:`risk_${r.length+1}`,description:`${e.text} - ${l.label}`,likelihood:R,impact:S,score:R*S,level:u,mitigated:false,relatedQuestionIds:[e.id]});}});else {let n=e.riskLevel,i=n==="low"?1:n==="medium"?3:5,l=n==="low"?1:n==="medium"?3:5;r.push({id:`risk_${r.length+1}`,description:e.text,likelihood:i,impact:l,score:i*l,level:n,mitigated:false,relatedQuestionIds:[e.id]});}});}),r},K=(r,s,e)=>{let t=F(),n={id:`dpia_${Date.now()}`,title:s,processingDescription:e,startedAt:Date.now(),completedAt:Date.now(),assessor:r,answers:o,risks:t,overallRiskLevel:"low",canProceed:true,conclusion:"",version:"1.0"},i=chunkSSGJREE3_js.a(n);return n.overallRiskLevel=i.overallRiskLevel,n.canProceed=i.canProceed,n.conclusion=i.canProceed?"Based on the assessment, the processing can proceed with appropriate safeguards.":"Based on the assessment, the processing should not proceed without further mitigation measures.",n.recommendations=i.recommendations,I&&I(n),n},M=()=>{p({}),g(0),Promise.resolve(d.current.remove()).catch(r=>{console.warn("[ndpr-toolkit] Failed to remove DPIA data:",r);});},j=(()=>{let r=0,s=0;return a.forEach(e=>{e.questions.forEach(t=>{if(t.required&&b(t)){s++;let n=o[t.id];n!=null&&!(typeof n=="string"&&n.trim()==="")&&!(Array.isArray(n)&&n.length===0)&&r++;}});}),s>0?Math.round(r/s*100):0})();return {currentSectionIndex:f,currentSection:c,answers:o,updateAnswer:_,nextSection:O,prevSection:U,goToSection:V,isCurrentSectionValid:P,getCurrentSectionErrors:$,isComplete:B,completeDPIA:K,getVisibleQuestions:v,resetDPIA:M,progress:j,isLoading:C}}exports.a=Y;//# sourceMappingURL=chunk-ZCZ5RRZO.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-ZCZ5RRZO.js.map
|