@tantainnovative/ndpr-toolkit 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (200) hide show
  1. package/README.md +34 -1
  2. package/dist/{DPIAQuestionnaire-BkejviPj.d.mts → DPIAQuestionnaire-VXBoWFMC.d.ts} +3 -3
  3. package/dist/{DPIAQuestionnaire-DdSqXG3x.d.ts → DPIAQuestionnaire-jkt1Veb6.d.mts} +3 -3
  4. package/dist/{DSRRequestForm-BY8PogCU.d.mts → DSRRequestForm-D8rPTNmU.d.ts} +2 -2
  5. package/dist/{DSRRequestForm-CHUg9cZh.d.ts → DSRRequestForm-DRouEr9j.d.mts} +2 -2
  6. package/dist/{DSRTracker-Dr_aT0pg.d.ts → DSRTracker-Bl__d4df.d.ts} +1 -1
  7. package/dist/{DSRTracker-C6u_jAaK.d.mts → DSRTracker-CSVDfgQQ.d.mts} +1 -1
  8. package/dist/{StepIndicator-D9ZATz_O.d.ts → StepIndicator-CgrlokSV.d.ts} +1 -1
  9. package/dist/{StepIndicator-D-nwRTyo.d.mts → StepIndicator-W8S_QjgO.d.mts} +1 -1
  10. package/dist/adapters.js +1 -1
  11. package/dist/adapters.mjs +1 -1
  12. package/dist/breach.js +1 -1
  13. package/dist/breach.mjs +1 -1
  14. package/dist/chunk-256APOQM.js +2 -0
  15. package/dist/chunk-25OOUES4.js +2 -0
  16. package/dist/chunk-4JKTIR33.mjs +2 -0
  17. package/dist/chunk-5BUS6AI7.js +2 -0
  18. package/dist/chunk-5X32J5IA.mjs +2 -0
  19. package/dist/chunk-6BXUVS6E.js +81 -0
  20. package/dist/chunk-6JCRDJQI.mjs +2 -0
  21. package/dist/{chunk-KHRBU5K7.js → chunk-6RQGQZT2.js} +2 -2
  22. package/dist/chunk-6TA2MVTU.mjs +2 -0
  23. package/dist/chunk-6WIP33TW.mjs +2 -0
  24. package/dist/chunk-6YN73KR7.mjs +2 -0
  25. package/dist/chunk-75TJPK2N.mjs +2 -0
  26. package/dist/{chunk-2ORDHJRD.js → chunk-7AVN424U.js} +2 -2
  27. package/dist/chunk-7D2OIPHH.mjs +2 -0
  28. package/dist/{chunk-5VMHKNJY.js → chunk-7SMLHZ4B.js} +2 -2
  29. package/dist/chunk-A4PK7JB2.js +2 -0
  30. package/dist/chunk-ABDB7LEV.mjs +2 -0
  31. package/dist/chunk-BKRETVJ6.js +2 -0
  32. package/dist/chunk-C4YM4UMI.js +2 -0
  33. package/dist/chunk-CDZDT2OS.mjs +320 -0
  34. package/dist/chunk-CSIJCLGZ.mjs +2 -0
  35. package/dist/chunk-CWUPGY3M.mjs +3 -0
  36. package/dist/chunk-DJGS7SSN.mjs +2 -0
  37. package/dist/{chunk-SVCRYM4I.mjs → chunk-E4NCJ7RD.mjs} +2 -2
  38. package/dist/chunk-E63VPR7U.js +2 -0
  39. package/dist/chunk-ELKB2AFZ.js +2 -0
  40. package/dist/chunk-FDDI426Y.mjs +2 -0
  41. package/dist/chunk-GKKAK6ES.mjs +3 -0
  42. package/dist/chunk-GMLCWGNJ.js +7 -0
  43. package/dist/{chunk-SWF3YVE5.js → chunk-GOU6FU6Y.js} +3 -3
  44. package/dist/chunk-GQVNLUP2.js +94 -0
  45. package/dist/chunk-GXLSOZCH.mjs +2 -0
  46. package/dist/chunk-HO5M7M4M.js +2 -0
  47. package/dist/chunk-I4M2AA3N.js +2 -0
  48. package/dist/chunk-I54CDQGN.js +3 -0
  49. package/dist/chunk-IQJO7WIH.js +7 -0
  50. package/dist/chunk-JKKRPS4P.js +2 -0
  51. package/dist/chunk-LETEUS5X.mjs +2 -0
  52. package/dist/{chunk-P7BSBCB3.js → chunk-M6XETYNL.js} +2 -2
  53. package/dist/chunk-NBSVFQ5G.js +2 -0
  54. package/dist/chunk-NUDVUAD4.mjs +81 -0
  55. package/dist/chunk-NUULHXVL.mjs +7 -0
  56. package/dist/chunk-P42Z5CFE.js +2 -0
  57. package/dist/chunk-PATONNTZ.mjs +2 -0
  58. package/dist/{chunk-WLSW4Z4W.mjs → chunk-PM7O5IGE.mjs} +2 -2
  59. package/dist/chunk-Q7VHB64E.mjs +2 -0
  60. package/dist/chunk-QDHHD2KR.mjs +94 -0
  61. package/dist/chunk-R3OYAJI6.mjs +2 -0
  62. package/dist/chunk-S4GRSNB4.js +2 -0
  63. package/dist/chunk-SAA7UVI2.js +3 -0
  64. package/dist/{chunk-PYEX7DFR.mjs → chunk-SHMJNRHO.mjs} +3 -3
  65. package/dist/chunk-TI2M7H6R.mjs +7 -0
  66. package/dist/chunk-TKVJ3OOV.mjs +2 -0
  67. package/dist/chunk-TXXWCB5O.js +320 -0
  68. package/dist/chunk-U62QYKVG.mjs +2 -0
  69. package/dist/{chunk-44W4H2EY.js → chunk-UGY5ZYUG.js} +2 -2
  70. package/dist/chunk-UO6QPJLH.js +2 -0
  71. package/dist/chunk-UX6ZZNEM.mjs +3 -0
  72. package/dist/{chunk-5RSOLEEP.js → chunk-UXMGBIX6.js} +4 -4
  73. package/dist/chunk-VLSGE2YA.js +2 -0
  74. package/dist/{chunk-G26I6MP5.mjs → chunk-VWPGIES4.mjs} +2 -2
  75. package/dist/chunk-XFUEZ3MP.mjs +2 -0
  76. package/dist/chunk-XHSHPB74.js +2 -0
  77. package/dist/chunk-YCX6BFOQ.js +2 -0
  78. package/dist/chunk-YURSF2YO.mjs +2 -0
  79. package/dist/chunk-YZXUAIYN.js +3 -0
  80. package/dist/{chunk-CAB7O3GR.mjs → chunk-ZEOQYWOE.mjs} +4 -4
  81. package/dist/chunk-ZGJA7OO4.js +2 -0
  82. package/dist/chunk-ZT7KNFAU.mjs +2 -0
  83. package/dist/chunk-ZYLDLGFL.js +2 -0
  84. package/dist/consent.js +1 -1
  85. package/dist/consent.mjs +1 -1
  86. package/dist/core.d.mts +21 -9
  87. package/dist/core.d.ts +21 -9
  88. package/dist/core.js +1 -1
  89. package/dist/core.mjs +1 -1
  90. package/dist/cross-border.d.mts +68 -1
  91. package/dist/cross-border.d.ts +68 -1
  92. package/dist/cross-border.js +1 -1
  93. package/dist/cross-border.mjs +1 -1
  94. package/dist/{dpia-B0Pok5us.d.ts → dpia-D82hUrJe.d.ts} +1 -1
  95. package/dist/{dpia-CUfOmzvX.d.mts → dpia-DQDFw2_l.d.mts} +1 -1
  96. package/dist/{dpia-5OQVA1R_.d.mts → dpia-c9GiiOq0.d.mts} +2 -2
  97. package/dist/{dpia-5OQVA1R_.d.ts → dpia-c9GiiOq0.d.ts} +2 -2
  98. package/dist/dpia.d.mts +9 -9
  99. package/dist/dpia.d.ts +9 -9
  100. package/dist/dpia.js +1 -1
  101. package/dist/dpia.mjs +1 -1
  102. package/dist/{dsr-D_eTNc4S.d.mts → dsr-CIx5sd7e.d.ts} +2 -2
  103. package/dist/{dsr-pNtVb1BK.d.ts → dsr-XZ_HqTlA.d.mts} +2 -2
  104. package/dist/{dsr-Cm9lzWG7.d.mts → dsr-yKbqX531.d.mts} +1 -1
  105. package/dist/{dsr-Cm9lzWG7.d.ts → dsr-yKbqX531.d.ts} +1 -1
  106. package/dist/dsr.d.mts +9 -9
  107. package/dist/dsr.d.ts +9 -9
  108. package/dist/dsr.js +1 -1
  109. package/dist/dsr.mjs +1 -1
  110. package/dist/hooks.d.mts +6 -6
  111. package/dist/hooks.d.ts +6 -6
  112. package/dist/hooks.js +1 -1
  113. package/dist/hooks.mjs +1 -1
  114. package/dist/index.d.mts +11 -11
  115. package/dist/index.d.ts +11 -11
  116. package/dist/index.js +1 -1
  117. package/dist/index.mjs +1 -1
  118. package/dist/lawful-basis.js +1 -1
  119. package/dist/lawful-basis.mjs +1 -1
  120. package/dist/{policy-engine-DSQpT55_.d.ts → policy-engine-C6nC2t3a.d.ts} +1 -1
  121. package/dist/{policy-engine-C-tShzZH.d.mts → policy-engine-DefZcX3R.d.mts} +1 -1
  122. package/dist/{policy-sections-CfNVBLCh.d.mts → policy-sections-Bylm31kZ.d.mts} +1 -1
  123. package/dist/{policy-sections-DqH0iZRf.d.ts → policy-sections-DFDPVCCg.d.ts} +1 -1
  124. package/dist/policy.d.mts +4 -4
  125. package/dist/policy.d.ts +4 -4
  126. package/dist/policy.js +1 -1
  127. package/dist/policy.mjs +1 -1
  128. package/dist/presets.d.mts +5 -5
  129. package/dist/presets.d.ts +5 -5
  130. package/dist/presets.js +1 -1
  131. package/dist/presets.mjs +1 -1
  132. package/dist/ropa.js +1 -1
  133. package/dist/ropa.mjs +1 -1
  134. package/dist/{sanitize-9mOO_cJW.d.mts → sanitize-B0AzEm1D.d.mts} +14 -1
  135. package/dist/{sanitize-9mOO_cJW.d.ts → sanitize-B0AzEm1D.d.ts} +14 -1
  136. package/dist/{useAdaptivePolicyWizard-N4eUM4Tj.d.mts → useAdaptivePolicyWizard-A1PyOy6P.d.mts} +1 -1
  137. package/dist/{useAdaptivePolicyWizard-B9Op2gYM.d.ts → useAdaptivePolicyWizard-LVIKhAxw.d.ts} +1 -1
  138. package/dist/{useDPIA-DzWye8JB.d.mts → useDPIA-B6180UQn.d.mts} +9 -5
  139. package/dist/{useDPIA-Dl16Te3r.d.ts → useDPIA-CTqbNbww.d.ts} +9 -5
  140. package/dist/{useDSR-C1LksCfP.d.mts → useDSR-WvHk8_iu.d.mts} +2 -2
  141. package/dist/{useDSR-DZel52O1.d.ts → useDSR-wH4H6hSM.d.ts} +2 -2
  142. package/package.json +3 -2
  143. package/dist/chunk-27NYSWUG.mjs +0 -2
  144. package/dist/chunk-2SYNHRP6.mjs +0 -2
  145. package/dist/chunk-2W7ARAW2.js +0 -2
  146. package/dist/chunk-3F34NACG.js +0 -2
  147. package/dist/chunk-3UWT64FI.mjs +0 -2
  148. package/dist/chunk-3V23O4ZJ.js +0 -2
  149. package/dist/chunk-3XAUN5IM.mjs +0 -3
  150. package/dist/chunk-4JUDKBA2.mjs +0 -7
  151. package/dist/chunk-4VVARDN2.mjs +0 -2
  152. package/dist/chunk-6D3ZUGBB.mjs +0 -2
  153. package/dist/chunk-6E54NSAO.mjs +0 -2
  154. package/dist/chunk-7F5F5YWI.mjs +0 -2
  155. package/dist/chunk-BGHQTZAC.js +0 -94
  156. package/dist/chunk-CL53OI3I.js +0 -7
  157. package/dist/chunk-CMZTI7SG.js +0 -2
  158. package/dist/chunk-DQLDX5X6.js +0 -316
  159. package/dist/chunk-ELKEZEV5.mjs +0 -2
  160. package/dist/chunk-EPF7J2FK.js +0 -3
  161. package/dist/chunk-ER7X6E36.js +0 -2
  162. package/dist/chunk-FR7ZYZXB.js +0 -2
  163. package/dist/chunk-FXTZDKDC.mjs +0 -3
  164. package/dist/chunk-FY5G6DGZ.js +0 -7
  165. package/dist/chunk-GIV2OHE6.mjs +0 -2
  166. package/dist/chunk-GPJVTGHR.mjs +0 -2
  167. package/dist/chunk-GVANK6PL.js +0 -3
  168. package/dist/chunk-HNZK7LY3.mjs +0 -2
  169. package/dist/chunk-IKEPXHCZ.js +0 -2
  170. package/dist/chunk-IQF726GS.js +0 -2
  171. package/dist/chunk-IQQW52EF.js +0 -2
  172. package/dist/chunk-ISSGO2YT.mjs +0 -72
  173. package/dist/chunk-JZKH5RMC.js +0 -3
  174. package/dist/chunk-LFNA6WYQ.mjs +0 -2
  175. package/dist/chunk-NPI5T6NH.mjs +0 -7
  176. package/dist/chunk-NPLXE43Q.mjs +0 -2
  177. package/dist/chunk-PEH5GIMN.js +0 -2
  178. package/dist/chunk-PGSA2O5P.mjs +0 -2
  179. package/dist/chunk-QKK5S54L.mjs +0 -2
  180. package/dist/chunk-RGYK4VAY.mjs +0 -2
  181. package/dist/chunk-RSUDIFZV.mjs +0 -2
  182. package/dist/chunk-RYZEIDNR.js +0 -2
  183. package/dist/chunk-SBNAMPAP.mjs +0 -2
  184. package/dist/chunk-SKJCQKFL.mjs +0 -94
  185. package/dist/chunk-SSGJREE3.js +0 -2
  186. package/dist/chunk-TKBZRULW.mjs +0 -316
  187. package/dist/chunk-TVW6KBVV.mjs +0 -2
  188. package/dist/chunk-U6VWHC46.js +0 -72
  189. package/dist/chunk-UK656RCG.js +0 -2
  190. package/dist/chunk-UNKXYVXY.js +0 -2
  191. package/dist/chunk-UOSEH6DC.js +0 -2
  192. package/dist/chunk-UZ5EZOA7.js +0 -2
  193. package/dist/chunk-V37BM2LF.js +0 -2
  194. package/dist/chunk-V3MXWGXU.mjs +0 -2
  195. package/dist/chunk-VDZKGCAF.js +0 -2
  196. package/dist/chunk-XSK4BSZJ.mjs +0 -2
  197. package/dist/chunk-Y34DQYS7.js +0 -2
  198. package/dist/chunk-YJCGEOLO.mjs +0 -2
  199. package/dist/chunk-ZCZ5RRZO.js +0 -2
  200. package/dist/chunk-ZQSX5ZHB.mjs +0 -3
