@tantainnovative/ndpr-toolkit 2.4.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +226 -246
- package/dist/BreachReportForm-DpRrBoxU.d.ts +158 -0
- package/dist/BreachReportForm-yJ2Zl6gz.d.mts +158 -0
- package/dist/ConsentBanner-CDRT0o2k.d.mts +146 -0
- package/dist/ConsentBanner-Vxyt8SCX.d.ts +146 -0
- package/dist/{cross-border-entry-BrWVPly6.d.ts → CrossBorderTransferManager-D5Lc0e46.d.ts} +4 -5
- package/dist/{cross-border-entry-cCTvpwnT.d.mts → CrossBorderTransferManager-DkZhv9vD.d.mts} +4 -5
- package/dist/DPIAQuestionnaire-BkejviPj.d.mts +123 -0
- package/dist/DPIAQuestionnaire-DdSqXG3x.d.ts +123 -0
- package/dist/DSRRequestForm-BY8PogCU.d.mts +146 -0
- package/dist/DSRRequestForm-CHUg9cZh.d.ts +146 -0
- package/dist/DSRTracker-C6u_jAaK.d.mts +163 -0
- package/dist/DSRTracker-Dr_aT0pg.d.ts +163 -0
- package/dist/{lawful-basis-entry-CxZrofwG.d.mts → LawfulBasisTracker-CBqOxX1D.d.mts} +3 -5
- package/dist/{lawful-basis-entry-15qjKcNO.d.ts → LawfulBasisTracker-Cg30NbDA.d.ts} +3 -5
- package/dist/NDPRDashboard-CLJpEg0X.d.mts +44 -0
- package/dist/NDPRDashboard-DDWNd2Ah.d.ts +44 -0
- package/dist/{policy-E0fXZkda.d.mts → PolicyExporter-Bgi6nz82.d.mts} +5 -7
- package/dist/{policy-D2_jh5-T.d.ts → PolicyExporter-BnvuFncj.d.ts} +5 -7
- package/dist/{ropa-entry-B0D7X1GV.d.ts → ROPAManager-BS4eB8Hw.d.mts} +4 -5
- package/dist/{ropa-entry-DiOThOc2.d.mts → ROPAManager-qxTrXLkD.d.ts} +4 -5
- package/dist/RegulatoryReportGenerator-BUYgzTTT.d.ts +282 -0
- package/dist/RegulatoryReportGenerator-DwcHcEFp.d.mts +282 -0
- package/dist/StepIndicator-D-nwRTyo.d.mts +171 -0
- package/dist/StepIndicator-D9ZATz_O.d.ts +171 -0
- package/dist/adapters.d.mts +25 -0
- package/dist/adapters.d.ts +25 -0
- package/dist/adapters.js +2 -0
- package/dist/adapters.mjs +2 -0
- package/dist/breach.d.mts +36 -431
- package/dist/breach.d.ts +36 -431
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-27NYSWUG.mjs +2 -0
- package/dist/chunk-2ORDHJRD.js +2 -0
- package/dist/chunk-2W7ARAW2.js +2 -0
- package/dist/chunk-3F34NACG.js +2 -0
- package/dist/chunk-3UWT64FI.mjs +2 -0
- package/dist/chunk-3V23O4ZJ.js +2 -0
- package/dist/chunk-3XAUN5IM.mjs +3 -0
- package/dist/chunk-44W4H2EY.js +2 -0
- package/dist/chunk-5VMHKNJY.js +2 -0
- package/dist/chunk-6D3ZUGBB.mjs +2 -0
- package/dist/chunk-6E54NSAO.mjs +2 -0
- package/dist/chunk-7F5F5YWI.mjs +2 -0
- package/dist/chunk-DQLDX5X6.js +316 -0
- package/dist/chunk-FR7ZYZXB.js +2 -0
- package/dist/chunk-FY5G6DGZ.js +7 -0
- package/dist/chunk-G26I6MP5.mjs +2 -0
- package/dist/chunk-GCQRHMTQ.mjs +144 -0
- package/dist/chunk-GPJVTGHR.mjs +2 -0
- package/dist/chunk-GVANK6PL.js +3 -0
- package/dist/chunk-HNZK7LY3.mjs +2 -0
- package/dist/chunk-IKEPXHCZ.js +2 -0
- package/dist/chunk-IQQW52EF.js +2 -0
- package/dist/chunk-ISSGO2YT.mjs +72 -0
- package/dist/chunk-JZKH5RMC.js +3 -0
- package/dist/chunk-KHRBU5K7.js +2 -0
- package/dist/chunk-LFNA6WYQ.mjs +2 -0
- package/dist/chunk-LU4PFST7.js +144 -0
- package/dist/chunk-NPI5T6NH.mjs +7 -0
- package/dist/chunk-NPLXE43Q.mjs +2 -0
- package/dist/chunk-P7BSBCB3.js +2 -0
- package/dist/chunk-PEH5GIMN.js +2 -0
- package/dist/chunk-RSUDIFZV.mjs +2 -0
- package/dist/chunk-SBNAMPAP.mjs +2 -0
- package/dist/chunk-SVCRYM4I.mjs +2 -0
- package/dist/chunk-TKBZRULW.mjs +316 -0
- package/dist/chunk-TVW6KBVV.mjs +2 -0
- package/dist/chunk-U6VWHC46.js +72 -0
- package/dist/chunk-UK656RCG.js +2 -0
- package/dist/chunk-UNKXYVXY.js +2 -0
- package/dist/chunk-UOSEH6DC.js +2 -0
- package/dist/chunk-V37BM2LF.js +2 -0
- package/dist/chunk-V3MXWGXU.mjs +2 -0
- package/dist/chunk-VDZKGCAF.js +2 -0
- package/dist/chunk-WLSW4Z4W.mjs +2 -0
- package/dist/chunk-XSK4BSZJ.mjs +2 -0
- package/dist/chunk-YJCGEOLO.mjs +2 -0
- package/dist/chunk-ZCZ5RRZO.js +2 -0
- package/dist/chunk-ZQSX5ZHB.mjs +3 -0
- package/dist/compliance-score-racQe_E_.d.mts +115 -0
- package/dist/compliance-score-racQe_E_.d.ts +115 -0
- package/dist/consent.d.mts +67 -295
- package/dist/consent.d.ts +67 -295
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +14 -48
- package/dist/core.d.ts +14 -48
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border-BBi9rZyO.d.mts +54 -0
- package/dist/cross-border-Dy-U9Hu6.d.ts +54 -0
- package/dist/{cross-border-BMcqLvjC.d.mts → cross-border-UyT00llA.d.mts} +1 -52
- package/dist/{cross-border-BMcqLvjC.d.ts → cross-border-UyT00llA.d.ts} +1 -52
- package/dist/cross-border.d.mts +32 -4
- package/dist/cross-border.d.ts +32 -4
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/dpia.d.mts +28 -284
- package/dist/dpia.d.ts +28 -284
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/dsr.d.mts +29 -300
- package/dist/dsr.d.ts +29 -300
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +23 -10
- package/dist/hooks.d.ts +23 -10
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +28 -19
- package/dist/index.d.ts +28 -19
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis.d.mts +31 -4
- package/dist/lawful-basis.d.ts +31 -4
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/policy-engine-C-tShzZH.d.mts +154 -0
- package/dist/policy-engine-DSQpT55_.d.ts +154 -0
- package/dist/policy-sections-CfNVBLCh.d.mts +54 -0
- package/dist/policy-sections-DqH0iZRf.d.ts +54 -0
- package/dist/policy.d.mts +117 -4
- package/dist/policy.d.ts +117 -4
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets.d.mts +114 -0
- package/dist/presets.d.ts +114 -0
- package/dist/presets.js +2 -0
- package/dist/presets.mjs +2 -0
- package/dist/{ropa-Li6UlL5H.d.ts → ropa-BDTM06tr.d.ts} +1 -49
- package/dist/{ropa-DP7pPPql.d.mts → ropa-CFHuT7jE.d.mts} +1 -49
- package/dist/ropa-CyynscU6.d.ts +51 -0
- package/dist/ropa-NIgxd8uP.d.mts +51 -0
- package/dist/ropa.d.mts +30 -4
- package/dist/ropa.d.ts +30 -4
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/sanitize-9mOO_cJW.d.mts +147 -0
- package/dist/sanitize-9mOO_cJW.d.ts +147 -0
- package/dist/styling-B7CBzYG7.d.ts +165 -0
- package/dist/styling-uJLsBbER.d.mts +165 -0
- package/dist/types-DK2CoKOC.d.mts +10 -0
- package/dist/types-DK2CoKOC.d.ts +10 -0
- package/dist/unstyled.d.mts +4 -4
- package/dist/unstyled.d.ts +4 -4
- package/dist/useAdaptivePolicyWizard-B9Op2gYM.d.ts +52 -0
- package/dist/useAdaptivePolicyWizard-N4eUM4Tj.d.mts +52 -0
- package/dist/{useBreach-BBSoIcZO.d.mts → useBreach-CPr86Yan.d.mts} +18 -2
- package/dist/{useBreach-lFLbSyAN.d.ts → useBreach-DkVXvtJK.d.ts} +18 -2
- package/dist/{useConsent-D0pAfTlb.d.ts → useConsent-DCNkIJHR.d.mts} +12 -2
- package/dist/{useConsent-DOt2Njst.d.mts → useConsent-dOcELSfX.d.ts} +12 -2
- package/dist/{useCrossBorderTransfer-DmtACeqW.d.ts → useCrossBorderTransfer-BGNZt2lk.d.mts} +15 -3
- package/dist/{useCrossBorderTransfer-BZVFCXfr.d.mts → useCrossBorderTransfer-COqjgjsu.d.ts} +15 -3
- package/dist/{useDPIA-DBsg2yZx.d.ts → useDPIA-Dl16Te3r.d.ts} +13 -2
- package/dist/{useDPIA-Da7-Q_yW.d.mts → useDPIA-DzWye8JB.d.mts} +13 -2
- package/dist/{useDSR-YYZ6FYFs.d.mts → useDSR-C1LksCfP.d.mts} +13 -2
- package/dist/{useDSR-CYI7WCXr.d.ts → useDSR-DZel52O1.d.ts} +13 -2
- package/dist/{useDefaultPrivacyPolicy-CUluF_ic.d.mts → useDefaultPrivacyPolicy-BsYttRey.d.mts} +13 -2
- package/dist/{useDefaultPrivacyPolicy-B7kTHbZh.d.ts → useDefaultPrivacyPolicy-C-mG-A5S.d.ts} +13 -2
- package/dist/{useLawfulBasis-CpWuHtyh.d.mts → useLawfulBasis-CKJ-kw84.d.mts} +13 -2
- package/dist/{useLawfulBasis-CCWF9waR.d.ts → useLawfulBasis-DFTmu1ca.d.ts} +13 -2
- package/dist/{useROPA-BhJ3kvHp.d.ts → useROPA-BSSU1rfx.d.ts} +14 -2
- package/dist/{useROPA-DLFdjkxP.d.mts → useROPA-C2hjaBTz.d.mts} +14 -2
- package/package.json +24 -3
- package/dist/chunk-2XFAV267.mjs +0 -2
- package/dist/chunk-32UIWTGD.js +0 -72
- package/dist/chunk-3YCV2BA6.js +0 -2
- package/dist/chunk-4A354HL3.js +0 -2
- package/dist/chunk-5ZBO2UPH.js +0 -2
- package/dist/chunk-6GGGTRDZ.mjs +0 -2
- package/dist/chunk-BZTTQS4A.mjs +0 -7
- package/dist/chunk-EKVTLHBQ.js +0 -2
- package/dist/chunk-GMLNWS2N.mjs +0 -2
- package/dist/chunk-IBEKLDBY.mjs +0 -2
- package/dist/chunk-ILCNDOBU.js +0 -2
- package/dist/chunk-K3GMTMQ6.js +0 -2
- package/dist/chunk-L52PDW6O.mjs +0 -2
- package/dist/chunk-LI6WJ3LZ.js +0 -2
- package/dist/chunk-LXRXDTPI.js +0 -2
- package/dist/chunk-NW4A3JW6.mjs +0 -2
- package/dist/chunk-OITITR6K.mjs +0 -2
- package/dist/chunk-PDJGTQMY.mjs +0 -2
- package/dist/chunk-T44JQT2O.mjs +0 -2
- package/dist/chunk-TCJCE6WN.js +0 -2
- package/dist/chunk-VMJBW3EF.mjs +0 -2
- package/dist/chunk-WSHSHIIM.mjs +0 -2
- package/dist/chunk-WW3X3ELF.js +0 -2
- package/dist/chunk-XMYUYQH7.mjs +0 -72
- package/dist/chunk-ZNTMZ6NM.js +0 -7
- package/dist/chunk-ZU73VG3X.js +0 -2
package/dist/chunk-IBEKLDBY.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-2SYNHRP6.mjs';import {a as a$3}from'./chunk-FXTZDKDC.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {b,a as a$2}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var ke=({requestTypes:A,onSubmit:z,onValidationError:M,title:K="Submit a Data Subject Request",description:te="Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",submitButtonText:oe="Submit Request",className:W="",buttonClassName:H="",showConfirmation:re=true,confirmationMessage:ie="Your request has been submitted successfully. You will receive a confirmation email shortly.",requireIdentityVerification:V=true,identifierTypes:l=[{id:"email",label:"Email Address"},{id:"account",label:"Account Number"},{id:"customer_id",label:"Customer ID"}],collectAdditionalContact:b$1=true,labels:D={},classNames:e,unstyled:m=false,isSubmitting:C=false,defaultValues:k,onReset:$})=>{var t,d,h,q,se,ge;let[I,_]=useState((k==null?void 0:k.requestType)||""),[E,F]=useState(((t=k==null?void 0:k.dataSubject)==null?void 0:t.fullName)||""),[B,L]=useState(((d=k==null?void 0:k.dataSubject)==null?void 0:d.email)||""),[Y,Z]=useState(((h=k==null?void 0:k.dataSubject)==null?void 0:h.phone)||""),[ae,P]=useState(((q=k==null?void 0:k.dataSubject)==null?void 0:q.identifierType)||((se=l[0])==null?void 0:se.id)||""),[G,Q]=useState(((ge=k==null?void 0:k.dataSubject)==null?void 0:ge.identifierValue)||""),[j,J]=useState((k==null?void 0:k.additionalInfo)||{}),[T,U]=useState(false),[o,i]=useState({}),v=()=>{var r;_(""),F(""),L(""),Z(""),P(((r=l[0])==null?void 0:r.id)||""),Q(""),J({}),U(false),i({}),$==null||$();},u=A.find(r=>r.id===I),R=r=>{_(r.target.value),J({});},s=(r,w)=>{J(X=>b(a$2({},X),{[r]:w}));},x=()=>{let r={};return E.trim()||(r.fullName="Full name is required"),B.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(B)||(r.email="Email is invalid"):r.email="Email is required",I||(r.requestType="Please select a request type"),V&&!G.trim()&&(r.identifierValue="Identifier value is required"),u!=null&&u.requiresAdditionalInfo&&u.additionalFields&&u.additionalFields.forEach(w=>{w.required&&!j[w.id]&&(r[`additional_${w.id}`]=`${w.label} is required`);}),i(r),r},S=r=>{r.preventDefault();let w=x();if(Object.keys(w).length>0){M==null||M(w);return}let X=Object.keys(j).length>0?Object.fromEntries(Object.entries(j).map(([be,le])=>[be,typeof le=="string"?a$3(le):le])):void 0,ne={requestType:I,dataSubject:{fullName:a$3(E),email:a$3(B),phone:Y?a$3(Y):void 0,identifierType:ae,identifierValue:a$3(G)},additionalInfo:X,submittedAt:Date.now()};z(ne),re&&U(true);};return T?jsxs("div",{className:a(`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${W}`,e==null?void 0:e.successMessage,m),children:[jsx("h2",{className:a("text-lg font-bold text-green-800 dark:text-green-200 mb-2",e==null?void 0:e.title,m),children:"Request Submitted"}),jsx("p",{className:a("text-green-700 dark:text-green-300",e==null?void 0:e.description,m),children:ie}),jsx("button",{onClick:()=>U(false),className:a(`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${H}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),m),children:"Submit Another Request"})]}):jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${W}`,e==null?void 0:e.root,m),children:[jsx("h2",{className:a("text-xl font-bold mb-2",e==null?void 0:e.title,m),children:K}),jsx("p",{className:a("mb-6 text-gray-600 dark:text-gray-300",e==null?void 0:e.description,m),children:te}),jsx("form",{onSubmit:S,className:a("",e==null?void 0:e.form,m),children:jsxs("div",{className:a("space-y-4",e==null?void 0:e.fieldGroup,m),children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Personal Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"fullName",className:a("block text-sm font-medium mb-1",e==null?void 0:e.label,m),children:[D.name||"Full Name"," ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"fullName",value:E,onChange:r=>F(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,m),required:true,"aria-invalid":!!o.fullName,"aria-describedby":o.fullName?"fullName-error":void 0}),o.fullName&&jsx("p",{id:"fullName-error",role:"alert",className:"mt-1 text-sm text-red-500",children:o.fullName})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"email",className:a("block text-sm font-medium mb-1",e==null?void 0:e.label,m),children:[D.email||"Email Address"," ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"email",id:"email",value:B,onChange:r=>L(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,m),required:true,"aria-invalid":!!o.email,"aria-describedby":o.email?"email-error":void 0}),o.email&&jsx("p",{id:"email-error",role:"alert",className:"mt-1 text-sm text-red-500",children:o.email})]}),b$1&&jsxs("div",{children:[jsx("label",{htmlFor:"phone",className:a("block text-sm font-medium mb-1",e==null?void 0:e.label,m),children:"Phone Number (Optional)"}),jsx("input",{type:"tel",id:"phone",value:Y,onChange:r=>Z(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,m)})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Request Details"}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"requestType",className:a("block text-sm font-medium mb-1",e==null?void 0:e.label,m),children:[D.requestType||"Request Type"," ",jsx("span",{className:"text-red-500",children:"*"})]}),jsxs("select",{id:"requestType",value:I,onChange:R,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,m),required:true,"aria-invalid":!!o.requestType,"aria-describedby":o.requestType?"requestType-error":void 0,children:[jsx("option",{value:"",children:"Select a request type"}),A.map(r=>jsx("option",{value:r.id,children:r.name},r.id))]}),o.requestType&&jsx("p",{id:"requestType-error",role:"alert",className:"mt-1 text-sm text-red-500",children:o.requestType})]}),u&&jsxs("div",{className:"mb-4 p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:u.description}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Estimated completion time: ",u.estimatedCompletionTime," ",u.estimatedCompletionTime===1?"day":"days"]})]}),jsxs("div",{className:"mb-4",children:[jsx("label",{htmlFor:"requestDescription",className:a("block text-sm font-medium mb-1",e==null?void 0:e.label,m),children:D.description||"Additional Information"}),jsx("textarea",{id:"requestDescription",className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.textarea,m),rows:4,placeholder:"Please provide any additional details that might help us process your request"})]})]}),V&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Identity Verification"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3",children:"To protect your privacy, we need to verify your identity before processing your request."}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"identifierType",className:a("block text-sm font-medium mb-1",e==null?void 0:e.label,m),children:["Identifier Type ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("select",{id:"identifierType",value:ae,onChange:r=>P(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,m),required:true,children:l.map(r=>jsx("option",{value:r.id,children:r.label},r.id))})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"identifierValue",className:a("block text-sm font-medium mb-1",e==null?void 0:e.label,m),children:["Identifier Value ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"identifierValue",value:G,onChange:r=>Q(r.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,m),required:true,"aria-invalid":!!o.identifierValue,"aria-describedby":o.identifierValue?"identifierValue-error":void 0}),o.identifierValue&&jsx("p",{id:"identifierValue-error",role:"alert",className:"mt-1 text-sm text-red-500",children:o.identifierValue})]})]})]}),(u==null?void 0:u.requiresAdditionalInfo)&&u.additionalFields&&u.additionalFields.length>0&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsx("div",{className:"space-y-4",children:u.additionalFields.map(r=>jsxs("div",{children:[jsxs("label",{htmlFor:r.id,className:a("block text-sm font-medium mb-1",e==null?void 0:e.label,m),children:[r.label," ",r.required&&jsx("span",{className:"text-red-500",children:"*"})]}),r.type==="text"&&jsx("input",{type:"text",id:r.id,value:j[r.id]||"",onChange:w=>s(r.id,w.target.value),placeholder:r.placeholder,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,m),required:r.required,"aria-invalid":!!o[`additional_${r.id}`],"aria-describedby":o[`additional_${r.id}`]?`additional-${r.id}-error`:void 0}),r.type==="textarea"&&jsx("textarea",{id:r.id,value:j[r.id]||"",onChange:w=>s(r.id,w.target.value),placeholder:r.placeholder,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.textarea,m),rows:4,required:r.required,"aria-invalid":!!o[`additional_${r.id}`],"aria-describedby":o[`additional_${r.id}`]?`additional-${r.id}-error`:void 0}),r.type==="select"&&r.options&&jsxs("select",{id:r.id,value:j[r.id]||"",onChange:w=>s(r.id,w.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,m),required:r.required,"aria-invalid":!!o[`additional_${r.id}`],"aria-describedby":o[`additional_${r.id}`]?`additional-${r.id}-error`:void 0,children:[jsx("option",{value:"",children:r.placeholder||"Select an option"}),r.options.map(w=>jsx("option",{value:w,children:w},w))]}),r.type==="checkbox"&&jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{type:"checkbox",id:r.id,checked:!!j[r.id],onChange:w=>s(r.id,w.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",required:r.required,"aria-invalid":!!o[`additional_${r.id}`],"aria-describedby":o[`additional_${r.id}`]?`additional-${r.id}-error`:void 0})}),jsx("div",{className:"ml-3 text-sm",children:jsx("label",{htmlFor:r.id,className:"text-gray-700 dark:text-gray-300",children:r.placeholder||r.label})})]}),r.type==="file"&&jsx("input",{type:"file",id:r.id,onChange:w=>{var ne;let X=(ne=w.target.files)==null?void 0:ne[0];X&&s(r.id,X);},className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,m),required:r.required,"aria-invalid":!!o[`additional_${r.id}`],"aria-describedby":o[`additional_${r.id}`]?`additional-${r.id}-error`:void 0}),o[`additional_${r.id}`]&&jsx("p",{id:`additional-${r.id}-error`,role:"alert",className:"mt-1 text-sm text-red-500",children:o[`additional_${r.id}`]})]},r.id))})]}),jsxs("div",{className:"mt-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("h3",{className:"text-sm font-semibold mb-2",children:"Privacy Notice"}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300",children:"The information you provide in this form will be used solely for the purpose of processing your data subject request. We will retain this information for as long as necessary to fulfill your request and to comply with our legal obligations. For more information, please refer to our Privacy Policy."})]}),jsxs("div",{className:"mt-6 flex gap-3 relative",children:[C&&(e==null?void 0:e.loadingOverlay)&&jsx("div",{className:e.loadingOverlay}),jsx("button",{type:"submit",disabled:C,className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${H} ${C?"opacity-50 cursor-not-allowed":""}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),m),children:C?"Submitting...":D.submit||oe}),jsx("button",{type:"button",onClick:v,className:a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,m),children:"Reset"})]})]})})]})};var je=({requests:A,onSelectRequest:z,onUpdateStatus:M,onAssignRequest:K,title:te="Data Subject Request Dashboard",description:oe="Track and manage data subject requests in compliance with NDPA Part IV requirements.",className:W="",buttonClassName:H="",showRequestDetails:re=true,showRequestTimeline:ie=true,showDeadlineAlerts:V=true,assignees:l=[],classNames:b,unstyled:D=false})=>{let[e,m]=useState(null),[C,k]=useState(A),[$,I]=useState("all"),[_,E]=useState("all"),[F,B]=useState(""),[L,Y]=useState("createdAt"),[Z,ae]=useState("desc"),[P,G]=useState("");useEffect(()=>{let t=[...A];if($!=="all"&&(t=t.filter(d=>d.status===$)),_!=="all"&&(t=t.filter(d=>d.type===_)),F){let d=F.toLowerCase();t=t.filter(h=>h.subject.name.toLowerCase().includes(d)||h.subject.email.toLowerCase().includes(d)||h.description&&h.description.toLowerCase().includes(d));}t.sort((d,h)=>{let q=0;switch(L){case "createdAt":q=d.createdAt-h.createdAt;break;case "dueDate":q=(d.dueDate||0)-(h.dueDate||0);break;case "type":q=d.type.localeCompare(h.type);break;case "status":q=d.status.localeCompare(h.status);break;default:q=d.createdAt-h.createdAt;}return Z==="asc"?q:-q}),k(t);},[A,$,_,F,L,Z]),useEffect(()=>{C.length>0&&!e&&m(C[0].id);},[C,e]);let Q=t=>{m(t),z&&z(t);},j=t=>{e&&M&&M(e,t);},J=()=>{e&&P&&K&&(K(e,P),G(""));},T=t=>new Date(t).toLocaleDateString(),U=t=>{let d=Date.now(),h=(t-d)/(1440*60*1e3);return Math.ceil(h)},o=e?A.find(t=>t.id===e):null,i=t=>{let d={information:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",access:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",rectification:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",erasure:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",restriction:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",portability:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",objection:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",automated_decision_making:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},h={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${d[t]}`,children:h[t]})},v=t=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{pending:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",inProgress:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",completed:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",rejected:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",awaitingVerification:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200"}[t]}`,b==null?void 0:b.statusBadge,D),children:t==="inProgress"?"In Progress":t==="awaitingVerification"?"Awaiting Verification":t.charAt(0).toUpperCase()+t.slice(1)}),u=t=>{if(!t.dueDate)return null;let d=U(t.dueDate);return d<=0?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Deadline Passed"}),jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The response deadline has passed. Immediate action is required."})]}):d<=3?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Deadline Approaching"}),jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",d," day",d!==1?"s":""," remaining until the response deadline."]})]}):d<=7?jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Deadline Approaching"}),jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:[d," days remaining until the response deadline."]})]}):jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Deadline Tracking"}),jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:[d," days remaining until the response deadline."]})]})},R=t=>{let d=[{title:"Request Received",date:t.createdAt,completed:true,description:`Request was received on ${T(t.createdAt)}.`}];return t.verifiedAt?d.push({title:"Identity Verified",date:t.verifiedAt,completed:true,description:`Data subject's identity was verified on ${T(t.verifiedAt)}.`}):t.status==="awaitingVerification"&&d.push({title:"Identity Verification",date:Date.now(),completed:false,description:"Awaiting verification of data subject's identity."}),(t.status==="inProgress"||t.status==="completed"||t.status==="rejected")&&d.push({title:"Processing Started",date:t.updatedAt,completed:true,description:`Request processing started on ${T(t.updatedAt)}.`}),t.status==="completed"?d.push({title:"Request Completed",date:t.completedAt||Date.now(),completed:true,description:`Request was completed on ${T(t.completedAt||Date.now())}.`}):t.status==="rejected"&&d.push({title:"Request Rejected",date:t.completedAt||Date.now(),completed:true,description:`Request was rejected on ${T(t.completedAt||Date.now())}.${t.rejectionReason?` Reason: ${t.rejectionReason}`:""}`}),t.dueDate&&d.push({title:"Response Deadline",date:t.dueDate,completed:Date.now()>t.dueDate,description:`Response is due by ${T(t.dueDate)}.`}),jsxs("div",{className:"mt-6",children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Request Timeline"}),jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:d.map((h,q)=>jsxs("li",{className:"mb-6 ml-4",children:[jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${h.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-600 dark:text-gray-500",children:h.date?T(h.date):"Pending"}),jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:h.title}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:h.description})]},q))})]})},s=()=>[{value:"all",label:"All Types"},{value:"information",label:"Information (NDPA Section 29)"},{value:"access",label:"Access (NDPA Section 30)"},{value:"rectification",label:"Rectification (NDPA Section 31)"},{value:"erasure",label:"Erasure (NDPA Section 32)"},{value:"restriction",label:"Restriction (NDPA Section 33)"},{value:"portability",label:"Portability (NDPA Section 34)"},{value:"objection",label:"Objection (NDPA Section 35)"},{value:"automated_decision_making",label:"Automated Decision-Making (NDPA Section 36)"}].map(d=>jsx("option",{value:d.value,children:d.label},d.value)),x=()=>[{value:"all",label:"All Statuses"},{value:"pending",label:"Pending"},{value:"awaitingVerification",label:"Awaiting Verification"},{value:"inProgress",label:"In Progress"},{value:"completed",label:"Completed"},{value:"rejected",label:"Rejected"}].map(d=>jsx("option",{value:d.value,children:d.label},d.value)),S=()=>[{value:"pending",label:"Pending"},{value:"awaitingVerification",label:"Awaiting Verification"},{value:"inProgress",label:"In Progress"},{value:"completed",label:"Completed"},{value:"rejected",label:"Rejected"}].map(d=>jsx("option",{value:d.value,children:d.label},d.value));return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${W}`,b==null?void 0:b.root,D),children:[jsxs("div",{className:a("",b==null?void 0:b.header,D),children:[jsx("h2",{className:a("text-xl font-bold mb-2",b==null?void 0:b.title,D),children:te}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:oe})]}),jsxs("div",{className:a("mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",b==null?void 0:b.filters,D),children:[jsxs("div",{children:[jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsx("select",{id:"statusFilter",value:$,onChange:t=>I(t.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:x()})]}),jsxs("div",{children:[jsx("label",{htmlFor:"typeFilter",className:"block text-sm font-medium mb-1",children:"Request Type Filter"}),jsx("select",{id:"typeFilter",value:_,onChange:t=>E(t.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:s()})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxs("select",{id:"sortBy",value:L,onChange:t=>Y(t.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsx("option",{value:"createdAt",children:"Date Received"}),jsx("option",{value:"dueDate",children:"Due Date"}),jsx("option",{value:"type",children:"Request Type"}),jsx("option",{value:"status",children:"Status"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsx("input",{type:"text",id:"searchTerm",value:F,onChange:t=>B(t.target.value),placeholder:"Search requests...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxs("div",{className:"md:col-span-1",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"DSR Requests"}),C.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data subject requests found."}):jsx("div",{className:a("space-y-2 max-h-96 overflow-y-auto pr-2",b==null?void 0:b.requestList,D),children:C.map(t=>{let d=t.dueDate?U(t.dueDate):null,h=null;return d!==null&&(d<=0?h=jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):d<=3?h=jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):d<=7&&(h=jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Soon"}))),jsxs("div",{className:a(`p-3 rounded-md cursor-pointer ${e===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"}`,b==null?void 0:b.requestItem,D),onClick:()=>Q(t.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:t.subject.name}),i(t.type)]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:t.subject.email}),jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:["Received: ",T(t.createdAt)]}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsx("div",{children:v(t.status)}),jsx("div",{children:h})]})]},t.id)})})]}),jsx("div",{className:a("md:col-span-2",b==null?void 0:b.detailPanel,D),children:o?jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsx("h3",{className:"text-lg font-medium",children:o.subject.name}),jsxs("div",{className:"flex space-x-2",children:[i(o.type),v(o.status)]})]}),V&&o.dueDate&&jsx("div",{className:"mb-4",children:u(o)}),re&&jsxs("div",{className:"mb-6",children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Email:"})," ",o.subject.email]}),o.subject.phone&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Phone:"})," ",o.subject.phone]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Received:"})," ",T(o.createdAt)]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Request Type:"})," ",{information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"}[o.type]||o.type]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",o.status==="inProgress"?"In Progress":o.status==="awaitingVerification"?"Awaiting Verification":o.status.charAt(0).toUpperCase()+o.status.slice(1)]}),o.dueDate&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Due Date:"})," ",T(o.dueDate)]})]})]}),o.description&&jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium",children:"Request Details:"}),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:o.description})]}),o.additionalInfo&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium",children:"Additional Information:"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:typeof o.additionalInfo=="object"?JSON.stringify(o.additionalInfo,null,2):String(o.additionalInfo||"No additional information provided")})]})]}),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsx("h3",{className:"text-md font-medium mb-2",children:"Update Status"}),jsxs("div",{className:"flex space-x-2",children:[jsx("select",{value:o.status,onChange:t=>j(t.target.value),className:"flex-grow px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:S()}),jsx("button",{onClick:()=>j(o.status),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${H}`,children:"Update"})]})]}),l.length>0&&jsxs("div",{children:[jsx("h3",{className:"text-md font-medium mb-2",children:"Assign Request"}),jsxs("div",{className:"flex space-x-2",children:[jsxs("select",{value:P,onChange:t=>G(t.target.value),className:"flex-grow px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsx("option",{value:"",children:"Select Assignee"}),l.map(t=>jsx("option",{value:t,children:t},t))]}),jsx("button",{onClick:J,disabled:!P,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] disabled:bg-gray-300 disabled:text-gray-500 ${H}`,children:"Assign"})]})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Request Summary"}),jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:jsx("pre",{children:JSON.stringify(a$1(o),null,2)})})})]}),ie&&R(o)]}):jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Select a request to view details"})})})]})]})};var _e=({requests:A,onSelectRequest:z,title:M="DSR Request Tracker",description:K="Track the status and progress of data subject requests as required by NDPA Part IV.",className:te="",buttonClassName:oe="",showSummaryStats:W=true,showTypeBreakdown:H=true,showStatusBreakdown:re=true,showTimelineChart:ie=true,showOverdueRequests:V=true,classNames:l,unstyled:b=false})=>{let[D,e]=useState("30days"),[m,C]=useState(A),[k,$]=useState([]),[I,_]=useState([]);useEffect(()=>{let i=Date.now(),v;switch(D){case "7days":v=A.filter(s=>i-s.createdAt<=10080*60*1e3);break;case "30days":v=A.filter(s=>i-s.createdAt<=720*60*60*1e3);break;case "90days":v=A.filter(s=>i-s.createdAt<=2160*60*60*1e3);break;default:v=[...A];}C(v);let u=v.filter(s=>s.dueDate&&i>s.dueDate&&s.status!=="completed"&&s.status!=="rejected");$(u);let R=v.filter(s=>s.dueDate&&i<s.dueDate&&s.dueDate-i<=10080*60*1e3&&s.status!=="completed"&&s.status!=="rejected");_(R);},[A,D]);let E=i=>{z&&z(i);},F=i=>new Date(i).toLocaleDateString(),B=i=>{let v=Date.now(),u=(i-v)/(1440*60*1e3);return Math.ceil(u)},L=()=>{let i=m.filter(u=>u.status==="completed"&&u.completedAt&&u.createdAt);if(i.length===0)return null;let v=i.reduce((u,R)=>{let s=((R.completedAt||0)-R.createdAt)/864e5;return u+s},0);return Number((v/i.length).toFixed(1))},Y=()=>{let i=m.filter(u=>(u.status==="completed"||u.status==="rejected")&&u.completedAt&&u.dueDate);if(i.length===0)return null;let v=i.filter(u=>(u.completedAt||0)<=(u.dueDate||0));return Math.round(v.length/i.length*100)},Z=()=>{let i={};return m.forEach(v=>{i[v.type]=(i[v.type]||0)+1;}),{information:i.information||0,access:i.access||0,rectification:i.rectification||0,erasure:i.erasure||0,restriction:i.restriction||0,portability:i.portability||0,objection:i.objection||0,automated_decision_making:i.automated_decision_making||0}},ae=()=>{let i={};return m.forEach(v=>{i[v.status]=(i[v.status]||0)+1;}),{pending:i.pending||0,awaitingVerification:i.awaitingVerification||0,inProgress:i.inProgress||0,completed:i.completed||0,rejected:i.rejected||0}},P=i=>{let v={information:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",access:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",rectification:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",erasure:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",restriction:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",portability:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",objection:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",automated_decision_making:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},u={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${v[i]}`,children:u[i]})},Q=()=>{let i=m.length,v=m.filter(x=>x.status!=="completed"&&x.status!=="rejected").length;m.filter(x=>x.status==="completed"||x.status==="rejected").length;let R=L(),s=Y();return jsxs("div",{className:a("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",l==null?void 0:l.stats,b),children:[jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",l==null?void 0:l.statCard,b),children:[jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Total Requests"}),jsx("p",{className:"text-2xl font-bold",children:i})]}),jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",l==null?void 0:l.statCard,b),children:[jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Pending Requests"}),jsx("p",{className:"text-2xl font-bold",children:v})]}),jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",l==null?void 0:l.statCard,b),children:[jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Avg. Response Time"}),jsx("p",{className:"text-2xl font-bold",children:R!==null?`${R} days`:"N/A"})]}),jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",l==null?void 0:l.statCard,b),children:[jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Compliance Rate"}),jsx("p",{className:"text-2xl font-bold",children:s!==null?`${s}%`:"N/A"})]})]})},j=()=>{let i=Z(),v=m.length,u=Object.entries(i).sort(([,R],[,s])=>s-R).map(([R])=>R);return jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",l==null?void 0:l.table,b),children:[jsx("h3",{className:a("text-lg font-medium mb-4",l==null?void 0:l.tableHeader,b),children:"Request Types"}),v===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsx("div",{className:"space-y-4",children:u.map(R=>{let s=i[R],x=Math.round(s/v*100);return jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-center mb-1",children:[jsxs("div",{className:"flex items-center",children:[P(R),jsxs("span",{className:"ml-2 text-sm",children:[s," requests"]})]}),jsxs("span",{className:"text-sm font-medium",children:[x,"%"]})]}),jsx("div",{className:"w-full bg-gray-200 dark:bg-gray-600 rounded-full h-2.5",children:jsx("div",{className:"bg-[rgb(var(--ndpr-primary))] h-2.5 rounded-full",style:{width:`${x}%`}})})]},R)})})]})},J=()=>{let i=ae(),v=m.length,u=["pending","awaitingVerification","inProgress","completed","rejected"],R={pending:"bg-yellow-500",awaitingVerification:"bg-purple-500",inProgress:"bg-blue-500",completed:"bg-green-500",rejected:"bg-red-500"};return jsxs("div",{className:a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",l==null?void 0:l.table,b),children:[jsx("h3",{className:a("text-lg font-medium mb-4",l==null?void 0:l.tableHeader,b),children:"Request Status"}),v===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxs("div",{children:[jsx("div",{className:"flex h-4 mb-2",children:u.map(s=>{let x=i[s],S=x/v*100;return S>0?jsx("div",{className:`${R[s]} first:rounded-l-full last:rounded-r-full`,style:{width:`${S}%`},title:`${s}: ${x} (${Math.round(S)}%)`},s):null})}),jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 mt-4",children:u.map(s=>{let x=i[s],S=Math.round(x/v*100);return jsxs("div",{className:"flex items-center",children:[jsx("div",{className:`w-3 h-3 rounded-full ${R[s]} mr-2`}),jsxs("div",{children:[jsx("p",{className:"text-xs font-medium",children:s==="inProgress"?"In Progress":s==="awaitingVerification"?"Awaiting Verification":s.charAt(0).toUpperCase()+s.slice(1)}),jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:[x," (",S,"%)"]})]})]},s)})})]})]})},T=()=>{let i={};m.forEach(x=>{let S=new Date(x.createdAt),t=`${S.getFullYear()}-${String(S.getMonth()+1).padStart(2,"0")}`;i[t]=(i[t]||0)+1;});let u=Object.keys(i).sort().slice(-6),R=Math.max(...Object.values(i).filter(x=>x>0),1),s=x=>{let[S,t]=x.split("-");return `${t}/${S.slice(2)}`};return jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Request Timeline"}),u.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxs("div",{className:"h-40",children:[jsx("div",{className:"flex h-32 items-end justify-between space-x-2",children:u.map(x=>{let S=i[x],t=`${S/R*100}%`;return jsx("div",{className:"flex flex-col items-center flex-1",children:jsx("div",{className:"w-full bg-[rgb(var(--ndpr-primary))] rounded-t",style:{height:t},title:`${s(x)}: ${S} requests`})},x)})}),jsx("div",{className:"flex justify-between mt-2",children:u.map(x=>jsx("div",{className:"text-xs text-center",children:s(x)},x))})]})]})},U=()=>jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Overdue Requests"}),k.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No overdue requests."}):jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:k.map(i=>jsxs("div",{className:a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md cursor-pointer hover:bg-red-100 dark:hover:bg-red-900/30",l==null?void 0:l.tableRow,b),onClick:()=>E(i.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:i.subject.name}),P(i.type)]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:i.subject.email}),jsxs("div",{className:"flex justify-between items-center",children:[jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:["Due: ",F(i.dueDate||0)]}),jsxs("p",{className:"text-xs font-bold text-red-600 dark:text-red-400",children:["Overdue by ",Math.abs(B(i.dueDate||0))," days"]})]})]},i.id))})]}),o=()=>jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Upcoming Deadlines"}),I.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No upcoming deadlines in the next 7 days."}):jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:I.map(i=>{let v=B(i.dueDate||0);return jsxs("div",{className:a("p-3 bg-yellow-50 dark:bg-yellow-900/20 rounded-md cursor-pointer hover:bg-yellow-100 dark:hover:bg-yellow-900/30",l==null?void 0:l.tableRow,b),onClick:()=>E(i.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:i.subject.name}),P(i.type)]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:i.subject.email}),jsxs("div",{className:"flex justify-between items-center",children:[jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:["Due: ",F(i.dueDate||0)]}),jsxs("p",{className:`text-xs font-bold ${v<=3?"text-red-600 dark:text-red-400":"text-yellow-600 dark:text-yellow-400"}`,children:["Due in ",v," days"]})]})]},i.id)})})]});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${te}`,l==null?void 0:l.root,b),children:[jsxs("div",{className:a("flex flex-col md:flex-row md:justify-between md:items-center mb-6",l==null?void 0:l.header,b),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-bold mb-2",l==null?void 0:l.title,b),children:M}),jsx("p",{className:"text-gray-600 dark:text-gray-300",children:K})]}),jsxs("div",{className:"mt-4 md:mt-0",children:[jsx("label",{htmlFor:"timeframe",className:"block text-sm font-medium mb-1",children:"Timeframe"}),jsxs("select",{id:"timeframe",value:D,onChange:i=>e(i.target.value),className:"px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsx("option",{value:"7days",children:"Last 7 Days"}),jsx("option",{value:"30days",children:"Last 30 Days"}),jsx("option",{value:"90days",children:"Last 90 Days"}),jsx("option",{value:"all",children:"All Time"})]})]})]}),W&&Q(),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[jsxs("div",{children:[H&&j(),re&&J()]}),jsxs("div",{children:[ie&&T(),V&&U(),V&&o()]})]})]})};export{ke as a,je as b,_e as c};//# sourceMappingURL=chunk-IBEKLDBY.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-IBEKLDBY.mjs.map
|
package/dist/chunk-ILCNDOBU.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var m=react.createContext({}),g=u=>{var i=u,{children:t}=i,e=chunkMQFZHA2D_js.c(i,["children"]);let n=react.useMemo(()=>{if(!e.theme)return;let r={};return e.theme.primary&&(r["--ndpr-primary"]=e.theme.primary),e.theme.primaryHover&&(r["--ndpr-primary-hover"]=e.theme.primaryHover),e.theme.primaryForeground&&(r["--ndpr-primary-foreground"]=e.theme.primaryForeground),Object.keys(r).length>0?r:void 0},[e.theme]);return jsxRuntime.jsx(m.Provider,{value:e,children:n?jsxRuntime.jsx("div",{style:n,children:t}):t})};function P(){return react.useContext(m)}exports.a=g;exports.b=P;//# sourceMappingURL=chunk-ILCNDOBU.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-ILCNDOBU.js.map
|
package/dist/chunk-K3GMTMQ6.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 he=({options:a,onSave:y,title:m="We Value Your Privacy",description:A="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:I="Accept All",rejectAllButtonText:P="Reject All",customizeButtonText:E="Customize",saveButtonText:O="Save Preferences",position:x="bottom",zIndex:p=9999,version:u="1.0",show:h,manageStorage:n=true,storageKey:l="ndpr_consent",className:z="",buttonClassName:k="",primaryButtonClassName:L="",secondaryButtonClassName:C="",classNames:e,unstyled:r,onAnalytics:c})=>{let[f,b]=react.useState(false),[w,R]=react.useState(false),[S,i]=react.useState({}),v=react.useRef(null),M=react.useRef(null),G=react.useRef(false),D=react.useCallback((t,d)=>{c==null||c(chunkMQFZHA2D_js.a({action:t,timestamp:Date.now(),version:u},d!==void 0?{categories:d}:{}));},[c,u]);react.useEffect(()=>{let t={};if(a.forEach(d=>{t[d.id]=d.defaultValue||false;}),i(t),h===void 0)if(!n)b(true);else {let d=localStorage.getItem(l);if(d)try{JSON.parse(d).version!==u?b(!0):b(!1);}catch(Y){b(true);}else b(true);}else b(h);},[a,l,u,n]),react.useEffect(()=>{h!==void 0&&b(h);},[h]);let oe=()=>{let t={};a.forEach(d=>{t[d.id]=true;}),D("accepted_all",t),U(t);},ie=()=>{let t={};a.forEach(d=>{t[d.id]=d.required||false;}),D("rejected_all",t),U(t);},de=(t,d)=>{i(Y=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},Y),{[t]:d}));},ge=()=>{let t={};a.forEach(d=>{t[d.id]=true;}),i(t);},ae=()=>{let t={};a.forEach(d=>{t[d.id]=d.required||false;}),i(t);},Q=a.length>0&&a.every(t=>S[t.id]),ue=()=>{D("customized",S),U(S);},U=t=>{let d={consents:t,timestamp:Date.now(),version:u,method:w?"customize":"banner",hasInteracted:true};n&&localStorage.setItem(l,JSON.stringify(d)),y(d),b(false),R(false);},X=react.useCallback(()=>{D("dismissed"),b(false),R(false);},[D]);if(react.useEffect(()=>{if(!f)return;let t=d=>{d.key==="Escape"&&X();};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[f,X]),react.useEffect(()=>{f&&!G.current&&(G.current=true,D("shown")),f||(G.current=false);},[f,D]),react.useEffect(()=>{f&&v.current&&v.current.focus();},[f]),react.useEffect(()=>{if(w&&M.current){let t=M.current;t.style.maxHeight="0px",t.style.opacity="0",t.offsetHeight,t.style.maxHeight=`${t.scrollHeight}px`,t.style.opacity="1";}},[w]),!f)return null;let ce=(e==null?void 0:e.primaryButton)||(e==null?void 0:e.acceptButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${k} ${L}`,Z=(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.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 ${k} ${C}`,fe=(e==null?void 0:e.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${k}`,pe=(e==null?void 0:e.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${k} ${L}`,J=x==="inline",V=x==="center",j;J||V?j="":x==="top"?j="fixed inset-x-0 top-0":j="fixed inset-x-0 bottom-0";let H=jsxRuntime.jsx("div",{ref:v,tabIndex:-1,"data-ndpr-component":"consent-banner",className:chunkE64TU6IU_js.a(`${J?"":j} bg-white dark:bg-gray-800 shadow-lg p-3 sm:p-4 border border-gray-200 dark:border-gray-700 ${V?"max-w-lg w-full":""} ${z}`,e==null?void 0:e.root,r),style:!J&&!V?{zIndex:p}: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",e==null?void 0:e.container,r),children:[jsxRuntime.jsx("h2",{id:"consent-banner-title",className:chunkE64TU6IU_js.a("text-lg font-bold mb-2",e==null?void 0:e.title,r),children:m}),jsxRuntime.jsx("p",{id:"consent-banner-description",className:chunkE64TU6IU_js.a("text-sm sm:text-base mb-4",e==null?void 0:e.description,r),children:A}),w&&jsxRuntime.jsxs("div",{ref:M,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",e==null?void 0:e.customizePanel,r),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:Q?ae:ge,className:chunkE64TU6IU_js.a("text-sm font-medium text-[rgb(var(--ndpr-primary))] hover:underline",e==null?void 0:e.selectAllButton,r),children:Q?"Deselect All":"Select All"})}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-3",e==null?void 0:e.optionsList,r),children:a.map(t=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex items-start",e==null?void 0:e.optionItem,r),children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:`consent-${t.id}`,type:"checkbox",checked:S[t.id]||false,onChange:d=>de(t.id,d.target.checked),disabled:t.required,className:chunkE64TU6IU_js.a("h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.optionCheckbox,r)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:`consent-${t.id}`,className:chunkE64TU6IU_js.a("font-medium",e==null?void 0:e.optionLabel,r),children:[t.label," ",t.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-400",e==null?void 0:e.optionDescription,r),children:t.description})]})]},t.id))}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-4 flex flex-col sm:flex-row flex-wrap gap-2",e==null?void 0:e.buttonGroup,r),children:[jsxRuntime.jsx("button",{onClick:ue,className:chunkE64TU6IU_js.a(pe,e==null?void 0:e.saveButton,r),children:O}),jsxRuntime.jsx("button",{onClick:()=>R(false),className:chunkE64TU6IU_js.a(Z,e==null?void 0:e.rejectButton,r),children:"Back"})]})]}),!w&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col sm:flex-row flex-wrap gap-2",e==null?void 0:e.buttonGroup,r),children:[jsxRuntime.jsx("button",{onClick:oe,className:chunkE64TU6IU_js.a(ce,e==null?void 0:e.acceptButton,r),children:I}),jsxRuntime.jsx("button",{onClick:ie,className:chunkE64TU6IU_js.a(Z,e==null?void 0:e.rejectButton,r),children:P}),jsxRuntime.jsx("button",{onClick:()=>R(true),className:chunkE64TU6IU_js.a(fe,e==null?void 0:e.customizeButton,r),children:E})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("mt-2 text-xs text-gray-600 dark:text-gray-400",void 0,r),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(J)return H;if(V){let t=jsxRuntime.jsxs("div",{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:p},children:[jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"relative",children:H})]});return typeof document!="undefined"?reactDom.createPortal(t,document.body):t}return typeof document!="undefined"?reactDom.createPortal(H,document.body):H};var Re=({options:a,settings:y,onSave:m,title:A="Manage Your Privacy Settings",description:I="Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function. Consent management is provided in accordance with NDPA Sections 25-26.",saveButtonText:P="Save Preferences",resetButtonText:E="Reset to Defaults",version:O="1.0",className:x="",buttonClassName:p="",primaryButtonClassName:u="",secondaryButtonClassName:h="",classNames:n,unstyled:l,showSuccessMessage:z=true,successMessage:k="Your preferences have been saved.",successMessageDuration:L=3e3})=>{let[C,e]=react.useState({}),[r,c]=react.useState(false);react.useEffect(()=>{if(y&&y.consents)e(y.consents);else {let i={};a.forEach(v=>{i[v.id]=v.defaultValue||false;}),e(i);}},[a,y]);let f=(i,v)=>{e(M=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},M),{[i]:v}));},b=()=>{let i={consents:C,timestamp:Date.now(),version:O,method:"manager",hasInteracted:true};m(i),z&&(c(true),setTimeout(()=>{c(false);},L));},w=()=>{let i={};a.forEach(v=>{i[v.id]=v.defaultValue||false;}),e(i);},R=(n==null?void 0:n.primaryButton)||(n==null?void 0:n.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${p} ${u}`,S=(n==null?void 0:n.secondaryButton)||(n==null?void 0:n.resetButton)||`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 ${p} ${h}`;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 ${x}`,n==null?void 0:n.root,l),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",n==null?void 0:n.title,l),children:A}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("mb-6 text-gray-600 dark:text-gray-300",n==null?void 0:n.description,l),children:I}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-6",n==null?void 0:n.optionsList,l),children:a.map(i=>jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("border-b border-gray-200 dark:border-gray-700 pb-4 last:border-0",n==null?void 0:n.optionItem,l),children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:i.label}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:i.description})]}),jsxRuntime.jsx("div",{className:"ml-4 flex-shrink-0",children:jsxRuntime.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",className:"sr-only peer",checked:C[i.id]||false,onChange:v=>f(i.id,v.target.checked),disabled:i.required}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a(`w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-[rgb(var(--ndpr-ring)/0.3)] rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-[rgb(var(--ndpr-primary))] ${i.required?"opacity-60":""}`,n==null?void 0:n.toggle,l)}),jsxRuntime.jsxs("span",{className:"ml-3 text-sm font-medium text-gray-900 dark:text-gray-300",children:[C[i.id]?"Enabled":"Disabled",i.required&&jsxRuntime.jsx("span",{className:"text-xs text-red-500 ml-1",children:"(Required)"})]})]})})]})},i.id))}),r&&jsxRuntime.jsx("div",{className:"mt-4 p-3 bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-200 rounded-md",children:k}),jsxRuntime.jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[jsxRuntime.jsx("button",{onClick:b,className:chunkE64TU6IU_js.a(R,n==null?void 0:n.saveButton,l),children:P}),jsxRuntime.jsx("button",{onClick:w,className:chunkE64TU6IU_js.a(S,n==null?void 0:n.resetButton,l),children:E})]}),jsxRuntime.jsxs("div",{className:"mt-4 text-xs text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsxs("p",{children:["Last updated: ",y?new Date(y.timestamp).toLocaleString():"Never"]}),jsxRuntime.jsxs("p",{children:["Version: ",O]})]})]})};var Oe=({settings:a,storageOptions:y={},onLoad:m,onSave:A,autoSave:I=true,autoLoad:P=true,classNames:E,unstyled:O,children:x})=>{let{storageKey:p="ndpr_consent",storageType:u="localStorage",cookieOptions:h={}}=y,[n,l]=react.useState(false);react.useEffect(()=>{P&&!n&&z();},[P,n]),react.useEffect(()=>{I&&n&&k(a);},[a,I,n]);let z=()=>{let e=null;try{if(u==="localStorage"&&typeof window!="undefined"){let r=localStorage.getItem(p);r&&(e=JSON.parse(r));}else if(u==="sessionStorage"&&typeof window!="undefined"){let r=sessionStorage.getItem(p);r&&(e=JSON.parse(r));}else if(u==="cookie"&&typeof document!="undefined"){let c=document.cookie.split(";").find(f=>f.trim().startsWith(`${p}=`));if(c){let f=c.split("=")[1];e=JSON.parse(decodeURIComponent(f));}}l(!0),m&&m(e);}catch(r){console.error("Error loading consent settings:",r),l(true),m&&m(null);}return e},k=e=>{try{let r=JSON.stringify(e);if(u==="localStorage"&&typeof window!="undefined")localStorage.setItem(p,r);else if(u==="sessionStorage"&&typeof window!="undefined")sessionStorage.setItem(p,r);else if(u==="cookie"&&typeof document!="undefined"){let{domain:c,path:f="/",expires:b=365,secure:w=!0,sameSite:R="Lax"}=h,S=new Date;S.setDate(S.getDate()+b);let i=`${p}=${encodeURIComponent(r)}; path=${f}; expires=${S.toUTCString()}`;c&&(i+=`; domain=${c}`),w&&(i+="; secure"),i+=`; samesite=${R}`,document.cookie=i;}return A&&A(e),!0}catch(r){return console.error("Error saving consent settings:",r),false}},L=()=>{try{if(u==="localStorage"&&typeof window!="undefined")localStorage.removeItem(p);else if(u==="sessionStorage"&&typeof window!="undefined")sessionStorage.removeItem(p);else if(u==="cookie"&&typeof document!="undefined"){let{domain:e,path:r="/"}=h,c=`${p}=; path=${r}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;e&&(c+=`; domain=${e}`),document.cookie=c;}return !0}catch(e){return console.error("Error clearing consent settings:",e),false}},C=chunkE64TU6IU_js.a("",E==null?void 0:E.root,O);if(typeof x=="function"){let e=x({loadSettings:z,saveSettings:k,clearSettings:L,loaded:n});return C?jsxRuntime.jsx("div",{className:C,children:e}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:e})}return C?jsxRuntime.jsx("div",{className:C,children:x}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:x})};exports.a=he;exports.b=Re;exports.c=Oe;//# sourceMappingURL=chunk-K3GMTMQ6.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-K3GMTMQ6.js.map
|
package/dist/chunk-L52PDW6O.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {d,a as a$1}from'./chunk-TXBZPCGF.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect,useCallback}from'react';function E({initialActivities:P=[],storageKey:c="ndpr_lawful_basis_activities",useLocalStorage:a$2=true,onAdd:d$1,onUpdate:v,onRemove:y}={}){let[e,o]=useState(P);useEffect(()=>{if(a$2&&typeof window!="undefined")try{let i=localStorage.getItem(c);i&&o(JSON.parse(i));}catch(i){console.error("Error loading lawful basis activities:",i);}},[c,a$2]),useEffect(()=>{if(a$2&&typeof window!="undefined")try{localStorage.setItem(c,JSON.stringify(e));}catch(i){console.error("Error saving lawful basis activities:",i);}},[e,c,a$2]);let p=()=>"lb_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),B=useCallback(i=>{let s=Date.now(),t=b(a({},i),{id:p(),createdAt:s,updatedAt:s});return o(n=>[...n,t]),d$1&&d$1(t),t},[d$1]),L=useCallback((i,s)=>{let t=null;return o(n=>{let u=n.findIndex(x=>x.id===i);if(u===-1)return n;t=b(a(a({},n[u]),s),{id:n[u].id,updatedAt:Date.now()});let g=[...n];return g[u]=t,g}),t&&v&&v(t),t},[v]),S=useCallback(i=>{o(s=>s.filter(t=>t.id!==i)),y&&y(i);},[y]),b$1=useCallback(i=>e.find(s=>s.id===i)||null,[e]),O=useCallback(()=>d(e),[e]),_=useCallback(i=>a$1(i),[]);return {activities:e,addActivity:B,updateActivity:L,removeActivity:S,getActivity:b$1,getSummary:O,validateActivity:_}}export{E as a};//# sourceMappingURL=chunk-L52PDW6O.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-L52PDW6O.mjs.map
|
package/dist/chunk-LI6WJ3LZ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkRYZEIDNR_js=require('./chunk-RYZEIDNR.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function H({categories:U,initialReports:O=[],storageKey:u="ndpr_breach_data",useLocalStorage:d=true,onReport:q,onAssessment:l,onNotification:h}){let[f,g]=react.useState(O),[R,p]=react.useState([]),[a,N]=react.useState([]);react.useEffect(()=>{if(d&&typeof window!="undefined")try{let t=localStorage.getItem(u);if(t){let{reports:i,assessments:s,notifications:e}=JSON.parse(t);g(i||[]),p(s||[]),N(e||[]);}}catch(t){console.error("Error loading breach data:",t);}},[u,d]),react.useEffect(()=>{if(d&&typeof window!="undefined")try{localStorage.setItem(u,JSON.stringify({reports:f,assessments:R,notifications:a}));}catch(t){console.error("Error saving breach data:",t);}},[f,R,a,u,d]);let B=t=>`${t}_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,v=t=>{let i=chunkMQFZHA2D_js.a({id:B("breach"),reportedAt:Date.now()},t);return g(s=>[...s,i]),q&&q(i),i},S=(t,i)=>{let s=null;return g(e=>{let r=e.findIndex(c=>c.id===t);if(r===-1)return e;let n=e[r];s=chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},n),i);let m=[...e];return m[r]=s,m}),s},w=t=>f.find(i=>i.id===t)||null,x=(t,i)=>{let s=R.find(e=>e.breachId===t);if(s){let e=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},s),i),{assessedAt:Date.now()});return p(r=>r.map(n=>n.id===s.id?e:n)),l&&l(e),e}else {let e=chunkMQFZHA2D_js.a({id:B("assessment"),breachId:t,assessedAt:Date.now()},i);return p(r=>[...r,e]),l&&l(e),e}},A=t=>R.find(i=>i.breachId===t)||null,k=t=>{let i=w(t),s=A(t);if(!i)return null;let{severityLevel:e,notificationRequired:r,timeframeHours:n,justification:m}=chunkRYZEIDNR_js.a(i,s||void 0),c=i.discoveredAt+n*60*60*1e3;return {ndpcNotificationRequired:r,ndpcNotificationDeadline:c,dataSubjectNotificationRequired:e==="high"||e==="critical",justification:m}};return {reports:f,assessments:R,notifications:a,reportBreach:v,updateReport:S,getReport:w,assessRisk:x,getAssessment:A,calculateNotificationRequirements:k,sendNotification:(t,i)=>{let s=a.find(e=>e.breachId===t);if(s){let e=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},s),i),{sentAt:Date.now()});return N(r=>r.map(n=>n.id===s.id?e:n)),h&&h(e),e}else {let e=chunkMQFZHA2D_js.a({id:B("notification"),breachId:t,sentAt:Date.now()},i);return N(r=>[...r,e]),h&&h(e),e}},getNotification:t=>a.find(i=>i.breachId===t)||null,getBreachesRequiringNotification:(t=24)=>{let i=Date.now(),s=[];return f.forEach(e=>{if(a.some(E=>E.breachId===e.id))return;let r=A(e.id);if(!r)return;let n=k(e.id);if(!n||!n.ndpcNotificationRequired)return;let c=(n.ndpcNotificationDeadline-i)/(3600*1e3);c<=t&&s.push({report:e,assessment:r,requirements:n,hoursRemaining:c});}),s.sort((e,r)=>e.hoursRemaining-r.hoursRemaining)},clearBreachData:()=>{g([]),p([]),N([]),d&&typeof window!="undefined"&&localStorage.removeItem(u);}}}exports.a=H;//# sourceMappingURL=chunk-LI6WJ3LZ.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-LI6WJ3LZ.js.map
|
package/dist/chunk-LXRXDTPI.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkTDDAYVKK_js=require('./chunk-TDDAYVKK.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function E({initialActivities:P=[],storageKey:c="ndpr_lawful_basis_activities",useLocalStorage:a=true,onAdd:d,onUpdate:v,onRemove:y}={}){let[e,o]=react.useState(P);react.useEffect(()=>{if(a&&typeof window!="undefined")try{let i=localStorage.getItem(c);i&&o(JSON.parse(i));}catch(i){console.error("Error loading lawful basis activities:",i);}},[c,a]),react.useEffect(()=>{if(a&&typeof window!="undefined")try{localStorage.setItem(c,JSON.stringify(e));}catch(i){console.error("Error saving lawful basis activities:",i);}},[e,c,a]);let p=()=>"lb_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),B=react.useCallback(i=>{let s=Date.now(),t=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{id:p(),createdAt:s,updatedAt:s});return o(n=>[...n,t]),d&&d(t),t},[d]),L=react.useCallback((i,s)=>{let t=null;return o(n=>{let u=n.findIndex(x=>x.id===i);if(u===-1)return n;t=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},n[u]),s),{id:n[u].id,updatedAt:Date.now()});let g=[...n];return g[u]=t,g}),t&&v&&v(t),t},[v]),S=react.useCallback(i=>{o(s=>s.filter(t=>t.id!==i)),y&&y(i);},[y]),b=react.useCallback(i=>e.find(s=>s.id===i)||null,[e]),O=react.useCallback(()=>chunkTDDAYVKK_js.d(e),[e]),_=react.useCallback(i=>chunkTDDAYVKK_js.a(i),[]);return {activities:e,addActivity:B,updateActivity:L,removeActivity:S,getActivity:b,getSummary:O,validateActivity:_}}exports.a=E;//# sourceMappingURL=chunk-LXRXDTPI.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-LXRXDTPI.js.map
|
package/dist/chunk-NW4A3JW6.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,useCallback,useEffect}from'react';import {createPortal}from'react-dom';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var he=({options:a$2,onSave:y,title:m="We Value Your Privacy",description:A="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:I="Accept All",rejectAllButtonText:P="Reject All",customizeButtonText:E="Customize",saveButtonText:O="Save Preferences",position:x="bottom",zIndex:p=9999,version:u="1.0",show:h,manageStorage:n=true,storageKey:l="ndpr_consent",className:z="",buttonClassName:k="",primaryButtonClassName:L="",secondaryButtonClassName:C="",classNames:e,unstyled:r,onAnalytics:c})=>{let[f,b$1]=useState(false),[w,R]=useState(false),[S,i]=useState({}),v=useRef(null),M=useRef(null),G=useRef(false),D=useCallback((t,d)=>{c==null||c(a({action:t,timestamp:Date.now(),version:u},d!==void 0?{categories:d}:{}));},[c,u]);useEffect(()=>{let t={};if(a$2.forEach(d=>{t[d.id]=d.defaultValue||false;}),i(t),h===void 0)if(!n)b$1(true);else {let d=localStorage.getItem(l);if(d)try{JSON.parse(d).version!==u?b$1(!0):b$1(!1);}catch(Y){b$1(true);}else b$1(true);}else b$1(h);},[a$2,l,u,n]),useEffect(()=>{h!==void 0&&b$1(h);},[h]);let oe=()=>{let t={};a$2.forEach(d=>{t[d.id]=true;}),D("accepted_all",t),U(t);},ie=()=>{let t={};a$2.forEach(d=>{t[d.id]=d.required||false;}),D("rejected_all",t),U(t);},de=(t,d)=>{i(Y=>b(a({},Y),{[t]:d}));},ge=()=>{let t={};a$2.forEach(d=>{t[d.id]=true;}),i(t);},ae=()=>{let t={};a$2.forEach(d=>{t[d.id]=d.required||false;}),i(t);},Q=a$2.length>0&&a$2.every(t=>S[t.id]),ue=()=>{D("customized",S),U(S);},U=t=>{let d={consents:t,timestamp:Date.now(),version:u,method:w?"customize":"banner",hasInteracted:true};n&&localStorage.setItem(l,JSON.stringify(d)),y(d),b$1(false),R(false);},X=useCallback(()=>{D("dismissed"),b$1(false),R(false);},[D]);if(useEffect(()=>{if(!f)return;let t=d=>{d.key==="Escape"&&X();};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[f,X]),useEffect(()=>{f&&!G.current&&(G.current=true,D("shown")),f||(G.current=false);},[f,D]),useEffect(()=>{f&&v.current&&v.current.focus();},[f]),useEffect(()=>{if(w&&M.current){let t=M.current;t.style.maxHeight="0px",t.style.opacity="0",t.offsetHeight,t.style.maxHeight=`${t.scrollHeight}px`,t.style.opacity="1";}},[w]),!f)return null;let ce=(e==null?void 0:e.primaryButton)||(e==null?void 0:e.acceptButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${k} ${L}`,Z=(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.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 ${k} ${C}`,fe=(e==null?void 0:e.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${k}`,pe=(e==null?void 0:e.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${k} ${L}`,J=x==="inline",V=x==="center",j;J||V?j="":x==="top"?j="fixed inset-x-0 top-0":j="fixed inset-x-0 bottom-0";let H=jsx("div",{ref:v,tabIndex:-1,"data-ndpr-component":"consent-banner",className:a$1(`${J?"":j} bg-white dark:bg-gray-800 shadow-lg p-3 sm:p-4 border border-gray-200 dark:border-gray-700 ${V?"max-w-lg w-full":""} ${z}`,e==null?void 0:e.root,r),style:!J&&!V?{zIndex:p}: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",e==null?void 0:e.container,r),children:[jsx("h2",{id:"consent-banner-title",className:a$1("text-lg font-bold mb-2",e==null?void 0:e.title,r),children:m}),jsx("p",{id:"consent-banner-description",className:a$1("text-sm sm:text-base mb-4",e==null?void 0:e.description,r),children:A}),w&&jsxs("div",{ref:M,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",e==null?void 0:e.customizePanel,r),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:Q?ae:ge,className:a$1("text-sm font-medium text-[rgb(var(--ndpr-primary))] hover:underline",e==null?void 0:e.selectAllButton,r),children:Q?"Deselect All":"Select All"})}),jsx("div",{className:a$1("space-y-3",e==null?void 0:e.optionsList,r),children:a$2.map(t=>jsxs("div",{className:a$1("flex items-start",e==null?void 0:e.optionItem,r),children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:`consent-${t.id}`,type:"checkbox",checked:S[t.id]||false,onChange:d=>de(t.id,d.target.checked),disabled:t.required,className:a$1("h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.optionCheckbox,r)})}),jsxs("div",{className:"ml-3 text-sm",children:[jsxs("label",{htmlFor:`consent-${t.id}`,className:a$1("font-medium",e==null?void 0:e.optionLabel,r),children:[t.label," ",t.required&&jsx("span",{className:"text-red-500",children:"*"})]}),jsx("p",{className:a$1("text-gray-600 dark:text-gray-400",e==null?void 0:e.optionDescription,r),children:t.description})]})]},t.id))}),jsxs("div",{className:a$1("mt-4 flex flex-col sm:flex-row flex-wrap gap-2",e==null?void 0:e.buttonGroup,r),children:[jsx("button",{onClick:ue,className:a$1(pe,e==null?void 0:e.saveButton,r),children:O}),jsx("button",{onClick:()=>R(false),className:a$1(Z,e==null?void 0:e.rejectButton,r),children:"Back"})]})]}),!w&&jsxs("div",{className:a$1("flex flex-col sm:flex-row flex-wrap gap-2",e==null?void 0:e.buttonGroup,r),children:[jsx("button",{onClick:oe,className:a$1(ce,e==null?void 0:e.acceptButton,r),children:I}),jsx("button",{onClick:ie,className:a$1(Z,e==null?void 0:e.rejectButton,r),children:P}),jsx("button",{onClick:()=>R(true),className:a$1(fe,e==null?void 0:e.customizeButton,r),children:E})]}),jsx("div",{className:a$1("mt-2 text-xs text-gray-600 dark:text-gray-400",void 0,r),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(J)return H;if(V){let t=jsxs("div",{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:p},children:[jsx("div",{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),jsx("div",{className:"relative",children:H})]});return typeof document!="undefined"?createPortal(t,document.body):t}return typeof document!="undefined"?createPortal(H,document.body):H};var Re=({options:a$2,settings:y,onSave:m,title:A="Manage Your Privacy Settings",description:I="Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function. Consent management is provided in accordance with NDPA Sections 25-26.",saveButtonText:P="Save Preferences",resetButtonText:E="Reset to Defaults",version:O="1.0",className:x="",buttonClassName:p="",primaryButtonClassName:u="",secondaryButtonClassName:h="",classNames:n,unstyled:l,showSuccessMessage:z=true,successMessage:k="Your preferences have been saved.",successMessageDuration:L=3e3})=>{let[C,e]=useState({}),[r,c]=useState(false);useEffect(()=>{if(y&&y.consents)e(y.consents);else {let i={};a$2.forEach(v=>{i[v.id]=v.defaultValue||false;}),e(i);}},[a$2,y]);let f=(i,v)=>{e(M=>b(a({},M),{[i]:v}));},b$1=()=>{let i={consents:C,timestamp:Date.now(),version:O,method:"manager",hasInteracted:true};m(i),z&&(c(true),setTimeout(()=>{c(false);},L));},w=()=>{let i={};a$2.forEach(v=>{i[v.id]=v.defaultValue||false;}),e(i);},R=(n==null?void 0:n.primaryButton)||(n==null?void 0:n.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${p} ${u}`,S=(n==null?void 0:n.secondaryButton)||(n==null?void 0:n.resetButton)||`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 ${p} ${h}`;return jsxs("div",{className:a$1(`bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 ${x}`,n==null?void 0:n.root,l),children:[jsx("h2",{className:a$1("text-xl font-bold mb-2",n==null?void 0:n.title,l),children:A}),jsx("p",{className:a$1("mb-6 text-gray-600 dark:text-gray-300",n==null?void 0:n.description,l),children:I}),jsx("div",{className:a$1("space-y-6",n==null?void 0:n.optionsList,l),children:a$2.map(i=>jsx("div",{className:a$1("border-b border-gray-200 dark:border-gray-700 pb-4 last:border-0",n==null?void 0:n.optionItem,l),children:jsxs("div",{className:"flex items-start justify-between",children:[jsxs("div",{children:[jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:i.label}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:i.description})]}),jsx("div",{className:"ml-4 flex-shrink-0",children:jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[jsx("input",{type:"checkbox",className:"sr-only peer",checked:C[i.id]||false,onChange:v=>f(i.id,v.target.checked),disabled:i.required}),jsx("div",{className:a$1(`w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-[rgb(var(--ndpr-ring)/0.3)] rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-[rgb(var(--ndpr-primary))] ${i.required?"opacity-60":""}`,n==null?void 0:n.toggle,l)}),jsxs("span",{className:"ml-3 text-sm font-medium text-gray-900 dark:text-gray-300",children:[C[i.id]?"Enabled":"Disabled",i.required&&jsx("span",{className:"text-xs text-red-500 ml-1",children:"(Required)"})]})]})})]})},i.id))}),r&&jsx("div",{className:"mt-4 p-3 bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-200 rounded-md",children:k}),jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[jsx("button",{onClick:b$1,className:a$1(R,n==null?void 0:n.saveButton,l),children:P}),jsx("button",{onClick:w,className:a$1(S,n==null?void 0:n.resetButton,l),children:E})]}),jsxs("div",{className:"mt-4 text-xs text-gray-600 dark:text-gray-400",children:[jsxs("p",{children:["Last updated: ",y?new Date(y.timestamp).toLocaleString():"Never"]}),jsxs("p",{children:["Version: ",O]})]})]})};var Oe=({settings:a,storageOptions:y={},onLoad:m,onSave:A,autoSave:I=true,autoLoad:P=true,classNames:E,unstyled:O,children:x})=>{let{storageKey:p="ndpr_consent",storageType:u="localStorage",cookieOptions:h={}}=y,[n,l]=useState(false);useEffect(()=>{P&&!n&&z();},[P,n]),useEffect(()=>{I&&n&&k(a);},[a,I,n]);let z=()=>{let e=null;try{if(u==="localStorage"&&typeof window!="undefined"){let r=localStorage.getItem(p);r&&(e=JSON.parse(r));}else if(u==="sessionStorage"&&typeof window!="undefined"){let r=sessionStorage.getItem(p);r&&(e=JSON.parse(r));}else if(u==="cookie"&&typeof document!="undefined"){let c=document.cookie.split(";").find(f=>f.trim().startsWith(`${p}=`));if(c){let f=c.split("=")[1];e=JSON.parse(decodeURIComponent(f));}}l(!0),m&&m(e);}catch(r){console.error("Error loading consent settings:",r),l(true),m&&m(null);}return e},k=e=>{try{let r=JSON.stringify(e);if(u==="localStorage"&&typeof window!="undefined")localStorage.setItem(p,r);else if(u==="sessionStorage"&&typeof window!="undefined")sessionStorage.setItem(p,r);else if(u==="cookie"&&typeof document!="undefined"){let{domain:c,path:f="/",expires:b=365,secure:w=!0,sameSite:R="Lax"}=h,S=new Date;S.setDate(S.getDate()+b);let i=`${p}=${encodeURIComponent(r)}; path=${f}; expires=${S.toUTCString()}`;c&&(i+=`; domain=${c}`),w&&(i+="; secure"),i+=`; samesite=${R}`,document.cookie=i;}return A&&A(e),!0}catch(r){return console.error("Error saving consent settings:",r),false}},L=()=>{try{if(u==="localStorage"&&typeof window!="undefined")localStorage.removeItem(p);else if(u==="sessionStorage"&&typeof window!="undefined")sessionStorage.removeItem(p);else if(u==="cookie"&&typeof document!="undefined"){let{domain:e,path:r="/"}=h,c=`${p}=; path=${r}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;e&&(c+=`; domain=${e}`),document.cookie=c;}return !0}catch(e){return console.error("Error clearing consent settings:",e),false}},C=a$1("",E==null?void 0:E.root,O);if(typeof x=="function"){let e=x({loadSettings:z,saveSettings:k,clearSettings:L,loaded:n});return C?jsx("div",{className:C,children:e}):jsx(Fragment,{children:e})}return C?jsx("div",{className:C,children:x}):jsx(Fragment,{children:x})};export{he as a,Re as b,Oe as c};//# sourceMappingURL=chunk-NW4A3JW6.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-NW4A3JW6.mjs.map
|
package/dist/chunk-OITITR6K.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-RGYK4VAY.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect}from'react';function H({categories:U,initialReports:O=[],storageKey:u="ndpr_breach_data",useLocalStorage:d=true,onReport:q,onAssessment:l,onNotification:h}){let[f,g]=useState(O),[R,p]=useState([]),[a$2,N]=useState([]);useEffect(()=>{if(d&&typeof window!="undefined")try{let t=localStorage.getItem(u);if(t){let{reports:i,assessments:s,notifications:e}=JSON.parse(t);g(i||[]),p(s||[]),N(e||[]);}}catch(t){console.error("Error loading breach data:",t);}},[u,d]),useEffect(()=>{if(d&&typeof window!="undefined")try{localStorage.setItem(u,JSON.stringify({reports:f,assessments:R,notifications:a$2}));}catch(t){console.error("Error saving breach data:",t);}},[f,R,a$2,u,d]);let B=t=>`${t}_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,v=t=>{let i=a({id:B("breach"),reportedAt:Date.now()},t);return g(s=>[...s,i]),q&&q(i),i},S=(t,i)=>{let s=null;return g(e=>{let r=e.findIndex(c=>c.id===t);if(r===-1)return e;let n=e[r];s=a(a({},n),i);let m=[...e];return m[r]=s,m}),s},w=t=>f.find(i=>i.id===t)||null,x=(t,i)=>{let s=R.find(e=>e.breachId===t);if(s){let e=b(a(a({},s),i),{assessedAt:Date.now()});return p(r=>r.map(n=>n.id===s.id?e:n)),l&&l(e),e}else {let e=a({id:B("assessment"),breachId:t,assessedAt:Date.now()},i);return p(r=>[...r,e]),l&&l(e),e}},A=t=>R.find(i=>i.breachId===t)||null,k=t=>{let i=w(t),s=A(t);if(!i)return null;let{severityLevel:e,notificationRequired:r,timeframeHours:n,justification:m}=a$1(i,s||void 0),c=i.discoveredAt+n*60*60*1e3;return {ndpcNotificationRequired:r,ndpcNotificationDeadline:c,dataSubjectNotificationRequired:e==="high"||e==="critical",justification:m}};return {reports:f,assessments:R,notifications:a$2,reportBreach:v,updateReport:S,getReport:w,assessRisk:x,getAssessment:A,calculateNotificationRequirements:k,sendNotification:(t,i)=>{let s=a$2.find(e=>e.breachId===t);if(s){let e=b(a(a({},s),i),{sentAt:Date.now()});return N(r=>r.map(n=>n.id===s.id?e:n)),h&&h(e),e}else {let e=a({id:B("notification"),breachId:t,sentAt:Date.now()},i);return N(r=>[...r,e]),h&&h(e),e}},getNotification:t=>a$2.find(i=>i.breachId===t)||null,getBreachesRequiringNotification:(t=24)=>{let i=Date.now(),s=[];return f.forEach(e=>{if(a$2.some(E=>E.breachId===e.id))return;let r=A(e.id);if(!r)return;let n=k(e.id);if(!n||!n.ndpcNotificationRequired)return;let c=(n.ndpcNotificationDeadline-i)/(3600*1e3);c<=t&&s.push({report:e,assessment:r,requirements:n,hoursRemaining:c});}),s.sort((e,r)=>e.hoursRemaining-r.hoursRemaining)},clearBreachData:()=>{g([]),p([]),N([]),d&&typeof window!="undefined"&&localStorage.removeItem(u);}}}export{H as a};//# sourceMappingURL=chunk-OITITR6K.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-OITITR6K.mjs.map
|
package/dist/chunk-PDJGTQMY.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-GIV2OHE6.mjs';import {useState,useEffect}from'react';function T({options:h,storageOptions:d={},version:f="1.0",onChange:v}){let{storageKey:o="ndpr_consent",storageType:n="localStorage"}=d,[r,g]=useState(null),[y,a$1]=useState(true),[k,u]=useState(false),[I,p]=useState([]);useEffect(()=>{let t=null;try{if(n==="localStorage"&&typeof window!="undefined"){let e=localStorage.getItem(o);e&&(t=JSON.parse(e));}else if(n==="sessionStorage"&&typeof window!="undefined"){let e=sessionStorage.getItem(o);e&&(t=JSON.parse(e));}else if(n==="cookie"&&typeof document!="undefined"){let s=document.cookie.split(";").find(i=>i.trim().startsWith(`${o}=`));if(s){let i=s.split("=")[1];t=JSON.parse(decodeURIComponent(i));}}}catch(e){console.error("Error loading consent settings:",e);}if(t){g(t);let{valid:e,errors:s}=a(t);u(e),p(s),a$1(!(e&&t.version===f));}else a$1(true);},[o,n,f]);let O=t=>{try{let e=JSON.stringify(t);if(n==="localStorage"&&typeof window!="undefined")localStorage.setItem(o,e);else if(n==="sessionStorage"&&typeof window!="undefined")sessionStorage.setItem(o,e);else if(n==="cookie"&&typeof document!="undefined"){let{cookieOptions:b={}}=d,{domain:w,path:$="/",expires:E=365,secure:R=!0,sameSite:x="Lax"}=b,m=new Date;m.setDate(m.getDate()+E);let c=`${o}=${encodeURIComponent(e)}; path=${$}; expires=${m.toUTCString()}`;w&&(c+=`; domain=${w}`),R&&(c+="; secure"),c+=`; samesite=${x}`,document.cookie=c;}let{valid:s,errors:i}=a(t);u(s),p(i),v&&v(t);}catch(e){console.error("Error saving consent settings:",e);}},S=t=>{let e={consents:t,timestamp:Date.now(),version:f,method:"explicit",hasInteracted:true};g(e),O(e),a$1(false);};return {settings:r,hasConsent:t=>!!(r!=null&&r.consents[t]),updateConsent:S,acceptAll:()=>{let t={};h.forEach(e=>{t[e.id]=true;}),S(t);},rejectAll:()=>{let t={};h.forEach(e=>{t[e.id]=e.required||false;}),S(t);},shouldShowBanner:y,isValid:k,validationErrors:I,resetConsent:()=>{if(n==="localStorage"&&typeof window!="undefined")localStorage.removeItem(o);else if(n==="sessionStorage"&&typeof window!="undefined")sessionStorage.removeItem(o);else if(n==="cookie"&&typeof document!="undefined"){let{cookieOptions:t={}}=d,{domain:e,path:s="/"}=t,i=`${o}=; path=${s}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;e&&(i+=`; domain=${e}`),document.cookie=i;}g(null),a$1(true),u(false),p([]);}}}export{T as a};//# sourceMappingURL=chunk-PDJGTQMY.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-PDJGTQMY.mjs.map
|
package/dist/chunk-T44JQT2O.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {b as b$1,c,d}from'./chunk-PYEX7DFR.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useState,useCallback}from'react';function w({initialData:R,onRecordAdd:n,onRecordUpdate:c$1,onRecordArchive:d$1}){let[s,p]=useState(R),O=useCallback(e=>{p(t=>b(a({},t),{records:[...t.records,e],lastUpdated:Date.now()})),n==null||n(e);},[n]),l=useCallback((e,t)=>{p(o=>b(a({},o),{records:o.records.map(g=>g.id===e?b(a(a({},g),t),{updatedAt:Date.now()}):g),lastUpdated:Date.now()})),c$1==null||c$1(e,t);},[c$1]),f=useCallback(e=>{p(t=>b(a({},t),{records:t.records.map(o=>o.id===e?b(a({},o),{status:"archived",updatedAt:Date.now()}):o),lastUpdated:Date.now()})),d$1==null||d$1(e);},[d$1]),A=useCallback(e=>s.records.find(t=>t.id===e),[s.records]),y=useCallback(()=>b$1(s),[s]),C=useCallback(()=>c(s),[s]),S=useCallback(()=>d(s),[s]);return {ropa:s,addRecord:O,updateRecord:l,archiveRecord:f,getRecord:A,getSummary:y,exportCSV:C,getComplianceGaps:S}}export{w as a};//# sourceMappingURL=chunk-T44JQT2O.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-T44JQT2O.mjs.map
|
package/dist/chunk-TCJCE6WN.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunk5RSOLEEP_js=require('./chunk-5RSOLEEP.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function O({templates:y,initialPolicy:c,storageKey:f="ndpr_privacy_policy",useLocalStorage:m=true,onGenerate:g}){let[n,u]=react.useState(c||null),[a,p]=react.useState(null),[d,P]=react.useState({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""});react.useEffect(()=>{if(m&&typeof window!="undefined"&&!c)try{let i=localStorage.getItem(f);if(i){let{policy:o,template:e,organizationInfo:t}=JSON.parse(i);if(o&&u(o),e){let s=y.find(x=>x.id===e.id);s&&p(s);}t&&P(t);}}catch(i){console.error("Error loading privacy policy data:",i);}},[f,m,c,y]),react.useEffect(()=>{if(m&&typeof window!="undefined")try{localStorage.setItem(f,JSON.stringify({policy:n,template:a,organizationInfo:d}));}catch(i){console.error("Error saving privacy policy data:",i);}},[n,a,d,f,m]);let V=i=>{let o=y.find(s=>s.id===i);if(!o)return false;p(o);o.sections.map(s=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},s),{customContent:void 0}));return Object.keys(o.variables).forEach(s=>{o.variables[s].defaultValue||"";}),true},h=i=>{P(o=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},o),i));},w=(i,o)=>{a&&(n?u(e=>e&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{sections:e.sections.map(t=>t.id===i?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{included:o}):t)})):p(e=>e&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{sections:e.sections.map(t=>t.id===i?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{included:o}):t)})));},z=(i,o)=>{a&&(n?u(e=>e&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{sections:e.sections.map(t=>t.id===i?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{customContent:o}):t)})):p(e=>e&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{sections:e.sections.map(t=>t.id===i?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},t),{customContent:o}):t)})));},E=(i,o)=>{n&&u(e=>e&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{variableValues:chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e.variableValues),{[i]:o})}));},S=()=>"policy_"+Date.now()+"_"+Math.random().toString(36).substr(2,9);return {policy:n,selectedTemplate:a,organizationInfo:d,selectTemplate:V,updateOrganizationInfo:h,toggleSection:w,updateSectionContent:z,updateVariableValue:E,generatePolicy:()=>{if(!a)throw new Error("No template selected");let i=Date.now(),o={id:(n==null?void 0:n.id)||S(),title:`Privacy Policy for ${d.name}`,templateId:a.id,organizationInfo:d,sections:a.sections.map(e=>{var t;return chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{customContent:(t=n==null?void 0:n.sections.find(s=>s.id===e.id))==null?void 0:t.customContent})}),variableValues:(n==null?void 0:n.variableValues)||{},effectiveDate:i,lastUpdated:i,version:"1.0"};return u(o),g&&g(o),o},getPolicyText:()=>{if(!n)return {fullText:"",sectionTexts:{},missingVariables:[]};let i=chunk5RSOLEEP_js.a(n.sections,n.organizationInfo);return typeof i=="string"?{fullText:i,sectionTexts:{full:i},missingVariables:[]}:i},resetPolicy:()=>{u(null),p(null),P({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),m&&typeof window!="undefined"&&localStorage.removeItem(f);},isValid:()=>{let i=[];if(a||i.push("No template selected"),d.name||i.push("Organization name is required"),d.website||i.push("Organization website is required"),d.privacyEmail||i.push("Privacy contact email is required"),a){let o=a.sections.filter(t=>t.required),e=(n==null?void 0:n.sections.filter(t=>t.included))||[];o.forEach(t=>{e.some(s=>s.id===t.id)||i.push(`Required section "${t.title}" must be included`);});}return a&&n&&Object.entries(a.variables).forEach(([o,e])=>{e.required&&!n.variableValues[o]&&i.push(`Required variable "${e.name}" must have a value`);}),{valid:i.length===0,errors:i}}}}function J(y={}){let{orgInfo:c,storageKey:f,useLocalStorage:m}=y,{sections:g,variables:n}=chunk5RSOLEEP_js.d();if(c)for(let a of n)c.name&&a.name==="orgName"&&(a.value=c.name),c.email&&a.name==="privacyEmail"&&(a.value=c.email),c.dpoName&&a.name==="dpoName"&&(a.value=c.dpoName);let u={id:"default-business",name:"Default Business Policy",description:"NDPA-compliant privacy policy template for businesses.",organizationType:"business",sections:g,variables:Object.fromEntries(n.map(a=>[a.name,{name:a.name,description:a.description,required:a.required,defaultValue:a.value||void 0}])),version:"1.0",lastUpdated:Date.now(),ndpaCompliant:true};return O({templates:[u],storageKey:f,useLocalStorage:m})}exports.a=O;exports.b=J;//# sourceMappingURL=chunk-TCJCE6WN.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-TCJCE6WN.js.map
|
package/dist/chunk-VMJBW3EF.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {c}from'./chunk-QKK5S54L.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect,useCallback}from'react';function J({initialTransfers:w=[],storageKey:c$1="ndpr_cross_border_transfers",useLocalStorage:u=true,onAdd:m,onUpdate:p,onRemove:C}={}){let[t,l]=useState(w);useEffect(()=>{if(u&&typeof window!="undefined")try{let r=localStorage.getItem(c$1);r&&l(JSON.parse(r));}catch(r){console.error("Error loading cross-border transfers:",r);}},[c$1,u]),useEffect(()=>{if(u&&typeof window!="undefined")try{localStorage.setItem(c$1,JSON.stringify(t));}catch(r){console.error("Error saving cross-border transfers:",r);}},[t,c$1,u]);let _=()=>"cbt_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),b$1=useCallback(r=>{let n=Date.now(),s=b(a({},r),{id:_(),createdAt:n,updatedAt:n});return l(a=>[...a,s]),m&&m(s),s},[m]),A=useCallback((r,n)=>{let s=null;return l(a$1=>{let o=a$1.findIndex(g=>g.id===r);if(o===-1)return a$1;s=b(a(a({},a$1[o]),n),{updatedAt:Date.now()});let f=[...a$1];return f[o]=s,f}),s&&p&&p(s),s},[p]),S=useCallback(r=>{let n=false;return l(s=>s.findIndex(o=>o.id===r)===-1?s:(n=true,s.filter(o=>o.id!==r))),n&&C&&C(r),n},[C]),q=useCallback(r=>t.find(n=>n.id===r)||null,[t]),D=useCallback(()=>{let r=Date.now(),n=t.filter(e=>e.status==="active"),s=["adequacy_decision","standard_clauses","binding_corporate_rules","ndpc_authorization","explicit_consent","contract_performance","public_interest","legal_claims","vital_interests"],a={};for(let e of s)a[e]=n.filter(i=>i.transferMechanism===e).length;let o=["adequate","inadequate","pending_review","unknown"],f={};for(let e of o)f[e]=n.filter(i=>i.adequacyStatus===e).length;let g=t.filter(e=>{var i,v;return e.status==="pending_approval"||((i=e.ndpcApproval)==null?void 0:i.required)&&!((v=e.ndpcApproval)!=null&&v.approved)}),R=720*60*60*1e3,x=t.filter(e=>e.reviewDate&&e.reviewDate<=r+R&&e.status==="active"),I=t.filter(e=>!e.tiaCompleted&&e.status==="active"),O=t.filter(e=>e.riskLevel==="high"&&e.status==="active");return {totalActiveTransfers:n.length,byMechanism:a,byAdequacy:f,pendingApproval:g,dueForReview:x,missingTIA:I,highRiskTransfers:O,lastUpdated:r}},[t]),M=useCallback(r=>c(r),[]);return {transfers:t,addTransfer:b$1,updateTransfer:A,removeTransfer:S,getTransfer:q,getSummary:D,validateTransfer:M}}export{J as a};//# sourceMappingURL=chunk-VMJBW3EF.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-VMJBW3EF.mjs.map
|
package/dist/chunk-WSHSHIIM.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {c}from'./chunk-WWT2ZSNU.mjs';import {createContext,useMemo,useContext}from'react';import {jsx}from'react/jsx-runtime';var m=createContext({}),g=u=>{var i=u,{children:t}=i,e=c(i,["children"]);let n=useMemo(()=>{if(!e.theme)return;let r={};return e.theme.primary&&(r["--ndpr-primary"]=e.theme.primary),e.theme.primaryHover&&(r["--ndpr-primary-hover"]=e.theme.primaryHover),e.theme.primaryForeground&&(r["--ndpr-primary-foreground"]=e.theme.primaryForeground),Object.keys(r).length>0?r:void 0},[e.theme]);return jsx(m.Provider,{value:e,children:n?jsx("div",{style:n,children:t}):t})};function P(){return useContext(m)}export{g as a,P as b};//# sourceMappingURL=chunk-WSHSHIIM.mjs.map
|
|
2
|
-
//# sourceMappingURL=chunk-WSHSHIIM.mjs.map
|
package/dist/chunk-WW3X3ELF.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkCMZTI7SG_js=require('./chunk-CMZTI7SG.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function J({initialRequests:T=[],requestTypes:D,storageKey:R="ndpr_dsr_requests",useLocalStorage:r=true,onSubmit:c,onUpdate:l}){let[u,q]=react.useState(T);react.useEffect(()=>{if(r&&typeof window!="undefined")try{let e=localStorage.getItem(R);e&&q(JSON.parse(e));}catch(e){console.error("Error loading DSR requests:",e);}},[R,r]),react.useEffect(()=>{if(r&&typeof window!="undefined"&&u.length>0)try{localStorage.setItem(R,JSON.stringify(u));}catch(e){console.error("Error saving DSR requests:",e);}},[u,R,r]);let A=()=>"dsr_"+Date.now()+"_"+Math.random().toString(36).substr(2,9);return {requests:u,submitRequest:e=>{let t=D.find(S=>S.id===e.type),n=(t==null?void 0:t.estimatedCompletionTime)||30,s=Date.now(),i=s+n*24*60*60*1e3,f=e,{createdAt:p}=f,d=chunkMQFZHA2D_js.c(f,["createdAt"]),o=chunkMQFZHA2D_js.a({id:A(),status:"pending",createdAt:s,updatedAt:s,dueDate:i},d);return q(S=>[...S,o]),c&&c(o),o},updateRequest:(e,t)=>{let n=null;return q(s=>{let i=s.findIndex(o=>o.id===e);if(i===-1)return s;let p=s[i];n=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},p),t),{updatedAt:Date.now()});let d=[...s];return d[i]=n,d}),n&&l&&l(n),n},getRequest:e=>u.find(t=>t.id===e)||null,getRequestsByStatus:e=>u.filter(t=>t.status===e),getRequestsByType:e=>u.filter(t=>t.type===e),getRequestType:e=>D.find(t=>t.id===e),formatRequest:e=>{let{formattedRequest:t}=chunkCMZTI7SG_js.a(e);return t},clearRequests:()=>{q([]),r&&typeof window!="undefined"&&localStorage.removeItem(R);}}}exports.a=J;//# sourceMappingURL=chunk-WW3X3ELF.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-WW3X3ELF.js.map
|
package/dist/chunk-XMYUYQH7.mjs
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-RGYK4VAY.mjs';import {a as a$3}from'./chunk-FXTZDKDC.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {a as a$2,b}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var ze=({categories:N,onSubmit:x,onValidationError:D,title:oe="Report a Data Breach",formDescription:ne="Use this form to report a suspected or confirmed data breach in accordance with NDPA Section 40. All fields marked with * are required.",submitButtonText:de="Submit Report",className:me="",buttonClassName:ee="",classNames:u={},unstyled:n=false,isSubmitting:p=false,showConfirmation:P=true,confirmationMessage:Z="Your breach report has been submitted successfully. The data protection team has been notified.",allowAttachments:pe=true,maxAttachments:L=5,maxFileSize:C=5*1024*1024,allowedFileTypes:I=[".pdf",".jpg",".jpeg",".png",".doc",".docx",".xls",".xlsx",".txt"],defaultValues:d,onReset:q})=>{var we,Re,Ae,Ce,Se;let E=i=>{if(!i)return "";let A=new Date(i),Y=T=>String(T).padStart(2,"0");return `${A.getFullYear()}-${Y(A.getMonth()+1)}-${Y(A.getDate())}T${Y(A.getHours())}:${Y(A.getMinutes())}`},[O,M]=useState((d==null?void 0:d.title)||""),[_,J]=useState((d==null?void 0:d.description)||""),[z,K]=useState((d==null?void 0:d.category)||""),[V,le]=useState(E(d==null?void 0:d.discoveredAt)),[Q,ce]=useState(E(d==null?void 0:d.occurredAt)),[B,k]=useState(((we=d==null?void 0:d.reporter)==null?void 0:we.name)||""),[w,y]=useState(((Re=d==null?void 0:d.reporter)==null?void 0:Re.email)||""),[S,te]=useState(((Ae=d==null?void 0:d.reporter)==null?void 0:Ae.department)||""),[U,ae]=useState(((Ce=d==null?void 0:d.reporter)==null?void 0:Ce.phone)||""),[h,j]=useState((d==null?void 0:d.affectedSystems)||[]),[ge,be]=useState(((Se=d==null?void 0:d.affectedSystems)==null?void 0:Se.join(", "))||""),[s,f]=useState((d==null?void 0:d.dataTypes)||[]),[m,R]=useState((d==null?void 0:d.estimatedAffectedSubjects)!=null?String(d.estimatedAffectedSubjects):""),[H,G]=useState((d==null?void 0:d.status)||"ongoing"),[ue,re]=useState((d==null?void 0:d.initialActions)||""),[$,xe]=useState([]),[ye,ve]=useState(false),[b$1,Ne]=useState({}),je=()=>{M(""),J(""),K(""),le(""),ce(""),k(""),y(""),te(""),ae(""),j([]),be(""),f([]),R(""),G("ongoing"),re(""),xe([]),ve(false),Ne({}),q==null||q();},$e=i=>{let A=i.target.value;be(A);let Y=A.split(",").map(T=>T.trim()).filter(Boolean);j(Y);},Le=i=>{f(A=>A.includes(i)?A.filter(Y=>Y!==i):[...A,i]);},qe=i=>{var De;let A=i.target.files;if(!A)return;let Y=[],T={};if($.length+A.length>L){T.attachments=`Maximum of ${L} files allowed`,Ne(X=>a$2(a$2({},X),T));return}for(let X=0;X<A.length;X++){let ke=A[X];if(ke.size>C){T.attachments=`File ${ke.name} exceeds the maximum size of ${C/(1024*1024)}MB`;continue}let Be="."+((De=ke.name.split(".").pop())==null?void 0:De.toLowerCase());if(!I.includes(Be)){T.attachments=`File type ${Be} is not allowed`;continue}Y.push(ke);}Object.keys(T).length>0?Ne(X=>a$2(a$2({},X),T)):(xe(X=>[...X,...Y]),Ne(X=>b(a$2({},X),{attachments:""})));},Ee=i=>{xe(A=>A.filter((Y,T)=>T!==i));},Oe=()=>{let i={};return O.trim()||(i.breachTitle="Breach title is required"),_.trim()||(i.description="Description is required"),z||(i.category="Category is required"),V||(i.discoveredAt="Discovery date is required"),B.trim()||(i.reporterName="Reporter name is required"),w.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(w)||(i.reporterEmail="Reporter email is invalid"):i.reporterEmail="Reporter email is required",S.trim()||(i.reporterDepartment="Reporter department is required"),h.length===0&&(i.affectedSystems="At least one affected system is required"),s.length===0&&(i.dataTypes="At least one data type is required"),m&&isNaN(Number(m))&&(i.estimatedAffectedSubjects="Estimated affected subjects must be a number"),Ne(i),i},Me=i=>{i.preventDefault();let A=Oe();if(Object.keys(A).length>0){D==null||D(A);return}let Y={title:a$3(O),description:a$3(_),category:z,discoveredAt:new Date(V).getTime(),occurredAt:Q?new Date(Q).getTime():void 0,reportedAt:Date.now(),reporter:{name:a$3(B),email:a$3(w),department:a$3(S),phone:U?a$3(U):void 0},affectedSystems:h.map(T=>a$3(T)),dataTypes:s,estimatedAffectedSubjects:m?Number(m):void 0,status:H,initialActions:ue?a$3(ue):void 0,attachments:$.map(T=>({name:T.name,type:T.type,size:T.size,file:T}))};x(Y),P&&ve(true);};if(ye)return jsxs("div",{className:`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${me}`,children:[jsx("h2",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Submitted"}),jsx("p",{className:"text-green-700 dark:text-green-300",children:Z}),jsxs("div",{className:"mt-4 p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-md",children:[jsx("h3",{className:"text-sm font-bold text-yellow-800 dark:text-yellow-200 mb-2",children:"Important: Next Steps"}),jsx("p",{className:"text-yellow-700 dark:text-yellow-300 text-sm",children:"Under the NDPA (Section 40), data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsx("button",{onClick:()=>ve(false),className:`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${ee}`,children:"Report Another Breach"})]});let Ue=[{id:"personal",label:"Personal Information (names, addresses)"},{id:"contact",label:"Contact Information (email, phone)"},{id:"financial",label:"Financial Information (bank details, payment info)"},{id:"health",label:"Health Information"},{id:"identification",label:"Identification Documents (ID cards, passports)"},{id:"login",label:"Login Credentials"},{id:"biometric",label:"Biometric Data"},{id:"children",label:"Children's Data"},{id:"location",label:"Location Data"},{id:"communications",label:"Communications Content"}];return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${me}`,u.root,n),children:[jsx("h2",{className:a("text-xl font-bold mb-2",u.title,n),children:oe}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:ne}),jsx("form",{onSubmit:Me,className:a("",u.form,n),children:jsxs("div",{className:"space-y-6",children:[jsxs("div",{className:a("",u.fieldGroup,n),children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Breach Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"breachTitle",className:a("block text-sm font-medium mb-1",u.label,n),children:["Breach Title/Summary ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"breachTitle",value:O,onChange:i=>M(i.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))]",u.input,n),required:true,"aria-invalid":!!b$1.breachTitle,"aria-describedby":b$1.breachTitle?"breachTitle-error":void 0}),b$1.breachTitle&&jsx("p",{id:"breachTitle-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b$1.breachTitle})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"category",className:a("block text-sm font-medium mb-1",u.label,n),children:["Breach Category ",jsx("span",{className:"text-red-500",children:"*"})]}),jsxs("select",{id:"category",value:z,onChange:i=>K(i.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))]",u.select,n),required:true,"aria-invalid":!!b$1.category,"aria-describedby":b$1.category?"category-error":void 0,children:[jsx("option",{value:"",children:"Select a category"}),N.map(i=>jsx("option",{value:i.id,children:i.name},i.id))]}),b$1.category&&jsx("p",{id:"category-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b$1.category})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{htmlFor:"description",className:a("block text-sm font-medium mb-1",u.label,n),children:["Detailed Description ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{id:"description",value:_,onChange:i=>J(i.target.value),rows:4,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))]",u.textarea,n),required:true,"aria-invalid":!!b$1.description,"aria-describedby":b$1.description?"description-error":void 0}),b$1.description&&jsx("p",{id:"description-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b$1.description})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"discoveredAt",className:"block text-sm font-medium mb-1",children:["Date Discovered ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"datetime-local",id:"discoveredAt",value:V,onChange:i=>le(i.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!b$1.discoveredAt,"aria-describedby":b$1.discoveredAt?"discoveredAt-error":void 0}),b$1.discoveredAt&&jsx("p",{id:"discoveredAt-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b$1.discoveredAt})]}),jsxs("div",{children:[jsx("label",{htmlFor:"occurredAt",className:"block text-sm font-medium mb-1",children:"Date Occurred (if known)"}),jsx("input",{type:"datetime-local",id:"occurredAt",value:Q,onChange:i=>ce(i.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Reporter Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"reporterName",className:"block text-sm font-medium mb-1",children:["Your Name ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"reporterName",value:B,onChange:i=>k(i.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!b$1.reporterName,"aria-describedby":b$1.reporterName?"reporterName-error":void 0}),b$1.reporterName&&jsx("p",{id:"reporterName-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b$1.reporterName})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"reporterEmail",className:"block text-sm font-medium mb-1",children:["Your Email ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"email",id:"reporterEmail",value:w,onChange:i=>y(i.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!b$1.reporterEmail,"aria-describedby":b$1.reporterEmail?"reporterEmail-error":void 0}),b$1.reporterEmail&&jsx("p",{id:"reporterEmail-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b$1.reporterEmail})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"reporterDepartment",className:"block text-sm font-medium mb-1",children:["Your Department ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"reporterDepartment",value:S,onChange:i=>te(i.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!b$1.reporterDepartment,"aria-describedby":b$1.reporterDepartment?"reporterDepartment-error":void 0}),b$1.reporterDepartment&&jsx("p",{id:"reporterDepartment-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b$1.reporterDepartment})]}),jsxs("div",{children:[jsx("label",{htmlFor:"reporterPhone",className:"block text-sm font-medium mb-1",children:"Your Phone Number (Optional)"}),jsx("input",{type:"tel",id:"reporterPhone",value:U,onChange:i=>ae(i.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Information"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"affectedSystems",className:"block text-sm font-medium mb-1",children:["Affected Systems/Applications ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("input",{type:"text",id:"affectedSystems",value:ge,onChange:$e,placeholder:"e.g. CRM, Email Server, Website (comma separated)",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true,"aria-invalid":!!b$1.affectedSystems,"aria-describedby":b$1.affectedSystems?"affectedSystems-error":void 0}),b$1.affectedSystems&&jsx("p",{id:"affectedSystems-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b$1.affectedSystems})]}),jsxs("div",{children:[jsx("label",{htmlFor:"estimatedAffectedSubjects",className:"block text-sm font-medium mb-1",children:"Estimated Number of Affected Data Subjects"}),jsx("input",{type:"text",id:"estimatedAffectedSubjects",value:m,onChange:i=>R(i.target.value),placeholder:"e.g. 100",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]","aria-invalid":!!b$1.estimatedAffectedSubjects,"aria-describedby":b$1.estimatedAffectedSubjects?"estimatedAffectedSubjects-error":void 0}),b$1.estimatedAffectedSubjects&&jsx("p",{id:"estimatedAffectedSubjects-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b$1.estimatedAffectedSubjects})]}),jsxs("div",{className:"md:col-span-2",children:[jsxs("label",{className:"block text-sm font-medium mb-1",children:["Types of Data Involved ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:Ue.map(i=>jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"checkbox",id:`dataType_${i.id}`,checked:s.includes(i.id),onChange:()=>Le(i.id),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:`dataType_${i.id}`,className:"ml-2 text-sm text-gray-700 dark:text-gray-300",children:i.label})]},i.id))}),b$1.dataTypes&&jsx("p",{id:"dataTypes-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b$1.dataTypes})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"status",className:"block text-sm font-medium mb-1",children:["Current Status ",jsx("span",{className:"text-red-500",children:"*"})]}),jsxs("select",{id:"status",value:H,onChange:i=>G(i.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))]",u.select,n),required:true,children:[jsx("option",{value:"ongoing",children:"Ongoing (breach is still active)"}),jsx("option",{value:"contained",children:"Contained (breach is stopped but not resolved)"}),jsx("option",{value:"resolved",children:"Resolved (breach is fully addressed)"})]})]}),jsxs("div",{className:"md:col-span-2",children:[jsx("label",{htmlFor:"initialActions",className:"block text-sm font-medium mb-1",children:"Initial Actions Taken"}),jsx("textarea",{id:"initialActions",value:ue,onChange:i=>re(i.target.value),placeholder:"Describe any immediate actions that have been taken to address the breach",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))]",u.textarea,n)})]})]})]}),pe&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Attachments"}),jsxs("div",{className:"mb-4",children:[jsx("label",{className:"block text-sm font-medium mb-1",children:"Upload Supporting Files (Optional)"}),jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-2",children:["Max ",L," files, ",C/(1024*1024),"MB each. Allowed types: ",I.join(", ")]}),jsx("input",{type:"file",onChange:qe,multiple:true,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",accept:I.join(",")}),b$1.attachments&&jsx("p",{id:"attachments-error",role:"alert",className:"mt-1 text-sm text-red-500",children:b$1.attachments})]}),$.length>0&&jsxs("div",{className:"mb-4",children:[jsx("h4",{className:"text-sm font-medium mb-2",children:"Attached Files:"}),jsx("ul",{className:"space-y-2",children:$.map((i,A)=>jsxs("li",{className:"flex items-center justify-between p-2 bg-gray-50 dark:bg-gray-700 rounded",children:[jsxs("div",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 text-gray-500 dark:text-gray-400 mr-2",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M8 4a3 3 0 00-3 3v4a5 5 0 0010 0V7a1 1 0 112 0v4a7 7 0 11-14 0V7a5 5 0 0110 0v4a3 3 0 11-6 0V7a1 1 0 012 0v4a1 1 0 102 0V7a3 3 0 00-3-3z",clipRule:"evenodd"})}),jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:i.name}),jsxs("span",{className:"ml-2 text-xs text-gray-600 dark:text-gray-400",children:["(",(i.size/1024).toFixed(1)," KB)"]})]}),jsx("button",{type:"button",onClick:()=>Ee(A),className:"text-red-500 hover:text-red-700",children:jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]},A))})]})]}),jsxs("div",{className:a("mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",u.notice,n),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. The data protection team will assess this breach and determine if notification is required."})]}),jsxs("div",{className:"mt-6 relative flex gap-3",children:[p&&u.loadingOverlay&&jsx("div",{className:u.loadingOverlay}),jsx("button",{type:"submit",disabled:p,className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${ee} ${p?"opacity-50 cursor-not-allowed":""}`,u.primaryButton||u.submitButton,n),children:p?"Submitting...":de}),jsx("button",{type:"button",onClick:je,disabled:p,className:a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,n),children:"Reset"})]})]})})]})};var tt=({breachData:N,initialAssessment:x={},onComplete:D,title:oe="Breach Risk Assessment",description:ne="Assess the risk level of this data breach to determine notification requirements under NDPA Section 40.",submitButtonText:de="Complete Assessment",className:me="",buttonClassName:ee="",classNames:u={},unstyled:n=false,showBreachSummary:p=true,showNotificationRequirements:P=true})=>{let[Z,pe]=useState(x.confidentialityImpact||3),[L,C]=useState(x.integrityImpact||3),[I,d]=useState(x.availabilityImpact||3),[q,E]=useState(x.harmLikelihood||3),[O,M]=useState(x.harmSeverity||3),[_,J]=useState(x.risksToRightsAndFreedoms!==void 0?x.risksToRightsAndFreedoms:false),[z,K]=useState(x.highRisksToRightsAndFreedoms!==void 0?x.highRisksToRightsAndFreedoms:false),[V,le]=useState(x.justification||""),[Q,ce]=useState(0),[B,k]=useState("low"),[w,y]=useState(false),[S,te]=useState(0),[U,ae]=useState(0),[h,j]=useState(false);useEffect(()=>{let re=Z*.2+L*.1+I*.1+q*.3+O*.3;ce(Number(re.toFixed(1)));let $;re<2?$="low":re<3?$="medium":re<4?$="high":$="critical",k($),y(_||$==="high"||$==="critical");let ye=N.discoveredAt+4320*60*1e3;te(ye);let ve=Date.now(),b=(ye-ve)/(3600*1e3);ae(Number(b.toFixed(1)));},[Z,L,I,q,O,_,N.discoveredAt]);let ge=m=>new Date(m).toLocaleString(),be=m=>{m.preventDefault();let R={id:x.id||`assessment_${Date.now()}`,breachId:N.id,assessedAt:Date.now(),assessor:x.assessor||{name:"Assessment User",role:"Data Protection Officer",email:"dpo@example.com"},confidentialityImpact:Z,integrityImpact:L,availabilityImpact:I,harmLikelihood:q,harmSeverity:O,overallRiskScore:Q,riskLevel:B,risksToRightsAndFreedoms:_,highRisksToRightsAndFreedoms:z,justification:V};D(R),j(true);},s=m=>{switch(m){case 1:return "Minimal";case 2:return "Low";case 3:return "Moderate";case 4:return "High";case 5:return "Severe";default:return "Unknown"}},f=m=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[m]}`,u.riskBadge,n),children:m.charAt(0).toUpperCase()+m.slice(1)});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${me}`,u.root,n),children:[jsx("h2",{className:a("text-xl font-bold mb-2",u.title,n),children:oe}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:ne}),p&&jsxs("div",{className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("h3",{className:"text-lg font-medium mb-2",children:"Breach Summary"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Title:"})," ",N.title]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Discovered:"})," ",ge(N.discoveredAt)]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",N.status.charAt(0).toUpperCase()+N.status.slice(1)]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Types:"})," ",N.dataTypes.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",N.affectedSystems.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",N.estimatedAffectedSubjects||"Unknown"]})]})]})]}),h?jsxs("div",{children:[jsxs("div",{className:"mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Assessment Results"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Overall Risk Level:"})," ",f(B)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risk Score:"})," ",Q," / 5"]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Assessed On:"})," ",ge(Date.now())]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",_?"Yes":"No"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",z?"Yes":"No"]})]})]}),jsxs("div",{className:"mt-3",children:[jsx("p",{className:"text-sm mb-1",children:jsx("span",{className:"font-medium",children:"Justification:"})}),jsx("p",{className:"text-sm bg-white dark:bg-gray-800 p-2 rounded",children:V})]})]}),P&&jsxs("div",{className:a(`mb-6 p-4 rounded-md ${w?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"}`,u.notificationStatus,n),children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Requirements"}),w?jsxs("div",{children:[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"}),jsx("p",{className:"text-sm mb-2",children:"Under the NDPA (Section 40), this breach must be reported to the NDPC within 72 hours of discovery."}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Notification Deadline:"})," ",ge(S)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Time Remaining:"})," ",jsx("span",{className:U<24?"text-red-600 dark:text-red-400 font-bold":"",children:U>0?`${U} hours`:"Deadline passed"})]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Data Subject Notification:"})," ",z?"Required (NDPA Section 40(4))":"Not required unless directed by NDPC"]})]}):jsxs("div",{children:[jsx("p",{className:"text-sm font-bold mb-2 text-green-800 dark:text-green-200",children:"NDPC Notification Not Required"}),jsx("p",{className:"text-sm mb-2",children:"Based on this assessment, this breach does not need to be reported to the NDPC."}),jsx("p",{className:"text-sm mb-2",children:"However, the breach should still be documented internally for compliance purposes."})]}),jsxs("div",{className:"mt-3 text-sm",children:[jsx("p",{className:"font-medium",children:"Next Steps:"}),jsx("ul",{className:"list-disc pl-5 mt-1",children:w?jsxs(Fragment,{children:[jsx("li",{children:"Prepare a notification report for the NDPC"}),jsx("li",{children:"Document all aspects of the breach and your response"}),z&&jsx("li",{children:"Prepare communications for affected data subjects"}),jsx("li",{children:"Implement measures to mitigate the impact of the breach"})]}):jsxs(Fragment,{children:[jsx("li",{children:"Document the breach and this assessment in your internal records"}),jsx("li",{children:"Implement measures to prevent similar breaches in the future"}),jsx("li",{children:"Review and update security measures as needed"})]})})]})]}),jsx("button",{onClick:()=>j(false),className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${ee}`,u.primaryButton||u.submitButton,n),children:"Edit Assessment"})]}):jsx("form",{onSubmit:be,children:jsxs("div",{className:"space-y-6",children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Impact Assessment"}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"confidentialityImpact",className:"block text-sm font-medium mb-1",children:["Confidentiality Impact (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the confidentiality of data been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"confidentialityImpact",min:"1",max:"5",step:"1",value:Z,onChange:m=>pe(parseInt(m.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",u.slider,n)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(Z)," (",Z,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"integrityImpact",className:"block text-sm font-medium mb-1",children:["Integrity Impact (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the integrity of data been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"integrityImpact",min:"1",max:"5",step:"1",value:L,onChange:m=>C(parseInt(m.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",u.slider,n)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(L)," (",L,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"availabilityImpact",className:"block text-sm font-medium mb-1",children:["Availability Impact (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How much has the availability of data or systems been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"availabilityImpact",min:"1",max:"5",step:"1",value:I,onChange:m=>d(parseInt(m.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",u.slider,n)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(I)," (",I,")"]})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Risk to Data Subjects"}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"harmLikelihood",className:"block text-sm font-medium mb-1",children:["Likelihood of Harm (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How likely is it that data subjects will experience harm?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"harmLikelihood",min:"1",max:"5",step:"1",value:q,onChange:m=>E(parseInt(m.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",u.slider,n)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(q)," (",q,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"harmSeverity",className:"block text-sm font-medium mb-1",children:["Severity of Harm (1-5)",jsx("span",{className:"ml-2 text-sm text-gray-600 dark:text-gray-400",children:"How severe would the harm be to affected data subjects?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"harmSeverity",min:"1",max:"5",step:"1",value:O,onChange:m=>M(parseInt(m.target.value)),className:a("w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",u.slider,n)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[s(O)," (",O,")"]})]})]}),jsxs("div",{className:"mb-4",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("input",{type:"checkbox",id:"risksToRightsAndFreedoms",checked:_,onChange:m=>J(m.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"risksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a risk to the rights and freedoms of data subjects"})]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40), breaches that pose a risk to rights and freedoms must be reported to the NDPC within 72 hours."})]}),jsxs("div",{className:"mb-4",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("input",{type:"checkbox",id:"highRisksToRightsAndFreedoms",checked:z,onChange:m=>K(m.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"highRisksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a high risk to the rights and freedoms of data subjects"})]}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 ml-6",children:"Under the NDPA (Section 40(4)), breaches that pose a high risk to rights and freedoms also require notification to affected data subjects without undue delay."})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Overall Assessment"}),jsxs("div",{className:"mb-4 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsx("span",{className:"font-medium",children:"Overall Risk Score:"}),jsxs("span",{className:a("",u.riskScore,n),children:[Q," / 5"]})]}),jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:"font-medium",children:"Risk Level:"}),f(B)]})]}),jsxs("div",{className:"mb-4",children:[jsxs("label",{htmlFor:"justification",className:"block text-sm font-medium mb-1",children:["Justification for Assessment ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{id:"justification",value:V,onChange:m=>le(m.target.value),rows:4,placeholder:"Explain the reasoning behind your assessment, including any factors that influenced your decision.",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",required:true})]})]}),jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This assessment will determine if notification is required for this breach."})]}),jsx("div",{className:"mt-6",children:jsx("button",{type:"submit",className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${ee}`,u.primaryButton||u.submitButton,n),children:de})})]})})]})};var dt=({breachReports:N,riskAssessments:x,regulatoryNotifications:D,onSelectBreach:oe,onRequestAssessment:ne,onRequestNotification:de,title:me="Breach Notification Manager",description:ee="Manage data breach notifications and track compliance with NDPA Section 40 requirements.",className:u="",buttonClassName:n="",classNames:p={},unstyled:P=false,showBreachDetails:Z=true,showNotificationTimeline:pe=true,showDeadlineAlerts:L=true})=>{var be;let[C,I]=useState(null),[d,q]=useState(N),[E,O]=useState("all"),[M,_]=useState(""),[J,z]=useState("discoveredAt"),[K,V]=useState("desc");useEffect(()=>{let s=[...N];if(E!=="all"&&(s=s.filter(f=>f.status===E)),M){let f=M.toLowerCase();s=s.filter(m=>m.title.toLowerCase().includes(f)||m.description.toLowerCase().includes(f)||m.affectedSystems.some(R=>R.toLowerCase().includes(f))||m.dataTypes.some(R=>R.toLowerCase().includes(f)));}s.sort((f,m)=>{let R=0;switch(J){case "title":R=f.title.localeCompare(m.title);break;case "discoveredAt":R=f.discoveredAt-m.discoveredAt;break;case "status":R=f.status.localeCompare(m.status);break;case "riskLevel":let H=x.find($=>$.breachId===f.id),G=x.find($=>$.breachId===m.id),ue=(H==null?void 0:H.riskLevel)||"unknown",re=(G==null?void 0:G.riskLevel)||"unknown";R=ue.localeCompare(re);break;default:R=f.discoveredAt-m.discoveredAt;}return K==="asc"?R:-R}),q(s);},[N,E,M,J,K,x]),useEffect(()=>{d.length>0&&!C&&I(d[0].id);},[d,C]);let le=s=>{I(s),oe&&oe(s);},Q=()=>{C&&ne&&ne(C);},ce=()=>{C&&de&&de(C);},B=s=>new Date(s).toLocaleString(),k=C?N.find(s=>s.id===C):null,w=C?x.find(s=>s.breachId===C):null,y=C?D.find(s=>s.breachId===C):null,S=k?te(k,w):null;function te(s,f){let m=a$1(s,f||void 0),R=s.discoveredAt+m.timeframeHours*60*60*1e3;return {ndpcNotificationRequired:m.notificationRequired,ndpcNotificationDeadline:R,dataSubjectNotificationRequired:(f==null?void 0:f.highRisksToRightsAndFreedoms)||false,justification:m.justification}}function U(s){let f=Date.now(),m=(s-f)/(3600*1e3);return Number(m.toFixed(1))}let ae=s=>s?jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[s]}`,p.statusBadge,P),children:s.charAt(0).toUpperCase()+s.slice(1)}):null,h=s=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{ongoing:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",contained:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",resolved:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"}[s]||"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200"}`,p.statusBadge,P),children:s.charAt(0).toUpperCase()+s.slice(1)}),j=()=>{if(!k||!S)return null;if(!S.ndpcNotificationRequired)return jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Not Required"}),jsx("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:"Based on the risk assessment, NDPC notification is not required for this breach."})]});if(y)return jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Notification Sent"}),jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:["Notification was sent to the NDPC on ",B(y.sentAt),"."]})]});let s=U(S.ndpcNotificationDeadline);return s<=0?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Notification Deadline Passed"}),jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The 72-hour deadline for NDPC notification has passed. Notification should be sent immediately."})]}):s<=24?jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Notification Due Soon"}),jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",s," hours remaining until the NDPC notification deadline."]})]}):jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Notification Required"}),jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:["NDPC notification is required by ",B(S.ndpcNotificationDeadline)," (",s," hours remaining)."]})]})},ge=()=>{if(!k)return null;let s=[{title:"Breach Discovered",date:k.discoveredAt,completed:true,description:`Breach was discovered on ${B(k.discoveredAt)}.`},{title:"Risk Assessment",date:w==null?void 0:w.assessedAt,completed:!!w,description:w?`Risk assessment completed on ${B(w.assessedAt)}.`:"Risk assessment has not been completed yet."}];return S!=null&&S.ndpcNotificationRequired&&s.push({title:"NDPC Notification",date:y==null?void 0:y.sentAt,completed:!!y,description:y?`Notification sent to the NDPC on ${B(y.sentAt)}.`:`Notification must be sent to the NDPC by ${B(S.ndpcNotificationDeadline)}.`}),S!=null&&S.dataSubjectNotificationRequired&&s.push({title:"Data Subject Notification",date:void 0,completed:false,description:"Notification to affected data subjects is required but has not been sent yet."}),jsxs("div",{className:a("mt-6",p.timeline,P),children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Notification Timeline"}),jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:s.map((f,m)=>jsxs("li",{className:a("mb-6 ml-4",p.timelineStep,P),children:[jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${f.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-600 dark:text-gray-500",children:f.date?B(f.date):"Pending"}),jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:f.title}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:f.description})]},m))})]})};return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${u}`,p.root,P),children:[jsxs("div",{className:a("",p.header,P),children:[jsx("h2",{className:a("text-xl font-bold mb-2",p.title,P),children:me}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:ee})]}),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxs("select",{id:"statusFilter",value:E,onChange:s=>O(s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsx("option",{value:"all",children:"All Statuses"}),jsx("option",{value:"ongoing",children:"Ongoing"}),jsx("option",{value:"contained",children:"Contained"}),jsx("option",{value:"resolved",children:"Resolved"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxs("select",{id:"sortBy",value:J,onChange:s=>z(s.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsx("option",{value:"discoveredAt",children:"Discovery Date"}),jsx("option",{value:"title",children:"Title"}),jsx("option",{value:"status",children:"Status"}),jsx("option",{value:"riskLevel",children:"Risk Level"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsx("input",{type:"text",id:"searchTerm",value:M,onChange:s=>_(s.target.value),placeholder:"Search breaches...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxs("div",{className:"md:col-span-1",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Breach Reports"}),d.length===0?jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No breach reports found."}):jsx("div",{className:a("space-y-2 max-h-96 overflow-y-auto pr-2",p.breachList,P),children:d.map(s=>{let f=x.find(G=>G.breachId===s.id),m=D.find(G=>G.breachId===s.id),R=te(s,f),H=null;if(R!=null&&R.ndpcNotificationRequired)if(m)H=jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Notified"});else {let G=U(R.ndpcNotificationDeadline);G<=0?H=jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):G<=24?H=jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):H=jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Required"});}else H=jsx("span",{className:"text-xs text-green-600 dark:text-green-400",children:"Not Required"});return jsxs("div",{className:a(`p-3 rounded-md cursor-pointer ${C===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"}`,p.breachItem,P),onClick:()=>le(s.id),children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:s.title}),h(s.status)]}),jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:["Discovered: ",new Date(s.discoveredAt).toLocaleDateString()]}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsx("div",{children:f&&ae(f.riskLevel)}),jsx("div",{children:H})]})]},s.id)})})]}),jsx("div",{className:a("md:col-span-2",p.detailPanel,P),children:k?jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsx("h3",{className:"text-lg font-medium",children:k.title}),h(k.status)]}),L&&jsx("div",{className:"mb-4",children:j()}),Z&&jsxs("div",{className:"mb-6",children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Discovered:"})," ",B(k.discoveredAt)]}),k.occurredAt&&jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Occurred:"})," ",B(k.occurredAt)]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Reporter:"})," ",k.reporter.name]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",k.affectedSystems.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Data Types:"})," ",k.dataTypes.join(", ")]}),jsxs("p",{className:"text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",k.estimatedAffectedSubjects||"Unknown"]})]})]}),jsxs("div",{className:"mb-4",children:[jsx("p",{className:"text-sm font-medium",children:"Description:"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:k.description})]}),k.initialActions&&jsxs("div",{children:[jsx("p",{className:"text-sm font-medium",children:"Initial Actions Taken:"}),jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:k.initialActions})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Risk Assessment"}),w?jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsx("p",{className:"text-sm font-medium",children:"Risk Level:"}),ae(w.riskLevel)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risk Score:"})," ",w.overallRiskScore," / 5"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",w.risksToRightsAndFreedoms?"Yes":"No"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",w.highRisksToRightsAndFreedoms?"Yes":"No"]}),jsx("p",{className:"text-sm mb-1",children:jsx("span",{className:"font-medium",children:"Justification:"})}),jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300 bg-white dark:bg-gray-800 p-2 rounded-md",children:w.justification})]}):jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"Risk assessment has not been conducted yet."}),jsx("button",{onClick:Q,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${n}`,children:"Conduct Risk Assessment"})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Status"}),y?jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Notification Sent:"})," ",B(y.sentAt)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Method:"})," ",y.method.charAt(0).toUpperCase()+y.method.slice(1)]}),y.referenceNumber&&jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Reference Number:"})," ",y.referenceNumber]}),(y.ndpcContact||y.nitdaContact)&&jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"NDPC Contact:"})," ",(be=y.ndpcContact||y.nitdaContact)==null?void 0:be.name]})]}):jsx("div",{children:S!=null&&S.ndpcNotificationRequired?jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:"NDPC notification is required but has not been sent yet."}),jsx("button",{onClick:ce,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${n}`,children:"Generate Notification"})]}):jsx("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:jsx("p",{className:"text-sm text-green-800 dark:text-green-200",children:"NDPC notification is not required for this breach."})})})]}),pe&&ge()]}):jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Select a breach to view details"})})})]})]})};var bt=({breachData:N,assessmentData:x,organizationInfo:D,onGenerate:oe,title:ne="Generate NDPC Notification Report",description:de="Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements.",generateButtonText:me="Generate Report",className:ee="",buttonClassName:u="",classNames:n={},unstyled:p=false,showPreview:P=true,allowEditing:Z=true,allowDownload:pe=true,downloadFormat:L="pdf"})=>{let[C,I]=useState(""),[d,q]=useState(""),[E,O]=useState(""),[M,_]=useState(""),[J,z]=useState("email"),[K,V]=useState(""),[le,Q]=useState(""),[ce,B]=useState(false),[k,w]=useState(false);useEffect(()=>{if(!ce){let h=S();I(h),B(true);}},[N,x,D]);let y=h=>new Date(h).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),S=()=>`
|
|
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: ${D.name}
|
|
11
|
-
${D.registrationNumber?`Registration Number: ${D.registrationNumber}`:""}
|
|
12
|
-
Address: ${D.address}
|
|
13
|
-
${D.website?`Website: ${D.website}`:""}
|
|
14
|
-
|
|
15
|
-
DATA PROTECTION OFFICER
|
|
16
|
-
----------------------
|
|
17
|
-
Name: ${D.dpoName}
|
|
18
|
-
Email: ${D.dpoEmail}
|
|
19
|
-
${D.dpoPhone?`Phone: ${D.dpoPhone}`:""}
|
|
20
|
-
|
|
21
|
-
BREACH DETAILS
|
|
22
|
-
-------------
|
|
23
|
-
Breach Title: ${N.title}
|
|
24
|
-
Date Discovered: ${y(N.discoveredAt)}
|
|
25
|
-
${N.occurredAt?`Date Occurred: ${y(N.occurredAt)}`:"Date Occurred: Unknown"}
|
|
26
|
-
Status: ${N.status.charAt(0).toUpperCase()+N.status.slice(1)}
|
|
27
|
-
|
|
28
|
-
Description of the Breach:
|
|
29
|
-
${N.description}
|
|
30
|
-
|
|
31
|
-
Affected Systems/Applications:
|
|
32
|
-
${N.affectedSystems.join(", ")}
|
|
33
|
-
|
|
34
|
-
Types of Personal Data Involved:
|
|
35
|
-
${N.dataTypes.join(", ")}
|
|
36
|
-
|
|
37
|
-
Estimated Number of Data Subjects Affected:
|
|
38
|
-
${N.estimatedAffectedSubjects||"Unknown"}
|
|
39
|
-
|
|
40
|
-
RISK ASSESSMENT
|
|
41
|
-
--------------
|
|
42
|
-
${x?`
|
|
43
|
-
Overall Risk Level: ${x.riskLevel.charAt(0).toUpperCase()+x.riskLevel.slice(1)}
|
|
44
|
-
Risk to Rights and Freedoms of Data Subjects: ${x.risksToRightsAndFreedoms?"Yes":"No"}
|
|
45
|
-
High Risk to Rights and Freedoms of Data Subjects: ${x.highRisksToRightsAndFreedoms?"Yes":"No"}
|
|
46
|
-
|
|
47
|
-
Justification for Risk Assessment:
|
|
48
|
-
${x.justification}
|
|
49
|
-
`:"Risk assessment has not been conducted yet."}
|
|
50
|
-
|
|
51
|
-
MEASURES TAKEN
|
|
52
|
-
-------------
|
|
53
|
-
Measures taken or proposed to address the breach:
|
|
54
|
-
${N.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
|
-
`,te=h=>{h.preventDefault();let j={id:`notification_${Date.now()}`,breachId:N.id,sentAt:Date.now(),method:J,referenceNumber:K||void 0,ndpcContact:d?{name:d,email:E,phone:M||void 0}:void 0,content:C,attachments:[]};oe(j),w(true);},U=()=>{let h=document.createElement("a"),j=new Blob([C],{type:"text/plain"});h.href=URL.createObjectURL(j),h.download=`NDPC_Breach_Notification_${new Date().toISOString().split("T")[0]}.txt`,document.body.appendChild(h),h.click(),document.body.removeChild(h);},ae=()=>[{value:"email",label:"Email"},{value:"portal",label:"NDPC Portal"},{value:"letter",label:"Formal Letter"},{value:"other",label:"Other"}].map(j=>jsx("option",{value:j.value,children:j.label},j.value));return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ee}`,n.root,p),children:[jsxs("div",{className:a("",n.header,p),children:[jsx("h2",{className:a("text-xl font-bold mb-2",n.title,p),children:ne}),jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:de})]}),k?jsxs("div",{children:[jsxs("div",{className:"mb-6 p-4 bg-green-50 dark:bg-green-900/20 rounded-md",children:[jsx("h3",{className:"text-lg font-bold text-green-800 dark:text-green-200 mb-2",children:"Report Generated Successfully"}),jsx("p",{className:"text-green-700 dark:text-green-300",children:"Your NDPC notification report has been generated and is ready for submission. Please review the report carefully before submitting it to the NDPC."})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Submission Details"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:a("text-sm",n.field,p),children:[jsx("span",{className:a("font-medium",n.fieldLabel,p),children:"Method:"})," ",jsx("span",{className:a("",n.fieldValue,p),children:J.charAt(0).toUpperCase()+J.slice(1)})]}),d&&jsxs("p",{className:a("text-sm",n.field,p),children:[jsx("span",{className:a("font-medium",n.fieldLabel,p),children:"Contact Name:"})," ",jsx("span",{className:a("",n.fieldValue,p),children:d})]}),E&&jsxs("p",{className:a("text-sm",n.field,p),children:[jsx("span",{className:a("font-medium",n.fieldLabel,p),children:"Contact Email:"})," ",jsx("span",{className:a("",n.fieldValue,p),children:E})]}),M&&jsxs("p",{className:a("text-sm",n.field,p),children:[jsx("span",{className:a("font-medium",n.fieldLabel,p),children:"Contact Phone:"})," ",jsx("span",{className:a("",n.fieldValue,p),children:M})]})]}),jsxs("div",{children:[jsxs("p",{className:a("text-sm",n.field,p),children:[jsx("span",{className:a("font-medium",n.fieldLabel,p),children:"Date Generated:"})," ",jsx("span",{className:a("",n.fieldValue,p),children:y(Date.now())})]}),jsxs("p",{className:a("text-sm",n.field,p),children:[jsx("span",{className:a("font-medium",n.fieldLabel,p),children:"Breach ID:"})," ",jsx("span",{className:a("",n.fieldValue,p),children:N.id})]}),K&&jsxs("p",{className:a("text-sm",n.field,p),children:[jsx("span",{className:a("font-medium",n.fieldLabel,p),children:"Reference Number:"})," ",jsx("span",{className:a("",n.fieldValue,p),children:K})]})]})]})]}),P&&jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Preview"}),jsx("div",{className:a("bg-gray-50 dark:bg-gray-700 p-4 rounded-md",n.reportPreview,p),children:jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:C})})]}),jsxs("div",{className:"flex flex-wrap gap-3",children:[pe&&jsxs("button",{onClick:U,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${u}`,n.secondaryButton||n.downloadButton,p),children:["Download Report (",L.toUpperCase(),")"]}),jsx("button",{onClick:()=>w(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 ${u}`,children:"Edit Report"})]})]}):jsx("form",{onSubmit:te,children:jsxs("div",{className:"space-y-6",children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Notification Method"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"method",className:"block text-sm font-medium mb-1",children:["Method of Submission ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("select",{id:"method",value:J,onChange:h=>z(h.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:ae()})]}),jsxs("div",{children:[jsx("label",{htmlFor:"referenceNumber",className:"block text-sm font-medium mb-1",children:"Reference Number (if available)"}),jsx("input",{type:"text",id:"referenceNumber",value:K,onChange:h=>V(h.target.value),placeholder:"e.g. NDPC/BR/2024/001",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"NDPC Contact (if known)"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[jsxs("div",{children:[jsx("label",{htmlFor:"contactName",className:"block text-sm font-medium mb-1",children:"Contact Name"}),jsx("input",{type:"text",id:"contactName",value:d,onChange:h=>q(h.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"contactEmail",className:"block text-sm font-medium mb-1",children:"Contact Email"}),jsx("input",{type:"email",id:"contactEmail",value:E,onChange:h=>O(h.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"contactPhone",className:"block text-sm font-medium mb-1",children:"Contact Phone"}),jsx("input",{type:"tel",id:"contactPhone",value:M,onChange:h=>_(h.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsxs("div",{children:[jsx("label",{htmlFor:"additionalInfo",className:"block text-sm font-medium mb-1",children:"Additional Information to Include"}),jsx("textarea",{id:"additionalInfo",value:le,onChange:h=>Q(h.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))]"})]})]}),Z&&jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold mb-3",children:"Report Content"}),jsxs("div",{children:[jsxs("label",{htmlFor:"reportContent",className:"block text-sm font-medium mb-1",children:["Edit Report Content ",jsx("span",{className:"text-red-500",children:"*"})]}),jsx("textarea",{id:"reportContent",value:C,onChange:h=>I(h.target.value),rows:20,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] font-mono text-sm",required:true})]})]}),jsxs("div",{className:"mt-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This report will help you comply with this requirement."})]}),jsx("div",{className:"mt-6",children:jsx("button",{type:"submit",className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${u}`,n.primaryButton||n.generateButton,p),children:me})})]})})]})};export{ze as a,tt as b,dt as c,bt as d};//# sourceMappingURL=chunk-XMYUYQH7.mjs.map
|
|
72
|
-
//# sourceMappingURL=chunk-XMYUYQH7.mjs.map
|