@tantainnovative/ndpr-toolkit 3.3.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/CHANGELOG.md +529 -0
  2. package/README.md +4 -4
  3. package/dist/{ConsentBanner-CDRT0o2k.d.mts → ConsentBanner-F5ayys5K.d.mts} +10 -0
  4. package/dist/{ConsentBanner-Vxyt8SCX.d.ts → ConsentBanner-VqIPophc.d.ts} +10 -0
  5. package/dist/{styling-B7CBzYG7.d.ts → ConsentManager-C7I3PDe8.d.mts} +2 -62
  6. package/dist/{styling-uJLsBbER.d.mts → ConsentManager-CQ2IZtUU.d.ts} +2 -62
  7. package/dist/{sanitize-B0AzEm1D.d.mts → NDPRProvider-DYFb8xEl.d.ts} +2 -94
  8. package/dist/{sanitize-B0AzEm1D.d.ts → NDPRProvider-U3QNu6MA.d.mts} +2 -94
  9. package/dist/adapters.js +1 -1
  10. package/dist/adapters.mjs +1 -1
  11. package/dist/breach.js +1 -1
  12. package/dist/breach.mjs +1 -1
  13. package/dist/chunk-2AW7KAZO.mjs +2 -0
  14. package/dist/chunk-2WH4DLV5.js +3 -0
  15. package/dist/chunk-3NQQSU4P.js +2 -0
  16. package/dist/chunk-3VQAYQR7.js +7 -0
  17. package/dist/chunk-4R42ZNO7.mjs +318 -0
  18. package/dist/chunk-5HL4UBFV.js +2 -0
  19. package/dist/chunk-6FGCGLH5.mjs +2 -0
  20. package/dist/chunk-6HZL2WDU.mjs +2 -0
  21. package/dist/chunk-6QPRDQZF.js +2 -0
  22. package/dist/chunk-74Z23WUA.mjs +2 -0
  23. package/dist/chunk-AHSMDPG5.js +132 -0
  24. package/dist/chunk-BN77GP4W.mjs +2 -0
  25. package/dist/chunk-C5QO3SX4.js +2 -0
  26. package/dist/chunk-CISJAQ6W.mjs +2 -0
  27. package/dist/chunk-DCJK5OZT.mjs +2 -0
  28. package/dist/chunk-DUY6F3GT.mjs +94 -0
  29. package/dist/chunk-EHAZIKDX.js +81 -0
  30. package/dist/chunk-EPT2K355.mjs +2 -0
  31. package/dist/chunk-HGGLW5TE.js +2 -0
  32. package/dist/chunk-HQSU7LGM.js +94 -0
  33. package/dist/chunk-IZCWCE7W.mjs +2 -0
  34. package/dist/chunk-JBSCER34.js +2 -0
  35. package/dist/chunk-KF3EFJEF.mjs +3 -0
  36. package/dist/chunk-KSERBMXW.mjs +4 -0
  37. package/dist/chunk-LJNNPAFU.mjs +2 -0
  38. package/dist/{chunk-UXMGBIX6.js → chunk-LSCMXAPY.mjs} +4 -4
  39. package/dist/chunk-LSNL4XR5.js +2 -0
  40. package/dist/chunk-M2TPT5GB.js +2 -0
  41. package/dist/chunk-MCWV7S2G.js +2 -0
  42. package/dist/chunk-MG73MOZC.mjs +15 -0
  43. package/dist/chunk-NCOZB2WU.mjs +2 -0
  44. package/dist/chunk-NQNFS3QI.js +7 -0
  45. package/dist/chunk-OPYQIJKY.js +2 -0
  46. package/dist/{chunk-ZEOQYWOE.mjs → chunk-P2YV6DR3.js} +4 -4
  47. package/dist/chunk-P6QAFBCV.js +2 -0
  48. package/dist/chunk-QVULSG6J.mjs +3 -0
  49. package/dist/chunk-R5FW5XUQ.mjs +2 -0
  50. package/dist/chunk-RGNP45VR.js +2 -0
  51. package/dist/chunk-RLYTX3MM.js +2 -0
  52. package/dist/chunk-RNTNHVKZ.js +15 -0
  53. package/dist/chunk-RRVKUCFR.mjs +2 -0
  54. package/dist/chunk-RXL6CZAI.js +2 -0
  55. package/dist/chunk-RY3PGVLZ.mjs +2 -0
  56. package/dist/chunk-SUEGUY35.js +2 -0
  57. package/dist/chunk-SYMQJO2W.mjs +7 -0
  58. package/dist/chunk-TCN22KYP.mjs +7 -0
  59. package/dist/chunk-UFPSUO52.js +318 -0
  60. package/dist/chunk-VTITKWGX.mjs +2 -0
  61. package/dist/chunk-WH6ZMUOS.mjs +81 -0
  62. package/dist/chunk-WTJGLNTB.js +3 -0
  63. package/dist/chunk-XHROISIF.mjs +2 -0
  64. package/dist/chunk-XMBSJJ5U.js +4 -0
  65. package/dist/chunk-XSEZDQLB.js +2 -0
  66. package/dist/chunk-Z6IIMLZU.mjs +2 -0
  67. package/dist/chunk-ZLSWOFAY.mjs +132 -0
  68. package/dist/chunk-ZPKVLTSX.js +2 -0
  69. package/dist/consent.d.mts +6 -4
  70. package/dist/consent.d.ts +6 -4
  71. package/dist/consent.js +1 -1
  72. package/dist/consent.mjs +1 -1
  73. package/dist/core.d.mts +6 -25
  74. package/dist/core.d.ts +6 -25
  75. package/dist/core.js +1 -1
  76. package/dist/core.mjs +1 -1
  77. package/dist/cross-border.d.mts +2 -2
  78. package/dist/cross-border.d.ts +2 -2
  79. package/dist/cross-border.js +1 -1
  80. package/dist/cross-border.mjs +1 -1
  81. package/dist/docx-BxKascXN.d.ts +64 -0
  82. package/dist/docx-CV7Vsry_.d.mts +64 -0
  83. package/dist/dpia.js +1 -1
  84. package/dist/dpia.mjs +1 -1
  85. package/dist/dsr.js +1 -1
  86. package/dist/dsr.mjs +1 -1
  87. package/dist/hooks.d.mts +4 -4
  88. package/dist/hooks.d.ts +4 -4
  89. package/dist/hooks.js +1 -1
  90. package/dist/hooks.mjs +1 -1
  91. package/dist/index.d.mts +8 -6
  92. package/dist/index.d.ts +8 -6
  93. package/dist/index.js +1 -1
  94. package/dist/index.mjs +1 -1
  95. package/dist/lawful-basis.js +1 -1
  96. package/dist/lawful-basis.mjs +1 -1
  97. package/dist/locale-CxJx2tzn.d.mts +25 -0
  98. package/dist/locale-DSkrtf-c.d.ts +25 -0
  99. package/dist/{policy-engine-C6nC2t3a.d.ts → policy-engine-CCUCud2T.d.ts} +1 -1
  100. package/dist/{policy-engine-DefZcX3R.d.mts → policy-engine-fYSqEqSW.d.mts} +1 -1
  101. package/dist/{policy-sections-DFDPVCCg.d.ts → policy-sections-BYx6fEFk.d.ts} +4 -2
  102. package/dist/{policy-sections-Bylm31kZ.d.mts → policy-sections-Dm97Nq8m.d.mts} +4 -2
  103. package/dist/{policy-templates-CIKcV0i1.d.ts → policy-templates-DhLwq4R-.d.ts} +8 -1
  104. package/dist/{policy-templates-DMsPwOSZ.d.mts → policy-templates-DwYl2329.d.mts} +8 -1
  105. package/dist/policy.d.mts +36 -71
  106. package/dist/policy.d.ts +36 -71
  107. package/dist/policy.js +1 -1
  108. package/dist/policy.mjs +1 -1
  109. package/dist/presets.d.mts +2 -2
  110. package/dist/presets.d.ts +2 -2
  111. package/dist/presets.js +1 -1
  112. package/dist/presets.mjs +1 -1
  113. package/dist/ropa.js +1 -1
  114. package/dist/ropa.mjs +1 -1
  115. package/dist/sanitize-CxxwKxAx.d.mts +94 -0
  116. package/dist/sanitize-CxxwKxAx.d.ts +94 -0
  117. package/dist/server.d.mts +24 -0
  118. package/dist/server.d.ts +24 -0
  119. package/dist/server.js +2 -0
  120. package/dist/server.mjs +2 -0
  121. package/dist/styles.css +1423 -31
  122. package/dist/styling-BMDGQDgS.d.mts +64 -0
  123. package/dist/styling-BaoQtV06.d.ts +64 -0
  124. package/dist/unstyled.d.mts +52 -19
  125. package/dist/unstyled.d.ts +52 -19
  126. package/dist/unstyled.js +1 -1
  127. package/dist/unstyled.mjs +1 -1
  128. package/dist/{useAdaptivePolicyWizard-A1PyOy6P.d.mts → useAdaptivePolicyWizard-BnjW4OR4.d.mts} +1 -1
  129. package/dist/{useAdaptivePolicyWizard-LVIKhAxw.d.ts → useAdaptivePolicyWizard-sb3m4-Zk.d.ts} +1 -1
  130. package/dist/{useCrossBorderTransfer-BGNZt2lk.d.mts → useCrossBorderTransfer-DixjLjN1.d.mts} +1 -1
  131. package/dist/{useCrossBorderTransfer-COqjgjsu.d.ts → useCrossBorderTransfer-DvSq06lv.d.ts} +1 -1
  132. package/dist/{useDefaultPrivacyPolicy-BsYttRey.d.mts → useDefaultPrivacyPolicy-Cs2WQSYQ.d.mts} +34 -9
  133. package/dist/{useDefaultPrivacyPolicy-C-mG-A5S.d.ts → useDefaultPrivacyPolicy-DkOqMg2e.d.ts} +34 -9
  134. package/package.json +20 -6
  135. package/dist/chunk-256APOQM.js +0 -2
  136. package/dist/chunk-25OOUES4.js +0 -2
  137. package/dist/chunk-4JKTIR33.mjs +0 -2
  138. package/dist/chunk-5BUS6AI7.js +0 -2
  139. package/dist/chunk-6BXUVS6E.js +0 -81
  140. package/dist/chunk-6JCRDJQI.mjs +0 -2
  141. package/dist/chunk-6RQGQZT2.js +0 -2
  142. package/dist/chunk-6YN73KR7.mjs +0 -2
  143. package/dist/chunk-CDZDT2OS.mjs +0 -320
  144. package/dist/chunk-CSIJCLGZ.mjs +0 -2
  145. package/dist/chunk-CWUPGY3M.mjs +0 -3
  146. package/dist/chunk-E63VPR7U.js +0 -2
  147. package/dist/chunk-FDDI426Y.mjs +0 -2
  148. package/dist/chunk-GCQRHMTQ.mjs +0 -144
  149. package/dist/chunk-GMLCWGNJ.js +0 -7
  150. package/dist/chunk-GQVNLUP2.js +0 -94
  151. package/dist/chunk-GXLSOZCH.mjs +0 -2
  152. package/dist/chunk-IQJO7WIH.js +0 -7
  153. package/dist/chunk-LETEUS5X.mjs +0 -2
  154. package/dist/chunk-LU4PFST7.js +0 -144
  155. package/dist/chunk-M6XETYNL.js +0 -2
  156. package/dist/chunk-NBSVFQ5G.js +0 -2
  157. package/dist/chunk-NUDVUAD4.mjs +0 -81
  158. package/dist/chunk-NUULHXVL.mjs +0 -7
  159. package/dist/chunk-PM7O5IGE.mjs +0 -2
  160. package/dist/chunk-Q7VHB64E.mjs +0 -2
  161. package/dist/chunk-QDHHD2KR.mjs +0 -94
  162. package/dist/chunk-SAA7UVI2.js +0 -3
  163. package/dist/chunk-TI2M7H6R.mjs +0 -7
  164. package/dist/chunk-TKVJ3OOV.mjs +0 -2
  165. package/dist/chunk-TXXWCB5O.js +0 -320
  166. package/dist/chunk-UGY5ZYUG.js +0 -2
  167. package/dist/chunk-UO6QPJLH.js +0 -2
  168. package/dist/chunk-UX6ZZNEM.mjs +0 -3
  169. package/dist/chunk-VLSGE2YA.js +0 -2
  170. package/dist/chunk-XFUEZ3MP.mjs +0 -2
  171. package/dist/chunk-XHSHPB74.js +0 -2
  172. package/dist/chunk-YCX6BFOQ.js +0 -2
  173. package/dist/chunk-YURSF2YO.mjs +0 -2
  174. package/dist/chunk-YZXUAIYN.js +0 -3
  175. package/dist/chunk-ZGJA7OO4.js +0 -2
  176. package/dist/chunk-ZT7KNFAU.mjs +0 -2