@@ -1,2 +0,0 @@
1
- var p=["critical","high","medium","low"];function m(e){let i=new Date(e).getTime();return (Date.now()-i)/(1e3*60*60*24*30.44)}function u(e){if(e.length===0)return 100;let i=e.filter(t=>t.pass).length;return Math.round(i/e.length*100)}function f(e){return [{key:"hasConsentMechanism",label:"Consent collection mechanism",priority:"critical",effort:"high",recommendation:"Implement a clear, affirmative consent collection mechanism before processing personal data.",ndpaSection:"Section 25",pass:e.hasConsentMechanism},{key:"hasPurposeSpecification",label:"Purpose specification at collection",priority:"critical",effort:"medium",recommendation:"Specify and communicate the purpose of data collection at the point of consent.",ndpaSection:"Section 25",pass:e.hasPurposeSpecification},{key:"hasWithdrawalMechanism",label:"Consent withdrawal mechanism",priority:"high",effort:"medium",recommendation:"Provide a simple mechanism for data subjects to withdraw consent at any time.",ndpaSection:"Section 26",pass:e.hasWithdrawalMechanism},{key:"hasMinorProtection",label:"Minor (child) data protection controls",priority:"high",effort:"high",recommendation:"Implement age-verification and parental-consent controls for processing data of minors.",ndpaSection:"Section 26",pass:e.hasMinorProtection},{key:"consentRecordsRetained",label:"Consent records retained",priority:"medium",effort:"low",recommendation:"Retain records of all consents obtained, including what was agreed to and when.",ndpaSection:"Section 25",pass:e.consentRecordsRetained}]}function g(e){let i=e.responseTimelineDays<=30;return [{key:"hasRequestMechanism",label:"DSR submission mechanism",priority:"critical",effort:"high",recommendation:"Implement a formal channel (e.g. a web form or email address) for data subjects to submit requests.",ndpaSection:"Section 34",pass:e.hasRequestMechanism},{key:"supportsAccess",label:"Right of access supported",priority:"high",effort:"medium",recommendation:"Enable data subjects to request and receive a copy of their personal data.",ndpaSection:"Section 34",pass:e.supportsAccess},{key:"supportsRectification",label:"Right to rectification supported",priority:"high",effort:"medium",recommendation:"Allow data subjects to request correction of inaccurate or incomplete personal data.",ndpaSection:"Section 35",pass:e.supportsRectification},{key:"supportsErasure",label:"Right to erasure supported",priority:"high",effort:"high",recommendation:"Implement processes to delete personal data upon valid erasure requests.",ndpaSection:"Section 36",pass:e.supportsErasure},{key:"supportsPortability",label:"Right to data portability supported",priority:"medium",effort:"high",recommendation:"Provide personal data in a structured, machine-readable format upon request.",ndpaSection:"Section 37",pass:e.supportsPortability},{key:"supportsObjection",label:"Right to object supported",priority:"medium",effort:"medium",recommendation:"Honour objections to processing where no compelling legitimate grounds override the data subject's interests.",ndpaSection:"Section 38",pass:e.supportsObjection},{key:"responseTimeline",label:"DSR response within 30 days",priority:"high",effort:"medium",recommendation:"Reduce DSR response time to 30 days or less as required by the NDPA.",ndpaSection:"Section 39",pass:i}]}function y(e){return [{key:"conductedForHighRisk",label:"DPIA conducted for high-risk processing",priority:"critical",effort:"high",recommendation:"Conduct a Data Protection Impact Assessment before undertaking high-risk processing activities.",ndpaSection:"Section 28",pass:e.conductedForHighRisk},{key:"documentedRisks",label:"Risks documented in DPIA",priority:"high",effort:"medium",recommendation:"Document identified risks to data subjects' rights and freedoms within the DPIA.",ndpaSection:"Section 28",pass:e.documentedRisks},{key:"mitigationMeasures",label:"Mitigation measures documented",priority:"high",effort:"medium",recommendation:"Document mitigation measures and residual risk acceptance within the DPIA.",ndpaSection:"Section 28",pass:e.mitigationMeasures}]}function b(e){return [{key:"hasNotificationProcess",label:"Breach notification process in place",priority:"critical",effort:"high",recommendation:"Establish a documented breach notification process covering detection, assessment, and reporting.",ndpaSection:"Section 40",pass:e.hasNotificationProcess},{key:"notifiesWithin72Hours",label:"NDPC notified within 72 hours",priority:"critical",effort:"medium",recommendation:"Ensure the NDPC is notified of qualifying breaches within 72 hours of discovery.",ndpaSection:"Section 40",pass:e.notifiesWithin72Hours},{key:"hasRiskAssessment",label:"Breach risk assessment performed",priority:"high",effort:"medium",recommendation:"Perform a risk assessment for every identified breach to determine notification obligations.",ndpaSection:"Section 40",pass:e.hasRiskAssessment},{key:"hasRecordKeeping",label:"Breach records maintained",priority:"medium",effort:"low",recommendation:"Maintain a breach register documenting all incidents, assessments, and actions taken.",ndpaSection:"Section 40",pass:e.hasRecordKeeping}]}function S(e){let t=m(e.lastUpdated)<=13;return [{key:"hasPrivacyPolicy",label:"Privacy policy exists",priority:"critical",effort:"high",recommendation:"Draft and publish a comprehensive privacy policy that satisfies NDPA requirements.",ndpaSection:"Section 29",pass:e.hasPrivacyPolicy},{key:"isPubliclyAccessible",label:"Privacy policy publicly accessible",priority:"high",effort:"low",recommendation:"Make the privacy policy easily accessible to data subjects on your website or app.",ndpaSection:"Section 29",pass:e.isPubliclyAccessible},{key:"policyUpToDate",label:"Privacy policy reviewed within 13 months",priority:"medium",effort:"medium",recommendation:"Review and update the privacy policy at least annually to reflect current practices.",ndpaSection:"Section 29",pass:t},{key:"coversAllSections",label:"Privacy policy covers all required sections",priority:"high",effort:"medium",recommendation:"Ensure the privacy policy addresses all NDPA-mandated disclosures including lawful basis, retention, and subject rights.",ndpaSection:"Section 29",pass:e.coversAllSections}]}function R(e){return [{key:"documentedForAllProcessing",label:"Lawful basis documented for all processing",priority:"critical",effort:"high",recommendation:"Identify and document a valid lawful basis for every processing activity before it begins.",ndpaSection:"Section 25(1)",pass:e.documentedForAllProcessing},{key:"hasLegitimateInterestAssessment",label:"Legitimate interest assessment completed",priority:"medium",effort:"medium",recommendation:"Complete a Legitimate Interest Assessment (LIA) where legitimate interests is the chosen lawful basis.",ndpaSection:"Section 25(1)",pass:e.hasLegitimateInterestAssessment}]}function v(e){return [{key:"hasTransferMechanisms",label:"Transfer mechanisms in place",priority:"critical",effort:"high",recommendation:"Implement appropriate transfer mechanisms (SCCs, BCRs, or adequacy decisions) for all cross-border transfers.",ndpaSection:"Section 43",pass:e.hasTransferMechanisms},{key:"adequacyAssessed",label:"Adequacy of destination country assessed",priority:"high",effort:"medium",recommendation:"Assess whether the destination country provides an adequate level of data protection before transferring.",ndpaSection:"Section 43",pass:e.adequacyAssessed},{key:"ndpcApprovalObtained",label:"NDPC approval obtained where required",priority:"high",effort:"high",recommendation:"Obtain NDPC approval for transfers to countries without adequacy decisions where required.",ndpaSection:"Section 44",pass:e.ndpcApprovalObtained}]}function w(e){let t=m(e.lastReviewed)<=6;return [{key:"maintained",label:"Record of Processing Activities maintained",priority:"critical",effort:"high",recommendation:"Create and maintain a comprehensive Record of Processing Activities (ROPA) as required by the NDPA.",ndpaSection:"Section 30",pass:e.maintained},{key:"includesAllProcessing",label:"ROPA includes all processing activities",priority:"high",effort:"medium",recommendation:"Ensure the ROPA captures every processing activity across all departments and systems.",ndpaSection:"Section 30",pass:e.includesAllProcessing},{key:"ropaUpToDate",label:"ROPA reviewed within 6 months",priority:"medium",effort:"low",recommendation:"Review and update the ROPA at least every six months to reflect changes in processing activities.",ndpaSection:"Section 30",pass:t}]}var k=[{name:"consent",weight:.2,ndpaSections:["Section 25","Section 26"],evaluate:e=>f(e.consent)},{name:"dsr",weight:.15,ndpaSections:["Section 34","Section 35","Section 36","Section 37","Section 38","Section 39"],evaluate:e=>g(e.dsr)},{name:"breach",weight:.15,ndpaSections:["Section 40"],evaluate:e=>b(e.breach)},{name:"policy",weight:.12,ndpaSections:["Section 29"],evaluate:e=>S(e.policy)},{name:"dpia",weight:.12,ndpaSections:["Section 28"],evaluate:e=>y(e.dpia)},{name:"lawfulBasis",weight:.1,ndpaSections:["Section 25(1)"],evaluate:e=>R(e.lawfulBasis)},{name:"crossBorder",weight:.08,ndpaSections:["Section 43","Section 44"],evaluate:e=>v(e.crossBorder)},{name:"ropa",weight:.08,ndpaSections:["Section 30"],evaluate:e=>w(e.ropa)}];function P(e){return e>=90?"excellent":e>=70?"good":e>=40?"needs-work":"critical"}function A(e){let i={},t=[],s=0;for(let o of k){let a=o.evaluate(e),c=u(a),l=c*o.weight;s+=l;let d=[];for(let n of a)n.pass||(d.push(n.label),t.push({module:o.name,key:n.key,label:n.label,priority:n.priority,effort:n.effort,recommendation:n.recommendation,ndpaSection:n.ndpaSection}));i[o.name]={name:o.name,score:c,maxScore:100,weightedScore:Math.round(l*100)/100,ndpaSections:o.ndpaSections,gaps:d};}t.sort((o,a)=>p.indexOf(o.priority)-p.indexOf(a.priority));let r=Math.round(s),h=[{section:"Section 25",title:"Consent and lawful basis for processing"},{section:"Section 26",title:"Withdrawal of consent and minor protection"},{section:"Section 28",title:"Data Protection Impact Assessment"},{section:"Section 29",title:"Privacy notice requirements"},{section:"Section 30",title:"Records of processing activities"},{section:"Section 34",title:"Right of access"},{section:"Section 35",title:"Right to rectification"},{section:"Section 36",title:"Right to erasure"},{section:"Section 37",title:"Right to data portability"},{section:"Section 38",title:"Right to object"},{section:"Section 39",title:"Response timelines for data subject requests"},{section:"Section 40",title:"Data breach notification"},{section:"Section 43",title:"Cross-border transfer restrictions"},{section:"Section 44",title:"NDPC approval for cross-border transfers"}];return {score:r,rating:P(r),modules:i,recommendations:t,regulatoryReferences:h,generatedAt:new Date().toISOString()}}export{A as a};//# sourceMappingURL=chunk-GPJVTGHR.mjs.map
2
- //# sourceMappingURL=chunk-GPJVTGHR.mjs.map
@@ -1,3 +0,0 @@
1
- 'use strict';var chunkEPF7J2FK_js=require('./chunk-EPF7J2FK.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var qe=({categories:pe,onSubmit:ge,onValidationError:N,title:be="Report a Data Breach",formDescription:fe="Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40. All fields marked with * are required.",submitButtonText:ue="Submit Report",className:M="",buttonClassName:z="",classNames:d={},unstyled:c=false,isSubmitting:f=false,showConfirmation:ve=true,confirmationMessage:he="Your breach report has been submitted successfully. The data protection team has been notified.",allowAttachments:ye=true,maxAttachments:A=5,maxFileSize:k=5*1024*1024,allowedFileTypes:w=[".pdf",".jpg",".jpeg",".png",".doc",".docx",".xls",".xlsx",".txt"],defaultValues:t,onReset:S})=>{var ie,oe,se,ne,de;let L=r=>{if(!r)return "";let o=new Date(r),l=s=>String(s).padStart(2,"0");return `${o.getFullYear()}-${l(o.getMonth()+1)}-${l(o.getDate())}T${l(o.getHours())}:${l(o.getMinutes())}`},[D,O]=react.useState((t==null?void 0:t.title)||""),[C,Y]=react.useState((t==null?void 0:t.description)||""),[F,U]=react.useState((t==null?void 0:t.category)||""),[T,H]=react.useState(L(t==null?void 0:t.discoveredAt)),[R,_]=react.useState(L(t==null?void 0:t.occurredAt)),[B,Z]=react.useState(((ie=t==null?void 0:t.reporter)==null?void 0:ie.name)||""),[h,G]=react.useState(((oe=t==null?void 0:t.reporter)==null?void 0:oe.email)||""),[j,K]=react.useState(((se=t==null?void 0:t.reporter)==null?void 0:se.department)||""),[E,W]=react.useState(((ne=t==null?void 0:t.reporter)==null?void 0:ne.phone)||""),[J,Q]=react.useState((t==null?void 0:t.affectedSystems)||[]),[xe,X]=react.useState(((de=t==null?void 0:t.affectedSystems)==null?void 0:de.join(", "))||""),[q,V]=react.useState((t==null?void 0:t.dataTypes)||[]),[u,ee]=react.useState((t==null?void 0:t.estimatedAffectedSubjects)!=null?String(t.estimatedAffectedSubjects):""),[re,te]=react.useState((t==null?void 0:t.status)||"ongoing"),[I,ae]=react.useState((t==null?void 0:t.initialActions)||""),[y,$]=react.useState([]),[Ne,P]=react.useState(false),[i,v]=react.useState({}),Ae=()=>{O(""),Y(""),U(""),H(""),_(""),Z(""),G(""),K(""),W(""),Q([]),X(""),V([]),ee(""),te("ongoing"),ae(""),$([]),P(false),v({}),S==null||S();},ke=r=>{let o=r.target.value;X(o);let l=o.split(",").map(s=>s.trim()).filter(Boolean);Q(l);},we=r=>{V(o=>o.includes(r)?o.filter(l=>l!==r):[...o,r]);},Se=r=>{var me;let o=r.target.files;if(!o)return;let l=[],s={};if(y.length+o.length>A){s.attachments=`Maximum of ${A} files allowed`,v(p=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},p),s));return}for(let p=0;p<o.length;p++){let x=o[p];if(x.size>k){s.attachments=`File ${x.name} exceeds the maximum size of ${k/(1024*1024)}MB`;continue}let ce="."+((me=x.name.split(".").pop())==null?void 0:me.toLowerCase());if(!w.includes(ce)){s.attachments=`File type ${ce} is not allowed`;continue}l.push(x);}Object.keys(s).length>0?v(p=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},p),s)):($(p=>[...p,...l]),v(p=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},p),{attachments:""})));},De=r=>{$(o=>o.filter((l,s)=>s!==r));},Ce=()=>{let r={};return D.trim()||(r.breachTitle="Breach title is required"),C.trim()||(r.description="Description is required"),F||(r.category="Category is required"),T||(r.discoveredAt="Discovery date is required"),B.trim()||(r.reporterName="Reporter name is required"),h.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(h)||(r.reporterEmail="Reporter email is invalid"):r.reporterEmail="Reporter email is required",j.trim()||(r.reporterDepartment="Reporter department is required"),J.length===0&&(r.affectedSystems="At least one affected system is required"),q.length===0&&(r.dataTypes="At least one data type is required"),u&&isNaN(Number(u))&&(r.estimatedAffectedSubjects="Estimated affected subjects must be a number"),v(r),r},Fe=r=>{r.preventDefault();let o=Ce();if(Object.keys(o).length>0){N==null||N(o);return}let l={title:chunkEPF7J2FK_js.a(D),description:chunkEPF7J2FK_js.a(C),category:F,discoveredAt:new Date(T).getTime(),occurredAt:R?new Date(R).getTime():void 0,reportedAt:Date.now(),reporter:{name:chunkEPF7J2FK_js.a(B),email:chunkEPF7J2FK_js.a(h),department:chunkEPF7J2FK_js.a(j),phone:E?chunkEPF7J2FK_js.a(E):void 0},affectedSystems:J.map(s=>chunkEPF7J2FK_js.a(s)),dataTypes:q,estimatedAffectedSubjects:u?Number(u):void 0,status:re,initialActions:I?chunkEPF7J2FK_js.a(I):void 0,attachments:y.map(s=>({name:s.name,type:s.type,size:s.size,file:s}))};ge(l),ve&&P(true);};if(Ne)return jsxRuntime.jsxs("div",{className:`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${M}`,children:[jsxRuntime.jsx("h2",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Submitted"}),jsxRuntime.jsx("p",{className:"text-green-700 dark:text-green-300",children:he}),jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-yellow-800 dark:text-yellow-200 mb-2",children:"Important: Next Steps"}),jsxRuntime.jsx("p",{className:"text-yellow-700 dark:text-yellow-300 text-sm",children:"Under the NDPA (Section 40), data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsxRuntime.jsx("button",{onClick:()=>P(false),className:`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${z}`,children:"Report Another Breach"})]});let Te=[{id:"personal",label:"Personal Information (names, addresses)"},{id:"contact",label:"Contact Information (email, phone)"},{id:"financial",label:"Financial Information (bank details, payment info)"},{id:"health",label:"Health Information"},{id:"identification",label:"Identification Documents (ID cards, passports)"},{id:"login",label:"Login Credentials"},{id:"biometric",label:"Biometric Data"},{id:"children",label:"Children's Data"},{id:"location",label:"Location Data"},{id:"communications",label:"Communications Content"}];return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${M}`,d.root,c),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",d.title,c),children:be}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:fe}),jsxRuntime.jsx("form",{onSubmit:Fe,className:chunkE64TU6IU_js.a("",d.form,c),children:jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",d.fieldGroup,c),children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Breach Information"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"breachTitle",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",d.label,c),children:["Breach Title/Summary ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"breachTitle",value:D,onChange:r=>O(r.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))]",d.input,c),required:true,"aria-invalid":!!i.breachTitle,"aria-describedby":i.breachTitle?"breachTitle-error":void 0}),i.breachTitle&&jsxRuntime.jsx("p",{id:"breachTitle-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.breachTitle})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"category",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",d.label,c),children:["Breach Category ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsxs("select",{id:"category",value:F,onChange:r=>U(r.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))]",d.select,c),required:true,"aria-invalid":!!i.category,"aria-describedby":i.category?"category-error":void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select a category"}),pe.map(r=>jsxRuntime.jsx("option",{value:r.id,children:r.name},r.id))]}),i.category&&jsxRuntime.jsx("p",{id:"category-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.category})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"description",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",d.label,c),children:["Detailed Description ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"description",value:C,onChange:r=>Y(r.target.value),rows:4,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))]",d.textarea,c),required:true,"aria-invalid":!!i.description,"aria-describedby":i.description?"description-error":void 0}),i.description&&jsxRuntime.jsx("p",{id:"description-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.description})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"discoveredAt",className:"block text-sm font-medium mb-1",children:["Date Discovered ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"datetime-local",id:"discoveredAt",value:T,onChange:r=>H(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!i.discoveredAt,"aria-describedby":i.discoveredAt?"discoveredAt-error":void 0}),i.discoveredAt&&jsxRuntime.jsx("p",{id:"discoveredAt-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.discoveredAt})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"occurredAt",className:"block text-sm font-medium mb-1",children:"Date Occurred (if known)"}),jsxRuntime.jsx("input",{type:"datetime-local",id:"occurredAt",value:R,onChange:r=>_(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Reporter Information"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterName",className:"block text-sm font-medium mb-1",children:["Your Name ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"reporterName",value:B,onChange:r=>Z(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!i.reporterName,"aria-describedby":i.reporterName?"reporterName-error":void 0}),i.reporterName&&jsxRuntime.jsx("p",{id:"reporterName-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.reporterName})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterEmail",className:"block text-sm font-medium mb-1",children:["Your Email ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",id:"reporterEmail",value:h,onChange:r=>G(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!i.reporterEmail,"aria-describedby":i.reporterEmail?"reporterEmail-error":void 0}),i.reporterEmail&&jsxRuntime.jsx("p",{id:"reporterEmail-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.reporterEmail})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reporterDepartment",className:"block text-sm font-medium mb-1",children:["Your Department ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"reporterDepartment",value:j,onChange:r=>K(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!i.reporterDepartment,"aria-describedby":i.reporterDepartment?"reporterDepartment-error":void 0}),i.reporterDepartment&&jsxRuntime.jsx("p",{id:"reporterDepartment-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.reporterDepartment})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"reporterPhone",className:"block text-sm font-medium mb-1",children:"Your Phone Number (Optional)"}),jsxRuntime.jsx("input",{type:"tel",id:"reporterPhone",value:E,onChange:r=>W(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Information"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"affectedSystems",className:"block text-sm font-medium mb-1",children:["Affected Systems/Applications ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"affectedSystems",value:xe,onChange:ke,placeholder:"e.g. CRM, Email Server, Website (comma separated)",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!i.affectedSystems,"aria-describedby":i.affectedSystems?"affectedSystems-error":void 0}),i.affectedSystems&&jsxRuntime.jsx("p",{id:"affectedSystems-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.affectedSystems})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"estimatedAffectedSubjects",className:"block text-sm font-medium mb-1",children:"Estimated Number of Affected Data Subjects"}),jsxRuntime.jsx("input",{type:"text",id:"estimatedAffectedSubjects",value:u,onChange:r=>ee(r.target.value),placeholder:"e.g. 100",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))]","aria-invalid":!!i.estimatedAffectedSubjects,"aria-describedby":i.estimatedAffectedSubjects?"estimatedAffectedSubjects-error":void 0}),i.estimatedAffectedSubjects&&jsxRuntime.jsx("p",{id:"estimatedAffectedSubjects-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.estimatedAffectedSubjects})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Types of Data Involved ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:Te.map(r=>jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"checkbox",id:`dataType_${r.id}`,checked:q.includes(r.id),onChange:()=>we(r.id),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:`dataType_${r.id}`,className:"ml-2 text-sm text-gray-700 dark:text-gray-300",children:r.label})]},r.id))}),i.dataTypes&&jsxRuntime.jsx("p",{id:"dataTypes-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.dataTypes})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"status",className:"block text-sm font-medium mb-1",children:["Current Status ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsxs("select",{id:"status",value:re,onChange:r=>te(r.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))]",d.select,c),required:true,children:[jsxRuntime.jsx("option",{value:"ongoing",children:"Ongoing (breach is still active)"}),jsxRuntime.jsx("option",{value:"contained",children:"Contained (breach is stopped but not resolved)"}),jsxRuntime.jsx("option",{value:"resolved",children:"Resolved (breach is fully addressed)"})]})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"initialActions",className:"block text-sm font-medium mb-1",children:"Initial Actions Taken"}),jsxRuntime.jsx("textarea",{id:"initialActions",value:I,onChange:r=>ae(r.target.value),placeholder:"Describe any immediate actions that have been taken to address the breach",rows:3,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))]",d.textarea,c)})]})]})]}),ye&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Attachments"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Upload Supporting Files (Optional)"}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-2",children:["Max ",A," files, ",k/(1024*1024),"MB each. Allowed types: ",w.join(", ")]}),jsxRuntime.jsx("input",{type:"file",onChange:Se,multiple:true,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))]",accept:w.join(",")}),i.attachments&&jsxRuntime.jsx("p",{id:"attachments-error",role:"alert",className:"mt-1 text-sm text-red-500",children:i.attachments})]}),y.length>0&&jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium mb-2",children:"Attached Files:"}),jsxRuntime.jsx("ul",{className:"space-y-2",children:y.map((r,o)=>jsxRuntime.jsxs("li",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 text-gray-500 dark:text-gray-400 mr-2",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M8 4a3 3 0 00-3 3v4a5 5 0 0010 0V7a1 1 0 112 0v4a7 7 0 11-14 0V7a5 5 0 0110 0v4a3 3 0 11-6 0V7a1 1 0 012 0v4a1 1 0 102 0V7a3 3 0 00-3-3z",clipRule:"evenodd"})}),jsxRuntime.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:r.name}),jsxRuntime.jsxs("span",{className:"ml-2 text-xs text-gray-600 dark:text-gray-400",children:["(",(r.size/1024).toFixed(1)," KB)"]})]}),jsxRuntime.jsx("button",{type:"button",onClick:()=>De(o),className:"text-red-500 hover:text-red-700",children:jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]},o))})]})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",d.notice,c),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsxRuntime.jsxs("div",{className:"mt-6 relative flex gap-3",children:[f&&d.loadingOverlay&&jsxRuntime.jsx("div",{className:d.loadingOverlay}),jsxRuntime.jsx("button",{type:"submit",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 ${z} ${f?"opacity-50 cursor-not-allowed":""}`,d.primaryButton||d.submitButton,c),children:f?"Submitting...":ue}),jsxRuntime.jsx("button",{type:"button",onClick:Ae,disabled:f,className:chunkE64TU6IU_js.a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,c),children:"Reset"})]})]})})]})};
2
- exports.a=qe;//# sourceMappingURL=chunk-GVANK6PL.js.map
3
- //# sourceMappingURL=chunk-GVANK6PL.js.map
@@ -1,2 +0,0 @@
1
- import {a as a$1}from'./chunk-PGSA2O5P.mjs';import {a as a$2}from'./chunk-SBNAMPAP.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect}from'react';function H(a,A){return A?a$2(a):{load:()=>null,save:()=>{},remove:()=>{}}}function Y({sections:a$2,initialAnswers:A={},adapter:h,storageKey:E="ndpr_dpia_data",useLocalStorage:T=true,onComplete:I}){let w=h!=null?h:H(E,T),d=useRef(w);d.current=w;let[f,g]=useState(0),[o,p]=useState(A),[C,m]=useState(true);useEffect(()=>{let r=false;try{let s=d.current.load();s instanceof Promise?s.then(e=>{r||(e&&p(e),m(!1));},()=>{r||m(!1);}):(s&&p(s),m(!1));}catch(s){r||m(false);}return ()=>{r=true;}},[]);let c=a$2[f]||null,W=r=>{Promise.resolve(d.current.save(r)).catch(s=>{console.warn("[ndpr-toolkit] Failed to save DPIA answers:",s);});},_=(r,s)=>{p(e=>{let t=b(a({},e),{[r]:s});return W(t),t});},b$1=r=>r.showWhen?r.showWhen.every(s=>{let e=o[s.questionId];switch(s.operator){case "equals":return e===s.value;case "contains":return Array.isArray(e)?e.includes(s.value):false;case "greaterThan":return typeof e=="number"?e>s.value:false;case "lessThan":return typeof e=="number"?e<s.value:false;default:return true}}):true,v=()=>c?c.questions.filter(b$1):[],P=()=>c?v().every(s=>{if(!s.required)return true;let e=o[s.id];return !(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0)}):false,$=()=>{let r={};return c&&v().forEach(e=>{if(!e.required)return;let t=o[e.id];t==null||typeof t=="string"&&t.trim()===""?r[e.id]="This question is required":Array.isArray(t)&&t.length===0&&(r[e.id]="At least one option must be selected");}),r},O=()=>P()&&f<a$2.length-1?(g(r=>r+1),true):false,U=()=>f>0?(g(r=>r-1),true):false,V=r=>r>=0&&r<a$2.length?(g(r),true):false,B=()=>a$2.every(r=>r.questions.filter(e=>!e.showWhen||e.showWhen.length===0?true:e.showWhen.some(t=>{let n=o[t.questionId];switch(t.operator){case "equals":return n===t.value;case "contains":return Array.isArray(n)&&n.includes(t.value);case "greaterThan":return typeof n=="number"&&n>t.value;case "lessThan":return typeof n=="number"&&n<t.value;default:return false}})).every(e=>{if(!e.required)return true;let t=o[e.id];return !(t==null||typeof t=="string"&&t.trim()===""||Array.isArray(t)&&t.length===0)})),F=()=>{let r=[];return a$2.forEach(s=>{s.questions.forEach(e=>{let t=o[e.id];if(t!=null&&e.riskLevel)if(["select","radio","checkbox"].includes(e.type)&&e.options)(Array.isArray(t)?t:[t]).forEach(i=>{var D;let l=(D=e.options)==null?void 0:D.find(u=>u.value===i);if(l!=null&&l.riskLevel){let u=l.riskLevel,R=u==="low"?1:u==="medium"?3:5,S=u==="low"?1:u==="medium"?3:5;r.push({id:`risk_${r.length+1}`,description:`${e.text} - ${l.label}`,likelihood:R,impact:S,score:R*S,level:u,mitigated:false,relatedQuestionIds:[e.id]});}});else {let n=e.riskLevel,i=n==="low"?1:n==="medium"?3:5,l=n==="low"?1:n==="medium"?3:5;r.push({id:`risk_${r.length+1}`,description:e.text,likelihood:i,impact:l,score:i*l,level:n,mitigated:false,relatedQuestionIds:[e.id]});}});}),r},K=(r,s,e)=>{let t=F(),n={id:`dpia_${Date.now()}`,title:s,processingDescription:e,startedAt:Date.now(),completedAt:Date.now(),assessor:r,answers:o,risks:t,overallRiskLevel:"low",canProceed:true,conclusion:"",version:"1.0"},i=a$1(n);return n.overallRiskLevel=i.overallRiskLevel,n.canProceed=i.canProceed,n.conclusion=i.canProceed?"Based on the assessment, the processing can proceed with appropriate safeguards.":"Based on the assessment, the processing should not proceed without further mitigation measures.",n.recommendations=i.recommendations,I&&I(n),n},M=()=>{p({}),g(0),Promise.resolve(d.current.remove()).catch(r=>{console.warn("[ndpr-toolkit] Failed to remove DPIA data:",r);});},j=(()=>{let r=0,s=0;return a$2.forEach(e=>{e.questions.forEach(t=>{if(t.required&&b$1(t)){s++;let n=o[t.id];n!=null&&!(typeof n=="string"&&n.trim()==="")&&!(Array.isArray(n)&&n.length===0)&&r++;}});}),s>0?Math.round(r/s*100):0})();return {currentSectionIndex:f,currentSection:c,answers:o,updateAnswer:_,nextSection:O,prevSection:U,goToSection:V,isCurrentSectionValid:P,getCurrentSectionErrors:$,isComplete:B,completeDPIA:K,getVisibleQuestions:v,resetDPIA:M,progress:j,isLoading:C}}export{Y as a};//# sourceMappingURL=chunk-HNZK7LY3.mjs.map
2
- //# sourceMappingURL=chunk-HNZK7LY3.mjs.map
@@ -1,2 +0,0 @@
1
- 'use strict';var chunk5RSOLEEP_js=require('./chunk-5RSOLEEP.js'),chunkUK656RCG_js=require('./chunk-UK656RCG.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function _(f,s){return s?chunkUK656RCG_js.a(f):{load:()=>null,save:()=>{},remove:()=>{}}}function z({templates:f,initialPolicy:s,adapter:y,storageKey:T="ndpr_privacy_policy",useLocalStorage:I=true,onGenerate:p}){let P=y!=null?y:_(T,I),o=react.useRef(P);o.current=P;let[a,d]=react.useState(s||null),[u,g]=react.useState(null),[m,h]=react.useState({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),[w,v]=react.useState(true);react.useEffect(()=>{if(s){v(false);return}let e=false;try{let n=o.current.load(),i=t=>{if(t){if(d(t),t.templateId){let l=f.find(U=>U.id===t.templateId);l&&g(l);}t.organizationInfo&&h(t.organizationInfo);}v(!1);};n instanceof Promise?n.then(t=>{e||i(t);},()=>{e||v(!1);}):i(n);}catch(n){e||v(false);}return ()=>{e=true;}},[s,f]);let x=e=>{Promise.resolve(o.current.save(e)).catch(n=>{console.warn("[ndpr-toolkit] Failed to save policy:",n);});},E=e=>{let n=f.find(l=>l.id===e);if(!n)return false;g(n);n.sections.map(l=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},l),{customContent:void 0}));return Object.keys(n.variables).forEach(l=>{n.variables[l].defaultValue||"";}),true},q=e=>{h(n=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},n),e));},N=(e,n)=>{u&&(a?d(i=>i&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{sections:i.sections.map(t=>t.id===e?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{included:n}):t)})):g(i=>i&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{sections:i.sections.map(t=>t.id===e?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{included:n}):t)})));},D=(e,n)=>{u&&(a?d(i=>i&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{sections:i.sections.map(t=>t.id===e?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{customContent:n}):t)})):g(i=>i&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{sections:i.sections.map(t=>t.id===e?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{customContent:n}):t)})));},C=(e,n)=>{a&&d(i=>i&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{variableValues:chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i.variableValues),{[e]:n})}));},R=()=>"policy_"+Date.now()+"_"+Math.random().toString(36).substr(2,9);return {policy:a,selectedTemplate:u,organizationInfo:m,selectTemplate:E,updateOrganizationInfo:q,toggleSection:N,updateSectionContent:D,updateVariableValue:C,generatePolicy:()=>{if(!u)throw new Error("No template selected");let e=Date.now(),n={id:(a==null?void 0:a.id)||R(),title:`Privacy Policy for ${m.name}`,templateId:u.id,organizationInfo:m,sections:u.sections.map(i=>{var t;return chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{customContent:(t=a==null?void 0:a.sections.find(l=>l.id===i.id))==null?void 0:t.customContent})}),variableValues:(a==null?void 0:a.variableValues)||{},effectiveDate:e,lastUpdated:e,version:"1.0"};return d(n),x(n),p&&p(n),n},getPolicyText:()=>{if(!a)return {fullText:"",sectionTexts:{},missingVariables:[]};let e=chunk5RSOLEEP_js.a(a.sections,a.organizationInfo);return typeof e=="string"?{fullText:e,sectionTexts:{full:e},missingVariables:[]}:e},resetPolicy:()=>{d(null),g(null),h({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),Promise.resolve(o.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove policy:",e);});},isValid:()=>{let e=[];if(u||e.push("No template selected"),m.name||e.push("Organization name is required"),m.website||e.push("Organization website is required"),m.privacyEmail||e.push("Privacy contact email is required"),u){let n=u.sections.filter(t=>t.required),i=(a==null?void 0:a.sections.filter(t=>t.included))||[];n.forEach(t=>{i.some(l=>l.id===t.id)||e.push(`Required section "${t.title}" must be included`);});}return u&&a&&Object.entries(u.variables).forEach(([n,i])=>{i.required&&!a.variableValues[n]&&e.push(`Required variable "${i.name}" must have a value`);}),{valid:e.length===0,errors:e}},isLoading:w}}function W(f={}){let{orgInfo:s,storageKey:y,useLocalStorage:T}=f,{sections:I,variables:p}=chunk5RSOLEEP_js.d();if(s)for(let o of p)s.name&&o.name==="orgName"&&(o.value=s.name),s.email&&o.name==="privacyEmail"&&(o.value=s.email),s.dpoName&&o.name==="dpoName"&&(o.value=s.dpoName);let P={id:"default-business",name:"Default Business Policy",description:"NDPA-compliant privacy policy template for businesses.",organizationType:"business",sections:I,variables:Object.fromEntries(p.map(o=>[o.name,{name:o.name,description:o.description,required:o.required,defaultValue:o.value||void 0}])),version:"1.0",lastUpdated:Date.now(),ndpaCompliant:true};return z({templates:[P],storageKey:y,useLocalStorage:T})}exports.a=z;exports.b=W;//# sourceMappingURL=chunk-IKEPXHCZ.js.map
2
- //# sourceMappingURL=chunk-IKEPXHCZ.js.map
@@ -1,2 +0,0 @@
1
- 'use strict';function u(e){return e==="standard_clauses"||e==="binding_corporate_rules"||e==="ndpc_authorization"}function h(e){return {adequacy_decision:"Adequacy Decision (NDPA Section 41) \u2014 Transfer to a country or territory that the NDPC has determined provides an adequate level of data protection.",standard_clauses:"Standard Contractual Clauses (NDPA Section 42) \u2014 Transfer based on standard contractual clauses approved by the NDPC between the controller/processor and the recipient.",binding_corporate_rules:"Binding Corporate Rules (NDPA Section 43) \u2014 Transfer within a group of undertakings based on binding corporate rules approved by the NDPC.",ndpc_authorization:"NDPC Authorization (NDPA Section 44) \u2014 Transfer authorized by the Nigeria Data Protection Commission under specific conditions.",explicit_consent:"Explicit Consent (NDPA Section 45(a)) \u2014 Transfer based on the explicit and informed consent of the data subject after being informed of the risks.",contract_performance:"Contract Performance (NDPA Section 45(b)) \u2014 Transfer necessary for the performance of a contract between the data subject and the controller.",public_interest:"Public Interest (NDPA Section 45(c)) \u2014 Transfer necessary for important reasons of public interest.",legal_claims:"Legal Claims (NDPA Section 45(d)) \u2014 Transfer necessary for the establishment, exercise, or defense of legal claims.",vital_interests:"Vital Interests (NDPA Section 45(e)) \u2014 Transfer necessary to protect the vital interests of the data subject or other persons."}[e]}function m(e){var s,n;let t=[],a=[];return e.id||t.push("Transfer ID is required."),(!e.destinationCountry||e.destinationCountry.trim()==="")&&t.push("Destination country is required."),(!e.recipientOrganization||e.recipientOrganization.trim()==="")&&t.push("Recipient organization is required."),(!((s=e.recipientContact)!=null&&s.name)||e.recipientContact.name.trim()==="")&&t.push("Recipient contact name is required."),(!((n=e.recipientContact)!=null&&n.email)||e.recipientContact.email.trim()==="")&&t.push("Recipient contact email is required."),(!e.purpose||e.purpose.trim()==="")&&t.push("Purpose of the transfer is required."),e.transferMechanism||t.push("Transfer mechanism is required."),(!e.dataCategories||e.dataCategories.length===0)&&t.push("At least one data category must be specified."),(!e.riskAssessment||e.riskAssessment.trim()==="")&&t.push("Risk assessment summary is required."),(!e.safeguards||e.safeguards.length===0)&&t.push("At least one safeguard must be documented for the transfer."),u(e.transferMechanism)&&(e.ndpcApproval?(e.ndpcApproval.required||a.push("NDPC approval is marked as not required, but the selected transfer mechanism requires NDPC approval."),e.ndpcApproval.required&&!e.ndpcApproval.applied&&t.push("NDPC approval is required but an application has not been submitted."),e.ndpcApproval.applied&&!e.ndpcApproval.approved&&e.status==="active"&&t.push('Transfer is marked as active but NDPC approval has not been granted. Status should be "pending_approval".')):t.push(`NDPC approval documentation is required for transfers using ${d(e.transferMechanism)}.`)),e.tiaCompleted||a.push("A Transfer Impact Assessment (TIA) has not been completed for this transfer."),e.adequacyStatus==="inadequate"&&e.transferMechanism==="adequacy_decision"&&t.push("Cannot rely on adequacy decision (Section 41) when the destination country is marked as inadequate."),e.endDate&&e.startDate>e.endDate&&t.push("Start date must be before end date."),e.includesSensitiveData&&e.riskLevel!=="high"&&a.push("Transfer includes sensitive personal data but the risk level is not set to high. Consider reviewing the risk assessment."),e.reviewDate||a.push("No review date has been set for this transfer. Periodic reviews are recommended."),{isValid:t.length===0,errors:t,warnings:a}}function f(e){var o,c;let t=[],a=[],s=0,p={adequate:0,pending_review:2,unknown:3,inadequate:4}[e.adequacyStatus];s+=p,e.adequacyStatus==="inadequate"?(t.push("Destination country does not have an adequate level of data protection."),a.push("Implement supplementary technical and organizational measures.")):e.adequacyStatus==="unknown"?(t.push("Data protection adequacy of the destination country has not been assessed."),a.push("Conduct an adequacy assessment of the destination country.")):e.adequacyStatus==="pending_review"&&(t.push("Destination country adequacy is currently under review."),a.push("Monitor the adequacy review outcome and plan for contingencies."));let r={adequacy_decision:0,standard_clauses:1,binding_corporate_rules:1,ndpc_authorization:1,contract_performance:2,explicit_consent:2,legal_claims:2,public_interest:2,vital_interests:3}[e.transferMechanism];s+=r,r>=2&&(t.push(`Transfer relies on a derogation mechanism (${d(e.transferMechanism)}), which provides fewer structural safeguards.`),a.push("Consider whether a stronger transfer mechanism (adequacy decision, standard clauses, or BCRs) could be used instead.")),e.includesSensitiveData&&(s+=3,t.push("Transfer includes sensitive personal data, increasing the potential impact of unauthorized access."),a.push("Ensure encryption in transit and at rest, and apply strict access controls.")),e.estimatedDataSubjects&&e.estimatedDataSubjects>1e4?(s+=2,t.push("Large number of data subjects involved increases the scope of potential harm."),a.push("Consider data minimization strategies and ensure robust incident response procedures.")):e.estimatedDataSubjects&&e.estimatedDataSubjects>1e3&&(s+=1,t.push("Moderate number of data subjects involved.")),e.tiaCompleted||(s+=2,t.push("Transfer Impact Assessment has not been completed."),a.push("Complete a Transfer Impact Assessment before proceeding with the transfer.")),u(e.transferMechanism)&&((o=e.ndpcApproval)!=null&&o.approved||(s+=2,t.push("NDPC approval is required but has not been granted."),a.push("Obtain NDPC approval before activating the transfer."))),(((c=e.safeguards)==null?void 0:c.length)||0)<3&&(s+=1,t.push("Limited number of safeguards documented."),a.push("Document additional technical, organizational, and contractual safeguards.")),e.frequency==="continuous"&&(s+=1,t.push("Continuous data transfer increases exposure window."),a.push("Implement real-time monitoring and anomaly detection for the transfer."));let i;return s<=4?i="low":s<=9?i="medium":i="high",{riskLevel:i,riskScore:s,factors:t,recommendations:a}}function d(e){return {adequacy_decision:"Adequacy Decision",standard_clauses:"Standard Contractual Clauses",binding_corporate_rules:"Binding Corporate Rules",ndpc_authorization:"NDPC Authorization",explicit_consent:"Explicit Consent",contract_performance:"Contract Performance",public_interest:"Public Interest",legal_claims:"Legal Claims",vital_interests:"Vital Interests"}[e]}exports.a=u;exports.b=h;exports.c=m;exports.d=f;//# sourceMappingURL=chunk-IQF726GS.js.map
2
- //# sourceMappingURL=chunk-IQF726GS.js.map
@@ -1,2 +0,0 @@
1
- 'use strict';var chunkCMZTI7SG_js=require('./chunk-CMZTI7SG.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var oe=({requests:k,onSelectRequest:T,onUpdateStatus:$,onAssignRequest:I,title:H="Data Subject Request Dashboard",description:X="Track and manage data subject requests in compliance with NDPA Part IV requirements.",className:J="",buttonClassName:V="",showRequestDetails:K=true,showRequestTimeline:Y=true,showDeadlineAlerts:F=true,assignees:i=[],classNames:s,unstyled:f=false})=>{let[R,y]=react.useState(null),[N,B]=react.useState(k),[j,O]=react.useState("all"),[C,M]=react.useState("all"),[A,_]=react.useState(""),[P,z]=react.useState("createdAt"),[L,Z]=react.useState("desc"),[D,G]=react.useState("");react.useEffect(()=>{let e=[...k];if(j!=="all"&&(e=e.filter(r=>r.status===j)),C!=="all"&&(e=e.filter(r=>r.type===C)),A){let r=A.toLowerCase();e=e.filter(p=>p.subject.name.toLowerCase().includes(r)||p.subject.email.toLowerCase().includes(r)||p.description&&p.description.toLowerCase().includes(r));}e.sort((r,p)=>{let w=0;switch(P){case "createdAt":w=r.createdAt-p.createdAt;break;case "dueDate":w=(r.dueDate||0)-(p.dueDate||0);break;case "type":w=r.type.localeCompare(p.type);break;case "status":w=r.status.localeCompare(p.status);break;default:w=r.createdAt-p.createdAt;}return L==="asc"?w:-w}),B(e);},[k,j,C,A,P,L]),react.useEffect(()=>{N.length>0&&!R&&y(N[0].id);},[N,R]);let Q=e=>{y(e),T&&T(e);},U=e=>{R&&$&&$(R,e);},W=()=>{R&&D&&I&&(I(R,D),G(""));},h=e=>new Date(e).toLocaleDateString(),E=e=>{let r=Date.now(),p=(e-r)/(1440*60*1e3);return Math.ceil(p)},m=R?k.find(e=>e.id===R):null,t=e=>{let r={information:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",access:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",rectification:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",erasure:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",restriction:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",portability:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",objection:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",automated_decision_making:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},p={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${r[e]}`,children:p[e]})},l=e=>jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{pending:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",inProgress:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",completed:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",rejected:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",awaitingVerification:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200"}[e]}`,s==null?void 0:s.statusBadge,f),children:e==="inProgress"?"In Progress":e==="awaitingVerification"?"Awaiting Verification":e.charAt(0).toUpperCase()+e.slice(1)}),g=e=>{if(!e.dueDate)return null;let r=E(e.dueDate);return r<=0?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Deadline Passed"}),jsxRuntime.jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The response deadline has passed. Immediate action is required."})]}):r<=3?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Deadline Approaching"}),jsxRuntime.jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",r," day",r!==1?"s":""," remaining until the response deadline."]})]}):r<=7?jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Deadline Approaching"}),jsxRuntime.jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:[r," days remaining until the response deadline."]})]}):jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Deadline Tracking"}),jsxRuntime.jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:[r," days remaining until the response deadline."]})]})},x=e=>{let r=[{title:"Request Received",date:e.createdAt,completed:true,description:`Request was received on ${h(e.createdAt)}.`}];return e.verifiedAt?r.push({title:"Identity Verified",date:e.verifiedAt,completed:true,description:`Data subject's identity was verified on ${h(e.verifiedAt)}.`}):e.status==="awaitingVerification"&&r.push({title:"Identity Verification",date:Date.now(),completed:false,description:"Awaiting verification of data subject's identity."}),(e.status==="inProgress"||e.status==="completed"||e.status==="rejected")&&r.push({title:"Processing Started",date:e.updatedAt,completed:true,description:`Request processing started on ${h(e.updatedAt)}.`}),e.status==="completed"?r.push({title:"Request Completed",date:e.completedAt||Date.now(),completed:true,description:`Request was completed on ${h(e.completedAt||Date.now())}.`}):e.status==="rejected"&&r.push({title:"Request Rejected",date:e.completedAt||Date.now(),completed:true,description:`Request was rejected on ${h(e.completedAt||Date.now())}.${e.rejectionReason?` Reason: ${e.rejectionReason}`:""}`}),e.dueDate&&r.push({title:"Response Deadline",date:e.dueDate,completed:Date.now()>e.dueDate,description:`Response is due by ${h(e.dueDate)}.`}),jsxRuntime.jsxs("div",{className:"mt-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Request Timeline"}),jsxRuntime.jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:r.map((p,w)=>jsxRuntime.jsxs("li",{className:"mb-6 ml-4",children:[jsxRuntime.jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${p.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsxRuntime.jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-600 dark:text-gray-500",children:p.date?h(p.date):"Pending"}),jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:p.title}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:p.description})]},w))})]})},o=()=>[{value:"all",label:"All Types"},{value:"information",label:"Information (NDPA Section 29)"},{value:"access",label:"Access (NDPA Section 30)"},{value:"rectification",label:"Rectification (NDPA Section 31)"},{value:"erasure",label:"Erasure (NDPA Section 32)"},{value:"restriction",label:"Restriction (NDPA Section 33)"},{value:"portability",label:"Portability (NDPA Section 34)"},{value:"objection",label:"Objection (NDPA Section 35)"},{value:"automated_decision_making",label:"Automated Decision-Making (NDPA Section 36)"}].map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value)),u=()=>[{value:"all",label:"All Statuses"},{value:"pending",label:"Pending"},{value:"awaitingVerification",label:"Awaiting Verification"},{value:"inProgress",label:"In Progress"},{value:"completed",label:"Completed"},{value:"rejected",label:"Rejected"}].map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value)),v=()=>[{value:"pending",label:"Pending"},{value:"awaitingVerification",label:"Awaiting Verification"},{value:"inProgress",label:"In Progress"},{value:"completed",label:"Completed"},{value:"rejected",label:"Rejected"}].map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value));return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${J}`,s==null?void 0:s.root,f),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",s==null?void 0:s.header,f),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",s==null?void 0:s.title,f),children:H}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:X})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",s==null?void 0:s.filters,f),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxRuntime.jsx("select",{id:"statusFilter",value:j,onChange:e=>O(e.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:u()})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"typeFilter",className:"block text-sm font-medium mb-1",children:"Request Type Filter"}),jsxRuntime.jsx("select",{id:"typeFilter",value:C,onChange:e=>M(e.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:o()})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxRuntime.jsxs("select",{id:"sortBy",value:P,onChange:e=>z(e.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"createdAt",children:"Date Received"}),jsxRuntime.jsx("option",{value:"dueDate",children:"Due Date"}),jsxRuntime.jsx("option",{value:"type",children:"Request Type"}),jsxRuntime.jsx("option",{value:"status",children:"Status"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"searchTerm",value:A,onChange:e=>_(e.target.value),placeholder:"Search requests...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxRuntime.jsxs("div",{className:"md:col-span-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"DSR Requests"}),N.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data subject requests found."}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",s==null?void 0:s.requestList,f),children:N.map(e=>{let r=e.dueDate?E(e.dueDate):null,p=null;return r!==null&&(r<=0?p=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):r<=3?p=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):r<=7&&(p=jsxRuntime.jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Soon"}))),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md cursor-pointer ${R===e.id?"bg-[rgb(var(--ndpr-primary)/0.05)] dark:bg-[rgb(var(--ndpr-primary)/0.1)] border border-[rgb(var(--ndpr-primary)/0.2)] dark:border-[rgb(var(--ndpr-primary)/0.3)]":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,s==null?void 0:s.requestItem,f),onClick:()=>Q(e.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:e.subject.name}),t(e.type)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:e.subject.email}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:["Received: ",h(e.createdAt)]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsxRuntime.jsx("div",{children:l(e.status)}),jsxRuntime.jsx("div",{children:p})]})]},e.id)})})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("md:col-span-2",s==null?void 0:s.detailPanel,f),children:m?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:m.subject.name}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[t(m.type),l(m.status)]})]}),F&&m.dueDate&&jsxRuntime.jsx("div",{className:"mb-4",children:g(m)}),K&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Email:"})," ",m.subject.email]}),m.subject.phone&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Phone:"})," ",m.subject.phone]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Received:"})," ",h(m.createdAt)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Request Type:"})," ",{information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"}[m.type]||m.type]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",m.status==="inProgress"?"In Progress":m.status==="awaitingVerification"?"Awaiting Verification":m.status.charAt(0).toUpperCase()+m.status.slice(1)]}),m.dueDate&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Due Date:"})," ",h(m.dueDate)]})]})]}),m.description&&jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Request Details:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:m.description})]}),m.additionalInfo&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Additional Information:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:typeof m.additionalInfo=="object"?JSON.stringify(m.additionalInfo,null,2):String(m.additionalInfo||"No additional information provided")})]})]}),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-md font-medium mb-2",children:"Update Status"}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsx("select",{value:m.status,onChange:e=>U(e.target.value),className:"flex-grow px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:v()}),jsxRuntime.jsx("button",{onClick:()=>U(m.status),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${V}`,children:"Update"})]})]}),i.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-md font-medium mb-2",children:"Assign Request"}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsxs("select",{value:D,onChange:e=>G(e.target.value),className:"flex-grow px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"",children:"Select Assignee"}),i.map(e=>jsxRuntime.jsx("option",{value:e,children:e},e))]}),jsxRuntime.jsx("button",{onClick:W,disabled:!D,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] disabled:bg-gray-300 disabled:text-gray-500 ${V}`,children:"Assign"})]})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Request Summary"}),jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:jsxRuntime.jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:jsxRuntime.jsx("pre",{children:JSON.stringify(chunkCMZTI7SG_js.a(m),null,2)})})})]}),Y&&x(m)]}):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Select a request to view details"})})})]})]})};var ue=({requests:k,onSelectRequest:T,title:$="DSR Request Tracker",description:I="Track the status and progress of data subject requests as required by NDPA Part IV.",className:H="",buttonClassName:X="",showSummaryStats:J=true,showTypeBreakdown:V=true,showStatusBreakdown:K=true,showTimelineChart:Y=true,showOverdueRequests:F=true,classNames:i,unstyled:s=false})=>{let[f,R]=react.useState("30days"),[y,N]=react.useState(k),[B,j]=react.useState([]),[O,C]=react.useState([]);react.useEffect(()=>{let t=Date.now(),l;switch(f){case "7days":l=k.filter(o=>t-o.createdAt<=10080*60*1e3);break;case "30days":l=k.filter(o=>t-o.createdAt<=720*60*60*1e3);break;case "90days":l=k.filter(o=>t-o.createdAt<=2160*60*60*1e3);break;default:l=[...k];}N(l);let g=l.filter(o=>o.dueDate&&t>o.dueDate&&o.status!=="completed"&&o.status!=="rejected");j(g);let x=l.filter(o=>o.dueDate&&t<o.dueDate&&o.dueDate-t<=10080*60*1e3&&o.status!=="completed"&&o.status!=="rejected");C(x);},[k,f]);let M=t=>{T&&T(t);},A=t=>new Date(t).toLocaleDateString(),_=t=>{let l=Date.now(),g=(t-l)/(1440*60*1e3);return Math.ceil(g)},P=()=>{let t=y.filter(g=>g.status==="completed"&&g.completedAt&&g.createdAt);if(t.length===0)return null;let l=t.reduce((g,x)=>{let o=((x.completedAt||0)-x.createdAt)/864e5;return g+o},0);return Number((l/t.length).toFixed(1))},z=()=>{let t=y.filter(g=>(g.status==="completed"||g.status==="rejected")&&g.completedAt&&g.dueDate);if(t.length===0)return null;let l=t.filter(g=>(g.completedAt||0)<=(g.dueDate||0));return Math.round(l.length/t.length*100)},L=()=>{let t={};return y.forEach(l=>{t[l.type]=(t[l.type]||0)+1;}),{information:t.information||0,access:t.access||0,rectification:t.rectification||0,erasure:t.erasure||0,restriction:t.restriction||0,portability:t.portability||0,objection:t.objection||0,automated_decision_making:t.automated_decision_making||0}},Z=()=>{let t={};return y.forEach(l=>{t[l.status]=(t[l.status]||0)+1;}),{pending:t.pending||0,awaitingVerification:t.awaitingVerification||0,inProgress:t.inProgress||0,completed:t.completed||0,rejected:t.rejected||0}},D=t=>{let l={information:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",access:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",rectification:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",erasure:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",restriction:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",portability:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",objection:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",automated_decision_making:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},g={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${l[t]}`,children:g[t]})},Q=()=>{let t=y.length,l=y.filter(u=>u.status!=="completed"&&u.status!=="rejected").length;y.filter(u=>u.status==="completed"||u.status==="rejected").length;let x=P(),o=z();return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",i==null?void 0:i.stats,s),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,s),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Total Requests"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:t})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,s),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Pending Requests"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:l})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,s),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Avg. Response Time"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:x!==null?`${x} days`:"N/A"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",i==null?void 0:i.statCard,s),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Compliance Rate"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:o!==null?`${o}%`:"N/A"})]})]})},U=()=>{let t=L(),l=y.length,g=Object.entries(t).sort(([,x],[,o])=>o-x).map(([x])=>x);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",i==null?void 0:i.table,s),children:[jsxRuntime.jsx("h3",{className:chunkE64TU6IU_js.a("text-lg font-medium mb-4",i==null?void 0:i.tableHeader,s),children:"Request Types"}),l===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxRuntime.jsx("div",{className:"space-y-4",children:g.map(x=>{let o=t[x],u=Math.round(o/l*100);return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[D(x),jsxRuntime.jsxs("span",{className:"ml-2 text-sm",children:[o," requests"]})]}),jsxRuntime.jsxs("span",{className:"text-sm font-medium",children:[u,"%"]})]}),jsxRuntime.jsx("div",{className:"w-full bg-gray-200 dark:bg-gray-600 rounded-full h-2.5",children:jsxRuntime.jsx("div",{className:"bg-[rgb(var(--ndpr-primary))] h-2.5 rounded-full",style:{width:`${u}%`}})})]},x)})})]})},W=()=>{let t=Z(),l=y.length,g=["pending","awaitingVerification","inProgress","completed","rejected"],x={pending:"bg-yellow-500",awaitingVerification:"bg-purple-500",inProgress:"bg-blue-500",completed:"bg-green-500",rejected:"bg-red-500"};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",i==null?void 0:i.table,s),children:[jsxRuntime.jsx("h3",{className:chunkE64TU6IU_js.a("text-lg font-medium mb-4",i==null?void 0:i.tableHeader,s),children:"Request Status"}),l===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"flex h-4 mb-2",children:g.map(o=>{let u=t[o],v=u/l*100;return v>0?jsxRuntime.jsx("div",{className:`${x[o]} first:rounded-l-full last:rounded-r-full`,style:{width:`${v}%`},title:`${o}: ${u} (${Math.round(v)}%)`},o):null})}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 mt-4",children:g.map(o=>{let u=t[o],v=Math.round(u/l*100);return jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("div",{className:`w-3 h-3 rounded-full ${x[o]} mr-2`}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium",children:o==="inProgress"?"In Progress":o==="awaitingVerification"?"Awaiting Verification":o.charAt(0).toUpperCase()+o.slice(1)}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:[u," (",v,"%)"]})]})]},o)})})]})]})},h=()=>{let t={};y.forEach(u=>{let v=new Date(u.createdAt),e=`${v.getFullYear()}-${String(v.getMonth()+1).padStart(2,"0")}`;t[e]=(t[e]||0)+1;});let g=Object.keys(t).sort().slice(-6),x=Math.max(...Object.values(t).filter(u=>u>0),1),o=u=>{let[v,e]=u.split("-");return `${e}/${v.slice(2)}`};return jsxRuntime.jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Request Timeline"}),g.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxRuntime.jsxs("div",{className:"h-40",children:[jsxRuntime.jsx("div",{className:"flex h-32 items-end justify-between space-x-2",children:g.map(u=>{let v=t[u],e=`${v/x*100}%`;return jsxRuntime.jsx("div",{className:"flex flex-col items-center flex-1",children:jsxRuntime.jsx("div",{className:"w-full bg-[rgb(var(--ndpr-primary))] rounded-t",style:{height:e},title:`${o(u)}: ${v} requests`})},u)})}),jsxRuntime.jsx("div",{className:"flex justify-between mt-2",children:g.map(u=>jsxRuntime.jsx("div",{className:"text-xs text-center",children:o(u)},u))})]})]})},E=()=>jsxRuntime.jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Overdue Requests"}),B.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No overdue requests."}):jsxRuntime.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:B.map(t=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md cursor-pointer hover:bg-red-100 dark:hover:bg-red-900/30",i==null?void 0:i.tableRow,s),onClick:()=>M(t.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:t.subject.name}),D(t.type)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:t.subject.email}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:["Due: ",A(t.dueDate||0)]}),jsxRuntime.jsxs("p",{className:"text-xs font-bold text-red-600 dark:text-red-400",children:["Overdue by ",Math.abs(_(t.dueDate||0))," days"]})]})]},t.id))})]}),m=()=>jsxRuntime.jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Upcoming Deadlines"}),O.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No upcoming deadlines in the next 7 days."}):jsxRuntime.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:O.map(t=>{let l=_(t.dueDate||0);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-3 bg-yellow-50 dark:bg-yellow-900/20 rounded-md cursor-pointer hover:bg-yellow-100 dark:hover:bg-yellow-900/30",i==null?void 0:i.tableRow,s),onClick:()=>M(t.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:t.subject.name}),D(t.type)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:t.subject.email}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:["Due: ",A(t.dueDate||0)]}),jsxRuntime.jsxs("p",{className:`text-xs font-bold ${l<=3?"text-red-600 dark:text-red-400":"text-yellow-600 dark:text-yellow-400"}`,children:["Due in ",l," days"]})]})]},t.id)})})]});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${H}`,i==null?void 0:i.root,s),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col md:flex-row md:justify-between md:items-center mb-6",i==null?void 0:i.header,s),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",i==null?void 0:i.title,s),children:$}),jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:I})]}),jsxRuntime.jsxs("div",{className:"mt-4 md:mt-0",children:[jsxRuntime.jsx("label",{htmlFor:"timeframe",className:"block text-sm font-medium mb-1",children:"Timeframe"}),jsxRuntime.jsxs("select",{id:"timeframe",value:f,onChange:t=>R(t.target.value),className:"px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"7days",children:"Last 7 Days"}),jsxRuntime.jsx("option",{value:"30days",children:"Last 30 Days"}),jsxRuntime.jsx("option",{value:"90days",children:"Last 90 Days"}),jsxRuntime.jsx("option",{value:"all",children:"All Time"})]})]})]}),J&&Q(),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{children:[V&&U(),K&&W()]}),jsxRuntime.jsxs("div",{children:[Y&&h(),F&&E(),F&&m()]})]})]})};exports.a=oe;exports.b=ue;//# sourceMappingURL=chunk-IQQW52EF.js.map
2
- //# sourceMappingURL=chunk-IQQW52EF.js.map
@@ -1,72 +0,0 @@
1
- import {a as a$1}from'./chunk-RGYK4VAY.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var ve=({breachData:g,initialAssessment:u={},onComplete:k,title:V="Breach Risk Assessment",description:Y="Assess the risk level of this data breach to determine notification requirements under NDPA Section 40.",submitButtonText:J="Complete Assessment",className:ee="",buttonClassName:_="",classNames:h={},unstyled:d=false,showBreachSummary:l=true,showNotificationRequirements:R=true})=>{let[L,te]=useState(u.confidentialityImpact||3),[$,v]=useState(u.integrityImpact||3),[D,C]=useState(u.availabilityImpact||3),[j,B]=useState(u.harmLikelihood||3),[q,P]=useState(u.harmSeverity||3),[U,E]=useState(u.risksToRightsAndFreedoms!==void 0?u.risksToRightsAndFreedoms:false),[H,M]=useState(u.highRisksToRightsAndFreedoms!==void 0?u.highRisksToRightsAndFreedoms:false),[K,ae]=useState(u.justification||""),[W,se]=useState(0),[w,f]=useState("low"),[x,b]=useState(false),[y,Z]=useState(0),[O,Q]=useState(0),[p,S]=useState(false);useEffect(()=>{let X=L*.2+$*.1+D*.1+j*.3+q*.3;se(Number(X.toFixed(1)));let F;X<2?F="low":X<3?F="medium":X<4?F="high":F="critical",f(F),b(U||F==="high"||F==="critical");let ne=g.discoveredAt+4320*60*1e3;Z(ne);let ce=Date.now(),pe=(ne-ce)/(3600*1e3);Q(Number(pe.toFixed(1)));},[L,$,D,j,q,U,g.discoveredAt]);let ie=o=>new Date(o).toLocaleString(),re=o=>{o.preventDefault();let N={id:u.id||`assessment_${Date.now()}`,breachId:g.id,assessedAt:Date.now(),assessor:u.assessor||{name:"Assessment User",role:"Data Protection Officer",email:"dpo@example.com"},confidentialityImpact:L,integrityImpact:$,availabilityImpact:D,harmLikelihood:j,harmSeverity:q,overallRiskScore:W,riskLevel:w,risksToRightsAndFreedoms:U,highRisksToRightsAndFreedoms:H,justification:K};k(N),S(true);},s=o=>{switch(o){case 1:return "Minimal";case 2:return "Low";case 3:return "Moderate";case 4:return "High";case 5:return "Severe";default:return "Unknown"}},c=o=>jsx("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-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[o]}`,h.riskBadge,d),children:o.charAt(0).toUpperCase()+o.slice(1)});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ee}`,h.root,d),children:[jsx("h2",{className:a("text-xl font-bold mb-2",h.title,d),children:V}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:Y}),l&&jsxs("div",{className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("h3",{className:"text-lg font-medium mb-2",children:"Breach Summary"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Title:"})," ",g.title]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Discovered:"})," ",ie(g.discoveredAt)]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",g.status.charAt(0).toUpperCase()+g.status.slice(1)]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Types:"})," ",g.dataTypes.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",g.affectedSystems.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",g.estimatedAffectedSubjects||"Unknown"]})]})]})]}),p?jsxs("div",{children:[jsxs("div",{className:"mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Assessment Results"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Overall Risk Level:"})," ",c(w)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risk Score:"})," ",W," / 5"]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Assessed On:"})," ",ie(Date.now())]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",U?"Yes":"No"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",H?"Yes":"No"]})]})]}),jsxs("div",{className:"mt-3",children:[jsx("p",{className:"text-sm mb-1",children:jsx("span",{className:"font-medium",children:"Justification:"})}),jsx("p",{className:"text-sm bg-white dark:bg-gray-800 p-2 rounded",children:K})]})]}),R&&jsxs("div",{className:a(`mb-6 p-4 rounded-md ${x?O>24?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20":"bg-green-50 dark:bg-green-900/20"}`,h.notificationStatus,d),children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Requirements"}),x?jsxs("div",{children:[jsx("p",{className:`text-sm font-bold mb-2 ${O>24?"text-yellow-800 dark:text-yellow-200":"text-red-800 dark:text-red-200"}`,children:"NDPC Notification Required"}),jsx("p",{className:"text-sm mb-2",children:"Under the NDPA (Section 40), this breach must be reported to the NDPC within 72 hours of discovery."}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Notification Deadline:"})," ",ie(y)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Time Remaining:"})," ",jsx("span",{className:O<24?"text-red-600 dark:text-red-400 font-bold":"",children:O>0?`${O} hours`:"Deadline passed"})]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Data Subject Notification:"})," ",H?"Required (NDPA Section 40(4))":"Not required unless directed by NDPC"]})]}):jsxs("div",{children:[jsx("p",{className:"text-sm font-bold mb-2 text-green-800 dark:text-green-200",children:"NDPC Notification Not Required"}),jsx("p",{className:"text-sm mb-2",children:"Based on this assessment, this breach does not need to be reported to the NDPC."}),jsx("p",{className:"text-sm mb-2",children:"However, the breach should still be documented internally for compliance purposes."})]}),jsxs("div",{className:"mt-3 text-sm",children:[jsx("p",{className:"font-medium",children:"Next Steps:"}),jsx("ul",{className:"list-disc pl-5 mt-1",children:x?jsxs(Fragment,{children:[jsx("li",{children:"Prepare a notification report for the NDPC"}),jsx("li",{children:"Document all aspects of the breach and your response"}),H&&jsx("li",{children:"Prepare communications for affected data subjects"}),jsx("li",{children:"Implement measures to mitigate the impact of the breach"})]}):jsxs(Fragment,{children:[jsx("li",{children:"Document the breach and this assessment in your internal records"}),jsx("li",{children:"Implement measures to prevent similar breaches in the future"}),jsx("li",{children:"Review and update security measures as needed"})]})})]})]}),jsx("button",{onClick:()=>S(false),className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${_}`,h.primaryButton||h.submitButton,d),children:"Edit Assessment"})]}):jsx("form",{onSubmit:re,children:jsxs("div",{className:"space-y-6",children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Assessment"}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"confidentialityImpact",className:"block text-sm font-medium mb-1",children:["Confidentiality Impact (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the confidentiality of data been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"confidentialityImpact",min:"1",max:"5",step:"1",value:L,onChange:o=>te(parseInt(o.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",h.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(L)," (",L,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"integrityImpact",className:"block text-sm font-medium mb-1",children:["Integrity Impact (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the integrity of data been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"integrityImpact",min:"1",max:"5",step:"1",value:$,onChange:o=>v(parseInt(o.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",h.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s($)," (",$,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"availabilityImpact",className:"block text-sm font-medium mb-1",children:["Availability Impact (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the availability of data or systems been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"availabilityImpact",min:"1",max:"5",step:"1",value:D,onChange:o=>C(parseInt(o.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",h.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(D)," (",D,")"]})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Risk to Data Subjects"}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"harmLikelihood",className:"block text-sm font-medium mb-1",children:["Likelihood of Harm (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How likely is it that data subjects will experience harm?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"harmLikelihood",min:"1",max:"5",step:"1",value:j,onChange:o=>B(parseInt(o.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",h.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(j)," (",j,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"harmSeverity",className:"block text-sm font-medium mb-1",children:["Severity of Harm (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How severe would the harm be to affected data subjects?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"harmSeverity",min:"1",max:"5",step:"1",value:q,onChange:o=>P(parseInt(o.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",h.slider,d)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(q)," (",q,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("input",{type:"checkbox",id:"risksToRightsAndFreedoms",checked:U,onChange:o=>E(o.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"risksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a risk to the rights and freedoms of data subjects"})]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40), breaches that pose a risk to rights and freedoms must be reported to the NDPC within 72 hours."})]}),jsxs("div",{className:"mb-4",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("input",{type:"checkbox",id:"highRisksToRightsAndFreedoms",checked:H,onChange:o=>M(o.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"highRisksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a high risk to the rights and freedoms of data subjects"})]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40(4)), breaches that pose a high risk to rights and freedoms also require notification to affected data subjects without undue delay."})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Overall Assessment"}),jsxs("div",{className:"mb-4 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsx("span",{className:"font-medium",children:"Overall Risk Score:"}),jsxs("span",{className:a("",h.riskScore,d),children:[W," / 5"]})]}),jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:"font-medium",children:"Risk Level:"}),c(w)]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:["Justification for Assessment ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{id:"justification",value:K,onChange:o=>ae(o.target.value),rows:4,placeholder:"Explain the reasoning behind your assessment, including any factors that influenced your decision.",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true})]})]}),jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This assessment will determine if notification is required for this breach."})]}),jsx("div",{className:"mt-6",children:jsx("button",{type:"submit",className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${_}`,h.primaryButton||h.submitButton,d),children:J})})]})})]})};var Ce=({breachReports:g,riskAssessments:u,regulatoryNotifications:k,onSelectBreach:V,onRequestAssessment:Y,onRequestNotification:J,title:ee="Breach Notification Manager",description:_="Manage data breach notifications and track compliance with NDPA Section 40 requirements.",className:h="",buttonClassName:d="",classNames:l={},unstyled:R=false,showBreachDetails:L=true,showNotificationTimeline:te=true,showDeadlineAlerts:$=true})=>{var re;let[v,D]=useState(null),[C,j]=useState(g),[B,q]=useState("all"),[P,U]=useState(""),[E,H]=useState("discoveredAt"),[M,K]=useState("desc");useEffect(()=>{let s=[...g];if(B!=="all"&&(s=s.filter(c=>c.status===B)),P){let c=P.toLowerCase();s=s.filter(o=>o.title.toLowerCase().includes(c)||o.description.toLowerCase().includes(c)||o.affectedSystems.some(N=>N.toLowerCase().includes(c))||o.dataTypes.some(N=>N.toLowerCase().includes(c)));}s.sort((c,o)=>{let N=0;switch(E){case "title":N=c.title.localeCompare(o.title);break;case "discoveredAt":N=c.discoveredAt-o.discoveredAt;break;case "status":N=c.status.localeCompare(o.status);break;case "riskLevel":let I=u.find(F=>F.breachId===c.id),T=u.find(F=>F.breachId===o.id),oe=(I==null?void 0:I.riskLevel)||"unknown",X=(T==null?void 0:T.riskLevel)||"unknown";N=oe.localeCompare(X);break;default:N=c.discoveredAt-o.discoveredAt;}return M==="asc"?N:-N}),j(s);},[g,B,P,E,M,u]),useEffect(()=>{C.length>0&&!v&&D(C[0].id);},[C,v]);let ae=s=>{D(s),V&&V(s);},W=()=>{v&&Y&&Y(v);},se=()=>{v&&J&&J(v);},w=s=>new Date(s).toLocaleString(),f=v?g.find(s=>s.id===v):null,x=v?u.find(s=>s.breachId===v):null,b=v?k.find(s=>s.breachId===v):null,y=f?Z(f,x):null;function Z(s,c){let o=a$1(s,c||void 0),N=s.discoveredAt+o.timeframeHours*60*60*1e3;return {ndpcNotificationRequired:o.notificationRequired,ndpcNotificationDeadline:N,dataSubjectNotificationRequired:(c==null?void 0:c.highRisksToRightsAndFreedoms)||false,justification:o.justification}}function O(s){let c=Date.now(),o=(s-c)/(3600*1e3);return Number(o.toFixed(1))}let Q=s=>s?jsx("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-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[s]}`,l.statusBadge,R),children:s.charAt(0).toUpperCase()+s.slice(1)}):null,p=s=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{ongoing:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",contained:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",resolved:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"}[s]||"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200"}`,l.statusBadge,R),children:s.charAt(0).toUpperCase()+s.slice(1)}),S=()=>{if(!f||!y)return null;if(!y.ndpcNotificationRequired)return jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Not Required"}),jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"Based on the risk assessment, NDPC notification is not required for this breach."})]});if(b)return jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Sent"}),jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:["Notification was sent to the NDPC on ",w(b.sentAt),"."]})]});let s=O(y.ndpcNotificationDeadline);return s<=0?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Notification Deadline Passed"}),jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The 72-hour deadline for NDPC notification has passed. Notification should be sent immediately."})]}):s<=24?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Notification Due Soon"}),jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",s," hours remaining until the NDPC notification deadline."]})]}):jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Notification Required"}),jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:["NDPC notification is required by ",w(y.ndpcNotificationDeadline)," (",s," hours remaining)."]})]})},ie=()=>{if(!f)return null;let s=[{title:"Breach Discovered",date:f.discoveredAt,completed:true,description:`Breach was discovered on ${w(f.discoveredAt)}.`},{title:"Risk Assessment",date:x==null?void 0:x.assessedAt,completed:!!x,description:x?`Risk assessment completed on ${w(x.assessedAt)}.`:"Risk assessment has not been completed yet."}];return y!=null&&y.ndpcNotificationRequired&&s.push({title:"NDPC Notification",date:b==null?void 0:b.sentAt,completed:!!b,description:b?`Notification sent to the NDPC on ${w(b.sentAt)}.`:`Notification must be sent to the NDPC by ${w(y.ndpcNotificationDeadline)}.`}),y!=null&&y.dataSubjectNotificationRequired&&s.push({title:"Data Subject Notification",date:void 0,completed:false,description:"Notification to affected data subjects is required but has not been sent yet."}),jsxs("div",{className:a("mt-6",l.timeline,R),children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Notification Timeline"}),jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:s.map((c,o)=>jsxs("li",{className:a("mb-6 ml-4",l.timelineStep,R),children:[jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${c.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-600 dark:text-gray-500",children:c.date?w(c.date):"Pending"}),jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:c.title}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:c.description})]},o))})]})};return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${h}`,l.root,R),children:[jsxs("div",{className:a("",l.header,R),children:[jsx("h2",{className:a("text-xl font-bold mb-2",l.title,R),children:ee}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:_})]}),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxs("select",{id:"statusFilter",value:B,onChange:s=>q(s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsx("option",{value:"all",children:"All Statuses"}),jsx("option",{value:"ongoing",children:"Ongoing"}),jsx("option",{value:"contained",children:"Contained"}),jsx("option",{value:"resolved",children:"Resolved"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxs("select",{id:"sortBy",value:E,onChange:s=>H(s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsx("option",{value:"discoveredAt",children:"Discovery Date"}),jsx("option",{value:"title",children:"Title"}),jsx("option",{value:"status",children:"Status"}),jsx("option",{value:"riskLevel",children:"Risk Level"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsx("input",{type:"text",id:"searchTerm",value:P,onChange:s=>U(s.target.value),placeholder:"Search breaches...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxs("div",{className:"md:col-span-1",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Breach Reports"}),C.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No breach reports found."}):jsx("div",{className:a("space-y-2 max-h-96 overflow-y-auto pr-2",l.breachList,R),children:C.map(s=>{let c=u.find(T=>T.breachId===s.id),o=k.find(T=>T.breachId===s.id),N=Z(s,c),I=null;if(N!=null&&N.ndpcNotificationRequired)if(o)I=jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Notified"});else {let T=O(N.ndpcNotificationDeadline);T<=0?I=jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):T<=24?I=jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):I=jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Required"});}else I=jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Not Required"});return jsxs("div",{className:a(`p-3 rounded-md cursor-pointer ${v===s.id?"bg-[rgb(var(--ndpr-primary)/0.05)] dark:bg-[rgb(var(--ndpr-primary)/0.1)] border border-[rgb(var(--ndpr-primary)/0.2)] dark:border-[rgb(var(--ndpr-primary)/0.3)]":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,l.breachItem,R),onClick:()=>ae(s.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:s.title}),p(s.status)]}),jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:["Discovered: ",new Date(s.discoveredAt).toLocaleDateString()]}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsx("div",{children:c&&Q(c.riskLevel)}),jsx("div",{children:I})]})]},s.id)})})]}),jsx("div",{className:a("md:col-span-2",l.detailPanel,R),children:f?jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsx("h3",{className:"text-lg font-medium",children:f.title}),p(f.status)]}),$&&jsx("div",{className:"mb-4",children:S()}),L&&jsxs("div",{className:"mb-6",children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Discovered:"})," ",w(f.discoveredAt)]}),f.occurredAt&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Occurred:"})," ",w(f.occurredAt)]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Reporter:"})," ",f.reporter.name]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",f.affectedSystems.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Types:"})," ",f.dataTypes.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",f.estimatedAffectedSubjects||"Unknown"]})]})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium",children:"Description:"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:f.description})]}),f.initialActions&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium",children:"Initial Actions Taken:"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:f.initialActions})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Risk Assessment"}),x?jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsx("p",{className:"text-sm font-medium",children:"Risk Level:"}),Q(x.riskLevel)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risk Score:"})," ",x.overallRiskScore," / 5"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",x.risksToRightsAndFreedoms?"Yes":"No"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",x.highRisksToRightsAndFreedoms?"Yes":"No"]}),jsx("p",{className:"text-sm mb-1",children:jsx("span",{className:"font-medium",children:"Justification:"})}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300 bg-white dark:bg-gray-800 p-2 rounded-md",children:x.justification})]}):jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"Risk assessment has not been conducted yet."}),jsx("button",{onClick:W,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${d}`,children:"Conduct Risk Assessment"})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Status"}),b?jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Notification Sent:"})," ",w(b.sentAt)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Method:"})," ",b.method.charAt(0).toUpperCase()+b.method.slice(1)]}),b.referenceNumber&&jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Reference Number:"})," ",b.referenceNumber]}),(b.ndpcContact||b.nitdaContact)&&jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"NDPC Contact:"})," ",(re=b.ndpcContact||b.nitdaContact)==null?void 0:re.name]})]}):jsx("div",{children:y!=null&&y.ndpcNotificationRequired?jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"NDPC notification is required but has not been sent yet."}),jsx("button",{onClick:se,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${d}`,children:"Generate Notification"})]}):jsx("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:"NDPC notification is not required for this breach."})})})]}),te&&ie()]}):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 breach to view details"})})})]})]})};var Te=({breachData:g,assessmentData:u,organizationInfo:k,onGenerate:V,title:Y="Generate NDPC Notification Report",description:J="Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements.",generateButtonText:ee="Generate Report",className:_="",buttonClassName:h="",classNames:d={},unstyled:l=false,showPreview:R=true,allowEditing:L=true,allowDownload:te=true,downloadFormat:$="pdf"})=>{let[v,D]=useState(""),[C,j]=useState(""),[B,q]=useState(""),[P,U]=useState(""),[E,H]=useState("email"),[M,K]=useState(""),[ae,W]=useState(""),[se,w]=useState(false),[f,x]=useState(false);useEffect(()=>{if(!se){let p=y();D(p),w(true);}},[g,u,k]);let b=p=>new Date(p).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),y=()=>`
2
- NDPC DATA BREACH NOTIFICATION
3
-
4
- Date: ${new Date().toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})}
5
-
6
- Reference: NDPA Section 40 - Breach Notification
7
-
8
- ORGANIZATION DETAILS
9
- -------------------
10
- Organization Name: ${k.name}
11
- ${k.registrationNumber?`Registration Number: ${k.registrationNumber}`:""}
12
- Address: ${k.address}
13
- ${k.website?`Website: ${k.website}`:""}
14
-
15
- DATA PROTECTION OFFICER
16
- ----------------------
17
- Name: ${k.dpoName}
18
- Email: ${k.dpoEmail}
19
- ${k.dpoPhone?`Phone: ${k.dpoPhone}`:""}
20
-
21
- BREACH DETAILS
22
- -------------
23
- Breach Title: ${g.title}
24
- Date Discovered: ${b(g.discoveredAt)}
25
- ${g.occurredAt?`Date Occurred: ${b(g.occurredAt)}`:"Date Occurred: Unknown"}
26
- Status: ${g.status.charAt(0).toUpperCase()+g.status.slice(1)}
27
-
28
- Description of the Breach:
29
- ${g.description}
30
-
31
- Affected Systems/Applications:
32
- ${g.affectedSystems.join(", ")}
33
-
34
- Types of Personal Data Involved:
35
- ${g.dataTypes.join(", ")}
36
-
37
- Estimated Number of Data Subjects Affected:
38
- ${g.estimatedAffectedSubjects||"Unknown"}
39
-
40
- RISK ASSESSMENT
41
- --------------
42
- ${u?`
43
- Overall Risk Level: ${u.riskLevel.charAt(0).toUpperCase()+u.riskLevel.slice(1)}
44
- Risk to Rights and Freedoms of Data Subjects: ${u.risksToRightsAndFreedoms?"Yes":"No"}
45
- High Risk to Rights and Freedoms of Data Subjects: ${u.highRisksToRightsAndFreedoms?"Yes":"No"}
46
-
47
- Justification for Risk Assessment:
48
- ${u.justification}
49
- `:"Risk assessment has not been conducted yet."}
50
-
51
- MEASURES TAKEN
52
- -------------
53
- Measures taken or proposed to address the breach:
54
- ${g.initialActions||"To be determined"}
55
-
56
- Measures taken or proposed to mitigate possible adverse effects:
57
- [Please specify measures taken to mitigate adverse effects]
58
-
59
- NOTIFICATION TO DATA SUBJECTS (NDPA Section 40(4))
60
- ----------------------------
61
- Have data subjects been notified: [Yes/No]
62
- If yes, date of notification: [Date]
63
- If no, planned date of notification: [Date]
64
- Reason for delay (if applicable): [Reason]
65
-
66
- ADDITIONAL INFORMATION
67
- ---------------------
68
- [Any additional information relevant to the breach]
69
-
70
- This notification is made in compliance with the Nigeria Data Protection Act (NDPA), Section 40.
71
- `,Z=p=>{p.preventDefault();let S={id:`notification_${Date.now()}`,breachId:g.id,sentAt:Date.now(),method:E,referenceNumber:M||void 0,ndpcContact:C?{name:C,email:B,phone:P||void 0}:void 0,content:v,attachments:[]};V(S),x(true);},O=()=>{let p=document.createElement("a"),S=new Blob([v],{type:"text/plain"});p.href=URL.createObjectURL(S),p.download=`NDPC_Breach_Notification_${new Date().toISOString().split("T")[0]}.txt`,document.body.appendChild(p),p.click(),document.body.removeChild(p);},Q=()=>[{value:"email",label:"Email"},{value:"portal",label:"NDPC Portal"},{value:"letter",label:"Formal Letter"},{value:"other",label:"Other"}].map(S=>jsx("option",{value:S.value,children:S.label},S.value));return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${_}`,d.root,l),children:[jsxs("div",{className:a("",d.header,l),children:[jsx("h2",{className:a("text-xl font-bold mb-2",d.title,l),children:Y}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:J})]}),f?jsxs("div",{children:[jsxs("div",{className:"mb-6 p-4 bg-green-50 dark:bg-green-900/20 rounded-md",children:[jsx("h3",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Generated Successfully"}),jsx("p",{className:"text-green-700 dark:text-green-300",children:"Your NDPC notification report has been generated and is ready for submission. Please review the report carefully before submitting it to the NDPC."})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Submission Details"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Method:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:E.charAt(0).toUpperCase()+E.slice(1)})]}),C&&jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Contact Name:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:C})]}),B&&jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Contact Email:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:B})]}),P&&jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Contact Phone:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:P})]})]}),jsxs("div",{children:[jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Date Generated:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:b(Date.now())})]}),jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Breach ID:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:g.id})]}),M&&jsxs("p",{className:a("text-sm",d.field,l),children:[jsx("span",{className:a("font-medium",d.fieldLabel,l),children:"Reference Number:"})," ",jsx("span",{className:a("",d.fieldValue,l),children:M})]})]})]})]}),R&&jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Preview"}),jsx("div",{className:a("bg-gray-50 dark:bg-gray-700 p-4 rounded-md",d.reportPreview,l),children:jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:v})})]}),jsxs("div",{className:"flex flex-wrap gap-3",children:[te&&jsxs("button",{onClick:O,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${h}`,d.secondaryButton||d.downloadButton,l),children:["Download Report (",$.toUpperCase(),")"]}),jsx("button",{onClick:()=>x(false),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${h}`,children:"Edit Report"})]})]}):jsx("form",{onSubmit:Z,children:jsxs("div",{className:"space-y-6",children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Notification Method"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"method",className:"block text-sm font-medium mb-1",children:["Method of Submission ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("select",{id:"method",value:E,onChange:p=>H(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,children:Q()})]}),jsxs("div",{children:[jsx("label",{htmlFor:"referenceNumber",className:"block text-sm font-medium mb-1",children:"Reference Number (if available)"}),jsx("input",{type:"text",id:"referenceNumber",value:M,onChange:p=>K(p.target.value),placeholder:"e.g. NDPC/BR/2024/001",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"NDPC Contact (if known)"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[jsxs("div",{children:[jsx("label",{htmlFor:"contactName",className:"block text-sm font-medium mb-1",children:"Contact Name"}),jsx("input",{type:"text",id:"contactName",value:C,onChange:p=>j(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"contactEmail",className:"block text-sm font-medium mb-1",children:"Contact Email"}),jsx("input",{type:"email",id:"contactEmail",value:B,onChange:p=>q(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"contactPhone",className:"block text-sm font-medium mb-1",children:"Contact Phone"}),jsx("input",{type:"tel",id:"contactPhone",value:P,onChange:p=>U(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsxs("div",{children:[jsx("label",{htmlFor:"additionalInfo",className:"block text-sm font-medium mb-1",children:"Additional Information to Include"}),jsx("textarea",{id:"additionalInfo",value:ae,onChange:p=>W(p.target.value),rows:3,placeholder:"Any additional information you want to include in the report",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),L&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Content"}),jsxs("div",{children:[jsxs("label",{htmlFor:"reportContent",className:"block text-sm font-medium mb-1",children:["Edit Report Content ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{id:"reportContent",value:v,onChange:p=>D(p.target.value),rows:20,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] font-mono text-sm",required:true})]})]}),jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This report will help you comply with this requirement."})]}),jsx("div",{className:"mt-6",children:jsx("button",{type:"submit",className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${h}`,d.primaryButton||d.generateButton,l),children:ee})})]})})]})};export{ve as a,Ce as b,Te as c};//# sourceMappingURL=chunk-ISSGO2YT.mjs.map
72
- //# sourceMappingURL=chunk-ISSGO2YT.mjs.map
@@ -1,3 +0,0 @@
1
- 'use strict';var chunkDQLDX5X6_js=require('./chunk-DQLDX5X6.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),Gr=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Gr__default=/*#__PURE__*/_interopDefault(Gr);var vr=["Organization","Data Collection","Processing","Review & Export"],ur=({currentStep:n,classNames:d,unstyled:r})=>jsxRuntime.jsx("div",{"data-ndpr-component":"policy-step-indicator",className:chunkE64TU6IU_js.a("w-full flex items-center justify-between px-2 py-4",d==null?void 0:d.root,r),children:vr.map((o,p)=>{let t=p+1,i=t<n,v=t===n,h=p===vr.length-1;return jsxRuntime.jsxs(Gr__default.default.Fragment,{children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col items-center gap-1",d==null?void 0:d.stepWrapper,r),children:[jsxRuntime.jsx("div",{"aria-current":v?"step":void 0,className:chunkE64TU6IU_js.a(["flex items-center justify-center rounded-full border-2 font-semibold transition-all",i?"w-8 h-8 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))]":v?"w-9 h-9 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] shadow-md":"w-8 h-8 bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-600 text-gray-400 dark:text-gray-500"].join(" "),i?d==null?void 0:d.stepCompleted:v?d==null?void 0:d.stepCurrent:d==null?void 0:d.stepUpcoming,r),children:i?jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsxRuntime.jsx("span",{className:"text-xs leading-none",children:t})}),jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(["text-xs font-medium hidden sm:block",i||v?"text-[rgb(var(--ndpr-primary))]":"text-gray-400 dark:text-gray-500"].join(" "),d==null?void 0:d.stepLabel,r),children:o})]}),!h&&jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a(["flex-1 h-0.5 mx-2",i?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-700"].join(" "),d==null?void 0:d.connector,r),"aria-hidden":"true"})]},t)})});var F="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",Ur="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",A=({label:n,required:d,children:r,classNames:o,unstyled:p})=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col",o==null?void 0:o.field,p),children:[jsxRuntime.jsxs("label",{className:chunkE64TU6IU_js.a(Ur,o==null?void 0:o.label,p),children:[n,d&&jsxRuntime.jsx("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),r]}),yr=({context:n,onUpdateOrg:d,classNames:r,unstyled:o})=>{var t,i,v;let p=n.org;return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-about",className:chunkE64TU6IU_js.a("space-y-6",r==null?void 0:r.root,o),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Organisation Details"}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 mt-1",r==null?void 0:r.subheading,o),children:["Tell us about your organisation. Fields marked ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})," are required."]})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-1 md:grid-cols-2 gap-4",r==null?void 0:r.grid,o),children:[jsxRuntime.jsx(A,{label:"Organisation Name",required:true,classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{type:"text",value:p.name,onChange:x=>d({name:x.target.value}),placeholder:"Acme Corporation",className:chunkE64TU6IU_js.a(F,r==null?void 0:r.input,o),"aria-required":"true"})}),jsxRuntime.jsx(A,{label:"Website",required:true,classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{type:"url",value:p.website,onChange:x=>d({website:x.target.value}),placeholder:"https://example.com",className:chunkE64TU6IU_js.a(F,r==null?void 0:r.input,o),"aria-required":"true"})}),jsxRuntime.jsx(A,{label:"Privacy Contact Email",required:true,classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{type:"email",value:p.privacyEmail,onChange:x=>d({privacyEmail:x.target.value}),placeholder:"privacy@example.com",className:chunkE64TU6IU_js.a(F,r==null?void 0:r.input,o),"aria-required":"true"})}),jsxRuntime.jsx(A,{label:"Industry",classNames:r,unstyled:o,children:jsxRuntime.jsxs("select",{value:p.industry,onChange:x=>d({industry:x.target.value}),className:chunkE64TU6IU_js.a(F,r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"fintech",children:"Fintech"}),jsxRuntime.jsx("option",{value:"healthcare",children:"Healthcare"}),jsxRuntime.jsx("option",{value:"ecommerce",children:"E-commerce"}),jsxRuntime.jsx("option",{value:"saas",children:"SaaS"}),jsxRuntime.jsx("option",{value:"education",children:"Education"}),jsxRuntime.jsx("option",{value:"government",children:"Government"}),jsxRuntime.jsx("option",{value:"other",children:"Other"})]})}),jsxRuntime.jsx(A,{label:"Data Protection Officer (DPO) Name",classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{type:"text",value:(t=p.dpoName)!=null?t:"",onChange:x=>d({dpoName:x.target.value}),placeholder:"Jane Smith",className:chunkE64TU6IU_js.a(F,r==null?void 0:r.input,o)})}),jsxRuntime.jsx(A,{label:"DPO Email",classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{type:"email",value:(i=p.dpoEmail)!=null?i:"",onChange:x=>d({dpoEmail:x.target.value}),placeholder:"dpo@example.com",className:chunkE64TU6IU_js.a(F,r==null?void 0:r.input,o)})}),jsxRuntime.jsx(A,{label:"Registered Address",classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{type:"text",value:(v=p.address)!=null?v:"",onChange:x=>d({address:x.target.value}),placeholder:"1 Victoria Island, Lagos, Nigeria",className:chunkE64TU6IU_js.a(F,r==null?void 0:r.input,o)})}),jsxRuntime.jsx(A,{label:"Organisation Size",classNames:r,unstyled:o,children:jsxRuntime.jsxs("select",{value:p.orgSize,onChange:x=>d({orgSize:x.target.value}),className:chunkE64TU6IU_js.a(F,r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"startup",children:"Startup (1\u201350 employees)"}),jsxRuntime.jsx("option",{value:"midsize",children:"Mid-size (51\u2013500 employees)"}),jsxRuntime.jsx("option",{value:"enterprise",children:"Enterprise (500+ employees)"})]})}),jsxRuntime.jsx(A,{label:"Country of Operation",classNames:r,unstyled:o,children:jsxRuntime.jsx("input",{type:"text",value:p.country,onChange:x=>d({country:x.target.value}),placeholder:"Nigeria",className:chunkE64TU6IU_js.a(F,r==null?void 0:r.input,o)})})]})]})};var Vr={identity:"Identity",financial:"Financial",behavioral:"Behavioural",sensitive:"Sensitive",children:"Children"},Xr=["identity","financial","behavioral","sensitive","children"],Yr=["sensitive","children"],hr=({categories:n,onToggle:d,classNames:r,unstyled:o})=>{let p=Xr.reduce((t,i)=>{let v=n.filter(x=>x.group===i);return v.length>0&&(t[i]=v),t},{});return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-data",className:chunkE64TU6IU_js.a("space-y-8",r==null?void 0:r.root,o),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Data Categories"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 mt-1",r==null?void 0:r.subheading,o),children:"Select the categories of personal data your organisation collects. You must select at least one."})]}),Object.entries(p).map(([t,i])=>{let v=Yr.includes(t);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-3",r==null?void 0:r.group,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center gap-2",r==null?void 0:r.groupHeader,o),children:[jsxRuntime.jsx("h3",{className:chunkE64TU6IU_js.a("text-sm font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",r==null?void 0:r.groupTitle,o),children:Vr[t]}),v&&jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("text-xs font-medium text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20 px-2 py-0.5 rounded-full",r==null?void 0:r.sensitiveTag,o),children:"Sensitive"})]}),v&&jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-amber-700 dark:text-amber-400",r==null?void 0:r.sensitiveWarning,o),children:t==="children"?"Processing children's data requires parental consent under NDPA Section 31 and imposes heightened obligations.":"Sensitive/special-category data requires explicit consent and additional safeguards under NDPA Section 30."}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",r==null?void 0:r.cardsGrid,o),children:i.map(x=>jsxRuntime.jsx("button",{type:"button",onClick:()=>d(x.id),"aria-pressed":x.selected,className:chunkE64TU6IU_js.a(["text-left rounded-lg border p-4 transition-all cursor-pointer focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",x.selected?"bg-[rgb(var(--ndpr-primary))]/5 border-[rgb(var(--ndpr-primary))] dark:bg-[rgb(var(--ndpr-primary))]/10":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"].join(" "),r==null?void 0:r.card,o),children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a(["mt-0.5 w-4 h-4 rounded border-2 flex-shrink-0 flex items-center justify-center",x.selected?"bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))]":"border-gray-300 dark:border-gray-600"].join(" "),r==null?void 0:r.checkbox,o),"aria-hidden":"true",children:x.selected&&jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-[rgb(var(--ndpr-primary-foreground))]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm font-medium text-gray-900 dark:text-gray-100",r==null?void 0:r.cardLabel,o),children:x.label}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 mt-1 leading-relaxed",r==null?void 0:r.cardDataPoints,o),children:x.dataPoints.join(", ")})]})]})},x.id))})]},t)})]})};var Jr=[{value:"service_delivery",label:"Service Delivery",description:"Processing required to deliver the core product or service."},{value:"marketing",label:"Marketing & Communications",description:"Sending promotional messages, newsletters or offers."},{value:"analytics",label:"Analytics & Insights",description:"Analysing usage patterns to improve the product."},{value:"research",label:"Research & Development",description:"Using data to develop new features or products."},{value:"legal_compliance",label:"Legal Compliance",description:"Meeting statutory, regulatory or contractual obligations."},{value:"fraud_prevention",label:"Fraud Prevention & Security",description:"Detecting and preventing fraudulent activity."}],dr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",pr="bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-4",gr=({id:n,checked:d,onChange:r})=>jsxRuntime.jsx("button",{id:n,type:"button",role:"switch","aria-checked":d,onClick:()=>r(!d),className:["relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent cursor-pointer transition-colors focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",d?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-600"].join(" "),children:jsxRuntime.jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition-transform",d?"translate-x-5":"translate-x-0"].join(" ")})}),lr=({context:n,onTogglePurpose:d,onUpdateContext:r,onAddProcessor:o,onRemoveProcessor:p,classNames:t,unstyled:i})=>{let[v,x]=Gr.useState({name:"",purpose:"",country:""}),[h,c]=Gr.useState(false),a=()=>{let{name:g,purpose:u,country:P}=v;!g.trim()||!u.trim()||!P.trim()||(o({name:g.trim(),purpose:u.trim(),country:P.trim()}),x({name:"",purpose:"",country:""}),c(false));};return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-processing",className:chunkE64TU6IU_js.a("space-y-6",t==null?void 0:t.root,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.heading,i),children:"Processing Details"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 mt-1",t==null?void 0:t.subheading,i),children:"Define how and why you process personal data."})]}),jsxRuntime.jsxs("section",{className:chunkE64TU6IU_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"purposes-heading",children:[jsxRuntime.jsx("h3",{id:"purposes-heading",className:chunkE64TU6IU_js.a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Processing Purposes"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400",t==null?void 0:t.sectionDescription,i),children:"Select all purposes for which you process personal data. At least one is required."}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-3",t==null?void 0:t.purposeList,i),children:Jr.map(g=>{let u=n.purposes.includes(g.value);return jsxRuntime.jsxs("label",{className:chunkE64TU6IU_js.a("flex items-start gap-3 cursor-pointer group",t==null?void 0:t.purposeItem,i),children:[jsxRuntime.jsx("input",{type:"checkbox",checked:u,onChange:()=>d(g.value),className:chunkE64TU6IU_js.a("mt-0.5 h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] cursor-pointer",t==null?void 0:t.purposeCheckbox,i)}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.purposeLabel,i),children:g.label}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400",t==null?void 0:t.purposeDescription,i),children:g.description})]})]},g.value)})})]}),jsxRuntime.jsxs("section",{className:chunkE64TU6IU_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"thirdparty-heading",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h3",{id:"thirdparty-heading",className:chunkE64TU6IU_js.a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Third-Party Data Sharing"}),jsxRuntime.jsx(gr,{id:"thirdparty-toggle",checked:n.thirdPartyProcessors.length>0||h,onChange:g=>{g?c(true):(n.thirdPartyProcessors.forEach((u,P)=>p(0)),c(false));}})]}),(n.thirdPartyProcessors.length>0||h)&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",t==null?void 0:t.processorSection,i),children:[n.thirdPartyProcessors.length>0&&jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("overflow-x-auto",t==null?void 0:t.processorTable,i),children:jsxRuntime.jsxs("table",{className:"w-full text-sm",children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsxs("tr",{className:chunkE64TU6IU_js.a("text-left text-xs font-medium text-gray-500 dark:text-gray-400 border-b border-gray-200 dark:border-gray-700",t==null?void 0:t.tableHeader,i),children:[jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Name"}),jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Purpose"}),jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Country"}),jsxRuntime.jsx("th",{className:"pb-2"})]})}),jsxRuntime.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:n.thirdPartyProcessors.map((g,u)=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:chunkE64TU6IU_js.a("py-2 pr-4 text-gray-900 dark:text-gray-100",t==null?void 0:t.tableCell,i),children:g.name}),jsxRuntime.jsx("td",{className:chunkE64TU6IU_js.a("py-2 pr-4 text-gray-700 dark:text-gray-300",t==null?void 0:t.tableCell,i),children:g.purpose}),jsxRuntime.jsx("td",{className:chunkE64TU6IU_js.a("py-2 pr-4 text-gray-700 dark:text-gray-300",t==null?void 0:t.tableCell,i),children:g.country}),jsxRuntime.jsx("td",{className:"py-2",children:jsxRuntime.jsx("button",{type:"button",onClick:()=>p(u),className:chunkE64TU6IU_js.a("text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 text-xs font-medium",t==null?void 0:t.removeButton,i),"aria-label":`Remove ${g.name}`,children:"Remove"})})]},u))})]})}),h?jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-1 sm:grid-cols-3 gap-3 items-end",t==null?void 0:t.processorForm,i),children:[jsxRuntime.jsx("input",{type:"text",placeholder:"Processor name",value:v.name,onChange:g=>x(u=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{name:g.target.value})),className:chunkE64TU6IU_js.a(dr,t==null?void 0:t.input,i)}),jsxRuntime.jsx("input",{type:"text",placeholder:"Purpose",value:v.purpose,onChange:g=>x(u=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{purpose:g.target.value})),className:chunkE64TU6IU_js.a(dr,t==null?void 0:t.input,i)}),jsxRuntime.jsx("input",{type:"text",placeholder:"Country",value:v.country,onChange:g=>x(u=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{country:g.target.value})),className:chunkE64TU6IU_js.a(dr,t==null?void 0:t.input,i)}),jsxRuntime.jsxs("div",{className:"sm:col-span-3 flex gap-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:a,className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",t==null?void 0:t.addButton,i),children:"Add Processor"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>c(false),className:chunkE64TU6IU_js.a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm",t==null?void 0:t.cancelButton,i),children:"Cancel"})]})]}):jsxRuntime.jsxs("button",{type:"button",onClick:()=>c(true),className:chunkE64TU6IU_js.a("flex items-center gap-1 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",t==null?void 0:t.addLink,i),children:[jsxRuntime.jsx("span",{"aria-hidden":"true",children:"+"})," Add processor"]})]})]}),jsxRuntime.jsxs("section",{className:chunkE64TU6IU_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"disclosures-heading",children:[jsxRuntime.jsx("h3",{id:"disclosures-heading",className:chunkE64TU6IU_js.a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Additional Disclosures"}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",t==null?void 0:t.disclosureList,i),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.disclosureLabel,i),children:"Cross-border Data Transfers"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you transfer personal data outside Nigeria? This triggers NDPA Chapter 6 obligations."})]}),jsxRuntime.jsx(gr,{id:"cross-border-toggle",checked:n.hasCrossBorderTransfer,onChange:g=>r({hasCrossBorderTransfer:g})})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.disclosureLabel,i),children:"Automated Decision-Making / Profiling"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you use algorithms or AI to make decisions about individuals? Requires disclosure under NDPA Section 37."})]}),jsxRuntime.jsx(gr,{id:"automated-toggle",checked:n.hasAutomatedDecisions,onChange:g=>r({hasAutomatedDecisions:g})})]})]})]})]})};var kr=({section:n,index:d,isCustom:r,isEditing:o,editedContent:p,onEdit:t,onSaveEdit:i,onCancelEdit:v,onMoveUp:x,onMoveDown:h,onDelete:c,classNames:a,unstyled:g})=>{let[u,P]=Gr.useState(p!=null?p:n.template);return Gr.useEffect(()=>{p!==void 0&&P(p);},[p]),Gr.useEffect(()=>{o&&P(p!=null?p:n.template);},[o,p,n.template]),jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-section-card",className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-3",a==null?void 0:a.root,g),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start justify-between gap-2",a==null?void 0:a.header,g),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center gap-3 min-w-0",a==null?void 0:a.titleRow,g),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("flex-shrink-0 w-7 h-7 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 text-xs font-semibold flex items-center justify-center",a==null?void 0:a.sectionNumber,g),"aria-hidden":"true",children:d+1}),jsxRuntime.jsxs("h4",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",a==null?void 0:a.sectionTitle,g),children:[n.title,r&&jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("ml-2 text-xs font-normal text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded",a==null?void 0:a.customBadge,g),children:"Custom"})]})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center gap-1 flex-shrink-0",a==null?void 0:a.actions,g),children:[x&&jsxRuntime.jsx("button",{type:"button",onClick:x,className:chunkE64TU6IU_js.a("p-1.5 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",a==null?void 0:a.moveButton,g),"aria-label":`Move "${n.title}" up`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}),h&&jsxRuntime.jsx("button",{type:"button",onClick:h,className:chunkE64TU6IU_js.a("p-1.5 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",a==null?void 0:a.moveButton,g),"aria-label":`Move "${n.title}" down`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}),!o&&jsxRuntime.jsx("button",{type:"button",onClick:t,className:chunkE64TU6IU_js.a("p-1.5 text-gray-400 hover:text-[rgb(var(--ndpr-primary))] rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",a==null?void 0:a.editButton,g),"aria-label":`Edit "${n.title}"`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),r&&c&&jsxRuntime.jsx("button",{type:"button",onClick:c,className:chunkE64TU6IU_js.a("p-1.5 text-gray-400 hover:text-red-500 dark:hover:text-red-400 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",a==null?void 0:a.deleteButton,g),"aria-label":`Delete "${n.title}"`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),o?jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-2",a==null?void 0:a.editArea,g),children:[jsxRuntime.jsx("textarea",{value:u,onChange:z=>P(z.target.value),rows:8,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm font-mono resize-y",a==null?void 0:a.textarea,g),"aria-label":`Edit content for ${n.title}`}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex gap-2",a==null?void 0:a.editActions,g),children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>i(u),className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",a==null?void 0:a.saveButton,g),children:"Save"}),jsxRuntime.jsx("button",{type:"button",onClick:v,className:chunkE64TU6IU_js.a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm",a==null?void 0:a.cancelButton,g),children:"Cancel"})]})]}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("text-sm text-gray-600 dark:text-gray-300 leading-relaxed line-clamp-4 whitespace-pre-wrap",a==null?void 0:a.content,g),children:n.template})]})};var Cr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",wr=({onAdd:n,nextOrder:d,classNames:r,unstyled:o})=>{let[p,t]=Gr.useState(""),[i,v]=Gr.useState(""),[x,h]=Gr.useState(""),c=()=>{if(!p.trim()){h("Section title is required.");return}if(!i.trim()){h("Section content is required.");return}h(""),n({title:p.trim(),content:i.trim(),order:d}),t(""),v("");};return jsxRuntime.jsxs("div",{"data-ndpr-component":"custom-section-form",className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-4",r==null?void 0:r.root,o),children:[jsxRuntime.jsx("h4",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Add Custom Section"}),x&&jsxRuntime.jsx("p",{role:"alert",className:chunkE64TU6IU_js.a("text-xs text-red-600 dark:text-red-400",r==null?void 0:r.error,o),children:x}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-3",r==null?void 0:r.fields,o),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"custom-section-title",className:chunkE64TU6IU_js.a("block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",r==null?void 0:r.label,o),children:["Section Title ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsxRuntime.jsx("input",{id:"custom-section-title",type:"text",value:p,onChange:a=>{t(a.target.value),x&&h("");},placeholder:"e.g. Cookie Policy",className:chunkE64TU6IU_js.a(Cr,r==null?void 0:r.input,o),"aria-required":"true"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"custom-section-content",className:chunkE64TU6IU_js.a("block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",r==null?void 0:r.label,o),children:["Content ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"custom-section-content",value:i,onChange:a=>{v(a.target.value),x&&h("");},placeholder:"Write the section content here...",rows:5,className:chunkE64TU6IU_js.a(`${Cr} resize-y`,r==null?void 0:r.textarea,o),"aria-required":"true"})]})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("flex items-center gap-2",r==null?void 0:r.footer,o),children:jsxRuntime.jsx("button",{type:"button",onClick:c,className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",r==null?void 0:r.addButton,o),children:"Add Section"})})]})};var Sr={compliant:{bg:"bg-green-50 dark:bg-green-900/20",text:"text-green-700 dark:text-green-300",border:"border-green-200 dark:border-green-700"},nearly_compliant:{bg:"bg-amber-50 dark:bg-amber-900/20",text:"text-amber-700 dark:text-amber-300",border:"border-amber-200 dark:border-amber-700"},not_compliant:{bg:"bg-red-50 dark:bg-red-900/20",text:"text-red-700 dark:text-red-300",border:"border-red-200 dark:border-red-700"}},Qr={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},N=({icon:n,label:d,description:r,actionLabel:o,loading:p,onClick:t,classNames:i,unstyled:v})=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex flex-col gap-3",i==null?void 0:i.formatCard,v),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center gap-3",i==null?void 0:i.formatHeader,v),children:[jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center flex-shrink-0",i==null?void 0:i.formatIcon,v),"aria-hidden":"true",children:n}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100",i==null?void 0:i.formatLabel,v),children:d}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400",i==null?void 0:i.formatDescription,v),children:r})]})]}),jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:p,className:chunkE64TU6IU_js.a("w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2",i==null?void 0:i.formatButton,v),children:p?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{className:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),"Generating\u2026"]}):o})]}),mr=({complianceResult:n,onExportPDF:d,onExportDOCX:r,onExportHTML:o,onExportMarkdown:p,classNames:t,unstyled:i})=>{var P;let[v,x]=Gr.useState(false),[h,c]=Gr.useState(false),a=(P=Sr[n.rating])!=null?P:Sr.not_compliant,g=()=>chunkMQFZHA2D_js.d(null,null,function*(){x(true);try{yield d();}finally{x(false);}}),u=()=>chunkMQFZHA2D_js.d(null,null,function*(){c(true);try{yield r();}finally{c(false);}});return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-export-panel",className:chunkE64TU6IU_js.a("space-y-6",t==null?void 0:t.root,i),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`rounded-lg border p-4 flex items-center gap-4 ${a.bg} ${a.border}`,t==null?void 0:t.complianceSummary,i),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`text-3xl font-bold ${a.text}`,t==null?void 0:t.complianceScore,i),"aria-label":`Compliance score: ${n.percentage}%`,children:[n.percentage,"%"]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-sm font-semibold ${a.text}`,t==null?void 0:t.complianceRating,i),children:Qr[n.rating]}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.complianceDetail,i),children:[n.score," / ",n.maxScore," points \u2022"," ",n.gaps.length," gap",n.gaps.length!==1?"s":""," remaining"]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100 mb-3",t==null?void 0:t.formatsHeading,i),children:"Export Format"}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-1 sm:grid-cols-2 gap-3",t==null?void 0:t.formatsGrid,i),children:[jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-red-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 7v-1h4v1h-4zm0-3v-1h4v1h-4zm-2-5h8v1H8v-1z"})}),label:"PDF",description:"Professional formatted document, ideal for publishing.",actionLabel:"Download PDF",loading:v,onClick:g,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-5 8v-5h1.5l1 3 1-3H13v5h-1v-3.5l-.75 2.25h-.5L10 13.5V17H9zm5-1.5h.75c.55 0 .75-.25.75-.75 0-.4-.2-.65-.75-.65H14V15.5zm1 1.5h-2v-4h2c1.1 0 1.75.6 1.75 1.5 0 .55-.25.95-.65 1.15.5.2.8.65.8 1.2 0 1-.65 1.65-1.9 1.65V17zm-.25-1c.6 0 .9-.25.9-.75 0-.45-.3-.75-.9-.75H14V16h.75z"})}),label:"DOCX",description:"Editable Word document for further customisation.",actionLabel:"Download DOCX",loading:h,onClick:u,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsxs("svg",{className:"w-5 h-5 text-orange-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15H9V8h2v9zm4 0h-2V8h2v9z"}),jsxRuntime.jsx("path",{d:"M9.5 6.5h1v1h-1zm4 0h1v1h-1z"}),jsxRuntime.jsx("path",{d:"M5 5h14v2H5zm0 12h14v2H5z"})]}),label:"HTML",description:"Copy-ready HTML to embed on your website.",actionLabel:"Copy HTML",onClick:o,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-gray-500 dark:text-gray-300",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M3 5h18v2H3V5zm0 4h12v2H3V9zm0 4h18v2H3v-2zm0 4h12v2H3v-2z"})}),label:"Markdown",description:"Plain-text format for documentation or Git repos.",actionLabel:"Copy Markdown",onClick:p,classNames:t,unstyled:i})]})]})]})};var Lr=({sections:n,customSections:d,sectionOverrides:r,complianceResult:o,onEditSection:p,onAddCustomSection:t,onRemoveCustomSection:i,onReorderSection:v,onExportPDF:x,onExportDOCX:h,onExportHTML:c,onExportMarkdown:a,classNames:g,unstyled:u})=>{let[P,z]=Gr.useState(null),[Q,Y]=Gr.useState(false),Z=new Set(d.map(f=>f.id)),er=(f,L)=>{p(f,L),z(null);},or=n.length>0?Math.max(...n.map(f=>{var L;return (L=f.order)!=null?L:0}))+1:1;return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-review",className:chunkE64TU6IU_js.a("space-y-6",g==null?void 0:g.root,u),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-semibold text-gray-900 dark:text-gray-100",g==null?void 0:g.heading,u),children:"Review & Export"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 mt-1",g==null?void 0:g.subheading,u),children:"Review your generated policy sections, reorder or edit content, then export."})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-3",g==null?void 0:g.sectionList,u),children:n.map((f,L)=>jsxRuntime.jsx(kr,{section:r[f.id]?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},f),{template:r[f.id]}):f,index:L,isCustom:Z.has(f.id),isEditing:P===f.id,editedContent:r[f.id],onEdit:()=>z(f.id),onSaveEdit:ir=>er(f.id,ir),onCancelEdit:()=>z(null),onMoveUp:L>0?()=>v(f.id,"up"):void 0,onMoveDown:L<n.length-1?()=>v(f.id,"down"):void 0,onDelete:Z.has(f.id)?()=>i(f.id):void 0,classNames:g,unstyled:u},f.id))}),!Q&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>Y(true),className:chunkE64TU6IU_js.a("flex items-center gap-2 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",g==null?void 0:g.addSectionButton,u),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("w-5 h-5 rounded-full border-2 border-[rgb(var(--ndpr-primary))] flex items-center justify-center text-xs font-bold leading-none",g==null?void 0:g.addSectionIcon,u),"aria-hidden":"true",children:"+"}),"Add Custom Section"]}),Q&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-2",g==null?void 0:g.customFormWrapper,u),children:[jsxRuntime.jsx(wr,{onAdd:f=>{t(f),Y(false);},nextOrder:or,classNames:g,unstyled:u}),jsxRuntime.jsx("button",{type:"button",onClick:()=>Y(false),className:chunkE64TU6IU_js.a("text-sm text-gray-500 dark:text-gray-400 hover:underline",g==null?void 0:g.cancelCustomForm,u),children:"Cancel"})]}),jsxRuntime.jsx("hr",{className:chunkE64TU6IU_js.a("border-gray-200 dark:border-gray-700",g==null?void 0:g.divider,u)}),jsxRuntime.jsx(mr,{complianceResult:o,onExportPDF:x,onExportDOCX:h,onExportHTML:c,onExportMarkdown:a,classNames:g,unstyled:u})]})};var Dr={compliant:{stroke:"stroke-green-500 dark:stroke-green-400",text:"text-green-600 dark:text-green-400"},nearly_compliant:{stroke:"stroke-amber-500 dark:stroke-amber-400",text:"text-amber-600 dark:text-amber-400"},not_compliant:{stroke:"stroke-red-500 dark:stroke-red-400",text:"text-red-600 dark:text-red-400"}},Nr={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},Er=({score:n,maxScore:d,rating:r,classNames:o,unstyled:p})=>{var c,a;let t=d>0?Math.round(n/d*100):0,i=(c=Dr[r])!=null?c:Dr.not_compliant,v=36,x=2*Math.PI*v,h=x-t/100*x;return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-score-ring",className:chunkE64TU6IU_js.a("flex flex-col items-center gap-2",o==null?void 0:o.root,p),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("relative w-24 h-24",o==null?void 0:o.svgWrapper,p),children:[jsxRuntime.jsxs("svg",{className:"w-24 h-24 -rotate-90",viewBox:"0 0 96 96","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{cx:"48",cy:"48",r:v,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:"8"}),jsxRuntime.jsx("circle",{cx:"48",cy:"48",r:v,fill:"none",className:i.stroke,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:x,strokeDashoffset:h,style:{transition:"stroke-dashoffset 0.5s ease-out"}})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("absolute inset-0 flex flex-col items-center justify-center",o==null?void 0:o.centerText,p),children:jsxRuntime.jsxs("span",{className:chunkE64TU6IU_js.a(`text-xl font-bold leading-none ${i.text}`,o==null?void 0:o.scoreValue,p),"aria-label":`${t}% compliance score`,children:[t,"%"]})})]}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-xs font-semibold text-center ${i.text}`,o==null?void 0:o.ratingLabel,p),children:(a=Nr[r])!=null?a:r}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 text-center",o==null?void 0:o.scoreDetail,p),children:[n," / ",d," pts"]})]})};var rt={critical:"text-red-600 dark:text-red-400",important:"text-amber-600 dark:text-amber-400",recommended:"text-blue-600 dark:text-blue-400"},Fr=({gap:n,isPassed:d,onFix:r,classNames:o,unstyled:p})=>{let[t,i]=Gr.useState(false);return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-requirement-item",className:chunkE64TU6IU_js.a("border-b border-gray-100 dark:border-gray-700 last:border-0 py-2",o==null?void 0:o.root,p),children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!d&&i(v=>!v),className:chunkE64TU6IU_js.a("w-full flex items-start gap-2 text-left group",o==null?void 0:o.row,p),"aria-expanded":d?void 0:t,"aria-disabled":d,children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(["mt-0.5 flex-shrink-0 w-4 h-4 rounded-full flex items-center justify-center",d?"bg-green-500":n.severity==="critical"?"bg-red-500":n.severity==="important"?"bg-amber-500":"bg-blue-400"].join(" "),o==null?void 0:o.statusIcon,p),"aria-hidden":"true",children:d?jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-1",children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-xs font-medium ${d?"text-gray-700 dark:text-gray-300":"text-gray-900 dark:text-gray-100"}`,o==null?void 0:o.requirementLabel,p),children:n.requirement}),!d&&jsxRuntime.jsx("svg",{className:`flex-shrink-0 w-3 h-3 text-gray-400 transition-transform ${t?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-400 dark:text-gray-500 mt-0.5",o==null?void 0:o.ndpaSection,p),children:["NDPA ",n.ndpaSection]})]})]}),!d&&t&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-2 ml-6 space-y-2",o==null?void 0:o.detail,p),children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-xs ${rt[n.severity]}`,o==null?void 0:o.message,p),children:n.message}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{r(n.requirementId),i(false);},className:chunkE64TU6IU_js.a("text-xs font-medium px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",o==null?void 0:o.fixButton,p),children:n.fixLabel})]})]})};function et(n,d){let r=d.map(t=>({gap:{requirementId:t,requirement:t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "),ndpaSection:"\u2014",severity:"recommended",message:"",fixType:"fill_field",fixLabel:""},isPassed:true})),o=n.map(t=>({gap:t,isPassed:false})),p={critical:0,important:1,recommended:2};return o.sort((t,i)=>p[t.gap.severity]-p[i.gap.severity]),[...o,...r]}var Ar=({complianceResult:n,onFix:d,classNames:r,unstyled:o})=>{let[p,t]=Gr.useState(false),i=et(n.gaps,n.passed);return jsxRuntime.jsxs("aside",{"data-ndpr-component":"compliance-checker-sidebar",className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",r==null?void 0:r.root,o),"aria-label":"NDPA compliance checker",children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50",r==null?void 0:r.header,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-sm font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.title,o),children:"NDPA Compliance"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>t(v=>!v),className:chunkE64TU6IU_js.a("p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",r==null?void 0:r.collapseButton,o),"aria-expanded":!p,"aria-label":p?"Expand compliance checker":"Collapse compliance checker",children:jsxRuntime.jsx("svg",{className:`w-4 h-4 transition-transform ${p?"-rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]}),!p&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 space-y-4",r==null?void 0:r.body,o),children:[jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("flex justify-center",r==null?void 0:r.ringWrapper,o),children:jsxRuntime.jsx(Er,{score:n.score,maxScore:n.maxScore,rating:n.rating,classNames:r,unstyled:o})}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("grid grid-cols-3 gap-2 text-center",r==null?void 0:r.statsRow,o),children:[{count:n.gaps.filter(v=>v.severity==="critical").length,label:"Critical",color:"text-red-600 dark:text-red-400"},{count:n.gaps.filter(v=>v.severity==="important").length,label:"Important",color:"text-amber-600 dark:text-amber-400"},{count:n.passed.length,label:"Passed",color:"text-green-600 dark:text-green-400"}].map(({count:v,label:x,color:h})=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a(`text-base font-bold ${h}`,r==null?void 0:r.statValue,o),children:v}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400",r==null?void 0:r.statLabel,o),children:x})]},x))}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("overflow-y-auto max-h-80",r==null?void 0:r.requirementsList,o),children:i.length===0?jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-xs text-gray-500 dark:text-gray-400 text-center py-4",r==null?void 0:r.emptyState,o),children:"No requirements to display."}):i.map(({gap:v,isPassed:x})=>jsxRuntime.jsx(Fr,{gap:v,isPassed:x,onFix:d,classNames:r,unstyled:o},v.requirementId))})]})]})};function ot(n){let d=Date.now()-n;return d<1e4?"just now":d<6e4?`${Math.floor(d/1e3)}s ago`:d<36e5?`${Math.floor(d/6e4)}m ago`:new Date(n).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var Mr=({lastSavedAt:n,isSaving:d,hasError:r,classNames:o,unstyled:p})=>{let t="idle";if(d?t="saving":r?t="error":n!==null&&(t="saved"),t==="idle")return null;let i=t==="saving"?"Saving\u2026":t==="error"?"Unable to save":`Draft saved ${n?ot(n):""}`;return jsxRuntime.jsxs("div",{"data-ndpr-component":"draft-save-indicator",role:"status","aria-live":"polite","aria-atomic":"true",className:chunkE64TU6IU_js.a(`flex items-center gap-1.5 ${t==="error"?"text-red-500 dark:text-red-400":t==="saving"?"text-gray-400 dark:text-gray-500":"text-green-600 dark:text-green-400"}`,o==null?void 0:o.root,p),children:[t==="saving"&&jsxRuntime.jsxs("svg",{className:"animate-spin w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),t==="saved"&&jsxRuntime.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),t==="error"&&jsxRuntime.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("text-xs font-medium",o==null?void 0:o.text,p),children:i})]})};var ce=({adapter:n,onComplete:d,classNames:r,unstyled:o})=>{let{currentStep:p,nextStep:t,prevStep:i,canProceed:v,context:x,updateOrg:h,updateContext:c,toggleDataCategory:a,togglePurpose:g,addProcessor:u,removeProcessor:P,sections:z,customSections:Q,sectionOverrides:Y,editSectionContent:Z,addCustomSection:er,removeCustomSection:or,reorderSections:f,complianceResult:L,applyFix:ir,handleExportPDF:Br,handleExportDOCX:Ir,handleExportHTML:zr,handleExportMarkdown:jr,lastSavedAt:Or,isLoading:_r}=chunkDQLDX5X6_js.e({adapter:n,onComplete:d}),nr=(D,J)=>{let H=URL.createObjectURL(D),q=document.createElement("a");q.href=H,q.download=J,q.click(),URL.revokeObjectURL(H);},Hr=()=>chunkMQFZHA2D_js.d(null,null,function*(){let D=yield Br();nr(D,"privacy-policy.pdf");}),qr=()=>chunkMQFZHA2D_js.d(null,null,function*(){let D=yield Ir();nr(D,"privacy-policy.docx");}),Wr=()=>{let D=zr();navigator.clipboard.writeText(D).catch(()=>{let J=new Blob([D],{type:"text/html"}),H=URL.createObjectURL(J),q=window.open(H,"_blank");q?q.addEventListener("load",()=>URL.revokeObjectURL(H)):URL.revokeObjectURL(H);});},$r=()=>{let D=jr();navigator.clipboard.writeText(D).catch(()=>{let J=new Blob([D],{type:"text/markdown"});nr(J,"privacy-policy.md");});};return _r?jsxRuntime.jsxs("div",{"data-ndpr-component":"adaptive-policy-wizard",className:chunkE64TU6IU_js.a("flex items-center justify-center min-h-64 text-gray-400 dark:text-gray-500",r==null?void 0:r.root,o),"aria-busy":"true","aria-label":"Loading policy wizard",children:[jsxRuntime.jsxs("svg",{className:"animate-spin w-6 h-6 mr-2",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),jsxRuntime.jsx("span",{className:"text-sm",children:"Loading\u2026"})]}):jsxRuntime.jsx("div",{"data-ndpr-component":"adaptive-policy-wizard",className:chunkE64TU6IU_js.a("min-h-screen bg-gray-50 dark:bg-gray-900",r==null?void 0:r.root,o),children:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",r==null?void 0:r.container,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center justify-between mb-6",r==null?void 0:r.topBar,o),children:[jsxRuntime.jsx("h1",{className:chunkE64TU6IU_js.a("text-2xl font-bold text-gray-900 dark:text-gray-100",r==null?void 0:r.wizardTitle,o),children:"Privacy Policy Builder"}),jsxRuntime.jsx(Mr,{lastSavedAt:Or,isSaving:false,hasError:false,classNames:r,unstyled:o})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-4 mb-6",r==null?void 0:r.stepIndicatorWrapper,o),children:jsxRuntime.jsx(ur,{currentStep:p,classNames:r,unstyled:o})}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col lg:flex-row gap-6 items-start",r==null?void 0:r.panels,o),children:[jsxRuntime.jsxs("main",{className:chunkE64TU6IU_js.a("flex-1 min-w-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6",r==null?void 0:r.mainPanel,o),children:[p===1&&jsxRuntime.jsx(yr,{context:x,onUpdateOrg:h,classNames:r,unstyled:o}),p===2&&jsxRuntime.jsx(hr,{categories:x.dataCategories,onToggle:a,classNames:r,unstyled:o}),p===3&&jsxRuntime.jsx(lr,{context:x,onTogglePurpose:g,onUpdateContext:c,onAddProcessor:u,onRemoveProcessor:P,classNames:r,unstyled:o}),p===4&&jsxRuntime.jsx(Lr,{sections:z,customSections:Q,sectionOverrides:Y,complianceResult:L,onEditSection:Z,onAddCustomSection:er,onRemoveCustomSection:or,onReorderSection:f,onExportPDF:Hr,onExportDOCX:qr,onExportHTML:Wr,onExportMarkdown:$r,classNames:r,unstyled:o}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-center justify-between mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",r==null?void 0:r.navigation,o),children:[jsxRuntime.jsx("button",{type:"button",onClick:i,disabled:p===1,className:chunkE64TU6IU_js.a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors",r==null?void 0:r.backButton,o),children:"Back"}),jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:jsxRuntime.jsxs("span",{className:chunkE64TU6IU_js.a("text-xs text-gray-400 dark:text-gray-500",r==null?void 0:r.stepCounter,o),children:["Step ",p," of 4"]})}),p<4?jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:!v,className:chunkE64TU6IU_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-colors",r==null?void 0:r.nextButton,o),children:"Next"}):jsxRuntime.jsx("span",{})]})]}),jsxRuntime.jsx("aside",{className:chunkE64TU6IU_js.a("w-full lg:w-80 flex-shrink-0",r==null?void 0:r.sidebarWrapper,o),children:jsxRuntime.jsx(Ar,{complianceResult:L,onFix:ir,classNames:r,unstyled:o})})]})]})})};
2
- exports.a=ce;//# sourceMappingURL=chunk-JZKH5RMC.js.map
3
- //# sourceMappingURL=chunk-JZKH5RMC.js.map
@@ -1,2 +0,0 @@
1
- import {a as a$1}from'./chunk-RGYK4VAY.mjs';import {a as a$2}from'./chunk-SBNAMPAP.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect}from'react';function K(q,h){return h?a$2(q):{load:()=>null,save:()=>{},remove:()=>{}}}function W({categories:q,initialReports:h=[],adapter:g,storageKey:L="ndpr_breach_data",useLocalStorage:P=true,onReport:v,onAssessment:S,onNotification:I}){let D=g!=null?g:K(L,P),d=useRef(D);d.current=D;let[a$2,m]=useState(h),[u,A]=useState([]),[c,B]=useState([]),[U,N]=useState(true);useEffect(()=>{let e=false;try{let s=d.current.load(),r=t=>{var i,n,l;t&&(m((i=t.reports)!=null?i:[]),A((n=t.assessments)!=null?n:[]),B((l=t.notifications)!=null?l:[])),N(!1);};s instanceof Promise?s.then(t=>{e||r(t);},()=>{e||N(!1);}):r(s);}catch(s){e||N(false);}return ()=>{e=true;}},[]);let f=(e,s,r)=>{Promise.resolve(d.current.save({reports:e,assessments:s,notifications:r})).catch(t=>{console.warn("[ndpr-toolkit] Failed to save breach data:",t);});},y=e=>`${e}_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,_=e=>{let s=a({id:y("breach"),reportedAt:Date.now()},e),r=[...a$2,s];return m(r),f(r,u,c),v&&v(s),s},$=(e,s)=>{let r=a$2.findIndex(n=>n.id===e);if(r===-1)return null;let t=a(a({},a$2[r]),s),i=[...a$2];return i[r]=t,m(i),f(i,u,c),t},w=e=>a$2.find(s=>s.id===e)||null,j=(e,s)=>{let r=u.find(n=>n.breachId===e),t,i;return r?(i=b(a(a({},r),s),{assessedAt:Date.now()}),t=u.map(n=>n.id===r.id?i:n)):(i=a({id:y("assessment"),breachId:e,assessedAt:Date.now()},s),t=[...u,i]),A(t),f(a$2,t,c),S&&S(i),i},b$1=e=>u.find(s=>s.breachId===e)||null,x=e=>{let s=w(e),r=b$1(e);if(!s)return null;let{severityLevel:t,notificationRequired:i,timeframeHours:n,justification:l}=a$1(s,r||void 0),R=s.discoveredAt+n*60*60*1e3;return {ndpcNotificationRequired:i,ndpcNotificationDeadline:R,dataSubjectNotificationRequired:t==="high"||t==="critical",justification:l}};return {reports:a$2,assessments:u,notifications:c,reportBreach:_,updateReport:$,getReport:w,assessRisk:j,getAssessment:b$1,calculateNotificationRequirements:x,sendNotification:(e,s)=>{let r=c.find(n=>n.breachId===e),t,i;return r?(i=b(a(a({},r),s),{sentAt:Date.now()}),t=c.map(n=>n.id===r.id?i:n)):(i=a({id:y("notification"),breachId:e,sentAt:Date.now()},s),t=[...c,i]),B(t),f(a$2,u,t),I&&I(i),i},getNotification:e=>c.find(s=>s.breachId===e)||null,getBreachesRequiringNotification:(e=24)=>{let s=Date.now(),r=[];return a$2.forEach(t=>{if(c.some(E=>E.breachId===t.id))return;let i=b$1(t.id);if(!i)return;let n=x(t.id);if(!n||!n.ndpcNotificationRequired)return;let R=(n.ndpcNotificationDeadline-s)/(3600*1e3);R<=e&&r.push({report:t,assessment:i,requirements:n,hoursRemaining:R});}),r.sort((t,i)=>t.hoursRemaining-i.hoursRemaining)},clearBreachData:()=>{m([]),A([]),B([]),Promise.resolve(d.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove breach data:",e);});},isLoading:U}}export{W as a};//# sourceMappingURL=chunk-LFNA6WYQ.mjs.map
2
- //# sourceMappingURL=chunk-LFNA6WYQ.mjs.map