@tantainnovative/ndpr-toolkit 2.1.2 → 2.4.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/README.md +73 -2
- package/dist/{breach-6z0r-KuE.d.mts → breach-B_-6lDqS.d.mts} +1 -1
- package/dist/{breach-BFfnvtRk.d.ts → breach-CzXqSsaY.d.ts} +1 -1
- package/dist/{breach-BtFbDOmV.d.mts → breach-Eu9byel8.d.mts} +1 -1
- package/dist/{breach-BtFbDOmV.d.ts → breach-Eu9byel8.d.ts} +1 -1
- package/dist/breach-ouXoVTWs.d.ts +438 -0
- package/dist/breach-yRiyyc4n.d.mts +438 -0
- package/dist/breach.d.mts +5 -275
- package/dist/breach.d.ts +5 -275
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-2XFAV267.mjs +2 -0
- package/dist/chunk-32UIWTGD.js +72 -0
- package/dist/chunk-4JUDKBA2.mjs +7 -0
- package/dist/chunk-4VVARDN2.mjs +2 -0
- package/dist/chunk-5RSOLEEP.js +63 -0
- package/dist/chunk-AYKLAEOU.mjs +2 -0
- package/dist/chunk-BGHQTZAC.js +94 -0
- package/dist/chunk-BZTTQS4A.mjs +7 -0
- package/dist/chunk-CAB7O3GR.mjs +63 -0
- package/dist/chunk-CL53OI3I.js +7 -0
- package/dist/chunk-E64TU6IU.js +2 -0
- package/dist/chunk-EKVTLHBQ.js +2 -0
- package/dist/chunk-ELKEZEV5.mjs +2 -0
- package/dist/chunk-EPF7J2FK.js +3 -0
- package/dist/chunk-ER7X6E36.js +2 -0
- package/dist/chunk-FXTZDKDC.mjs +3 -0
- package/dist/chunk-IBEKLDBY.mjs +2 -0
- package/dist/chunk-ILCNDOBU.js +2 -0
- package/dist/chunk-K3GMTMQ6.js +2 -0
- package/dist/chunk-MJGOLP5M.js +2 -0
- package/dist/chunk-NW4A3JW6.mjs +2 -0
- package/dist/chunk-P3PULLYP.mjs +2 -0
- package/dist/chunk-SKJCQKFL.mjs +94 -0
- package/dist/chunk-TCJCE6WN.js +2 -0
- package/dist/chunk-UZ5EZOA7.js +2 -0
- package/dist/chunk-WSHSHIIM.mjs +2 -0
- package/dist/chunk-XMYUYQH7.mjs +72 -0
- package/dist/chunk-ZNTMZ6NM.js +7 -0
- package/dist/consent-audit-BdByjYlM.d.mts +65 -0
- package/dist/consent-audit-DhbfMR0n.d.ts +65 -0
- package/dist/consent.d.mts +120 -7
- package/dist/consent.d.ts +120 -7
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +62 -12
- package/dist/core.d.ts +62 -12
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/{cross-border-BrIy1ieh.d.ts → cross-border-BMcqLvjC.d.mts} +1 -1
- package/dist/{cross-border-BrIy1ieh.d.mts → cross-border-BMcqLvjC.d.ts} +1 -1
- package/dist/cross-border-entry-BrWVPly6.d.ts +91 -0
- package/dist/cross-border-entry-cCTvpwnT.d.mts +91 -0
- package/dist/cross-border.d.mts +4 -58
- package/dist/cross-border.d.ts +4 -58
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/{dpia-vWfE_9bO.d.mts → dpia-5OQVA1R_.d.mts} +1 -1
- package/dist/{dpia-vWfE_9bO.d.ts → dpia-5OQVA1R_.d.ts} +1 -1
- package/dist/{dpia-fdtTd2DI.d.ts → dpia-B0Pok5us.d.ts} +1 -1
- package/dist/{dpia-B9ZZJG5a.d.mts → dpia-CUfOmzvX.d.mts} +1 -1
- package/dist/dpia.d.mts +119 -5
- package/dist/dpia.d.ts +119 -5
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/dsr-190YpijW.d.ts +307 -0
- package/dist/dsr-BTT-Xd7H.d.mts +307 -0
- package/dist/{dsr-pQzQ3H1O.d.mts → dsr-Cm9lzWG7.d.mts} +1 -1
- package/dist/{dsr-pQzQ3H1O.d.ts → dsr-Cm9lzWG7.d.ts} +1 -1
- package/dist/{dsr-whPkiI0_.d.mts → dsr-D_eTNc4S.d.mts} +1 -1
- package/dist/{dsr-jq5NUEdz.d.ts → dsr-pNtVb1BK.d.ts} +1 -1
- package/dist/dsr.d.mts +5 -192
- package/dist/dsr.d.ts +5 -192
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +14 -14
- package/dist/hooks.d.ts +14 -14
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +28 -27
- package/dist/index.d.ts +28 -27
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{lawful-basis-v04AhbK2.d.ts → lawful-basis-BEyI0kGg.d.ts} +2 -2
- package/dist/{lawful-basis-D-oXFizg.d.mts → lawful-basis-C2eGaoHM.d.mts} +2 -2
- package/dist/{lawful-basis-CWtvDG1x.d.mts → lawful-basis-Cv1VmDLn.d.mts} +1 -1
- package/dist/{lawful-basis-CWtvDG1x.d.ts → lawful-basis-Cv1VmDLn.d.ts} +1 -1
- package/dist/lawful-basis-entry-15qjKcNO.d.ts +87 -0
- package/dist/lawful-basis-entry-CxZrofwG.d.mts +87 -0
- package/dist/lawful-basis.d.mts +5 -55
- package/dist/lawful-basis.d.ts +5 -55
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/policy-D2_jh5-T.d.ts +293 -0
- package/dist/policy-E0fXZkda.d.mts +293 -0
- package/dist/policy-templates-CIKcV0i1.d.ts +36 -0
- package/dist/policy-templates-DMsPwOSZ.d.mts +36 -0
- package/dist/policy.d.mts +5 -195
- package/dist/policy.d.ts +5 -195
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/{ropa-Rb4dsFSz.d.mts → ropa-DP7pPPql.d.mts} +2 -2
- package/dist/{ropa-BebGfqKQ.d.ts → ropa-Li6UlL5H.d.ts} +2 -2
- package/dist/ropa-entry-B0D7X1GV.d.ts +80 -0
- package/dist/ropa-entry-DiOThOc2.d.mts +80 -0
- package/dist/ropa.d.mts +5 -45
- package/dist/ropa.d.ts +5 -45
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/styles.css +40 -28
- package/dist/styles.d.ts +1 -0
- package/dist/unstyled.js +1 -1
- package/dist/unstyled.mjs +1 -1
- package/dist/{useBreach-WrZzJilM.d.mts → useBreach-BBSoIcZO.d.mts} +1 -1
- package/dist/{useBreach-vrh_XMpI.d.ts → useBreach-lFLbSyAN.d.ts} +1 -1
- package/dist/{useCrossBorderTransfer-TVnY8_UX.d.mts → useCrossBorderTransfer-BZVFCXfr.d.mts} +1 -1
- package/dist/{useCrossBorderTransfer-D4FQYfFt.d.ts → useCrossBorderTransfer-DmtACeqW.d.ts} +1 -1
- package/dist/{useDPIA-DFDHBLSa.d.ts → useDPIA-DBsg2yZx.d.ts} +1 -1
- package/dist/{useDPIA-FqPofFaV.d.mts → useDPIA-Da7-Q_yW.d.mts} +1 -1
- package/dist/{useDSR-DAqqOBXb.d.ts → useDSR-CYI7WCXr.d.ts} +1 -1
- package/dist/{useDSR-OXM5Q9rf.d.mts → useDSR-YYZ6FYFs.d.mts} +1 -1
- package/dist/{usePrivacyPolicy-CfySfBLS.d.ts → useDefaultPrivacyPolicy-B7kTHbZh.d.ts} +39 -2
- package/dist/{usePrivacyPolicy-Dit2sFuV.d.mts → useDefaultPrivacyPolicy-CUluF_ic.d.mts} +39 -2
- package/dist/{useLawfulBasis-RILM_xsx.d.ts → useLawfulBasis-CCWF9waR.d.ts} +2 -2
- package/dist/{useLawfulBasis-DNQ8YszQ.d.mts → useLawfulBasis-CpWuHtyh.d.mts} +2 -2
- package/dist/{useROPA-Bcs6cRdi.d.ts → useROPA-BhJ3kvHp.d.ts} +1 -1
- package/dist/{useROPA-nmcSiUYv.d.mts → useROPA-DLFdjkxP.d.mts} +1 -1
- package/package.json +30 -21
- package/dist/chunk-2XHD22J7.mjs +0 -7
- package/dist/chunk-4DKT6IB6.js +0 -94
- package/dist/chunk-6JFTAYXV.mjs +0 -2
- package/dist/chunk-6JVYYLS7.js +0 -2
- package/dist/chunk-6SGG6WPA.mjs +0 -2
- package/dist/chunk-AQEGDEQM.js +0 -7
- package/dist/chunk-C2IJWCZQ.mjs +0 -2
- package/dist/chunk-DB3JH4DS.mjs +0 -2
- package/dist/chunk-FFW7RUAG.mjs +0 -94
- package/dist/chunk-FK3CSFLJ.js +0 -2
- package/dist/chunk-IWUUVRLJ.js +0 -2
- package/dist/chunk-JUN6YPLL.mjs +0 -72
- package/dist/chunk-L3FKTBGV.js +0 -72
- package/dist/chunk-PM7CMTMB.js +0 -4
- package/dist/chunk-RB26MIRI.js +0 -2
- package/dist/chunk-RHWW5FDP.js +0 -16
- package/dist/chunk-SLNMKGQ2.mjs +0 -2
- package/dist/chunk-UUWVBENC.js +0 -2
- package/dist/chunk-UYP64PV7.mjs +0 -4
- package/dist/chunk-XMKA6GVK.mjs +0 -16
- package/dist/consent-DCc5zjXI.d.mts +0 -24
- package/dist/consent-DLWb5ota.d.ts +0 -24
- package/dist/privacy-9FcJceMr.d.mts +0 -15
- package/dist/privacy-BXz7O2ej.d.ts +0 -15
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {a as a$1,d,c,b}from'./chunk-QKK5S54L.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {b as b$1,a as a$2}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var M=[{value:"adequacy_decision",label:"Adequacy Decision (Section 41)"},{value:"standard_clauses",label:"Standard Contractual Clauses (Section 42)"},{value:"binding_corporate_rules",label:"Binding Corporate Rules (Section 43)"},{value:"ndpc_authorization",label:"NDPC Authorization (Section 44)"},{value:"explicit_consent",label:"Explicit Consent (Section 45(a))"},{value:"contract_performance",label:"Contract Performance (Section 45(b))"},{value:"public_interest",label:"Public Interest (Section 45(c))"},{value:"legal_claims",label:"Legal Claims (Section 45(d))"},{value:"vital_interests",label:"Vital Interests (Section 45(e))"}],H=[{value:"adequate",label:"Adequate"},{value:"inadequate",label:"Inadequate"},{value:"pending_review",label:"Pending Review"},{value:"unknown",label:"Unknown"}],Y=[{value:"one_time",label:"One-Time"},{value:"periodic",label:"Periodic"},{value:"continuous",label:"Continuous"}],Q=[{value:"active",label:"Active"},{value:"suspended",label:"Suspended"},{value:"terminated",label:"Terminated"},{value:"pending_approval",label:"Pending Approval"}],W={destinationCountry:"",destinationCountryCode:"",adequacyStatus:"unknown",transferMechanism:"adequacy_decision",dataCategories:"",includesSensitiveData:false,estimatedDataSubjects:"",recipientOrganization:"",recipientContactName:"",recipientContactEmail:"",recipientContactPhone:"",recipientContactAddress:"",purpose:"",safeguards:"",riskAssessment:"",riskLevel:"medium",frequency:"one_time",status:"active",tiaCompleted:false,tiaReference:"",ndpcApprovalApplied:false,ndpcApprovalApproved:false,ndpcApprovalReference:""},xe=({transfers:c$1,onAddTransfer:P,onUpdateTransfer:F,onRemoveTransfer:B,summary:G,title:K="Cross-Border Data Transfer Manager",description:J="Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VI (Sections 41-45).",className:X="",buttonClassName:T="",showSummary:Z=true,showTIA:ee=true,classNames:r,unstyled:o})=>{let[v,D]=useState(null),[I,x]=useState(false),[y,O]=useState(null),[i,R]=useState(W),[f,_]=useState(null),[C,te]=useState("all"),[A,re]=useState("all"),[k,ae]=useState(c$1);useEffect(()=>{let t=[...c$1];C!=="all"&&(t=t.filter(a=>a.status===C)),A!=="all"&&(t=t.filter(a=>a.transferMechanism===A)),t.sort((a,l)=>l.updatedAt-a.updatedAt),ae(t);},[c$1,C,A]),useEffect(()=>{k.length>0&&!v&&D(k[0].id);},[k,v]);let j=v?c$1.find(t=>t.id===v):null,h=t=>new Date(t).toLocaleDateString(),w=()=>{R(W),O(null),_(null);},ne=()=>{w(),x(true);},ie=t=>{var a,l,u,b;O(t.id),R({destinationCountry:t.destinationCountry,destinationCountryCode:t.destinationCountryCode||"",adequacyStatus:t.adequacyStatus,transferMechanism:t.transferMechanism,dataCategories:t.dataCategories.join(", "),includesSensitiveData:t.includesSensitiveData,estimatedDataSubjects:((a=t.estimatedDataSubjects)==null?void 0:a.toString())||"",recipientOrganization:t.recipientOrganization,recipientContactName:t.recipientContact.name,recipientContactEmail:t.recipientContact.email,recipientContactPhone:t.recipientContact.phone||"",recipientContactAddress:t.recipientContact.address||"",purpose:t.purpose,safeguards:t.safeguards.join(`
|
|
2
|
+
`),riskAssessment:t.riskAssessment,riskLevel:t.riskLevel,frequency:t.frequency,status:t.status,tiaCompleted:t.tiaCompleted,tiaReference:t.tiaReference||"",ndpcApprovalApplied:((l=t.ndpcApproval)==null?void 0:l.applied)||false,ndpcApprovalApproved:((u=t.ndpcApproval)==null?void 0:u.approved)||false,ndpcApprovalReference:((b=t.ndpcApproval)==null?void 0:b.referenceNumber)||""}),x(true);},p=(t,a)=>{R(l=>b$1(a$2({},l),{[t]:a}));},de=()=>{let t=a$1(i.transferMechanism),a=Date.now();return {destinationCountry:i.destinationCountry.trim(),destinationCountryCode:i.destinationCountryCode.trim()||void 0,adequacyStatus:i.adequacyStatus,transferMechanism:i.transferMechanism,dataCategories:i.dataCategories.split(",").map(l=>l.trim()).filter(Boolean),includesSensitiveData:i.includesSensitiveData,estimatedDataSubjects:i.estimatedDataSubjects?parseInt(i.estimatedDataSubjects,10):void 0,recipientOrganization:i.recipientOrganization.trim(),recipientContact:{name:i.recipientContactName.trim(),email:i.recipientContactEmail.trim(),phone:i.recipientContactPhone.trim()||void 0,address:i.recipientContactAddress.trim()||void 0},purpose:i.purpose.trim(),safeguards:i.safeguards.split(`
|
|
3
|
+
`).map(l=>l.trim()).filter(Boolean),riskAssessment:i.riskAssessment.trim(),riskLevel:i.riskLevel,frequency:i.frequency,status:t&&!i.ndpcApprovalApproved?"pending_approval":i.status,tiaCompleted:i.tiaCompleted,tiaReference:i.tiaReference.trim()||void 0,ndpcApproval:t?{required:true,applied:i.ndpcApprovalApplied,approved:i.ndpcApprovalApproved||void 0,referenceNumber:i.ndpcApprovalReference.trim()||void 0,appliedAt:i.ndpcApprovalApplied?a:void 0,approvedAt:i.ndpcApprovalApproved?a:void 0}:void 0,startDate:a,reviewDate:a+365*24*60*60*1e3}},oe=()=>{let t=de(),a=a$2({id:y||"temp",createdAt:Date.now(),updatedAt:Date.now()},t),l=c(a);_(l),l.isValid&&(y?F&&F(y,t):P&&P(t),w(),x(false));},le=t=>{B&&B(t),v===t&&D(null);},E=t=>jsxs("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[t]}`,r==null?void 0:r.riskBadge,o),children:[t.charAt(0).toUpperCase()+t.slice(1)," Risk"]}),L=t=>{let a$1={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",suspended:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",terminated:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",pending_approval:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200"},l={active:"Active",suspended:"Suspended",terminated:"Terminated",pending_approval:"Pending Approval"};return jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${a$1[t]}`,r==null?void 0:r.statusBadge,o),children:l[t]})},pe=t=>{var u;let a=a$1(t),l=((u=M.find(b=>b.value===t))==null?void 0:u.label)||t;return jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${a?"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200":"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200"}`,children:l})},se=()=>{let t=G||{totalActiveTransfers:c$1.filter(a=>a.status==="active").length,pendingApproval:c$1.filter(a=>{var l,u;return a.status==="pending_approval"||((l=a.ndpcApproval)==null?void 0:l.required)&&!((u=a.ndpcApproval)!=null&&u.approved)}),highRiskTransfers:c$1.filter(a=>a.riskLevel==="high"&&a.status==="active"),missingTIA:c$1.filter(a=>!a.tiaCompleted&&a.status==="active")};return jsxs("div",{className:a("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",r==null?void 0:r.summary,o),children:[jsxs("div",{className:a("bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200",children:t.totalActiveTransfers}),jsx("p",{className:"text-sm text-blue-600 dark:text-blue-300",children:"Active Transfers"})]}),jsxs("div",{className:a("bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-purple-800 dark:text-purple-200",children:t.pendingApproval.length}),jsx("p",{className:"text-sm text-purple-600 dark:text-purple-300",children:"Pending Approval"})]}),jsxs("div",{className:a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-red-800 dark:text-red-200",children:t.highRiskTransfers.length}),jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"High Risk"})]}),jsxs("div",{className:a("bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-yellow-800 dark:text-yellow-200",children:t.missingTIA.length}),jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-300",children:"Missing TIA"})]})]})},ue=()=>{let t=a$1(i.transferMechanism);return jsxs("div",{className:a("bg-gray-50 dark:bg-gray-700 p-6 rounded-lg mb-6",r==null?void 0:r.form,o),children:[jsxs("div",{className:a("flex justify-between items-center mb-4",r==null?void 0:r.header,o),children:[jsx("h3",{className:"text-lg font-medium",children:y?"Edit Transfer":"Add New Transfer"}),jsx("button",{onClick:()=>{w(),x(false);},className:"text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:"Cancel"})]}),f&&!f.isValid&&jsxs("div",{className:"mb-4 bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Please fix the following errors:"}),jsx("ul",{className:"list-disc list-inside text-sm text-red-700 dark:text-red-300",children:f.errors.map((a,l)=>jsx("li",{children:a},l))})]}),f&&f.warnings.length>0&&jsxs("div",{className:"mb-4 bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-1",children:"Warnings:"}),jsx("ul",{className:"list-disc list-inside text-sm text-yellow-700 dark:text-yellow-300",children:f.warnings.map((a,l)=>jsx("li",{children:a},l))})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Destination Country ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",value:i.destinationCountry,onChange:a=>p("destinationCountry",a.target.value),placeholder:"e.g. United Kingdom",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Country Code (ISO)"}),jsx("input",{type:"text",value:i.destinationCountryCode,onChange:a=>p("destinationCountryCode",a.target.value),placeholder:"e.g. GB",maxLength:3,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Organization ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",value:i.recipientOrganization,onChange:a=>p("recipientOrganization",a.target.value),placeholder:"Organization name",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Transfer Mechanism ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("select",{value:i.transferMechanism,onChange:a=>p("transferMechanism",a.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:M.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Adequacy Status"}),jsx("select",{value:i.adequacyStatus,onChange:a=>p("adequacyStatus",a.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:H.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Risk Level"}),jsxs("select",{value:i.riskLevel,onChange:a=>p("riskLevel",a.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsx("option",{value:"low",children:"Low"}),jsx("option",{value:"medium",children:"Medium"}),jsx("option",{value:"high",children:"High"})]})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Data Categories ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",value:i.dataCategories,onChange:a=>p("dataCategories",a.target.value),placeholder:"Comma-separated, e.g. Names, Email addresses, Phone numbers",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"includesSensitiveData",checked:i.includesSensitiveData,onChange:a=>p("includesSensitiveData",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"includesSensitiveData",className:"text-sm font-medium",children:"Includes sensitive personal data"})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Estimated Data Subjects"}),jsx("input",{type:"number",value:i.estimatedDataSubjects,onChange:a=>p("estimatedDataSubjects",a.target.value),placeholder:"Number of data subjects",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Contact Name ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",value:i.recipientContactName,onChange:a=>p("recipientContactName",a.target.value),placeholder:"Contact person name",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Contact Email ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"email",value:i.recipientContactEmail,onChange:a=>p("recipientContactEmail",a.target.value),placeholder:"contact@example.com",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Recipient Contact Phone"}),jsx("input",{type:"text",value:i.recipientContactPhone,onChange:a=>p("recipientContactPhone",a.target.value),placeholder:"Phone number",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Recipient Contact Address"}),jsx("input",{type:"text",value:i.recipientContactAddress,onChange:a=>p("recipientContactAddress",a.target.value),placeholder:"Address",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Purpose of Transfer ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{value:i.purpose,onChange:a=>p("purpose",a.target.value),placeholder:"Describe the purpose of this data transfer",rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Safeguards ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{value:i.safeguards,onChange:a=>p("safeguards",a.target.value),placeholder:`One safeguard per line, e.g.
|
|
4
|
+
End-to-end encryption
|
|
5
|
+
Access control policies
|
|
6
|
+
Regular security audits`,rows:3,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Risk Assessment Summary ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{value:i.riskAssessment,onChange:a=>p("riskAssessment",a.target.value),placeholder:"Summarize the risk assessment for this transfer",rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Transfer Frequency"}),jsx("select",{value:i.frequency,onChange:a=>p("frequency",a.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:Y.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Status"}),jsx("select",{value:i.status,onChange:a=>p("status",a.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:Q.map(a=>jsx("option",{value:a.value,children:a.label},a.value))})]})]}),t&&jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h4",{className:"text-sm font-medium text-blue-800 dark:text-blue-200 mb-3",children:"NDPC Approval Required"}),jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300 mb-3",children:"The selected transfer mechanism requires approval from the Nigeria Data Protection Commission."}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"ndpcApprovalApplied",checked:i.ndpcApprovalApplied,onChange:a=>p("ndpcApprovalApplied",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"ndpcApprovalApplied",className:"text-sm",children:"Application submitted"})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"ndpcApprovalApproved",checked:i.ndpcApprovalApproved,onChange:a=>p("ndpcApprovalApproved",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"ndpcApprovalApproved",className:"text-sm",children:"Approval granted"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"NDPC Reference Number"}),jsx("input",{type:"text",value:i.ndpcApprovalReference,onChange:a=>p("ndpcApprovalReference",a.target.value),placeholder:"Reference number (if available)",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]})]}),ee&&jsxs("div",{className:"mt-4 p-4 bg-gray-100 dark:bg-gray-600 rounded-md",children:[jsx("h4",{className:"text-sm font-medium mb-3",children:"Transfer Impact Assessment"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("input",{type:"checkbox",id:"tiaCompleted",checked:i.tiaCompleted,onChange:a=>p("tiaCompleted",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"tiaCompleted",className:"text-sm",children:"TIA completed"})]}),jsxs("div",{children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"TIA Reference"}),jsx("input",{type:"text",value:i.tiaReference,onChange:a=>p("tiaReference",a.target.value),placeholder:"Document reference",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]})]}),jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[jsx("button",{onClick:()=>{w(),x(false);},className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600",children:"Cancel"}),jsx("button",{onClick:oe,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:y?"Update Transfer":"Add Transfer"})]})]})},me=t=>{var u,b$1;let a$1=d(t),l=c(t);return jsxs("div",{className:a("",r==null?void 0:r.detailPanel,o),children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxs("h3",{className:"text-lg font-medium",children:[t.destinationCountry," \u2014 ",t.recipientOrganization]}),jsxs("div",{className:"flex gap-2",children:[L(t.status),E(t.riskLevel)]})]}),!l.isValid&&jsxs("div",{className:"mb-4 bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Compliance Issues"}),jsx("ul",{className:"list-disc list-inside text-sm text-red-700 dark:text-red-300",children:l.errors.map((s,m)=>jsx("li",{children:s},m))})]}),l.warnings.length>0&&jsxs("div",{className:"mb-4 bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-1",children:"Warnings"}),jsx("ul",{className:"list-disc list-inside text-sm text-yellow-700 dark:text-yellow-300",children:l.warnings.map((s,m)=>jsx("li",{children:s},m))})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Destination:"})," ",t.destinationCountry,t.destinationCountryCode?` (${t.destinationCountryCode})`:""]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Adequacy:"})," ",(u=H.find(s=>s.value===t.adequacyStatus))==null?void 0:u.label]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Frequency:"})," ",(b$1=Y.find(s=>s.value===t.frequency))==null?void 0:b$1.label]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Start Date:"})," ",h(t.startDate)]}),t.endDate&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"End Date:"})," ",h(t.endDate)]}),t.reviewDate&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Next Review:"})," ",h(t.reviewDate)]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Recipient:"})," ",t.recipientOrganization]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Contact:"})," ",t.recipientContact.name," (",t.recipientContact.email,")"]}),t.estimatedDataSubjects&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Subjects:"})," ",t.estimatedDataSubjects.toLocaleString()]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",t.includesSensitiveData?"Yes":"No"]})]})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"Transfer Mechanism"}),jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:b(t.transferMechanism)})})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"Purpose"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md",children:t.purpose})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"Data Categories"}),jsx("div",{className:"flex flex-wrap gap-1",children:t.dataCategories.map((s,m)=>jsx("span",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-600 rounded text-xs",children:s},m))})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"Safeguards"}),jsx("ul",{className:"list-disc list-inside text-sm text-gray-600 dark:text-gray-300",children:t.safeguards.map((s,m)=>jsx("li",{children:s},m))})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"Risk Assessment"}),jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200 mb-2",children:t.riskAssessment}),jsxs("div",{className:"mt-2",children:[jsxs("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:["Automated Assessment (Score: ",a$1.riskScore,")"]}),a$1.factors.length>0&&jsx("ul",{className:"list-disc list-inside text-xs text-gray-600 dark:text-gray-400",children:a$1.factors.map((s,m)=>jsx("li",{children:s},m))}),a$1.recommendations.length>0&&jsxs("div",{className:"mt-2",children:[jsx("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Recommendations:"}),jsx("ul",{className:"list-disc list-inside text-xs text-gray-600 dark:text-gray-400",children:a$1.recommendations.map((s,m)=>jsx("li",{children:s},m))})]})]})]})]}),t.ndpcApproval&&jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"NDPC Approval"}),jsxs("div",{className:a(`p-3 rounded-md ${t.ndpcApproval.approved?"bg-green-50 dark:bg-green-900/20":t.ndpcApproval.applied?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20"}`,r==null?void 0:r.approvalStatus,o),children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",t.ndpcApproval.approved?"Approved":t.ndpcApproval.applied?"Application Submitted":"Not Applied"]}),t.ndpcApproval.referenceNumber&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Reference:"})," ",t.ndpcApproval.referenceNumber]}),t.ndpcApproval.appliedAt&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Applied:"})," ",h(t.ndpcApproval.appliedAt)]}),t.ndpcApproval.approvedAt&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Approved:"})," ",h(t.ndpcApproval.approvedAt)]})]})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium mb-1",children:"Transfer Impact Assessment"}),jsxs("div",{className:`p-3 rounded-md ${t.tiaCompleted?"bg-green-50 dark:bg-green-900/20":"bg-yellow-50 dark:bg-yellow-900/20"}`,children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",t.tiaCompleted?"Completed":"Not Completed"]}),t.tiaReference&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Reference:"})," ",t.tiaReference]})]})]}),jsxs("div",{className:"flex gap-3 mt-6",children:[jsx("button",{onClick:()=>ie(t),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,children:"Edit"}),jsx("button",{onClick:()=>le(t.id),className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",children:"Remove"})]})]})};return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${X}`,r==null?void 0:r.root,o),children:[jsx("h2",{className:a("text-xl font-bold mb-2",r==null?void 0:r.title,o),children:K}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:J}),Z&&se(),!I&&jsx("div",{className:"mb-6",children:jsx("button",{onClick:ne,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Add Transfer"})}),I&&ue(),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"cbStatusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxs("select",{id:"cbStatusFilter",value:C,onChange:t=>te(t.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsx("option",{value:"all",children:"All Statuses"}),Q.map(t=>jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"cbMechanismFilter",className:"block text-sm font-medium mb-1",children:"Mechanism Filter"}),jsxs("select",{id:"cbMechanismFilter",value:A,onChange:t=>re(t.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsx("option",{value:"all",children:"All Mechanisms"}),M.map(t=>jsx("option",{value:t.value,children:t.label},t.value))]})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxs("div",{className:"md:col-span-1",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Transfers"}),k.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No cross-border transfers found."}):jsx("div",{className:a("space-y-2 max-h-96 overflow-y-auto pr-2",r==null?void 0:r.transferList,o),children:k.map(t=>{var a$1,l;return jsxs("div",{className:a(`p-3 rounded-md cursor-pointer ${v===t.id?"bg-[rgb(var(--ndpr-primary)/0.05)] dark:bg-[rgb(var(--ndpr-primary)/0.1)] border border-[rgb(var(--ndpr-primary)/0.2)] dark:border-[rgb(var(--ndpr-primary)/0.3)]":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,r==null?void 0:r.transferItem,o),onClick:()=>D(t.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:t.destinationCountry}),E(t.riskLevel)]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:t.recipientOrganization}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:pe(t.transferMechanism)}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[L(t.status),((a$1=t.ndpcApproval)==null?void 0:a$1.required)&&!((l=t.ndpcApproval)!=null&&l.approved)&&jsx("span",{className:"text-xs text-purple-600 dark:text-purple-400",children:"NDPC Pending"})]})]},t.id)})})]}),jsx("div",{className:"md:col-span-2",children:j?me(j):jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Select a transfer to view details"})})})]})]})};export{xe as a};//# sourceMappingURL=chunk-4JUDKBA2.mjs.map
|
|
7
|
+
//# sourceMappingURL=chunk-4JUDKBA2.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b,d,c,a as a$2}from'./chunk-PYEX7DFR.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {a as a$1,b as b$1}from'./chunk-WWT2ZSNU.mjs';import {useState,useMemo,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var I=[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_interest",label:"Public Interest (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}],N=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"archived",label:"Archived"}],ke=[{value:"data_subject",label:"Directly from Data Subject"},{value:"third_party",label:"Third Party"},{value:"public_source",label:"Public Source"},{value:"other",label:"Other"}];function we(){let l=Date.now();return {id:`proc_${l}_${Math.random().toString(36).substring(2,11)}`,name:"",description:"",controllerDetails:{name:"",contact:"",address:""},lawfulBasis:"consent",lawfulBasisJustification:"",purposes:[],dataCategories:[],dataSubjectCategories:[],recipients:[],retentionPeriod:"",securityMeasures:[],dataSource:"data_subject",dpiaRequired:false,automatedDecisionMaking:false,status:"active",createdAt:l,updatedAt:l}}function ee(l){return l?new Date(l).toLocaleDateString():"N/A"}var Pe=({ropa:l,onAddRecord:R,onUpdateRecord:S,onArchiveRecord:P,title:te="Record of Processing Activities (ROPA)",description:re="Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",className:ae="",buttonClassName:A="",classNames:e,unstyled:d$1})=>{let[b$2,v]=useState("list"),[w,ie]=useState(""),[C,oe]=useState("all"),[D,de]=useState("all"),[n,x]=useState(null),[M,h]=useState([]),[O,L]=useState(""),[j,_]=useState(""),[E,T]=useState(""),[U,$]=useState(""),[J,q]=useState(""),[V,G]=useState(""),[z,H]=useState(""),c$1=useMemo(()=>b(l),[l]),f=useMemo(()=>d(l),[l]),W=useMemo(()=>{let a=[...l.records];if(C!=="all"&&(a=a.filter(r=>r.status===C)),D!=="all"&&(a=a.filter(r=>r.lawfulBasis===D)),w){let r=w.toLowerCase();a=a.filter(u=>u.name.toLowerCase().includes(r)||u.description.toLowerCase().includes(r)||u.dataCategories.some(p=>p.toLowerCase().includes(r))||u.department&&u.department.toLowerCase().includes(r));}return a},[l.records,C,D,w]);useEffect(()=>{n&&(L(n.purposes.join(", ")),_(n.dataCategories.join(", ")),T((n.sensitiveDataCategories||[]).join(", ")),$(n.dataSubjectCategories.join(", ")),q(n.recipients.join(", ")),G(n.securityMeasures.join(", ")),H((n.systemsUsed||[]).join(", ")));},[n==null?void 0:n.id]);let ne=()=>{let a=we();a.controllerDetails.name=l.organizationName,a.controllerDetails.contact=l.organizationContact,a.controllerDetails.address=l.organizationAddress,l.ndpcRegistrationNumber&&(a.controllerDetails.registrationNumber=l.ndpcRegistrationNumber),l.dpoDetails&&(a.controllerDetails.dpoContact=l.dpoDetails.email),x(a),h([]),v("form");},le=a=>{x(a$1({},a)),h([]),v("form");},m=a=>a.split(",").map(r=>r.trim()).filter(r=>r.length>0),ue=()=>{if(!n)return;let a=b$1(a$1({},n),{purposes:m(O),dataCategories:m(j),sensitiveDataCategories:m(E),dataSubjectCategories:m(U),recipients:m(J),securityMeasures:m(V),systemsUsed:m(z),updatedAt:Date.now()});a.sensitiveDataCategories&&a.sensitiveDataCategories.length===0&&(a.sensitiveDataCategories=void 0),a.systemsUsed&&a.systemsUsed.length===0&&(a.systemsUsed=void 0);let r=a$2(a);if(!r.valid){h(r.errors);return}l.records.find(p=>p.id===a.id)?S==null||S(a.id,a):R==null||R(a),x(null),h([]),v("list");},ge=a=>{P==null||P(a);},se=()=>{let a=c(l),r=new Blob([a],{type:"text/csv;charset=utf-8;"}),u=URL.createObjectURL(r),p=document.createElement("a");p.href=u,p.download=`ropa_${l.organizationName.replace(/\s+/g,"_").toLowerCase()}_${new Date().toISOString().slice(0,10)}.csv`,p.click(),setTimeout(()=>URL.revokeObjectURL(u),100);},K=()=>{x(null),h([]),v("list");},g=(a,r)=>{n&&x(u=>u&&b$1(a$1({},u),{[a]:r}));},B=(a,r)=>{n&&x(u=>u&&b$1(a$1({},u),{controllerDetails:b$1(a$1({},u.controllerDetails),{[a]:r})}));},ce=a=>!!a.nextReviewDate&&a.nextReviewDate<=Date.now(),pe=a$1=>{let r={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",inactive:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},u={active:"Active",inactive:"Inactive",archived:"Archived"};return jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${r[a$1]}`,e==null?void 0:e.statusBadge,d$1),children:u[a$1]})},me=a=>jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",children:{consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"}[a]}),be=()=>jsxs("div",{className:a("mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",e==null?void 0:e.orgInfo,d$1),children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"Organization"}),jsx("p",{className:"text-sm font-semibold",children:l.organizationName})]}),l.dpoDetails&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"Data Protection Officer"}),jsx("p",{className:"text-sm font-semibold",children:l.dpoDetails.name}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:l.dpoDetails.email})]}),l.ndpcRegistrationNumber&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"NDPC Registration No."}),jsx("p",{className:"text-sm font-semibold",children:l.ndpcRegistrationNumber})]})]}),jsxs("div",{className:"mt-2 text-xs text-gray-600 dark:text-gray-400",children:["Version ",l.version," | Last Updated: ",ee(l.lastUpdated)]})]}),ve=()=>jsxs("div",{className:a("mb-6",e==null?void 0:e.summary,d$1),children:[jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[jsxs("div",{className:a("p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,d$1),children:[jsx("p",{className:"text-2xl font-bold text-blue-700 dark:text-blue-300",children:c$1.totalRecords}),jsx("p",{className:"text-xs text-blue-600 dark:text-blue-400",children:"Total Records"})]}),jsxs("div",{className:a("p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,d$1),children:[jsx("p",{className:"text-2xl font-bold text-green-700 dark:text-green-300",children:c$1.activeRecords}),jsx("p",{className:"text-xs text-green-600 dark:text-green-400",children:"Active"})]}),jsxs("div",{className:a("p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,d$1),children:[jsx("p",{className:"text-2xl font-bold text-purple-700 dark:text-purple-300",children:c$1.crossBorderRecords}),jsx("p",{className:"text-xs text-purple-600 dark:text-purple-400",children:"Cross-Border"})]}),jsxs("div",{className:a("p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,d$1),children:[jsx("p",{className:"text-2xl font-bold text-orange-700 dark:text-orange-300",children:f.length}),jsx("p",{className:"text-xs text-orange-600 dark:text-orange-400",children:"Records with Gaps"})]})]}),jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("p",{className:"text-sm font-medium mb-2",children:"By Lawful Basis"}),I.map(a=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:a.label.split(" (")[0]}),jsx("span",{className:"font-medium",children:c$1.byLawfulBasis[a.value]||0})]},a.value))]}),jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("p",{className:"text-sm font-medium mb-2",children:"Risk Indicators"}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Sensitive Data"}),jsx("span",{className:"font-medium",children:c$1.sensitiveDataRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"DPIA Required"}),jsx("span",{className:"font-medium",children:c$1.dpiaRequiredRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Automated Decisions"}),jsx("span",{className:"font-medium",children:c$1.automatedDecisionRecords})]}),jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Due for Review"}),jsx("span",{className:`font-medium ${c$1.recordsDueForReview.length>0?"text-red-600 dark:text-red-400":""}`,children:c$1.recordsDueForReview.length})]})]}),c$1.topDepartments.length>0&&jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("p",{className:"text-sm font-medium mb-2",children:"Top Departments"}),c$1.topDepartments.slice(0,5).map(a=>jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsx("span",{className:"text-gray-600 dark:text-gray-400",children:a.department}),jsx("span",{className:"font-medium",children:a.count})]},a.department))]})]}),f.length>0&&jsxs("div",{className:a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md",e==null?void 0:e.complianceGap,d$1),children:[jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-2",children:"Compliance Gaps Detected"}),f.slice(0,5).map(a=>jsxs("div",{className:"mb-2",children:[jsx("p",{className:"text-xs font-medium text-red-700 dark:text-red-300",children:a.recordName}),jsx("ul",{className:"list-disc list-inside",children:a.gaps.map((r,u)=>jsx("li",{className:"text-xs text-red-600 dark:text-red-400",children:r},u))})]},a.recordId)),f.length>5&&jsxs("p",{className:"text-xs text-red-600 dark:text-red-400 mt-1",children:["...and ",f.length-5," more record(s) with gaps."]})]})]}),xe=()=>jsxs("div",{children:[jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"ropaSearch",className:"block text-sm font-medium mb-1",children:"Search"}),jsx("input",{type:"text",id:"ropaSearch",value:w,onChange:a=>ie(a.target.value),placeholder:"Search records...",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"ropaStatusFilter",className:"block text-sm font-medium mb-1",children:"Status"}),jsxs("select",{id:"ropaStatusFilter",value:C,onChange:a=>oe(a.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,d$1),children:[jsx("option",{value:"all",children:"All Statuses"}),N.map(a=>jsx("option",{value:a.value,children:a.label},a.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"ropaBasisFilter",className:"block text-sm font-medium mb-1",children:"Lawful Basis"}),jsxs("select",{id:"ropaBasisFilter",value:D,onChange:a=>de(a.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,d$1),children:[jsx("option",{value:"all",children:"All Bases"}),I.map(a=>jsx("option",{value:a.value,children:a.label.split(" (")[0]},a.value))]})]}),jsxs("div",{className:"flex items-end space-x-2",children:[jsx("button",{onClick:ne,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${A}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),d$1),children:"Add Record"}),jsx("button",{onClick:se,className:a(`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 text-sm ${A}`,(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.exportButton),d$1),children:"Export CSV"})]})]}),W.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm text-center py-8",children:"No processing records found."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:a("w-full text-sm text-left",e==null?void 0:e.table,d$1),children:[jsx("thead",{className:a("text-xs uppercase bg-gray-50 dark:bg-gray-700",e==null?void 0:e.tableHeader,d$1),children:jsxs("tr",{children:[jsx("th",{className:"px-4 py-3",children:"Name"}),jsx("th",{className:"px-4 py-3",children:"Lawful Basis"}),jsx("th",{className:"px-4 py-3",children:"Data Categories"}),jsx("th",{className:"px-4 py-3",children:"Status"}),jsx("th",{className:"px-4 py-3",children:"Last Reviewed"}),jsx("th",{className:"px-4 py-3",children:"Actions"})]})}),jsx("tbody",{children:W.map(a$1=>{let r=ce(a$1),u=f.some(p=>p.recordId===a$1.id);return jsxs("tr",{className:a(`border-b dark:border-gray-600 ${r?"bg-red-50 dark:bg-red-900/10":u?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} hover:bg-gray-50 dark:hover:bg-gray-700`,e==null?void 0:e.tableRow,d$1),children:[jsx("td",{className:"px-4 py-3",children:jsxs("div",{children:[jsx("p",{className:"font-medium",children:a$1.name}),a$1.department&&jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:a$1.department}),r&&jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-medium",children:"Review Overdue"})]})}),jsx("td",{className:"px-4 py-3",children:me(a$1.lawfulBasis)}),jsx("td",{className:"px-4 py-3",children:jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300 max-w-xs truncate",children:a$1.dataCategories.join(", ")})}),jsx("td",{className:"px-4 py-3",children:pe(a$1.status)}),jsx("td",{className:"px-4 py-3 text-xs text-gray-600 dark:text-gray-400",children:ee(a$1.lastReviewedAt)}),jsx("td",{className:"px-4 py-3",children:jsxs("div",{className:"flex space-x-2",children:[jsx("button",{onClick:()=>le(a$1),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline text-xs",children:"Edit"}),a$1.status!=="archived"&&jsx("button",{onClick:()=>ge(a$1.id),className:"text-gray-600 dark:text-gray-400 hover:underline text-xs",children:"Archive"})]})})]},a$1.id)})})]})})]}),fe=()=>{if(!n)return null;let a$1=!l.records.find(r=>r.id===n.id);return jsxs("div",{className:a("",e==null?void 0:e.form,d$1),children:[jsxs("div",{className:a("flex justify-between items-center mb-4",e==null?void 0:e.header,d$1),children:[jsx("h3",{className:"text-lg font-medium",children:a$1?"Add Processing Record":"Edit Processing Record"}),jsx("button",{onClick:K,className:"text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 text-sm",children:"Cancel"})]}),M.length>0&&jsxs("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 rounded-md",children:[jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Please fix the following errors:"}),jsx("ul",{className:"list-disc list-inside",children:M.map((r,u)=>jsx("li",{className:"text-xs text-red-600 dark:text-red-400",children:r},u))})]}),jsxs("div",{className:"space-y-6",children:[jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Basic Information"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"recordName",className:"block text-sm font-medium mb-1",children:"Activity Name *"}),jsx("input",{type:"text",id:"recordName",value:n.name,onChange:r=>g("name",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1),placeholder:"e.g., Customer Account Management"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recordDepartment",className:"block text-sm font-medium mb-1",children:"Department"}),jsx("input",{type:"text",id:"recordDepartment",value:n.department||"",onChange:r=>g("department",r.target.value||void 0),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1),placeholder:"e.g., Marketing"})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"recordDescription",className:"block text-sm font-medium mb-1",children:"Description *"}),jsx("textarea",{id:"recordDescription",value:n.description,onChange:r=>g("description",r.target.value),rows:3,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1),placeholder:"Describe what personal data processing is performed..."})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recordStatus",className:"block text-sm font-medium mb-1",children:"Status *"}),jsx("select",{id:"recordStatus",value:n.status,onChange:r=>g("status",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,d$1),children:N.map(r=>jsx("option",{value:r.value,children:r.label},r.value))})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Controller Details"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"controllerName",className:"block text-sm font-medium mb-1",children:"Controller Name *"}),jsx("input",{type:"text",id:"controllerName",value:n.controllerDetails.name,onChange:r=>B("name",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"controllerContact",className:"block text-sm font-medium mb-1",children:"Controller Contact *"}),jsx("input",{type:"text",id:"controllerContact",value:n.controllerDetails.contact,onChange:r=>B("contact",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1)})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"controllerAddress",className:"block text-sm font-medium mb-1",children:"Controller Address *"}),jsx("input",{type:"text",id:"controllerAddress",value:n.controllerDetails.address,onChange:r=>B("address",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1)})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Lawful Basis (NDPA Section 25)"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasis",className:"block text-sm font-medium mb-1",children:"Lawful Basis *"}),jsx("select",{id:"lawfulBasis",value:n.lawfulBasis,onChange:r=>g("lawfulBasis",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,d$1),children:I.map(r=>jsx("option",{value:r.value,children:r.label},r.value))})]}),jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasisJustification",className:"block text-sm font-medium mb-1",children:"Justification *"}),jsx("textarea",{id:"lawfulBasisJustification",value:n.lawfulBasisJustification,onChange:r=>g("lawfulBasisJustification",r.target.value),rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1),placeholder:"Explain why this lawful basis applies..."})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Data Details"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"purposes",className:"block text-sm font-medium mb-1",children:"Purposes * (comma-separated)"}),jsx("input",{type:"text",id:"purposes",value:O,onChange:r=>L(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1),placeholder:"e.g., Account management, Service delivery"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataCategories",className:"block text-sm font-medium mb-1",children:"Data Categories * (comma-separated)"}),jsx("input",{type:"text",id:"dataCategories",value:j,onChange:r=>_(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1),placeholder:"e.g., Name, Email, Phone number"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sensitiveData",className:"block text-sm font-medium mb-1",children:"Sensitive Data Categories (comma-separated)"}),jsx("input",{type:"text",id:"sensitiveData",value:E,onChange:r=>T(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1),placeholder:"e.g., Health data, Biometric data"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"subjectCategories",className:"block text-sm font-medium mb-1",children:"Data Subject Categories * (comma-separated)"}),jsx("input",{type:"text",id:"subjectCategories",value:U,onChange:r=>$(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1),placeholder:"e.g., Customers, Employees"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recipients",className:"block text-sm font-medium mb-1",children:"Recipients * (comma-separated)"}),jsx("input",{type:"text",id:"recipients",value:J,onChange:r=>q(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1),placeholder:"e.g., Payment processors, Cloud service providers"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataSource",className:"block text-sm font-medium mb-1",children:"Data Source *"}),jsx("select",{id:"dataSource",value:n.dataSource,onChange:r=>g("dataSource",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,d$1),children:ke.map(r=>jsx("option",{value:r.value,children:r.label},r.value))})]}),n.dataSource==="third_party"&&jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"thirdPartyDetails",className:"block text-sm font-medium mb-1",children:"Third-Party Source Details *"}),jsx("input",{type:"text",id:"thirdPartyDetails",value:n.thirdPartySourceDetails||"",onChange:r=>g("thirdPartySourceDetails",r.target.value||void 0),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1),placeholder:"Describe the third-party data source..."})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Retention and Security"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"retentionPeriod",className:"block text-sm font-medium mb-1",children:"Retention Period *"}),jsx("input",{type:"text",id:"retentionPeriod",value:n.retentionPeriod,onChange:r=>g("retentionPeriod",r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1),placeholder:"e.g., 5 years after account closure"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"retentionJustification",className:"block text-sm font-medium mb-1",children:"Retention Justification"}),jsx("input",{type:"text",id:"retentionJustification",value:n.retentionJustification||"",onChange:r=>g("retentionJustification",r.target.value||void 0),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1),placeholder:"Why this retention period is necessary..."})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"securityMeasures",className:"block text-sm font-medium mb-1",children:"Security Measures * (comma-separated)"}),jsx("input",{type:"text",id:"securityMeasures",value:V,onChange:r=>G(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1),placeholder:"e.g., Encryption at rest, Access controls, Audit logging"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"systemsUsed",className:"block text-sm font-medium mb-1",children:"Systems Used (comma-separated)"}),jsx("input",{type:"text",id:"systemsUsed",value:z,onChange:r=>H(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1),placeholder:"e.g., CRM, ERP, Cloud Storage"})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Risk Indicators"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:"dpiaRequired",checked:n.dpiaRequired,onChange:r=>g("dpiaRequired",r.target.checked),className:"rounded border-gray-300 dark:border-gray-600"}),jsx("label",{htmlFor:"dpiaRequired",className:"text-sm font-medium",children:"DPIA Required"})]}),n.dpiaRequired&&jsxs("div",{children:[jsx("label",{htmlFor:"dpiaReference",className:"block text-sm font-medium mb-1",children:"DPIA Reference *"}),jsx("input",{type:"text",id:"dpiaReference",value:n.dpiaReference||"",onChange:r=>g("dpiaReference",r.target.value||void 0),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1),placeholder:"Reference to the completed DPIA"})]}),jsxs("div",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",id:"automatedDecisionMaking",checked:n.automatedDecisionMaking,onChange:r=>g("automatedDecisionMaking",r.target.checked),className:"rounded border-gray-300 dark:border-gray-600"}),jsx("label",{htmlFor:"automatedDecisionMaking",className:"text-sm font-medium",children:"Automated Decision-Making"})]}),n.automatedDecisionMaking&&jsxs("div",{children:[jsx("label",{htmlFor:"automatedDecisionMakingDetails",className:"block text-sm font-medium mb-1",children:"Automated Decision-Making Details *"}),jsx("textarea",{id:"automatedDecisionMakingDetails",value:n.automatedDecisionMakingDetails||"",onChange:r=>g("automatedDecisionMakingDetails",r.target.value||void 0),rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1),placeholder:"Describe the automated decision-making process..."})]})]})]}),jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsx("legend",{className:"text-sm font-medium px-2",children:"Review Schedule"}),jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:jsxs("div",{children:[jsx("label",{htmlFor:"nextReviewDate",className:"block text-sm font-medium mb-1",children:"Next Review Date"}),jsx("input",{type:"date",id:"nextReviewDate",value:n.nextReviewDate?new Date(n.nextReviewDate).toISOString().slice(0,10):"",onChange:r=>g("nextReviewDate",r.target.value?new Date(r.target.value).getTime():void 0),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,d$1)})]})})]}),jsxs("div",{className:"flex justify-end space-x-3",children:[jsx("button",{onClick:K,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-50 dark:hover:bg-gray-700 text-sm",children:"Cancel"}),jsx("button",{onClick:ue,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${A}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),d$1),children:a$1?"Add Record":"Save Changes"})]})]})]})},ye=()=>jsxs("div",{className:"flex space-x-4 mb-6 border-b border-gray-200 dark:border-gray-600",children:[jsx("button",{onClick:()=>v("list"),className:`pb-2 text-sm font-medium ${b$2==="list"?"border-b-2 border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Processing Records"}),jsx("button",{onClick:()=>v("summary"),className:`pb-2 text-sm font-medium ${b$2==="summary"?"border-b-2 border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Compliance Summary"})]});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ae}`,e==null?void 0:e.root,d$1),children:[jsx("h2",{className:a("text-xl font-bold mb-2",e==null?void 0:e.title,d$1),children:te}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:re}),be(),b$2!=="form"&&ye(),b$2==="list"&&xe(),b$2==="summary"&&ve(),b$2==="form"&&fe()]})};export{Pe as a};//# sourceMappingURL=chunk-4VVARDN2.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-4VVARDN2.mjs.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js');function f(i,u){if(typeof i=="string"){let a=i,o=u,r=a,n=/\{\{([^}]+)\}\}/g,c;for(;(c=n.exec(a))!==null;){let e=c[1].trim(),t=o[e]||"";r=r.replace(new RegExp(`\\{\\{\\s*${e}\\s*\\}\\}`,"g"),t);}return r}else {let a=i,o=u,r={},n=[];return a.filter(e=>e.included).sort((e,t)=>(e.order||0)-(t.order||0)).forEach(e=>{let t=e.template||e.customContent||e.defaultContent||"",m=/\{\{([^}]+)\}\}/g,p,g=[];for(;(p=m.exec(t))!==null;)g.push(p[1].trim());g.forEach(s=>{let l="";s in o&&(l=o[s]||""),l||n.push(s),t=t.replace(new RegExp(`\\{\\{\\s*${s}\\s*\\}\\}`,"g"),l);}),r[e.id]=t;}),{fullText:Object.values(r).join(`
|
|
2
|
+
|
|
3
|
+
`),sectionTexts:r,missingVariables:Array.from(new Set(n))}}}var h=[{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
|
+
|
|
5
|
+
- Consent: where you have given clear, informed, and voluntary consent for a specific purpose.
|
|
6
|
+
- Contract: where processing is necessary to fulfil a contract with you or to take steps at your request before entering a contract.
|
|
7
|
+
- Legal obligation: where processing is required to comply with applicable Nigerian law.
|
|
8
|
+
- Vital interest: where processing is necessary to protect your life or that of another person.
|
|
9
|
+
- Public interest: where processing is necessary for the performance of a task carried out in the public interest.
|
|
10
|
+
- Legitimate interest: where processing is necessary for our legitimate interests, provided these are not overridden by your rights and freedoms.`,variables:["orgName"]},{id:"data-usage",title:"Data Usage",description:"Explains the purposes for which personal data is processed.",order:3,required:true,included:true,template:`We use the personal data we collect for the following purposes:
|
|
11
|
+
|
|
12
|
+
- Providing and improving our services at {{website}}.
|
|
13
|
+
- Communicating with you regarding your account, enquiries, or support requests.
|
|
14
|
+
- Sending relevant updates, where you have opted in to receive them.
|
|
15
|
+
- Ensuring the security and integrity of our platform.
|
|
16
|
+
- Complying with legal and regulatory obligations under Nigerian law.
|
|
17
|
+
- Conducting analytics to improve user experience and service quality.
|
|
18
|
+
|
|
19
|
+
We will not process your data for purposes incompatible with those stated above without providing you with notice and, where required, obtaining your consent.`,variables:["website"]},{id:"data-sharing",title:"Data Sharing and Disclosure",description:"Details when and with whom personal data may be shared.",order:4,required:true,included:true,template:`{{orgName}} does not sell personal data. We may share your data with the following categories of recipients:
|
|
20
|
+
|
|
21
|
+
- Service providers and processors who assist us in operating our services, under strict data processing agreements.
|
|
22
|
+
- Regulatory and law enforcement authorities when required by Nigerian law or valid legal process.
|
|
23
|
+
- Professional advisers, including lawyers, auditors, and insurers, where necessary.
|
|
24
|
+
- Business partners, only with your explicit consent and for clearly stated purposes.
|
|
25
|
+
|
|
26
|
+
Any cross-border transfer of personal data will comply with the requirements of the NDPA 2023, including ensuring adequate safeguards are in place in the receiving jurisdiction.`,variables:["orgName"]},{id:"data-subject-rights",title:"Data Subject Rights",description:"Outlines the rights of data subjects under the NDPA.",order:5,required:true,included:true,template:`Under the NDPA 2023, you have the following rights regarding your personal data:
|
|
27
|
+
|
|
28
|
+
- Right of access: request a copy of the personal data we hold about you.
|
|
29
|
+
- Right to rectification: request correction of inaccurate or incomplete data.
|
|
30
|
+
- Right to erasure: request deletion of your personal data where there is no compelling reason for continued processing.
|
|
31
|
+
- Right to restrict processing: request limitation of how we process your data.
|
|
32
|
+
- Right to data portability: receive your data in a structured, commonly used format.
|
|
33
|
+
- Right to object: object to processing based on legitimate interest or for direct marketing purposes.
|
|
34
|
+
- Right to withdraw consent: withdraw previously given consent at any time without affecting prior processing.
|
|
35
|
+
|
|
36
|
+
To exercise any of these rights, contact us at {{privacyEmail}}. We will respond to your request within 30 days.`,variables:["privacyEmail"]},{id:"data-retention",title:"Data Retention",description:"Describes how long personal data is retained and the criteria for retention periods.",order:6,required:true,included:true,template:`{{orgName}} retains personal data only for as long as necessary to fulfil the purposes for which it was collected, or as required by applicable Nigerian law. Retention periods are determined based on:
|
|
37
|
+
|
|
38
|
+
- The nature of the data and the purposes for processing.
|
|
39
|
+
- Legal, regulatory, and contractual obligations.
|
|
40
|
+
- Legitimate business needs such as maintaining records for audits or dispute resolution.
|
|
41
|
+
|
|
42
|
+
When personal data is no longer needed, it will be securely deleted or anonymised in accordance with our data retention policy.`,variables:["orgName"]},{id:"data-security",title:"Data Security",description:"Describes the security measures in place to protect personal data.",order:7,required:true,included:true,template:`We implement appropriate technical and organisational measures to protect personal data against unauthorised access, alteration, disclosure, or destruction. These measures include:
|
|
43
|
+
|
|
44
|
+
- Encryption of data in transit and at rest.
|
|
45
|
+
- Access controls and authentication mechanisms.
|
|
46
|
+
- Regular security assessments and vulnerability testing.
|
|
47
|
+
- Staff training on data protection and information security.
|
|
48
|
+
- Incident response procedures in line with NDPA breach notification requirements.
|
|
49
|
+
|
|
50
|
+
While we strive to protect your data, no method of transmission or storage is completely secure. If you become aware of any security incident, please contact us immediately at {{privacyEmail}}.`,variables:["privacyEmail"]},{id:"contact-info",title:"Contact Information",description:"Provides contact details for privacy-related enquiries and the Data Protection Officer.",order:8,required:true,included:true,template:`If you have questions, concerns, or requests regarding this privacy policy or our data practices, please contact us:
|
|
51
|
+
|
|
52
|
+
Organisation: {{orgName}}
|
|
53
|
+
Address: {{address}}
|
|
54
|
+
Email: {{privacyEmail}}
|
|
55
|
+
Website: {{website}}
|
|
56
|
+
|
|
57
|
+
Data Protection Officer: {{dpoName}}
|
|
58
|
+
DPO Email: {{dpoEmail}}
|
|
59
|
+
|
|
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
|
+
|
|
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"]}],y=[{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 v(){return {sections:h.map(i=>chunkMQFZHA2D_js.a({},i)),variables:y.map(i=>chunkMQFZHA2D_js.a({},i))}}exports.a=f;exports.b=h;exports.c=y;exports.d=v;//# sourceMappingURL=chunk-5RSOLEEP.js.map
|
|
63
|
+
//# sourceMappingURL=chunk-5RSOLEEP.js.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
'use strict';var chunk5RSOLEEP_js=require('./chunk-5RSOLEEP.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var ur=({sections:P=chunk5RSOLEEP_js.b,variables:R=chunk5RSOLEEP_js.c,onGenerate:S,title:q="NDPA Privacy Policy Generator",description:B="Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 24.",className:j="",buttonClassName:L="",generateButtonText:z="Generate Policy",showPreview:A=true,allowEditing:V=true,classNames:e,unstyled:x=false})=>{let[T,U]=react.useState(P),[a,t]=react.useState(R),[m,C]=react.useState("sections"),[E,X]=react.useState(""),[F,D]=react.useState(""),[_,G]=react.useState(false),[h,W]=react.useState({});react.useEffect(()=>{U(P);},[P]),react.useEffect(()=>{t(R);},[R]);let s=n=>{U(b=>b.map(p=>p.id===n?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},p),{included:!p.included}):p));},g=(n,b)=>{t(p=>p.map(u=>u.id===n?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{value:b}):u)),h[n]&&W(p=>{let u=chunkMQFZHA2D_js.a({},p);return delete u[n],u});},v=()=>{let n={},b=true;return a.forEach(p=>{p.required&&!p.value&&(n[p.id]=`${p.name} is required`,b=false);}),W(n),b},k=()=>{if(!v()){C("variables");return}let n=T.filter(u=>u.included),b=Object.fromEntries(a.map(u=>[u.name,u.value])),p="";n.forEach(u=>{p+=`## ${u.title}
|
|
2
|
+
|
|
3
|
+
`,p+=chunk5RSOLEEP_js.a(u.template,b),p+=`
|
|
4
|
+
|
|
5
|
+
`;}),X(p),D(p),G(true),C("preview");},H=()=>{S({sections:T,variables:a,content:V?F:E});},I=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",e==null?void 0:e.sectionList,x),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Select Policy Sections"}),T.map(n=>jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("border border-gray-200 dark:border-gray-700 rounded-md p-4",e==null?void 0:e.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:`section-${n.id}`,type:"checkbox",checked:n.included,onChange:()=>s(n.id),disabled:n.required,className:chunkE64TU6IU_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",e==null?void 0:e.input,x)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:`section-${n.id}`,className:"font-medium text-gray-900 dark:text-white",children:[n.title," ",n.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),n.description&&jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:n.description})]})]})},n.id)),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{onClick:()=>C("variables"),className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${L}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.generateButton),x),children:"Next: Fill Variables"})})]}),J=()=>{let n={};return a.forEach(b=>{let p=b.id.split(".")[0];n[p]||(n[p]=[]),n[p].push(b);}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",e==null?void 0:e.form,x),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Fill Policy Variables"}),jsxRuntime.jsx("div",{className:"space-y-6",children:Object.entries(n).map(([b,p])=>{let u=T.find(r=>r.id===b);return u&&!u.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:u?u.title:"General Information"}),jsxRuntime.jsx("div",{className:"space-y-4",children:p.map(r=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`var-${r.id}`,className:"block text-sm font-medium mb-1",children:[r.name," ",r.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),r.description&&jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-2",children:r.description}),r.inputType==="textarea"?jsxRuntime.jsx("textarea",{id:`var-${r.id}`,value:r.value,onChange:c=>g(r.id,c.target.value),rows:4,className:chunkE64TU6IU_js.a(`w-full px-3 py-2 border ${h[r.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`,e==null?void 0:e.input,x),required:r.required}):r.inputType==="select"&&r.options?jsxRuntime.jsxs("select",{id:`var-${r.id}`,value:r.value,onChange:c=>g(r.id,c.target.value),className:chunkE64TU6IU_js.a(`w-full px-3 py-2 border ${h[r.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`,e==null?void 0:e.input,x),required:r.required,children:[jsxRuntime.jsx("option",{value:"",children:"Select an option"}),r.options.map(c=>jsxRuntime.jsx("option",{value:c,children:c},c))]}):jsxRuntime.jsx("input",{id:`var-${r.id}`,type:r.inputType,value:r.value,onChange:c=>g(r.id,c.target.value),className:chunkE64TU6IU_js.a(`w-full px-3 py-2 border ${h[r.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`,e==null?void 0:e.input,x),required:r.required}),h[r.id]&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-500",children:h[r.id]})]},r.id))})]},b)})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>C("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 ${L}`,children:"Back to Sections"}),jsxRuntime.jsx("button",{onClick:k,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${L}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.generateButton),x),children:z})]})]})},N=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Preview Generated Policy"}),V?jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("label",{htmlFor:"policy-content",className:"block text-sm font-medium mb-1",children:"Edit Policy Content"}),jsxRuntime.jsx("textarea",{id:"policy-content",value:F,onChange:n=>D(n.target.value),rows:20,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] font-mono text-sm"})]}):jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4",children:jsxRuntime.jsx("div",{className:"prose dark:prose-invert max-w-none",children:E.split(`
|
|
6
|
+
`).map((n,b)=>n.startsWith("## ")?jsxRuntime.jsx("h2",{className:"text-xl font-bold mt-6 mb-3",children:n.substring(3)},b):n.startsWith("### ")?jsxRuntime.jsx("h3",{className:"text-lg font-bold mt-4 mb-2",children:n.substring(4)},b):n===""?jsxRuntime.jsx("br",{},b):jsxRuntime.jsx("p",{className:"mb-2",children:n},b))})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>C("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 ${L}`,children:"Back to Variables"}),jsxRuntime.jsx("button",{onClick:H,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${L}`,children:"Save Policy"})]})]}),K=()=>{switch(m){case "sections":return I();case "variables":return J();case "preview":return N();default:return I()}};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${j}`,e==null?void 0:e.root,x),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",e==null?void 0:e.header,x),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",e==null?void 0:e.title,x),children:q}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-300",e==null?void 0:e.description,x),children:B})]}),jsxRuntime.jsx("div",{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"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${m==="sections"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"1"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Sections"})]}),jsxRuntime.jsxs("li",{className:`flex w-full items-center ${m==="variables"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${m==="variables"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"2"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Variables"})]}),jsxRuntime.jsxs("li",{className:`flex items-center ${m==="preview"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"}`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${m==="preview"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"3"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Preview"})]})]})}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",e==null?void 0:e.complianceNotice,x),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"This tool helps you generate a privacy policy that aligns with the Nigeria Data Protection Act (NDPA) 2023. While we strive to ensure compliance, we recommend having the final policy reviewed by a legal professional familiar with NDPA requirements."})]}),K()]})};var wr=({content:P,sections:R,variables:S,onExport:q,onEdit:B,title:j="Privacy Policy Preview",description:L="Preview your NDPA-compliant privacy policy before exporting.",className:z="",buttonClassName:A="",showExportOptions:V=true,showEditButton:e=true,showTableOfContents:x=true,showMetadata:T=true,organizationName:U,lastUpdated:a=new Date,classNames:t,unstyled:m=false})=>{let[C,E]=react.useState("preview"),F=(()=>{let s=P.split(`
|
|
7
|
+
`),g=[];return s.forEach(v=>{if(v.startsWith("## ")){let k=v.substring(3).trim(),H=k.toLowerCase().replace(/[^a-z0-9]+/g,"-");g.push({id:H,title:k,level:2});}else if(v.startsWith("### ")){let k=v.substring(4).trim(),H=k.toLowerCase().replace(/[^a-z0-9]+/g,"-");g.push({id:H,title:k,level:3});}}),g})(),D=s=>{if(q)q(s);else if(s==="markdown"){let g=document.createElement("a"),v=new Blob([P],{type:"text/markdown"});g.href=URL.createObjectURL(v),g.download=`privacy-policy-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(g),g.click(),document.body.removeChild(g);}},_=()=>!x||F.length===0?null:jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Table of Contents"}),jsxRuntime.jsx("ul",{className:"space-y-1",children:F.map((s,g)=>jsxRuntime.jsx("li",{style:{marginLeft:`${(s.level-2)*1.5}rem`},children:jsxRuntime.jsx("a",{href:`#${s.id}`,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline",children:s.title})},g))})]}),G=()=>T?jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h1",{className:"text-2xl font-bold mb-2",children:U?`${U} Privacy Policy`:"Privacy Policy"}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Last Updated: ",a.toLocaleDateString()]})]}):null,h=()=>jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("prose dark:prose-invert max-w-none",t==null?void 0:t.sectionContent,m),children:P.split(`
|
|
8
|
+
`).map((s,g)=>{if(s.startsWith("## ")){let v=s.substring(3).trim(),k=v.toLowerCase().replace(/[^a-z0-9]+/g,"-");return jsxRuntime.jsx("h2",{id:k,className:chunkE64TU6IU_js.a("text-xl font-bold mt-6 mb-3",t==null?void 0:t.sectionTitle,m),children:v},g)}else if(s.startsWith("### ")){let v=s.substring(4).trim(),k=v.toLowerCase().replace(/[^a-z0-9]+/g,"-");return jsxRuntime.jsx("h3",{id:k,className:chunkE64TU6IU_js.a("text-lg font-bold mt-4 mb-2",t==null?void 0:t.sectionTitle,m),children:v},g)}else return s===""?jsxRuntime.jsx("br",{},g):jsxRuntime.jsx("p",{className:"mb-2",children:s},g)})}),W=()=>V?jsxRuntime.jsxs("div",{className:"mt-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Export Options"}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-3",children:[jsxRuntime.jsx("button",{onClick:()=>D("pdf"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${A}`,children:"Export as PDF"}),jsxRuntime.jsx("button",{onClick:()=>D("docx"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${A}`,children:"Export as DOCX"}),jsxRuntime.jsx("button",{onClick:()=>D("html"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${A}`,children:"Export as HTML"}),jsxRuntime.jsx("button",{onClick:()=>D("markdown"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${A}`,children:"Export as Markdown"})]})]}):null;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${z}`,t==null?void 0:t.root,m),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex justify-between items-start mb-6",t==null?void 0:t.header,m),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",t==null?void 0:t.title,m),children:j}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-300",t==null?void 0:t.description,m),children:L})]}),e&&B&&jsxRuntime.jsx("button",{onClick:B,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 ${A}`,children:"Edit Policy"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",t==null?void 0:t.complianceNotice,m),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"This privacy policy has been generated to align with the Nigeria Data Protection Act (NDPA) 2023. We recommend having the final policy reviewed by a legal professional familiar with NDPA requirements before publishing it on your website or sharing it with your users."})]}),jsxRuntime.jsx("div",{className:"mb-6 border-b border-gray-200 dark:border-gray-700",children:jsxRuntime.jsxs("ul",{className:"flex flex-wrap -mb-px",children:[jsxRuntime.jsx("li",{className:"mr-2",children:jsxRuntime.jsx("button",{onClick:()=>E("preview"),className:`inline-block p-4 ${C==="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("li",{className:"mr-2",children:jsxRuntime.jsx("button",{onClick:()=>E("markdown"),className:`inline-block p-4 ${C==="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:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 p-4 rounded-md",t==null?void 0:t.content,m),children:C==="preview"?jsxRuntime.jsxs("div",{children:[G(),_(),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("bg-gray-50 dark:bg-gray-700 p-6 rounded-md",t==null?void 0:t.section,m),children:h()})]}):jsxRuntime.jsx("div",{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:P})})}),W()]})};var Sr=({content:P,title:R="Privacy Policy",organizationName:S,lastUpdated:q=new Date,onExportComplete:B,componentTitle:j="Export Privacy Policy",description:L="Export your NDPA-compliant privacy policy in various formats.",className:z="",buttonClassName:A="",showExportHistory:V=true,includeComplianceNotice:e=true,includeLogo:x=false,logoUrl:T,customStyles:U,classNames:a,unstyled:t=false})=>{let[m,C]=react.useState([]),[E,X]=react.useState("pdf"),[F,D]=react.useState(false),[_,G]=react.useState(null),[h,W]=react.useState(""),[s,g]=react.useState(""),[v,k]=react.useState(""),[H,I]=react.useState(false),J=r=>{let c=new Date().toISOString().split("T")[0];return `${S?S.toLowerCase().replace(/[^a-z0-9]+/g,"-"):"privacy-policy"}-privacy-policy-${c}.${r.toLowerCase()}`},N=r=>h?h.endsWith(`.${r.toLowerCase()}`)?h:`${h}.${r.toLowerCase()}`:J(r),K=()=>{let r=S?`${S} ${R}`:R,c=q.toLocaleDateString(),w=`<!DOCTYPE html>
|
|
9
|
+
<html lang="en">
|
|
10
|
+
<head>
|
|
11
|
+
<meta charset="UTF-8">
|
|
12
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
13
|
+
<title>${r}</title>
|
|
14
|
+
<style>
|
|
15
|
+
body {
|
|
16
|
+
font-family: Arial, sans-serif;
|
|
17
|
+
line-height: 1.6;
|
|
18
|
+
color: #333;
|
|
19
|
+
max-width: 800px;
|
|
20
|
+
margin: 0 auto;
|
|
21
|
+
padding: 20px;
|
|
22
|
+
}
|
|
23
|
+
h1 {
|
|
24
|
+
font-size: 24px;
|
|
25
|
+
margin-bottom: 10px;
|
|
26
|
+
}
|
|
27
|
+
h2 {
|
|
28
|
+
font-size: 20px;
|
|
29
|
+
margin-top: 30px;
|
|
30
|
+
margin-bottom: 10px;
|
|
31
|
+
border-bottom: 1px solid #eee;
|
|
32
|
+
padding-bottom: 5px;
|
|
33
|
+
}
|
|
34
|
+
h3 {
|
|
35
|
+
font-size: 18px;
|
|
36
|
+
margin-top: 20px;
|
|
37
|
+
margin-bottom: 10px;
|
|
38
|
+
}
|
|
39
|
+
p {
|
|
40
|
+
margin-bottom: 15px;
|
|
41
|
+
}
|
|
42
|
+
.header {
|
|
43
|
+
text-align: center;
|
|
44
|
+
margin-bottom: 30px;
|
|
45
|
+
}
|
|
46
|
+
.footer {
|
|
47
|
+
margin-top: 50px;
|
|
48
|
+
text-align: center;
|
|
49
|
+
font-size: 12px;
|
|
50
|
+
color: #666;
|
|
51
|
+
border-top: 1px solid #eee;
|
|
52
|
+
padding-top: 20px;
|
|
53
|
+
}
|
|
54
|
+
.logo {
|
|
55
|
+
max-width: 200px;
|
|
56
|
+
margin-bottom: 20px;
|
|
57
|
+
}
|
|
58
|
+
.last-updated {
|
|
59
|
+
font-size: 12px;
|
|
60
|
+
color: #666;
|
|
61
|
+
margin-bottom: 30px;
|
|
62
|
+
}
|
|
63
|
+
.compliance-notice {
|
|
64
|
+
background-color: #f8f9fa;
|
|
65
|
+
border: 1px solid #e9ecef;
|
|
66
|
+
padding: 15px;
|
|
67
|
+
margin-bottom: 30px;
|
|
68
|
+
font-size: 14px;
|
|
69
|
+
}
|
|
70
|
+
${U||""}
|
|
71
|
+
</style>
|
|
72
|
+
</head>
|
|
73
|
+
<body>
|
|
74
|
+
<div class="header">
|
|
75
|
+
${x&&T?`<img src="${T}" alt="${S||"Company"} Logo" class="logo">`:""}
|
|
76
|
+
${s?`<div class="custom-header">${s}</div>`:""}
|
|
77
|
+
<h1>${r}</h1>
|
|
78
|
+
<div class="last-updated">Last Updated: ${c}</div>
|
|
79
|
+
</div>`;e&&(w+=`
|
|
80
|
+
<div class="compliance-notice">
|
|
81
|
+
<strong>NDPA Compliance Notice:</strong> This privacy policy has been created to comply with the Nigeria Data Protection Act (NDPA) 2023.
|
|
82
|
+
It outlines how we collect, use, disclose, and protect your personal information in accordance with NDPA requirements.
|
|
83
|
+
</div>`);let Q=P.replace(/^## (.*?)$/gm,"<h2>$1</h2>").replace(/^### (.*?)$/gm,"<h3>$1</h3>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>");return w+=`
|
|
84
|
+
<div class="content">
|
|
85
|
+
<p>${Q}</p>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
<div class="footer">
|
|
89
|
+
${v?`<div class="custom-footer">${v}</div>`:""}
|
|
90
|
+
<p>© ${new Date().getFullYear()} ${S||"Company"}. All rights reserved.</p>
|
|
91
|
+
</div>
|
|
92
|
+
</body>
|
|
93
|
+
</html>`,w},n=()=>chunkMQFZHA2D_js.d(null,null,function*(){D(true),G(null);try{let r=E.toLowerCase(),c="",w;switch(r){case "pdf":let rr=K();w=new Blob([rr],{type:"text/html"}),c=URL.createObjectURL(w);break;case "docx":w=new Blob([P],{type:"text/plain"}),c=URL.createObjectURL(w);break;case "html":let lr=K();w=new Blob([lr],{type:"text/html"}),c=URL.createObjectURL(w);break;default:w=new Blob([P],{type:"text/markdown"}),c=URL.createObjectURL(w);break}let Q=N(r),Y=document.createElement("a");Y.href=c,Y.download=Q,document.body.appendChild(Y),Y.click(),document.body.removeChild(Y);let dr={id:`export_${Date.now()}`,format:r,timestamp:Date.now(),url:c,filename:Q};C(rr=>[dr,...rr]),B&&B(r,c);}catch(r){console.error("Export error:",r),G("An error occurred during export. Please try again.");}finally{D(false);}}),b=()=>{let r=[{value:"pdf",label:"PDF Document (.pdf)"},{value:"docx",label:"Word Document (.docx)"},{value:"html",label:"Web Page (.html)"},{value:"markdown",label:"Markdown (.md)"}];return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",a==null?void 0:a.formatSelector,t),children:[jsxRuntime.jsx("label",{htmlFor:"export-format",className:"block text-sm font-medium mb-1",children:"Export Format"}),jsxRuntime.jsx("select",{id:"export-format",value:E,onChange:c=>X(c.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",a==null?void 0:a.formatOption,t),children:r.map(c=>jsxRuntime.jsx("option",{value:c.value,children:c.label},c.value))})]})},p=()=>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:()=>I(false),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] text-sm",children:"Hide Advanced Options"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"custom-filename",className:"block text-sm font-medium mb-1",children:"Custom Filename"}),jsxRuntime.jsx("input",{type:"text",id:"custom-filename",value:h,onChange:r=>W(r.target.value),placeholder:J(E),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:"Leave blank to use the default filename format."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"custom-header",className:"block text-sm font-medium mb-1",children:"Custom Header HTML (for HTML/PDF exports)"}),jsxRuntime.jsx("textarea",{id:"custom-header",value:s,onChange:r=>g(r.target.value),rows:3,placeholder:"<div>Custom header content</div>",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"custom-footer",className:"block text-sm font-medium mb-1",children:"Custom Footer HTML (for HTML/PDF exports)"}),jsxRuntime.jsx("textarea",{id:"custom-footer",value:v,onChange:r=>k(r.target.value),rows:3,placeholder:"<div>Custom footer content</div>",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:"include-compliance-notice",type:"checkbox",checked:e,onChange:r=>I(r.target.checked),className:"w-4 h-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))] dark:focus:ring-[rgb(var(--ndpr-ring))] dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsx("label",{htmlFor:"include-compliance-notice",className:"font-medium text-gray-900 dark:text-white",children:"Include NDPA Compliance Notice"}),jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Adds a notice explaining that this policy complies with NDPA requirements."})]})]})]}):jsxRuntime.jsx("button",{type:"button",onClick:()=>I(true),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] text-sm mb-6",children:"Show Advanced Options"}),u=()=>!V||m.length===0?null:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-6",a==null?void 0:a.preview,t),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 text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Date"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Format"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Filename"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-700 divide-y divide-gray-200 dark:divide-gray-600",children:m.map(r=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:new Date(r.timestamp).toLocaleString()}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:r.format.toUpperCase()}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:r.filename}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:jsxRuntime.jsx("a",{href:r.url,download:r.filename,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:text-[rgb(var(--ndpr-primary-hover))] dark:hover:text-[rgb(var(--ndpr-primary-hover))] mr-4",children:"Download"})})]},r.id))})]})})]});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${z}`,a==null?void 0:a.root,t),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",a==null?void 0:a.header,t),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",a==null?void 0:a.title,t),children:j}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-300",a==null?void 0:a.description,t),children:L})]}),b(),p(),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("button",{onClick:n,disabled:F,className:chunkE64TU6IU_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${A} ${F?"opacity-70 cursor-not-allowed":""}`,(a==null?void 0:a.primaryButton)||(a==null?void 0:a.exportButton),t),children:F?"Exporting...":`Export as ${E.toUpperCase()}`}),_&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-500",children:_})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",a==null?void 0:a.complianceNotice,t),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"Export Tips"}),jsxRuntime.jsxs("ul",{className:"text-blue-700 dark:text-blue-300 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."})]})]}),u()]})};exports.a=ur;exports.b=wr;exports.c=Sr;//# sourceMappingURL=chunk-BGHQTZAC.js.map
|
|
94
|
+
//# sourceMappingURL=chunk-BGHQTZAC.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {a}from'./chunk-AYKLAEOU.mjs';import {jsxs,jsx}from'react/jsx-runtime';import F from'react';var E=({sections:d,answers:k,onAnswerChange:y,currentSectionIndex:b,onNextSection:C,onPrevSection:P,validationErrors:$={},readOnly:x=false,className:A="",buttonClassName:D="",nextButtonText:o="Next",prevButtonText:N="Previous",submitButtonText:h="Submit",showProgress:c=true,progress:v,classNames:w={},unstyled:S=false})=>{let u=d[b],i=b===d.length-1,a$1=(e,m)=>{let n=m?w[m]:void 0;return !n&&m==="nextButton"&&(n=w.primaryButton),!n&&m==="prevButton"&&(n=w.secondaryButton),a(e,n,S)},g=e=>e.showWhen?e.showWhen.every(m=>{let n=k[m.questionId];switch(m.operator){case "equals":return n===m.value;case "contains":return Array.isArray(n)?n.includes(m.value):false;case "greaterThan":return typeof n=="number"?n>m.value:false;case "lessThan":return typeof n=="number"?n<m.value:false;default:return true}}):true,R=e=>a$1(`w-full px-3 py-2 border rounded-md ${e?"border-red-500":"border-gray-300 dark:border-gray-600"} focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100`,"input"),B=e=>{if(!g(e))return null;let m=$[e.id],n=k[e.id];return jsxs("div",{className:a$1("mb-6","question"),children:[jsxs("div",{className:"mb-2",children:[jsxs("label",{htmlFor:e.id,className:a$1("block text-sm font-medium text-gray-900 dark:text-gray-100","questionText"),children:[e.text,e.required&&jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),e.guidance&&jsx("p",{className:a$1("mt-1 text-sm text-gray-600 dark:text-gray-400","guidance"),children:e.guidance})]}),e.type==="text"&&jsx("input",{type:"text",id:e.id,value:n||"",onChange:s=>y(e.id,s.target.value),disabled:x,className:R(m)}),e.type==="textarea"&&jsx("textarea",{id:e.id,value:n||"",onChange:s=>y(e.id,s.target.value),disabled:x,rows:4,className:R(m)}),e.type==="select"&&e.options&&jsxs("select",{id:e.id,value:n||"",onChange:s=>y(e.id,s.target.value),disabled:x,className:R(m),children:[jsx("option",{value:"",children:"Select an option"}),e.options.map(s=>jsx("option",{value:s.value,children:s.label},s.value))]}),e.type==="radio"&&e.options&&jsx("div",{className:a$1("space-y-2","radioGroup"),children:e.options.map(s=>jsxs("div",{className:a$1("flex items-center","radioOption"),children:[jsx("input",{type:"radio",id:`${e.id}_${s.value}`,name:e.id,value:s.value,checked:n===s.value,onChange:()=>y(e.id,s.value),disabled:x,className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] border-gray-300 dark:border-gray-600"}),jsxs("label",{htmlFor:`${e.id}_${s.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:[s.label,s.riskLevel&&jsxs("span",{className:`ml-2 text-xs px-2 py-1 rounded ${s.riskLevel==="low"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":s.riskLevel==="medium"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:[s.riskLevel.charAt(0).toUpperCase()+s.riskLevel.slice(1)," Risk"]})]})]},s.value))}),e.type==="checkbox"&&e.options&&jsx("div",{className:"space-y-2",children:e.options.map(s=>jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"checkbox",id:`${e.id}_${s.value}`,value:s.value,checked:Array.isArray(n)?n.includes(s.value):false,onChange:L=>{let Q=Array.isArray(n)?[...n]:[];L.target.checked?y(e.id,[...Q,s.value]):y(e.id,Q.filter(j=>j!==s.value));},disabled:x,className:"h-4 w-4 rounded text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] border-gray-300 dark:border-gray-600"}),jsx("label",{htmlFor:`${e.id}_${s.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:s.label})]},s.value))}),e.type==="scale"&&jsxs("div",{children:[jsx("div",{className:"flex justify-between mb-2",children:e.scaleLabels&&Object.entries(e.scaleLabels).map(([s,L])=>jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 text-center",style:{width:`${100/Object.keys(e.scaleLabels||{}).length}%`},children:L},s))}),jsx("input",{type:"range",id:e.id,min:e.minValue||1,max:e.maxValue||5,value:n||e.minValue||1,onChange:s=>y(e.id,parseInt(s.target.value,10)),disabled:x,className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"}),jsxs("div",{className:"mt-1 text-sm text-gray-600 dark:text-gray-400 text-center",children:["Selected value: ",n||e.minValue||1]})]}),m&&jsx("p",{className:"mt-1 text-sm text-red-500",children:m})]},e.id)};return u?jsxs("div",{className:`${a$1("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6","root")} ${A}`,children:[c&&jsxs("div",{className:a$1("mb-6","header"),children:[jsxs("div",{className:"flex justify-between text-sm text-gray-600 dark:text-gray-400 mb-1",children:[jsxs("span",{children:["Section ",b+1," of ",d.length]}),jsx("span",{children:v!==void 0?`${v}% Complete`:""})]}),jsx("div",{className:a$1("w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700","progressBar"),children:jsx("div",{className:"bg-[rgb(var(--ndpr-primary))] h-2.5 rounded-full",style:{width:`${v!==void 0?v:(b+1)/d.length*100}%`}})})]}),jsx("h2",{className:a$1("text-xl font-bold mb-2 text-gray-900 dark:text-white","title"),children:u.title}),u.description&&jsx("p",{className:a$1("mb-6 text-gray-600 dark:text-gray-300","sectionTitle"),children:u.description}),jsx("div",{className:a$1("space-y-6","section"),children:u.questions.map(e=>B(e))}),jsxs("div",{className:a$1("mt-8 flex justify-between","navigation"),children:[jsx("button",{type:"button",onClick:P,disabled:b===0||x,className:`${a$1("px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed","prevButton")} ${D}`,children:N}),jsx("button",{type:"button",onClick:C,disabled:x,className:`${a$1("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] disabled:opacity-50 disabled:cursor-not-allowed","nextButton")} ${D}`,children:i?h:o})]})]}):jsx("div",{children:"No section found."})};var U=({result:d,sections:k,showFullReport:y=true,allowPrint:b=true,allowExport:C=true,onExport:P,className:$="",buttonClassName:x="",classNames:A={},unstyled:D=false})=>{let o=(i,a$1)=>{let g=a$1?A[a$1]:void 0;return !g&&a$1==="printButton"&&(g=A.primaryButton),a(i,g,D)},N=i=>new Date(i).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),v=i=>{let a=d.answers[i];return a==null?"Not answered":typeof a=="boolean"?a?"Yes":"No":Array.isArray(a)?a.join(", "):String(a)},w=()=>{window.print();},S=i=>{P&&P(i);},u=i=>jsx("span",{className:o(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[i]}`,"riskBadge"),children:i.charAt(0).toUpperCase()+i.slice(1)});return jsxs("div",{className:`${o("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 print:shadow-none print:p-0","root")} ${$}`,children:[jsxs("div",{className:o("mb-8 border-b border-gray-200 dark:border-gray-700 pb-6 print:pb-4","header"),children:[jsxs("div",{className:"flex justify-between items-start",children:[jsxs("div",{children:[jsx("h1",{className:o("text-2xl font-bold text-gray-900 dark:text-white mb-2","title"),children:"Data Protection Impact Assessment Report"}),jsx("h2",{className:"text-xl text-gray-700 dark:text-gray-300 mb-4",children:d.title})]}),(b||C)&&jsxs("div",{className:"flex space-x-2 print:hidden",children:[b&&jsx("button",{onClick:w,className:`${o("px-3 py-1 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600","printButton")} ${x}`,children:jsxs("span",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})}),"Print"]})}),C&&jsx("div",{className:"relative inline-block",children:jsx("button",{onClick:()=>S("pdf"),className:`px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${x}`,children:jsxs("span",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Export PDF"]})})})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Assessor:"})," ",d.assessor.name,", ",d.assessor.role]}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Contact:"})," ",d.assessor.email]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Started:"})," ",N(d.startedAt)]}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Completed:"})," ",d.completedAt?N(d.completedAt):"In progress"]}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Next review:"})," ",d.reviewDate?N(d.reviewDate):"Not scheduled"]})]})]})]}),jsxs("div",{className:o("mb-8","summary"),children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Executive Summary"}),jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("span",{className:"font-medium mr-2",children:"Overall Risk Level:"}),u(d.overallRiskLevel)]}),jsxs("div",{className:o("mb-2","conclusion"),children:[jsx("span",{className:"font-medium",children:"Conclusion:"})," ",d.conclusion]}),jsxs("div",{children:[jsx("span",{className:"font-medium",children:"Can Proceed:"})," ",d.canProceed?"Yes":"No"]})]}),jsxs("div",{children:[jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Processing Activity Description"}),jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-4",children:d.processingDescription}),d.recommendations&&d.recommendations.length>0&&jsxs("div",{children:[jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Key Recommendations"}),jsx("ul",{className:"list-disc pl-5 text-gray-700 dark:text-gray-300",children:d.recommendations.map((i,a)=>jsx("li",{className:o("","recommendation"),children:i},a))})]})]})]}),jsxs("div",{className:"mb-8",children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Identified Risks"}),d.risks.length===0?jsx("p",{className:"text-gray-700 dark:text-gray-300",children:"No risks identified."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:o("min-w-full divide-y divide-gray-200 dark:divide-gray-700","riskTable"),children:[jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Risk"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Likelihood"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Impact"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Risk Level"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Mitigated"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:d.risks.map(i=>jsxs("tr",{className:o("","riskRow"),children:[jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:i.description}),jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[i.likelihood," / 5"]}),jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[i.impact," / 5"]}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:u(i.level)}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:i.mitigated?jsx("span",{className:"text-green-600 dark:text-green-400",children:"Yes"}):jsx("span",{className:"text-red-600 dark:text-red-400",children:"No"})})]},i.id))})]})})]}),y&&jsxs("div",{children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Full Assessment Details"}),k.map(i=>{let a=i.questions.filter(g=>d.answers[g.id]!==void 0);return a.length===0?null:jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:i.title}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Question"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Answer"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:a.map(g=>jsxs("tr",{children:[jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:g.text}),jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-600 dark:text-gray-400",children:v(g.id)})]},g.id))})]})})]},i.id)})]}),jsxs("div",{className:"mt-8 pt-4 border-t border-gray-200 dark:border-gray-700 text-sm text-gray-600 dark:text-gray-400",children:[jsx("p",{children:"This DPIA was conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023."}),jsxs("p",{children:["DPIA Report Version: ",d.version]}),jsxs("p",{children:["Generated on: ",new Date().toLocaleDateString()]})]})]})};var K=({steps:d,onStepClick:k,clickable:y=true,orientation:b="horizontal",className:C="",activeStepClassName:P="",completedStepClassName:$="",incompleteStepClassName:x="",classNames:A={},unstyled:D=false})=>{let o=(c,v)=>a(c,v?A[v]:void 0,D),N=c=>{y&&k&&k(c);},h=b==="vertical";return jsx("div",{className:`${o(h?"flex flex-col space-y-4":"flex items-center justify-between","root")} ${C}`,children:d.map((c,v)=>{let w=v===d.length-1,S=c.active?o(`font-medium ${P||"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]"}`,"label"):c.completed?o($||"text-green-600 dark:text-green-400","label"):o(x||"text-gray-600 dark:text-gray-400","label"),u=c.active?o("flex items-center justify-center w-8 h-8 rounded-full bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)] text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] border-2 border-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]","stepActive"):c.completed?o("flex items-center justify-center w-8 h-8 rounded-full bg-green-100 dark:bg-green-900 text-green-600 dark:text-green-400 border-2 border-green-600 dark:border-green-400","stepCompleted"):o("flex items-center justify-center w-8 h-8 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400 border-2 border-gray-300 dark:border-gray-600","stepPending");return jsxs(F.Fragment,{children:[jsxs("div",{className:o(`${h?"flex items-start":"flex flex-col items-center"} ${y?"cursor-pointer":""}`,"step"),onClick:()=>N(c.id),children:[jsx("div",{className:`
|
|
2
|
+
flex items-center justify-center
|
|
3
|
+
${h?"mr-4":""}
|
|
4
|
+
`,children:jsx("div",{className:u,children:c.icon?c.icon:c.completed?jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):jsx("span",{children:v+1})})}),jsxs("div",{className:`
|
|
5
|
+
${h?"flex-1":"mt-2 text-center"}
|
|
6
|
+
`,children:[jsx("div",{className:`text-sm font-medium ${S}`,children:c.label}),c.description&&jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:c.description})]})]}),!w&&jsx("div",{className:o(h?"ml-4 h-8 border-l-2 border-gray-300 dark:border-gray-600":"w-full border-t-2 border-gray-300 dark:border-gray-600 hidden sm:block","connector")})]},c.id)})})};export{E as a,U as b,K as c};//# sourceMappingURL=chunk-BZTTQS4A.mjs.map
|
|
7
|
+
//# sourceMappingURL=chunk-BZTTQS4A.mjs.map
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import {a}from'./chunk-WWT2ZSNU.mjs';function f(i,u){if(typeof i=="string"){let a=i,o=u,r=a,n=/\{\{([^}]+)\}\}/g,c;for(;(c=n.exec(a))!==null;){let e=c[1].trim(),t=o[e]||"";r=r.replace(new RegExp(`\\{\\{\\s*${e}\\s*\\}\\}`,"g"),t);}return r}else {let a=i,o=u,r={},n=[];return a.filter(e=>e.included).sort((e,t)=>(e.order||0)-(t.order||0)).forEach(e=>{let t=e.template||e.customContent||e.defaultContent||"",m=/\{\{([^}]+)\}\}/g,p,g=[];for(;(p=m.exec(t))!==null;)g.push(p[1].trim());g.forEach(s=>{let l="";s in o&&(l=o[s]||""),l||n.push(s),t=t.replace(new RegExp(`\\{\\{\\s*${s}\\s*\\}\\}`,"g"),l);}),r[e.id]=t;}),{fullText:Object.values(r).join(`
|
|
2
|
+
|
|
3
|
+
`),sectionTexts:r,missingVariables:Array.from(new Set(n))}}}var h=[{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
|
+
|
|
5
|
+
- Consent: where you have given clear, informed, and voluntary consent for a specific purpose.
|
|
6
|
+
- Contract: where processing is necessary to fulfil a contract with you or to take steps at your request before entering a contract.
|
|
7
|
+
- Legal obligation: where processing is required to comply with applicable Nigerian law.
|
|
8
|
+
- Vital interest: where processing is necessary to protect your life or that of another person.
|
|
9
|
+
- Public interest: where processing is necessary for the performance of a task carried out in the public interest.
|
|
10
|
+
- Legitimate interest: where processing is necessary for our legitimate interests, provided these are not overridden by your rights and freedoms.`,variables:["orgName"]},{id:"data-usage",title:"Data Usage",description:"Explains the purposes for which personal data is processed.",order:3,required:true,included:true,template:`We use the personal data we collect for the following purposes:
|
|
11
|
+
|
|
12
|
+
- Providing and improving our services at {{website}}.
|
|
13
|
+
- Communicating with you regarding your account, enquiries, or support requests.
|
|
14
|
+
- Sending relevant updates, where you have opted in to receive them.
|
|
15
|
+
- Ensuring the security and integrity of our platform.
|
|
16
|
+
- Complying with legal and regulatory obligations under Nigerian law.
|
|
17
|
+
- Conducting analytics to improve user experience and service quality.
|
|
18
|
+
|
|
19
|
+
We will not process your data for purposes incompatible with those stated above without providing you with notice and, where required, obtaining your consent.`,variables:["website"]},{id:"data-sharing",title:"Data Sharing and Disclosure",description:"Details when and with whom personal data may be shared.",order:4,required:true,included:true,template:`{{orgName}} does not sell personal data. We may share your data with the following categories of recipients:
|
|
20
|
+
|
|
21
|
+
- Service providers and processors who assist us in operating our services, under strict data processing agreements.
|
|
22
|
+
- Regulatory and law enforcement authorities when required by Nigerian law or valid legal process.
|
|
23
|
+
- Professional advisers, including lawyers, auditors, and insurers, where necessary.
|
|
24
|
+
- Business partners, only with your explicit consent and for clearly stated purposes.
|
|
25
|
+
|
|
26
|
+
Any cross-border transfer of personal data will comply with the requirements of the NDPA 2023, including ensuring adequate safeguards are in place in the receiving jurisdiction.`,variables:["orgName"]},{id:"data-subject-rights",title:"Data Subject Rights",description:"Outlines the rights of data subjects under the NDPA.",order:5,required:true,included:true,template:`Under the NDPA 2023, you have the following rights regarding your personal data:
|
|
27
|
+
|
|
28
|
+
- Right of access: request a copy of the personal data we hold about you.
|
|
29
|
+
- Right to rectification: request correction of inaccurate or incomplete data.
|
|
30
|
+
- Right to erasure: request deletion of your personal data where there is no compelling reason for continued processing.
|
|
31
|
+
- Right to restrict processing: request limitation of how we process your data.
|
|
32
|
+
- Right to data portability: receive your data in a structured, commonly used format.
|
|
33
|
+
- Right to object: object to processing based on legitimate interest or for direct marketing purposes.
|
|
34
|
+
- Right to withdraw consent: withdraw previously given consent at any time without affecting prior processing.
|
|
35
|
+
|
|
36
|
+
To exercise any of these rights, contact us at {{privacyEmail}}. We will respond to your request within 30 days.`,variables:["privacyEmail"]},{id:"data-retention",title:"Data Retention",description:"Describes how long personal data is retained and the criteria for retention periods.",order:6,required:true,included:true,template:`{{orgName}} retains personal data only for as long as necessary to fulfil the purposes for which it was collected, or as required by applicable Nigerian law. Retention periods are determined based on:
|
|
37
|
+
|
|
38
|
+
- The nature of the data and the purposes for processing.
|
|
39
|
+
- Legal, regulatory, and contractual obligations.
|
|
40
|
+
- Legitimate business needs such as maintaining records for audits or dispute resolution.
|
|
41
|
+
|
|
42
|
+
When personal data is no longer needed, it will be securely deleted or anonymised in accordance with our data retention policy.`,variables:["orgName"]},{id:"data-security",title:"Data Security",description:"Describes the security measures in place to protect personal data.",order:7,required:true,included:true,template:`We implement appropriate technical and organisational measures to protect personal data against unauthorised access, alteration, disclosure, or destruction. These measures include:
|
|
43
|
+
|
|
44
|
+
- Encryption of data in transit and at rest.
|
|
45
|
+
- Access controls and authentication mechanisms.
|
|
46
|
+
- Regular security assessments and vulnerability testing.
|
|
47
|
+
- Staff training on data protection and information security.
|
|
48
|
+
- Incident response procedures in line with NDPA breach notification requirements.
|
|
49
|
+
|
|
50
|
+
While we strive to protect your data, no method of transmission or storage is completely secure. If you become aware of any security incident, please contact us immediately at {{privacyEmail}}.`,variables:["privacyEmail"]},{id:"contact-info",title:"Contact Information",description:"Provides contact details for privacy-related enquiries and the Data Protection Officer.",order:8,required:true,included:true,template:`If you have questions, concerns, or requests regarding this privacy policy or our data practices, please contact us:
|
|
51
|
+
|
|
52
|
+
Organisation: {{orgName}}
|
|
53
|
+
Address: {{address}}
|
|
54
|
+
Email: {{privacyEmail}}
|
|
55
|
+
Website: {{website}}
|
|
56
|
+
|
|
57
|
+
Data Protection Officer: {{dpoName}}
|
|
58
|
+
DPO Email: {{dpoEmail}}
|
|
59
|
+
|
|
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
|
+
|
|
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"]}],y=[{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 v(){return {sections:h.map(i=>a({},i)),variables:y.map(i=>a({},i))}}export{f as a,h as b,y as c,v as d};//# sourceMappingURL=chunk-CAB7O3GR.mjs.map
|
|
63
|
+
//# sourceMappingURL=chunk-CAB7O3GR.mjs.map
|