@@ -1,2 +0,0 @@
1
- import {a as a$1}from'./chunk-AYKLAEOU.mjs';import {a,b}from'./chunk-WWT2ZSNU.mjs';import {useState,useRef,useEffect,useCallback}from'react';import {createPortal}from'react-dom';import {jsx,jsxs}from'react/jsx-runtime';var yt=({options:d,onSave:U,title:Q="We Value Your Privacy",description:X="We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",acceptAllButtonText:Z="Accept All",rejectAllButtonText:s="Reject All",customizeButtonText:N="Customize",saveButtonText:tt="Save Preferences",position:L="bottom",zIndex:q=9999,version:a$2="1.0",show:x,manageStorage:z=true,storageKey:D="ndpr_consent",className:et="",buttonClassName:B="",primaryButtonClassName:H="",secondaryButtonClassName:nt="",classNames:t,unstyled:o,onAnalytics:k})=>{let[u,c]=useState(false),[g,m]=useState(false),[w,E]=useState({}),[F,rt]=useState(false),f=useRef(null),T=useRef(null),$=useRef(false);useEffect(()=>{rt(true);},[]);let b$1=useCallback((e,n)=>{k==null||k(a({action:e,timestamp:Date.now(),version:a$2},n!==void 0?{categories:n}:{}));},[k,a$2]);useEffect(()=>{let e={};if(d.forEach(n=>{e[n.id]=n.defaultValue||false;}),E(e),x===void 0)if(!z)c(true);else {let n=localStorage.getItem(D);if(n)try{JSON.parse(n).version!==a$2?c(!0):c(!1);}catch(C){c(true);}else c(true);}else c(x);},[d,D,a$2,z]),useEffect(()=>{x!==void 0&&c(x);},[x]);let ot=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),b$1("accepted_all",e),j(e);},M=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),b$1("rejected_all",e),j(e);},it=(e,n)=>{E(C=>b(a({},C),{[e]:n}));},dt=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),E(e);},ut=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),E(e);},_=d.length>0&&d.every(e=>w[e.id]),ct=()=>{b$1("customized",w),j(w);},j=e=>{let n={consents:e,timestamp:Date.now(),version:a$2,method:g?"customize":"banner",hasInteracted:true};z&&localStorage.setItem(D,JSON.stringify(n)),U(n),c(false),m(false);};if(useEffect(()=>{if(!u)return;let e=n=>{n.key==="Escape"&&(b$1("dismissed"),M());};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[u,b$1,d,g]),useEffect(()=>{u&&!$.current&&($.current=true,b$1("shown")),u||($.current=false);},[u,b$1]),useEffect(()=>{if(!u||!f.current)return;let e='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',C=setTimeout(()=>{if(!f.current)return;let p=f.current.querySelectorAll(e);p.length>0?p[0].focus():f.current.focus();},0),G=p=>{if(p.key!=="Tab"||!f.current)return;let A=f.current.querySelectorAll(e);if(A.length===0)return;let V=A[0],J=A[A.length-1];p.shiftKey?document.activeElement===V&&(p.preventDefault(),J.focus()):document.activeElement===J&&(p.preventDefault(),V.focus());};return document.addEventListener("keydown",G),()=>{clearTimeout(C),document.removeEventListener("keydown",G);}},[u,g]),useEffect(()=>{if(g&&T.current){let e=T.current;e.style.maxHeight="0px",e.style.opacity="0",e.offsetHeight,e.style.maxHeight=`${e.scrollHeight}px`,e.style.opacity="1";}},[g]),!u)return null;let lt=(t==null?void 0:t.primaryButton)||(t==null?void 0:t.acceptButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${B} ${H}`,K=(t==null?void 0:t.secondaryButton)||(t==null?void 0:t.rejectButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${B} ${nt}`,gt=(t==null?void 0:t.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${B}`,ft=(t==null?void 0:t.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${B} ${H}`,S=L==="inline",y=L==="center",h;S||y?h="":L==="top"?h="fixed inset-x-0 top-0":h="fixed inset-x-0 bottom-0";let P=jsx("div",{ref:f,tabIndex:-1,"data-ndpr-component":"consent-banner",className:a$1(`${S?"":h} bg-white dark:bg-gray-800 shadow-lg p-3 sm:p-4 border border-gray-200 dark:border-gray-700 ${y?"max-w-lg w-full":""} ${et}`,t==null?void 0:t.root,o),style:!S&&!y?{zIndex:q}:void 0,role:"dialog","aria-modal":y||void 0,"aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children:jsxs("div",{className:a$1("max-w-6xl mx-auto",t==null?void 0:t.container,o),children:[jsx("h2",{id:"consent-banner-title",className:a$1("text-lg font-bold mb-2",t==null?void 0:t.title,o),children:Q}),jsx("p",{id:"consent-banner-description",className:a$1("text-sm sm:text-base mb-4",t==null?void 0:t.description,o),children:X}),g&&jsxs("div",{ref:T,className:a$1("mb-4 p-3 sm:p-4 rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50",t==null?void 0:t.customizePanel,o),style:{overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out"},children:[jsx("div",{className:"mb-3 flex items-center justify-end",children:jsx("button",{type:"button",onClick:_?ut:dt,className:a$1("text-sm font-medium text-[rgb(var(--ndpr-primary))] hover:underline",t==null?void 0:t.selectAllButton,o),children:_?"Deselect All":"Select All"})}),jsx("div",{className:a$1("space-y-3",t==null?void 0:t.optionsList,o),children:d.map(e=>jsxs("div",{className:a$1("flex items-start",t==null?void 0:t.optionItem,o),children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:`consent-${e.id}`,type:"checkbox",checked:w[e.id]||false,onChange:n=>it(e.id,n.target.checked),disabled:e.required,className:a$1("h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",t==null?void 0:t.optionCheckbox,o)})}),jsxs("div",{className:"ml-3 text-sm",children:[jsxs("label",{htmlFor:`consent-${e.id}`,className:a$1("font-medium",t==null?void 0:t.optionLabel,o),children:[e.label," ",e.required&&jsx("span",{className:"text-red-500",children:"*"})]}),jsx("p",{className:a$1("text-gray-600 dark:text-gray-400",t==null?void 0:t.optionDescription,o),children:e.description})]})]},e.id))}),jsxs("div",{className:a$1("mt-4 flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsx("button",{onClick:ct,className:a$1(ft,t==null?void 0:t.saveButton,o),children:tt}),jsx("button",{onClick:()=>m(false),className:a$1(K,t==null?void 0:t.rejectButton,o),children:"Back"})]})]}),!g&&jsxs("div",{className:a$1("flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsx("button",{onClick:ot,className:a$1(lt,t==null?void 0:t.acceptButton,o),children:Z}),jsx("button",{onClick:M,className:a$1(K,t==null?void 0:t.rejectButton,o),children:s}),jsx("button",{onClick:()=>m(true),className:a$1(gt,t==null?void 0:t.customizeButton,o),children:N})]}),jsx("div",{className:a$1("mt-2 text-xs text-gray-600 dark:text-gray-400",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(S)return P;if(y){let e=jsxs("div",{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:q},children:[jsx("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),jsx("div",{className:"relative",children:P})]});return F?createPortal(e,document.body):null}return F?createPortal(P,document.body):null};export{yt as a};//# sourceMappingURL=chunk-4JKTIR33.mjs.map
2
- //# sourceMappingURL=chunk-4JKTIR33.mjs.map
@@ -1,2 +0,0 @@
1
- 'use strict';var chunkGOU6FU6Y_js=require('./chunk-GOU6FU6Y.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var _=[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_interest",label:"Public Interest (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}],ee=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"archived",label:"Archived"}],Oe=[{value:"data_subject",label:"Directly from Data Subject"},{value:"third_party",label:"Third Party"},{value:"public_source",label:"Public Source"},{value:"other",label:"Other"}];function je(){let d=Date.now();return {id:`proc_${d}_${Math.random().toString(36).substring(2,11)}`,name:"",description:"",controllerDetails:{name:"",contact:"",address:""},lawfulBasis:"consent",lawfulBasisJustification:"",purposes:[],dataCategories:[],dataSubjectCategories:[],recipients:[],retentionPeriod:"",securityMeasures:[],dataSource:"data_subject",dpiaRequired:false,automatedDecisionMaking:false,status:"active",createdAt:d,updatedAt:d}}function te(d){return d?new Date(d).toLocaleDateString():"N/A"}var $e=({ropa:d,onAddRecord:w,onUpdateRecord:R,onArchiveRecord:D,title:re="Record of Processing Activities (ROPA)",description:ae="Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",className:ie="",buttonClassName:F="",classNames:e,unstyled:o})=>{let[v,x]=react.useState("list"),[S,oe]=react.useState(""),[P,ne]=react.useState("all"),[A,de]=react.useState("all"),[l,f]=react.useState(null),[U,k]=react.useState([]),[I,$]=react.useState(""),[M,H]=react.useState(""),[L,V]=react.useState(""),[E,J]=react.useState(""),[O,z]=react.useState(""),[j,G]=react.useState(""),[q,W]=react.useState(""),p=react.useMemo(()=>chunkGOU6FU6Y_js.b(d),[d]),y=react.useMemo(()=>chunkGOU6FU6Y_js.d(d),[d]),K=react.useMemo(()=>{let r=[...d.records];if(P!=="all"&&(r=r.filter(i=>i.status===P)),A!=="all"&&(r=r.filter(i=>i.lawfulBasis===A)),S){let i=S.toLowerCase();r=r.filter(u=>u.name.toLowerCase().includes(i)||u.description.toLowerCase().includes(i)||u.dataCategories.some(m=>m.toLowerCase().includes(i))||u.department&&u.department.toLowerCase().includes(i));}return r},[d.records,P,A,S]);react.useEffect(()=>{l&&($(l.purposes.join(", ")),H(l.dataCategories.join(", ")),V((l.sensitiveDataCategories||[]).join(", ")),J(l.dataSubjectCategories.join(", ")),z(l.recipients.join(", ")),G(l.securityMeasures.join(", ")),W((l.systemsUsed||[]).join(", ")));},[l==null?void 0:l.id]);let le=react.useCallback(()=>{let r=je();r.controllerDetails.name=d.organizationName,r.controllerDetails.contact=d.organizationContact,r.controllerDetails.address=d.organizationAddress,d.ndpcRegistrationNumber&&(r.controllerDetails.registrationNumber=d.ndpcRegistrationNumber),d.dpoDetails&&(r.controllerDetails.dpoContact=d.dpoDetails.email),f(r),k([]),x("form");},[d.organizationName,d.organizationContact,d.organizationAddress,d.ndpcRegistrationNumber,d.dpoDetails]),ue=react.useCallback(r=>{f(chunkMQFZHA2D_js.a({},r)),k([]),x("form");},[]),b=r=>r.split(",").map(i=>i.trim()).filter(i=>i.length>0),ge=react.useCallback(()=>{if(!l)return;let r=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},l),{purposes:b(I),dataCategories:b(M),sensitiveDataCategories:b(L),dataSubjectCategories:b(E),recipients:b(O),securityMeasures:b(j),systemsUsed:b(q),updatedAt:Date.now()});r.sensitiveDataCategories&&r.sensitiveDataCategories.length===0&&(r.sensitiveDataCategories=void 0),r.systemsUsed&&r.systemsUsed.length===0&&(r.systemsUsed=void 0);let i=chunkGOU6FU6Y_js.a(r);if(!i.valid){k(i.errors);return}d.records.find(m=>m.id===r.id)?R==null||R(r.id,r):w==null||w(r),f(null),k([]),x("list");},[l,I,M,L,E,O,j,q,d.records,R,w]),se=react.useCallback(r=>{D==null||D(r);},[D]),ce=react.useCallback(()=>{let r=chunkGOU6FU6Y_js.c(d),i=new Blob([r],{type:"text/csv;charset=utf-8;"}),u=URL.createObjectURL(i),m=document.createElement("a");m.href=u,m.download=`ropa_${d.organizationName.replace(/\s+/g,"_").toLowerCase()}_${new Date().toISOString().slice(0,10)}.csv`,m.click(),setTimeout(()=>URL.revokeObjectURL(u),100);},[d]),Q=react.useCallback(()=>{f(null),k([]),x("list");},[]),s=react.useCallback((r,i)=>{f(u=>u&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{[r]:i}));},[]),T=react.useCallback((r,i)=>{f(u=>u&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{controllerDetails:chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u.controllerDetails),{[r]:i})}));},[]),pe=react.useCallback(r=>!!r.nextReviewDate&&r.nextReviewDate<=Date.now(),[]),me=react.useCallback(r=>{oe(r.target.value);},[]),be=react.useCallback(r=>{ne(r.target.value);},[]),ve=react.useCallback(r=>{de(r.target.value);},[]),xe=react.useCallback(r=>{$(r.target.value);},[]),fe=react.useCallback(r=>{H(r.target.value);},[]),ye=react.useCallback(r=>{V(r.target.value);},[]),he=react.useCallback(r=>{J(r.target.value);},[]),ke=react.useCallback(r=>{z(r.target.value);},[]),Ce=react.useCallback(r=>{G(r.target.value);},[]),we=react.useCallback(r=>{W(r.target.value);},[]),Re=react.useCallback(()=>x("list"),[]),De=react.useCallback(()=>x("summary"),[]),Se=react.useCallback(r=>{let i={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",inactive:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},u={active:"Active",inactive:"Inactive",archived:"Archived"};return jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${i[r]}`,e==null?void 0:e.statusBadge,o),children:u[r]})},[e==null?void 0:e.statusBadge,o]),Pe=react.useCallback(r=>jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",children:{consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"}[r]}),[]),Ae=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",e==null?void 0:e.orgInfo,o),children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"Organization"}),jsxRuntime.jsx("p",{className:"text-sm font-semibold",children:d.organizationName})]}),d.dpoDetails&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"Data Protection Officer"}),jsxRuntime.jsx("p",{className:"text-sm font-semibold",children:d.dpoDetails.name}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:d.dpoDetails.email})]}),d.ndpcRegistrationNumber&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-gray-600 dark:text-gray-400",children:"NDPC Registration No."}),jsxRuntime.jsx("p",{className:"text-sm font-semibold",children:d.ndpcRegistrationNumber})]})]}),jsxRuntime.jsxs("div",{className:"mt-2 text-xs text-gray-600 dark:text-gray-400",children:["Version ",d.version," | Last Updated: ",te(d.lastUpdated)]})]}),Be=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",e==null?void 0:e.summary,o),children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-blue-700 dark:text-blue-300",children:p.totalRecords}),jsxRuntime.jsx("p",{className:"text-xs text-blue-600 dark:text-blue-400",children:"Total Records"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-green-700 dark:text-green-300",children:p.activeRecords}),jsxRuntime.jsx("p",{className:"text-xs text-green-600 dark:text-green-400",children:"Active"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-700 dark:text-purple-300",children:p.crossBorderRecords}),jsxRuntime.jsx("p",{className:"text-xs text-purple-600 dark:text-purple-400",children:"Cross-Border"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-orange-700 dark:text-orange-300",children:y.length}),jsxRuntime.jsx("p",{className:"text-xs text-orange-600 dark:text-orange-400",children:"Records with Gaps"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-2",children:"By Lawful Basis"}),_.map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:r.label.split(" (")[0]}),jsxRuntime.jsx("span",{className:"font-medium",children:p.byLawfulBasis[r.value]||0})]},r.value))]}),jsxRuntime.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-2",children:"Risk Indicators"}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Sensitive Data"}),jsxRuntime.jsx("span",{className:"font-medium",children:p.sensitiveDataRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"DPIA Required"}),jsxRuntime.jsx("span",{className:"font-medium",children:p.dpiaRequiredRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Automated Decisions"}),jsxRuntime.jsx("span",{className:"font-medium",children:p.automatedDecisionRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:"Due for Review"}),jsxRuntime.jsx("span",{className:`font-medium ${p.recordsDueForReview.length>0?"text-red-600 dark:text-red-400":""}`,children:p.recordsDueForReview.length})]})]}),p.topDepartments.length>0&&jsxRuntime.jsxs("div",{className:"p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-2",children:"Top Departments"}),p.topDepartments.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:r.department}),jsxRuntime.jsx("span",{className:"font-medium",children:r.count})]},r.department))]})]}),y.length>0&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md",e==null?void 0:e.complianceGap,o),role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-2",children:"Compliance Gaps Detected"}),y.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"mb-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-red-700 dark:text-red-300",children:r.recordName}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:r.gaps.map((i,u)=>jsxRuntime.jsx("li",{className:"text-xs text-red-600 dark:text-red-400",children:i},u))})]},r.recordId)),y.length>5&&jsxRuntime.jsxs("p",{className:"text-xs text-red-600 dark:text-red-400 mt-1",children:["...and ",y.length-5," more record(s) with gaps."]})]})]}),Fe=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaSearch",className:"block text-sm font-medium mb-1",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"ropaSearch",value:S,onChange:me,placeholder:"Search records...",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))]",e==null?void 0:e.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaStatusFilter",className:"block text-sm font-medium mb-1",children:"Status"}),jsxRuntime.jsxs("select",{id:"ropaStatusFilter",value:P,onChange:be,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))]",e==null?void 0:e.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),ee.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaBasisFilter",className:"block text-sm font-medium mb-1",children:"Lawful Basis"}),jsxRuntime.jsxs("select",{id:"ropaBasisFilter",value:A,onChange:ve,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))]",e==null?void 0:e.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Bases"}),_.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label.split(" (")[0]},r.value))]})]}),jsxRuntime.jsxs("div",{className:"flex items-end space-x-2",children:[jsxRuntime.jsx("button",{onClick:le,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${F}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),o),children:"Add Record"}),jsxRuntime.jsx("button",{onClick:ce,"aria-label":"Export ROPA records as CSV",className:chunkE64TU6IU_js.a(`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 text-sm ${F}`,(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.exportButton),o),children:"Export CSV"})]})]}),K.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm text-center py-8",children:"No processing records found."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:chunkE64TU6IU_js.a("w-full text-sm text-left",e==null?void 0:e.table,o),children:[jsxRuntime.jsx("thead",{className:chunkE64TU6IU_js.a("text-xs uppercase bg-gray-50 dark:bg-gray-700",e==null?void 0:e.tableHeader,o),children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Name"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Lawful Basis"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Data Categories"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Status"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Last Reviewed"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{children:K.map(r=>{let i=pe(r),u=y.some(m=>m.recordId===r.id);return jsxRuntime.jsxs("tr",{className:chunkE64TU6IU_js.a(`border-b dark:border-gray-600 ${i?"bg-red-50 dark:bg-red-900/10":u?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} hover:bg-gray-50 dark:hover:bg-gray-700`,e==null?void 0:e.tableRow,o),children:[jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"font-medium",children:r.name}),r.department&&jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:r.department}),i&&jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-medium",children:"Review Overdue"})]})}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:Pe(r.lawfulBasis)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300 max-w-xs truncate",children:r.dataCategories.join(", ")})}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:Se(r.status)}),jsxRuntime.jsx("td",{className:"px-4 py-3 text-xs text-gray-600 dark:text-gray-400",children:te(r.lastReviewedAt)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsx("button",{onClick:()=>ue(r),"aria-label":`Edit record: ${r.name}`,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline text-xs",children:"Edit"}),r.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>se(r.id),"aria-label":`Archive record: ${r.name}`,className:"text-gray-600 dark:text-gray-400 hover:underline text-xs",children:"Archive"})]})})]},r.id)})})]})})]}),Ie=react.useMemo(()=>l?!d.records.find(r=>r.id===l.id):true,[l,d.records]),Me=()=>{if(!l)return null;let r=Ie;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",e==null?void 0:e.form,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex justify-between items-center mb-4",e==null?void 0:e.header,o),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:r?"Add Processing Record":"Edit Processing Record"}),jsxRuntime.jsx("button",{onClick:Q,className:"text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 text-sm",children:"Cancel"})]}),U.length>0&&jsxRuntime.jsxs("div",{className:"mb-4 p-3 bg-red-50 dark:bg-red-900/20 rounded-md",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Please fix the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:U.map((i,u)=>jsxRuntime.jsx("li",{className:"text-xs text-red-600 dark:text-red-400",children:i},u))})]}),jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Basic Information"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordName",className:"block text-sm font-medium mb-1",children:"Activity Name *"}),jsxRuntime.jsx("input",{type:"text",id:"recordName",value:l.name,onChange:i=>s("name",i.target.value),"aria-required":"true",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))]",e==null?void 0:e.input,o),placeholder:"e.g., Customer Account Management"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordDepartment",className:"block text-sm font-medium mb-1",children:"Department"}),jsxRuntime.jsx("input",{type:"text",id:"recordDepartment",value:l.department||"",onChange:i=>s("department",i.target.value||void 0),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))]",e==null?void 0:e.input,o),placeholder:"e.g., Marketing"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"recordDescription",className:"block text-sm font-medium mb-1",children:"Description *"}),jsxRuntime.jsx("textarea",{id:"recordDescription",value:l.description,onChange:i=>s("description",i.target.value),rows:3,"aria-required":"true",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))]",e==null?void 0:e.input,o),placeholder:"Describe what personal data processing is performed..."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordStatus",className:"block text-sm font-medium mb-1",children:"Status *"}),jsxRuntime.jsx("select",{id:"recordStatus",value:l.status,onChange:i=>s("status",i.target.value),"aria-required":"true",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))]",e==null?void 0:e.select,o),children:ee.map(i=>jsxRuntime.jsx("option",{value:i.value,children:i.label},i.value))})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Controller Details"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"controllerName",className:"block text-sm font-medium mb-1",children:"Controller Name *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerName",value:l.controllerDetails.name,onChange:i=>T("name",i.target.value),"aria-required":"true",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))]",e==null?void 0:e.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"controllerContact",className:"block text-sm font-medium mb-1",children:"Controller Contact *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerContact",value:l.controllerDetails.contact,onChange:i=>T("contact",i.target.value),"aria-required":"true",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))]",e==null?void 0:e.input,o)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"controllerAddress",className:"block text-sm font-medium mb-1",children:"Controller Address *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerAddress",value:l.controllerDetails.address,onChange:i=>T("address",i.target.value),"aria-required":"true",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))]",e==null?void 0:e.input,o)})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Lawful Basis (NDPA Section 25)"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasis",className:"block text-sm font-medium mb-1",children:"Lawful Basis *"}),jsxRuntime.jsx("select",{id:"lawfulBasis",value:l.lawfulBasis,onChange:i=>s("lawfulBasis",i.target.value),"aria-required":"true",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))]",e==null?void 0:e.select,o),children:_.map(i=>jsxRuntime.jsx("option",{value:i.value,children:i.label},i.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasisJustification",className:"block text-sm font-medium mb-1",children:"Justification *"}),jsxRuntime.jsx("textarea",{id:"lawfulBasisJustification",value:l.lawfulBasisJustification,onChange:i=>s("lawfulBasisJustification",i.target.value),rows:2,"aria-required":"true",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))]",e==null?void 0:e.input,o),placeholder:"Explain why this lawful basis applies..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Data Details"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"purposes",className:"block text-sm font-medium mb-1",children:"Purposes * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"purposes",value:I,onChange:xe,"aria-required":"true",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))]",e==null?void 0:e.input,o),placeholder:"e.g., Account management, Service delivery"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataCategories",className:"block text-sm font-medium mb-1",children:"Data Categories * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"dataCategories",value:M,onChange:fe,"aria-required":"true",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))]",e==null?void 0:e.input,o),placeholder:"e.g., Name, Email, Phone number"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sensitiveData",className:"block text-sm font-medium mb-1",children:"Sensitive Data Categories (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"sensitiveData",value:L,onChange:ye,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))]",e==null?void 0:e.input,o),placeholder:"e.g., Health data, Biometric data"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"subjectCategories",className:"block text-sm font-medium mb-1",children:"Data Subject Categories * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"subjectCategories",value:E,onChange:he,"aria-required":"true",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))]",e==null?void 0:e.input,o),placeholder:"e.g., Customers, Employees"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recipients",className:"block text-sm font-medium mb-1",children:"Recipients * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"recipients",value:O,onChange:ke,"aria-required":"true",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))]",e==null?void 0:e.input,o),placeholder:"e.g., Payment processors, Cloud service providers"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataSource",className:"block text-sm font-medium mb-1",children:"Data Source *"}),jsxRuntime.jsx("select",{id:"dataSource",value:l.dataSource,onChange:i=>s("dataSource",i.target.value),"aria-required":"true",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))]",e==null?void 0:e.select,o),children:Oe.map(i=>jsxRuntime.jsx("option",{value:i.value,children:i.label},i.value))})]}),l.dataSource==="third_party"&&jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"thirdPartyDetails",className:"block text-sm font-medium mb-1",children:"Third-Party Source Details *"}),jsxRuntime.jsx("input",{type:"text",id:"thirdPartyDetails",value:l.thirdPartySourceDetails||"",onChange:i=>s("thirdPartySourceDetails",i.target.value||void 0),"aria-required":"true",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))]",e==null?void 0:e.input,o),placeholder:"Describe the third-party data source..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Retention and Security"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionPeriod",className:"block text-sm font-medium mb-1",children:"Retention Period *"}),jsxRuntime.jsx("input",{type:"text",id:"retentionPeriod",value:l.retentionPeriod,onChange:i=>s("retentionPeriod",i.target.value),"aria-required":"true",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))]",e==null?void 0:e.input,o),placeholder:"e.g., 5 years after account closure"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionJustification",className:"block text-sm font-medium mb-1",children:"Retention Justification"}),jsxRuntime.jsx("input",{type:"text",id:"retentionJustification",value:l.retentionJustification||"",onChange:i=>s("retentionJustification",i.target.value||void 0),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))]",e==null?void 0:e.input,o),placeholder:"Why this retention period is necessary..."})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"securityMeasures",className:"block text-sm font-medium mb-1",children:"Security Measures * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"securityMeasures",value:j,onChange:Ce,"aria-required":"true",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))]",e==null?void 0:e.input,o),placeholder:"e.g., Encryption at rest, Access controls, Audit logging"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"systemsUsed",className:"block text-sm font-medium mb-1",children:"Systems Used (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"systemsUsed",value:q,onChange:we,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))]",e==null?void 0:e.input,o),placeholder:"e.g., CRM, ERP, Cloud Storage"})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Risk Indicators"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"dpiaRequired",checked:l.dpiaRequired,onChange:i=>s("dpiaRequired",i.target.checked),className:"rounded border-gray-300 dark:border-gray-600"}),jsxRuntime.jsx("label",{htmlFor:"dpiaRequired",className:"text-sm font-medium",children:"DPIA Required"})]}),l.dpiaRequired&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpiaReference",className:"block text-sm font-medium mb-1",children:"DPIA Reference *"}),jsxRuntime.jsx("input",{type:"text",id:"dpiaReference",value:l.dpiaReference||"",onChange:i=>s("dpiaReference",i.target.value||void 0),"aria-required":"true",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))]",e==null?void 0:e.input,o),placeholder:"Reference to the completed DPIA"})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"automatedDecisionMaking",checked:l.automatedDecisionMaking,onChange:i=>s("automatedDecisionMaking",i.target.checked),className:"rounded border-gray-300 dark:border-gray-600"}),jsxRuntime.jsx("label",{htmlFor:"automatedDecisionMaking",className:"text-sm font-medium",children:"Automated Decision-Making"})]}),l.automatedDecisionMaking&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"automatedDecisionMakingDetails",className:"block text-sm font-medium mb-1",children:"Automated Decision-Making Details *"}),jsxRuntime.jsx("textarea",{id:"automatedDecisionMakingDetails",value:l.automatedDecisionMakingDetails||"",onChange:i=>s("automatedDecisionMakingDetails",i.target.value||void 0),rows:2,"aria-required":"true",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))]",e==null?void 0:e.input,o),placeholder:"Describe the automated decision-making process..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"border border-gray-200 dark:border-gray-600 rounded-md p-4",children:[jsxRuntime.jsx("legend",{className:"text-sm font-medium px-2",children:"Review Schedule"}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"nextReviewDate",className:"block text-sm font-medium mb-1",children:"Next Review Date"}),jsxRuntime.jsx("input",{type:"date",id:"nextReviewDate",value:l.nextReviewDate?new Date(l.nextReviewDate).toISOString().slice(0,10):"",onChange:i=>s("nextReviewDate",i.target.value?new Date(i.target.value).getTime():void 0),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))]",e==null?void 0:e.input,o)})]})})]}),jsxRuntime.jsxs("div",{className:"flex justify-end space-x-3",children:[jsxRuntime.jsx("button",{onClick:Q,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-50 dark:hover:bg-gray-700 text-sm",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:ge,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${F}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),o),children:r?"Add Record":"Save Changes"})]})]})]})},Le=()=>jsxRuntime.jsxs("div",{className:"flex space-x-4 mb-6 border-b border-gray-200 dark:border-gray-600",children:[jsxRuntime.jsx("button",{onClick:Re,className:`pb-2 text-sm font-medium ${v==="list"?"border-b-2 border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Processing Records"}),jsxRuntime.jsx("button",{onClick:De,className:`pb-2 text-sm font-medium ${v==="summary"?"border-b-2 border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Compliance Summary"})]});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ie}`,e==null?void 0:e.root,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",e==null?void 0:e.title,o),children:re}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:ae}),Ae(),v!=="form"&&Le(),v==="list"&&Fe(),v==="summary"&&Be(),v==="form"&&Me()]})};exports.a=$e;//# sourceMappingURL=chunk-5BUS6AI7.js.map
2
- //# sourceMappingURL=chunk-5BUS6AI7.js.map
@@ -1,81 +0,0 @@
1
- 'use strict';var chunkBKRETVJ6_js=require('./chunk-BKRETVJ6.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var ve=({breachData:g,initialAssessment:u={},onComplete:w,title:J="Breach Risk Assessment",description:_="Assess the risk level of this data breach to determine notification requirements under NDPA Section 40.",submitButtonText:K="Complete Assessment",className:ae="",buttonClassName:Z="",classNames:v={},unstyled:d=false,showBreachSummary:l=true,showNotificationRequirements:A=true})=>{let[j,se]=react.useState(u.confidentialityImpact||3),[P,b]=react.useState(u.integrityImpact||3),[D,C]=react.useState(u.availabilityImpact||3),[q,B]=react.useState(u.harmLikelihood||3),[E,I]=react.useState(u.harmSeverity||3),[M,O]=react.useState(u.risksToRightsAndFreedoms!==void 0?u.risksToRightsAndFreedoms:false),[G,W]=react.useState(u.highRisksToRightsAndFreedoms!==void 0?u.highRisksToRightsAndFreedoms:false),[Q,ie]=react.useState(u.justification||""),[Y,re]=react.useState(0),[R,h]=react.useState("low"),[x,f]=react.useState(false),[y,X]=react.useState(0),[U,z]=react.useState(0),[p,k]=react.useState(false);react.useEffect(()=>{let ee=j*.2+P*.1+D*.1+q*.3+E*.3;re(Number(ee.toFixed(1)));let L;ee<2?L="low":ee<3?L="medium":ee<4?L="high":L="critical",h(L),f(M||L==="high"||L==="critical");let ne=g.discoveredAt+4320*60*1e3;X(ne);let ce=Date.now(),pe=(ne-ce)/(3600*1e3);z(Number(pe.toFixed(1)));},[j,P,D,q,E,M,g.discoveredAt]);let T=o=>new Date(o).toLocaleString(),H=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:j,integrityImpact:P,availabilityImpact:D,harmLikelihood:q,harmSeverity:E,overallRiskScore:Y,riskLevel:R,risksToRightsAndFreedoms:M,highRisksToRightsAndFreedoms:G,justification:Q};w(N),k(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"}},m=o=>jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[o]}`,v.riskBadge,d),children:o.charAt(0).toUpperCase()+o.slice(1)});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ae}`,v.root,d),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",v.title,d),children:J}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:_}),l&&jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-2",children:"Breach Summary"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Title:"})," ",g.title]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Discovered:"})," ",T(g.discoveredAt)]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",g.status.charAt(0).toUpperCase()+g.status.slice(1)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Types:"})," ",g.dataTypes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",g.affectedSystems.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",g.estimatedAffectedSubjects||"Unknown"]})]})]})]}),p?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Assessment Results"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Overall Risk Level:"})," ",m(R)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Score:"})," ",Y," / 5"]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Assessed On:"})," ",T(Date.now())]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",M?"Yes":"No"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",G?"Yes":"No"]})]})]}),jsxRuntime.jsxs("div",{className:"mt-3",children:[jsxRuntime.jsx("p",{className:"text-sm mb-1",children:jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})}),jsxRuntime.jsx("p",{className:"text-sm bg-white dark:bg-gray-800 p-2 rounded",children:Q})]})]}),A&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`mb-6 p-4 rounded-md ${x?U>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"}`,v.notificationStatus,d),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Requirements"}),x?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:`text-sm font-bold mb-2 ${U>24?"text-yellow-800 dark:text-yellow-200":"text-red-800 dark:text-red-200"}`,children:"NDPC Notification Required"}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"Under the NDPA (Section 40), this breach must be reported to the NDPC within 72 hours of discovery."}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notification Deadline:"})," ",T(y)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Time Remaining:"})," ",jsxRuntime.jsx("span",{className:U<24?"text-red-600 dark:text-red-400 font-bold":"",children:U>0?`${U} hours`:"Deadline passed"})]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subject Notification:"})," ",G?"Required (NDPA Section 40(4))":"Not required unless directed by NDPC"]})]}):jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-bold mb-2 text-green-800 dark:text-green-200",children:"NDPC Notification Not Required"}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"Based on this assessment, this breach does not need to be reported to the NDPC."}),jsxRuntime.jsx("p",{className:"text-sm mb-2",children:"However, the breach should still be documented internally for compliance purposes."})]}),jsxRuntime.jsxs("div",{className:"mt-3 text-sm",children:[jsxRuntime.jsx("p",{className:"font-medium",children:"Next Steps:"}),jsxRuntime.jsx("ul",{className:"list-disc pl-5 mt-1",children:x?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("li",{children:"Prepare a notification report for the NDPC"}),jsxRuntime.jsx("li",{children:"Document all aspects of the breach and your response"}),G&&jsxRuntime.jsx("li",{children:"Prepare communications for affected data subjects"}),jsxRuntime.jsx("li",{children:"Implement measures to mitigate the impact of the breach"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("li",{children:"Document the breach and this assessment in your internal records"}),jsxRuntime.jsx("li",{children:"Implement measures to prevent similar breaches in the future"}),jsxRuntime.jsx("li",{children:"Review and update security measures as needed"})]})})]})]}),jsxRuntime.jsx("button",{onClick:()=>k(false),className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${Z}`,v.primaryButton||v.submitButton,d),children:"Edit Assessment"})]}):jsxRuntime.jsx("form",{onSubmit:H,children:jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Assessment"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"confidentialityImpact",className:"block text-sm font-medium mb-1",children:["Confidentiality Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the confidentiality of data been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"confidentialityImpact",min:"1",max:"5",step:"1",value:j,onChange:o=>se(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(j)," (",j,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"integrityImpact",className:"block text-sm font-medium mb-1",children:["Integrity Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the integrity of data been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"integrityImpact",min:"1",max:"5",step:"1",value:P,onChange:o=>b(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(P)," (",P,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"availabilityImpact",className:"block text-sm font-medium mb-1",children:["Availability Impact (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the availability of data or systems been compromised?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"availabilityImpact",min:"1",max:"5",step:"1",value:D,onChange:o=>C(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(D)," (",D,")"]})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Risk to Data Subjects"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"harmLikelihood",className:"block text-sm font-medium mb-1",children:["Likelihood of Harm (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How likely is it that data subjects will experience harm?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"harmLikelihood",min:"1",max:"5",step:"1",value:q,onChange:o=>B(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(q)," (",q,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"harmSeverity",className:"block text-sm font-medium mb-1",children:["Severity of Harm (1-5)",jsxRuntime.jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How severe would the harm be to affected data subjects?"})]}),jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("input",{type:"range",id:"harmSeverity",min:"1",max:"5",step:"1",value:E,onChange:o=>I(parseInt(o.target.value)),className:chunkE64TU6IU_js.a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",v.slider,d)}),jsxRuntime.jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(E)," (",E,")"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"risksToRightsAndFreedoms",checked:M,onChange:o=>O(o.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"risksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a risk to the rights and freedoms of data subjects"})]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40), breaches that pose a risk to rights and freedoms must be reported to the NDPC within 72 hours."})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center mb-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"highRisksToRightsAndFreedoms",checked:G,onChange:o=>W(o.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"highRisksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a high risk to the rights and freedoms of data subjects"})]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40(4)), breaches that pose a high risk to rights and freedoms also require notification to affected data subjects without undue delay."})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Overall Assessment"}),jsxRuntime.jsxs("div",{className:"mb-4 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Overall Risk Score:"}),jsxRuntime.jsxs("span",{className:chunkE64TU6IU_js.a("",v.riskScore,d),children:[Y," / 5"]})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Level:"}),m(R)]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:["Justification for Assessment ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"justification",value:Q,onChange:o=>ie(o.target.value),rows:4,placeholder:"Explain the reasoning behind your assessment, including any factors that influenced your decision.",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true})]})]}),jsxRuntime.jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This assessment will determine if notification is required for this breach."})]}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{type:"submit",className:chunkE64TU6IU_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${Z}`,v.primaryButton||v.submitButton,d),children:K})})]})})]})};var Ce=({breachReports:g,riskAssessments:u,regulatoryNotifications:w,onSelectBreach:J,onRequestAssessment:_,onRequestNotification:K,title:ae="Breach Notification Manager",description:Z="Manage data breach notifications and track compliance with NDPA Section 40 requirements.",className:v="",buttonClassName:d="",classNames:l={},unstyled:A=false,showBreachDetails:j=true,showNotificationTimeline:se=true,showDeadlineAlerts:P=true})=>{var H;let[b,D]=react.useState(null),[C,q]=react.useState(g),[B,E]=react.useState("all"),[I,M]=react.useState(""),[O,G]=react.useState("discoveredAt"),[W,Q]=react.useState("desc");react.useEffect(()=>{let s=[...g];if(B!=="all"&&(s=s.filter(m=>m.status===B)),I){let m=I.toLowerCase();s=s.filter(o=>o.title.toLowerCase().includes(m)||o.description.toLowerCase().includes(m)||o.affectedSystems.some(N=>N.toLowerCase().includes(m))||o.dataTypes.some(N=>N.toLowerCase().includes(m)));}s.sort((m,o)=>{let N=0;switch(O){case "title":N=m.title.localeCompare(o.title);break;case "discoveredAt":N=m.discoveredAt-o.discoveredAt;break;case "status":N=m.status.localeCompare(o.status);break;case "riskLevel":let F=u.find(L=>L.breachId===m.id),$=u.find(L=>L.breachId===o.id),oe=(F==null?void 0:F.riskLevel)||"unknown",ee=($==null?void 0:$.riskLevel)||"unknown";N=oe.localeCompare(ee);break;default:N=m.discoveredAt-o.discoveredAt;}return W==="asc"?N:-N}),q(s);},[g,B,I,O,W,u]),react.useEffect(()=>{C.length>0&&(b&&C.some(m=>m.id===b)||D(C[0].id));},[C,b]);let ie=s=>{D(s),J&&J(s);},Y=()=>{b&&_&&_(b);},re=()=>{b&&K&&K(b);},R=s=>new Date(s).toLocaleString(),h=b?g.find(s=>s.id===b):null,x=b?u.find(s=>s.breachId===b):null,f=b?w.find(s=>s.breachId===b):null,y=h?X(h,x):null;function X(s,m){let o=chunkBKRETVJ6_js.a(s,m||void 0),N=s.discoveredAt+o.timeframeHours*60*60*1e3;return {ndpcNotificationRequired:o.notificationRequired,ndpcNotificationDeadline:N,dataSubjectNotificationRequired:(m==null?void 0:m.highRisksToRightsAndFreedoms)||false,justification:o.justification}}function U(s){let m=Date.now(),o=(s-m)/(3600*1e3);return Number(o.toFixed(1))}let z=s=>s?jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[s]}`,l.statusBadge,A),children:s.charAt(0).toUpperCase()+s.slice(1)}):null,p=s=>jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{ongoing:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",contained:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",resolved:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"}[s]||"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200"}`,l.statusBadge,A),children:s.charAt(0).toUpperCase()+s.slice(1)}),k=()=>{if(!h||!y)return null;if(!y.ndpcNotificationRequired)return jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Not Required"}),jsxRuntime.jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"Based on the risk assessment, NDPC notification is not required for this breach."})]});if(f)return jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Sent"}),jsxRuntime.jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:["Notification was sent to the NDPC on ",R(f.sentAt),"."]})]});let s=U(y.ndpcNotificationDeadline);return s<=0?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Notification Deadline Passed"}),jsxRuntime.jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The 72-hour deadline for NDPC notification has passed. Notification should be sent immediately."})]}):s<=24?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Notification Due Soon"}),jsxRuntime.jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",s," hours remaining until the NDPC notification deadline."]})]}):jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Notification Required"}),jsxRuntime.jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:["NDPC notification is required by ",R(y.ndpcNotificationDeadline)," (",s," hours remaining)."]})]})},T=()=>{if(!h)return null;let s=[{title:"Breach Discovered",date:h.discoveredAt,completed:true,description:`Breach was discovered on ${R(h.discoveredAt)}.`},{title:"Risk Assessment",date:x==null?void 0:x.assessedAt,completed:!!x,description:x?`Risk assessment completed on ${R(x.assessedAt)}.`:"Risk assessment has not been completed yet."}];return y!=null&&y.ndpcNotificationRequired&&s.push({title:"NDPC Notification",date:f==null?void 0:f.sentAt,completed:!!f,description:f?`Notification sent to the NDPC on ${R(f.sentAt)}.`:`Notification must be sent to the NDPC by ${R(y.ndpcNotificationDeadline)}.`}),y!=null&&y.dataSubjectNotificationRequired&&s.push({title:"Data Subject Notification",date:void 0,completed:false,description:"Notification to affected data subjects is required but has not been sent yet."}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-6",l.timeline,A),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Notification Timeline"}),jsxRuntime.jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:s.map((m,o)=>jsxRuntime.jsxs("li",{className:chunkE64TU6IU_js.a("mb-6 ml-4",l.timelineStep,A),children:[jsxRuntime.jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${m.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsxRuntime.jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-600 dark:text-gray-500",children:m.date?R(m.date):"Pending"}),jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:m.title}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:m.description})]},o))})]})};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${v}`,l.root,A),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",l.header,A),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",l.title,A),children:ae}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:Z})]}),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxRuntime.jsxs("select",{id:"statusFilter",value:B,onChange:s=>E(s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),jsxRuntime.jsx("option",{value:"ongoing",children:"Ongoing"}),jsxRuntime.jsx("option",{value:"contained",children:"Contained"}),jsxRuntime.jsx("option",{value:"resolved",children:"Resolved"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxRuntime.jsxs("select",{id:"sortBy",value:O,onChange:s=>G(s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"discoveredAt",children:"Discovery Date"}),jsxRuntime.jsx("option",{value:"title",children:"Title"}),jsxRuntime.jsx("option",{value:"status",children:"Status"}),jsxRuntime.jsx("option",{value:"riskLevel",children:"Risk Level"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"searchTerm",value:I,onChange:s=>M(s.target.value),placeholder:"Search breaches...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxRuntime.jsxs("div",{className:"md:col-span-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Breach Reports"}),C.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No breach reports found."}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",l.breachList,A),children:C.map(s=>{let m=u.find($=>$.breachId===s.id),o=w.find($=>$.breachId===s.id),N=X(s,m),F=null;if(N!=null&&N.ndpcNotificationRequired)if(o)F=jsxRuntime.jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Notified"});else {let $=U(N.ndpcNotificationDeadline);$<=0?F=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):$<=24?F=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):F=jsxRuntime.jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Required"});}else F=jsxRuntime.jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Not Required"});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md cursor-pointer ${b===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,A),onClick:()=>ie(s.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:s.title}),p(s.status)]}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:["Discovered: ",new Date(s.discoveredAt).toLocaleDateString()]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsxRuntime.jsx("div",{children:m&&z(m.riskLevel)}),jsxRuntime.jsx("div",{children:F})]})]},s.id)})})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("md:col-span-2",l.detailPanel,A),children:h?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:h.title}),p(h.status)]}),P&&jsxRuntime.jsx("div",{className:"mb-4",children:k()}),j&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Discovered:"})," ",R(h.discoveredAt)]}),h.occurredAt&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Occurred:"})," ",R(h.occurredAt)]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reporter:"})," ",h.reporter.name]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",h.affectedSystems.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Types:"})," ",h.dataTypes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",h.estimatedAffectedSubjects||"Unknown"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Description:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:h.description})]}),h.initialActions&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Initial Actions Taken:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:h.initialActions})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Risk Assessment"}),x?jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Risk Level:"}),z(x.riskLevel)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risk Score:"})," ",x.overallRiskScore," / 5"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",x.risksToRightsAndFreedoms?"Yes":"No"]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",x.highRisksToRightsAndFreedoms?"Yes":"No"]}),jsxRuntime.jsx("p",{className:"text-sm mb-1",children:jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300 bg-white dark:bg-gray-800 p-2 rounded-md",children:x.justification})]}):jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"Risk assessment has not been conducted yet."}),jsxRuntime.jsx("button",{onClick:Y,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${d}`,children:"Conduct Risk Assessment"})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Status"}),f?jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notification Sent:"})," ",R(f.sentAt)]}),jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Method:"})," ",f.method.charAt(0).toUpperCase()+f.method.slice(1)]}),f.referenceNumber&&jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference Number:"})," ",f.referenceNumber]}),(f.ndpcContact||f.nitdaContact)&&jsxRuntime.jsxs("p",{className:"text-sm mb-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"NDPC Contact:"})," ",(H=f.ndpcContact||f.nitdaContact)==null?void 0:H.name]})]}):jsxRuntime.jsx("div",{children:y!=null&&y.ndpcNotificationRequired?jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"NDPC notification is required but has not been sent yet."}),jsxRuntime.jsx("button",{onClick:re,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${d}`,children:"Generate Notification"})]}):jsxRuntime.jsx("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:"NDPC notification is not required for this breach."})})})]}),se&&T()]}):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Select a breach to view details"})})})]})]})};var Te=({breachData:g,assessmentData:u,organizationInfo:w,onGenerate:J,title:_="Generate NDPC Notification Report",description:K="Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements.",generateButtonText:ae="Generate Report",className:Z="",buttonClassName:v="",classNames:d={},unstyled:l=false,showPreview:A=true,allowEditing:j=true,allowDownload:se=true,downloadFormat:P="pdf"})=>{let[b,D]=react.useState(""),[C,q]=react.useState(""),[B,E]=react.useState(""),[I,M]=react.useState(""),[O,G]=react.useState("email"),[W,Q]=react.useState(""),[ie,Y]=react.useState(""),[re,R]=react.useState(false),[h,x]=react.useState(false);react.useEffect(()=>{let p=y();D(p),R(true);},[g,u,w]);let f=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: ${w.name}
11
- ${w.registrationNumber?`Registration Number: ${w.registrationNumber}`:""}
12
- Address: ${w.address}
13
- ${w.website?`Website: ${w.website}`:""}
14
-
15
- DATA PROTECTION OFFICER
16
- ----------------------
17
- Name: ${w.dpoName}
18
- Email: ${w.dpoEmail}
19
- ${w.dpoPhone?`Phone: ${w.dpoPhone}`:""}
20
-
21
- BREACH DETAILS
22
- -------------
23
- Breach Title: ${g.title}
24
- Date Discovered: ${f(g.discoveredAt)}
25
- ${g.occurredAt?`Date Occurred: ${f(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
- `,X=p=>{p.preventDefault();let k={id:`notification_${Date.now()}`,breachId:g.id,sentAt:Date.now(),method:O,referenceNumber:W||void 0,ndpcContact:C?{name:C,email:B,phone:I||void 0}:void 0,content:b,attachments:[]};J(k),x(true);},U=()=>{let p,k,T;switch(P){case "html":{p="text/html",k="html",T=`<!DOCTYPE html>
72
- <html lang="en">
73
- <head>
74
- <meta charset="UTF-8">
75
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
76
- <title>NDPC Breach Notification Report</title>
77
- <style>body{font-family:monospace;white-space:pre-wrap;max-width:800px;margin:2rem auto;padding:0 1rem;}</style>
78
- </head>
79
- <body>${b.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}</body>
80
- </html>`;break}case "pdf":p="text/plain",k="pdf.txt",T=b;break;case "docx":p="text/plain",k="docx.txt",T=b;break;default:p="text/plain",k="txt",T=b;}let H=document.createElement("a"),s=new Blob([T],{type:p});H.href=URL.createObjectURL(s),H.download=`NDPC_Breach_Notification_${new Date().toISOString().split("T")[0]}.${k}`,document.body.appendChild(H),H.click(),document.body.removeChild(H);},z=()=>[{value:"email",label:"Email"},{value:"portal",label:"NDPC Portal"},{value:"letter",label:"Formal Letter"},{value:"other",label:"Other"}].map(k=>jsxRuntime.jsx("option",{value:k.value,children:k.label},k.value));return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Z}`,d.root,l),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",d.header,l),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",d.title,l),children:_}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:K})]}),h?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-green-50 dark:bg-green-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Generated Successfully"}),jsxRuntime.jsx("p",{className:"text-green-700 dark:text-green-300",children:"Your NDPC notification report has been generated and is ready for submission. Please review the report carefully before submitting it to the NDPC."})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Submission Details"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Method:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:O.charAt(0).toUpperCase()+O.slice(1)})]}),C&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Contact Name:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:C})]}),B&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Contact Email:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:B})]}),I&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Contact Phone:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:I})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Date Generated:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:f(Date.now())})]}),jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Breach ID:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:g.id})]}),W&&jsxRuntime.jsxs("p",{className:chunkE64TU6IU_js.a("text-sm",d.field,l),children:[jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("font-medium",d.fieldLabel,l),children:"Reference Number:"})," ",jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a("",d.fieldValue,l),children:W})]})]})]})]}),A&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Preview"}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("bg-gray-50 dark:bg-gray-700 p-4 rounded-md",d.reportPreview,l),children:jsxRuntime.jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:b})})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-3",children:[se&&jsxRuntime.jsxs("button",{onClick:U,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${v}`,d.secondaryButton||d.downloadButton,l),children:["Download Report (",P.toUpperCase(),")"]}),jsxRuntime.jsx("button",{onClick:()=>x(false),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${v}`,children:"Edit Report"})]})]}):jsxRuntime.jsx("form",{onSubmit:X,children:jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Notification Method"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"method",className:"block text-sm font-medium mb-1",children:["Method of Submission ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("select",{id:"method",value:O,onChange:p=>G(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:z()})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"referenceNumber",className:"block text-sm font-medium mb-1",children:"Reference Number (if available)"}),jsxRuntime.jsx("input",{type:"text",id:"referenceNumber",value:W,onChange:p=>Q(p.target.value),placeholder:"e.g. NDPC/BR/2024/001",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"NDPC Contact (if known)"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactName",className:"block text-sm font-medium mb-1",children:"Contact Name"}),jsxRuntime.jsx("input",{type:"text",id:"contactName",value:C,onChange:p=>q(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactEmail",className:"block text-sm font-medium mb-1",children:"Contact Email"}),jsxRuntime.jsx("input",{type:"email",id:"contactEmail",value:B,onChange:p=>E(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"contactPhone",className:"block text-sm font-medium mb-1",children:"Contact Phone"}),jsxRuntime.jsx("input",{type:"tel",id:"contactPhone",value:I,onChange:p=>M(p.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"additionalInfo",className:"block text-sm font-medium mb-1",children:"Additional Information to Include"}),jsxRuntime.jsx("textarea",{id:"additionalInfo",value:ie,onChange:p=>Y(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))]"})]})]}),j&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Content"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"reportContent",className:"block text-sm font-medium mb-1",children:["Edit Report Content ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"reportContent",value:b,onChange:p=>D(p.target.value),rows:20,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] font-mono text-sm",required:true})]})]}),jsxRuntime.jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This report will help you comply with this requirement."})]}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{type:"submit",className:chunkE64TU6IU_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${v}`,d.primaryButton||d.generateButton,l),children:ae})})]})})]})};exports.a=ve;exports.b=Ce;exports.c=Te;//# sourceMappingURL=chunk-6BXUVS6E.js.map
81
- //# sourceMappingURL=chunk-6BXUVS6E.js.map
@@ -1,2 +0,0 @@
1
- import {a as a$1}from'./chunk-6TA2MVTU.mjs';import {a as a$2}from'./chunk-6WIP33TW.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect}from'react';function H(i,m){return m?a$2(i):{load:()=>null,save:()=>{},remove:()=>{}}}function Y({sections:i,initialAnswers:m={},adapter:v,storageKey:E="ndpr_dpia_data",useLocalStorage:M=true,onComplete:w}){let D=v!=null?v:H(E,M),d=useRef(D);d.current=D;let[f,A]=useState(0),[a$2,p]=useState(m),[C,g]=useState(true);useEffect(()=>{let r=false;try{let t=d.current.load();t instanceof Promise?t.then(e=>{r||(e&&p(e),g(!1));},()=>{r||g(!1);}):(t&&p(t),g(!1));}catch(t){r||g(false);}return ()=>{r=true;}},[]);let c=i[f]||null,V=r=>{Promise.resolve(d.current.save(r)).catch(t=>{console.warn("[ndpr-toolkit] Failed to save DPIA answers:",t);});},T=(r,t)=>{p(e=>{let s=b(a({},e),{[r]:t});return V(s),s});},I=r=>r.showWhen?r.showWhen.every(t=>{let e=a$2[t.questionId];switch(t.operator){case "equals":return e===t.value;case "contains":return Array.isArray(e)?e.includes(String(t.value)):false;case "greaterThan":return typeof e=="number"&&typeof t.value=="number"?e>t.value:false;case "lessThan":return typeof e=="number"&&typeof t.value=="number"?e<t.value:false;default:return true}}):true,P=()=>c?c.questions.filter(I):[],b$1=()=>c?P().every(t=>{if(!t.required)return true;let e=a$2[t.id];return !(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0)}):false,_=()=>{let r={};return c&&P().forEach(e=>{if(!e.required)return;let s=a$2[e.id];s==null||typeof s=="string"&&s.trim()===""?r[e.id]="This question is required":Array.isArray(s)&&s.length===0&&(r[e.id]="At least one option must be selected");}),r},$=()=>b$1()&&f<i.length-1?(A(r=>r+1),true):false,O=()=>f>0?(A(r=>r-1),true):false,U=r=>r>=0&&r<i.length?(A(r),true):false,B=()=>i.every(r=>r.questions.filter(I).every(e=>{if(!e.required)return true;let s=a$2[e.id];return !(s==null||typeof s=="string"&&s.trim()===""||Array.isArray(s)&&s.length===0)})),F=()=>{let r=[];return i.forEach(t=>{t.questions.forEach(e=>{let s=a$2[e.id];if(s!=null&&e.riskLevel)if(["select","radio","checkbox"].includes(e.type)&&e.options)(Array.isArray(s)?s:[s]).forEach(o=>{var y;let l=(y=e.options)==null?void 0:y.find(u=>u.value===o);if(l!=null&&l.riskLevel){let u=l.riskLevel,S=u==="low"?1:u==="medium"?3:5,k=u==="low"?1:u==="medium"?3:5;r.push({id:`risk_${r.length+1}`,description:`${e.text} - ${l.label}`,likelihood:S,impact:k,score:S*k,level:u,mitigated:false,relatedQuestionIds:[e.id]});}});else {let n=e.riskLevel,o=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:o,impact:l,score:o*l,level:n,mitigated:false,relatedQuestionIds:[e.id]});}});}),r},W=(r,t,e)=>{let s=F(),n={id:`dpia_${Date.now()}`,title:t,processingDescription:e,startedAt:Date.now(),completedAt:Date.now(),assessor:r,answers:a$2,risks:s,overallRiskLevel:"low",canProceed:true,conclusion:"",version:"1.0"},o=a$1(n);return n.overallRiskLevel=o.overallRiskLevel,n.canProceed=o.canProceed,n.conclusion=o.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=o.recommendations,w&&w(n),n},K=()=>{p({}),A(0),Promise.resolve(d.current.remove()).catch(r=>{console.warn("[ndpr-toolkit] Failed to remove DPIA data:",r);});},j=(()=>{let r=0,t=0;return i.forEach(e=>{e.questions.forEach(s=>{if(s.required&&I(s)){t++;let n=a$2[s.id];n!=null&&!(typeof n=="string"&&n.trim()==="")&&!(Array.isArray(n)&&n.length===0)&&r++;}});}),t>0?Math.round(r/t*100):0})();return {currentSectionIndex:f,currentSection:c,answers:a$2,updateAnswer:T,nextSection:$,prevSection:O,goToSection:U,isCurrentSectionValid:b$1,getCurrentSectionErrors:_,isComplete:B,completeDPIA:W,getVisibleQuestions:P,resetDPIA:K,progress:j,isLoading:C}}export{Y as a};//# sourceMappingURL=chunk-6JCRDJQI.mjs.map
2
- //# sourceMappingURL=chunk-6JCRDJQI.mjs.map
@@ -1,2 +0,0 @@
1
- 'use strict';var chunkGOU6FU6Y_js=require('./chunk-GOU6FU6Y.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function E({initialData:S,adapter:l,onRecordAdd:p,onRecordUpdate:g,onRecordArchive:f}){let d=react.useRef(l);d.current=l;let[s,u]=react.useState(S),[v,P]=react.useState(l!==void 0);react.useEffect(()=>{if(!d.current)return;let t=false;try{let e=d.current.load();e instanceof Promise?e.then(r=>{t||(r&&u(r),P(!1));},()=>{t||P(!1);}):(e&&u(e),P(!1));}catch(e){t||P(false);}return ()=>{t=true;}},[]);let n=react.useCallback(t=>{d.current&&Promise.resolve(d.current.save(t)).catch(e=>{console.warn("[ndpr-toolkit] Failed to save ROPA:",e);});},[]),C=react.useCallback(t=>{u(e=>{let r=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{records:[...e.records,t],lastUpdated:Date.now()});return n(r),r}),p==null||p(t);},[p,n]),w=react.useCallback((t,e)=>{u(r=>{let a=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},r),{records:r.records.map(R=>R.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},R),e),{updatedAt:Date.now()}):R),lastUpdated:Date.now()});return n(a),a}),g==null||g(t,e);},[g,n]),x=react.useCallback(t=>{u(e=>{let r=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{records:e.records.map(a=>a.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{status:"archived",updatedAt:Date.now()}):a),lastUpdated:Date.now()});return n(r),r}),f==null||f(t);},[f,n]),D=react.useCallback(t=>s.records.find(e=>e.id===t),[s.records]),G=react.useCallback(()=>chunkGOU6FU6Y_js.b(s),[s]),b=react.useCallback(()=>chunkGOU6FU6Y_js.c(s),[s]),L=react.useCallback(()=>chunkGOU6FU6Y_js.d(s),[s]);return {ropa:s,addRecord:C,updateRecord:w,archiveRecord:x,getRecord:D,getSummary:G,exportCSV:b,getComplianceGaps:L,isLoading:v}}exports.a=E;//# sourceMappingURL=chunk-6RQGQZT2.js.map
2
- //# sourceMappingURL=chunk-6RQGQZT2.js.map
@@ -1,2 +0,0 @@
1
- import {a as a$2}from'./chunk-GKKAK6ES.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useState}from'react';import {jsxs,jsx}from'react/jsx-runtime';var mr=({requestTypes:A,onSubmit:V,onValidationError:S,title:s="Submit a Data Subject Request",description:N="Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",submitButtonText:rr="Submit Request",className:D="",buttonClassName:_="",showConfirmation:er=true,confirmationMessage:ir="Your request has been submitted successfully. You will receive a confirmation email shortly.",requireIdentityVerification:P=true,identifierTypes:R=[{id:"email",label:"Email Address"},{id:"account",label:"Account Number"},{id:"customer_id",label:"Customer ID"}],collectAdditionalContact:tr=true,labels:f={},classNames:r,unstyled:o=false,isSubmitting:x=false,defaultValues:a$3,onReset:F})=>{var Y,H,L,U,W,J;let[h,j]=useState((a$3==null?void 0:a$3.requestType)||""),[T,E]=useState(((Y=a$3==null?void 0:a$3.dataSubject)==null?void 0:Y.fullName)||""),[q,O]=useState(((H=a$3==null?void 0:a$3.dataSubject)==null?void 0:H.email)||""),[w,B]=useState(((L=a$3==null?void 0:a$3.dataSubject)==null?void 0:L.phone)||""),[z,M]=useState(((U=a$3==null?void 0:a$3.dataSubject)==null?void 0:U.identifierType)||((W=R[0])==null?void 0:W.id)||""),[$,Z]=useState(((J=a$3==null?void 0:a$3.dataSubject)==null?void 0:J.identifierValue)||""),[l,C]=useState((a$3==null?void 0:a$3.additionalInfo)||{}),[or,I]=useState(false),[d,G]=useState({}),nr=()=>{var e;j(""),E(""),O(""),B(""),M(((e=R[0])==null?void 0:e.id)||""),Z(""),C({}),I(false),G({}),F==null||F();},u=A.find(e=>e.id===h),dr=e=>{j(e.target.value),C({});},c=(e,b$1)=>{C(m=>b(a$1({},m),{[e]:b$1}));},ar=()=>{let e={};return T.trim()||(e.fullName="Full name is required"),q.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(q)||(e.email="Email is invalid"):e.email="Email is required",h||(e.requestType="Please select a request type"),P&&!$.trim()&&(e.identifierValue="Identifier value is required"),u!=null&&u.requiresAdditionalInfo&&u.additionalFields&&u.additionalFields.forEach(b=>{b.required&&!l[b.id]&&(e[`additional_${b.id}`]=`${b.label} is required`);}),G(e),e},ur=e=>{e.preventDefault();let b=ar();if(Object.keys(b).length>0){S==null||S(b);return}let m=Object.keys(l).length>0?Object.fromEntries(Object.entries(l).map(([g,v])=>[g,typeof v=="string"?a$2(v):v])):void 0,k={requestType:h,dataSubject:{fullName:a$2(T),email:a$2(q),phone:w?a$2(w):void 0,identifierType:z,identifierValue:a$2($)},additionalInfo:m,submittedAt:Date.now()};V(k),er&&I(true);};return or?jsxs("div",{className:a(`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${D}`,r==null?void 0:r.successMessage,o),"aria-live":"polite",children:[jsx("h2",{className:a("text-lg font-bold text-green-800 dark:text-green-200 mb-2",r==null?void 0:r.title,o),children:"Request Submitted"}),jsx("p",{className:a("text-green-700 dark:text-green-300",r==null?void 0:r.description,o),children:ir}),jsx("button",{onClick:()=>I(false),className:a(`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${_}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Submit Another Request"})]}):jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${D}`,r==null?void 0:r.root,o),children:[jsx("h2",{className:a("text-xl font-bold mb-2",r==null?void 0:r.title,o),children:s}),jsx("p",{className:a("mb-6 text-gray-600 dark:text-gray-300",r==null?void 0:r.description,o),children:N}),jsx("form",{onSubmit:ur,className:a("",r==null?void 0:r.form,o),children:jsxs("div",{className:a("space-y-4",r==null?void 0:r.fieldGroup,o),children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Personal Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"fullName",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[f.name||"Full Name"," ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"fullName",value:T,onChange:e=>E(e.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:true,"aria-required":"true","aria-invalid":!!d.fullName,"aria-describedby":d.fullName?"fullName-error":void 0}),d.fullName&&jsx("p",{id:"fullName-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.fullName})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"email",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[f.email||"Email Address"," ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"email",id:"email",value:q,onChange:e=>O(e.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:true,"aria-required":"true","aria-invalid":!!d.email,"aria-describedby":d.email?"email-error":void 0}),d.email&&jsx("p",{id:"email-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.email})]}),tr&&jsxs("div",{children:[jsx("label",{htmlFor:"phone",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:"Phone Number (Optional)"}),jsx("input",{type:"tel",id:"phone",value:w,onChange:e=>B(e.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Request Details"}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"requestType",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[f.requestType||"Request Type"," ",jsx("span",{className:"text-red-500",children:"*"})]}),jsxs("select",{id:"requestType",value:h,onChange:dr,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:true,"aria-required":"true","aria-invalid":!!d.requestType,"aria-describedby":d.requestType?"requestType-error":void 0,children:[jsx("option",{value:"",children:"Select a request type"}),A.map(e=>jsx("option",{value:e.id,children:e.name},e.id))]}),d.requestType&&jsx("p",{id:"requestType-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.requestType})]}),u&&jsxs("div",{className:"mb-4 p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:u.description}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Estimated completion time: ",u.estimatedCompletionTime," ",u.estimatedCompletionTime===1?"day":"days"]})]}),jsxs("div",{className:"mb-4",children:[jsx("label",{htmlFor:"requestDescription",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:f.description||"Additional Information"}),jsx("textarea",{id:"requestDescription",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.textarea,o),rows:4,placeholder:"Please provide any additional details that might help us process your request"})]})]}),P&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Identity Verification"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3",children:"To protect your privacy, we need to verify your identity before processing your request."}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"identifierType",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:["Identifier Type ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("select",{id:"identifierType",value:z,onChange:e=>M(e.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:true,"aria-required":"true",children:R.map(e=>jsx("option",{value:e.id,children:e.label},e.id))})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"identifierValue",className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:["Identifier Value ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"identifierValue",value:$,onChange:e=>Z(e.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:true,"aria-required":"true","aria-invalid":!!d.identifierValue,"aria-describedby":d.identifierValue?"identifierValue-error":void 0}),d.identifierValue&&jsx("p",{id:"identifierValue-error",role:"alert",className:"mt-1 text-sm text-red-500",children:d.identifierValue})]})]})]}),(u==null?void 0:u.requiresAdditionalInfo)&&u.additionalFields&&u.additionalFields.length>0&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsx("div",{className:"space-y-4",children:u.additionalFields.map(e=>{var b,m,k;return jsxs("div",{children:[jsxs("label",{htmlFor:e.id,className:a("block text-sm font-medium mb-1",r==null?void 0:r.label,o),children:[e.label," ",e.required&&jsx("span",{className:"text-red-500",children:"*"})]}),e.type==="text"&&jsx("input",{type:"text",id:e.id,value:String((b=l[e.id])!=null?b:""),onChange:g=>c(e.id,g.target.value),placeholder:e.placeholder,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:e.required,"aria-required":e.required||void 0,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),e.type==="textarea"&&jsx("textarea",{id:e.id,value:String((m=l[e.id])!=null?m:""),onChange:g=>c(e.id,g.target.value),placeholder:e.placeholder,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.textarea,o),rows:4,required:e.required,"aria-required":e.required||void 0,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),e.type==="select"&&e.options&&jsxs("select",{id:e.id,value:String((k=l[e.id])!=null?k:""),onChange:g=>c(e.id,g.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),required:e.required,"aria-required":e.required||void 0,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0,children:[jsx("option",{value:"",children:e.placeholder||"Select an option"}),e.options.map(g=>jsx("option",{value:g,children:g},g))]}),e.type==="checkbox"&&jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{type:"checkbox",id:e.id,checked:!!l[e.id],onChange:g=>c(e.id,g.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",required:e.required,"aria-required":e.required||void 0,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0})}),jsx("div",{className:"ml-3 text-sm",children:jsx("label",{htmlFor:e.id,className:"text-gray-700 dark:text-gray-300",children:e.placeholder||e.label})})]}),e.type==="file"&&jsx("input",{type:"file",id:e.id,onChange:g=>{var K;let v=(K=g.target.files)==null?void 0:K[0];v&&c(e.id,v.name);},className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o),required:e.required,"aria-required":e.required||void 0,"aria-invalid":!!d[`additional_${e.id}`],"aria-describedby":d[`additional_${e.id}`]?`additional-${e.id}-error`:void 0}),d[`additional_${e.id}`]&&jsx("p",{id:`additional-${e.id}-error`,role:"alert",className:"mt-1 text-sm text-red-500",children:d[`additional_${e.id}`]})]},e.id)})})]}),jsxs("div",{className:"mt-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("h3",{className:"text-sm font-semibold mb-2",children:"Privacy Notice"}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300",children:"The information you provide in this form will be used solely for the purpose of processing your data subject request. We will retain this information for as long as necessary to fulfill your request and to comply with our legal obligations. For more information, please refer to our Privacy Policy."})]}),jsxs("div",{className:"mt-6 flex gap-3 relative",children:[x&&(r==null?void 0:r.loadingOverlay)&&jsx("div",{className:r.loadingOverlay}),jsx("button",{type:"submit",disabled:x,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 ${_} ${x?"opacity-50 cursor-not-allowed":""}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:x?"Submitting...":f.submit||rr}),jsx("button",{type:"button",onClick:nr,className: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,o),children:"Reset"})]})]})})]})};export{mr as a};//# sourceMappingURL=chunk-6YN73KR7.mjs.map
2
- //# sourceMappingURL=chunk-6YN73KR7.mjs.map