@tantainnovative/ndpr-toolkit 3.2.1 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -4
- package/dist/{DPIAQuestionnaire-BkejviPj.d.mts → DPIAQuestionnaire-VXBoWFMC.d.ts} +3 -3
- package/dist/{DPIAQuestionnaire-DdSqXG3x.d.ts → DPIAQuestionnaire-jkt1Veb6.d.mts} +3 -3
- package/dist/{DSRRequestForm-BY8PogCU.d.mts → DSRRequestForm-D8rPTNmU.d.ts} +2 -2
- package/dist/{DSRRequestForm-CHUg9cZh.d.ts → DSRRequestForm-DRouEr9j.d.mts} +2 -2
- package/dist/{DSRTracker-Dr_aT0pg.d.ts → DSRTracker-Bl__d4df.d.ts} +1 -1
- package/dist/{DSRTracker-C6u_jAaK.d.mts → DSRTracker-CSVDfgQQ.d.mts} +1 -1
- package/dist/{StepIndicator-D9ZATz_O.d.ts → StepIndicator-CgrlokSV.d.ts} +1 -1
- package/dist/{StepIndicator-D-nwRTyo.d.mts → StepIndicator-W8S_QjgO.d.mts} +1 -1
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-25OOUES4.js +2 -0
- package/dist/chunk-2AW7KAZO.mjs +2 -0
- package/dist/chunk-4JKTIR33.mjs +2 -0
- package/dist/chunk-5BUS6AI7.js +2 -0
- package/dist/chunk-5ECDPRSZ.js +7 -0
- package/dist/chunk-5X32J5IA.mjs +2 -0
- package/dist/chunk-6FGCGLH5.mjs +2 -0
- package/dist/chunk-6YN73KR7.mjs +2 -0
- package/dist/chunk-75TJPK2N.mjs +2 -0
- package/dist/{chunk-NXQMU36Z.mjs → chunk-7D2OIPHH.mjs} +2 -2
- package/dist/chunk-C4YM4UMI.js +2 -0
- package/dist/{chunk-EH2I4L7M.mjs → chunk-CDZDT2OS.mjs} +14 -10
- package/dist/chunk-CYU6YUJQ.mjs +81 -0
- package/dist/chunk-DCJK5OZT.mjs +2 -0
- package/dist/chunk-EKHBORAH.js +81 -0
- package/dist/chunk-ENIMJ6SQ.js +2 -0
- package/dist/chunk-FLKJSGR7.mjs +94 -0
- package/dist/chunk-FWLPJ5YI.js +94 -0
- package/dist/chunk-GMLCWGNJ.js +7 -0
- package/dist/chunk-GXLSOZCH.mjs +2 -0
- package/dist/{chunk-NRQELKAE.js → chunk-JKKRPS4P.js} +2 -2
- package/dist/chunk-LETEUS5X.mjs +2 -0
- package/dist/chunk-M2TPT5GB.js +2 -0
- package/dist/chunk-MCWV7S2G.js +2 -0
- package/dist/chunk-NBSVFQ5G.js +2 -0
- package/dist/chunk-OPYQIJKY.js +2 -0
- package/dist/chunk-OYR3L4XS.mjs +7 -0
- package/dist/chunk-QF6XNKU6.mjs +2 -0
- package/dist/{chunk-256APOQM.js → chunk-QJ3JNHO7.js} +2 -2
- package/dist/{chunk-Q7VHB64E.mjs → chunk-QNCGRCAX.mjs} +2 -2
- package/dist/chunk-TI2M7H6R.mjs +7 -0
- package/dist/{chunk-KVOGOLIR.js → chunk-TXXWCB5O.js} +14 -10
- package/dist/{chunk-44W4H2EY.js → chunk-UGY5ZYUG.js} +2 -2
- package/dist/chunk-UO6QPJLH.js +2 -0
- package/dist/chunk-UX6ZZNEM.mjs +3 -0
- package/dist/chunk-XFUEZ3MP.mjs +2 -0
- package/dist/chunk-XHSHPB74.js +2 -0
- package/dist/chunk-XSEZDQLB.js +2 -0
- package/dist/chunk-YCX6BFOQ.js +2 -0
- package/dist/chunk-YURSF2YO.mjs +2 -0
- package/dist/chunk-YZXUAIYN.js +3 -0
- package/dist/chunk-Z6IIMLZU.mjs +2 -0
- package/dist/chunk-ZT7KNFAU.mjs +2 -0
- package/dist/chunk-ZYLDLGFL.js +2 -0
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +25 -9
- package/dist/core.d.ts +25 -9
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.d.mts +70 -3
- package/dist/cross-border.d.ts +70 -3
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/{dpia-B0Pok5us.d.ts → dpia-D82hUrJe.d.ts} +1 -1
- package/dist/{dpia-CUfOmzvX.d.mts → dpia-DQDFw2_l.d.mts} +1 -1
- package/dist/{dpia-5OQVA1R_.d.mts → dpia-c9GiiOq0.d.mts} +2 -2
- package/dist/{dpia-5OQVA1R_.d.ts → dpia-c9GiiOq0.d.ts} +2 -2
- package/dist/dpia.d.mts +9 -9
- package/dist/dpia.d.ts +9 -9
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/{dsr-D_eTNc4S.d.mts → dsr-CIx5sd7e.d.ts} +2 -2
- package/dist/{dsr-pNtVb1BK.d.ts → dsr-XZ_HqTlA.d.mts} +2 -2
- package/dist/{dsr-Cm9lzWG7.d.mts → dsr-yKbqX531.d.mts} +1 -1
- package/dist/{dsr-Cm9lzWG7.d.ts → dsr-yKbqX531.d.ts} +1 -1
- package/dist/dsr.d.mts +9 -9
- package/dist/dsr.d.ts +9 -9
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +8 -8
- package/dist/hooks.d.ts +8 -8
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/{policy-engine-DSQpT55_.d.ts → policy-engine-C6nC2t3a.d.ts} +1 -1
- package/dist/{policy-engine-C-tShzZH.d.mts → policy-engine-DefZcX3R.d.mts} +1 -1
- package/dist/{policy-sections-CfNVBLCh.d.mts → policy-sections-Bylm31kZ.d.mts} +1 -1
- package/dist/{policy-sections-DqH0iZRf.d.ts → policy-sections-DFDPVCCg.d.ts} +1 -1
- package/dist/policy.d.mts +6 -6
- package/dist/policy.d.ts +6 -6
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets.d.mts +5 -5
- package/dist/presets.d.ts +5 -5
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/{sanitize-9mOO_cJW.d.mts → sanitize-B0AzEm1D.d.mts} +14 -1
- package/dist/{sanitize-9mOO_cJW.d.ts → sanitize-B0AzEm1D.d.ts} +14 -1
- package/dist/{useAdaptivePolicyWizard-N4eUM4Tj.d.mts → useAdaptivePolicyWizard-A1PyOy6P.d.mts} +1 -1
- package/dist/{useAdaptivePolicyWizard-B9Op2gYM.d.ts → useAdaptivePolicyWizard-LVIKhAxw.d.ts} +1 -1
- package/dist/{useCrossBorderTransfer-BGNZt2lk.d.mts → useCrossBorderTransfer-DixjLjN1.d.mts} +1 -1
- package/dist/{useCrossBorderTransfer-COqjgjsu.d.ts → useCrossBorderTransfer-DvSq06lv.d.ts} +1 -1
- package/dist/{useDPIA-DzWye8JB.d.mts → useDPIA-B6180UQn.d.mts} +9 -5
- package/dist/{useDPIA-Dl16Te3r.d.ts → useDPIA-CTqbNbww.d.ts} +9 -5
- package/dist/{useDSR-C1LksCfP.d.mts → useDSR-WvHk8_iu.d.mts} +2 -2
- package/dist/{useDSR-DZel52O1.d.ts → useDSR-wH4H6hSM.d.ts} +2 -2
- package/dist/{useDefaultPrivacyPolicy-C-mG-A5S.d.ts → useDefaultPrivacyPolicy-DvCbeEl1.d.ts} +5 -1
- package/dist/{useDefaultPrivacyPolicy-BsYttRey.d.mts → useDefaultPrivacyPolicy-ySWU7nc-.d.mts} +5 -1
- package/package.json +7 -5
- package/dist/chunk-2FWCVWKN.js +0 -2
- package/dist/chunk-3DJGO6WG.js +0 -2
- package/dist/chunk-3UWT64FI.mjs +0 -2
- package/dist/chunk-4JUDKBA2.mjs +0 -7
- package/dist/chunk-4XCL62MJ.mjs +0 -2
- package/dist/chunk-555WWZ3W.js +0 -2
- package/dist/chunk-6BXUVS6E.js +0 -81
- package/dist/chunk-6RQGQZT2.js +0 -2
- package/dist/chunk-CL53OI3I.js +0 -7
- package/dist/chunk-E63VPR7U.js +0 -2
- package/dist/chunk-ELKEZEV5.mjs +0 -2
- package/dist/chunk-ER7X6E36.js +0 -2
- package/dist/chunk-FDDI426Y.mjs +0 -2
- package/dist/chunk-FOXZRRMW.mjs +0 -2
- package/dist/chunk-FY5G6DGZ.js +0 -7
- package/dist/chunk-GOD4LA2J.mjs +0 -2
- package/dist/chunk-I23WPZNQ.mjs +0 -94
- package/dist/chunk-IQF726GS.js +0 -2
- package/dist/chunk-IR7VCBWV.mjs +0 -2
- package/dist/chunk-K45S6YQV.mjs +0 -2
- package/dist/chunk-KBAFOVE3.js +0 -2
- package/dist/chunk-KBP26GLC.js +0 -2
- package/dist/chunk-MDWG2KDA.mjs +0 -2
- package/dist/chunk-NN233SGA.mjs +0 -3
- package/dist/chunk-NPI5T6NH.mjs +0 -7
- package/dist/chunk-NUDVUAD4.mjs +0 -81
- package/dist/chunk-PM7O5IGE.mjs +0 -2
- package/dist/chunk-QH6YUVJS.js +0 -2
- package/dist/chunk-QKK5S54L.mjs +0 -2
- package/dist/chunk-QY7PD5XB.js +0 -94
- package/dist/chunk-TVW6KBVV.mjs +0 -2
- package/dist/chunk-UDNRAQLE.js +0 -3
- package/dist/chunk-UNKXYVXY.js +0 -2
- package/dist/chunk-V37BM2LF.js +0 -2
- package/dist/chunk-V3MXWGXU.mjs +0 -2
- package/dist/chunk-VK27WVV3.js +0 -2
- package/dist/chunk-XQ4M5FHC.mjs +0 -2
package/dist/chunk-4XCL62MJ.mjs
DELETED
|
@@ -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 pt=({options:d,onSave:W,title:Y="We Value Your Privacy",description:m="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:K="Accept All",rejectAllButtonText:Q="Reject All",customizeButtonText:U="Customize",saveButtonText:X="Save Preferences",position:A="bottom",zIndex:T=9999,version:f="1.0",show:p,manageStorage:R=true,storageKey:E="ndpr_consent",className:Z="",buttonClassName:h="",primaryButtonClassName:q="",secondaryButtonClassName:s="",classNames:t,unstyled:o,onAnalytics:y})=>{let[g,u]=useState(false),[v,a$2]=useState(false),[C,B]=useState({}),[H,N]=useState(false),z=useRef(null),$=useRef(null),j=useRef(false);useEffect(()=>{N(true);},[]);let l=useCallback((e,n)=>{y==null||y(a({action:e,timestamp:Date.now(),version:f},n!==void 0?{categories:n}:{}));},[y,f]);useEffect(()=>{let e={};if(d.forEach(n=>{e[n.id]=n.defaultValue||false;}),B(e),p===void 0)if(!R)u(true);else {let n=localStorage.getItem(E);if(n)try{JSON.parse(n).version!==f?u(!0):u(!1);}catch(L){u(true);}else u(true);}else u(p);},[d,E,f,R]),useEffect(()=>{p!==void 0&&u(p);},[p]);let tt=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),l("accepted_all",e),P(e);},et=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),l("rejected_all",e),P(e);},nt=(e,n)=>{B(L=>b(a({},L),{[e]:n}));},rt=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),B(e);},ot=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),B(e);},_=d.length>0&&d.every(e=>C[e.id]),it=()=>{l("customized",C),P(C);},P=e=>{let n={consents:e,timestamp:Date.now(),version:f,method:v?"customize":"banner",hasInteracted:true};R&&localStorage.setItem(E,JSON.stringify(n)),W(n),u(false),a$2(false);},M=useCallback(()=>{l("dismissed"),u(false),a$2(false);},[l]);if(useEffect(()=>{if(!g)return;let e=n=>{n.key==="Escape"&&M();};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[g,M]),useEffect(()=>{g&&!j.current&&(j.current=true,l("shown")),g||(j.current=false);},[g,l]),useEffect(()=>{g&&z.current&&z.current.focus();},[g]),useEffect(()=>{if(v&&$.current){let e=$.current;e.style.maxHeight="0px",e.style.opacity="0",e.offsetHeight,e.style.maxHeight=`${e.scrollHeight}px`,e.style.opacity="1";}},[v]),!g)return null;let dt=(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))] ${h} ${q}`,F=(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 ${h} ${s}`,ut=(t==null?void 0:t.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${h}`,gt=(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))] ${h} ${q}`,k=A==="inline",w=A==="center",x;k||w?x="":A==="top"?x="fixed inset-x-0 top-0":x="fixed inset-x-0 bottom-0";let D=jsx("div",{ref:z,tabIndex:-1,"data-ndpr-component":"consent-banner",className:a$1(`${k?"":x} bg-white dark:bg-gray-800 shadow-lg p-3 sm:p-4 border border-gray-200 dark:border-gray-700 ${w?"max-w-lg w-full":""} ${Z}`,t==null?void 0:t.root,o),style:!k&&!w?{zIndex:T}:void 0,role:"dialog","aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children: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:Y}),jsx("p",{id:"consent-banner-description",className:a$1("text-sm sm:text-base mb-4",t==null?void 0:t.description,o),children:m}),v&&jsxs("div",{ref:$,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:_?ot:rt,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:C[e.id]||false,onChange:n=>nt(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:it,className:a$1(gt,t==null?void 0:t.saveButton,o),children:X}),jsx("button",{onClick:()=>a$2(false),className:a$1(F,t==null?void 0:t.rejectButton,o),children:"Back"})]})]}),!v&&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:tt,className:a$1(dt,t==null?void 0:t.acceptButton,o),children:K}),jsx("button",{onClick:et,className:a$1(F,t==null?void 0:t.rejectButton,o),children:Q}),jsx("button",{onClick:()=>a$2(true),className:a$1(ut,t==null?void 0:t.customizeButton,o),children:U})]}),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(k)return D;if(w){let e=jsxs("div",{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:T},children:[jsx("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),jsx("div",{className:"relative",children:D})]});return H?createPortal(e,document.body):null}return H?createPortal(D,document.body):null};export{pt as a};//# sourceMappingURL=chunk-4XCL62MJ.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-4XCL62MJ.mjs.map
|
package/dist/chunk-555WWZ3W.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),reactDom=require('react-dom'),jsxRuntime=require('react/jsx-runtime');var pt=({options:d,onSave:W,title:Y="We Value Your Privacy",description:m="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:K="Accept All",rejectAllButtonText:Q="Reject All",customizeButtonText:U="Customize",saveButtonText:X="Save Preferences",position:A="bottom",zIndex:T=9999,version:f="1.0",show:p,manageStorage:R=true,storageKey:E="ndpr_consent",className:Z="",buttonClassName:h="",primaryButtonClassName:q="",secondaryButtonClassName:s="",classNames:t,unstyled:o,onAnalytics:y})=>{let[g,u]=react.useState(false),[v,a]=react.useState(false),[C,B]=react.useState({}),[H,N]=react.useState(false),z=react.useRef(null),$=react.useRef(null),j=react.useRef(false);react.useEffect(()=>{N(true);},[]);let l=react.useCallback((e,n)=>{y==null||y(chunkMQFZHA2D_js.a({action:e,timestamp:Date.now(),version:f},n!==void 0?{categories:n}:{}));},[y,f]);react.useEffect(()=>{let e={};if(d.forEach(n=>{e[n.id]=n.defaultValue||false;}),B(e),p===void 0)if(!R)u(true);else {let n=localStorage.getItem(E);if(n)try{JSON.parse(n).version!==f?u(!0):u(!1);}catch(L){u(true);}else u(true);}else u(p);},[d,E,f,R]),react.useEffect(()=>{p!==void 0&&u(p);},[p]);let tt=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),l("accepted_all",e),P(e);},et=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),l("rejected_all",e),P(e);},nt=(e,n)=>{B(L=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},L),{[e]:n}));},rt=()=>{let e={};d.forEach(n=>{e[n.id]=true;}),B(e);},ot=()=>{let e={};d.forEach(n=>{e[n.id]=n.required||false;}),B(e);},_=d.length>0&&d.every(e=>C[e.id]),it=()=>{l("customized",C),P(C);},P=e=>{let n={consents:e,timestamp:Date.now(),version:f,method:v?"customize":"banner",hasInteracted:true};R&&localStorage.setItem(E,JSON.stringify(n)),W(n),u(false),a(false);},M=react.useCallback(()=>{l("dismissed"),u(false),a(false);},[l]);if(react.useEffect(()=>{if(!g)return;let e=n=>{n.key==="Escape"&&M();};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[g,M]),react.useEffect(()=>{g&&!j.current&&(j.current=true,l("shown")),g||(j.current=false);},[g,l]),react.useEffect(()=>{g&&z.current&&z.current.focus();},[g]),react.useEffect(()=>{if(v&&$.current){let e=$.current;e.style.maxHeight="0px",e.style.opacity="0",e.offsetHeight,e.style.maxHeight=`${e.scrollHeight}px`,e.style.opacity="1";}},[v]),!g)return null;let dt=(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))] ${h} ${q}`,F=(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 ${h} ${s}`,ut=(t==null?void 0:t.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${h}`,gt=(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))] ${h} ${q}`,k=A==="inline",w=A==="center",x;k||w?x="":A==="top"?x="fixed inset-x-0 top-0":x="fixed inset-x-0 bottom-0";let D=jsxRuntime.jsx("div",{ref:z,tabIndex:-1,"data-ndpr-component":"consent-banner",className:chunkE64TU6IU_js.a(`${k?"":x} bg-white dark:bg-gray-800 shadow-lg p-3 sm:p-4 border border-gray-200 dark:border-gray-700 ${w?"max-w-lg w-full":""} ${Z}`,t==null?void 0:t.root,o),style:!k&&!w?{zIndex:T}:void 0,role:"dialog","aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("max-w-6xl mx-auto",t==null?void 0:t.container,o),children:[jsxRuntime.jsx("h2",{id:"consent-banner-title",className:chunkE64TU6IU_js.a("text-lg font-bold mb-2",t==null?void 0:t.title,o),children:Y}),jsxRuntime.jsx("p",{id:"consent-banner-description",className:chunkE64TU6IU_js.a("text-sm sm:text-base mb-4",t==null?void 0:t.description,o),children:m}),v&&jsxRuntime.jsxs("div",{ref:$,className:chunkE64TU6IU_js.a("mb-4 p-3 sm:p-4 rounded-md border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/50",t==null?void 0:t.customizePanel,o),style:{overflow:"hidden",transition:"max-height 0.3s ease-out, opacity 0.3s ease-out"},children:[jsxRuntime.jsx("div",{className:"mb-3 flex items-center justify-end",children:jsxRuntime.jsx("button",{type:"button",onClick:_?ot:rt,className:chunkE64TU6IU_js.a("text-sm font-medium text-[rgb(var(--ndpr-primary))] hover:underline",t==null?void 0:t.selectAllButton,o),children:_?"Deselect All":"Select All"})}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-3",t==null?void 0:t.optionsList,o),children:d.map(e=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start",t==null?void 0:t.optionItem,o),children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:`consent-${e.id}`,type:"checkbox",checked:C[e.id]||false,onChange:n=>nt(e.id,n.target.checked),disabled:e.required,className:chunkE64TU6IU_js.a("h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",t==null?void 0:t.optionCheckbox,o)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:`consent-${e.id}`,className:chunkE64TU6IU_js.a("font-medium",t==null?void 0:t.optionLabel,o),children:[e.label," ",e.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-400",t==null?void 0:t.optionDescription,o),children:e.description})]})]},e.id))}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-4 flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:it,className:chunkE64TU6IU_js.a(gt,t==null?void 0:t.saveButton,o),children:X}),jsxRuntime.jsx("button",{onClick:()=>a(false),className:chunkE64TU6IU_js.a(F,t==null?void 0:t.rejectButton,o),children:"Back"})]})]}),!v&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col sm:flex-row flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:tt,className:chunkE64TU6IU_js.a(dt,t==null?void 0:t.acceptButton,o),children:K}),jsxRuntime.jsx("button",{onClick:et,className:chunkE64TU6IU_js.a(F,t==null?void 0:t.rejectButton,o),children:Q}),jsxRuntime.jsx("button",{onClick:()=>a(true),className:chunkE64TU6IU_js.a(ut,t==null?void 0:t.customizeButton,o),children:U})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("mt-2 text-xs text-gray-600 dark:text-gray-400",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(k)return D;if(w){let e=jsxRuntime.jsxs("div",{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:T},children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"relative",children:D})]});return H?reactDom.createPortal(e,document.body):null}return H?reactDom.createPortal(D,document.body):null};exports.a=pt;//# sourceMappingURL=chunk-555WWZ3W.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-555WWZ3W.js.map
|
package/dist/chunk-6BXUVS6E.js
DELETED
|
@@ -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,"&").replace(/</g,"<").replace(/>/g,">")}</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
|
package/dist/chunk-6RQGQZT2.js
DELETED
|
@@ -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
|
package/dist/chunk-CL53OI3I.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkIQF726GS_js=require('./chunk-IQF726GS.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var M=[{value:"adequacy_decision",label:"Adequacy Decision (Section 41)"},{value:"standard_clauses",label:"Standard Contractual Clauses (Section 42)"},{value:"binding_corporate_rules",label:"Binding Corporate Rules (Section 43)"},{value:"ndpc_authorization",label:"NDPC Authorization (Section 44)"},{value:"explicit_consent",label:"Explicit Consent (Section 45(a))"},{value:"contract_performance",label:"Contract Performance (Section 45(b))"},{value:"public_interest",label:"Public Interest (Section 45(c))"},{value:"legal_claims",label:"Legal Claims (Section 45(d))"},{value:"vital_interests",label:"Vital Interests (Section 45(e))"}],H=[{value:"adequate",label:"Adequate"},{value:"inadequate",label:"Inadequate"},{value:"pending_review",label:"Pending Review"},{value:"unknown",label:"Unknown"}],Y=[{value:"one_time",label:"One-Time"},{value:"periodic",label:"Periodic"},{value:"continuous",label:"Continuous"}],Q=[{value:"active",label:"Active"},{value:"suspended",label:"Suspended"},{value:"terminated",label:"Terminated"},{value:"pending_approval",label:"Pending Approval"}],W={destinationCountry:"",destinationCountryCode:"",adequacyStatus:"unknown",transferMechanism:"adequacy_decision",dataCategories:"",includesSensitiveData:false,estimatedDataSubjects:"",recipientOrganization:"",recipientContactName:"",recipientContactEmail:"",recipientContactPhone:"",recipientContactAddress:"",purpose:"",safeguards:"",riskAssessment:"",riskLevel:"medium",frequency:"one_time",status:"active",tiaCompleted:false,tiaReference:"",ndpcApprovalApplied:false,ndpcApprovalApproved:false,ndpcApprovalReference:""},xe=({transfers:c,onAddTransfer:P,onUpdateTransfer:F,onRemoveTransfer:B,summary:G,title:K="Cross-Border Data Transfer Manager",description:J="Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VI (Sections 41-45).",className:X="",buttonClassName:T="",showSummary:Z=true,showTIA:ee=true,classNames:r,unstyled:o})=>{let[v,D]=react.useState(null),[I,x]=react.useState(false),[y,O]=react.useState(null),[i,R]=react.useState(W),[f,_]=react.useState(null),[C,te]=react.useState("all"),[A,re]=react.useState("all"),[k,ae]=react.useState(c);react.useEffect(()=>{let t=[...c];C!=="all"&&(t=t.filter(a=>a.status===C)),A!=="all"&&(t=t.filter(a=>a.transferMechanism===A)),t.sort((a,l)=>l.updatedAt-a.updatedAt),ae(t);},[c,C,A]),react.useEffect(()=>{k.length>0&&!v&&D(k[0].id);},[k,v]);let j=v?c.find(t=>t.id===v):null,h=t=>new Date(t).toLocaleDateString(),w=()=>{R(W),O(null),_(null);},ne=()=>{w(),x(true);},ie=t=>{var a,l,u,b;O(t.id),R({destinationCountry:t.destinationCountry,destinationCountryCode:t.destinationCountryCode||"",adequacyStatus:t.adequacyStatus,transferMechanism:t.transferMechanism,dataCategories:t.dataCategories.join(", "),includesSensitiveData:t.includesSensitiveData,estimatedDataSubjects:((a=t.estimatedDataSubjects)==null?void 0:a.toString())||"",recipientOrganization:t.recipientOrganization,recipientContactName:t.recipientContact.name,recipientContactEmail:t.recipientContact.email,recipientContactPhone:t.recipientContact.phone||"",recipientContactAddress:t.recipientContact.address||"",purpose:t.purpose,safeguards:t.safeguards.join(`
|
|
2
|
-
`),riskAssessment:t.riskAssessment,riskLevel:t.riskLevel,frequency:t.frequency,status:t.status,tiaCompleted:t.tiaCompleted,tiaReference:t.tiaReference||"",ndpcApprovalApplied:((l=t.ndpcApproval)==null?void 0:l.applied)||false,ndpcApprovalApproved:((u=t.ndpcApproval)==null?void 0:u.approved)||false,ndpcApprovalReference:((b=t.ndpcApproval)==null?void 0:b.referenceNumber)||""}),x(true);},p=(t,a)=>{R(l=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},l),{[t]:a}));},de=()=>{let t=chunkIQF726GS_js.a(i.transferMechanism),a=Date.now();return {destinationCountry:i.destinationCountry.trim(),destinationCountryCode:i.destinationCountryCode.trim()||void 0,adequacyStatus:i.adequacyStatus,transferMechanism:i.transferMechanism,dataCategories:i.dataCategories.split(",").map(l=>l.trim()).filter(Boolean),includesSensitiveData:i.includesSensitiveData,estimatedDataSubjects:i.estimatedDataSubjects?parseInt(i.estimatedDataSubjects,10):void 0,recipientOrganization:i.recipientOrganization.trim(),recipientContact:{name:i.recipientContactName.trim(),email:i.recipientContactEmail.trim(),phone:i.recipientContactPhone.trim()||void 0,address:i.recipientContactAddress.trim()||void 0},purpose:i.purpose.trim(),safeguards:i.safeguards.split(`
|
|
3
|
-
`).map(l=>l.trim()).filter(Boolean),riskAssessment:i.riskAssessment.trim(),riskLevel:i.riskLevel,frequency:i.frequency,status:t&&!i.ndpcApprovalApproved?"pending_approval":i.status,tiaCompleted:i.tiaCompleted,tiaReference:i.tiaReference.trim()||void 0,ndpcApproval:t?{required:true,applied:i.ndpcApprovalApplied,approved:i.ndpcApprovalApproved||void 0,referenceNumber:i.ndpcApprovalReference.trim()||void 0,appliedAt:i.ndpcApprovalApplied?a:void 0,approvedAt:i.ndpcApprovalApproved?a:void 0}:void 0,startDate:a,reviewDate:a+365*24*60*60*1e3}},oe=()=>{let t=de(),a=chunkMQFZHA2D_js.a({id:y||"temp",createdAt:Date.now(),updatedAt:Date.now()},t),l=chunkIQF726GS_js.c(a);_(l),l.isValid&&(y?F&&F(y,t):P&&P(t),w(),x(false));},le=t=>{B&&B(t),v===t&&D(null);},E=t=>jsxRuntime.jsxs("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-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[t]}`,r==null?void 0:r.riskBadge,o),children:[t.charAt(0).toUpperCase()+t.slice(1)," Risk"]}),L=t=>{let a={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",suspended:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",terminated:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",pending_approval:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200"},l={active:"Active",suspended:"Suspended",terminated:"Terminated",pending_approval:"Pending Approval"};return jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${a[t]}`,r==null?void 0:r.statusBadge,o),children:l[t]})},pe=t=>{var u;let a=chunkIQF726GS_js.a(t),l=((u=M.find(b=>b.value===t))==null?void 0:u.label)||t;return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${a?"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200":"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200"}`,children:l})},se=()=>{let t=G||{totalActiveTransfers:c.filter(a=>a.status==="active").length,pendingApproval:c.filter(a=>{var l,u;return a.status==="pending_approval"||((l=a.ndpcApproval)==null?void 0:l.required)&&!((u=a.ndpcApproval)!=null&&u.approved)}),highRiskTransfers:c.filter(a=>a.riskLevel==="high"&&a.status==="active"),missingTIA:c.filter(a=>!a.tiaCompleted&&a.status==="active")};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",r==null?void 0:r.summary,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200",children:t.totalActiveTransfers}),jsxRuntime.jsx("p",{className:"text-sm text-blue-600 dark:text-blue-300",children:"Active Transfers"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-800 dark:text-purple-200",children:t.pendingApproval.length}),jsxRuntime.jsx("p",{className:"text-sm text-purple-600 dark:text-purple-300",children:"Pending Approval"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-red-800 dark:text-red-200",children:t.highRiskTransfers.length}),jsxRuntime.jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"High Risk"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-yellow-800 dark:text-yellow-200",children:t.missingTIA.length}),jsxRuntime.jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-300",children:"Missing TIA"})]})]})},ue=()=>{let t=chunkIQF726GS_js.a(i.transferMechanism);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-gray-50 dark:bg-gray-700 p-6 rounded-lg mb-6",r==null?void 0:r.form,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex justify-between items-center mb-4",r==null?void 0:r.header,o),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:y?"Edit Transfer":"Add New Transfer"}),jsxRuntime.jsx("button",{onClick:()=>{w(),x(false);},className:"text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:"Cancel"})]}),f&&!f.isValid&&jsxRuntime.jsxs("div",{className:"mb-4 bg-red-50 dark:bg-red-900/20 p-3 rounded-md",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 text-sm text-red-700 dark:text-red-300",children:f.errors.map((a,l)=>jsxRuntime.jsx("li",{children:a},l))})]}),f&&f.warnings.length>0&&jsxRuntime.jsxs("div",{className:"mb-4 bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-1",children:"Warnings:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-yellow-700 dark:text-yellow-300",children:f.warnings.map((a,l)=>jsxRuntime.jsx("li",{children:a},l))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Destination Country ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",value:i.destinationCountry,onChange:a=>p("destinationCountry",a.target.value),placeholder:"e.g. United Kingdom",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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Country Code (ISO)"}),jsxRuntime.jsx("input",{type:"text",value:i.destinationCountryCode,onChange:a=>p("destinationCountryCode",a.target.value),placeholder:"e.g. GB",maxLength:3,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Organization ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",value:i.recipientOrganization,onChange:a=>p("recipientOrganization",a.target.value),placeholder:"Organization name",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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Transfer Mechanism ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("select",{value:i.transferMechanism,onChange:a=>p("transferMechanism",a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:M.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Adequacy Status"}),jsxRuntime.jsx("select",{value:i.adequacyStatus,onChange:a=>p("adequacyStatus",a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:H.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Risk Level"}),jsxRuntime.jsxs("select",{value:i.riskLevel,onChange:a=>p("riskLevel",a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"low",children:"Low"}),jsxRuntime.jsx("option",{value:"medium",children:"Medium"}),jsxRuntime.jsx("option",{value:"high",children:"High"})]})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Data Categories ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",value:i.dataCategories,onChange:a=>p("dataCategories",a.target.value),placeholder:"Comma-separated, e.g. Names, Email addresses, Phone numbers",className: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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"includesSensitiveData",checked:i.includesSensitiveData,onChange:a=>p("includesSensitiveData",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"includesSensitiveData",className:"text-sm font-medium",children:"Includes sensitive personal data"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Estimated Data Subjects"}),jsxRuntime.jsx("input",{type:"number",value:i.estimatedDataSubjects,onChange:a=>p("estimatedDataSubjects",a.target.value),placeholder:"Number of data subjects",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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Contact Name ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",value:i.recipientContactName,onChange:a=>p("recipientContactName",a.target.value),placeholder:"Contact person name",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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Contact Email ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",value:i.recipientContactEmail,onChange:a=>p("recipientContactEmail",a.target.value),placeholder:"contact@example.com",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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Recipient Contact Phone"}),jsxRuntime.jsx("input",{type:"text",value:i.recipientContactPhone,onChange:a=>p("recipientContactPhone",a.target.value),placeholder:"Phone number",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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Recipient Contact Address"}),jsxRuntime.jsx("input",{type:"text",value:i.recipientContactAddress,onChange:a=>p("recipientContactAddress",a.target.value),placeholder:"Address",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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Purpose of Transfer ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{value:i.purpose,onChange:a=>p("purpose",a.target.value),placeholder:"Describe the purpose of this data transfer",rows:2,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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Safeguards ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{value:i.safeguards,onChange:a=>p("safeguards",a.target.value),placeholder:`One safeguard per line, e.g.
|
|
4
|
-
End-to-end encryption
|
|
5
|
-
Access control policies
|
|
6
|
-
Regular security audits`,rows:3,className: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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Risk Assessment Summary ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{value:i.riskAssessment,onChange:a=>p("riskAssessment",a.target.value),placeholder:"Summarize the risk assessment for this transfer",rows:2,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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Transfer Frequency"}),jsxRuntime.jsx("select",{value:i.frequency,onChange:a=>p("frequency",a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:Y.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Status"}),jsxRuntime.jsx("select",{value:i.status,onChange:a=>p("status",a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:Q.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]})]}),t&&jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-blue-800 dark:text-blue-200 mb-3",children:"NDPC Approval Required"}),jsxRuntime.jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300 mb-3",children:"The selected transfer mechanism requires approval from the Nigeria Data Protection Commission."}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"ndpcApprovalApplied",checked:i.ndpcApprovalApplied,onChange:a=>p("ndpcApprovalApplied",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"ndpcApprovalApplied",className:"text-sm",children:"Application submitted"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"ndpcApprovalApproved",checked:i.ndpcApprovalApproved,onChange:a=>p("ndpcApprovalApproved",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"ndpcApprovalApproved",className:"text-sm",children:"Approval granted"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"NDPC Reference Number"}),jsxRuntime.jsx("input",{type:"text",value:i.ndpcApprovalReference,onChange:a=>p("ndpcApprovalReference",a.target.value),placeholder:"Reference number (if available)",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))]",r==null?void 0:r.input,o)})]})]})]}),ee&&jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-gray-100 dark:bg-gray-600 rounded-md",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium mb-3",children:"Transfer Impact Assessment"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"tiaCompleted",checked:i.tiaCompleted,onChange:a=>p("tiaCompleted",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"tiaCompleted",className:"text-sm",children:"TIA completed"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"TIA Reference"}),jsxRuntime.jsx("input",{type:"text",value:i.tiaReference,onChange:a=>p("tiaReference",a.target.value),placeholder:"Document reference",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))]",r==null?void 0:r.input,o)})]})]})]}),jsxRuntime.jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[jsxRuntime.jsx("button",{onClick:()=>{w(),x(false);},className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:oe,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:y?"Update Transfer":"Add Transfer"})]})]})},me=t=>{var u,b;let a=chunkIQF726GS_js.d(t),l=chunkIQF726GS_js.c(t);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",r==null?void 0:r.detailPanel,o),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsxs("h3",{className:"text-lg font-medium",children:[t.destinationCountry," \u2014 ",t.recipientOrganization]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[L(t.status),E(t.riskLevel)]})]}),!l.isValid&&jsxRuntime.jsxs("div",{className:"mb-4 bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Compliance Issues"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-red-700 dark:text-red-300",children:l.errors.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]}),l.warnings.length>0&&jsxRuntime.jsxs("div",{className:"mb-4 bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-1",children:"Warnings"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-yellow-700 dark:text-yellow-300",children:l.warnings.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Destination:"})," ",t.destinationCountry,t.destinationCountryCode?` (${t.destinationCountryCode})`:""]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Adequacy:"})," ",(u=H.find(s=>s.value===t.adequacyStatus))==null?void 0:u.label]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Frequency:"})," ",(b=Y.find(s=>s.value===t.frequency))==null?void 0:b.label]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Start Date:"})," ",h(t.startDate)]}),t.endDate&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"End Date:"})," ",h(t.endDate)]}),t.reviewDate&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next Review:"})," ",h(t.reviewDate)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Recipient:"})," ",t.recipientOrganization]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Contact:"})," ",t.recipientContact.name," (",t.recipientContact.email,")"]}),t.estimatedDataSubjects&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subjects:"})," ",t.estimatedDataSubjects.toLocaleString()]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",t.includesSensitiveData?"Yes":"No"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Transfer Mechanism"}),jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:chunkIQF726GS_js.b(t.transferMechanism)})})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Purpose"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md",children:t.purpose})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Data Categories"}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:t.dataCategories.map((s,m)=>jsxRuntime.jsx("span",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-600 rounded text-xs",children:s},m))})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Safeguards"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-gray-600 dark:text-gray-300",children:t.safeguards.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Risk Assessment"}),jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200 mb-2",children:t.riskAssessment}),jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsxs("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:["Automated Assessment (Score: ",a.riskScore,")"]}),a.factors.length>0&&jsxRuntime.jsx("ul",{className:"list-disc list-inside text-xs text-gray-600 dark:text-gray-400",children:a.factors.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))}),a.recommendations.length>0&&jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Recommendations:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-xs text-gray-600 dark:text-gray-400",children:a.recommendations.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]})]})]})]}),t.ndpcApproval&&jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"NDPC Approval"}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md ${t.ndpcApproval.approved?"bg-green-50 dark:bg-green-900/20":t.ndpcApproval.applied?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20"}`,r==null?void 0:r.approvalStatus,o),children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",t.ndpcApproval.approved?"Approved":t.ndpcApproval.applied?"Application Submitted":"Not Applied"]}),t.ndpcApproval.referenceNumber&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference:"})," ",t.ndpcApproval.referenceNumber]}),t.ndpcApproval.appliedAt&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Applied:"})," ",h(t.ndpcApproval.appliedAt)]}),t.ndpcApproval.approvedAt&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Approved:"})," ",h(t.ndpcApproval.approvedAt)]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Transfer Impact Assessment"}),jsxRuntime.jsxs("div",{className:`p-3 rounded-md ${t.tiaCompleted?"bg-green-50 dark:bg-green-900/20":"bg-yellow-50 dark:bg-yellow-900/20"}`,children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",t.tiaCompleted?"Completed":"Not Completed"]}),t.tiaReference&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference:"})," ",t.tiaReference]})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-3 mt-6",children:[jsxRuntime.jsx("button",{onClick:()=>ie(t),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,children:"Edit"}),jsxRuntime.jsx("button",{onClick:()=>le(t.id),className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",children:"Remove"})]})]})};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${X}`,r==null?void 0:r.root,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",r==null?void 0:r.title,o),children:K}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:J}),Z&&se(),!I&&jsxRuntime.jsx("div",{className:"mb-6",children:jsxRuntime.jsx("button",{onClick:ne,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Add Transfer"})}),I&&ue(),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cbStatusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxRuntime.jsxs("select",{id:"cbStatusFilter",value:C,onChange:t=>te(t.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),Q.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cbMechanismFilter",className:"block text-sm font-medium mb-1",children:"Mechanism Filter"}),jsxRuntime.jsxs("select",{id:"cbMechanismFilter",value:A,onChange:t=>re(t.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Mechanisms"}),M.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))]})]})]}),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:"Transfers"}),k.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No cross-border transfers found."}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",r==null?void 0:r.transferList,o),children:k.map(t=>{var a,l;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md cursor-pointer ${v===t.id?"bg-[rgb(var(--ndpr-primary)/0.05)] dark:bg-[rgb(var(--ndpr-primary)/0.1)] border border-[rgb(var(--ndpr-primary)/0.2)] dark:border-[rgb(var(--ndpr-primary)/0.3)]":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,r==null?void 0:r.transferItem,o),onClick:()=>D(t.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:t.destinationCountry}),E(t.riskLevel)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:t.recipientOrganization}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:pe(t.transferMechanism)}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[L(t.status),((a=t.ndpcApproval)==null?void 0:a.required)&&!((l=t.ndpcApproval)!=null&&l.approved)&&jsxRuntime.jsx("span",{className:"text-xs text-purple-600 dark:text-purple-400",children:"NDPC Pending"})]})]},t.id)})})]}),jsxRuntime.jsx("div",{className:"md:col-span-2",children:j?me(j):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 transfer to view details"})})})]})]})};exports.a=xe;//# sourceMappingURL=chunk-CL53OI3I.js.map
|
|
7
|
-
//# sourceMappingURL=chunk-CL53OI3I.js.map
|
package/dist/chunk-E63VPR7U.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkUXMGBIX6_js=require('./chunk-UXMGBIX6.js'),chunkELKB2AFZ_js=require('./chunk-ELKB2AFZ.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function j(d,a){return a?chunkELKB2AFZ_js.a(d):{load:()=>null,save:()=>{},remove:()=>{}}}function E({templates:d,initialPolicy:a,adapter:g,storageKey:I="ndpr_privacy_policy",useLocalStorage:h=true,onGenerate:v}){let f=g!=null?g:j(I,h),p=react.useRef(f);p.current=f;let[o,m]=react.useState(a||null),[l,P]=react.useState(null),[y,O]=react.useState({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),[D,b]=react.useState(true),S=react.useRef(d);S.current=d,react.useEffect(()=>{if(a){b(false);return}let e=false;try{let n=p.current.load(),t=i=>{if(i){if(m(i),i.templateId){let c=S.current.find(u=>u.id===i.templateId);c&&P(c);}i.organizationInfo&&O(i.organizationInfo);}b(!1);};n instanceof Promise?n.then(i=>{e||t(i);},()=>{e||b(!1);}):t(n);}catch(n){e||b(false);}return ()=>{e=true;}},[a]);let q=e=>{Promise.resolve(p.current.save(e)).catch(n=>{console.warn("[ndpr-toolkit] Failed to save policy:",n);});},N=e=>{let n=d.find(u=>u.id===e);if(!n)return false;P(n);let t=n.sections.map(u=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{customContent:void 0})),i={};Object.keys(n.variables).forEach(u=>{i[u]=n.variables[u].defaultValue||"";});let c=Date.now();return m({id:"policy_"+c+"_"+Math.random().toString(36).substr(2,9),title:"",templateId:n.id,organizationInfo:y,sections:t,variableValues:i,effectiveDate:c,lastUpdated:c,version:"1.0"}),true},R=e=>{O(n=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},n),e));},U=(e,n)=>{l&&(o?m(t=>t&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{sections:t.sections.map(i=>i.id===e?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{included:n}):i)})):P(t=>t&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{sections:t.sections.map(i=>i.id===e?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{included:n}):i)})));},C=(e,n)=>{l&&(o?m(t=>t&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{sections:t.sections.map(i=>i.id===e?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{customContent:n}):i)})):P(t=>t&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{sections:t.sections.map(i=>i.id===e?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{customContent:n}):i)})));},A=(e,n)=>{o&&m(t=>t&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{variableValues:chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t.variableValues),{[e]:n})}));},L=()=>"policy_"+Date.now()+"_"+Math.random().toString(36).substr(2,9);return {policy:o,selectedTemplate:l,organizationInfo:y,selectTemplate:N,updateOrganizationInfo:R,toggleSection:U,updateSectionContent:C,updateVariableValue:A,generatePolicy:()=>{if(!l)throw new Error("No template selected");let e=Date.now(),n={id:(o==null?void 0:o.id)||L(),title:`Privacy Policy for ${y.name}`,templateId:l.id,organizationInfo:y,sections:l.sections.map(t=>{var i;return chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{customContent:(i=o==null?void 0:o.sections.find(c=>c.id===t.id))==null?void 0:i.customContent})}),variableValues:(o==null?void 0:o.variableValues)||{},effectiveDate:e,lastUpdated:e,version:"1.0"};return m(n),q(n),v&&v(n),n},getPolicyText:()=>{if(!o)return {fullText:"",sectionTexts:{},missingVariables:[]};let e=chunkUXMGBIX6_js.a(o.sections,o.organizationInfo);return typeof e=="string"?{fullText:e,sectionTexts:{full:e},missingVariables:[]}:e},resetPolicy:()=>{m(null),P(null),O({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),Promise.resolve(p.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove policy:",e);});},isValid:()=>{let e=[];if(l||e.push("No template selected"),y.name||e.push("Organization name is required"),y.website||e.push("Organization website is required"),y.privacyEmail||e.push("Privacy contact email is required"),l){let n=l.sections.filter(i=>i.required),t=(o==null?void 0:o.sections.filter(i=>i.included))||[];n.forEach(i=>{t.some(c=>c.id===i.id)||e.push(`Required section "${i.title}" must be included`);});}return l&&o&&Object.entries(l.variables).forEach(([n,t])=>{t.required&&!o.variableValues[n]&&e.push(`Required variable "${t.name}" must have a value`);}),{valid:e.length===0,errors:e}},isLoading:D}}function X(d={}){let{orgInfo:a,storageKey:g,useLocalStorage:I}=d,{sections:h,variables:v}=chunkUXMGBIX6_js.d(),f={};a&&(a.name&&(f.orgName=a.name),a.email&&(f.privacyEmail=a.email),a.dpoName&&(f.dpoName=a.dpoName));let p={id:"default-business",name:"Default Business Policy",description:"NDPA-compliant privacy policy template for businesses.",organizationType:"business",sections:h,variables:Object.fromEntries(v.map(o=>[o.name,{name:o.name,description:o.description,required:o.required,defaultValue:f[o.name]||o.value||void 0}])),version:"1.0",lastUpdated:Date.now(),ndpaCompliant:true};return E({templates:[p],storageKey:g,useLocalStorage:I})}exports.a=E;exports.b=X;//# sourceMappingURL=chunk-E63VPR7U.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-E63VPR7U.js.map
|
package/dist/chunk-ELKEZEV5.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {d,c,b as b$1,a as a$2}from'./chunk-TXBZPCGF.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var F={name:"",description:"",lawfulBasis:"consent",lawfulBasisJustification:"",dataCategories:"",involvesSensitiveData:false,sensitiveDataCondition:"",dataSubjectCategories:"",purposes:"",retentionPeriod:"",retentionJustification:"",recipients:"",crossBorderTransfer:false,reviewDate:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""},H=[{value:"consent",label:"Consent"},{value:"contract",label:"Contract"},{value:"legal_obligation",label:"Legal Obligation"},{value:"vital_interests",label:"Vital Interests"},{value:"public_interest",label:"Public Interest"},{value:"legitimate_interests",label:"Legitimate Interests"}],Y=[{value:"explicit_consent",label:"Explicit Consent"},{value:"employment_law",label:"Employment Law"},{value:"vital_interests_incapable",label:"Vital Interests (Incapable)"},{value:"nonprofit_legitimate",label:"Nonprofit Legitimate Activities"},{value:"publicly_available",label:"Publicly Available Data"},{value:"legal_claims",label:"Legal Claims"},{value:"substantial_public_interest",label:"Substantial Public Interest"},{value:"health_purposes",label:"Health Purposes"},{value:"public_health",label:"Public Health"},{value:"archiving_research",label:"Archiving / Research"}],fe=({activities:b$2,onAddActivity:_,onUpdateActivity:j,onArchiveActivity:I,title:W="Lawful Basis Tracker",description:q="Document and track the lawful basis for each processing activity as required by NDPA 2023 Section 25.",className:z="",buttonClassName:f="",showSummary:K=true,showComplianceGaps:Q=true,classNames:r,unstyled:o})=>{let[y,m]=useState("list"),[a$3,p]=useState(F),[h,S]=useState(null),[J,X]=useState(null),[k,Z]=useState("all"),[C,ee]=useState("all"),[A,te]=useState(""),[R,x]=useState([]),[N,re]=useState(b$2);useEffect(()=>{let t=[...b$2];if(k!=="all"&&(t=t.filter(l=>l.status===k)),C!=="all"&&(t=t.filter(l=>l.lawfulBasis===C)),A){let l=A.toLowerCase();t=t.filter(s=>s.name.toLowerCase().includes(l)||s.description.toLowerCase().includes(l)||s.purposes.some(v=>v.toLowerCase().includes(l)));}t.sort((l,s)=>s.updatedAt-l.updatedAt),re(t);},[b$2,k,C,A]);let w=t=>new Date(t).toLocaleDateString(),D=d(b$2),P=c(b$2),B=t=>t.split(",").map(l=>l.trim()).filter(l=>l.length>0),ie=()=>{p(F),S(null),x([]),m("form");},E=t=>{p({name:t.name,description:t.description,lawfulBasis:t.lawfulBasis,lawfulBasisJustification:t.lawfulBasisJustification,dataCategories:t.dataCategories.join(", "),involvesSensitiveData:t.involvesSensitiveData,sensitiveDataCondition:t.sensitiveDataCondition||"",dataSubjectCategories:t.dataSubjectCategories.join(", "),purposes:t.purposes.join(", "),retentionPeriod:t.retentionPeriod,retentionJustification:t.retentionJustification||"",recipients:(t.recipients||[]).join(", "),crossBorderTransfer:t.crossBorderTransfer,reviewDate:t.reviewDate?new Date(t.reviewDate).toISOString().split("T")[0]:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""}),S(t.id),x([]),m("form");},ae=()=>{let t={name:a$3.name,description:a$3.description,lawfulBasis:a$3.lawfulBasis,lawfulBasisJustification:a$3.lawfulBasisJustification,dataCategories:B(a$3.dataCategories),involvesSensitiveData:a$3.involvesSensitiveData,sensitiveDataCondition:a$3.sensitiveDataCondition||void 0,dataSubjectCategories:B(a$3.dataSubjectCategories),purposes:B(a$3.purposes),retentionPeriod:a$3.retentionPeriod,retentionJustification:a$3.retentionJustification||void 0,recipients:a$3.recipients?B(a$3.recipients):void 0,crossBorderTransfer:a$3.crossBorderTransfer,reviewDate:a$3.reviewDate?new Date(a$3.reviewDate).getTime():void 0,status:"active"},l=b(a$1({},t),{id:h||"temp",createdAt:Date.now(),updatedAt:Date.now()}),s=a$2(l);if(!s.isValid){x(s.errors);return}h&&j?j(h,t):_&&_(t),p(F),S(null),x([]),m("list");},O=t=>{I&&I(t);},ne=t=>{X(t),m("detail");},d$1=J?b$2.find(t=>t.id===J):null,V=t=>{let l={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",inactive:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",under_review:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",archived:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"},s={active:"Active",inactive:"Inactive",under_review:"Under Review",archived:"Archived"};return jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${l[t]}`,r==null?void 0:r.statusBadge,o),children:s[t]})},$=t=>{let l={consent:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",contract:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",legal_obligation:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",vital_interests:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",public_interest:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",legitimate_interests:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},s={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"};return jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${l[t]}`,children:s[t]})},M=t=>t.dpoApproval?t.dpoApproval.approved?jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"Approved"}):jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",children:"Pending Approval"}):jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400",children:"No DPO Review"}),oe=()=>jsxs("div",{className:a("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",r==null?void 0:r.summary,o),children:[jsxs("div",{className:a("bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200",children:D.totalActivities}),jsx("p",{className:"text-sm text-blue-600 dark:text-blue-300",children:"Total Activities"})]}),jsxs("div",{className:a("bg-orange-50 dark:bg-orange-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-orange-800 dark:text-orange-200",children:D.sensitiveDataActivities}),jsx("p",{className:"text-sm text-orange-600 dark:text-orange-300",children:"Sensitive Data"})]}),jsxs("div",{className:a("bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-purple-800 dark:text-purple-200",children:D.crossBorderActivities}),jsx("p",{className:"text-sm text-purple-600 dark:text-purple-300",children:"Cross-Border Transfers"})]}),jsxs("div",{className:a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsx("p",{className:"text-2xl font-bold text-red-800 dark:text-red-200",children:D.activitiesWithoutApproval.length}),jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"Pending Approval"})]})]}),de=()=>{if(P.length===0)return jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-4 rounded-lg mb-6",children:[jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"No compliance gaps detected."}),jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"All processing activities appear to be properly documented."})]});let t=P.filter(s=>s.severity==="high"),l=P.filter(s=>s.severity==="medium");return jsxs("div",{className:"mb-6",children:[t.length>0&&jsxs("div",{className:a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-3",r==null?void 0:r.gapAlert,o),children:[jsxs("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-2",children:["High Priority (",t.length,")"]}),jsx("ul",{className:"space-y-1",children:t.map((s,v)=>jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:s.description},v))})]}),l.length>0&&jsxs("div",{className:a("bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg",r==null?void 0:r.gapAlert,o),children:[jsxs("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-2",children:["Medium Priority (",l.length,")"]}),jsx("ul",{className:"space-y-1",children:l.map((s,v)=>jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:s.description},v))})]})]})},le=()=>jsxs("div",{className:a("",r==null?void 0:r.form,o),children:[jsxs("div",{className:a("flex justify-between items-center mb-4",r==null?void 0:r.header,o),children:[jsx("h3",{className:"text-lg font-medium",children:h?"Edit Processing Activity":"New Processing Activity"}),jsx("button",{onClick:()=>{m("list"),x([]);},className:`px-4 py-2 text-gray-600 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${f}`,children:"Cancel"})]}),R.length>0&&jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-4",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-2",children:"Please correct the following errors:"}),jsx("ul",{className:"list-disc list-inside space-y-1",children:R.map((t,l)=>jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:t},l))})]}),jsxs("div",{className:"space-y-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"activityName",className:"block text-sm font-medium mb-1",children:"Activity Name *"}),jsx("input",{type:"text",id:"activityName",value:a$3.name,onChange:t=>p(b(a$1({},a$3),{name:t.target.value})),placeholder:"e.g., Customer Account Management",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"activityDescription",className:"block text-sm font-medium mb-1",children:"Description *"}),jsx("textarea",{id:"activityDescription",value:a$3.description,onChange:t=>p(b(a$1({},a$3),{description:t.target.value})),placeholder:"Describe what processing is performed...",rows:3,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"lawfulBasis",className:"block text-sm font-medium mb-1",children:"Lawful Basis (NDPA Section 25) *"}),jsx("select",{id:"lawfulBasis",value:a$3.lawfulBasis,onChange:t=>p(b(a$1({},a$3),{lawfulBasis:t.target.value})),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:H.map(t=>jsx("option",{value:t.value,children:t.label},t.value))}),jsx("p",{className:"mt-1 text-xs text-gray-600 dark:text-gray-400",children:b$1(a$3.lawfulBasis)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:"Lawful Basis Justification *"}),jsx("textarea",{id:"justification",value:a$3.lawfulBasisJustification,onChange:t=>p(b(a$1({},a$3),{lawfulBasisJustification:t.target.value})),placeholder:"Document why this lawful basis applies to this processing activity...",rows:3,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),a$3.lawfulBasis==="legitimate_interests"&&jsxs("div",{className:"border border-indigo-200 dark:border-indigo-800 rounded-lg p-4 bg-indigo-50 dark:bg-indigo-900/20",children:[jsx("h4",{className:"text-sm font-semibold text-indigo-800 dark:text-indigo-200 mb-3",children:"Legitimate Interest Assessment (LIA)"}),jsx("p",{className:"text-xs text-indigo-600 dark:text-indigo-300 mb-4",children:"NDPA Section 25(1)(f) requires a balancing test when relying on legitimate interests."}),jsxs("div",{className:"space-y-3",children:[jsxs("div",{children:[jsx("label",{htmlFor:"liaPurpose",className:"block text-sm font-medium mb-1",children:"Purpose Test"}),jsx("textarea",{id:"liaPurpose",value:a$3.liaPurposeTest,onChange:t=>p(b(a$1({},a$3),{liaPurposeTest:t.target.value})),placeholder:"Describe the legitimate interest being pursued...",rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaNecessity",className:"block text-sm font-medium mb-1",children:"Necessity Test"}),jsx("textarea",{id:"liaNecessity",value:a$3.liaNecessityTest,onChange:t=>p(b(a$1({},a$3),{liaNecessityTest:t.target.value})),placeholder:"Explain why this processing is necessary for the stated purpose...",rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaBalancing",className:"block text-sm font-medium mb-1",children:"Balancing Test"}),jsx("textarea",{id:"liaBalancing",value:a$3.liaBalancingTest,onChange:t=>p(b(a$1({},a$3),{liaBalancingTest:t.target.value})),placeholder:"Assess the impact on data subjects' rights and interests...",rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaSafeguards",className:"block text-sm font-medium mb-1",children:"Safeguards"}),jsx("input",{type:"text",id:"liaSafeguards",value:a$3.liaSafeguards,onChange:t=>p(b(a$1({},a$3),{liaSafeguards:t.target.value})),placeholder:"List safeguards (comma-separated)...",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"liaConclusion",className:"block text-sm font-medium mb-1",children:"Conclusion"}),jsx("textarea",{id:"liaConclusion",value:a$3.liaConclusion,onChange:t=>p(b(a$1({},a$3),{liaConclusion:t.target.value})),placeholder:"State your overall conclusion...",rows:2,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataCategories",className:"block text-sm font-medium mb-1",children:"Data Categories *"}),jsx("input",{type:"text",id:"dataCategories",value:a$3.dataCategories,onChange:t=>p(b(a$1({},a$3),{dataCategories:t.target.value})),placeholder:"e.g., Name, Email, Phone Number (comma-separated)",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)})]}),jsx("div",{children:jsxs("label",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",checked:a$3.involvesSensitiveData,onChange:t=>p(b(a$1({},a$3),{involvesSensitiveData:t.target.checked,sensitiveDataCondition:t.target.checked?a$3.sensitiveDataCondition:""})),className:"rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("span",{className:"text-sm font-medium",children:"Involves Sensitive Personal Data (NDPA Section 27)"})]})}),a$3.involvesSensitiveData&&jsxs("div",{children:[jsx("label",{htmlFor:"sensitiveCondition",className:"block text-sm font-medium mb-1",children:"Sensitive Data Condition (NDPA Section 27) *"}),jsxs("select",{id:"sensitiveCondition",value:a$3.sensitiveDataCondition,onChange:t=>p(b(a$1({},a$3),{sensitiveDataCondition:t.target.value})),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsx("option",{value:"",children:"Select a condition..."}),Y.map(t=>jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"dataSubjectCategories",className:"block text-sm font-medium mb-1",children:"Data Subject Categories *"}),jsx("input",{type:"text",id:"dataSubjectCategories",value:a$3.dataSubjectCategories,onChange:t=>p(b(a$1({},a$3),{dataSubjectCategories:t.target.value})),placeholder:"e.g., Customers, Employees, Vendors (comma-separated)",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"purposes",className:"block text-sm font-medium mb-1",children:"Processing Purposes *"}),jsx("input",{type:"text",id:"purposes",value:a$3.purposes,onChange:t=>p(b(a$1({},a$3),{purposes:t.target.value})),placeholder:"e.g., Account management, Service delivery (comma-separated)",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"retentionPeriod",className:"block text-sm font-medium mb-1",children:"Retention Period *"}),jsx("input",{type:"text",id:"retentionPeriod",value:a$3.retentionPeriod,onChange:t=>p(b(a$1({},a$3),{retentionPeriod:t.target.value})),placeholder:"e.g., 3 years after account closure",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{children:[jsx("label",{htmlFor:"retentionJustification",className:"block text-sm font-medium mb-1",children:"Retention Justification"}),jsx("input",{type:"text",id:"retentionJustification",value:a$3.retentionJustification,onChange:t=>p(b(a$1({},a$3),{retentionJustification:t.target.value})),placeholder:"Reason for the retention period",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"recipients",className:"block text-sm font-medium mb-1",children:"Recipients"}),jsx("input",{type:"text",id:"recipients",value:a$3.recipients,onChange:t=>p(b(a$1({},a$3),{recipients:t.target.value})),placeholder:"e.g., Payment processor, Cloud provider (comma-separated)",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)})]}),jsx("div",{children:jsxs("label",{className:"flex items-center space-x-2",children:[jsx("input",{type:"checkbox",checked:a$3.crossBorderTransfer,onChange:t=>p(b(a$1({},a$3),{crossBorderTransfer:t.target.checked})),className:"rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("span",{className:"text-sm font-medium",children:"Involves Cross-Border Transfer Outside Nigeria"})]})}),jsxs("div",{children:[jsx("label",{htmlFor:"reviewDate",className:"block text-sm font-medium mb-1",children:"Next Review Date"}),jsx("input",{type:"date",id:"reviewDate",value:a$3.reviewDate,onChange:t=>p(b(a$1({},a$3),{reviewDate:t.target.value})),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[jsx("button",{onClick:()=>{m("list"),x([]);},className:`px-4 py-2 text-gray-600 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${f}`,children:"Cancel"}),jsx("button",{onClick:ae,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${f}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:h?"Update Activity":"Create Activity"})]})]})]}),se=()=>{var l;if(!d$1)return jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Activity not found."})});let t=a$2(d$1);return jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxs("div",{children:[jsx("button",{onClick:()=>m("list"),className:"text-sm text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline mb-2",children:"Back to list"}),jsx("h3",{className:"text-lg font-medium",children:d$1.name})]}),jsxs("div",{className:"flex space-x-2",children:[$(d$1.lawfulBasis),V(d$1.status),M(d$1)]})]}),t.warnings.length>0&&jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md mb-4",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-1",children:"Warnings"}),jsx("ul",{className:"list-disc list-inside space-y-1",children:t.warnings.map((s,v)=>jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:s},v))})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Description:"})," ",d$1.description]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Lawful Basis:"})," ",b$1(d$1.lawfulBasis)]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Justification:"})," ",d$1.lawfulBasisJustification]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Categories:"})," ",d$1.dataCategories.join(", ")]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Data Subject Categories:"})," ",d$1.dataSubjectCategories.join(", ")]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Purposes:"})," ",d$1.purposes.join(", ")]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Retention Period:"})," ",d$1.retentionPeriod,d$1.retentionJustification&&jsxs("span",{className:"text-gray-600 dark:text-gray-400",children:[" ","(",d$1.retentionJustification,")"]})]})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",d$1.involvesSensitiveData?"Yes":"No",d$1.sensitiveDataCondition&&jsxs("span",{children:[" ","(Condition:"," ",((l=Y.find(s=>s.value===d$1.sensitiveDataCondition))==null?void 0:l.label)||d$1.sensitiveDataCondition,")"]})]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Cross-Border Transfer:"})," ",d$1.crossBorderTransfer?"Yes":"No"]}),d$1.recipients&&d$1.recipients.length>0&&jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Recipients:"})," ",d$1.recipients.join(", ")]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Created:"})," ",w(d$1.createdAt)]}),jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Last Updated:"})," ",w(d$1.updatedAt)]}),d$1.reviewDate&&jsxs("p",{className:"text-sm mt-2",children:[jsx("span",{className:"font-medium",children:"Next Review:"})," ",w(d$1.reviewDate),d$1.reviewDate<Date.now()&&jsx("span",{className:"text-red-600 dark:text-red-400 font-medium",children:" (Overdue)"})]})]})]}),d$1.dpoApproval&&jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-6",children:[jsx("h4",{className:"text-sm font-semibold mb-2",children:"DPO Approval"}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",d$1.dpoApproval.approved?"Approved":"Not Approved"]}),jsxs("p",{className:"text-sm mt-1",children:[jsx("span",{className:"font-medium",children:"Approved By:"})," ",d$1.dpoApproval.approvedBy]}),jsxs("p",{className:"text-sm mt-1",children:[jsx("span",{className:"font-medium",children:"Date:"})," ",w(d$1.dpoApproval.approvedAt)]}),d$1.dpoApproval.notes&&jsxs("p",{className:"text-sm mt-1",children:[jsx("span",{className:"font-medium",children:"Notes:"})," ",d$1.dpoApproval.notes]})]}),jsxs("div",{className:"flex space-x-3",children:[jsx("button",{onClick:()=>E(d$1),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${f}`,children:"Edit"}),d$1.status!=="archived"&&jsx("button",{onClick:()=>O(d$1.id),className:`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 ${f}`,children:"Archive"})]})]})},pe=()=>jsxs("div",{children:[jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"basisFilter",className:"block text-sm font-medium mb-1",children:"Lawful Basis"}),jsxs("select",{id:"basisFilter",value:C,onChange:t=>ee(t.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsx("option",{value:"all",children:"All Bases"}),H.map(t=>jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"statusFilterSelect",className:"block text-sm font-medium mb-1",children:"Status"}),jsxs("select",{id:"statusFilterSelect",value:k,onChange:t=>Z(t.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsx("option",{value:"all",children:"All Statuses"}),jsx("option",{value:"active",children:"Active"}),jsx("option",{value:"inactive",children:"Inactive"}),jsx("option",{value:"under_review",children:"Under Review"}),jsx("option",{value:"archived",children:"Archived"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"searchInput",className:"block text-sm font-medium mb-1",children:"Search"}),jsx("input",{type:"text",id:"searchInput",value:A,onChange:t=>te(t.target.value),placeholder:"Search activities...",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)})]}),jsx("div",{className:"flex items-end",children:jsx("button",{onClick:ie,className:a(`w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${f}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Add Activity"})})]}),N.length===0?jsx("div",{className:"flex items-center justify-center h-32 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No processing activities found."})}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:a("w-full text-sm text-left",r==null?void 0:r.table,o),children:[jsx("thead",{className:a("text-xs uppercase bg-gray-50 dark:bg-gray-700",r==null?void 0:r.tableHeader,o),children:jsxs("tr",{children:[jsx("th",{className:"px-4 py-3",children:"Activity"}),jsx("th",{className:"px-4 py-3",children:"Lawful Basis"}),jsx("th",{className:"px-4 py-3",children:"Status"}),jsx("th",{className:"px-4 py-3",children:"DPO Approval"}),jsx("th",{className:"px-4 py-3",children:"Sensitive Data"}),jsx("th",{className:"px-4 py-3",children:"Last Updated"}),jsx("th",{className:"px-4 py-3",children:"Actions"})]})}),jsx("tbody",{children:N.map(t=>jsxs("tr",{className:a("border-b border-gray-200 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-700",r==null?void 0:r.tableRow,o),children:[jsxs("td",{className:"px-4 py-3",children:[jsx("button",{onClick:()=>ne(t.id),className:"font-medium text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline text-left",children:t.name}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1 truncate max-w-xs",children:t.description})]}),jsx("td",{className:"px-4 py-3",children:$(t.lawfulBasis)}),jsx("td",{className:"px-4 py-3",children:V(t.status)}),jsx("td",{className:"px-4 py-3",children:M(t)}),jsx("td",{className:"px-4 py-3",children:jsx("span",{className:`text-xs ${t.involvesSensitiveData?"text-orange-600 dark:text-orange-400 font-medium":"text-gray-600 dark:text-gray-400"}`,children:t.involvesSensitiveData?"Yes":"No"})}),jsx("td",{className:"px-4 py-3 text-xs text-gray-600 dark:text-gray-400",children:w(t.updatedAt)}),jsx("td",{className:"px-4 py-3",children:jsxs("div",{className:"flex space-x-2",children:[jsx("button",{onClick:()=>E(t),className:"text-xs text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline",children:"Edit"}),t.status!=="archived"&&jsx("button",{onClick:()=>O(t.id),className:"text-xs text-gray-600 dark:text-gray-400 hover:underline",children:"Archive"})]})})]},t.id))})]})})]});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${z}`,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:W}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:q}),K&&y==="list"&&oe(),Q&&y==="list"&&de(),y==="list"&&pe(),y==="form"&&le(),y==="detail"&&se()]})};export{fe as a};//# sourceMappingURL=chunk-ELKEZEV5.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-ELKEZEV5.mjs.map
|
package/dist/chunk-ER7X6E36.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkTDDAYVKK_js=require('./chunk-TDDAYVKK.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var F={name:"",description:"",lawfulBasis:"consent",lawfulBasisJustification:"",dataCategories:"",involvesSensitiveData:false,sensitiveDataCondition:"",dataSubjectCategories:"",purposes:"",retentionPeriod:"",retentionJustification:"",recipients:"",crossBorderTransfer:false,reviewDate:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""},H=[{value:"consent",label:"Consent"},{value:"contract",label:"Contract"},{value:"legal_obligation",label:"Legal Obligation"},{value:"vital_interests",label:"Vital Interests"},{value:"public_interest",label:"Public Interest"},{value:"legitimate_interests",label:"Legitimate Interests"}],Y=[{value:"explicit_consent",label:"Explicit Consent"},{value:"employment_law",label:"Employment Law"},{value:"vital_interests_incapable",label:"Vital Interests (Incapable)"},{value:"nonprofit_legitimate",label:"Nonprofit Legitimate Activities"},{value:"publicly_available",label:"Publicly Available Data"},{value:"legal_claims",label:"Legal Claims"},{value:"substantial_public_interest",label:"Substantial Public Interest"},{value:"health_purposes",label:"Health Purposes"},{value:"public_health",label:"Public Health"},{value:"archiving_research",label:"Archiving / Research"}],fe=({activities:b,onAddActivity:_,onUpdateActivity:j,onArchiveActivity:I,title:W="Lawful Basis Tracker",description:q="Document and track the lawful basis for each processing activity as required by NDPA 2023 Section 25.",className:z="",buttonClassName:f="",showSummary:K=true,showComplianceGaps:Q=true,classNames:r,unstyled:o})=>{let[y,m]=react.useState("list"),[a,p]=react.useState(F),[h,S]=react.useState(null),[J,X]=react.useState(null),[k,Z]=react.useState("all"),[C,ee]=react.useState("all"),[A,te]=react.useState(""),[R,x]=react.useState([]),[N,re]=react.useState(b);react.useEffect(()=>{let t=[...b];if(k!=="all"&&(t=t.filter(l=>l.status===k)),C!=="all"&&(t=t.filter(l=>l.lawfulBasis===C)),A){let l=A.toLowerCase();t=t.filter(s=>s.name.toLowerCase().includes(l)||s.description.toLowerCase().includes(l)||s.purposes.some(v=>v.toLowerCase().includes(l)));}t.sort((l,s)=>s.updatedAt-l.updatedAt),re(t);},[b,k,C,A]);let w=t=>new Date(t).toLocaleDateString(),D=chunkTDDAYVKK_js.d(b),P=chunkTDDAYVKK_js.c(b),B=t=>t.split(",").map(l=>l.trim()).filter(l=>l.length>0),ie=()=>{p(F),S(null),x([]),m("form");},E=t=>{p({name:t.name,description:t.description,lawfulBasis:t.lawfulBasis,lawfulBasisJustification:t.lawfulBasisJustification,dataCategories:t.dataCategories.join(", "),involvesSensitiveData:t.involvesSensitiveData,sensitiveDataCondition:t.sensitiveDataCondition||"",dataSubjectCategories:t.dataSubjectCategories.join(", "),purposes:t.purposes.join(", "),retentionPeriod:t.retentionPeriod,retentionJustification:t.retentionJustification||"",recipients:(t.recipients||[]).join(", "),crossBorderTransfer:t.crossBorderTransfer,reviewDate:t.reviewDate?new Date(t.reviewDate).toISOString().split("T")[0]:"",liaPurposeTest:"",liaNecessityTest:"",liaBalancingTest:"",liaSafeguards:"",liaConclusion:""}),S(t.id),x([]),m("form");},ae=()=>{let t={name:a.name,description:a.description,lawfulBasis:a.lawfulBasis,lawfulBasisJustification:a.lawfulBasisJustification,dataCategories:B(a.dataCategories),involvesSensitiveData:a.involvesSensitiveData,sensitiveDataCondition:a.sensitiveDataCondition||void 0,dataSubjectCategories:B(a.dataSubjectCategories),purposes:B(a.purposes),retentionPeriod:a.retentionPeriod,retentionJustification:a.retentionJustification||void 0,recipients:a.recipients?B(a.recipients):void 0,crossBorderTransfer:a.crossBorderTransfer,reviewDate:a.reviewDate?new Date(a.reviewDate).getTime():void 0,status:"active"},l=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{id:h||"temp",createdAt:Date.now(),updatedAt:Date.now()}),s=chunkTDDAYVKK_js.a(l);if(!s.isValid){x(s.errors);return}h&&j?j(h,t):_&&_(t),p(F),S(null),x([]),m("list");},O=t=>{I&&I(t);},ne=t=>{X(t),m("detail");},d=J?b.find(t=>t.id===J):null,V=t=>{let l={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",inactive:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",under_review:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",archived:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"},s={active:"Active",inactive:"Inactive",under_review:"Under Review",archived:"Archived"};return jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${l[t]}`,r==null?void 0:r.statusBadge,o),children:s[t]})},$=t=>{let l={consent:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",contract:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",legal_obligation:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",vital_interests:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",public_interest:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",legitimate_interests:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},s={consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"};return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${l[t]}`,children:s[t]})},M=t=>t.dpoApproval?t.dpoApproval.approved?jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",children:"Approved"}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",children:"Pending Approval"}):jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400",children:"No DPO Review"}),oe=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",r==null?void 0:r.summary,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200",children:D.totalActivities}),jsxRuntime.jsx("p",{className:"text-sm text-blue-600 dark:text-blue-300",children:"Total Activities"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-orange-50 dark:bg-orange-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-orange-800 dark:text-orange-200",children:D.sensitiveDataActivities}),jsxRuntime.jsx("p",{className:"text-sm text-orange-600 dark:text-orange-300",children:"Sensitive Data"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-800 dark:text-purple-200",children:D.crossBorderActivities}),jsxRuntime.jsx("p",{className:"text-sm text-purple-600 dark:text-purple-300",children:"Cross-Border Transfers"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-red-800 dark:text-red-200",children:D.activitiesWithoutApproval.length}),jsxRuntime.jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"Pending Approval"})]})]}),de=()=>{if(P.length===0)return jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-4 rounded-lg mb-6",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"No compliance gaps detected."}),jsxRuntime.jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"All processing activities appear to be properly documented."})]});let t=P.filter(s=>s.severity==="high"),l=P.filter(s=>s.severity==="medium");return jsxRuntime.jsxs("div",{className:"mb-6",children:[t.length>0&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-3",r==null?void 0:r.gapAlert,o),children:[jsxRuntime.jsxs("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-2",children:["High Priority (",t.length,")"]}),jsxRuntime.jsx("ul",{className:"space-y-1",children:t.map((s,v)=>jsxRuntime.jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:s.description},v))})]}),l.length>0&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg",r==null?void 0:r.gapAlert,o),children:[jsxRuntime.jsxs("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-2",children:["Medium Priority (",l.length,")"]}),jsxRuntime.jsx("ul",{className:"space-y-1",children:l.map((s,v)=>jsxRuntime.jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:s.description},v))})]})]})},le=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",r==null?void 0:r.form,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex justify-between items-center mb-4",r==null?void 0:r.header,o),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:h?"Edit Processing Activity":"New Processing Activity"}),jsxRuntime.jsx("button",{onClick:()=>{m("list"),x([]);},className:`px-4 py-2 text-gray-600 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${f}`,children:"Cancel"})]}),R.length>0&&jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-4 rounded-lg mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium mb-2",children:"Please correct the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside space-y-1",children:R.map((t,l)=>jsxRuntime.jsx("li",{className:"text-xs text-red-700 dark:text-red-300",children:t},l))})]}),jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"activityName",className:"block text-sm font-medium mb-1",children:"Activity Name *"}),jsxRuntime.jsx("input",{type:"text",id:"activityName",value:a.name,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{name:t.target.value})),placeholder:"e.g., Customer Account Management",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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"activityDescription",className:"block text-sm font-medium mb-1",children:"Description *"}),jsxRuntime.jsx("textarea",{id:"activityDescription",value:a.description,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{description:t.target.value})),placeholder:"Describe what processing is performed...",rows:3,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasis",className:"block text-sm font-medium mb-1",children:"Lawful Basis (NDPA Section 25) *"}),jsxRuntime.jsx("select",{id:"lawfulBasis",value:a.lawfulBasis,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{lawfulBasis:t.target.value})),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:H.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-gray-600 dark:text-gray-400",children:chunkTDDAYVKK_js.b(a.lawfulBasis)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:"Lawful Basis Justification *"}),jsxRuntime.jsx("textarea",{id:"justification",value:a.lawfulBasisJustification,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{lawfulBasisJustification:t.target.value})),placeholder:"Document why this lawful basis applies to this processing activity...",rows:3,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),a.lawfulBasis==="legitimate_interests"&&jsxRuntime.jsxs("div",{className:"border border-indigo-200 dark:border-indigo-800 rounded-lg p-4 bg-indigo-50 dark:bg-indigo-900/20",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-indigo-800 dark:text-indigo-200 mb-3",children:"Legitimate Interest Assessment (LIA)"}),jsxRuntime.jsx("p",{className:"text-xs text-indigo-600 dark:text-indigo-300 mb-4",children:"NDPA Section 25(1)(f) requires a balancing test when relying on legitimate interests."}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaPurpose",className:"block text-sm font-medium mb-1",children:"Purpose Test"}),jsxRuntime.jsx("textarea",{id:"liaPurpose",value:a.liaPurposeTest,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{liaPurposeTest:t.target.value})),placeholder:"Describe the legitimate interest being pursued...",rows:2,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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaNecessity",className:"block text-sm font-medium mb-1",children:"Necessity Test"}),jsxRuntime.jsx("textarea",{id:"liaNecessity",value:a.liaNecessityTest,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{liaNecessityTest:t.target.value})),placeholder:"Explain why this processing is necessary for the stated purpose...",rows:2,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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaBalancing",className:"block text-sm font-medium mb-1",children:"Balancing Test"}),jsxRuntime.jsx("textarea",{id:"liaBalancing",value:a.liaBalancingTest,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{liaBalancingTest:t.target.value})),placeholder:"Assess the impact on data subjects' rights and interests...",rows:2,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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaSafeguards",className:"block text-sm font-medium mb-1",children:"Safeguards"}),jsxRuntime.jsx("input",{type:"text",id:"liaSafeguards",value:a.liaSafeguards,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{liaSafeguards:t.target.value})),placeholder:"List safeguards (comma-separated)...",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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"liaConclusion",className:"block text-sm font-medium mb-1",children:"Conclusion"}),jsxRuntime.jsx("textarea",{id:"liaConclusion",value:a.liaConclusion,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{liaConclusion:t.target.value})),placeholder:"State your overall conclusion...",rows:2,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))]",r==null?void 0:r.input,o)})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataCategories",className:"block text-sm font-medium mb-1",children:"Data Categories *"}),jsxRuntime.jsx("input",{type:"text",id:"dataCategories",value:a.dataCategories,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{dataCategories:t.target.value})),placeholder:"e.g., Name, Email, Phone Number (comma-separated)",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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsx("div",{children:jsxRuntime.jsxs("label",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:a.involvesSensitiveData,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{involvesSensitiveData:t.target.checked,sensitiveDataCondition:t.target.checked?a.sensitiveDataCondition:""})),className:"rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Involves Sensitive Personal Data (NDPA Section 27)"})]})}),a.involvesSensitiveData&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sensitiveCondition",className:"block text-sm font-medium mb-1",children:"Sensitive Data Condition (NDPA Section 27) *"}),jsxRuntime.jsxs("select",{id:"sensitiveCondition",value:a.sensitiveDataCondition,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{sensitiveDataCondition:t.target.value})),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"",children:"Select a condition..."}),Y.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataSubjectCategories",className:"block text-sm font-medium mb-1",children:"Data Subject Categories *"}),jsxRuntime.jsx("input",{type:"text",id:"dataSubjectCategories",value:a.dataSubjectCategories,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{dataSubjectCategories:t.target.value})),placeholder:"e.g., Customers, Employees, Vendors (comma-separated)",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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"purposes",className:"block text-sm font-medium mb-1",children:"Processing Purposes *"}),jsxRuntime.jsx("input",{type:"text",id:"purposes",value:a.purposes,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{purposes:t.target.value})),placeholder:"e.g., Account management, Service delivery (comma-separated)",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))]",r==null?void 0:r.input,o)})]}),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:a.retentionPeriod,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{retentionPeriod:t.target.value})),placeholder:"e.g., 3 years after account closure",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))]",r==null?void 0:r.input,o)})]}),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:a.retentionJustification,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{retentionJustification:t.target.value})),placeholder:"Reason for the retention period",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))]",r==null?void 0:r.input,o)})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recipients",className:"block text-sm font-medium mb-1",children:"Recipients"}),jsxRuntime.jsx("input",{type:"text",id:"recipients",value:a.recipients,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{recipients:t.target.value})),placeholder:"e.g., Payment processor, Cloud provider (comma-separated)",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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsx("div",{children:jsxRuntime.jsxs("label",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:a.crossBorderTransfer,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{crossBorderTransfer:t.target.checked})),className:"rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Involves Cross-Border Transfer Outside Nigeria"})]})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"reviewDate",className:"block text-sm font-medium mb-1",children:"Next Review Date"}),jsxRuntime.jsx("input",{type:"date",id:"reviewDate",value:a.reviewDate,onChange:t=>p(chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{reviewDate:t.target.value})),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{className:"flex justify-end space-x-3 pt-4",children:[jsxRuntime.jsx("button",{onClick:()=>{m("list"),x([]);},className:`px-4 py-2 text-gray-600 dark:text-gray-300 bg-gray-100 dark:bg-gray-700 rounded hover:bg-gray-200 dark:hover:bg-gray-600 ${f}`,children:"Cancel"}),jsxRuntime.jsx("button",{onClick:ae,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${f}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:h?"Update Activity":"Create Activity"})]})]})]}),se=()=>{var l;if(!d)return 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:"Activity not found."})});let t=chunkTDDAYVKK_js.a(d);return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{onClick:()=>m("list"),className:"text-sm text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline mb-2",children:"Back to list"}),jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:d.name})]}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[$(d.lawfulBasis),V(d.status),M(d)]})]}),t.warnings.length>0&&jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium mb-1",children:"Warnings"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside space-y-1",children:t.warnings.map((s,v)=>jsxRuntime.jsx("li",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:s},v))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Description:"})," ",d.description]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Lawful Basis:"})," ",chunkTDDAYVKK_js.b(d.lawfulBasis)]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Justification:"})," ",d.lawfulBasisJustification]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Categories:"})," ",d.dataCategories.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subject Categories:"})," ",d.dataSubjectCategories.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Purposes:"})," ",d.purposes.join(", ")]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Retention Period:"})," ",d.retentionPeriod,d.retentionJustification&&jsxRuntime.jsxs("span",{className:"text-gray-600 dark:text-gray-400",children:[" ","(",d.retentionJustification,")"]})]})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",d.involvesSensitiveData?"Yes":"No",d.sensitiveDataCondition&&jsxRuntime.jsxs("span",{children:[" ","(Condition:"," ",((l=Y.find(s=>s.value===d.sensitiveDataCondition))==null?void 0:l.label)||d.sensitiveDataCondition,")"]})]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Cross-Border Transfer:"})," ",d.crossBorderTransfer?"Yes":"No"]}),d.recipients&&d.recipients.length>0&&jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Recipients:"})," ",d.recipients.join(", ")]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Created:"})," ",w(d.createdAt)]}),jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Last Updated:"})," ",w(d.updatedAt)]}),d.reviewDate&&jsxRuntime.jsxs("p",{className:"text-sm mt-2",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next Review:"})," ",w(d.reviewDate),d.reviewDate<Date.now()&&jsxRuntime.jsx("span",{className:"text-red-600 dark:text-red-400 font-medium",children:" (Overdue)"})]})]})]}),d.dpoApproval&&jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-6",children:[jsxRuntime.jsx("h4",{className:"text-sm font-semibold mb-2",children:"DPO Approval"}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",d.dpoApproval.approved?"Approved":"Not Approved"]}),jsxRuntime.jsxs("p",{className:"text-sm mt-1",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Approved By:"})," ",d.dpoApproval.approvedBy]}),jsxRuntime.jsxs("p",{className:"text-sm mt-1",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Date:"})," ",w(d.dpoApproval.approvedAt)]}),d.dpoApproval.notes&&jsxRuntime.jsxs("p",{className:"text-sm mt-1",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Notes:"})," ",d.dpoApproval.notes]})]}),jsxRuntime.jsxs("div",{className:"flex space-x-3",children:[jsxRuntime.jsx("button",{onClick:()=>E(d),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${f}`,children:"Edit"}),d.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>O(d.id),className:`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 ${f}`,children:"Archive"})]})]})},pe=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"basisFilter",className:"block text-sm font-medium mb-1",children:"Lawful Basis"}),jsxRuntime.jsxs("select",{id:"basisFilter",value:C,onChange:t=>ee(t.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Bases"}),H.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"statusFilterSelect",className:"block text-sm font-medium mb-1",children:"Status"}),jsxRuntime.jsxs("select",{id:"statusFilterSelect",value:k,onChange:t=>Z(t.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),jsxRuntime.jsx("option",{value:"active",children:"Active"}),jsxRuntime.jsx("option",{value:"inactive",children:"Inactive"}),jsxRuntime.jsx("option",{value:"under_review",children:"Under Review"}),jsxRuntime.jsx("option",{value:"archived",children:"Archived"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"searchInput",className:"block text-sm font-medium mb-1",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"searchInput",value:A,onChange:t=>te(t.target.value),placeholder:"Search activities...",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))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsx("div",{className:"flex items-end",children:jsxRuntime.jsx("button",{onClick:ie,className:chunkE64TU6IU_js.a(`w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${f}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Add Activity"})})]}),N.length===0?jsxRuntime.jsx("div",{className:"flex items-center justify-center h-32 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No processing activities found."})}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:chunkE64TU6IU_js.a("w-full text-sm text-left",r==null?void 0:r.table,o),children:[jsxRuntime.jsx("thead",{className:chunkE64TU6IU_js.a("text-xs uppercase bg-gray-50 dark:bg-gray-700",r==null?void 0:r.tableHeader,o),children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Activity"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Lawful Basis"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Status"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"DPO Approval"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Sensitive Data"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Last Updated"}),jsxRuntime.jsx("th",{className:"px-4 py-3",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{children:N.map(t=>jsxRuntime.jsxs("tr",{className:chunkE64TU6IU_js.a("border-b border-gray-200 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-700",r==null?void 0:r.tableRow,o),children:[jsxRuntime.jsxs("td",{className:"px-4 py-3",children:[jsxRuntime.jsx("button",{onClick:()=>ne(t.id),className:"font-medium text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline text-left",children:t.name}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1 truncate max-w-xs",children:t.description})]}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:$(t.lawfulBasis)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:V(t.status)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:M(t)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsx("span",{className:`text-xs ${t.involvesSensitiveData?"text-orange-600 dark:text-orange-400 font-medium":"text-gray-600 dark:text-gray-400"}`,children:t.involvesSensitiveData?"Yes":"No"})}),jsxRuntime.jsx("td",{className:"px-4 py-3 text-xs text-gray-600 dark:text-gray-400",children:w(t.updatedAt)}),jsxRuntime.jsx("td",{className:"px-4 py-3",children:jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsx("button",{onClick:()=>E(t),className:"text-xs text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline",children:"Edit"}),t.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>O(t.id),className:"text-xs text-gray-600 dark:text-gray-400 hover:underline",children:"Archive"})]})})]},t.id))})]})})]});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${z}`,r==null?void 0:r.root,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",r==null?void 0:r.title,o),children:W}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:q}),K&&y==="list"&&oe(),Q&&y==="list"&&de(),y==="list"&&pe(),y==="form"&&le(),y==="detail"&&se()]})};exports.a=fe;//# sourceMappingURL=chunk-ER7X6E36.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-ER7X6E36.js.map
|
package/dist/chunk-FDDI426Y.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a,d}from'./chunk-ZEOQYWOE.mjs';import {a as a$2}from'./chunk-6WIP33TW.mjs';import {b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect}from'react';function j(d,a){return a?a$2(d):{load:()=>null,save:()=>{},remove:()=>{}}}function E({templates:d,initialPolicy:a$2,adapter:g,storageKey:I="ndpr_privacy_policy",useLocalStorage:h=true,onGenerate:v}){let f=g!=null?g:j(I,h),p=useRef(f);p.current=f;let[o,m]=useState(a$2||null),[l,P]=useState(null),[y,O]=useState({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),[D,b$1]=useState(true),S=useRef(d);S.current=d,useEffect(()=>{if(a$2){b$1(false);return}let e=false;try{let n=p.current.load(),t=i=>{if(i){if(m(i),i.templateId){let c=S.current.find(u=>u.id===i.templateId);c&&P(c);}i.organizationInfo&&O(i.organizationInfo);}b$1(!1);};n instanceof Promise?n.then(i=>{e||t(i);},()=>{e||b$1(!1);}):t(n);}catch(n){e||b$1(false);}return ()=>{e=true;}},[a$2]);let q=e=>{Promise.resolve(p.current.save(e)).catch(n=>{console.warn("[ndpr-toolkit] Failed to save policy:",n);});},N=e=>{let n=d.find(u=>u.id===e);if(!n)return false;P(n);let t=n.sections.map(u=>b(a$1({},u),{customContent:void 0})),i={};Object.keys(n.variables).forEach(u=>{i[u]=n.variables[u].defaultValue||"";});let c=Date.now();return m({id:"policy_"+c+"_"+Math.random().toString(36).substr(2,9),title:"",templateId:n.id,organizationInfo:y,sections:t,variableValues:i,effectiveDate:c,lastUpdated:c,version:"1.0"}),true},R=e=>{O(n=>a$1(a$1({},n),e));},U=(e,n)=>{l&&(o?m(t=>t&&b(a$1({},t),{sections:t.sections.map(i=>i.id===e?b(a$1({},i),{included:n}):i)})):P(t=>t&&b(a$1({},t),{sections:t.sections.map(i=>i.id===e?b(a$1({},i),{included:n}):i)})));},C=(e,n)=>{l&&(o?m(t=>t&&b(a$1({},t),{sections:t.sections.map(i=>i.id===e?b(a$1({},i),{customContent:n}):i)})):P(t=>t&&b(a$1({},t),{sections:t.sections.map(i=>i.id===e?b(a$1({},i),{customContent:n}):i)})));},A=(e,n)=>{o&&m(t=>t&&b(a$1({},t),{variableValues:b(a$1({},t.variableValues),{[e]:n})}));},L=()=>"policy_"+Date.now()+"_"+Math.random().toString(36).substr(2,9);return {policy:o,selectedTemplate:l,organizationInfo:y,selectTemplate:N,updateOrganizationInfo:R,toggleSection:U,updateSectionContent:C,updateVariableValue:A,generatePolicy:()=>{if(!l)throw new Error("No template selected");let e=Date.now(),n={id:(o==null?void 0:o.id)||L(),title:`Privacy Policy for ${y.name}`,templateId:l.id,organizationInfo:y,sections:l.sections.map(t=>{var i;return b(a$1({},t),{customContent:(i=o==null?void 0:o.sections.find(c=>c.id===t.id))==null?void 0:i.customContent})}),variableValues:(o==null?void 0:o.variableValues)||{},effectiveDate:e,lastUpdated:e,version:"1.0"};return m(n),q(n),v&&v(n),n},getPolicyText:()=>{if(!o)return {fullText:"",sectionTexts:{},missingVariables:[]};let e=a(o.sections,o.organizationInfo);return typeof e=="string"?{fullText:e,sectionTexts:{full:e},missingVariables:[]}:e},resetPolicy:()=>{m(null),P(null),O({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),Promise.resolve(p.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove policy:",e);});},isValid:()=>{let e=[];if(l||e.push("No template selected"),y.name||e.push("Organization name is required"),y.website||e.push("Organization website is required"),y.privacyEmail||e.push("Privacy contact email is required"),l){let n=l.sections.filter(i=>i.required),t=(o==null?void 0:o.sections.filter(i=>i.included))||[];n.forEach(i=>{t.some(c=>c.id===i.id)||e.push(`Required section "${i.title}" must be included`);});}return l&&o&&Object.entries(l.variables).forEach(([n,t])=>{t.required&&!o.variableValues[n]&&e.push(`Required variable "${t.name}" must have a value`);}),{valid:e.length===0,errors:e}},isLoading:D}}function X(d$1={}){let{orgInfo:a,storageKey:g,useLocalStorage:I}=d$1,{sections:h,variables:v}=d(),f={};a&&(a.name&&(f.orgName=a.name),a.email&&(f.privacyEmail=a.email),a.dpoName&&(f.dpoName=a.dpoName));let p={id:"default-business",name:"Default Business Policy",description:"NDPA-compliant privacy policy template for businesses.",organizationType:"business",sections:h,variables:Object.fromEntries(v.map(o=>[o.name,{name:o.name,description:o.description,required:o.required,defaultValue:f[o.name]||o.value||void 0}])),version:"1.0",lastUpdated:Date.now(),ndpaCompliant:true};return E({templates:[p],storageKey:g,useLocalStorage:I})}export{E as a,X as b};//# sourceMappingURL=chunk-FDDI426Y.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-FDDI426Y.mjs.map
|
package/dist/chunk-FOXZRRMW.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-NXQMU36Z.mjs';import {a as a$2}from'./chunk-6WIP33TW.mjs';import {c,a,b}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function M(D,o){return o?a$2(D):{load:()=>null,save:()=>{},remove:()=>{}}}function Q({initialRequests:D=[],requestTypes:o,adapter:f,storageKey:x="ndpr_dsr_requests",useLocalStorage:B=true,onSubmit:p,onUpdate:m}){let y=f!=null?f:M(x,B),q=useRef(y);q.current=y;let[r,R]=useState(D),[I,l]=useState(true);useEffect(()=>{let e=false;try{let t=q.current.load();t instanceof Promise?t.then(s=>{e||(s&&R(s),l(!1));},()=>{e||l(!1);}):(t&&R(t),l(!1));}catch(t){e||l(false);}return ()=>{e=true;}},[]);let c$1=useCallback(e=>{Promise.resolve(q.current.save(e)).catch(t=>{console.warn("[ndpr-toolkit] Failed to save DSR requests:",t);});},[]),L=()=>"dsr_"+Date.now()+"_"+Math.random().toString(36).substr(2,9),O=useCallback(e=>{let t=o.find(g=>g.id===e.type),s=(t==null?void 0:t.estimatedCompletionTime)||30,u=Date.now(),a$1=u+s*24*60*60*1e3,v=e,{createdAt:A}=v,i=c(v,["createdAt"]),d=a({id:L(),status:"pending",createdAt:u,updatedAt:u,dueDate:a$1},i);return R(g=>{let b=[...g,d];return c$1(b),b}),p&&p(d),d},[o,c$1,p]),_=useCallback((e,t)=>{let s=null;return R(u=>{let a$1=u.findIndex(d=>d.id===e);if(a$1===-1)return u;let A=u[a$1];s=b(a(a({},A),t),{updatedAt:Date.now()});let i=[...u];return i[a$1]=s,c$1(i),i}),s&&m&&m(s),s},[c$1,m]),k=useCallback(e=>r.find(t=>t.id===e)||null,[r]),U=useCallback(e=>r.filter(t=>t.status===e),[r]),F=useCallback(e=>r.filter(t=>t.type===e),[r]);return {requests:r,submitRequest:O,updateRequest:_,getRequest:k,getRequestsByStatus:U,getRequestsByType:F,getRequestType:e=>o.find(t=>t.id===e),formatRequest:e=>{let{formattedRequest:t}=a$1(e);return t},clearRequests:()=>{R([]),Promise.resolve(q.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove DSR requests:",e);});},isLoading:I}}export{Q as a};//# sourceMappingURL=chunk-FOXZRRMW.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-FOXZRRMW.mjs.map
|