@tantainnovative/ndpr-toolkit 3.5.1 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +125 -0
- package/README.md +29 -8
- package/dist/adapters.d.mts +137 -3
- package/dist/adapters.d.ts +137 -3
- package/dist/adapters.js +1 -2
- package/dist/adapters.mjs +1 -2
- package/dist/breach.d.mts +80 -1
- package/dist/breach.d.ts +80 -1
- package/dist/breach.js +1 -2
- package/dist/breach.mjs +1 -2
- package/dist/{chunk-PATONNTZ.mjs → chunk-3HOXQNCH.mjs} +1 -2
- package/dist/{chunk-MJGOLP5M.js → chunk-3IA3KDII.js} +1 -2
- package/dist/{chunk-M2TPT5GB.js → chunk-3JPDTXGC.js} +1 -2
- package/dist/{chunk-BKRETVJ6.js → chunk-3YTAOT5O.js} +1 -2
- package/dist/{chunk-GOU6FU6Y.js → chunk-4CVBQC66.js} +1 -2
- package/dist/{chunk-E4NCJ7RD.mjs → chunk-4G3SRVRI.mjs} +1 -2
- package/dist/{chunk-6QPRDQZF.js → chunk-4QXTB3L6.js} +1 -2
- package/dist/{chunk-XNSZ7KUH.js → chunk-5GVMKUMP.js} +1 -2
- package/dist/chunk-66NQ5CVY.mjs +1 -0
- package/dist/chunk-732C2EVN.js +1 -0
- package/dist/chunk-7BJXI2HI.mjs +1 -0
- package/dist/{chunk-C5QO3SX4.js → chunk-7IFSWCQP.js} +1 -2
- package/dist/{chunk-A4PK7JB2.js → chunk-7ZZO7GVB.js} +1 -2
- package/dist/chunk-AME4HJR4.js +1 -0
- package/dist/chunk-AOHKVFAS.mjs +322 -0
- package/dist/{chunk-HO5M7M4M.js → chunk-B46SJB5V.js} +1 -2
- package/dist/chunk-BFAX7JQA.mjs +1 -0
- package/dist/{chunk-ID2NYIVE.mjs → chunk-BNHQFZHL.mjs} +2 -3
- package/dist/{chunk-RLYTX3MM.js → chunk-BRS52EDT.js} +1 -2
- package/dist/{chunk-OPYQIJKY.js → chunk-C7IDR2IV.js} +1 -2
- package/dist/{chunk-CISJAQ6W.mjs → chunk-COD3RMTL.mjs} +1 -2
- package/dist/chunk-CR2QZTGW.js +1 -0
- package/dist/{chunk-6WIP33TW.mjs → chunk-DBZSN4WP.mjs} +1 -2
- package/dist/{chunk-74Z23WUA.mjs → chunk-EEQALYOY.mjs} +1 -2
- package/dist/chunk-EFIBHKQE.mjs +1 -0
- package/dist/{chunk-GKKAK6ES.mjs → chunk-EWVK45Z3.mjs} +1 -2
- package/dist/{chunk-QSVVAZVT.mjs → chunk-EXEXUAF6.mjs} +1 -2
- package/dist/chunk-EZCGTHQV.js +6 -0
- package/dist/{chunk-SYMQJO2W.mjs → chunk-GTYXVAJX.mjs} +2 -3
- package/dist/{chunk-6FGCGLH5.mjs → chunk-H3XJV2IR.mjs} +1 -2
- package/dist/chunk-HBLGN4SD.js +1 -0
- package/dist/{chunk-MCWV7S2G.js → chunk-HHK5LHEG.js} +1 -2
- package/dist/{chunk-XHROISIF.mjs → chunk-HWHBINVN.mjs} +1 -2
- package/dist/{chunk-3EGQWLJ6.js → chunk-I2LMQWK3.js} +2 -3
- package/dist/{chunk-NQNFS3QI.js → chunk-I3Y4LOSL.js} +4 -5
- package/dist/chunk-ITCY2Z66.mjs +4 -0
- package/dist/{chunk-Z6IIMLZU.mjs → chunk-KDAZQO3N.mjs} +1 -2
- package/dist/{chunk-J5WCPZLW.js → chunk-L2BRFMVS.js} +1 -2
- package/dist/chunk-L2VO3MEJ.js +1 -0
- package/dist/{chunk-R5FW5XUQ.mjs → chunk-LQTARVPU.mjs} +1 -2
- package/dist/{chunk-6TA2MVTU.mjs → chunk-LRRENTT5.mjs} +1 -2
- package/dist/chunk-LTPSN2SU.mjs +1 -0
- package/dist/{chunk-LIM64IV2.js → chunk-LVGT3DLT.js} +2 -3
- package/dist/{chunk-TXBZPCGF.mjs → chunk-LWIKDDSU.mjs} +1 -2
- package/dist/chunk-MPBPAEZC.mjs +1 -0
- package/dist/{chunk-Z73T6MWY.js → chunk-N3MQQUQP.js} +39 -35
- package/dist/{chunk-HGGLW5TE.js → chunk-NUWVPRNI.js} +1 -2
- package/dist/chunk-O45PKBZA.mjs +6 -0
- package/dist/chunk-O6CUBNXK.mjs +3 -0
- package/dist/{chunk-7SMLHZ4B.js → chunk-P4LNLCSF.js} +1 -2
- package/dist/{chunk-VWPGIES4.mjs → chunk-PCU6GKBE.mjs} +1 -2
- package/dist/chunk-PGI2LM6P.js +103 -0
- package/dist/{chunk-U62QYKVG.mjs → chunk-PJNKQPQP.mjs} +1 -2
- package/dist/chunk-PL4XNCQA.mjs +1 -0
- package/dist/{chunk-LSNL4XR5.js → chunk-PZRQWPWD.js} +1 -2
- package/dist/chunk-Q64735OC.js +144 -0
- package/dist/chunk-QPRYXVH2.js +1 -0
- package/dist/{chunk-MQFZHA2D.js → chunk-RFPLZDIO.js} +1 -2
- package/dist/chunk-RMQ7OLNY.mjs +144 -0
- package/dist/chunk-ROTLSZMV.js +1 -0
- package/dist/{chunk-2AW7KAZO.mjs → chunk-RPXRPGHL.mjs} +1 -2
- package/dist/chunk-RV2VMWZJ.mjs +1 -0
- package/dist/chunk-RXZFYBUJ.js +1 -0
- package/dist/chunk-RYREGZVQ.js +1 -0
- package/dist/{chunk-B4Z5MBUC.mjs → chunk-RZ6GC6WN.mjs} +1 -2
- package/dist/chunk-S6COXIZA.js +2 -0
- package/dist/chunk-SFGW37LE.mjs +1 -0
- package/dist/{chunk-3NQQSU4P.js → chunk-SJDDNB6M.js} +1 -2
- package/dist/chunk-SJRIOZ4K.mjs +1 -0
- package/dist/{chunk-H3EYBSVP.mjs → chunk-TMXK4QKK.mjs} +2 -3
- package/dist/{chunk-P42Z5CFE.js → chunk-TQZWJGJ2.js} +1 -2
- package/dist/{chunk-EPT2K355.mjs → chunk-U5RWJRGA.mjs} +1 -2
- package/dist/{chunk-R3OYAJI6.mjs → chunk-UASG46LP.mjs} +1 -2
- package/dist/{chunk-RXL6CZAI.js → chunk-UAV7V4EM.js} +1 -2
- package/dist/chunk-UI536RU2.js +3 -0
- package/dist/{chunk-7AVN424U.js → chunk-UTFBKL73.js} +1 -2
- package/dist/{chunk-I54CDQGN.js → chunk-UXUMYP4L.js} +1 -2
- package/dist/chunk-V3RYHNHN.js +1 -0
- package/dist/{chunk-P3PULLYP.mjs → chunk-V7UFP6QU.mjs} +1 -2
- package/dist/{chunk-I4M2AA3N.js → chunk-VJTQXVAF.js} +1 -2
- package/dist/{chunk-ELKB2AFZ.js → chunk-VWED6UTN.js} +1 -2
- package/dist/{chunk-LU7PKE7Y.mjs → chunk-VYAL2TGT.mjs} +1 -2
- package/dist/chunk-W47OSMT6.js +2 -0
- package/dist/chunk-W65ZWTLD.mjs +1 -0
- package/dist/chunk-W7RBGZCC.js +1 -0
- package/dist/{chunk-5HL4UBFV.js → chunk-WDDCKYWA.js} +1 -2
- package/dist/{chunk-DJGS7SSN.mjs → chunk-WTGKZX7J.mjs} +1 -2
- package/dist/{chunk-TDDAYVKK.js → chunk-WZYCBW2R.js} +1 -2
- package/dist/chunk-X3GCGC3H.mjs +103 -0
- package/dist/chunk-XJO4DH3L.mjs +2 -0
- package/dist/{chunk-LWXZMKC2.js → chunk-XO3VQYTL.js} +7 -8
- package/dist/{chunk-IZCWCE7W.mjs → chunk-XOH4WXOZ.mjs} +1 -2
- package/dist/{chunk-SHMJNRHO.mjs → chunk-XP5PL6K7.mjs} +1 -2
- package/dist/{chunk-CKGJK4D7.mjs → chunk-Y3MKMAFQ.mjs} +2 -3
- package/dist/chunk-YFBDJ4FH.js +1 -0
- package/dist/chunk-YTU4FNM2.mjs +1 -0
- package/dist/{chunk-TV4U6AIS.js → chunk-Z763UI5U.js} +1 -2
- package/dist/chunk-ZHFLBL63.mjs +2 -0
- package/dist/{chunk-RRVKUCFR.mjs → chunk-ZIZL37BG.mjs} +1 -2
- package/dist/{chunk-WWT2ZSNU.mjs → chunk-ZJYULEER.mjs} +1 -2
- package/dist/{chunk-LJNNPAFU.mjs → chunk-ZQZJNKVB.mjs} +1 -2
- package/dist/chunk-ZVOIR4QH.js +4 -0
- package/dist/consent.js +1 -2
- package/dist/consent.mjs +1 -2
- package/dist/core.d.mts +98 -19
- package/dist/core.d.ts +98 -19
- package/dist/core.js +1 -2
- package/dist/core.mjs +1 -2
- package/dist/cross-border.d.mts +36 -14
- package/dist/cross-border.d.ts +36 -14
- package/dist/cross-border.js +1 -2
- package/dist/cross-border.mjs +1 -2
- package/dist/dpia.d.mts +4 -4
- package/dist/dpia.d.ts +4 -4
- package/dist/dpia.js +1 -2
- package/dist/dpia.mjs +1 -2
- package/dist/dsr.d.mts +30 -17
- package/dist/dsr.d.ts +30 -17
- package/dist/dsr.js +1 -2
- package/dist/dsr.mjs +1 -2
- package/dist/hooks.d.mts +113 -20
- package/dist/hooks.d.ts +113 -20
- package/dist/hooks.js +1 -2
- package/dist/hooks.mjs +1 -2
- package/dist/index.d.mts +422 -26
- package/dist/index.d.ts +422 -26
- package/dist/index.js +1 -2
- package/dist/index.mjs +1 -2
- package/dist/lawful-basis.js +1 -2
- package/dist/lawful-basis.mjs +1 -2
- package/dist/policy.js +1 -2
- package/dist/policy.mjs +1 -2
- package/dist/presets-consent.d.mts +139 -0
- package/dist/presets-consent.d.ts +139 -0
- package/dist/presets-consent.js +2 -0
- package/dist/presets-consent.mjs +2 -0
- package/dist/presets-dsr.d.mts +133 -0
- package/dist/presets-dsr.d.ts +133 -0
- package/dist/presets-dsr.js +2 -0
- package/dist/presets-dsr.mjs +2 -0
- package/dist/presets-policy.d.mts +203 -0
- package/dist/presets-policy.d.ts +203 -0
- package/dist/presets-policy.js +2 -0
- package/dist/presets-policy.mjs +2 -0
- package/dist/presets.d.mts +127 -5
- package/dist/presets.d.ts +127 -5
- package/dist/presets.js +1 -2
- package/dist/presets.mjs +1 -2
- package/dist/ropa.js +1 -2
- package/dist/ropa.mjs +1 -2
- package/dist/server.d.mts +226 -22
- package/dist/server.d.ts +226 -22
- package/dist/server.js +1 -2
- package/dist/server.mjs +1 -2
- package/dist/styles.css +34 -0
- package/dist/unstyled.d.mts +3 -1
- package/dist/unstyled.d.ts +3 -1
- package/dist/unstyled.js +1 -2
- package/dist/unstyled.mjs +1 -2
- package/package.json +83 -20
- package/dist/chunk-3VQAYQR7.js +0 -7
- package/dist/chunk-6HZL2WDU.mjs +0 -2
- package/dist/chunk-75TJPK2N.mjs +0 -2
- package/dist/chunk-ABDB7LEV.mjs +0 -2
- package/dist/chunk-AYKLAEOU.mjs +0 -2
- package/dist/chunk-C4YM4UMI.js +0 -2
- package/dist/chunk-CKJAECGV.js +0 -2
- package/dist/chunk-CPK5D5FY.js +0 -132
- package/dist/chunk-CWHBCQGT.mjs +0 -2
- package/dist/chunk-E64TU6IU.js +0 -2
- package/dist/chunk-F5TXUA4O.mjs +0 -4
- package/dist/chunk-GN5C32JB.mjs +0 -2
- package/dist/chunk-GRLIPT5V.mjs +0 -132
- package/dist/chunk-I557S566.mjs +0 -15
- package/dist/chunk-JBSCER34.js +0 -2
- package/dist/chunk-JFFOPHU3.mjs +0 -318
- package/dist/chunk-KF3EFJEF.mjs +0 -3
- package/dist/chunk-ORFC66EA.js +0 -4
- package/dist/chunk-RY3PGVLZ.mjs +0 -2
- package/dist/chunk-S4GRSNB4.js +0 -2
- package/dist/chunk-SCWNM4PC.mjs +0 -2
- package/dist/chunk-SKKOMFXH.js +0 -81
- package/dist/chunk-TCN22KYP.mjs +0 -7
- package/dist/chunk-TUNQUVHU.mjs +0 -81
- package/dist/chunk-VIQUXWJC.js +0 -2
- package/dist/chunk-WTJGLNTB.js +0 -3
- package/dist/chunk-XIM7KMD6.js +0 -2
- package/dist/chunk-YPKUHSK4.js +0 -15
- package/dist/chunk-ZPKVLTSX.js +0 -2
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-WTGKZX7J.mjs';import {b,a as a$2}from'./chunk-ITCY2Z66.mjs';import {a}from'./chunk-SFGW37LE.mjs';import {useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var we=({breachData:l,initialAssessment:f={},onComplete:k,title:J="Breach Risk Assessment",description:K="Assess the risk level of this data breach to determine notification requirements under NDPA Section 40.",submitButtonText:Q="Complete Assessment",className:se="",buttonClassName:Z="",classNames:b={},unstyled:d=false,showBreachSummary:c=true,showNotificationRequirements:S=true})=>{let[L,ae]=useState(f.confidentialityImpact||3),[B,h]=useState(f.integrityImpact||3),[I,D]=useState(f.availabilityImpact||3),[E,T]=useState(f.harmLikelihood||3),[O,F]=useState(f.harmSeverity||3),[U,j]=useState(f.risksToRightsAndFreedoms!==void 0?f.risksToRightsAndFreedoms:false),[H,M]=useState(f.highRisksToRightsAndFreedoms!==void 0?f.highRisksToRightsAndFreedoms:false),[X,ie]=useState(f.justification||""),[Y,re]=useState(0),[C,v]=useState("low"),[x,g]=useState(false),[R,z]=useState(0),[q,ee]=useState(0),[u,w]=useState(false),[$]=useState(()=>Date.now());useEffect(()=>{let W=L*.2+B*.1+I*.1+E*.3+O*.3;re(Number(W.toFixed(1)));let V;W<2?V="low":W<3?V="medium":W<4?V="high":V="critical",v(V),g(U||V==="high"||V==="critical");let de=l.discoveredAt+4320*60*1e3;z(de);let fe=Date.now(),Ne=(de-fe)/(3600*1e3);ee(Number(Ne.toFixed(1)));},[L,B,I,E,O,U,l.discoveredAt]);let P=r=>new Date(r).toLocaleString(),a$1=r=>{r.preventDefault();let y={id:f.id||`assessment_${Date.now()}`,breachId:l.id,assessedAt:Date.now(),assessor:f.assessor||{name:"Assessment User",role:"Data Protection Officer",email:"dpo@example.com"},confidentialityImpact:L,integrityImpact:B,availabilityImpact:I,harmLikelihood:E,harmSeverity:O,overallRiskScore:Y,riskLevel:C,risksToRightsAndFreedoms:U,highRisksToRightsAndFreedoms:H,justification:X};k(y),w(true);},m=r=>{switch(r){case 1:return "Minimal";case 2:return "Low";case 3:return "Moderate";case 4:return "High";case 5:return "Severe";default:return "Unknown"}},N=r=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--warning",critical:"ndpr-badge ndpr-badge--destructive"}[r]}`,b.riskBadge,d),children:r.charAt(0).toUpperCase()+r.slice(1)});return jsxs("div",{"data-ndpr-component":"breach-risk-assessment",className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${se}`,b.root,d),children:[jsx("h2",{className:a("ndpr-section-heading",b.title,d),children:J}),jsx("p",{className:"ndpr-card__subtitle",children:K}),c&&jsxs("div",{className:"ndpr-panel",children:[jsx("h3",{className:"text-lg font-medium mb-2",children:"Breach Summary"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Title:"})," ",l.title]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Discovered:"})," ",P(l.discoveredAt)]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",l.status.charAt(0).toUpperCase()+l.status.slice(1)]})]}),jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Data Types:"})," ",l.dataTypes.join(", ")]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",l.affectedSystems.join(", ")]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",l.estimatedAffectedSubjects||"Unknown"]})]})]})]}),u?jsxs("div",{children:[jsxs("div",{className:"ndpr-alert ndpr-alert--info",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Assessment Results"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Overall Risk Level:"})," ",N(C)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risk Score:"})," ",Y," / 5"]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Assessed On:"})," ",P($)]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",U?"Yes":"No"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",H?"Yes":"No"]})]})]}),jsxs("div",{className:"mt-3",children:[jsx("p",{className:"text-sm mb-1",children:jsx("span",{className:"font-medium",children:"Justification:"})}),jsx("p",{className:"text-sm bg-white dark:bg-gray-800 p-2 rounded",children:X})]})]}),S&&jsxs("div",{className:a(`mb-6 p-4 rounded-md ${x?q>24?"ndpr-alert ndpr-alert--warning":"ndpr-alert ndpr-alert--destructive":"ndpr-alert ndpr-alert--success"}`,b.notificationStatus,d),children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Requirements"}),x?jsxs("div",{children:[jsx("p",{className:`text-sm font-bold mb-2 ${q>24?"ndpr-text-warning":"ndpr-text-destructive"}`,children:"NDPC Notification Required"}),jsx("p",{className:"text-sm mb-2",children:"Under the NDPA (Section 40), this breach must be reported to the NDPC within 72 hours of discovery."}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Notification Deadline:"})," ",P(R)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Time Remaining:"})," ",jsx("span",{className:q<24?"ndpr-text-destructive font-bold":"",children:q>0?`${q} hours`:"Deadline passed"})]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Data Subject Notification:"})," ",H?"Required (NDPA Section 40(4))":"Not required unless directed by NDPC"]})]}):jsxs("div",{children:[jsx("p",{className:"text-sm font-bold mb-2 ndpr-text-success",children:"NDPC Notification Not Required"}),jsx("p",{className:"text-sm mb-2",children:"Based on this assessment, this breach does not need to be reported to the NDPC."}),jsx("p",{className:"text-sm mb-2",children:"However, the breach should still be documented internally for compliance purposes."})]}),jsxs("div",{className:"mt-3 text-sm",children:[jsx("p",{className:"font-medium",children:"Next Steps:"}),jsx("ul",{className:"list-disc pl-5 mt-1",children:x?jsxs(Fragment,{children:[jsx("li",{children:"Prepare a notification report for the NDPC"}),jsx("li",{children:"Document all aspects of the breach and your response"}),H&&jsx("li",{children:"Prepare communications for affected data subjects"}),jsx("li",{children:"Implement measures to mitigate the impact of the breach"})]}):jsxs(Fragment,{children:[jsx("li",{children:"Document the breach and this assessment in your internal records"}),jsx("li",{children:"Implement measures to prevent similar breaches in the future"}),jsx("li",{children:"Review and update security measures as needed"})]})})]})]}),jsx("button",{onClick:()=>w(false),className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${Z}`,b.primaryButton||b.submitButton,d),children:"Edit Assessment"})]}):jsx("form",{onSubmit:a$1,children:jsxs("div",{className:"ndpr-form-section",children:[jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Impact Assessment"}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"confidentialityImpact",className:"ndpr-form-field__label",children:["Confidentiality Impact (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",children:"How much has the confidentiality of data been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"confidentialityImpact",min:"1",max:"5",step:"1",value:L,onChange:r=>ae(parseInt(r.target.value)),className:a("ndpr-form-field__range",b.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(L)," (",L,")"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"integrityImpact",className:"ndpr-form-field__label",children:["Integrity Impact (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",children:"How much has the integrity of data been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"integrityImpact",min:"1",max:"5",step:"1",value:B,onChange:r=>h(parseInt(r.target.value)),className:a("ndpr-form-field__range",b.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(B)," (",B,")"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"availabilityImpact",className:"ndpr-form-field__label",children:["Availability Impact (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",children:"How much has the availability of data or systems been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"availabilityImpact",min:"1",max:"5",step:"1",value:I,onChange:r=>D(parseInt(r.target.value)),className:a("ndpr-form-field__range",b.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(I)," (",I,")"]})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Risk to Data Subjects"}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"harmLikelihood",className:"ndpr-form-field__label",children:["Likelihood of Harm (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",children:"How likely is it that data subjects will experience harm?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"harmLikelihood",min:"1",max:"5",step:"1",value:E,onChange:r=>T(parseInt(r.target.value)),className:a("ndpr-form-field__range",b.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(E)," (",E,")"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"harmSeverity",className:"ndpr-form-field__label",children:["Severity of Harm (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",children:"How severe would the harm be to affected data subjects?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"harmSeverity",min:"1",max:"5",step:"1",value:O,onChange:r=>F(parseInt(r.target.value)),className:a("ndpr-form-field__range",b.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[m(O)," (",O,")"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("input",{type:"checkbox",id:"risksToRightsAndFreedoms",checked:U,onChange:r=>j(r.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"risksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a risk to the rights and freedoms of data subjects"})]}),jsx("p",{className:"text-xs ndpr-text-muted ml-6",children:"Under the NDPA (Section 40), breaches that pose a risk to rights and freedoms must be reported to the NDPC within 72 hours."})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("input",{type:"checkbox",id:"highRisksToRightsAndFreedoms",checked:H,onChange:r=>M(r.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"highRisksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a high risk to the rights and freedoms of data subjects"})]}),jsx("p",{className:"text-xs ndpr-text-muted ml-6",children:"Under the NDPA (Section 40(4)), breaches that pose a high risk to rights and freedoms also require notification to affected data subjects without undue delay."})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Overall Assessment"}),jsxs("div",{className:"ndpr-panel",children:[jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsx("span",{className:"font-medium",children:"Overall Risk Score:"}),jsxs("span",{className:a("",b.riskScore,d),children:[Y," / 5"]})]}),jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:"font-medium",children:"Risk Level:"}),N(C)]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"justification",className:"ndpr-form-field__label",children:["Justification for Assessment ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"justification",value:X,onChange:r=>ie(r.target.value),rows:4,placeholder:"Explain the reasoning behind your assessment, including any factors that influenced your decision.",className:"ndpr-form-field__input",required:true})]})]}),jsxs("div",{className:"ndpr-alert ndpr-alert--info",children:[jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"ndpr-text-info text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This assessment will determine if notification is required for this breach."})]}),jsx("div",{className:"mt-6",children:jsx("button",{type:"submit",className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${Z}`,b.primaryButton||b.submitButton,d),children:Q})})]})})]})};var Pe=({breachReports:l,riskAssessments:f,regulatoryNotifications:k,onSelectBreach:J,onRequestAssessment:K,onRequestNotification:Q,title:se="Breach Notification Manager",description:Z="Manage data breach notifications and track compliance with NDPA Section 40 requirements.",className:b="",buttonClassName:d="",classNames:c={},unstyled:S=false,showBreachDetails:L=true,showNotificationTimeline:ae=true,showDeadlineAlerts:B=true})=>{var P;let[h,I]=useState(null),[D,E]=useState(l),[T,O]=useState("all"),[F,U]=useState(""),[j,H]=useState("discoveredAt"),[M,X]=useState("desc");useEffect(()=>{let a=[...l];if(T!=="all"&&(a=a.filter(m=>m.status===T)),F){let m=F.toLowerCase();a=a.filter(N=>N.title.toLowerCase().includes(m)||N.description.toLowerCase().includes(m)||N.affectedSystems.some(r=>r.toLowerCase().includes(m))||N.dataTypes.some(r=>r.toLowerCase().includes(m)));}a.sort((m,N)=>{let r=0;switch(j){case "title":r=m.title.localeCompare(N.title);break;case "discoveredAt":r=m.discoveredAt-N.discoveredAt;break;case "status":r=m.status.localeCompare(N.status);break;case "riskLevel":let y=f.find(W=>W.breachId===m.id),_=f.find(W=>W.breachId===N.id),ne=(y==null?void 0:y.riskLevel)||"unknown",oe=(_==null?void 0:_.riskLevel)||"unknown";r=ne.localeCompare(oe);break;default:r=m.discoveredAt-N.discoveredAt;}return M==="asc"?r:-r}),E(a);},[l,T,F,j,M,f]),useEffect(()=>{D.length>0&&(h&&D.some(m=>m.id===h)||I(D[0].id));},[D,h]);let ie=a=>{I(a),J&&J(a);},Y=()=>{h&&K&&K(h);},re=()=>{h&&Q&&Q(h);},C=a=>new Date(a).toLocaleString(),v=h?l.find(a=>a.id===h):null,x=h?f.find(a=>a.breachId===h):null,g=h?k.find(a=>a.breachId===h):null,R=v?z(v,x):null;function z(a,m){let N=a$1(a,m||void 0),r=a.discoveredAt+N.timeframeHours*60*60*1e3;return {ndpcNotificationRequired:N.notificationRequired,ndpcNotificationDeadline:r,dataSubjectNotificationRequired:(m==null?void 0:m.highRisksToRightsAndFreedoms)||false,justification:N.justification}}function q(a){let m=Date.now(),N=(a-m)/(3600*1e3);return Number(N.toFixed(1))}let ee=a$1=>a$1?jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--warning",critical:"ndpr-badge ndpr-badge--destructive"}[a$1]}`,c.statusBadge,S),children:a$1.charAt(0).toUpperCase()+a$1.slice(1)}):null,u=a$1=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{ongoing:"ndpr-badge ndpr-badge--destructive",contained:"ndpr-badge ndpr-badge--warning",resolved:"ndpr-badge ndpr-badge--success"}[a$1]||"ndpr-badge ndpr-badge--neutral"}`,c.statusBadge,S),children:a$1.charAt(0).toUpperCase()+a$1.slice(1)}),w=()=>{if(!v||!R)return null;if(!R.ndpcNotificationRequired)return jsxs("div",{"data-ndpr-component":"breach-notification-manager",className:"ndpr-alert ndpr-alert--success",children:[jsx("p",{className:"text-sm ndpr-text-success font-medium",children:"Notification Not Required"}),jsx("p",{className:"text-xs ndpr-text-success mt-1",children:"Based on the risk assessment, NDPC notification is not required for this breach."})]});if(g)return jsxs("div",{className:"ndpr-alert ndpr-alert--success",children:[jsx("p",{className:"text-sm ndpr-text-success font-medium",children:"Notification Sent"}),jsxs("p",{className:"text-xs ndpr-text-success mt-1",children:["Notification was sent to the NDPC on ",C(g.sentAt),"."]})]});let a=q(R.ndpcNotificationDeadline);return a<=0?jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",children:[jsx("p",{className:"text-sm ndpr-text-destructive font-medium",children:"Notification Deadline Passed"}),jsx("p",{className:"text-xs ndpr-text-destructive mt-1",children:"The 72-hour deadline for NDPC notification has passed. Notification should be sent immediately."})]}):a<=24?jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",children:[jsx("p",{className:"text-sm ndpr-text-destructive font-medium",children:"Urgent: Notification Due Soon"}),jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["Only ",a," hours remaining until the NDPC notification deadline."]})]}):jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm ndpr-text-warning font-medium",children:"Notification Required"}),jsxs("p",{className:"text-xs ndpr-text-warning mt-1",children:["NDPC notification is required by ",C(R.ndpcNotificationDeadline)," (",a," hours remaining)."]})]})},$=()=>{if(!v)return null;let a$1=[{title:"Breach Discovered",date:v.discoveredAt,completed:true,description:`Breach was discovered on ${C(v.discoveredAt)}.`},{title:"Risk Assessment",date:x==null?void 0:x.assessedAt,completed:!!x,description:x?`Risk assessment completed on ${C(x.assessedAt)}.`:"Risk assessment has not been completed yet."}];return R!=null&&R.ndpcNotificationRequired&&a$1.push({title:"NDPC Notification",date:g==null?void 0:g.sentAt,completed:!!g,description:g?`Notification sent to the NDPC on ${C(g.sentAt)}.`:`Notification must be sent to the NDPC by ${C(R.ndpcNotificationDeadline)}.`}),R!=null&&R.dataSubjectNotificationRequired&&a$1.push({title:"Data Subject Notification",date:void 0,completed:false,description:"Notification to affected data subjects is required but has not been sent yet."}),jsxs("div",{className:a("mt-6",c.timeline,S),children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Notification Timeline"}),jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:a$1.map((m,N)=>jsxs("li",{className:a("mb-6 ml-4",c.timelineStep,S),children:[jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${m.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsx("time",{className:"mb-1 text-sm font-normal leading-none ndpr-text-muted",children:m.date?C(m.date):"Pending"}),jsx("h4",{className:"ndpr-section-heading",children:m.title}),jsx("p",{className:"ndpr-form-field__hint",children:m.description})]},N))})]})};return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${b}`,c.root,S),children:[jsxs("div",{className:a("",c.header,S),children:[jsx("h2",{className:a("ndpr-section-heading",c.title,S),children:se}),jsx("p",{className:"ndpr-card__subtitle",children:Z})]}),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"statusFilter",className:"ndpr-form-field__label",children:"Status Filter"}),jsxs("select",{id:"statusFilter",value:T,onChange:a=>O(a.target.value),className:"ndpr-form-field__input",children:[jsx("option",{value:"all",children:"All Statuses"}),jsx("option",{value:"ongoing",children:"Ongoing"}),jsx("option",{value:"contained",children:"Contained"}),jsx("option",{value:"resolved",children:"Resolved"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sortBy",className:"ndpr-form-field__label",children:"Sort By"}),jsxs("select",{id:"sortBy",value:j,onChange:a=>H(a.target.value),className:"ndpr-form-field__input",children:[jsx("option",{value:"discoveredAt",children:"Discovery Date"}),jsx("option",{value:"title",children:"Title"}),jsx("option",{value:"status",children:"Status"}),jsx("option",{value:"riskLevel",children:"Risk Level"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"searchTerm",className:"ndpr-form-field__label",children:"Search"}),jsx("input",{type:"text",id:"searchTerm",value:F,onChange:a=>U(a.target.value),placeholder:"Search breaches...",className:"ndpr-form-field__input"})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxs("div",{className:"md:col-span-1",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Breach Reports"}),D.length===0?jsx("p",{className:"ndpr-card__subtitle",children:"No breach reports found."}):jsx("div",{className:a("space-y-2 max-h-96 overflow-y-auto pr-2",c.breachList,S),children:D.map(a$1=>{let m=f.find(_=>_.breachId===a$1.id),N=k.find(_=>_.breachId===a$1.id),r=z(a$1,m),y=null;if(r!=null&&r.ndpcNotificationRequired)if(N)y=jsx("span",{className:"text-xs ndpr-text-success",children:"Notified"});else {let _=q(r.ndpcNotificationDeadline);_<=0?y=jsx("span",{className:"text-xs ndpr-text-destructive font-bold",children:"Overdue"}):_<=24?y=jsx("span",{className:"text-xs ndpr-text-destructive",children:"Urgent"}):y=jsx("span",{className:"text-xs ndpr-text-warning",children:"Required"});}else y=jsx("span",{className:"text-xs ndpr-text-success",children:"Not Required"});return jsxs("div",{className:a(`p-3 rounded-md cursor-pointer ${h===a$1.id?"ndpr-alert ndpr-alert--info":"ndpr-panel"}`,c.breachItem,S),onClick:()=>ie(a$1.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:a$1.title}),u(a$1.status)]}),jsxs("p",{className:"text-xs ndpr-text-muted mb-1",children:["Discovered: ",new Date(a$1.discoveredAt).toLocaleDateString()]}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsx("div",{children:m&&ee(m.riskLevel)}),jsx("div",{children:y})]})]},a$1.id)})})]}),jsx("div",{className:a("md:col-span-2",c.detailPanel,S),children:v?jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsx("h3",{className:"ndpr-section-heading",children:v.title}),u(v.status)]}),B&&jsx("div",{className:"ndpr-form-field",children:w()}),L&&jsxs("div",{className:"mb-6",children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Discovered:"})," ",C(v.discoveredAt)]}),v.occurredAt&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Occurred:"})," ",C(v.occurredAt)]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Reporter:"})," ",v.reporter.name]})]}),jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",v.affectedSystems.join(", ")]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Data Types:"})," ",v.dataTypes.join(", ")]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",v.estimatedAffectedSubjects||"Unknown"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-text-sm ndpr-font-medium",children:"Description:"}),jsx("p",{className:"ndpr-panel",children:v.description})]}),v.initialActions&&jsxs("div",{children:[jsx("p",{className:"ndpr-text-sm ndpr-font-medium",children:"Initial Actions Taken:"}),jsx("p",{className:"ndpr-panel",children:v.initialActions})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Risk Assessment"}),x?jsxs("div",{className:"ndpr-panel",children:[jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsx("p",{className:"ndpr-text-sm ndpr-font-medium",children:"Risk Level:"}),ee(x.riskLevel)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risk Score:"})," ",x.overallRiskScore," / 5"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",x.risksToRightsAndFreedoms?"Yes":"No"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",x.highRisksToRightsAndFreedoms?"Yes":"No"]}),jsx("p",{className:"text-sm mb-1",children:jsx("span",{className:"font-medium",children:"Justification:"})}),jsx("p",{className:"text-xs ndpr-text-muted bg-white dark:bg-gray-800 p-2 rounded-md",children:x.justification})]}):jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm ndpr-text-warning",children:"Risk assessment has not been conducted yet."}),jsx("button",{onClick:Y,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${d}`,children:"Conduct Risk Assessment"})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Status"}),g?jsxs("div",{className:"ndpr-panel",children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Notification Sent:"})," ",C(g.sentAt)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Method:"})," ",g.method.charAt(0).toUpperCase()+g.method.slice(1)]}),g.referenceNumber&&jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Reference Number:"})," ",g.referenceNumber]}),(g.ndpcContact||g.nitdaContact)&&jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"NDPC Contact:"})," ",(P=g.ndpcContact||g.nitdaContact)==null?void 0:P.name]})]}):jsx("div",{children:R!=null&&R.ndpcNotificationRequired?jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm ndpr-text-warning",children:"NDPC notification is required but has not been sent yet."}),jsx("button",{onClick:re,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${d}`,children:"Generate Notification"})]}):jsx("div",{className:"ndpr-alert ndpr-alert--success",children:jsx("p",{className:"text-sm ndpr-text-success",children:"NDPC notification is not required for this breach."})})})]}),ae&&$()]}):jsx("div",{className:"ndpr-empty-state",children:jsx("p",{className:"ndpr-card__subtitle",children:"Select a breach to view details"})})})]})]})};var Le=({breachData:l,assessmentData:f,organizationInfo:k,onGenerate:J,title:K="Generate NDPC Notification Report",description:Q="Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements.",generateButtonText:se="Generate Report",className:Z="",buttonClassName:b$1="",classNames:d={},unstyled:c=false,showPreview:S=true,allowEditing:L=true,allowDownload:ae=true,downloadFormat:B="pdf"})=>{let[h,I]=useState(""),[D,E]=useState(""),[T,O]=useState(""),[F,U]=useState(""),[j,H]=useState("email"),[M,X]=useState(""),[ie,Y]=useState(""),[re,C]=useState(false),[v,x]=useState(false);useEffect(()=>{let u=R();I(u),C(true);},[l,f,k]);let g=u=>new Date(u).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),R=()=>{var m,N,r,y,_,ne;let w=new Date().toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),$=((m=l.dpoContact)==null?void 0:m.name)||k.dpoName,P=((N=l.dpoContact)==null?void 0:N.email)||k.dpoEmail,a=((r=l.dpoContact)==null?void 0:r.phone)||k.dpoPhone;return `
|
|
2
|
+
NDPC DATA BREACH NOTIFICATION
|
|
3
|
+
|
|
4
|
+
Date: ${w}
|
|
5
|
+
${l.isPhasedReport?"Report Type: PHASED / INTERIM REPORT":"Report Type: Full Report"}
|
|
6
|
+
${l.supplementsReportId?`Supplements Report ID: ${l.supplementsReportId}`:""}
|
|
7
|
+
|
|
8
|
+
Reference: NDPA Section 40 - Personal Data Breaches
|
|
9
|
+
|
|
10
|
+
ORGANIZATION DETAILS
|
|
11
|
+
-------------------
|
|
12
|
+
Organization Name: ${k.name}
|
|
13
|
+
${k.registrationNumber?`Registration Number: ${k.registrationNumber}`:""}
|
|
14
|
+
Address: ${k.address}
|
|
15
|
+
${k.website?`Website: ${k.website}`:""}
|
|
16
|
+
|
|
17
|
+
DATA PROTECTION OFFICER (Section 32 contact point)
|
|
18
|
+
----------------------
|
|
19
|
+
Name: ${$}
|
|
20
|
+
Email: ${P}
|
|
21
|
+
${a?`Phone: ${a}`:""}
|
|
22
|
+
|
|
23
|
+
BREACH DETAILS
|
|
24
|
+
-------------
|
|
25
|
+
Breach Title: ${l.title}
|
|
26
|
+
Date Discovered: ${g(l.discoveredAt)}
|
|
27
|
+
${l.occurredAt?`Date Occurred: ${g(l.occurredAt)}`:"Date Occurred: Unknown"}
|
|
28
|
+
Status: ${l.status.charAt(0).toUpperCase()+l.status.slice(1)}
|
|
29
|
+
|
|
30
|
+
Nature of the Personal Data Breach (Section 40(2)):
|
|
31
|
+
${l.description}
|
|
32
|
+
|
|
33
|
+
Affected Systems/Applications:
|
|
34
|
+
${l.affectedSystems.join(", ")}
|
|
35
|
+
|
|
36
|
+
Types of Personal Data Involved:
|
|
37
|
+
${l.dataTypes.join(", ")}
|
|
38
|
+
${l.involvesSensitiveData?"Sensitive personal data (Section 30) involved: YES":""}
|
|
39
|
+
|
|
40
|
+
Categories of Data Subjects Affected (Section 40(2)):
|
|
41
|
+
${((y=l.dataSubjectCategories)==null?void 0:y.join(", "))||"[Not specified \u2014 required by NDPC]"}
|
|
42
|
+
|
|
43
|
+
Approximate Number of Data Subjects Affected:
|
|
44
|
+
${(_=l.estimatedAffectedSubjects)!=null?_:"Unknown"}
|
|
45
|
+
|
|
46
|
+
Approximate Number of Personal Data Records Concerned (Section 40(2)):
|
|
47
|
+
${(ne=l.approximateRecordCount)!=null?ne:"Unknown"}
|
|
48
|
+
|
|
49
|
+
RISK ASSESSMENT
|
|
50
|
+
--------------
|
|
51
|
+
${f?`
|
|
52
|
+
Overall Risk Level: ${f.riskLevel.charAt(0).toUpperCase()+f.riskLevel.slice(1)}
|
|
53
|
+
Risk to Rights and Freedoms of Data Subjects: ${f.risksToRightsAndFreedoms?"Yes":"No"}
|
|
54
|
+
High Risk to Rights and Freedoms of Data Subjects: ${f.highRisksToRightsAndFreedoms?"Yes":"No"}
|
|
55
|
+
|
|
56
|
+
Justification for Risk Assessment:
|
|
57
|
+
${f.justification}
|
|
58
|
+
`:"Risk assessment has not been conducted yet."}
|
|
59
|
+
|
|
60
|
+
LIKELY CONSEQUENCES OF THE BREACH (Section 40(3))
|
|
61
|
+
--------------------------------
|
|
62
|
+
${l.likelyConsequences||"[Please describe likely consequences for affected data subjects \u2014 identity theft, financial loss, discrimination, etc.]"}
|
|
63
|
+
|
|
64
|
+
MEASURES TAKEN OR PROPOSED
|
|
65
|
+
-------------
|
|
66
|
+
Measures taken to address the breach:
|
|
67
|
+
${l.initialActions||"To be determined"}
|
|
68
|
+
|
|
69
|
+
Measures taken or proposed to mitigate possible adverse effects (Section 40(3)):
|
|
70
|
+
${l.mitigationMeasures||"[Please specify mitigation measures]"}
|
|
71
|
+
|
|
72
|
+
NOTIFICATION TO DATA SUBJECTS (Section 40(3))
|
|
73
|
+
----------------------------
|
|
74
|
+
Have data subjects been notified: [Yes/No]
|
|
75
|
+
If yes, date of notification: [Date]
|
|
76
|
+
If no, planned date of notification: [Date]
|
|
77
|
+
Reason for delay (if applicable): [Reason]
|
|
78
|
+
|
|
79
|
+
${l.isPhasedReport?`PHASED REPORT NOTE
|
|
80
|
+
---------------------
|
|
81
|
+
This report is submitted in phases under NDPA Section 40(2) because complete
|
|
82
|
+
information was not available within 72 hours of discovery. A supplementary
|
|
83
|
+
report will be filed once additional facts are confirmed.
|
|
84
|
+
`:""}
|
|
85
|
+
ADDITIONAL INFORMATION
|
|
86
|
+
---------------------
|
|
87
|
+
[Any additional information relevant to the breach]
|
|
88
|
+
|
|
89
|
+
This notification is made in compliance with the Nigeria Data Protection Act (NDPA), Section 40.
|
|
90
|
+
|
|
91
|
+
IMPORTANT NOTICE
|
|
92
|
+
---------------------
|
|
93
|
+
${b}
|
|
94
|
+
`},z=u=>{u.preventDefault();let w={id:`notification_${Date.now()}`,breachId:l.id,sentAt:Date.now(),method:j,referenceNumber:M||void 0,ndpcContact:D?{name:D,email:T,phone:F||void 0}:void 0,content:h,attachments:[]};J(w),x(true);},q=()=>{let u,w,$;switch(B){case "html":{u="text/html",w="html",$=`<!DOCTYPE html>
|
|
95
|
+
<html lang="en">
|
|
96
|
+
<head>
|
|
97
|
+
<meta charset="UTF-8">
|
|
98
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
99
|
+
<title>NDPC Breach Notification Report</title>
|
|
100
|
+
<style>body{font-family:monospace;white-space:pre-wrap;max-width:800px;margin:2rem auto;padding:0 1rem;}</style>
|
|
101
|
+
</head>
|
|
102
|
+
<body>${h.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}</body>
|
|
103
|
+
</html>`;break}case "pdf":u="text/plain",w="pdf.txt",$=h;break;case "docx":u="text/plain",w="docx.txt",$=h;break;default:u="text/plain",w="txt",$=h;}let P=document.createElement("a"),a=new Blob([$],{type:u});P.href=URL.createObjectURL(a),P.download=`NDPC_Breach_Notification_${new Date().toISOString().split("T")[0]}.${w}`,document.body.appendChild(P),P.click(),document.body.removeChild(P);},ee=()=>[{value:"email",label:"Email"},{value:"portal",label:"NDPC Portal"},{value:"letter",label:"Formal Letter"},{value:"other",label:"Other"}].map(w=>jsx("option",{value:w.value,children:w.label},w.value));return jsxs("div",{"data-ndpr-component":"regulatory-report-generator",className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Z}`,d.root,c),children:[jsxs("div",{className:a("",d.header,c),children:[jsx("h2",{className:a("ndpr-section-heading",d.title,c),children:K}),jsx("p",{className:"ndpr-card__subtitle",children:Q})]}),v?jsxs("div",{children:[jsxs("div",{className:"ndpr-alert ndpr-alert--success",children:[jsx("h3",{className:"text-lg font-bold ndpr-text-success mb-2",children:"Report Generated Successfully"}),jsx("p",{className:"ndpr-text-success",children:"Your NDPC notification report has been generated and is ready for submission. Please review the report carefully before submitting it to the NDPC."})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"ndpr-section-heading",children:"Submission Details"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:a("ndpr-text-sm",d.field,c),children:[jsx("span",{className:a("font-medium",d.fieldLabel,c),children:"Method:"})," ",jsx("span",{className:a("",d.fieldValue,c),children:j.charAt(0).toUpperCase()+j.slice(1)})]}),D&&jsxs("p",{className:a("ndpr-text-sm",d.field,c),children:[jsx("span",{className:a("font-medium",d.fieldLabel,c),children:"Contact Name:"})," ",jsx("span",{className:a("",d.fieldValue,c),children:D})]}),T&&jsxs("p",{className:a("ndpr-text-sm",d.field,c),children:[jsx("span",{className:a("font-medium",d.fieldLabel,c),children:"Contact Email:"})," ",jsx("span",{className:a("",d.fieldValue,c),children:T})]}),F&&jsxs("p",{className:a("ndpr-text-sm",d.field,c),children:[jsx("span",{className:a("font-medium",d.fieldLabel,c),children:"Contact Phone:"})," ",jsx("span",{className:a("",d.fieldValue,c),children:F})]})]}),jsxs("div",{children:[jsxs("p",{className:a("ndpr-text-sm",d.field,c),children:[jsx("span",{className:a("font-medium",d.fieldLabel,c),children:"Date Generated:"})," ",jsx("span",{className:a("",d.fieldValue,c),children:g(Date.now())})]}),jsxs("p",{className:a("ndpr-text-sm",d.field,c),children:[jsx("span",{className:a("font-medium",d.fieldLabel,c),children:"Breach ID:"})," ",jsx("span",{className:a("",d.fieldValue,c),children:l.id})]}),M&&jsxs("p",{className:a("ndpr-text-sm",d.field,c),children:[jsx("span",{className:a("font-medium",d.fieldLabel,c),children:"Reference Number:"})," ",jsx("span",{className:a("",d.fieldValue,c),children:M})]})]})]})]}),S&&jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"ndpr-section-heading",children:"Report Preview"}),jsx("div",{className:a("ndpr-panel",d.reportPreview,c),children:jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:h})})]}),jsxs("div",{className:"ndpr-card__footer",children:[ae&&jsxs("button",{onClick:q,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${b$1}`,d.secondaryButton||d.downloadButton,c),children:["Download Report (",B.toUpperCase(),")"]}),jsx("button",{onClick:()=>x(false),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${b$1}`,children:"Edit Report"})]})]}):jsx("form",{onSubmit:z,children:jsxs("div",{className:"ndpr-form-section",children:[jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Notification Method"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"method",className:"ndpr-form-field__label",children:["Method of Submission ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("select",{id:"method",value:j,onChange:u=>H(u.target.value),className:"ndpr-form-field__input",required:true,children:ee()})]}),jsxs("div",{children:[jsx("label",{htmlFor:"referenceNumber",className:"ndpr-form-field__label",children:"Reference Number (if available)"}),jsx("input",{type:"text",id:"referenceNumber",value:M,onChange:u=>X(u.target.value),placeholder:"e.g. NDPC/BR/2024/001",className:"ndpr-form-field__input"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"NDPC Contact (if known)"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[jsxs("div",{children:[jsx("label",{htmlFor:"contactName",className:"ndpr-form-field__label",children:"Contact Name"}),jsx("input",{type:"text",id:"contactName",value:D,onChange:u=>E(u.target.value),className:"ndpr-form-field__input"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"contactEmail",className:"ndpr-form-field__label",children:"Contact Email"}),jsx("input",{type:"email",id:"contactEmail",value:T,onChange:u=>O(u.target.value),className:"ndpr-form-field__input"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"contactPhone",className:"ndpr-form-field__label",children:"Contact Phone"}),jsx("input",{type:"tel",id:"contactPhone",value:F,onChange:u=>U(u.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Additional Information"}),jsxs("div",{children:[jsx("label",{htmlFor:"additionalInfo",className:"ndpr-form-field__label",children:"Additional Information to Include"}),jsx("textarea",{id:"additionalInfo",value:ie,onChange:u=>Y(u.target.value),rows:3,placeholder:"Any additional information you want to include in the report",className:"ndpr-form-field__input"})]})]}),L&&jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Report Content"}),jsxs("div",{children:[jsxs("label",{htmlFor:"reportContent",className:"ndpr-form-field__label",children:["Edit Report Content ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"reportContent",value:h,onChange:u=>I(u.target.value),rows:20,className:"ndpr-form-field__input ndpr-form-field__input--mono",required:true})]})]}),jsxs("div",{className:"ndpr-alert ndpr-alert--info",children:[jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"ndpr-text-info text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This report will help you comply with this requirement."}),jsx("p",{className:"ndpr-text-muted text-xs mt-2 italic",role:"note",children:a$2})]}),jsx("div",{className:"mt-6",children:jsx("button",{type:"submit",className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${b$1}`,d.primaryButton||d.generateButton,c),children:se})})]})})]})};export{we as a,Pe as b,Le as c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$2}from'./chunk-EWVK45Z3.mjs';import {a}from'./chunk-SFGW37LE.mjs';import {b,a as a$1}from'./chunk-ZJYULEER.mjs';import {useState}from'react';import {jsxs,jsx}from'react/jsx-runtime';var gr=({requestTypes:y,onSubmit:V,onValidationError:F,title:N="Submit a Data Subject Request",description:s="Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part VI.",submitButtonText:rr="Submit Request",className:q="",buttonClassName:ir="",showConfirmation:er=true,confirmationMessage:tr="Your request has been submitted successfully. You will receive a confirmation email shortly.",requireIdentityVerification:P=true,identifierTypes:T=[{id:"email",label:"Email Address"},{id:"account",label:"Account Number"},{id:"customer_id",label:"Customer ID"}],collectAdditionalContact:or=true,labels:v={},classNames:r,unstyled:e=false,isSubmitting:C=false,defaultValues:p,onReset:$})=>{var Y,H,L,U,W,J;if(!Array.isArray(y))throw new Error("[ndpr-toolkit] <DSRRequestForm requestTypes={...} /> requires an array of RequestType[]. See https://ndprtoolkit.com.ng/docs/components/dsr#requesttypes \u2014 or use the `<NDPRSubjectRights />` preset which ships sensible defaults.");let[c,w]=useState((p==null?void 0:p.requestType)||""),[A,j]=useState(((Y=p==null?void 0:p.dataSubject)==null?void 0:Y.fullName)||""),[S,E]=useState(((H=p==null?void 0:p.dataSubject)==null?void 0:H.email)||""),[I,B]=useState(((L=p==null?void 0:p.dataSubject)==null?void 0:L.phone)||""),[O,z]=useState(((U=p==null?void 0:p.dataSubject)==null?void 0:U.identifierType)||((W=T[0])==null?void 0:W.id)||""),[x,M]=useState(((J=p==null?void 0:p.dataSubject)==null?void 0:J.identifierValue)||""),[l,D]=useState((p==null?void 0:p.additionalInfo)||{}),[nr,k]=useState(false),[d,Z]=useState({}),dr=()=>{var i;w(""),j(""),E(""),B(""),z(((i=T[0])==null?void 0:i.id)||""),M(""),D({}),k(false),Z({}),$==null||$();},a$3=y.find(i=>i.id===c),pr=i=>{w(i.target.value),D({});},h=(i,b$1)=>{D(_=>b(a$1({},_),{[i]:b$1}));},ar=()=>{let i={};return A.trim()||(i.fullName="Full name is required"),S.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(S)||(i.email="Email is invalid"):i.email="Email is required",c||(i.requestType="Please select a request type"),P&&!x.trim()&&(i.identifierValue="Identifier value is required"),a$3!=null&&a$3.requiresAdditionalInfo&&a$3.additionalFields&&a$3.additionalFields.forEach(b=>{b.required&&!l[b.id]&&(i[`additional_${b.id}`]=`${b.label} is required`);}),Z(i),i},ur=i=>{i.preventDefault();let b=ar();if(Object.keys(b).length>0){F==null||F(b);return}let _=Object.keys(l).length>0?Object.fromEntries(Object.entries(l).map(([u,m])=>[u,typeof m=="string"?a$2(m):m])):void 0,R={requestType:c,dataSubject:{fullName:a$2(A),email:a$2(S),phone:I?a$2(I):void 0,identifierType:O,identifierValue:a$2(x)},additionalInfo:_,submittedAt:Date.now()};V(R),er&&k(true);},G=`ndpr-dsr-form__button ndpr-dsr-form__button--primary ${ir}`.trim(),br="ndpr-dsr-form__button ndpr-dsr-form__button--secondary";return nr?jsxs("div",{"data-ndpr-component":"dsr-request-form","data-ndpr-state":"submitted",className:a(`ndpr-dsr-form__success${q?` ${q}`:""}`,r==null?void 0:r.successMessage,e),"aria-live":"polite",children:[jsx("h2",{className:a("ndpr-dsr-form__success-title",r==null?void 0:r.title,e),children:"Request Submitted"}),jsx("p",{className:a("ndpr-dsr-form__success-body",r==null?void 0:r.description,e),children:tr}),jsx("button",{onClick:()=>k(false),className:a(G,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),e),children:"Submit Another Request"})]}):jsxs("div",{"data-ndpr-component":"dsr-request-form",className:a(`ndpr-dsr-form${q?` ${q}`:""}`,r==null?void 0:r.root,e),children:[jsx("h2",{className:a("ndpr-dsr-form__title",r==null?void 0:r.title,e),children:N}),jsx("p",{className:a("ndpr-dsr-form__description",r==null?void 0:r.description,e),children:s}),jsx("form",{onSubmit:ur,className:a("",r==null?void 0:r.form,e),children:jsxs("div",{className:a("ndpr-dsr-form__sections",r==null?void 0:r.fieldGroup,e),children:[jsxs("div",{children:[jsx("h3",{className:e?"":"ndpr-form-section__heading",children:"Personal Information"}),jsxs("div",{className:e?"":"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"fullName",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:[v.name||"Full Name"," ",jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"text",id:"fullName",value:A,onChange:i=>j(i.target.value),className:a("ndpr-form-field__input",r==null?void 0:r.input,e),required:true,"aria-required":"true","aria-invalid":!!d.fullName,"aria-describedby":d.fullName?"fullName-error":void 0}),d.fullName&&jsx("p",{id:"fullName-error",role:"alert",className:e?"":"ndpr-form-field__error",children:d.fullName})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"email",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:[v.email||"Email Address"," ",jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"email",id:"email",value:S,onChange:i=>E(i.target.value),className:a("ndpr-form-field__input",r==null?void 0:r.input,e),required:true,"aria-required":"true","aria-invalid":!!d.email,"aria-describedby":d.email?"email-error":void 0}),d.email&&jsx("p",{id:"email-error",role:"alert",className:e?"":"ndpr-form-field__error",children:d.email})]}),or&&jsxs("div",{children:[jsx("label",{htmlFor:"phone",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:"Phone Number (Optional)"}),jsx("input",{type:"tel",id:"phone",value:I,onChange:i=>B(i.target.value),className:a("ndpr-form-field__input",r==null?void 0:r.input,e)})]})]})]}),jsxs("div",{children:[jsx("h3",{className:e?"":"ndpr-form-section__heading",children:"Request Details"}),jsxs("div",{className:e?"":"ndpr-form-field",children:[jsxs("label",{htmlFor:"requestType",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:[v.requestType||"Request Type"," ",jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsxs("select",{id:"requestType",value:c,onChange:pr,className:a("ndpr-form-field__select",r==null?void 0:r.select,e),required:true,"aria-required":"true","aria-invalid":!!d.requestType,"aria-describedby":d.requestType?"requestType-error":void 0,children:[jsx("option",{value:"",children:"Select a request type"}),y.map(i=>jsx("option",{value:i.id,children:i.name},i.id))]}),d.requestType&&jsx("p",{id:"requestType-error",role:"alert",className:e?"":"ndpr-form-field__error",children:d.requestType})]}),a$3&&jsxs("div",{className:e?"":"ndpr-dsr-form__type-info",children:[jsx("p",{children:a$3.description}),jsxs("p",{children:["Estimated completion time: ",a$3.estimatedCompletionTime," ",a$3.estimatedCompletionTime===1?"day":"days"]})]}),jsxs("div",{className:e?"":"ndpr-form-field",children:[jsx("label",{htmlFor:"requestDescription",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:v.description||"Additional Information"}),jsx("textarea",{id:"requestDescription",className:a("ndpr-form-field__textarea",r==null?void 0:r.textarea,e),rows:4,placeholder:"Please provide any additional details that might help us process your request"})]})]}),P&&jsxs("div",{children:[jsx("h3",{className:e?"":"ndpr-form-section__heading",children:"Identity Verification"}),jsx("p",{className:e?"":"ndpr-form-section__hint",children:"To protect your privacy, we need to verify your identity before processing your request."}),jsxs("div",{className:e?"":"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"identifierType",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:["Identifier Type ",jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsx("select",{id:"identifierType",value:O,onChange:i=>z(i.target.value),className:a("ndpr-form-field__select",r==null?void 0:r.select,e),required:true,"aria-required":"true",children:T.map(i=>jsx("option",{value:i.id,children:i.label},i.id))})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"identifierValue",className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:["Identifier Value ",jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),jsx("input",{type:"text",id:"identifierValue",value:x,onChange:i=>M(i.target.value),className:a("ndpr-form-field__input",r==null?void 0:r.input,e),required:true,"aria-required":"true","aria-invalid":!!d.identifierValue,"aria-describedby":d.identifierValue?"identifierValue-error":void 0}),d.identifierValue&&jsx("p",{id:"identifierValue-error",role:"alert",className:e?"":"ndpr-form-field__error",children:d.identifierValue})]})]})]}),(a$3==null?void 0:a$3.requiresAdditionalInfo)&&a$3.additionalFields&&a$3.additionalFields.length>0&&jsxs("div",{children:[jsx("h3",{className:e?"":"ndpr-form-section__heading",children:"Additional Information"}),jsx("div",{className:e?"":"ndpr-form-section",children:a$3.additionalFields.map(i=>{var b,_,R;return jsxs("div",{children:[jsxs("label",{htmlFor:i.id,className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:[i.label," ",i.required&&jsx("span",{className:e?"":"ndpr-form-field__required",children:"*"})]}),i.type==="text"&&jsx("input",{type:"text",id:i.id,value:String((b=l[i.id])!=null?b:""),onChange:u=>h(i.id,u.target.value),placeholder:i.placeholder,className:a("ndpr-form-field__input",r==null?void 0:r.input,e),required:i.required,"aria-required":i.required||void 0,"aria-invalid":!!d[`additional_${i.id}`],"aria-describedby":d[`additional_${i.id}`]?`additional-${i.id}-error`:void 0}),i.type==="textarea"&&jsx("textarea",{id:i.id,value:String((_=l[i.id])!=null?_:""),onChange:u=>h(i.id,u.target.value),placeholder:i.placeholder,className:a("ndpr-form-field__textarea",r==null?void 0:r.textarea,e),rows:4,required:i.required,"aria-required":i.required||void 0,"aria-invalid":!!d[`additional_${i.id}`],"aria-describedby":d[`additional_${i.id}`]?`additional-${i.id}-error`:void 0}),i.type==="select"&&i.options&&jsxs("select",{id:i.id,value:String((R=l[i.id])!=null?R:""),onChange:u=>h(i.id,u.target.value),className:a("ndpr-form-field__select",r==null?void 0:r.select,e),required:i.required,"aria-required":i.required||void 0,"aria-invalid":!!d[`additional_${i.id}`],"aria-describedby":d[`additional_${i.id}`]?`additional-${i.id}-error`:void 0,children:[jsx("option",{value:"",children:i.placeholder||"Select an option"}),i.options.map(u=>jsx("option",{value:u,children:u},u))]}),i.type==="checkbox"&&jsxs("div",{className:e?"":"ndpr-form-field__checkbox-row",children:[jsx("input",{type:"checkbox",id:i.id,checked:!!l[i.id],onChange:u=>h(i.id,u.target.checked),className:e?"":"ndpr-form-field__checkbox",required:i.required,"aria-required":i.required||void 0,"aria-invalid":!!d[`additional_${i.id}`],"aria-describedby":d[`additional_${i.id}`]?`additional-${i.id}-error`:void 0}),jsx("label",{htmlFor:i.id,className:a("ndpr-form-field__label",r==null?void 0:r.label,e),children:i.placeholder||i.label})]}),i.type==="file"&&jsx("input",{type:"file",id:i.id,onChange:u=>{var K;let m=(K=u.target.files)==null?void 0:K[0];m&&h(i.id,m.name);},className:a("ndpr-form-field__input",r==null?void 0:r.input,e),required:i.required,"aria-required":i.required||void 0,"aria-invalid":!!d[`additional_${i.id}`],"aria-describedby":d[`additional_${i.id}`]?`additional-${i.id}-error`:void 0}),d[`additional_${i.id}`]&&jsx("p",{id:`additional-${i.id}-error`,role:"alert",className:e?"":"ndpr-form-field__error",children:d[`additional_${i.id}`]})]},i.id)})})]}),jsxs("div",{className:e?"":"ndpr-dsr-form__notice",children:[jsx("h3",{className:e?"":"ndpr-dsr-form__notice-title",children:"Privacy Notice"}),jsx("p",{className:e?"":"ndpr-dsr-form__notice-body",children:"The information you provide in this form will be used solely for the purpose of processing your data subject request. We will retain this information for as long as necessary to fulfill your request and to comply with our legal obligations. For more information, please refer to our Privacy Policy."})]}),jsxs("div",{className:e?"":"ndpr-dsr-form__actions",children:[C&&(r==null?void 0:r.loadingOverlay)&&jsx("div",{className:r.loadingOverlay}),jsx("button",{type:"submit",disabled:C,className:a(G,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),e),children:C?"Submitting...":v.submit||rr}),jsx("button",{type:"button",onClick:dr,className:a(br,void 0,e),children:"Reset"})]})]})})]})};
|
|
2
|
+
export{gr as a};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkLVGT3DLT_js=require('./chunk-LVGT3DLT.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var ye=({sections:_=chunkLVGT3DLT_js.c,variables:U=chunkLVGT3DLT_js.d,onGenerate:L,title:M="NDPA Privacy Policy Generator",description:V="Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 24.",className:K="",buttonClassName:T="",generateButtonText:Q="Generate Policy",showPreview:B=true,allowEditing:N=true,classNames:r,unstyled:x=false})=>{let P=react.useId(),[A,n]=react.useState(_),[i,s]=react.useState(U),[m,$]=react.useState("sections"),[S,X]=react.useState(""),[F,R]=react.useState(""),[J,Z]=react.useState(false),[v,I]=react.useState({});react.useEffect(()=>{n(_);},[_]),react.useEffect(()=>{s(U);},[U]);let G=l=>{n(c=>c.map(a=>a.id===l?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},a),{included:!a.included}):a));},W=(l,c)=>{s(a=>a.map(b=>b.id===l?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},b),{value:c}):b)),v[l]&&I(a=>{let b=chunkRFPLZDIO_js.a({},a);return delete b[l],b});},j=()=>{let l={},c=true;return i.forEach(a=>{a.required&&!a.value&&(l[a.id]=`${a.name} is required`,c=false);}),I(l),c},ee=()=>{if(!j()){$("variables");return}let l=A.filter(b=>b.included),c=Object.fromEntries(i.map(b=>[b.name,b.value])),a="";l.forEach(b=>{a+=`## ${b.title}
|
|
2
2
|
|
|
3
|
-
`,a+=
|
|
3
|
+
`,a+=chunkLVGT3DLT_js.b(b.template,c),a+=`
|
|
4
4
|
|
|
5
|
-
`;}),X(a),R(a),Z(true),$("preview");},h=()=>{L({sections:A,variables:i,content:N?F:S});},g=()=>jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-generator",className:
|
|
6
|
-
`).map((c,a)=>c.startsWith("## ")?jsxRuntime.jsx("h3",{className:"text-xl font-bold mt-6 mb-3",children:c.substring(3)},a):c.startsWith("### ")?jsxRuntime.jsx("h4",{className:"text-lg font-bold mt-4 mb-2",children:c.substring(4)},a):c===""?jsxRuntime.jsx("br",{},a):jsxRuntime.jsx("p",{className:"mb-2",children:c},a))})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>$("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 ${T}`,children:"Back to Variables"}),jsxRuntime.jsx("button",{onClick:h,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${T}`,children:"Save Policy"})]})]})},q=()=>{switch(m){case "sections":return g();case "variables":return w();case "preview":return C();default:return g()}};return jsxRuntime.jsxs("div",{className:
|
|
7
|
-
`),g=[];return h.forEach(w=>{if(w.startsWith("## ")){let C=w.substring(3).trim(),q=`${m}-${C.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;g.push({id:q,title:C,level:2});}else if(w.startsWith("### ")){let C=w.substring(4).trim(),q=`${m}-${C.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;g.push({id:q,title:C,level:3});}}),g})(),I=h=>{if(M)M(h);else if(h==="markdown"){let g=document.createElement("a"),w=new Blob([_],{type:"text/markdown"});g.href=URL.createObjectURL(w),g.download=`privacy-policy-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(g),g.click(),document.body.removeChild(g);}},G=()=>!x||v.length===0?null:jsxRuntime.jsxs("nav",{"aria-label":"Table of contents",className:"ndpr-panel",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Table of Contents"}),jsxRuntime.jsx("ul",{className:"space-y-1",children:v.map((h,g)=>jsxRuntime.jsx("li",{style:{marginLeft:`${(h.level-2)*1.5}rem`},children:jsxRuntime.jsx("a",{href:`#${h.id}`,className:"ndpr-text-primary hover:underline",children:h.title})},g))})]}),W=()=>P?jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-preview",className:"mb-6",children:[jsxRuntime.jsx("h1",{className:"ndpr-card__title",children:A?`${A} Privacy Policy`:"Privacy Policy"}),jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:["Last Updated: ",n?n.toLocaleDateString():"N/A"]})]}):null,j=()=>jsxRuntime.jsx("div",{className:
|
|
8
|
-
`).map((h,g)=>{if(h.startsWith("## ")){let w=h.substring(3).trim(),C=`${m}-${w.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return jsxRuntime.jsx("h3",{id:C,className:
|
|
5
|
+
`;}),X(a),R(a),Z(true),$("preview");},h=()=>{L({sections:A,variables:i,content:N?F:S});},g=()=>jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-generator",className:chunkAME4HJR4_js.a("ndpr-form-section",r==null?void 0:r.sectionList,x),role:"group","aria-labelledby":`${P}-sections-heading`,children:[jsxRuntime.jsx("h3",{id:`${P}-sections-heading`,className:"text-lg font-medium mb-4",children:"Select Policy Sections"}),A.map(l=>{let c=`${P}-section-${l.id}`,a=l.description?`${P}-section-desc-${l.id}`:void 0;return jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("border border-gray-200 dark:border-gray-700 rounded-md p-4",r==null?void 0:r.sectionItem,x),children:jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:c,type:"checkbox",checked:l.included,onChange:()=>G(l.id),disabled:l.required,"aria-describedby":a,className:chunkAME4HJR4_js.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,x)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:c,className:"font-medium ndpr-text-foreground",children:[l.title," ",l.required&&jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"}),l.required&&jsxRuntime.jsx("span",{className:"sr-only",children:" (required)"})]}),l.description&&jsxRuntime.jsx("p",{id:a,className:"ndpr-text-muted mt-1",children:l.description})]})]})},l.id)}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{onClick:()=>$("variables"),className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),x),children:"Next: Fill Variables"})})]}),w=()=>{let l={};return i.forEach(c=>{let a=c.id.split(".")[0];l[a]||(l[a]=[]),l[a].push(c);}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("",r==null?void 0:r.form,x),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Fill Policy Variables"}),jsxRuntime.jsx("div",{className:"ndpr-form-section",children:Object.entries(l).map(([c,a])=>{let b=A.find(e=>e.id===c);return b&&!b.included?null:jsxRuntime.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsxRuntime.jsx("h4",{className:"font-medium text-lg mb-3",children:b?b.title:"General Information"}),jsxRuntime.jsx("div",{className:"ndpr-form-section",children:a.map(e=>{let y=`${P}-var-${e.id}`,u=e.description?`${P}-var-desc-${e.id}`:void 0,z=v[e.id]?`${P}-var-err-${e.id}`:void 0,O=[u,z].filter(Boolean).join(" ")||void 0;return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:y,className:"ndpr-form-field__label",children:[e.name," ",e.required&&jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),e.description&&jsxRuntime.jsx("p",{id:u,className:"text-xs ndpr-text-muted mb-2",children:e.description}),e.inputType==="textarea"?jsxRuntime.jsx("textarea",{id:y,value:e.value,onChange:E=>W(e.id,E.target.value),rows:4,className:chunkAME4HJR4_js.a(`w-full px-3 py-2 border ${v[e.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,x),required:e.required,"aria-required":e.required||void 0,"aria-describedby":O,"aria-invalid":v[e.id]?true:void 0}):e.inputType==="select"&&e.options?jsxRuntime.jsxs("select",{id:y,value:e.value,onChange:E=>W(e.id,E.target.value),className:chunkAME4HJR4_js.a(`w-full px-3 py-2 border ${v[e.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,x),required:e.required,"aria-required":e.required||void 0,"aria-describedby":O,"aria-invalid":v[e.id]?true:void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select an option"}),e.options.map(E=>jsxRuntime.jsx("option",{value:E,children:E},E))]}):jsxRuntime.jsx("input",{id:y,type:e.inputType,value:e.value,onChange:E=>W(e.id,E.target.value),className:chunkAME4HJR4_js.a(`w-full px-3 py-2 border ${v[e.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,x),required:e.required,"aria-required":e.required||void 0,"aria-describedby":O,"aria-invalid":v[e.id]?true:void 0}),v[e.id]&&jsxRuntime.jsx("p",{id:z,role:"alert",className:"mt-1 text-sm ndpr-text-destructive dark:text-red-500",children:v[e.id]})]},e.id)})})]},c)})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>$("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 ${T}`,children:"Back to Sections"}),jsxRuntime.jsx("button",{onClick:ee,className:chunkAME4HJR4_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),x),children:Q})]})]})},C=()=>{let l=`${P}-policy-content`;return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Preview Generated Policy"}),N?jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("label",{htmlFor:l,className:"ndpr-form-field__label",children:"Edit Policy Content"}),jsxRuntime.jsx("textarea",{id:l,value:F,onChange:c=>R(c.target.value),rows:20,className:"ndpr-form-field__input ndpr-form-field__input--mono"})]}):jsxRuntime.jsx("div",{className:"ndpr-panel","aria-live":"polite",children:jsxRuntime.jsx("div",{className:"prose dark:prose-invert max-w-none",children:S.split(`
|
|
6
|
+
`).map((c,a)=>c.startsWith("## ")?jsxRuntime.jsx("h3",{className:"text-xl font-bold mt-6 mb-3",children:c.substring(3)},a):c.startsWith("### ")?jsxRuntime.jsx("h4",{className:"text-lg font-bold mt-4 mb-2",children:c.substring(4)},a):c===""?jsxRuntime.jsx("br",{},a):jsxRuntime.jsx("p",{className:"mb-2",children:c},a))})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>$("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 ${T}`,children:"Back to Variables"}),jsxRuntime.jsx("button",{onClick:h,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${T}`,children:"Save Policy"})]})]})},q=()=>{switch(m){case "sections":return g();case "variables":return w();case "preview":return C();default:return g()}};return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${K}`,r==null?void 0:r.root,x),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mb-6",r==null?void 0:r.header,x),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.title,x),children:M}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-card__subtitle",r==null?void 0:r.description,x),children:V})]}),jsxRuntime.jsx("nav",{"aria-label":"Policy generation steps",className:"mb-8",children:jsxRuntime.jsxs("ol",{className:"flex items-center w-full",children:[jsxRuntime.jsxs("li",{className:`flex w-full items-center ${m==="sections"?"ndpr-text-primary":"ndpr-card__subtitle"} 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:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${m==="sections"?"ndpr-alert ndpr-alert--info":"ndpr-panel"} rounded-full shrink-0`,"aria-current":m==="sections"?"step":void 0,children:"1"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Sections"}),jsxRuntime.jsx("span",{className:"sr-only",children:m==="sections"?" (current step)":""})]}),jsxRuntime.jsxs("li",{className:`flex w-full items-center ${m==="variables"?"ndpr-text-primary":"ndpr-card__subtitle"} 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:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${m==="variables"?"ndpr-alert ndpr-alert--info":"ndpr-panel"} rounded-full shrink-0`,"aria-current":m==="variables"?"step":void 0,children:"2"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Variables"}),jsxRuntime.jsx("span",{className:"sr-only",children:m==="variables"?" (current step)":""})]}),jsxRuntime.jsxs("li",{className:`flex items-center ${m==="preview"?"ndpr-text-primary":"ndpr-card__subtitle"}`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${m==="preview"?"ndpr-alert ndpr-alert--info":"ndpr-panel"} rounded-full shrink-0`,"aria-current":m==="preview"?"step":void 0,children:"3"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Preview"}),jsxRuntime.jsx("span",{className:"sr-only",children:m==="preview"?" (current step)":""})]})]})}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--info",r==null?void 0:r.complianceNotice,x),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Compliance Notice"}),jsxRuntime.jsx("p",{className:"ndpr-text-info 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."})]}),q()]})};var _e=({content:_,sections:U,variables:L,onExport:M,onEdit:V,title:K="Privacy Policy Preview",description:T="Preview your NDPA-compliant privacy policy before exporting.",className:Q="",buttonClassName:B="",showExportOptions:N=true,showEditButton:r=true,showTableOfContents:x=true,showMetadata:P=true,organizationName:A,lastUpdated:n,classNames:i,unstyled:s=false})=>{let m=react.useId(),[$,S]=react.useState("preview"),X=`${m}-tab-preview`,F=`${m}-tab-markdown`,R=`${m}-panel-preview`,J=`${m}-panel-markdown`,v=(()=>{let h=_.split(`
|
|
7
|
+
`),g=[];return h.forEach(w=>{if(w.startsWith("## ")){let C=w.substring(3).trim(),q=`${m}-${C.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;g.push({id:q,title:C,level:2});}else if(w.startsWith("### ")){let C=w.substring(4).trim(),q=`${m}-${C.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;g.push({id:q,title:C,level:3});}}),g})(),I=h=>{if(M)M(h);else if(h==="markdown"){let g=document.createElement("a"),w=new Blob([_],{type:"text/markdown"});g.href=URL.createObjectURL(w),g.download=`privacy-policy-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(g),g.click(),document.body.removeChild(g);}},G=()=>!x||v.length===0?null:jsxRuntime.jsxs("nav",{"aria-label":"Table of contents",className:"ndpr-panel",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Table of Contents"}),jsxRuntime.jsx("ul",{className:"space-y-1",children:v.map((h,g)=>jsxRuntime.jsx("li",{style:{marginLeft:`${(h.level-2)*1.5}rem`},children:jsxRuntime.jsx("a",{href:`#${h.id}`,className:"ndpr-text-primary hover:underline",children:h.title})},g))})]}),W=()=>P?jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-preview",className:"mb-6",children:[jsxRuntime.jsx("h1",{className:"ndpr-card__title",children:A?`${A} Privacy Policy`:"Privacy Policy"}),jsxRuntime.jsxs("p",{className:"ndpr-form-field__hint",children:["Last Updated: ",n?n.toLocaleDateString():"N/A"]})]}):null,j=()=>jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("prose dark:prose-invert max-w-none",i==null?void 0:i.sectionContent,s),children:_.split(`
|
|
8
|
+
`).map((h,g)=>{if(h.startsWith("## ")){let w=h.substring(3).trim(),C=`${m}-${w.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return jsxRuntime.jsx("h3",{id:C,className:chunkAME4HJR4_js.a("text-xl font-bold mt-6 mb-3",i==null?void 0:i.sectionTitle,s),children:w},g)}else if(h.startsWith("### ")){let w=h.substring(4).trim(),C=`${m}-${w.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return jsxRuntime.jsx("h4",{id:C,className:chunkAME4HJR4_js.a("text-lg font-bold mt-4 mb-2",i==null?void 0:i.sectionTitle,s),children:w},g)}else return h===""?jsxRuntime.jsx("br",{},g):jsxRuntime.jsx("p",{className:"mb-2",children:h},g)})}),ee=()=>N?jsxRuntime.jsxs("div",{className:"mt-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Export Options"}),jsxRuntime.jsxs("div",{className:"ndpr-card__footer",children:[jsxRuntime.jsx("button",{onClick:()=>I("pdf"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${B}`,children:"Export as PDF"}),jsxRuntime.jsx("button",{onClick:()=>I("docx"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${B}`,children:"Export as DOCX"}),jsxRuntime.jsx("button",{onClick:()=>I("html"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${B}`,children:"Export as HTML"}),jsxRuntime.jsx("button",{onClick:()=>I("markdown"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${B}`,children:"Export as Markdown"})]})]}):null;return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,i==null?void 0:i.root,s),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex justify-between items-start mb-6",i==null?void 0:i.header,s),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",i==null?void 0:i.title,s),children:K}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-card__subtitle",i==null?void 0:i.description,s),children:T})]}),r&&V&&jsxRuntime.jsx("button",{onClick:V,className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${B}`,children:"Edit Policy"})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--info",i==null?void 0:i.complianceNotice,s),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Compliance Notice"}),jsxRuntime.jsx("p",{className:"ndpr-text-info 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."})]}),jsxRuntime.jsx("div",{className:"mb-6 border-b border-gray-200 dark:border-gray-700",children:jsxRuntime.jsxs("div",{role:"tablist","aria-label":"Policy view options",className:"flex flex-wrap -mb-px",children:[jsxRuntime.jsx("div",{className:"mr-2",children:jsxRuntime.jsx("button",{role:"tab",id:X,"aria-selected":$==="preview","aria-controls":R,onClick:()=>S("preview"),className:`inline-block p-4 ${$==="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"})}),jsxRuntime.jsx("div",{className:"mr-2",children:jsxRuntime.jsx("button",{role:"tab",id:F,"aria-selected":$==="markdown","aria-controls":J,onClick:()=>S("markdown"),className:`inline-block p-4 ${$==="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"})})]})}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 p-4 rounded-md",i==null?void 0:i.content,s),children:$==="preview"?jsxRuntime.jsxs("div",{role:"tabpanel",id:R,"aria-labelledby":X,"aria-live":"polite",children:[W(),G(),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("bg-gray-50 dark:bg-gray-700 p-6 rounded-md",i==null?void 0:i.section,s),children:j()})]}):jsxRuntime.jsx("div",{role:"tabpanel",id:J,"aria-labelledby":F,children:jsxRuntime.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:_})})}),ee()]})};var Ae=({content:_,title:U="Privacy Policy",organizationName:L,lastUpdated:M,onExportComplete:V,componentTitle:K="Export Privacy Policy",description:T="Export your NDPA-compliant privacy policy in various formats.",className:Q="",buttonClassName:B="",showExportHistory:N=true,includeComplianceNotice:r=true,includeLogo:x=false,logoUrl:P,customStyles:A,classNames:n,unstyled:i=false})=>{let s=react.useId(),[m,$]=react.useState([]),[S,X]=react.useState("pdf"),[F,R]=react.useState(false),[J,Z]=react.useState(null),[v,I]=react.useState(""),[G,W]=react.useState(""),[j,ee]=react.useState(""),[h,g]=react.useState(false),w=e=>{let y=new Date().toISOString().split("T")[0];return `${L?L.toLowerCase().replace(/[^a-z0-9]+/g,"-"):"privacy-policy"}-privacy-policy-${y}.${e.toLowerCase()}`},C=e=>v?v.endsWith(`.${e.toLowerCase()}`)?v:`${v}.${e.toLowerCase()}`:w(e),q=()=>{let e=L?`${L} ${U}`:U,y=M?M.toLocaleDateString():"N/A",u=`<!DOCTYPE html>
|
|
9
9
|
<html lang="en">
|
|
10
10
|
<head>
|
|
11
11
|
<meta charset="UTF-8">
|
|
@@ -90,5 +90,4 @@
|
|
|
90
90
|
<p>© ${new Date().getFullYear()} ${L||"Company"}. All rights reserved.</p>
|
|
91
91
|
</div>
|
|
92
92
|
</body>
|
|
93
|
-
</html>`,u},l=()=>
|
|
94
|
-
//# sourceMappingURL=chunk-LWXZMKC2.js.map
|
|
93
|
+
</html>`,u},l=()=>chunkRFPLZDIO_js.d(null,null,function*(){R(true),Z(null);try{let e=S.toLowerCase(),y="",u;switch(e){case "pdf":let te=q();u=new Blob([te],{type:"text/html"}),y=URL.createObjectURL(u);break;case "docx":u=new Blob([_],{type:"text/plain"}),y=URL.createObjectURL(u);break;case "html":let pe=q();u=new Blob([pe],{type:"text/html"}),y=URL.createObjectURL(u);break;default:u=new Blob([_],{type:"text/markdown"}),y=URL.createObjectURL(u);break}let z=C(e),O=document.createElement("a");O.href=y,O.download=z,document.body.appendChild(O),O.click(),document.body.removeChild(O);let E={id:`export_${Date.now()}`,format:e,timestamp:Date.now(),url:y,filename:z};$(te=>[E,...te]),V&&V(e,y);}catch(e){console.error("[ndpr-toolkit] Export error:",e),Z("An error occurred during export. Please try again.");}finally{R(false);}}),c=()=>{let e=[{value:"pdf",label:"PDF Document (.pdf)"},{value:"docx",label:"Word Document (.docx)"},{value:"html",label:"Web Page (.html)"},{value:"markdown",label:"Markdown (.md)"}],y=`${s}-export-format`;return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-exporter",className:chunkAME4HJR4_js.a("mb-6",n==null?void 0:n.formatSelector,i),children:[jsxRuntime.jsx("label",{htmlFor:y,className:"ndpr-form-field__label",children:"Export Format"}),jsxRuntime.jsx("select",{id:y,value:S,onChange:u=>X(u.target.value),className:chunkAME4HJR4_js.a("ndpr-form-field__input",n==null?void 0:n.formatOption,i),children:e.map(u=>jsxRuntime.jsx("option",{value:u.value,children:u.label},u.value))})]})},a=()=>h?jsxRuntime.jsxs("div",{className:"mb-6 space-y-4 border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsx("h3",{className:"text-md font-medium",children:"Advanced Export Options"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>g(false),className:"ndpr-text-primary text-sm",children:"Hide Advanced Options"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${s}-custom-filename`,className:"ndpr-form-field__label",children:"Custom Filename"}),jsxRuntime.jsx("input",{type:"text",id:`${s}-custom-filename`,value:v,onChange:e=>I(e.target.value),placeholder:w(S),"aria-describedby":`${s}-custom-filename-desc`,className:"ndpr-form-field__input"}),jsxRuntime.jsx("p",{id:`${s}-custom-filename-desc`,className:"ndpr-form-field__hint",children:"Leave blank to use the default filename format."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${s}-custom-header`,className:"ndpr-form-field__label",children:"Custom Header HTML (for HTML/PDF exports)"}),jsxRuntime.jsx("textarea",{id:`${s}-custom-header`,value:G,onChange:e=>W(e.target.value),rows:3,placeholder:"<div>Custom header content</div>",className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${s}-custom-footer`,className:"ndpr-form-field__label",children:"Custom Footer HTML (for HTML/PDF exports)"}),jsxRuntime.jsx("textarea",{id:`${s}-custom-footer`,value:j,onChange:e=>ee(e.target.value),rows:3,placeholder:"<div>Custom footer content</div>",className:"ndpr-form-field__input"})]}),jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:`${s}-include-compliance-notice`,type:"checkbox",checked:r,onChange:e=>g(e.target.checked),"aria-describedby":`${s}-compliance-notice-desc`,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"})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsx("label",{htmlFor:`${s}-include-compliance-notice`,className:"font-medium ndpr-text-foreground",children:"Include NDPA Compliance Notice"}),jsxRuntime.jsx("p",{id:`${s}-compliance-notice-desc`,className:"ndpr-card__subtitle",children:"Adds a notice explaining that this policy complies with NDPA requirements."})]})]})]}):jsxRuntime.jsx("button",{type:"button",onClick:()=>g(true),className:"ndpr-text-primary text-sm mb-6",children:"Show Advanced Options"}),b=()=>!N||m.length===0?null:jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mt-6",n==null?void 0:n.preview,i),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Export History"}),jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 rounded-md overflow-hidden",children:jsxRuntime.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-600",children:[jsxRuntime.jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Date"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Format"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Filename"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium ndpr-text-muted uppercase tracking-wider",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-700 divide-y divide-gray-200 dark:divide-gray-600",children:m.map(e=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:new Date(e.timestamp).toLocaleString()}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:e.format.toUpperCase()}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:e.filename}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:jsxRuntime.jsx("a",{href:e.url,download:e.filename,className:"ndpr-text-primary hover:text-[rgb(var(--ndpr-primary-hover))] dark:hover:text-[rgb(var(--ndpr-primary-hover))] mr-4",children:"Download"})})]},e.id))})]})})]});return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,n==null?void 0:n.root,i),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mb-6",n==null?void 0:n.header,i),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",n==null?void 0:n.title,i),children:K}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-card__subtitle",n==null?void 0:n.description,i),children:T})]}),c(),a(),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("button",{onClick:l,disabled:F,className:chunkAME4HJR4_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 ${B} ${F?"opacity-70 cursor-not-allowed":""}`,(n==null?void 0:n.primaryButton)||(n==null?void 0:n.exportButton),i),children:F?"Exporting...":`Export as ${S.toUpperCase()}`}),J&&jsxRuntime.jsx("p",{className:"mt-2 text-sm ndpr-text-destructive dark:text-red-500",children:J})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-alert ndpr-alert--info",n==null?void 0:n.complianceNotice,i),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"Export Tips"}),jsxRuntime.jsxs("ul",{className:"ndpr-text-info text-sm list-disc list-inside space-y-1",children:[jsxRuntime.jsx("li",{children:"PDF format is recommended for printing or sharing with stakeholders."}),jsxRuntime.jsx("li",{children:"HTML format is ideal for publishing on your website."}),jsxRuntime.jsx("li",{children:"DOCX format allows for further editing in Microsoft Word or similar applications."}),jsxRuntime.jsx("li",{children:"Markdown format is useful for version control systems or technical documentation."})]})]}),b()]})};exports.a=ye;exports.b=_e;exports.c=Ae;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-IZCWCE7W.mjs.map
|
|
1
|
+
import {a}from'./chunk-SFGW37LE.mjs';import {useState,useCallback,useEffect}from'react';import {jsx,Fragment}from'react/jsx-runtime';var G=({settings:k,storageOptions:O={},onLoad:i,onSave:p,autoSave:v=true,autoLoad:w=true,classNames:u,unstyled:h,children:c})=>{let{storageKey:o="ndpr_consent",storageType:n="localStorage",cookieOptions:l={}}=O,[r,$]=useState(false),S=useCallback(()=>{let e=null;try{if(n==="localStorage"&&typeof window!="undefined"){let t=localStorage.getItem(o);t&&(e=JSON.parse(t));}else if(n==="sessionStorage"&&typeof window!="undefined"){let t=sessionStorage.getItem(o);t&&(e=JSON.parse(t));}else if(n==="cookie"&&typeof document!="undefined"){let s=document.cookie.split(";").find(a=>a.trim().startsWith(`${o}=`));if(s){let a=s.split("=")[1];e=JSON.parse(decodeURIComponent(a));}}$(!0),i&&i(e);}catch(t){console.error("[ndpr-toolkit] Error loading consent settings:",t),$(true),i&&i(null);}return e},[n,o,i]),m=useCallback(e=>{try{let t=JSON.stringify(e);if(n==="localStorage"&&typeof window!="undefined")localStorage.setItem(o,t);else if(n==="sessionStorage"&&typeof window!="undefined")sessionStorage.setItem(o,t);else if(n==="cookie"&&typeof document!="undefined"){let{domain:s,path:a="/",expires:N=365,secure:D=!0,sameSite:E="Lax"}=l,C=new Date;C.setDate(C.getDate()+N);let g=`${o}=${encodeURIComponent(t)}; path=${a}; expires=${C.toUTCString()}`;s&&(g+=`; domain=${s}`),D&&(g+="; secure"),g+=`; samesite=${E}`,document.cookie=g;}return p&&p(e),!0}catch(t){return console.error("[ndpr-toolkit] Error saving consent settings:",t),false}},[n,o,l,p]),x=useCallback(()=>{try{if(n==="localStorage"&&typeof window!="undefined")localStorage.removeItem(o);else if(n==="sessionStorage"&&typeof window!="undefined")sessionStorage.removeItem(o);else if(n==="cookie"&&typeof document!="undefined"){let{domain:e,path:t="/"}=l,s=`${o}=; path=${t}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;e&&(s+=`; domain=${e}`),document.cookie=s;}return !0}catch(e){return console.error("[ndpr-toolkit] Error clearing consent settings:",e),false}},[n,o,l]);useEffect(()=>{w&&!r&&S();},[w,r,S]),useEffect(()=>{v&&r&&m(k);},[k,v,r,m]);let d=a("",u==null?void 0:u.root,h);if(typeof c=="function"){let e=c({loadSettings:S,saveSettings:m,clearSettings:x,loaded:r});return d?jsx("div",{className:d,children:e}):jsx(Fragment,{children:e})}return d?jsx("div",{className:d,children:c}):jsx(Fragment,{children:c})};export{G as a};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
var l=["consent","contract","legal_obligation","vital_interests","public_interest","legitimate_interests"];function h(e){let s=[];return (!e.id||e.id.trim()==="")&&s.push("Record ID is required."),(!e.name||e.name.trim()==="")&&s.push("Processing activity name is required."),(!e.description||e.description.trim()==="")&&s.push("Processing description is required."),e.controllerDetails?((!e.controllerDetails.name||e.controllerDetails.name.trim()==="")&&s.push("Controller name is required."),(!e.controllerDetails.contact||e.controllerDetails.contact.trim()==="")&&s.push("Controller contact is required."),(!e.controllerDetails.address||e.controllerDetails.address.trim()==="")&&s.push("Controller address is required.")):s.push("Controller details are required."),(!e.lawfulBasis||!l.includes(e.lawfulBasis))&&s.push("A valid lawful basis must be specified (NDPA Section 25)."),(!e.lawfulBasisJustification||e.lawfulBasisJustification.trim()==="")&&s.push("Lawful basis justification is required to demonstrate compliance."),(!e.purposes||e.purposes.length===0)&&s.push("At least one processing purpose must be specified."),(!e.dataCategories||e.dataCategories.length===0)&&s.push("At least one data category must be specified."),(!e.dataSubjectCategories||e.dataSubjectCategories.length===0)&&s.push("At least one data subject category must be specified."),(!e.recipients||e.recipients.length===0)&&s.push("At least one recipient or category of recipients must be specified."),(!e.retentionPeriod||e.retentionPeriod.trim()==="")&&s.push("Retention period must be specified."),(!e.securityMeasures||e.securityMeasures.length===0)&&s.push("At least one security measure must be documented."),e.dataSource||s.push("Data source must be specified."),e.dataSource==="third_party"&&(!e.thirdPartySourceDetails||e.thirdPartySourceDetails.trim()==="")&&s.push('Third-party source details are required when data source is "third_party".'),e.automatedDecisionMaking&&(!e.automatedDecisionMakingDetails||e.automatedDecisionMakingDetails.trim()==="")&&s.push("Automated decision-making details are required when automated decision-making is involved."),e.dpiaRequired&&(!e.dpiaReference||e.dpiaReference.trim()==="")&&s.push("DPIA reference is required when DPIA is marked as required."),{valid:s.length===0,errors:s}}function D(e){let s=l.reduce((a,u)=>(a[u]=0,a),{}),o=0,t=0,i=0,n=0,r=0,p=[],d={},m=Date.now();for(let a of e.records)a.lawfulBasis&&l.includes(a.lawfulBasis)&&s[a.lawfulBasis]++,a.status==="active"&&o++,a.sensitiveDataCategories&&a.sensitiveDataCategories.length>0&&t++,a.crossBorderTransfers&&a.crossBorderTransfers.length>0&&i++,a.dpiaRequired&&n++,a.automatedDecisionMaking&&r++,a.nextReviewDate&&a.nextReviewDate<=m&&p.push(a),a.department&&(d[a.department]=(d[a.department]||0)+1);let g=Object.entries(d).map(([a,u])=>({department:a,count:u})).sort((a,u)=>u.count-a.count).slice(0,10);return {totalRecords:e.records.length,activeRecords:o,byLawfulBasis:s,sensitiveDataRecords:t,crossBorderRecords:i,dpiaRequiredRecords:n,automatedDecisionRecords:r,recordsDueForReview:p,topDepartments:g,lastUpdated:e.lastUpdated}}function f(e){return /^[=+\-@\t\r]/.test(e)&&(e="'"+e),e.includes(",")||e.includes('"')||e.includes(`
|
|
2
2
|
`)||e.includes("\r")?`"${e.replace(/"/g,'""')}"`:e}function c(e){return e?new Date(e).toISOString():""}function R(e){let s=["ID","Name","Description","Controller Name","Controller Contact","Lawful Basis","Lawful Basis Justification","Purposes","Data Categories","Sensitive Data Categories","Data Subject Categories","Recipients","Cross-Border Transfers","Retention Period","Security Measures","Data Source","DPIA Required","DPIA Reference","Automated Decision-Making","Status","Department","Systems Used","Created At","Updated At","Last Reviewed At","Next Review Date"],o=e.records.map(i=>{let n=i.crossBorderTransfers?i.crossBorderTransfers.map(r=>`${r.destinationCountry} (${r.transferMechanism}: ${r.safeguards})`).join("; "):"";return [i.id,i.name,i.description,i.controllerDetails.name,i.controllerDetails.contact,i.lawfulBasis,i.lawfulBasisJustification,i.purposes.join("; "),i.dataCategories.join("; "),(i.sensitiveDataCategories||[]).join("; "),i.dataSubjectCategories.join("; "),i.recipients.join("; "),n,i.retentionPeriod,i.securityMeasures.join("; "),i.dataSource,i.dpiaRequired?"Yes":"No",i.dpiaReference||"",i.automatedDecisionMaking?"Yes":"No",i.status,i.department||"",(i.systemsUsed||[]).join("; "),c(i.createdAt),c(i.updatedAt),c(i.lastReviewedAt),c(i.nextReviewDate)].map(r=>f(String(r)))});return [s.map(i=>f(i)).join(","),...o.map(i=>i.join(","))].join(`
|
|
3
|
-
`)}function w(e){let s=[],o=Date.now();for(let t of e.records){let i=[];if((!t.lawfulBasisJustification||t.lawfulBasisJustification.trim()==="")&&i.push("Missing lawful basis justification (NDPA Section 25 requires documented justification)."),(!t.retentionPeriod||t.retentionPeriod.trim()==="")&&i.push("Missing retention period (data must not be kept longer than necessary)."),(!t.securityMeasures||t.securityMeasures.length===0)&&i.push("No security measures documented (NDPA requires appropriate technical and organizational measures)."),t.nextReviewDate&&t.nextReviewDate<=o){let n=Math.ceil((o-t.nextReviewDate)/864e5);i.push(`Review is overdue by ${n} day${n!==1?"s":""}.`);}if(t.dpiaRequired&&(!t.dpiaReference||t.dpiaReference.trim()==="")&&i.push("DPIA is required but no reference to a completed DPIA was provided."),t.automatedDecisionMaking&&(!t.automatedDecisionMakingDetails||t.automatedDecisionMakingDetails.trim()==="")&&i.push("Automated decision-making is flagged but no details are documented."),t.crossBorderTransfers)for(let n of t.crossBorderTransfers)(!n.safeguards||n.safeguards.trim()==="")&&i.push(`Cross-border transfer to ${n.destinationCountry} is missing safeguard documentation.`),(!n.transferMechanism||n.transferMechanism.trim()==="")&&i.push(`Cross-border transfer to ${n.destinationCountry} is missing transfer mechanism.`);t.dataSource==="third_party"&&(!t.thirdPartySourceDetails||t.thirdPartySourceDetails.trim()==="")&&i.push('Data source is "third_party" but no source details are provided.'),(!t.purposes||t.purposes.length===0)&&i.push("No processing purposes specified."),(!t.recipients||t.recipients.length===0)&&i.push("No recipients or categories of recipients specified."),i.length>0&&s.push({recordId:t.id,recordName:t.name,gaps:i});}return s}export{h as a,D as b,R as c,w as d}
|
|
4
|
-
//# sourceMappingURL=chunk-SHMJNRHO.mjs.map
|
|
3
|
+
`)}function w(e){let s=[],o=Date.now();for(let t of e.records){let i=[];if((!t.lawfulBasisJustification||t.lawfulBasisJustification.trim()==="")&&i.push("Missing lawful basis justification (NDPA Section 25 requires documented justification)."),(!t.retentionPeriod||t.retentionPeriod.trim()==="")&&i.push("Missing retention period (data must not be kept longer than necessary)."),(!t.securityMeasures||t.securityMeasures.length===0)&&i.push("No security measures documented (NDPA requires appropriate technical and organizational measures)."),t.nextReviewDate&&t.nextReviewDate<=o){let n=Math.ceil((o-t.nextReviewDate)/864e5);i.push(`Review is overdue by ${n} day${n!==1?"s":""}.`);}if(t.dpiaRequired&&(!t.dpiaReference||t.dpiaReference.trim()==="")&&i.push("DPIA is required but no reference to a completed DPIA was provided."),t.automatedDecisionMaking&&(!t.automatedDecisionMakingDetails||t.automatedDecisionMakingDetails.trim()==="")&&i.push("Automated decision-making is flagged but no details are documented."),t.crossBorderTransfers)for(let n of t.crossBorderTransfers)(!n.safeguards||n.safeguards.trim()==="")&&i.push(`Cross-border transfer to ${n.destinationCountry} is missing safeguard documentation.`),(!n.transferMechanism||n.transferMechanism.trim()==="")&&i.push(`Cross-border transfer to ${n.destinationCountry} is missing transfer mechanism.`);t.dataSource==="third_party"&&(!t.thirdPartySourceDetails||t.thirdPartySourceDetails.trim()==="")&&i.push('Data source is "third_party" but no source details are provided.'),(!t.purposes||t.purposes.length===0)&&i.push("No processing purposes specified."),(!t.recipients||t.recipients.length===0)&&i.push("No recipients or categories of recipients specified."),i.length>0&&s.push({recordId:t.id,recordName:t.name,gaps:i});}return s}export{h as a,D as b,R as c,w as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-RMQ7OLNY.mjs';import {a}from'./chunk-ZJYULEER.mjs';function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function q(e){let n=new Set,o=new RegExp(`${s(a$1)}([^${s("\xBB")}]+)${s("\xBB")}`,"g"),i;for(;(i=o.exec(e))!==null;)n.add(i[1].trim());let r=/\{\{\s*([^}\s]+)\s*\}\}/g;for(;(i=r.exec(e))!==null;)n.add(i[1].trim());return Array.from(n)}function P(e,n){if(typeof e=="string"){let o=e,i=n,r=o,c=/\{\{([^}]+)\}\}/g,d;for(;(d=c.exec(o))!==null;){let t=d[1].trim(),a=i[t]||"";r=r.replace(new RegExp(`\\{\\{\\s*${s(t)}\\s*\\}\\}`,"g"),a);}return r}else {let o=e,i=n,r={},c=[];return o.filter(t=>t.included).sort((t,a)=>(t.order||0)-(a.order||0)).forEach(t=>{let a=t.template||t.customContent||t.defaultContent||"",y=/\{\{([^}]+)\}\}/g,m,h=[];for(;(m=y.exec(a))!==null;)h.push(m[1].trim());h.forEach(l=>{let u="";l in i&&(u=i[l]||""),u||c.push(l),a=a.replace(new RegExp(`\\{\\{\\s*${s(l)}\\s*\\}\\}`,"g"),u);}),r[t.id]=a;}),{fullText:Object.values(r).join(`
|
|
2
2
|
|
|
3
3
|
`),sectionTexts:r,missingVariables:Array.from(new Set(c))}}}var w=[{id:"data-collection",title:"Data Collection",description:"Describes what personal data is collected and how it is obtained.",order:1,required:true,included:true,template:'{{orgName}} ("we", "us", or "our") collects personal data from users of our services at {{website}}. We collect information you provide directly, such as your name, email address, phone number, and any other details you submit through forms or communications. We may also collect data automatically, including IP addresses, browser type, device information, and usage patterns through cookies and similar technologies. All data collection is conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023.',variables:["orgName","website"]},{id:"legal-basis",title:"Legal Basis for Processing",description:"Specifies the lawful basis for processing personal data under the NDPA.",order:2,required:true,included:true,template:`{{orgName}} processes personal data under one or more of the following lawful bases as prescribed by the NDPA 2023:
|
|
4
4
|
|
|
@@ -59,5 +59,4 @@ DPO Email: {{dpoEmail}}
|
|
|
59
59
|
|
|
60
60
|
You also have the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC) if you believe your data protection rights have been violated.
|
|
61
61
|
|
|
62
|
-
This policy is effective as of {{effectiveDate}} and applies to all {{industry}} services provided by {{orgName}}.`,variables:["orgName","address","privacyEmail","website","dpoName","dpoEmail","effectiveDate","industry"]}],v=[{id:"orgName",name:"orgName",description:"The official name of your organisation.",value:"",inputType:"text",required:true},{id:"website",name:"website",description:"Your organisation's website URL.",value:"",inputType:"url",required:true},{id:"privacyEmail",name:"privacyEmail",description:"Email address for privacy-related enquiries.",value:"",inputType:"email",required:true},{id:"dpoName",name:"dpoName",description:"Full name of your Data Protection Officer.",value:"",inputType:"text",required:false},{id:"dpoEmail",name:"dpoEmail",description:"Email address of your Data Protection Officer.",value:"",inputType:"email",required:false},{id:"address",name:"address",description:"Physical address of your organisation.",value:"",inputType:"textarea",required:false},{id:"industry",name:"industry",description:"The industry or sector your organisation operates in.",value:"",inputType:"text",required:false},{id:"effectiveDate",name:"effectiveDate",description:"The date this privacy policy becomes effective.",value:"",inputType:"date",required:false}];function N(){return {sections:w.map(e=>a({},e)),variables:v.map(e=>a({},e))}}export{q as a,P as b,w as c,v as d,N as e}
|
|
63
|
-
//# sourceMappingURL=chunk-CKGJK4D7.mjs.map
|
|
62
|
+
This policy is effective as of {{effectiveDate}} and applies to all {{industry}} services provided by {{orgName}}.`,variables:["orgName","address","privacyEmail","website","dpoName","dpoEmail","effectiveDate","industry"]}],v=[{id:"orgName",name:"orgName",description:"The official name of your organisation.",value:"",inputType:"text",required:true},{id:"website",name:"website",description:"Your organisation's website URL.",value:"",inputType:"url",required:true},{id:"privacyEmail",name:"privacyEmail",description:"Email address for privacy-related enquiries.",value:"",inputType:"email",required:true},{id:"dpoName",name:"dpoName",description:"Full name of your Data Protection Officer.",value:"",inputType:"text",required:false},{id:"dpoEmail",name:"dpoEmail",description:"Email address of your Data Protection Officer.",value:"",inputType:"email",required:false},{id:"address",name:"address",description:"Physical address of your organisation.",value:"",inputType:"textarea",required:false},{id:"industry",name:"industry",description:"The industry or sector your organisation operates in.",value:"",inputType:"text",required:false},{id:"effectiveDate",name:"effectiveDate",description:"The date this privacy policy becomes effective.",value:"",inputType:"date",required:false}];function N(){return {sections:w.map(e=>a({},e)),variables:v.map(e=>a({},e))}}export{q as a,P as b,w as c,v as d,N as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var n={AT:{country:"Austria",isoCode:"AT",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},BE:{country:"Belgium",isoCode:"BE",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},BG:{country:"Bulgaria",isoCode:"BG",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},HR:{country:"Croatia",isoCode:"HR",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},CY:{country:"Cyprus",isoCode:"CY",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},CZ:{country:"Czech Republic",isoCode:"CZ",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},DK:{country:"Denmark",isoCode:"DK",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},EE:{country:"Estonia",isoCode:"EE",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},FI:{country:"Finland",isoCode:"FI",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},FR:{country:"France",isoCode:"FR",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},DE:{country:"Germany",isoCode:"DE",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR with additional national provisions (BDSG).",lastUpdated:"2024-01-01"},GR:{country:"Greece",isoCode:"GR",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},HU:{country:"Hungary",isoCode:"HU",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},IE:{country:"Ireland",isoCode:"IE",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR. Hosts many multinational data processors.",lastUpdated:"2024-01-01"},IT:{country:"Italy",isoCode:"IT",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},LV:{country:"Latvia",isoCode:"LV",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},LT:{country:"Lithuania",isoCode:"LT",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},LU:{country:"Luxembourg",isoCode:"LU",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},MT:{country:"Malta",isoCode:"MT",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},NL:{country:"Netherlands",isoCode:"NL",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},PL:{country:"Poland",isoCode:"PL",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},PT:{country:"Portugal",isoCode:"PT",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},RO:{country:"Romania",isoCode:"RO",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},SK:{country:"Slovakia",isoCode:"SK",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},SI:{country:"Slovenia",isoCode:"SI",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},ES:{country:"Spain",isoCode:"ES",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},SE:{country:"Sweden",isoCode:"SE",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EU member state; protected by GDPR.",lastUpdated:"2024-01-01"},IS:{country:"Iceland",isoCode:"IS",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EEA member; GDPR applies through EEA Agreement.",lastUpdated:"2024-01-01"},LI:{country:"Liechtenstein",isoCode:"LI",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EEA member; GDPR applies through EEA Agreement.",lastUpdated:"2024-01-01"},NO:{country:"Norway",isoCode:"NO",adequacyStatus:"adequate",recognizedBy:"EU",notes:"EEA member; GDPR applies through EEA Agreement.",lastUpdated:"2024-01-01"},GB:{country:"United Kingdom",isoCode:"GB",adequacyStatus:"adequate",recognizedBy:"self-assessment",notes:"Protected by UK GDPR and the Data Protection Act 2018. EU adequacy decision granted post-Brexit.",lastUpdated:"2024-01-01"},US:{country:"United States",isoCode:"US",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"No comprehensive federal data protection law. Adequacy depends on transfer mechanism used (e.g. EU-US Data Privacy Framework, standard contractual clauses). Sector-specific laws exist (HIPAA, CCPA, etc.).",lastUpdated:"2024-01-01"},CA:{country:"Canada",isoCode:"CA",adequacyStatus:"adequate",recognizedBy:"self-assessment",notes:"Protected by PIPEDA (Personal Information Protection and Electronic Documents Act) and provincial privacy laws. Recognized as adequate by the EU.",lastUpdated:"2024-01-01"},ZA:{country:"South Africa",isoCode:"ZA",adequacyStatus:"adequate",recognizedBy:"self-assessment",notes:"Protected by POPIA (Protection of Personal Information Act, 2013). Comprehensive data protection framework with an independent Information Regulator.",lastUpdated:"2024-01-01"},GH:{country:"Ghana",isoCode:"GH",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Data Protection Act 2012 (Act 843) establishes a data protection framework. Enforcement capacity is still developing.",lastUpdated:"2024-01-01"},KE:{country:"Kenya",isoCode:"KE",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Data Protection Act 2019 provides a modern framework. The Office of the Data Protection Commissioner is operational but still maturing.",lastUpdated:"2024-01-01"},RW:{country:"Rwanda",isoCode:"RW",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Law No. 058/2021 on the Protection of Personal Data and Privacy. Framework is relatively new.",lastUpdated:"2024-01-01"},EG:{country:"Egypt",isoCode:"EG",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Personal Data Protection Law No. 151 of 2020. Implementation and enforcement are still in early stages.",lastUpdated:"2024-01-01"},TZ:{country:"Tanzania",isoCode:"TZ",adequacyStatus:"not_adequate",recognizedBy:"self-assessment",notes:"No comprehensive data protection legislation in force.",lastUpdated:"2024-01-01"},UG:{country:"Uganda",isoCode:"UG",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Data Protection and Privacy Act 2019 provides a framework, but enforcement capacity is limited.",lastUpdated:"2024-01-01"},SN:{country:"Senegal",isoCode:"SN",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Law No. 2008-12 on the Protection of Personal Data. One of the earlier African data protection laws.",lastUpdated:"2024-01-01"},MA:{country:"Morocco",isoCode:"MA",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Law No. 09-08 on the Protection of Individuals with Regard to the Processing of Personal Data (2009). Recognized as adequate by the EU.",lastUpdated:"2024-01-01"},MU:{country:"Mauritius",isoCode:"MU",adequacyStatus:"adequate",recognizedBy:"self-assessment",notes:"Data Protection Act 2017 provides a comprehensive framework modelled on international standards.",lastUpdated:"2024-01-01"},CN:{country:"China",isoCode:"CN",adequacyStatus:"not_adequate",recognizedBy:"self-assessment",notes:"Personal Information Protection Law (PIPL) enacted in 2021 but government access provisions and limited independent oversight raise concerns. Transfers require security assessments or standard contracts.",lastUpdated:"2024-01-01"},IN:{country:"India",isoCode:"IN",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Digital Personal Data Protection Act 2023 enacted. Implementation rules and enforcement mechanisms are still being finalized.",lastUpdated:"2024-01-01"},SG:{country:"Singapore",isoCode:"SG",adequacyStatus:"adequate",recognizedBy:"self-assessment",notes:"Personal Data Protection Act 2012 (PDPA) provides a robust framework. Strong enforcement by the PDPC.",lastUpdated:"2024-01-01"},JP:{country:"Japan",isoCode:"JP",adequacyStatus:"adequate",recognizedBy:"EU",notes:"Act on the Protection of Personal Information (APPI). Recognized as adequate by the EU under mutual adequacy arrangement.",lastUpdated:"2024-01-01"},KR:{country:"South Korea",isoCode:"KR",adequacyStatus:"adequate",recognizedBy:"EU",notes:"Personal Information Protection Act (PIPA). Recognized as adequate by the EU.",lastUpdated:"2024-01-01"},AE:{country:"United Arab Emirates",isoCode:"AE",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Federal Decree-Law No. 45 of 2021 on Personal Data Protection. DIFC and ADGM free zones have their own data protection regulations with stronger frameworks.",lastUpdated:"2024-01-01"},SA:{country:"Saudi Arabia",isoCode:"SA",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Personal Data Protection Law (Royal Decree M/19, 2021). Framework is new and enforcement is still developing.",lastUpdated:"2024-01-01"},IL:{country:"Israel",isoCode:"IL",adequacyStatus:"adequate",recognizedBy:"EU",notes:"Protection of Privacy Law 5741-1981 and regulations. Recognized as adequate by the EU.",lastUpdated:"2024-01-01"},BR:{country:"Brazil",isoCode:"BR",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Lei Geral de Protecao de Dados (LGPD, 2020) provides a comprehensive framework. The ANPD is actively enforcing.",lastUpdated:"2024-01-01"},AR:{country:"Argentina",isoCode:"AR",adequacyStatus:"adequate",recognizedBy:"EU",notes:"Personal Data Protection Act No. 25,326. Recognized as adequate by the EU.",lastUpdated:"2024-01-01"},AU:{country:"Australia",isoCode:"AU",adequacyStatus:"partially_adequate",recognizedBy:"self-assessment",notes:"Privacy Act 1988 provides protection but does not fully align with GDPR-level standards. Reform efforts are ongoing.",lastUpdated:"2024-01-01"},NZ:{country:"New Zealand",isoCode:"NZ",adequacyStatus:"adequate",recognizedBy:"EU",notes:"Privacy Act 2020 provides a comprehensive framework. Recognized as adequate by the EU.",lastUpdated:"2024-01-01"},CH:{country:"Switzerland",isoCode:"CH",adequacyStatus:"adequate",recognizedBy:"EU",notes:"Federal Act on Data Protection (FADP, revised 2023). Recognized as adequate by the EU.",lastUpdated:"2024-01-01"},RU:{country:"Russia",isoCode:"RU",adequacyStatus:"not_adequate",recognizedBy:"self-assessment",notes:"Federal Law on Personal Data (No. 152-FZ). Data localization requirements and government access concerns.",lastUpdated:"2024-01-01"}};function y(e){let t=e.trim().toUpperCase();if(n[t])return n[t];let a=e.trim().toLowerCase();for(let s of Object.values(n))if(s.country.toLowerCase()===a)return s}function q(){return Object.values(n).filter(e=>e.adequacyStatus==="adequate")}function g(e){let t=y(e);return t?t.adequacyStatus!=="adequate":true}function u(e){return e==="standard_clauses"||e==="binding_corporate_rules"||e==="ndpc_authorization"}function f(e){return {adequacy_decision:"Adequacy Decision (NDPA Section 42) \u2014 Transfer to a country, region, or specified sector that the NDPC has determined provides an adequate level of data protection.",standard_clauses:"Standard Contractual Clauses (NDPA Section 41(1)(a)) \u2014 Transfer based on contractual clauses that afford adequate protection. The NDPC may approve such clauses under Section 42(4)\u2013(5).",binding_corporate_rules:"Binding Corporate Rules (NDPA Section 41(1)(a)) \u2014 Transfer within a group of undertakings based on binding corporate rules that afford adequate protection. The NDPC may approve BCRs under Section 42(5).",ndpc_authorization:"NDPC-Approved Instrument (NDPA Section 42(5)) \u2014 Transfer authorized by an NDPC-approved code of conduct, certification mechanism, or similar instrument that meets the protection standards of the Act.",explicit_consent:"Explicit Consent (NDPA Section 43(1)(a)) \u2014 Transfer based on the consent of the data subject after being informed of the possible risks due to the absence of adequate protections.",contract_performance:"Contract Performance (NDPA Section 43(1)(b)) \u2014 Transfer necessary for the performance of a contract to which the data subject is a party, or for pre-contractual steps at the data subject's request.",public_interest:"Public Interest (NDPA Section 43(1)(d)) \u2014 Transfer necessary for important reasons of public interest.",legal_claims:"Legal Claims (NDPA Section 43(1)(e)) \u2014 Transfer necessary for the establishment, exercise, or defense of legal claims.",vital_interests:"Vital Interests (NDPA Section 43(1)(f)) \u2014 Transfer necessary to protect the vital interests of a data subject or of other persons where the data subject is physically or legally incapable of giving consent."}[e]}function U(e){var s,r;let t=[],a=[];return e.id||t.push("Transfer ID is required."),(!e.destinationCountry||e.destinationCountry.trim()==="")&&t.push("Destination country is required."),(!e.recipientOrganization||e.recipientOrganization.trim()==="")&&t.push("Recipient organization is required."),(!((s=e.recipientContact)!=null&&s.name)||e.recipientContact.name.trim()==="")&&t.push("Recipient contact name is required."),(!((r=e.recipientContact)!=null&&r.email)||e.recipientContact.email.trim()==="")&&t.push("Recipient contact email is required."),(!e.purpose||e.purpose.trim()==="")&&t.push("Purpose of the transfer is required."),e.transferMechanism||t.push("Transfer mechanism is required."),(!e.dataCategories||e.dataCategories.length===0)&&t.push("At least one data category must be specified."),(!e.riskAssessment||e.riskAssessment.trim()==="")&&t.push("Risk assessment summary is required."),(!e.safeguards||e.safeguards.length===0)&&t.push("At least one safeguard must be documented for the transfer."),u(e.transferMechanism)&&(e.ndpcApproval?(e.ndpcApproval.required||a.push("NDPC approval is marked as not required, but the selected transfer mechanism requires NDPC approval."),e.ndpcApproval.required&&!e.ndpcApproval.applied&&t.push("NDPC approval is required but an application has not been submitted."),e.ndpcApproval.applied&&!e.ndpcApproval.approved&&e.status==="active"&&t.push('Transfer is marked as active but NDPC approval has not been granted. Status should be "pending_approval".')):t.push(`NDPC approval documentation is required for transfers using ${l(e.transferMechanism)}.`)),e.tiaCompleted||a.push("A Transfer Impact Assessment (TIA) has not been completed for this transfer."),e.adequacyStatus==="inadequate"&&e.transferMechanism==="adequacy_decision"&&t.push("Cannot rely on adequacy decision (Section 42) when the destination country is marked as inadequate."),e.endDate&&e.startDate>e.endDate&&t.push("Start date must be before end date."),e.includesSensitiveData&&e.riskLevel!=="high"&&a.push("Transfer includes sensitive personal data but the risk level is not set to high. Consider reviewing the risk assessment."),e.reviewDate||a.push("No review date has been set for this transfer. Periodic reviews are recommended."),{isValid:t.length===0,errors:t,warnings:a}}function b(e){var d,c;let t=[],a=[],s=0,p={adequate:0,pending_review:2,unknown:3,inadequate:4}[e.adequacyStatus];s+=p,e.adequacyStatus==="inadequate"?(t.push("Destination country does not have an adequate level of data protection."),a.push("Implement supplementary technical and organizational measures.")):e.adequacyStatus==="unknown"?(t.push("Data protection adequacy of the destination country has not been assessed."),a.push("Conduct an adequacy assessment of the destination country.")):e.adequacyStatus==="pending_review"&&(t.push("Destination country adequacy is currently under review."),a.push("Monitor the adequacy review outcome and plan for contingencies."));let i={adequacy_decision:0,standard_clauses:1,binding_corporate_rules:1,ndpc_authorization:1,contract_performance:2,explicit_consent:2,legal_claims:2,public_interest:2,vital_interests:3}[e.transferMechanism];s+=i,i>=2&&(t.push(`Transfer relies on a derogation mechanism (${l(e.transferMechanism)}), which provides fewer structural safeguards.`),a.push("Consider whether a stronger transfer mechanism (adequacy decision, standard clauses, or BCRs) could be used instead.")),e.includesSensitiveData&&(s+=3,t.push("Transfer includes sensitive personal data, increasing the potential impact of unauthorized access."),a.push("Ensure encryption in transit and at rest, and apply strict access controls.")),e.estimatedDataSubjects&&e.estimatedDataSubjects>1e4?(s+=2,t.push("Large number of data subjects involved increases the scope of potential harm."),a.push("Consider data minimization strategies and ensure robust incident response procedures.")):e.estimatedDataSubjects&&e.estimatedDataSubjects>1e3&&(s+=1,t.push("Moderate number of data subjects involved.")),e.tiaCompleted||(s+=2,t.push("Transfer Impact Assessment has not been completed."),a.push("Complete a Transfer Impact Assessment before proceeding with the transfer.")),u(e.transferMechanism)&&((d=e.ndpcApproval)!=null&&d.approved||(s+=2,t.push("NDPC approval is required but has not been granted."),a.push("Obtain NDPC approval before activating the transfer."))),(((c=e.safeguards)==null?void 0:c.length)||0)<3&&(s+=1,t.push("Limited number of safeguards documented."),a.push("Document additional technical, organizational, and contractual safeguards.")),e.frequency==="continuous"&&(s+=1,t.push("Continuous data transfer increases exposure window."),a.push("Implement real-time monitoring and anomaly detection for the transfer."));let o;return s<=4?o="low":s<=9?o="medium":o="high",{riskLevel:o,riskScore:s,factors:t,recommendations:a}}function l(e){return {adequacy_decision:"Adequacy Decision",standard_clauses:"Standard Contractual Clauses",binding_corporate_rules:"Binding Corporate Rules",ndpc_authorization:"NDPC Authorization",explicit_consent:"Explicit Consent",contract_performance:"Contract Performance",public_interest:"Public Interest",legal_claims:"Legal Claims",vital_interests:"Vital Interests"}[e]}exports.a=n;exports.b=y;exports.c=q;exports.d=g;exports.e=u;exports.f=f;exports.g=U;exports.h=b;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {useRef,useEffect}from'react';var m='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function v(p){let{active:c,onEscape:o,autoFocus:r=true}=p,t=useRef(null),s=useRef(null);return useEffect(()=>{if(!c||(s.current=typeof document!="undefined"?document.activeElement:null,!t.current))return;let i=false,u;r&&(u=setTimeout(()=>{if(i||!t.current)return;let e=t.current.querySelectorAll(m);e.length>0?e[0].focus():(t.current.tabIndex<0&&(t.current.tabIndex=-1),t.current.focus());},0));let l=e=>{if(e.key==="Escape"&&o){o();return}if(e.key!=="Tab"||!t.current)return;let n=t.current.querySelectorAll(m);if(n.length===0)return;let f=n[0],a=n[n.length-1];e.shiftKey?document.activeElement===f&&(e.preventDefault(),a.focus()):document.activeElement===a&&(e.preventDefault(),f.focus());};return document.addEventListener("keydown",l),()=>{i=true,u&&clearTimeout(u),document.removeEventListener("keydown",l);let e=s.current;e&&typeof document!="undefined"&&document.contains(e)&&typeof e.focus=="function"&&e.focus();}},[c,o,r]),t}export{v as a};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
//# sourceMappingURL=chunk-TV4U6AIS.js.map
|
|
1
|
+
'use strict';var chunkLVGT3DLT_js=require('./chunk-LVGT3DLT.js'),chunkVWED6UTN_js=require('./chunk-VWED6UTN.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),react=require('react');function W(e,s){return s?chunkVWED6UTN_js.a(e):{load:()=>null,save:()=>{},remove:()=>{}}}function A({templates:e,initialPolicy:s,adapter:y,storageKey:l="ndpr_privacy_policy",persist:f,useLocalStorage:D,onGenerate:T}){var V;let O=(V=f!=null?f:D)!=null?V:true,w=y!=null?y:W(l,O),c=react.useRef(w);c.current=w;let[n,p]=react.useState(s||null),[o,g]=react.useState(null),[u,S]=react.useState({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),[C,E]=react.useState(true),R=react.useRef(e);R.current=e,react.useEffect(()=>{if(s){E(false);return}let t=false;try{let r=c.current.load(),i=a=>{if(a){if(p(a),a.templateId){let P=R.current.find(b=>b.id===a.templateId);P&&g(P);}a.organizationInfo&&S(a.organizationInfo);}E(!1);};r instanceof Promise?r.then(a=>{t||i(a);},()=>{t||E(!1);}):i(r);}catch(r){t||E(false);}return ()=>{t=true;}},[s]);let k=t=>{Promise.resolve(c.current.save(t)).catch(r=>{console.warn("[ndpr-toolkit] Failed to save policy:",r);});},j=react.useCallback(t=>{let r=e.find(b=>b.id===t);if(!r)return false;g(r);let i=r.sections.map(b=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},b),{customContent:void 0})),a={};Object.keys(r.variables).forEach(b=>{a[b]=r.variables[b].defaultValue||"";});let P=Date.now();return p({id:"policy_"+P+"_"+Math.random().toString(36).substr(2,9),title:"",templateId:r.id,organizationInfo:u,sections:i,variableValues:a,effectiveDate:P,lastUpdated:P,version:"1.0"}),true},[e,u]),I=react.useCallback(t=>{S(r=>chunkRFPLZDIO_js.a(chunkRFPLZDIO_js.a({},r),t));},[]),F=react.useCallback((t,r)=>{o&&(n?p(i=>i&&chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},i),{sections:i.sections.map(a=>a.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},a),{included:r}):a)})):g(i=>i&&chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},i),{sections:i.sections.map(a=>a.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},a),{included:r}):a)})));},[o,n]),M=react.useCallback((t,r)=>{o&&(n?p(i=>i&&chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},i),{sections:i.sections.map(a=>a.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},a),{customContent:r}):a)})):g(i=>i&&chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},i),{sections:i.sections.map(a=>a.id===t?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},a),{customContent:r}):a)})));},[o,n]),$=react.useCallback((t,r)=>{n&&p(i=>i&&chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},i),{variableValues:chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},i.variableValues),{[t]:r})}));},[n]),B=()=>"policy_"+Date.now()+"_"+Math.random().toString(36).substr(2,9),G=react.useCallback(()=>{if(!o)return null;let t=Date.now(),r={id:(n==null?void 0:n.id)||B(),title:`Privacy Policy for ${u.name}`,templateId:o.id,organizationInfo:u,sections:o.sections.map(i=>{var a;return chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},i),{customContent:(a=n==null?void 0:n.sections.find(P=>P.id===i.id))==null?void 0:a.customContent})}),variableValues:(n==null?void 0:n.variableValues)||{},effectiveDate:t,lastUpdated:t,version:"1.0"};return p(r),k(r),T&&T(r),r},[o,n,u,T]),K=react.useCallback(()=>{if(!n)return {fullText:"",sectionTexts:{},missingVariables:[]};let t=chunkLVGT3DLT_js.b(n.sections,n.organizationInfo);return typeof t=="string"?{fullText:t,sectionTexts:{full:t},missingVariables:[]}:t},[n]),H=react.useCallback(()=>{p(null),g(null),S({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),Promise.resolve(c.current.remove()).catch(t=>{console.warn("[ndpr-toolkit] Failed to remove policy:",t);});},[]),J=react.useCallback(()=>{let t=[];if(o||t.push("No template selected"),u.name||t.push("Organization name is required"),u.website||t.push("Organization website is required"),u.privacyEmail||t.push("Privacy contact email is required"),o){let r=o.sections.filter(a=>a.required),i=(n==null?void 0:n.sections.filter(a=>a.included))||[];r.forEach(a=>{i.some(P=>P.id===a.id)||t.push(`Required section "${a.title}" must be included`);});}return o&&n&&Object.entries(o.variables).forEach(([r,i])=>{i.required&&!n.variableValues[r]&&t.push(`Required variable "${i.name}" must have a value`);}),{valid:t.length===0,errors:t}},[o,u,n]);return {policy:n,selectedTemplate:o,organizationInfo:u,selectTemplate:j,updateOrganizationInfo:I,toggleSection:F,updateSectionContent:M,updateVariableValue:$,generatePolicy:G,getPolicyText:K,resetPolicy:H,isValid:J,isLoading:C}}var _="default-business";function X(e){return e.toLocaleDateString("en-NG",{day:"numeric",month:"long",year:"numeric"})}function Y(e){let{sections:s,variables:y}=chunkLVGT3DLT_js.e(),l={};return e&&(e.name&&(l.orgName=e.name),e.email&&(l.privacyEmail=e.email),e.website&&(l.website=e.website),e.address&&(l.address=e.address),e.industry&&(l.industry=e.industry),e.dpoName&&(l.dpoName=e.dpoName),e.dpoEmail&&(l.dpoEmail=e.dpoEmail)),l.effectiveDate||(l.effectiveDate=X(new Date)),{id:_,name:"Default Business Policy",description:"NDPA-compliant privacy policy template for businesses.",organizationType:"business",sections:s,variables:Object.fromEntries(y.map(f=>[f.name,{name:f.name,description:f.description,required:f.required,defaultValue:l[f.name]||f.value||void 0}])),version:"1.0",lastUpdated:Date.now(),ndpaCompliant:true}}function Z(e){if(!e)return {};let s={};return e.name&&(s.name=e.name),e.email&&(s.privacyEmail=e.email),e.website&&(s.website=e.website),e.address&&(s.address=e.address),e.industry&&(s.industry=e.industry),e.dpoName&&(s.dpoName=e.dpoName),e.dpoEmail&&(s.dpoEmail=e.dpoEmail),s}function ce(e={}){var o;let{orgInfo:s,autoGenerate:y=true,storageKey:l,persist:f,useLocalStorage:D,adapter:T}=e,O=(o=f!=null?f:D)!=null?o:true,w=react.useRef(null);w.current===null&&(w.current=Y(s));let c=A({templates:[w.current],adapter:T,storageKey:l,persist:O}),n=react.useRef(false),p=react.useRef(false);return react.useEffect(()=>{if(!y||c.isLoading||n.current)return;if(!T&&O!==false&&typeof window!="undefined"&&typeof window.localStorage!="undefined")try{if(window.localStorage.getItem(l!=null?l:"ndpr_privacy_policy")){n.current=!0,p.current=!0;return}}catch(S){}if(c.policy){n.current=true,p.current=true;return}n.current=true;let u=Z(s);Object.keys(u).length>0&&c.updateOrganizationInfo(u),c.selectedTemplate||c.selectTemplate(_);},[y,c.isLoading]),react.useEffect(()=>{var u;if(!y||p.current||!n.current||!c.selectedTemplate)return;let g=(u=s==null?void 0:s.name)!=null?u:"";g&&c.organizationInfo.name!==g||(p.current=true,c.generatePolicy());},[y,c.selectedTemplate,c.organizationInfo]),c}exports.a=A;exports.b=ce;
|