@tantainnovative/ndpr-toolkit 3.3.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +529 -0
- package/README.md +4 -4
- package/dist/{ConsentBanner-CDRT0o2k.d.mts → ConsentBanner-F5ayys5K.d.mts} +10 -0
- package/dist/{ConsentBanner-Vxyt8SCX.d.ts → ConsentBanner-VqIPophc.d.ts} +10 -0
- package/dist/{styling-B7CBzYG7.d.ts → ConsentManager-C7I3PDe8.d.mts} +2 -62
- package/dist/{styling-uJLsBbER.d.mts → ConsentManager-CQ2IZtUU.d.ts} +2 -62
- package/dist/{sanitize-B0AzEm1D.d.mts → NDPRProvider-DYFb8xEl.d.ts} +2 -94
- package/dist/{sanitize-B0AzEm1D.d.ts → NDPRProvider-U3QNu6MA.d.mts} +2 -94
- package/dist/adapters.js +1 -1
- package/dist/adapters.mjs +1 -1
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-2AW7KAZO.mjs +2 -0
- package/dist/chunk-2WH4DLV5.js +3 -0
- package/dist/chunk-3NQQSU4P.js +2 -0
- package/dist/chunk-3VQAYQR7.js +7 -0
- package/dist/chunk-4R42ZNO7.mjs +318 -0
- package/dist/chunk-5HL4UBFV.js +2 -0
- package/dist/chunk-6FGCGLH5.mjs +2 -0
- package/dist/chunk-6HZL2WDU.mjs +2 -0
- package/dist/chunk-6QPRDQZF.js +2 -0
- package/dist/chunk-74Z23WUA.mjs +2 -0
- package/dist/chunk-AHSMDPG5.js +132 -0
- package/dist/chunk-BN77GP4W.mjs +2 -0
- package/dist/chunk-C5QO3SX4.js +2 -0
- package/dist/chunk-CISJAQ6W.mjs +2 -0
- package/dist/chunk-DCJK5OZT.mjs +2 -0
- package/dist/chunk-DUY6F3GT.mjs +94 -0
- package/dist/chunk-EHAZIKDX.js +81 -0
- package/dist/chunk-EPT2K355.mjs +2 -0
- package/dist/chunk-HGGLW5TE.js +2 -0
- package/dist/chunk-HQSU7LGM.js +94 -0
- package/dist/chunk-IZCWCE7W.mjs +2 -0
- package/dist/chunk-JBSCER34.js +2 -0
- package/dist/chunk-KF3EFJEF.mjs +3 -0
- package/dist/chunk-KSERBMXW.mjs +4 -0
- package/dist/chunk-LJNNPAFU.mjs +2 -0
- package/dist/{chunk-UXMGBIX6.js → chunk-LSCMXAPY.mjs} +4 -4
- package/dist/chunk-LSNL4XR5.js +2 -0
- package/dist/chunk-M2TPT5GB.js +2 -0
- package/dist/chunk-MCWV7S2G.js +2 -0
- package/dist/chunk-MG73MOZC.mjs +15 -0
- package/dist/chunk-NCOZB2WU.mjs +2 -0
- package/dist/chunk-NQNFS3QI.js +7 -0
- package/dist/chunk-OPYQIJKY.js +2 -0
- package/dist/{chunk-ZEOQYWOE.mjs → chunk-P2YV6DR3.js} +4 -4
- package/dist/chunk-P6QAFBCV.js +2 -0
- package/dist/chunk-QVULSG6J.mjs +3 -0
- package/dist/chunk-R5FW5XUQ.mjs +2 -0
- package/dist/chunk-RGNP45VR.js +2 -0
- package/dist/chunk-RLYTX3MM.js +2 -0
- package/dist/chunk-RNTNHVKZ.js +15 -0
- package/dist/chunk-RRVKUCFR.mjs +2 -0
- package/dist/chunk-RXL6CZAI.js +2 -0
- package/dist/chunk-RY3PGVLZ.mjs +2 -0
- package/dist/chunk-SUEGUY35.js +2 -0
- package/dist/chunk-SYMQJO2W.mjs +7 -0
- package/dist/chunk-TCN22KYP.mjs +7 -0
- package/dist/chunk-UFPSUO52.js +318 -0
- package/dist/chunk-VTITKWGX.mjs +2 -0
- package/dist/chunk-WH6ZMUOS.mjs +81 -0
- package/dist/chunk-WTJGLNTB.js +3 -0
- package/dist/chunk-XHROISIF.mjs +2 -0
- package/dist/chunk-XMBSJJ5U.js +4 -0
- package/dist/chunk-XSEZDQLB.js +2 -0
- package/dist/chunk-Z6IIMLZU.mjs +2 -0
- package/dist/chunk-ZLSWOFAY.mjs +132 -0
- package/dist/chunk-ZPKVLTSX.js +2 -0
- package/dist/consent.d.mts +6 -4
- package/dist/consent.d.ts +6 -4
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +6 -25
- package/dist/core.d.ts +6 -25
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border.d.mts +2 -2
- package/dist/cross-border.d.ts +2 -2
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/docx-BxKascXN.d.ts +64 -0
- package/dist/docx-CV7Vsry_.d.mts +64 -0
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +4 -4
- package/dist/hooks.d.ts +4 -4
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +8 -6
- package/dist/index.d.ts +8 -6
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/locale-CxJx2tzn.d.mts +25 -0
- package/dist/locale-DSkrtf-c.d.ts +25 -0
- package/dist/{policy-engine-C6nC2t3a.d.ts → policy-engine-CCUCud2T.d.ts} +1 -1
- package/dist/{policy-engine-DefZcX3R.d.mts → policy-engine-fYSqEqSW.d.mts} +1 -1
- package/dist/{policy-sections-DFDPVCCg.d.ts → policy-sections-BYx6fEFk.d.ts} +4 -2
- package/dist/{policy-sections-Bylm31kZ.d.mts → policy-sections-Dm97Nq8m.d.mts} +4 -2
- package/dist/{policy-templates-CIKcV0i1.d.ts → policy-templates-DhLwq4R-.d.ts} +8 -1
- package/dist/{policy-templates-DMsPwOSZ.d.mts → policy-templates-DwYl2329.d.mts} +8 -1
- package/dist/policy.d.mts +36 -71
- package/dist/policy.d.ts +36 -71
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets.d.mts +2 -2
- package/dist/presets.d.ts +2 -2
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/sanitize-CxxwKxAx.d.mts +94 -0
- package/dist/sanitize-CxxwKxAx.d.ts +94 -0
- package/dist/server.d.mts +24 -0
- package/dist/server.d.ts +24 -0
- package/dist/server.js +2 -0
- package/dist/server.mjs +2 -0
- package/dist/styles.css +1423 -31
- package/dist/styling-BMDGQDgS.d.mts +64 -0
- package/dist/styling-BaoQtV06.d.ts +64 -0
- package/dist/unstyled.d.mts +52 -19
- package/dist/unstyled.d.ts +52 -19
- package/dist/unstyled.js +1 -1
- package/dist/unstyled.mjs +1 -1
- package/dist/{useAdaptivePolicyWizard-A1PyOy6P.d.mts → useAdaptivePolicyWizard-BnjW4OR4.d.mts} +1 -1
- package/dist/{useAdaptivePolicyWizard-LVIKhAxw.d.ts → useAdaptivePolicyWizard-sb3m4-Zk.d.ts} +1 -1
- package/dist/{useCrossBorderTransfer-BGNZt2lk.d.mts → useCrossBorderTransfer-DixjLjN1.d.mts} +1 -1
- package/dist/{useCrossBorderTransfer-COqjgjsu.d.ts → useCrossBorderTransfer-DvSq06lv.d.ts} +1 -1
- package/dist/{useDefaultPrivacyPolicy-BsYttRey.d.mts → useDefaultPrivacyPolicy-Cs2WQSYQ.d.mts} +34 -9
- package/dist/{useDefaultPrivacyPolicy-C-mG-A5S.d.ts → useDefaultPrivacyPolicy-DkOqMg2e.d.ts} +34 -9
- package/package.json +20 -6
- package/dist/chunk-256APOQM.js +0 -2
- package/dist/chunk-25OOUES4.js +0 -2
- package/dist/chunk-4JKTIR33.mjs +0 -2
- package/dist/chunk-5BUS6AI7.js +0 -2
- package/dist/chunk-6BXUVS6E.js +0 -81
- package/dist/chunk-6JCRDJQI.mjs +0 -2
- package/dist/chunk-6RQGQZT2.js +0 -2
- package/dist/chunk-6YN73KR7.mjs +0 -2
- package/dist/chunk-CDZDT2OS.mjs +0 -320
- package/dist/chunk-CSIJCLGZ.mjs +0 -2
- package/dist/chunk-CWUPGY3M.mjs +0 -3
- package/dist/chunk-E63VPR7U.js +0 -2
- package/dist/chunk-FDDI426Y.mjs +0 -2
- package/dist/chunk-GCQRHMTQ.mjs +0 -144
- package/dist/chunk-GMLCWGNJ.js +0 -7
- package/dist/chunk-GQVNLUP2.js +0 -94
- package/dist/chunk-GXLSOZCH.mjs +0 -2
- package/dist/chunk-IQJO7WIH.js +0 -7
- package/dist/chunk-LETEUS5X.mjs +0 -2
- package/dist/chunk-LU4PFST7.js +0 -144
- package/dist/chunk-M6XETYNL.js +0 -2
- package/dist/chunk-NBSVFQ5G.js +0 -2
- package/dist/chunk-NUDVUAD4.mjs +0 -81
- package/dist/chunk-NUULHXVL.mjs +0 -7
- package/dist/chunk-PM7O5IGE.mjs +0 -2
- package/dist/chunk-Q7VHB64E.mjs +0 -2
- package/dist/chunk-QDHHD2KR.mjs +0 -94
- package/dist/chunk-SAA7UVI2.js +0 -3
- package/dist/chunk-TI2M7H6R.mjs +0 -7
- package/dist/chunk-TKVJ3OOV.mjs +0 -2
- package/dist/chunk-TXXWCB5O.js +0 -320
- package/dist/chunk-UGY5ZYUG.js +0 -2
- package/dist/chunk-UO6QPJLH.js +0 -2
- package/dist/chunk-UX6ZZNEM.mjs +0 -3
- package/dist/chunk-VLSGE2YA.js +0 -2
- package/dist/chunk-XFUEZ3MP.mjs +0 -2
- package/dist/chunk-XHSHPB74.js +0 -2
- package/dist/chunk-YCX6BFOQ.js +0 -2
- package/dist/chunk-YURSF2YO.mjs +0 -2
- package/dist/chunk-YZXUAIYN.js +0 -3
- package/dist/chunk-ZGJA7OO4.js +0 -2
- package/dist/chunk-ZT7KNFAU.mjs +0 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
'use strict';var chunkC4YM4UMI_js=require('./chunk-C4YM4UMI.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var I=[{value:"adequacy_decision",label:"Adequacy Decision (Section 41)"},{value:"standard_clauses",label:"Standard Contractual Clauses (Section 42)"},{value:"binding_corporate_rules",label:"Binding Corporate Rules (Section 43)"},{value:"ndpc_authorization",label:"NDPC Authorization (Section 44)"},{value:"explicit_consent",label:"Explicit Consent (Section 45(a))"},{value:"contract_performance",label:"Contract Performance (Section 45(b))"},{value:"public_interest",label:"Public Interest (Section 45(c))"},{value:"legal_claims",label:"Legal Claims (Section 45(d))"},{value:"vital_interests",label:"Vital Interests (Section 45(e))"}],G=[{value:"adequate",label:"Adequate"},{value:"inadequate",label:"Inadequate"},{value:"pending_review",label:"Pending Review"},{value:"unknown",label:"Unknown"}],J=[{value:"one_time",label:"One-Time"},{value:"periodic",label:"Periodic"},{value:"continuous",label:"Continuous"}],X=[{value:"active",label:"Active"},{value:"suspended",label:"Suspended"},{value:"terminated",label:"Terminated"},{value:"pending_approval",label:"Pending Approval"}],Z={destinationCountry:"",destinationCountryCode:"",adequacyStatus:"unknown",transferMechanism:"adequacy_decision",dataCategories:"",includesSensitiveData:false,estimatedDataSubjects:"",recipientOrganization:"",recipientContactName:"",recipientContactEmail:"",recipientContactPhone:"",recipientContactAddress:"",purpose:"",safeguards:"",riskAssessment:"",riskLevel:"medium",frequency:"one_time",status:"active",tiaCompleted:false,tiaReference:"",ndpcApprovalApplied:false,ndpcApprovalApproved:false,ndpcApprovalReference:""},xe=({transfers:v,onAddTransfer:q,onUpdateTransfer:R,onRemoveTransfer:F,summary:E,title:ee="Cross-Border Data Transfer Manager",description:te="Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VI (Sections 41-45).",className:ae="",buttonClassName:M="",showSummary:re=true,showTIA:ie=true,classNames:a,unstyled:d})=>{let[f,y]=react.useState(null),[j,S]=react.useState(false),[h,z]=react.useState(null),[n,P]=react.useState(Z),[C,L]=react.useState(null),[k,ne]=react.useState("all"),[T,de]=react.useState("all"),x=react.useMemo(()=>{let e=[...v];return k!=="all"&&(e=e.filter(r=>r.status===k)),T!=="all"&&(e=e.filter(r=>r.transferMechanism===T)),e.sort((r,l)=>l.updatedAt-r.updatedAt),e},[v,k,T]);react.useEffect(()=>{x.length>0&&!f&&y(x[0].id);},[x,f]);let $=react.useMemo(()=>{var e;return f&&(e=v.find(r=>r.id===f))!=null?e:null},[v,f]),A=react.useCallback(e=>new Date(e).toLocaleDateString(),[]),_=react.useCallback(()=>{P(Z),z(null),L(null);},[]),pe=react.useCallback(()=>{_(),S(true);},[_]),le=react.useCallback(e=>{var r,l,c,g;z(e.id),P({destinationCountry:e.destinationCountry,destinationCountryCode:e.destinationCountryCode||"",adequacyStatus:e.adequacyStatus,transferMechanism:e.transferMechanism,dataCategories:e.dataCategories.join(", "),includesSensitiveData:e.includesSensitiveData,estimatedDataSubjects:((r=e.estimatedDataSubjects)==null?void 0:r.toString())||"",recipientOrganization:e.recipientOrganization,recipientContactName:e.recipientContact.name,recipientContactEmail:e.recipientContact.email,recipientContactPhone:e.recipientContact.phone||"",recipientContactAddress:e.recipientContact.address||"",purpose:e.purpose,safeguards:e.safeguards.join(`
|
|
2
|
+
`),riskAssessment:e.riskAssessment,riskLevel:e.riskLevel,frequency:e.frequency,status:e.status,tiaCompleted:e.tiaCompleted,tiaReference:e.tiaReference||"",ndpcApprovalApplied:((l=e.ndpcApproval)==null?void 0:l.applied)||false,ndpcApprovalApproved:((c=e.ndpcApproval)==null?void 0:c.approved)||false,ndpcApprovalReference:((g=e.ndpcApproval)==null?void 0:g.referenceNumber)||""}),S(true);},[]),o=react.useCallback((e,r)=>{P(l=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},l),{[e]:r}));},[]),V=react.useCallback(()=>{let e=chunkC4YM4UMI_js.e(n.transferMechanism),r=Date.now();return {destinationCountry:n.destinationCountry.trim(),destinationCountryCode:n.destinationCountryCode.trim()||void 0,adequacyStatus:n.adequacyStatus,transferMechanism:n.transferMechanism,dataCategories:n.dataCategories.split(",").map(l=>l.trim()).filter(Boolean),includesSensitiveData:n.includesSensitiveData,estimatedDataSubjects:n.estimatedDataSubjects?parseInt(n.estimatedDataSubjects,10):void 0,recipientOrganization:n.recipientOrganization.trim(),recipientContact:{name:n.recipientContactName.trim(),email:n.recipientContactEmail.trim(),phone:n.recipientContactPhone.trim()||void 0,address:n.recipientContactAddress.trim()||void 0},purpose:n.purpose.trim(),safeguards:n.safeguards.split(`
|
|
3
|
+
`).map(l=>l.trim()).filter(Boolean),riskAssessment:n.riskAssessment.trim(),riskLevel:n.riskLevel,frequency:n.frequency,status:e&&!n.ndpcApprovalApproved?"pending_approval":n.status,tiaCompleted:n.tiaCompleted,tiaReference:n.tiaReference.trim()||void 0,ndpcApproval:e?{required:true,applied:n.ndpcApprovalApplied,approved:n.ndpcApprovalApproved||void 0,referenceNumber:n.ndpcApprovalReference.trim()||void 0,appliedAt:n.ndpcApprovalApplied?r:void 0,approvedAt:n.ndpcApprovalApproved?r:void 0}:void 0,startDate:r,reviewDate:r+365*24*60*60*1e3}},[n]),oe=react.useCallback(()=>{let e=V(),r=chunkMQFZHA2D_js.a({id:h||"temp",createdAt:Date.now(),updatedAt:Date.now()},e),l=chunkC4YM4UMI_js.g(r);L(l),l.isValid&&(h?R&&R(h,e):q&&q(e),_(),S(false));},[V,h,R,q,_]),U=react.useCallback(()=>{_(),S(false);},[_]),se=react.useCallback(e=>{F&&F(e),f===e&&y(null);},[F,f]),H=react.useCallback(e=>jsxRuntime.jsxs("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--destructive"}[e]}`,a==null?void 0:a.riskBadge,d),children:[e.charAt(0).toUpperCase()+e.slice(1)," Risk"]}),[a==null?void 0:a.riskBadge,d]),Y=react.useCallback(e=>{let r={active:"ndpr-badge ndpr-badge--success",suspended:"ndpr-badge ndpr-badge--warning",terminated:"ndpr-badge ndpr-badge--neutral",pending_approval:"ndpr-badge ndpr-badge--info"},l={active:"Active",suspended:"Suspended",terminated:"Terminated",pending_approval:"Pending Approval"};return jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${r[e]}`,a==null?void 0:a.statusBadge,d),children:l[e]})},[a==null?void 0:a.statusBadge,d]),ce=react.useCallback(e=>{var c;chunkC4YM4UMI_js.e(e);let l=((c=I.find(g=>g.value===e))==null?void 0:c.label)||e;return jsxRuntime.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium ndpr-badge ndpr-badge--info",children:l})},[]),D=react.useMemo(()=>E||{totalActiveTransfers:v.filter(e=>e.status==="active").length,pendingApproval:v.filter(e=>{var r,l;return e.status==="pending_approval"||((r=e.ndpcApproval)==null?void 0:r.required)&&!((l=e.ndpcApproval)!=null&&l.approved)}),highRiskTransfers:v.filter(e=>e.riskLevel==="high"&&e.status==="active"),missingTIA:v.filter(e=>!e.tiaCompleted&&e.status==="active"),byMechanism:{},byAdequacy:{},dueForReview:[],lastUpdated:Date.now()},[E,v]),ue=()=>jsxRuntime.jsxs("div",{"data-ndpr-component":"cross-border-transfer-manager",role:"status","aria-label":"Transfer compliance summary",className:chunkE64TU6IU_js.a("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",a==null?void 0:a.summary,d),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("ndpr-alert ndpr-alert--info",a==null?void 0:a.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:D.totalActiveTransfers}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-info",children:"Active Transfers"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("ndpr-alert ndpr-alert--info",a==null?void 0:a.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:D.pendingApproval.length}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-info",children:"Pending Approval"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("ndpr-alert ndpr-alert--destructive",a==null?void 0:a.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-destructive",children:D.highRiskTransfers.length}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-destructive",children:"High Risk"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("ndpr-alert ndpr-alert--warning",a==null?void 0:a.summaryCard,d),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:D.missingTIA.length}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-warning",children:"Missing TIA"})]})]}),me=()=>{let e=chunkC4YM4UMI_js.e(n.transferMechanism);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-gray-50 dark:bg-gray-700 p-6 rounded-lg mb-6",a==null?void 0:a.form,d),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex justify-between items-center mb-4",a==null?void 0:a.header,d),children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:h?"Edit Transfer":"Add New Transfer"}),jsxRuntime.jsx("button",{onClick:U,"aria-label":"Cancel form",className:"text-gray-600 hover:ndpr-text-muted dark:hover:text-gray-200",children:"Cancel"})]}),C&&!C.isValid&&jsxRuntime.jsxs("div",{id:"cb-form-errors",role:"alert",className:"ndpr-alert ndpr-alert--destructive",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Please fix the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-destructive",children:C.errors.map((r,l)=>jsxRuntime.jsx("li",{children:r},l))})]}),C&&C.warnings.length>0&&jsxRuntime.jsxs("div",{id:"cb-form-warnings",role:"alert",className:"ndpr-alert ndpr-alert--warning",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-warning mb-1",children:"Warnings:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-warning",children:C.warnings.map((r,l)=>jsxRuntime.jsx("li",{children:r},l))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-destinationCountry",className:"ndpr-form-field__label",children:["Destination Country ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-destinationCountry",type:"text",value:n.destinationCountry,onChange:r=>o("destinationCountry",r.target.value),placeholder:"e.g. United Kingdom","aria-required":"true","aria-describedby":"cb-form-errors","aria-label":"Destination country",className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-destinationCountryCode",className:"ndpr-form-field__label",children:"Country Code (ISO)"}),jsxRuntime.jsx("input",{id:"cb-destinationCountryCode",type:"text",value:n.destinationCountryCode,onChange:r=>o("destinationCountryCode",r.target.value),placeholder:"e.g. GB",maxLength:3,"aria-label":"Country code in ISO format",className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-recipientOrganization",className:"ndpr-form-field__label",children:["Recipient Organization ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-recipientOrganization",type:"text",value:n.recipientOrganization,onChange:r=>o("recipientOrganization",r.target.value),placeholder:"Organization name","aria-required":"true","aria-describedby":"cb-form-errors",className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-transferMechanism",className:"ndpr-form-field__label",children:["Transfer Mechanism ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("select",{id:"cb-transferMechanism",value:n.transferMechanism,onChange:r=>o("transferMechanism",r.target.value),"aria-required":"true","aria-describedby":"cb-form-errors",className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.select,d),children:I.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cb-adequacyStatus",className:"ndpr-form-field__label",children:"Adequacy Status"}),jsxRuntime.jsx("select",{id:"cb-adequacyStatus",value:n.adequacyStatus,onChange:r=>o("adequacyStatus",r.target.value),"aria-label":"Select adequacy status of destination country",className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.select,d),children:G.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"ndpr-form-field__label",children:"Risk Level"}),jsxRuntime.jsxs("select",{value:n.riskLevel,onChange:r=>o("riskLevel",r.target.value),className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.select,d),children:[jsxRuntime.jsx("option",{value:"low",children:"Low"}),jsxRuntime.jsx("option",{value:"medium",children:"Medium"}),jsxRuntime.jsx("option",{value:"high",children:"High"})]})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-dataCategories",className:"ndpr-form-field__label",children:["Data Categories ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-dataCategories",type:"text",value:n.dataCategories,onChange:r=>o("dataCategories",r.target.value),placeholder:"Comma-separated, e.g. Names, Email addresses, Phone numbers","aria-required":"true","aria-describedby":"cb-dataCategories-help",className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.input,d)}),jsxRuntime.jsx("p",{id:"cb-dataCategories-help",className:"text-xs text-gray-500 mt-1",children:"Separate categories with commas"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"includesSensitiveData",checked:n.includesSensitiveData,onChange:r=>o("includesSensitiveData",r.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"includesSensitiveData",className:"ndpr-text-sm ndpr-font-medium",children:"Includes sensitive personal data"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"ndpr-form-field__label",children:"Estimated Data Subjects"}),jsxRuntime.jsx("input",{type:"number",value:n.estimatedDataSubjects,onChange:r=>o("estimatedDataSubjects",r.target.value),placeholder:"Number of data subjects",className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-recipientContactName",className:"ndpr-form-field__label",children:["Recipient Contact Name ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-recipientContactName",type:"text",value:n.recipientContactName,onChange:r=>o("recipientContactName",r.target.value),placeholder:"Contact person name","aria-required":"true","aria-describedby":"cb-form-errors",className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"cb-recipientContactEmail",className:"ndpr-form-field__label",children:["Recipient Contact Email ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("input",{id:"cb-recipientContactEmail",type:"email",value:n.recipientContactEmail,onChange:r=>o("recipientContactEmail",r.target.value),placeholder:"contact@example.com","aria-required":"true","aria-describedby":"cb-form-errors",className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"ndpr-form-field__label",children:"Recipient Contact Phone"}),jsxRuntime.jsx("input",{type:"text",value:n.recipientContactPhone,onChange:r=>o("recipientContactPhone",r.target.value),placeholder:"Phone number",className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"ndpr-form-field__label",children:"Recipient Contact Address"}),jsxRuntime.jsx("input",{type:"text",value:n.recipientContactAddress,onChange:r=>o("recipientContactAddress",r.target.value),placeholder:"Address",className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.input,d)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-purpose",className:"ndpr-form-field__label",children:["Purpose of Transfer ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"cb-purpose",value:n.purpose,onChange:r=>o("purpose",r.target.value),placeholder:"Describe the purpose of this data transfer",rows:2,"aria-required":"true","aria-describedby":"cb-form-errors",className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.input,d)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-safeguards",className:"ndpr-form-field__label",children:["Safeguards ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"cb-safeguards",value:n.safeguards,onChange:r=>o("safeguards",r.target.value),placeholder:`One safeguard per line, e.g.
|
|
4
|
+
End-to-end encryption
|
|
5
|
+
Access control policies
|
|
6
|
+
Regular security audits`,rows:3,"aria-required":"true","aria-describedby":"cb-safeguards-help",className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.input,d)}),jsxRuntime.jsx("p",{id:"cb-safeguards-help",className:"text-xs text-gray-500 mt-1",children:"Enter one safeguard per line"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{htmlFor:"cb-riskAssessment",className:"ndpr-form-field__label",children:["Risk Assessment Summary ",jsxRuntime.jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsxRuntime.jsx("textarea",{id:"cb-riskAssessment",value:n.riskAssessment,onChange:r=>o("riskAssessment",r.target.value),placeholder:"Summarize the risk assessment for this transfer",rows:2,"aria-required":"true","aria-describedby":"cb-form-errors",className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.input,d)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"ndpr-form-field__label",children:"Transfer Frequency"}),jsxRuntime.jsx("select",{value:n.frequency,onChange:r=>o("frequency",r.target.value),className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.select,d),children:J.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"ndpr-form-field__label",children:"Status"}),jsxRuntime.jsx("select",{value:n.status,onChange:r=>o("status",r.target.value),className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.select,d),children:X.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))})]})]}),e&&jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium ndpr-text-info mb-3",children:"NDPC Approval Required"}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-info mb-3",children:"The selected transfer mechanism requires approval from the Nigeria Data Protection Commission."}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"ndpcApprovalApplied",checked:n.ndpcApprovalApplied,onChange:r=>o("ndpcApprovalApplied",r.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"ndpcApprovalApplied",className:"ndpr-text-sm",children:"Application submitted"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"ndpcApprovalApproved",checked:n.ndpcApprovalApproved,onChange:r=>o("ndpcApprovalApproved",r.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"ndpcApprovalApproved",className:"ndpr-text-sm",children:"Approval granted"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{className:"ndpr-form-field__label",children:"NDPC Reference Number"}),jsxRuntime.jsx("input",{type:"text",value:n.ndpcApprovalReference,onChange:r=>o("ndpcApprovalReference",r.target.value),placeholder:"Reference number (if available)",className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.input,d)})]})]})]}),ie&&jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-gray-100 dark:bg-gray-600 rounded-md",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium mb-3",children:"Transfer Impact Assessment"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"tiaCompleted",checked:n.tiaCompleted,onChange:r=>o("tiaCompleted",r.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"tiaCompleted",className:"ndpr-text-sm",children:"TIA completed"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"ndpr-form-field__label",children:"TIA Reference"}),jsxRuntime.jsx("input",{type:"text",value:n.tiaReference,onChange:r=>o("tiaReference",r.target.value),placeholder:"Document reference",className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.input,d)})]})]})]}),jsxRuntime.jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[jsxRuntime.jsx("button",{onClick:U,className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:oe,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${M}`,(a==null?void 0:a.primaryButton)||(a==null?void 0:a.submitButton),d),children:h?"Update Transfer":"Add Transfer"})]})]})},ve=e=>{var c,g;let r=chunkC4YM4UMI_js.h(e),l=chunkC4YM4UMI_js.g(e);return jsxRuntime.jsxs("div",{role:"status","aria-label":"Transfer details",className:chunkE64TU6IU_js.a("",a==null?void 0:a.detailPanel,d),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsxs("h3",{className:"ndpr-section-heading",children:[e.destinationCountry," \u2014 ",e.recipientOrganization]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[Y(e.status),H(e.riskLevel)]})]}),!l.isValid&&jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Compliance Issues"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-destructive",children:l.errors.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]}),l.warnings.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-warning mb-1",children:"Warnings"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-warning",children:l.warnings.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Destination:"})," ",e.destinationCountry,e.destinationCountryCode?` (${e.destinationCountryCode})`:""]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Adequacy:"})," ",(c=G.find(s=>s.value===e.adequacyStatus))==null?void 0:c.label]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Frequency:"})," ",(g=J.find(s=>s.value===e.frequency))==null?void 0:g.label]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Start Date:"})," ",A(e.startDate)]}),e.endDate&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"End Date:"})," ",A(e.endDate)]}),e.reviewDate&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next Review:"})," ",A(e.reviewDate)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Recipient:"})," ",e.recipientOrganization]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Contact:"})," ",e.recipientContact.name," (",e.recipientContact.email,")"]}),e.estimatedDataSubjects&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subjects:"})," ",e.estimatedDataSubjects.toLocaleString()]}),jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",e.includesSensitiveData?"Yes":"No"]})]})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Transfer Mechanism"}),jsxRuntime.jsx("div",{className:"ndpr-panel",children:jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:chunkC4YM4UMI_js.f(e.transferMechanism)})})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Purpose"}),jsxRuntime.jsx("p",{className:"text-sm ndpr-text-muted bg-gray-50 dark:bg-gray-700 p-2 rounded-md",children:e.purpose})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Data Categories"}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:e.dataCategories.map((s,m)=>jsxRuntime.jsx("span",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-600 rounded text-xs",children:s},m))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Safeguards"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm ndpr-text-muted",children:e.safeguards.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Risk Assessment"}),jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200 mb-2",children:e.riskAssessment}),jsxRuntime.jsxs("div",{className:"mt-2",role:"status","aria-label":"Automated risk assessment result",children:[jsxRuntime.jsxs("p",{className:"text-xs font-medium ndpr-text-muted mb-1",children:["Automated Assessment (Score: ",r.riskScore,")"]}),r.factors.length>0&&jsxRuntime.jsx("ul",{className:"list-disc list-inside text-xs ndpr-text-muted",children:r.factors.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))}),r.recommendations.length>0&&jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium ndpr-text-muted mb-1",children:"Recommendations:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-xs ndpr-text-muted",children:r.recommendations.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]})]})]})]}),e.ndpcApproval&&jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"NDPC Approval"}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md ${e.ndpcApproval.approved?"ndpr-alert ndpr-alert--success":e.ndpcApproval.applied?"ndpr-alert ndpr-alert--warning":"ndpr-alert ndpr-alert--destructive"}`,a==null?void 0:a.approvalStatus,d),children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",e.ndpcApproval.approved?"Approved":e.ndpcApproval.applied?"Application Submitted":"Not Applied"]}),e.ndpcApproval.referenceNumber&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference:"})," ",e.ndpcApproval.referenceNumber]}),e.ndpcApproval.appliedAt&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Applied:"})," ",A(e.ndpcApproval.appliedAt)]}),e.ndpcApproval.approvedAt&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Approved:"})," ",A(e.ndpcApproval.approvedAt)]})]})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-field",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Transfer Impact Assessment"}),jsxRuntime.jsxs("div",{className:`p-3 rounded-md ${e.tiaCompleted?"ndpr-alert ndpr-alert--success":"ndpr-alert ndpr-alert--warning"}`,children:[jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",e.tiaCompleted?"Completed":"Not Completed"]}),e.tiaReference&&jsxRuntime.jsxs("p",{className:"ndpr-text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference:"})," ",e.tiaReference]})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-3 mt-6",children:[jsxRuntime.jsx("button",{onClick:()=>le(e),"aria-label":`Edit transfer to ${e.destinationCountry}`,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${M}`,children:"Edit"}),jsxRuntime.jsx("button",{onClick:()=>se(e.id),"aria-label":`Remove transfer to ${e.destinationCountry}`,className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",children:"Remove"})]})]})};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ae}`,a==null?void 0:a.root,d),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("ndpr-section-heading",a==null?void 0:a.title,d),children:ee}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:te}),re&&ue(),!j&&jsxRuntime.jsx("div",{className:"mb-6",children:jsxRuntime.jsx("button",{onClick:pe,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${M}`,(a==null?void 0:a.primaryButton)||(a==null?void 0:a.submitButton),d),children:"Add Transfer"})}),j&&me(),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cbStatusFilter",className:"ndpr-form-field__label",children:"Status Filter"}),jsxRuntime.jsxs("select",{id:"cbStatusFilter",value:k,onChange:e=>ne(e.target.value),"aria-label":"Filter transfers by status",className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.select,d),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),X.map(e=>jsxRuntime.jsx("option",{value:e.value,children:e.label},e.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cbMechanismFilter",className:"ndpr-form-field__label",children:"Mechanism Filter"}),jsxRuntime.jsxs("select",{id:"cbMechanismFilter",value:T,onChange:e=>de(e.target.value),"aria-label":"Filter transfers by mechanism",className:chunkE64TU6IU_js.a("ndpr-form-field__input",a==null?void 0:a.select,d),children:[jsxRuntime.jsx("option",{value:"all",children:"All Mechanisms"}),I.map(e=>jsxRuntime.jsx("option",{value:e.value,children:e.label},e.value))]})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxRuntime.jsxs("div",{className:"md:col-span-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Transfers"}),x.length===0?jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:"No cross-border transfers found."}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",a==null?void 0:a.transferList,d),children:x.map(e=>{var r,l;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md cursor-pointer ${f===e.id?"ndpr-alert ndpr-alert--info":"ndpr-panel"}`,a==null?void 0:a.transferItem,d),role:"button",tabIndex:0,"aria-label":`View transfer to ${e.destinationCountry}`,onClick:()=>y(e.id),onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),y(e.id));},children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:e.destinationCountry}),H(e.riskLevel)]}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mb-1",children:e.recipientOrganization}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted mb-1",children:ce(e.transferMechanism)}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[Y(e.status),((r=e.ndpcApproval)==null?void 0:r.required)&&!((l=e.ndpcApproval)!=null&&l.approved)&&jsxRuntime.jsx("span",{className:"text-xs ndpr-text-info",children:"NDPC Pending"})]})]},e.id)})})]}),jsxRuntime.jsx("div",{className:"md:col-span-2",children:$?ve($):jsxRuntime.jsx("div",{className:"ndpr-empty-state",children:jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:"Select a transfer to view details"})})})]})]})};exports.a=xe;//# sourceMappingURL=chunk-NQNFS3QI.js.map
|
|
7
|
+
//# sourceMappingURL=chunk-NQNFS3QI.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkP42Z5CFE_js=require('./chunk-P42Z5CFE.js'),chunkELKB2AFZ_js=require('./chunk-ELKB2AFZ.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function J(a,h){return h?chunkELKB2AFZ_js.a(a):{load:()=>null,save:()=>{},remove:()=>{}}}function Z({sections:a,initialAnswers:h={},adapter:P,storageKey:V="ndpr_dpia_data",useLocalStorage:T=true,onComplete:w}){let y=P!=null?P:J(V,T),g=react.useRef(y);g.current=y;let[f,m]=react.useState(0),[o,v]=react.useState(h),[_,I]=react.useState(true);react.useEffect(()=>{let r=false;try{let t=g.current.load();t instanceof Promise?t.then(e=>{r||(e&&v(e),I(!1));},()=>{r||I(!1);}):(t&&v(t),I(!1));}catch(t){r||I(false);}return ()=>{r=true;}},[]);let u=a[f]||null,S=react.useCallback(r=>{Promise.resolve(g.current.save(r)).catch(t=>{console.warn("[ndpr-toolkit] Failed to save DPIA answers:",t);});},[]),$=react.useCallback((r,t)=>{v(e=>{let s=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{[r]:t});return S(s),s});},[S]),A=react.useCallback(r=>r.showWhen?r.showWhen.every(t=>{let e=o[t.questionId];switch(t.operator){case "equals":return e===t.value;case "contains":return Array.isArray(e)?e.includes(String(t.value)):false;case "greaterThan":return typeof e=="number"&&typeof t.value=="number"?e>t.value:false;case "lessThan":return typeof e=="number"&&typeof t.value=="number"?e<t.value:false;default:return true}}):true,[o]),p=react.useCallback(()=>u?u.questions.filter(A):[],[u,A]),D=react.useCallback(()=>u?p().every(t=>{if(!t.required)return true;let e=o[t.id];return !(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0)}):false,[o,u,p]),O=react.useCallback(()=>{let r={};return u&&p().forEach(e=>{if(!e.required)return;let s=o[e.id];s==null||typeof s=="string"&&s.trim()===""?r[e.id]="This question is required":Array.isArray(s)&&s.length===0&&(r[e.id]="At least one option must be selected");}),r},[o,u,p]),U=react.useCallback(()=>D()&&f<a.length-1?(m(r=>r+1),true):false,[f,a.length,D]),B=react.useCallback(()=>f>0?(m(r=>r-1),true):false,[f]),F=react.useCallback(r=>r>=0&&r<a.length?(m(r),true):false,[a.length]),W=react.useCallback(()=>a.every(r=>r.questions.filter(A).every(e=>{if(!e.required)return true;let s=o[e.id];return !(s==null||typeof s=="string"&&s.trim()===""||Array.isArray(s)&&s.length===0)})),[o,a,A]),k=react.useCallback(()=>{let r=[];return a.forEach(t=>{t.questions.forEach(e=>{let s=o[e.id];if(s!=null&&e.riskLevel)if(["select","radio","checkbox"].includes(e.type)&&e.options)(Array.isArray(s)?s:[s]).forEach(l=>{var R;let c=(R=e.options)==null?void 0:R.find(d=>d.value===l);if(c!=null&&c.riskLevel){let d=c.riskLevel,Q=d==="low"?1:d==="medium"?3:5,L=d==="low"?1:d==="medium"?3:5;r.push({id:`risk_${r.length+1}`,description:`${e.text} - ${c.label}`,likelihood:Q,impact:L,score:Q*L,level:d,mitigated:false,relatedQuestionIds:[e.id]});}});else {let n=e.riskLevel,l=n==="low"?1:n==="medium"?3:5,c=n==="low"?1:n==="medium"?3:5;r.push({id:`risk_${r.length+1}`,description:e.text,likelihood:l,impact:c,score:l*c,level:n,mitigated:false,relatedQuestionIds:[e.id]});}});}),r},[o,a]),K=react.useCallback((r,t,e)=>{let s=k(),n={id:`dpia_${Date.now()}`,title:t,processingDescription:e,startedAt:Date.now(),completedAt:Date.now(),assessor:r,answers:o,risks:s,overallRiskLevel:"low",canProceed:true,conclusion:"",version:"1.0"},l=chunkP42Z5CFE_js.a(n);return n.overallRiskLevel=l.overallRiskLevel,n.canProceed=l.canProceed,n.conclusion=l.canProceed?"Based on the assessment, the processing can proceed with appropriate safeguards.":"Based on the assessment, the processing should not proceed without further mitigation measures.",n.recommendations=l.recommendations,w&&w(n),n},[o,k,w]),j=react.useCallback(()=>{v({}),m(0),Promise.resolve(g.current.remove()).catch(r=>{console.warn("[ndpr-toolkit] Failed to remove DPIA data:",r);});},[]),z=(()=>{let r=0,t=0;return a.forEach(e=>{e.questions.forEach(s=>{if(s.required&&A(s)){t++;let n=o[s.id];n!=null&&!(typeof n=="string"&&n.trim()==="")&&!(Array.isArray(n)&&n.length===0)&&r++;}});}),t>0?Math.round(r/t*100):0})();return {currentSectionIndex:f,currentSection:u,answers:o,updateAnswer:$,nextSection:U,prevSection:B,goToSection:F,isCurrentSectionValid:D,getCurrentSectionErrors:O,isComplete:W,completeDPIA:K,getVisibleQuestions:p,resetDPIA:j,progress:z,isLoading:_}}exports.a=Z;//# sourceMappingURL=chunk-OPYQIJKY.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-OPYQIJKY.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';var chunkAHSMDPG5_js=require('./chunk-AHSMDPG5.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js');function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function q(e){let n=new Set,o=new RegExp(`${s(chunkAHSMDPG5_js.a)}([^${s("\xBB")}]+)${s("\xBB")}`,"g"),i;for(;(i=o.exec(e))!==null;)n.add(i[1].trim());let r=/\{\{\s*([^}\s]+)\s*\}\}/g;for(;(i=r.exec(e))!==null;)n.add(i[1].trim());return Array.from(n)}function P(e,n){if(typeof e=="string"){let o=e,i=n,r=o,c=/\{\{([^}]+)\}\}/g,d;for(;(d=c.exec(o))!==null;){let t=d[1].trim(),a=i[t]||"";r=r.replace(new RegExp(`\\{\\{\\s*${s(t)}\\s*\\}\\}`,"g"),a);}return r}else {let o=e,i=n,r={},c=[];return o.filter(t=>t.included).sort((t,a)=>(t.order||0)-(a.order||0)).forEach(t=>{let a=t.template||t.customContent||t.defaultContent||"",y=/\{\{([^}]+)\}\}/g,m,h=[];for(;(m=y.exec(a))!==null;)h.push(m[1].trim());h.forEach(l=>{let u="";l in i&&(u=i[l]||""),u||c.push(l),a=a.replace(new RegExp(`\\{\\{\\s*${s(l)}\\s*\\}\\}`,"g"),u);}),r[t.id]=a;}),{fullText:Object.values(r).join(`
|
|
2
2
|
|
|
3
|
-
`),sectionTexts:r,missingVariables:Array.from(new Set(
|
|
3
|
+
`),sectionTexts:r,missingVariables:Array.from(new Set(c))}}}var w=[{id:"data-collection",title:"Data Collection",description:"Describes what personal data is collected and how it is obtained.",order:1,required:true,included:true,template:'{{orgName}} ("we", "us", or "our") collects personal data from users of our services at {{website}}. We collect information you provide directly, such as your name, email address, phone number, and any other details you submit through forms or communications. We may also collect data automatically, including IP addresses, browser type, device information, and usage patterns through cookies and similar technologies. All data collection is conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023.',variables:["orgName","website"]},{id:"legal-basis",title:"Legal Basis for Processing",description:"Specifies the lawful basis for processing personal data under the NDPA.",order:2,required:true,included:true,template:`{{orgName}} processes personal data under one or more of the following lawful bases as prescribed by the NDPA 2023:
|
|
4
4
|
|
|
5
5
|
- Consent: where you have given clear, informed, and voluntary consent for a specific purpose.
|
|
6
6
|
- Contract: where processing is necessary to fulfil a contract with you or to take steps at your request before entering a contract.
|
|
@@ -59,5 +59,5 @@ DPO Email: {{dpoEmail}}
|
|
|
59
59
|
|
|
60
60
|
You also have the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC) if you believe your data protection rights have been violated.
|
|
61
61
|
|
|
62
|
-
This policy is effective as of {{effectiveDate}} and applies to all {{industry}} services provided by {{orgName}}.`,variables:["orgName","address","privacyEmail","website","dpoName","dpoEmail","effectiveDate","industry"]}],
|
|
63
|
-
//# sourceMappingURL=chunk-
|
|
62
|
+
This policy is effective as of {{effectiveDate}} and applies to all {{industry}} services provided by {{orgName}}.`,variables:["orgName","address","privacyEmail","website","dpoName","dpoEmail","effectiveDate","industry"]}],v=[{id:"orgName",name:"orgName",description:"The official name of your organisation.",value:"",inputType:"text",required:true},{id:"website",name:"website",description:"Your organisation's website URL.",value:"",inputType:"url",required:true},{id:"privacyEmail",name:"privacyEmail",description:"Email address for privacy-related enquiries.",value:"",inputType:"email",required:true},{id:"dpoName",name:"dpoName",description:"Full name of your Data Protection Officer.",value:"",inputType:"text",required:false},{id:"dpoEmail",name:"dpoEmail",description:"Email address of your Data Protection Officer.",value:"",inputType:"email",required:false},{id:"address",name:"address",description:"Physical address of your organisation.",value:"",inputType:"textarea",required:false},{id:"industry",name:"industry",description:"The industry or sector your organisation operates in.",value:"",inputType:"text",required:false},{id:"effectiveDate",name:"effectiveDate",description:"The date this privacy policy becomes effective.",value:"",inputType:"date",required:false}];function N(){return {sections:w.map(e=>chunkMQFZHA2D_js.a({},e)),variables:v.map(e=>chunkMQFZHA2D_js.a({},e))}}exports.a=q;exports.b=P;exports.c=w;exports.d=v;exports.e=N;//# sourceMappingURL=chunk-P2YV6DR3.js.map
|
|
63
|
+
//# sourceMappingURL=chunk-P2YV6DR3.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkGOU6FU6Y_js=require('./chunk-GOU6FU6Y.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var T=[{value:"consent",label:"Consent (Section 25(1)(a))"},{value:"contract",label:"Contract (Section 25(1)(b))"},{value:"legal_obligation",label:"Legal Obligation (Section 25(1)(c))"},{value:"vital_interests",label:"Vital Interests (Section 25(1)(d))"},{value:"public_interest",label:"Public Interest (Section 25(1)(e))"},{value:"legitimate_interests",label:"Legitimate Interests (Section 25(1)(f))"}],ee=[{value:"active",label:"Active"},{value:"inactive",label:"Inactive"},{value:"archived",label:"Archived"}],Ee=[{value:"data_subject",label:"Directly from Data Subject"},{value:"third_party",label:"Third Party"},{value:"public_source",label:"Public Source"},{value:"other",label:"Other"}];function Oe(){let l=Date.now();return {id:`proc_${l}_${Math.random().toString(36).substring(2,11)}`,name:"",description:"",controllerDetails:{name:"",contact:"",address:""},lawfulBasis:"consent",lawfulBasisJustification:"",purposes:[],dataCategories:[],dataSubjectCategories:[],recipients:[],retentionPeriod:"",securityMeasures:[],dataSource:"data_subject",dpiaRequired:false,automatedDecisionMaking:false,status:"active",createdAt:l,updatedAt:l}}function te(l){return l?new Date(l).toLocaleDateString():"N/A"}var $e=({ropa:l,onAddRecord:R,onUpdateRecord:D,onArchiveRecord:w,title:re="Record of Processing Activities (ROPA)",description:ie="Maintain a comprehensive record of all data processing activities as required by the NDPA accountability principle.",className:ae="",buttonClassName:B="",classNames:e,unstyled:n})=>{let[f,b]=react.useState("list"),[S,ne]=react.useState(""),[P,de]=react.useState("all"),[k,le]=react.useState("all"),[o,h]=react.useState(null),[U,C]=react.useState([]),[F,$]=react.useState(""),[I,H]=react.useState(""),[M,V]=react.useState(""),[L,J]=react.useState(""),[E,z]=react.useState(""),[O,G]=react.useState(""),[j,W]=react.useState(""),g=react.useMemo(()=>chunkGOU6FU6Y_js.b(l),[l]),_=react.useMemo(()=>chunkGOU6FU6Y_js.d(l),[l]),K=react.useMemo(()=>{let r=[...l.records];if(P!=="all"&&(r=r.filter(a=>a.status===P)),k!=="all"&&(r=r.filter(a=>a.lawfulBasis===k)),S){let a=S.toLowerCase();r=r.filter(p=>p.name.toLowerCase().includes(a)||p.description.toLowerCase().includes(a)||p.dataCategories.some(m=>m.toLowerCase().includes(a))||p.department&&p.department.toLowerCase().includes(a));}return r},[l.records,P,k,S]);react.useEffect(()=>{o&&($(o.purposes.join(", ")),H(o.dataCategories.join(", ")),V((o.sensitiveDataCategories||[]).join(", ")),J(o.dataSubjectCategories.join(", ")),z(o.recipients.join(", ")),G(o.securityMeasures.join(", ")),W((o.systemsUsed||[]).join(", ")));},[o==null?void 0:o.id]);let oe=react.useCallback(()=>{let r=Oe();r.controllerDetails.name=l.organizationName,r.controllerDetails.contact=l.organizationContact,r.controllerDetails.address=l.organizationAddress,l.ndpcRegistrationNumber&&(r.controllerDetails.registrationNumber=l.ndpcRegistrationNumber),l.dpoDetails&&(r.controllerDetails.dpoContact=l.dpoDetails.email),h(r),C([]),b("form");},[l.organizationName,l.organizationContact,l.organizationAddress,l.ndpcRegistrationNumber,l.dpoDetails]),pe=react.useCallback(r=>{h(chunkMQFZHA2D_js.a({},r)),C([]),b("form");},[]),v=r=>r.split(",").map(a=>a.trim()).filter(a=>a.length>0),ue=react.useCallback(()=>{if(!o)return;let r=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},o),{purposes:v(F),dataCategories:v(I),sensitiveDataCategories:v(M),dataSubjectCategories:v(L),recipients:v(E),securityMeasures:v(O),systemsUsed:v(j),updatedAt:Date.now()});r.sensitiveDataCategories&&r.sensitiveDataCategories.length===0&&(r.sensitiveDataCategories=void 0),r.systemsUsed&&r.systemsUsed.length===0&&(r.systemsUsed=void 0);let a=chunkGOU6FU6Y_js.a(r);if(!a.valid){C(a.errors);return}l.records.find(m=>m.id===r.id)?D==null||D(r.id,r):R==null||R(r),h(null),C([]),b("list");},[o,F,I,M,L,E,O,j,l.records,D,R]),ce=react.useCallback(r=>{w==null||w(r);},[w]),se=react.useCallback(()=>{let r=chunkGOU6FU6Y_js.c(l),a=new Blob([r],{type:"text/csv;charset=utf-8;"}),p=URL.createObjectURL(a),m=document.createElement("a");m.href=p,m.download=`ropa_${l.organizationName.replace(/\s+/g,"_").toLowerCase()}_${new Date().toISOString().slice(0,10)}.csv`,m.click(),setTimeout(()=>URL.revokeObjectURL(p),100);},[l]),Q=react.useCallback(()=>{h(null),C([]),b("list");},[]),c=react.useCallback((r,a)=>{h(p=>p&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},p),{[r]:a}));},[]),q=react.useCallback((r,a)=>{h(p=>p&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},p),{controllerDetails:chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},p.controllerDetails),{[r]:a})}));},[]),ge=react.useCallback(r=>!!r.nextReviewDate&&r.nextReviewDate<=Date.now(),[]),me=react.useCallback(r=>{ne(r.target.value);},[]),ve=react.useCallback(r=>{de(r.target.value);},[]),fe=react.useCallback(r=>{le(r.target.value);},[]),be=react.useCallback(r=>{$(r.target.value);},[]),he=react.useCallback(r=>{H(r.target.value);},[]),_e=react.useCallback(r=>{V(r.target.value);},[]),xe=react.useCallback(r=>{J(r.target.value);},[]),Ce=react.useCallback(r=>{z(r.target.value);},[]),ye=react.useCallback(r=>{G(r.target.value);},[]),Re=react.useCallback(r=>{W(r.target.value);},[]),De=react.useCallback(()=>b("list"),[]),we=react.useCallback(()=>b("summary"),[]),Se=react.useCallback(r=>{let a={active:"ndpr-badge ndpr-badge--success",inactive:"ndpr-badge ndpr-badge--warning",archived:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"},p={active:"Active",inactive:"Inactive",archived:"Archived"};return jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${a[r]}`,e==null?void 0:e.statusBadge,n),children:p[r]})},[e==null?void 0:e.statusBadge,n]),Pe=react.useCallback(r=>jsxRuntime.jsx("span",{className:"ndpr-badge ndpr-badge--info",children:{consent:"Consent",contract:"Contract",legal_obligation:"Legal Obligation",vital_interests:"Vital Interests",public_interest:"Public Interest",legitimate_interests:"Legitimate Interests"}[r]}),[]),ke=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",e==null?void 0:e.orgInfo,n),children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"Organization"}),jsxRuntime.jsx("p",{className:"ndpr-section-heading",children:l.organizationName})]}),l.dpoDetails&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"Data Protection Officer"}),jsxRuntime.jsx("p",{className:"ndpr-section-heading",children:l.dpoDetails.name}),jsxRuntime.jsx("p",{className:"ndpr-form-field__hint",children:l.dpoDetails.email})]}),l.ndpcRegistrationNumber&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-muted",children:"NDPC Registration No."}),jsxRuntime.jsx("p",{className:"ndpr-section-heading",children:l.ndpcRegistrationNumber})]})]}),jsxRuntime.jsxs("div",{className:"mt-2 text-xs ndpr-text-muted",children:["Version ",l.version," | Last Updated: ",te(l.lastUpdated)]})]}),Ae=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",e==null?void 0:e.summary,n),children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:g.totalRecords}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-info",children:"Total Records"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 bg-green-50 dark:bg-green-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-success",children:g.activeRecords}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-success",children:"Active"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 bg-purple-50 dark:bg-purple-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-info",children:g.crossBorderRecords}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-info",children:"Cross-Border"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-4 bg-orange-50 dark:bg-orange-900/20 rounded-md text-center",e==null?void 0:e.summaryCard,n),children:[jsxRuntime.jsx("p",{className:"ndpr-stat__value ndpr-text-warning",children:_.length}),jsxRuntime.jsx("p",{className:"text-xs ndpr-text-warning",children:"Records with Gaps"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"By Lawful Basis"}),T.map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:r.label.split(" (")[0]}),jsxRuntime.jsx("span",{className:"font-medium",children:g.byLawfulBasis[r.value]||0})]},r.value))]}),jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Risk Indicators"}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"Sensitive Data"}),jsxRuntime.jsx("span",{className:"font-medium",children:g.sensitiveDataRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"DPIA Required"}),jsxRuntime.jsx("span",{className:"font-medium",children:g.dpiaRequiredRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"Automated Decisions"}),jsxRuntime.jsx("span",{className:"font-medium",children:g.automatedDecisionRecords})]}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:"Due for Review"}),jsxRuntime.jsx("span",{className:`font-medium ${g.recordsDueForReview.length>0?"ndpr-text-destructive":""}`,children:g.recordsDueForReview.length})]})]}),g.topDepartments.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-panel",children:[jsxRuntime.jsx("p",{className:"ndpr-form-field__label",children:"Top Departments"}),g.topDepartments.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[jsxRuntime.jsx("span",{className:"ndpr-card__subtitle",children:r.department}),jsxRuntime.jsx("span",{className:"font-medium",children:r.count})]},r.department))]})]}),_.length>0&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md",e==null?void 0:e.complianceGap,n),role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-2",children:"Compliance Gaps Detected"}),_.slice(0,5).map(r=>jsxRuntime.jsxs("div",{className:"mb-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium ndpr-text-destructive",children:r.recordName}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:r.gaps.map((a,p)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-destructive",children:a},p))})]},r.recordId)),_.length>5&&jsxRuntime.jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["...and ",_.length-5," more record(s) with gaps."]})]})]}),Be=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-4 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaSearch",className:"ndpr-form-field__label",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"ropaSearch",value:S,onChange:me,placeholder:"Search records...",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaStatusFilter",className:"ndpr-form-field__label",children:"Status"}),jsxRuntime.jsxs("select",{id:"ropaStatusFilter",value:P,onChange:ve,className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),ee.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label},r.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"ropaBasisFilter",className:"ndpr-form-field__label",children:"Lawful Basis"}),jsxRuntime.jsxs("select",{id:"ropaBasisFilter",value:k,onChange:fe,className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:[jsxRuntime.jsx("option",{value:"all",children:"All Bases"}),T.map(r=>jsxRuntime.jsx("option",{value:r.value,children:r.label.split(" (")[0]},r.value))]})]}),jsxRuntime.jsxs("div",{className:"flex items-end space-x-2",children:[jsxRuntime.jsx("button",{onClick:oe,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${B}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),n),children:"Add Record"}),jsxRuntime.jsx("button",{onClick:se,"aria-label":"Export ROPA records as CSV",className:chunkE64TU6IU_js.a(`px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 text-sm ${B}`,(e==null?void 0:e.secondaryButton)||(e==null?void 0:e.exportButton),n),children:"Export CSV"})]})]}),K.length===0?jsxRuntime.jsx("p",{className:"ndpr-empty-state",children:"No processing records found."}):jsxRuntime.jsx("div",{className:"overflow-x-auto",children:jsxRuntime.jsxs("table",{className:chunkE64TU6IU_js.a("w-full text-sm text-left",e==null?void 0:e.table,n),children:[jsxRuntime.jsx("thead",{className:chunkE64TU6IU_js.a("ndpr-table__head",e==null?void 0:e.tableHeader,n),children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Name"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Lawful Basis"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Data Categories"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Status"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Last Reviewed"}),jsxRuntime.jsx("th",{className:"ndpr-table__cell",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{children:K.map(r=>{let a=ge(r),p=_.some(m=>m.recordId===r.id);return jsxRuntime.jsxs("tr",{className:chunkE64TU6IU_js.a(`border-b dark:border-gray-600 ${a?"bg-red-50 dark:bg-red-900/10":p?"bg-yellow-50 dark:bg-yellow-900/10":"bg-white dark:bg-gray-800"} hover:bg-gray-50 dark:hover:bg-gray-700`,e==null?void 0:e.tableRow,n),children:[jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"font-medium",children:r.name}),r.department&&jsxRuntime.jsx("p",{className:"ndpr-form-field__hint",children:r.department}),a&&jsxRuntime.jsx("span",{className:"text-xs ndpr-text-destructive font-medium",children:"Review Overdue"})]})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:Pe(r.lawfulBasis)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsx("p",{className:"text-xs ndpr-text-muted max-w-xs truncate",children:r.dataCategories.join(", ")})}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:Se(r.status)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell ndpr-table__cell--muted",children:te(r.lastReviewedAt)}),jsxRuntime.jsx("td",{className:"ndpr-table__cell",children:jsxRuntime.jsxs("div",{className:"ndpr-card__footer",children:[jsxRuntime.jsx("button",{onClick:()=>pe(r),"aria-label":`Edit record: ${r.name}`,className:"ndpr-text-primary hover:underline text-xs",children:"Edit"}),r.status!=="archived"&&jsxRuntime.jsx("button",{onClick:()=>ce(r.id),"aria-label":`Archive record: ${r.name}`,className:"ndpr-text-muted hover:underline text-xs",children:"Archive"})]})})]},r.id)})})]})})]}),Fe=react.useMemo(()=>o?!l.records.find(r=>r.id===o.id):true,[o,l.records]),Ie=()=>{if(!o)return null;let r=Fe;return jsxRuntime.jsxs("div",{"data-ndpr-component":"ropa-manager",className:chunkE64TU6IU_js.a("",e==null?void 0:e.form,n),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex justify-between items-center mb-4",e==null?void 0:e.header,n),children:[jsxRuntime.jsx("h3",{className:"ndpr-section-heading",children:r?"Add Processing Record":"Edit Processing Record"}),jsxRuntime.jsx("button",{onClick:Q,className:"ndpr-button ndpr-button--ghost ndpr-button--sm",children:"Cancel"})]}),U.length>0&&jsxRuntime.jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",role:"status","aria-live":"polite",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium ndpr-text-destructive mb-1",children:"Please fix the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside",children:U.map((a,p)=>jsxRuntime.jsx("li",{className:"text-xs ndpr-text-destructive",children:a},p))})]}),jsxRuntime.jsxs("div",{className:"ndpr-form-section",children:[jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Basic Information"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordName",className:"ndpr-form-field__label",children:"Activity Name *"}),jsxRuntime.jsx("input",{type:"text",id:"recordName",value:o.name,onChange:a=>c("name",a.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Customer Account Management"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordDepartment",className:"ndpr-form-field__label",children:"Department"}),jsxRuntime.jsx("input",{type:"text",id:"recordDepartment",value:o.department||"",onChange:a=>c("department",a.target.value||void 0),className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Marketing"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"recordDescription",className:"ndpr-form-field__label",children:"Description *"}),jsxRuntime.jsx("textarea",{id:"recordDescription",value:o.description,onChange:a=>c("description",a.target.value),rows:3,"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe what personal data processing is performed..."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recordStatus",className:"ndpr-form-field__label",children:"Status *"}),jsxRuntime.jsx("select",{id:"recordStatus",value:o.status,onChange:a=>c("status",a.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:ee.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Controller Details"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"controllerName",className:"ndpr-form-field__label",children:"Controller Name *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerName",value:o.controllerDetails.name,onChange:a=>q("name",a.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"controllerContact",className:"ndpr-form-field__label",children:"Controller Contact *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerContact",value:o.controllerDetails.contact,onChange:a=>q("contact",a.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"controllerAddress",className:"ndpr-form-field__label",children:"Controller Address *"}),jsxRuntime.jsx("input",{type:"text",id:"controllerAddress",value:o.controllerDetails.address,onChange:a=>q("address",a.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Lawful Basis (NDPA Section 25)"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasis",className:"ndpr-form-field__label",children:"Lawful Basis *"}),jsxRuntime.jsx("select",{id:"lawfulBasis",value:o.lawfulBasis,onChange:a=>c("lawfulBasis",a.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:T.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"lawfulBasisJustification",className:"ndpr-form-field__label",children:"Justification *"}),jsxRuntime.jsx("textarea",{id:"lawfulBasisJustification",value:o.lawfulBasisJustification,onChange:a=>c("lawfulBasisJustification",a.target.value),rows:2,"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Explain why this lawful basis applies..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Data Details"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"purposes",className:"ndpr-form-field__label",children:"Purposes * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"purposes",value:F,onChange:be,"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Account management, Service delivery"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataCategories",className:"ndpr-form-field__label",children:"Data Categories * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"dataCategories",value:I,onChange:he,"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Name, Email, Phone number"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sensitiveData",className:"ndpr-form-field__label",children:"Sensitive Data Categories (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"sensitiveData",value:M,onChange:_e,className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Health data, Biometric data"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"subjectCategories",className:"ndpr-form-field__label",children:"Data Subject Categories * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"subjectCategories",value:L,onChange:xe,"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Customers, Employees"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"recipients",className:"ndpr-form-field__label",children:"Recipients * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"recipients",value:E,onChange:Ce,"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Payment processors, Cloud service providers"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dataSource",className:"ndpr-form-field__label",children:"Data Source *"}),jsxRuntime.jsx("select",{id:"dataSource",value:o.dataSource,onChange:a=>c("dataSource",a.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.select,n),children:Ee.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),o.dataSource==="third_party"&&jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"thirdPartyDetails",className:"ndpr-form-field__label",children:"Third-Party Source Details *"}),jsxRuntime.jsx("input",{type:"text",id:"thirdPartyDetails",value:o.thirdPartySourceDetails||"",onChange:a=>c("thirdPartySourceDetails",a.target.value||void 0),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe the third-party data source..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Retention and Security"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionPeriod",className:"ndpr-form-field__label",children:"Retention Period *"}),jsxRuntime.jsx("input",{type:"text",id:"retentionPeriod",value:o.retentionPeriod,onChange:a=>c("retentionPeriod",a.target.value),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., 5 years after account closure"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"retentionJustification",className:"ndpr-form-field__label",children:"Retention Justification"}),jsxRuntime.jsx("input",{type:"text",id:"retentionJustification",value:o.retentionJustification||"",onChange:a=>c("retentionJustification",a.target.value||void 0),className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Why this retention period is necessary..."})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{htmlFor:"securityMeasures",className:"ndpr-form-field__label",children:"Security Measures * (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"securityMeasures",value:O,onChange:ye,"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., Encryption at rest, Access controls, Audit logging"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"systemsUsed",className:"ndpr-form-field__label",children:"Systems Used (comma-separated)"}),jsxRuntime.jsx("input",{type:"text",id:"systemsUsed",value:j,onChange:Re,className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"e.g., CRM, ERP, Cloud Storage"})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Risk Indicators"}),jsxRuntime.jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"dpiaRequired",checked:o.dpiaRequired,onChange:a=>c("dpiaRequired",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"dpiaRequired",className:"ndpr-text-sm ndpr-font-medium",children:"DPIA Required"})]}),o.dpiaRequired&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"dpiaReference",className:"ndpr-form-field__label",children:"DPIA Reference *"}),jsxRuntime.jsx("input",{type:"text",id:"dpiaReference",value:o.dpiaReference||"",onChange:a=>c("dpiaReference",a.target.value||void 0),"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Reference to the completed DPIA"})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"automatedDecisionMaking",checked:o.automatedDecisionMaking,onChange:a=>c("automatedDecisionMaking",a.target.checked),className:"ndpr-form-field__checkbox"}),jsxRuntime.jsx("label",{htmlFor:"automatedDecisionMaking",className:"ndpr-text-sm ndpr-font-medium",children:"Automated Decision-Making"})]}),o.automatedDecisionMaking&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"automatedDecisionMakingDetails",className:"ndpr-form-field__label",children:"Automated Decision-Making Details *"}),jsxRuntime.jsx("textarea",{id:"automatedDecisionMakingDetails",value:o.automatedDecisionMakingDetails||"",onChange:a=>c("automatedDecisionMakingDetails",a.target.value||void 0),rows:2,"aria-required":"true",className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n),placeholder:"Describe the automated decision-making process..."})]})]})]}),jsxRuntime.jsxs("fieldset",{className:"ndpr-card ndpr-card--compact ndpr-card--flat",children:[jsxRuntime.jsx("legend",{className:"ndpr-badge",children:"Review Schedule"}),jsxRuntime.jsx("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"nextReviewDate",className:"ndpr-form-field__label",children:"Next Review Date"}),jsxRuntime.jsx("input",{type:"date",id:"nextReviewDate",value:o.nextReviewDate?new Date(o.nextReviewDate).toISOString().slice(0,10):"",onChange:a=>c("nextReviewDate",a.target.value?new Date(a.target.value).getTime():void 0),className:chunkE64TU6IU_js.a("ndpr-form-field__input",e==null?void 0:e.input,n)})]})})]}),jsxRuntime.jsxs("div",{className:"flex justify-end space-x-3",children:[jsxRuntime.jsx("button",{onClick:Q,className:"ndpr-button ndpr-button--secondary ndpr-button--sm",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:ue,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm ${B}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),n),children:r?"Add Record":"Save Changes"})]})]})]})},Me=()=>jsxRuntime.jsxs("div",{className:"ndpr-section-divider ndpr-text-sm",children:[jsxRuntime.jsx("button",{onClick:De,className:`pb-2 text-sm font-medium ${f==="list"?"border-b-2 border-[rgb(var(--ndpr-primary))] ndpr-text-primary":"ndpr-text-muted hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Processing Records"}),jsxRuntime.jsx("button",{onClick:we,className:`pb-2 text-sm font-medium ${f==="summary"?"border-b-2 border-[rgb(var(--ndpr-primary))] ndpr-text-primary":"ndpr-text-muted hover:text-gray-700 dark:hover:text-gray-300"}`,children:"Compliance Summary"})]});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${ae}`,e==null?void 0:e.root,n),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("ndpr-section-heading",e==null?void 0:e.title,n),children:re}),jsxRuntime.jsx("p",{className:"ndpr-card__subtitle",children:ie}),ke(),f!=="form"&&Me(),f==="list"&&Be(),f==="summary"&&Ae(),f==="form"&&Ie()]})};exports.a=$e;//# sourceMappingURL=chunk-P6QAFBCV.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-P6QAFBCV.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import {a}from'./chunk-KSERBMXW.mjs';import {a as a$1}from'./chunk-AYKLAEOU.mjs';import {d,b,a as a$2}from'./chunk-WWT2ZSNU.mjs';import Gr,{useId,useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var vr=["Organization","Data Collection","Processing","Review & Export"],lr=({currentStep:d,classNames:p,unstyled:r})=>jsx("nav",{"data-ndpr-component":"policy-step-indicator","aria-label":"Policy wizard progress",className:a$1("w-full flex items-center justify-between px-2 py-4",p==null?void 0:p.root,r),children:vr.map((e,n)=>{let t=n+1,i=t<d,u=t===d,l=n===vr.length-1;return jsxs(Gr.Fragment,{children:[jsxs("div",{className:a$1("flex flex-col items-center gap-1",p==null?void 0:p.stepWrapper,r),children:[jsx("div",{"aria-current":u?"step":void 0,"aria-label":`Step ${t}: ${e}${i?" (completed)":u?" (current)":""}`,className:a$1(["flex items-center justify-center rounded-full border-2 font-semibold transition-all",i?"w-8 h-8 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))]":u?"w-9 h-9 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] shadow-md":"w-8 h-8 bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-600 text-gray-400 dark:text-gray-500"].join(" "),i?p==null?void 0:p.stepCompleted:u?p==null?void 0:p.stepCurrent:p==null?void 0:p.stepUpcoming,r),children:i?jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsx("span",{className:"text-xs leading-none",children:t})}),jsx("span",{className:a$1(["text-xs font-medium hidden sm:block",i||u?"text-[rgb(var(--ndpr-primary))]":"ndpr-card__subtitle"].join(" "),p==null?void 0:p.stepLabel,r),children:e})]}),!l&&jsx("div",{className:a$1(["flex-1 h-0.5 mx-2",i?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-700"].join(" "),p==null?void 0:p.connector,r),"aria-hidden":"true"})]},t)})});var $="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",Vr="block text-sm font-medium ndpr-text-muted mb-1",A=({id:d,label:p,required:r,description:e,children:n,classNames:t,unstyled:i})=>{let u=e?`${d}-desc`:void 0;return jsxs("div",{className:a$1("flex flex-col",t==null?void 0:t.field,i),children:[jsxs("label",{htmlFor:d,className:a$1(Vr,t==null?void 0:t.label,i),children:[p,r&&jsx("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),e&&jsx("p",{id:u,className:"text-xs ndpr-text-muted mb-1",children:e}),n]})},fr=({context:d,onUpdateOrg:p,classNames:r,unstyled:e})=>{var i,u,b;let n=useId(),t=d.org;return jsxs("div",{"data-ndpr-component":"policy-step-about",className:a$1("ndpr-form-section",r==null?void 0:r.root,e),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Organisation Details"}),jsxs("p",{className:a$1("ndpr-form-field__hint",r==null?void 0:r.subheading,e),children:["Tell us about your organisation. Fields marked ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})," are required."]})]}),jsxs("div",{className:a$1("grid grid-cols-1 md:grid-cols-2 gap-4",r==null?void 0:r.grid,e),children:[jsx(A,{id:`${n}-org-name`,label:"Organisation Name",required:true,classNames:r,unstyled:e,children:jsx("input",{id:`${n}-org-name`,type:"text",value:t.name,onChange:l=>p({name:l.target.value}),placeholder:"Acme Corporation",className:a$1($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsx(A,{id:`${n}-website`,label:"Website",required:true,classNames:r,unstyled:e,children:jsx("input",{id:`${n}-website`,type:"url",value:t.website,onChange:l=>p({website:l.target.value}),placeholder:"https://example.com",className:a$1($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsx(A,{id:`${n}-privacy-email`,label:"Privacy Contact Email",required:true,classNames:r,unstyled:e,children:jsx("input",{id:`${n}-privacy-email`,type:"email",value:t.privacyEmail,onChange:l=>p({privacyEmail:l.target.value}),placeholder:"privacy@example.com",className:a$1($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsx(A,{id:`${n}-industry`,label:"Industry",classNames:r,unstyled:e,children:jsxs("select",{id:`${n}-industry`,value:t.industry,onChange:l=>p({industry:l.target.value}),className:a$1($,r==null?void 0:r.select,e),children:[jsx("option",{value:"fintech",children:"Fintech"}),jsx("option",{value:"healthcare",children:"Healthcare"}),jsx("option",{value:"ecommerce",children:"E-commerce"}),jsx("option",{value:"saas",children:"SaaS"}),jsx("option",{value:"education",children:"Education"}),jsx("option",{value:"government",children:"Government"}),jsx("option",{value:"other",children:"Other"})]})}),jsx(A,{id:`${n}-dpo-name`,label:"Data Protection Officer (DPO) Name",classNames:r,unstyled:e,children:jsx("input",{id:`${n}-dpo-name`,type:"text",value:(i=t.dpoName)!=null?i:"",onChange:l=>p({dpoName:l.target.value}),placeholder:"Jane Smith",className:a$1($,r==null?void 0:r.input,e)})}),jsx(A,{id:`${n}-dpo-email`,label:"DPO Email",classNames:r,unstyled:e,children:jsx("input",{id:`${n}-dpo-email`,type:"email",value:(u=t.dpoEmail)!=null?u:"",onChange:l=>p({dpoEmail:l.target.value}),placeholder:"dpo@example.com",className:a$1($,r==null?void 0:r.input,e)})}),jsx(A,{id:`${n}-address`,label:"Registered Address",classNames:r,unstyled:e,children:jsx("input",{id:`${n}-address`,type:"text",value:(b=t.address)!=null?b:"",onChange:l=>p({address:l.target.value}),placeholder:"1 Victoria Island, Lagos, Nigeria",className:a$1($,r==null?void 0:r.input,e)})}),jsx(A,{id:`${n}-org-size`,label:"Organisation Size",classNames:r,unstyled:e,children:jsxs("select",{id:`${n}-org-size`,value:t.orgSize,onChange:l=>p({orgSize:l.target.value}),className:a$1($,r==null?void 0:r.select,e),children:[jsx("option",{value:"startup",children:"Startup (1\u201350 employees)"}),jsx("option",{value:"midsize",children:"Mid-size (51\u2013500 employees)"}),jsx("option",{value:"enterprise",children:"Enterprise (500+ employees)"})]})}),jsx(A,{id:`${n}-country`,label:"Country of Operation",classNames:r,unstyled:e,children:jsx("input",{id:`${n}-country`,type:"text",value:t.country,onChange:l=>p({country:l.target.value}),placeholder:"Nigeria",className:a$1($,r==null?void 0:r.input,e)})})]})]})};var Xr={identity:"Identity",financial:"Financial",behavioral:"Behavioural",sensitive:"Sensitive",children:"Children"},Yr=["identity","financial","behavioral","sensitive","children"],Jr=["sensitive","children"],xr=({categories:d,onToggle:p,classNames:r,unstyled:e})=>{let n=Yr.reduce((t,i)=>{let u=d.filter(b=>b.group===i);return u.length>0&&(t[i]=u),t},{});return jsxs("div",{"data-ndpr-component":"policy-step-data",className:a$1("space-y-8",r==null?void 0:r.root,e),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Data Categories"}),jsx("p",{id:"data-categories-desc",className:a$1("ndpr-form-field__hint",r==null?void 0:r.subheading,e),children:"Select the categories of personal data your organisation collects. You must select at least one."})]}),Object.entries(n).map(([t,i])=>{let u=Jr.includes(t);return jsxs("div",{className:a$1("space-y-3",r==null?void 0:r.group,e),children:[jsxs("div",{className:a$1("flex items-center gap-2",r==null?void 0:r.groupHeader,e),children:[jsx("h3",{className:a$1("text-sm font-semibold uppercase tracking-wide ndpr-text-muted",r==null?void 0:r.groupTitle,e),children:Xr[t]}),u&&jsx("span",{className:a$1("text-xs font-medium ndpr-text-warning bg-amber-50 dark:bg-amber-900/20 px-2 py-0.5 rounded-full",r==null?void 0:r.sensitiveTag,e),children:"Sensitive"})]}),u&&jsx("p",{className:a$1("text-xs ndpr-text-warning",r==null?void 0:r.sensitiveWarning,e),children:t==="children"?"Processing children's data requires parental consent under NDPA Section 31 and imposes heightened obligations.":"Sensitive/special-category data requires explicit consent and additional safeguards under NDPA Section 30."}),jsx("div",{className:a$1("grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",r==null?void 0:r.cardsGrid,e),children:i.map(b=>jsx("button",{type:"button",onClick:()=>p(b.id),"aria-pressed":b.selected,className:a$1(["text-left rounded-lg border p-4 transition-all cursor-pointer focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",b.selected?"bg-[rgb(var(--ndpr-primary))]/5 border-[rgb(var(--ndpr-primary))] dark:bg-[rgb(var(--ndpr-primary))]/10":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"].join(" "),r==null?void 0:r.card,e),children:jsxs("div",{className:"flex items-start gap-3",children:[jsx("div",{className:a$1(["mt-0.5 w-4 h-4 rounded border-2 flex-shrink-0 flex items-center justify-center",b.selected?"bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))]":"border-gray-300 dark:border-gray-600"].join(" "),r==null?void 0:r.checkbox,e),"aria-hidden":"true",children:b.selected&&jsx("svg",{className:"w-2.5 h-2.5 text-[rgb(var(--ndpr-primary-foreground))]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),jsxs("div",{className:"min-w-0",children:[jsx("p",{className:a$1("text-sm font-medium ndpr-text-foreground",r==null?void 0:r.cardLabel,e),children:b.label}),jsx("p",{className:a$1("text-xs ndpr-text-muted mt-1 leading-relaxed",r==null?void 0:r.cardDataPoints,e),children:b.dataPoints.join(", ")})]})]})},b.id))})]},t)})]})};var Qr=[{value:"service_delivery",label:"Service Delivery",description:"Processing required to deliver the core product or service."},{value:"marketing",label:"Marketing & Communications",description:"Sending promotional messages, newsletters or offers."},{value:"analytics",label:"Analytics & Insights",description:"Analysing usage patterns to improve the product."},{value:"research",label:"Research & Development",description:"Using data to develop new features or products."},{value:"legal_compliance",label:"Legal Compliance",description:"Meeting statutory, regulatory or contractual obligations."},{value:"fraud_prevention",label:"Fraud Prevention & Security",description:"Detecting and preventing fraudulent activity."}],dr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",pr="ndpr-card ndpr-card--compact",gr=({id:d,checked:p,onChange:r})=>jsx("button",{id:d,type:"button",role:"switch","aria-checked":p,onClick:()=>r(!p),className:["relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent cursor-pointer transition-colors focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",p?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-600"].join(" "),children:jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition-transform",p?"translate-x-5":"translate-x-0"].join(" ")})}),hr=({context:d,onTogglePurpose:p,onUpdateContext:r,onAddProcessor:e,onRemoveProcessor:n,classNames:t,unstyled:i})=>{let u=useId(),[b$1,l]=useState({name:"",purpose:"",country:""}),[C,g]=useState(false),a=()=>{let{name:v,purpose:c,country:S}=b$1;!v.trim()||!c.trim()||!S.trim()||(e({name:v.trim(),purpose:c.trim(),country:S.trim()}),l({name:"",purpose:"",country:""}),g(false));};return jsxs("div",{"data-ndpr-component":"policy-step-processing",className:a$1("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",t==null?void 0:t.heading,i),children:"Processing Details"}),jsx("p",{className:a$1("ndpr-form-field__hint",t==null?void 0:t.subheading,i),children:"Define how and why you process personal data."})]}),jsxs("section",{className:a$1(pr,t==null?void 0:t.section,i),"aria-labelledby":"purposes-heading",children:[jsx("h3",{id:"purposes-heading",className:a$1("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Processing Purposes"}),jsx("p",{className:a$1("ndpr-form-field__hint",t==null?void 0:t.sectionDescription,i),children:"Select all purposes for which you process personal data. At least one is required."}),jsx("div",{className:a$1("space-y-3",t==null?void 0:t.purposeList,i),children:Qr.map(v=>{let c=d.purposes.includes(v.value),S=`${u}-purpose-${v.value}`,B=`${u}-purpose-desc-${v.value}`;return jsxs("label",{htmlFor:S,className:a$1("flex items-start gap-3 cursor-pointer group",t==null?void 0:t.purposeItem,i),children:[jsx("input",{id:S,type:"checkbox",checked:c,onChange:()=>p(v.value),"aria-describedby":B,className:a$1("mt-0.5 h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] cursor-pointer",t==null?void 0:t.purposeCheckbox,i)}),jsxs("div",{children:[jsx("p",{className:a$1("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.purposeLabel,i),children:v.label}),jsx("p",{id:B,className:a$1("ndpr-form-field__hint",t==null?void 0:t.purposeDescription,i),children:v.description})]})]},v.value)})})]}),jsxs("section",{className:a$1(pr,t==null?void 0:t.section,i),"aria-labelledby":"thirdparty-heading",children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("h3",{id:"thirdparty-heading",className:a$1("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Third-Party Data Sharing"}),jsx(gr,{id:`${u}-thirdparty-toggle`,checked:d.thirdPartyProcessors.length>0||C,onChange:v=>{v?g(true):(d.thirdPartyProcessors.forEach((c,S)=>n(0)),g(false));}})]}),(d.thirdPartyProcessors.length>0||C)&&jsxs("div",{className:a$1("ndpr-form-section",t==null?void 0:t.processorSection,i),children:[d.thirdPartyProcessors.length>0&&jsx("div",{className:a$1("overflow-x-auto",t==null?void 0:t.processorTable,i),children:jsxs("table",{className:"w-full text-sm",children:[jsx("thead",{children:jsxs("tr",{className:a$1("text-left text-xs font-medium ndpr-text-muted border-b border-gray-200 dark:border-gray-700",t==null?void 0:t.tableHeader,i),children:[jsx("th",{className:"pb-2 pr-4",children:"Name"}),jsx("th",{className:"pb-2 pr-4",children:"Purpose"}),jsx("th",{className:"pb-2 pr-4",children:"Country"}),jsx("th",{className:"pb-2"})]})}),jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:d.thirdPartyProcessors.map((v,c)=>jsxs("tr",{children:[jsx("td",{className:a$1("py-2 pr-4 ndpr-text-foreground",t==null?void 0:t.tableCell,i),children:v.name}),jsx("td",{className:a$1("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:v.purpose}),jsx("td",{className:a$1("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:v.country}),jsx("td",{className:"py-2",children:jsx("button",{type:"button",onClick:()=>n(c),className:a$1("text-red-500 hover:ndpr-text-destructive dark:hover:text-red-300 text-xs font-medium",t==null?void 0:t.removeButton,i),"aria-label":`Remove ${v.name}`,children:"Remove"})})]},c))})]})}),C?jsxs("div",{className:a$1("grid grid-cols-1 sm:grid-cols-3 gap-3 items-end",t==null?void 0:t.processorForm,i),children:[jsxs("div",{children:[jsx("label",{htmlFor:`${u}-proc-name`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Processor Name"}),jsx("input",{id:`${u}-proc-name`,type:"text",placeholder:"Processor name",value:b$1.name,onChange:v=>l(c=>b(a$2({},c),{name:v.target.value})),"aria-required":"true",className:a$1(dr,t==null?void 0:t.input,i)})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${u}-proc-purpose`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Purpose"}),jsx("input",{id:`${u}-proc-purpose`,type:"text",placeholder:"Purpose",value:b$1.purpose,onChange:v=>l(c=>b(a$2({},c),{purpose:v.target.value})),"aria-required":"true",className:a$1(dr,t==null?void 0:t.input,i)})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${u}-proc-country`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Country"}),jsx("input",{id:`${u}-proc-country`,type:"text",placeholder:"Country",value:b$1.country,onChange:v=>l(c=>b(a$2({},c),{country:v.target.value})),"aria-required":"true",className:a$1(dr,t==null?void 0:t.input,i)})]}),jsxs("div",{className:"sm:col-span-3 flex gap-2",children:[jsx("button",{type:"button",onClick:a,className:a$1("ndpr-button ndpr-button--primary ndpr-button--sm",t==null?void 0:t.addButton,i),children:"Add Processor"}),jsx("button",{type:"button",onClick:()=>g(false),className:a$1("ndpr-button ndpr-button--secondary ndpr-button--sm",t==null?void 0:t.cancelButton,i),children:"Cancel"})]})]}):jsxs("button",{type:"button",onClick:()=>g(true),className:a$1("flex items-center gap-1 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",t==null?void 0:t.addLink,i),children:[jsx("span",{"aria-hidden":"true",children:"+"})," Add processor"]})]})]}),jsxs("section",{className:a$1(pr,t==null?void 0:t.section,i),"aria-labelledby":"disclosures-heading",children:[jsx("h3",{id:"disclosures-heading",className:a$1("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Additional Disclosures"}),jsxs("div",{className:a$1("ndpr-form-section",t==null?void 0:t.disclosureList,i),children:[jsxs("div",{className:a$1("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxs("div",{children:[jsx("p",{id:`${u}-cross-border-label`,className:a$1("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Cross-border Data Transfers"}),jsx("p",{id:`${u}-cross-border-desc`,className:a$1("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you transfer personal data outside Nigeria? This triggers NDPA Chapter 6 obligations."})]}),jsx(gr,{id:`${u}-cross-border-toggle`,checked:d.hasCrossBorderTransfer,onChange:v=>r({hasCrossBorderTransfer:v})})]}),jsxs("div",{className:a$1("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxs("div",{children:[jsx("p",{id:`${u}-automated-label`,className:a$1("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Automated Decision-Making / Profiling"}),jsx("p",{id:`${u}-automated-desc`,className:a$1("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you use algorithms or automated systems to make decisions about individuals? Requires disclosure under NDPA Section 37."})]}),jsx(gr,{id:`${u}-automated-toggle`,checked:d.hasAutomatedDecisions,onChange:v=>r({hasAutomatedDecisions:v})})]})]})]})]})};var Cr=({section:d,index:p,isCustom:r,isEditing:e,editedContent:n,onEdit:t,onSaveEdit:i,onCancelEdit:u,onMoveUp:b,onMoveDown:l,onDelete:C,classNames:g,unstyled:a})=>{let[v,c]=useState(n!=null?n:d.template);return useEffect(()=>{n!==void 0&&c(n);},[n]),useEffect(()=>{e&&c(n!=null?n:d.template);},[e,n,d.template]),jsxs("div",{"data-ndpr-component":"policy-section-card",className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-3",g==null?void 0:g.root,a),children:[jsxs("div",{className:a$1("flex items-start justify-between gap-2",g==null?void 0:g.header,a),children:[jsxs("div",{className:a$1("flex items-center gap-3 min-w-0",g==null?void 0:g.titleRow,a),children:[jsx("span",{className:a$1("flex-shrink-0 w-7 h-7 rounded-full bg-gray-100 dark:bg-gray-700 ndpr-text-muted text-xs font-semibold flex items-center justify-center",g==null?void 0:g.sectionNumber,a),"aria-hidden":"true",children:p+1}),jsxs("h4",{className:a$1("text-sm font-semibold ndpr-text-foreground truncate",g==null?void 0:g.sectionTitle,a),children:[d.title,r&&jsx("span",{className:a$1("ml-2 text-xs font-normal ndpr-text-muted bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded",g==null?void 0:g.customBadge,a),children:"Custom"})]})]}),jsxs("div",{className:a$1("flex items-center gap-1 flex-shrink-0",g==null?void 0:g.actions,a),children:[b&&jsx("button",{type:"button",onClick:b,className:a$1("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${d.title}" up`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}),l&&jsx("button",{type:"button",onClick:l,className:a$1("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${d.title}" down`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}),!e&&jsx("button",{type:"button",onClick:t,className:a$1("p-1.5 text-gray-400 hover:text-[rgb(var(--ndpr-primary))] rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.editButton,a),"aria-label":`Edit "${d.title}"`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),r&&C&&jsx("button",{type:"button",onClick:C,className:a$1("p-1.5 text-gray-400 hover:text-red-500 dark:hover:text-red-400 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.deleteButton,a),"aria-label":`Delete "${d.title}"`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),e?jsxs("div",{className:a$1("space-y-2",g==null?void 0:g.editArea,a),children:[jsx("textarea",{value:v,onChange:S=>c(S.target.value),rows:8,className:a$1("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm font-mono resize-y",g==null?void 0:g.textarea,a),"aria-label":`Edit content for ${d.title}`}),jsxs("div",{className:a$1("flex gap-2",g==null?void 0:g.editActions,a),children:[jsx("button",{type:"button",onClick:()=>i(v),className:a$1("ndpr-button ndpr-button--primary ndpr-button--sm",g==null?void 0:g.saveButton,a),children:"Save"}),jsx("button",{type:"button",onClick:u,className:a$1("ndpr-button ndpr-button--secondary ndpr-button--sm",g==null?void 0:g.cancelButton,a),children:"Cancel"})]})]}):jsx("div",{className:a$1("text-sm ndpr-text-muted leading-relaxed line-clamp-4 whitespace-pre-wrap",g==null?void 0:g.content,a),children:d.template})]})};var kr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",wr=({onAdd:d,nextOrder:p,classNames:r,unstyled:e})=>{let n=useId(),[t,i]=useState(""),[u,b]=useState(""),[l,C]=useState(""),g=()=>{if(!t.trim()){C("Section title is required.");return}if(!u.trim()){C("Section content is required.");return}C(""),d({title:t.trim(),content:u.trim(),order:p}),i(""),b("");};return jsxs("div",{"data-ndpr-component":"custom-section-form",className:a$1("ndpr-card ndpr-card--compact",r==null?void 0:r.root,e),children:[jsx("h4",{className:a$1("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Add Custom Section"}),l&&jsx("p",{role:"alert",className:a$1("text-xs ndpr-text-destructive",r==null?void 0:r.error,e),children:l}),jsxs("div",{className:a$1("space-y-3",r==null?void 0:r.fields,e),children:[jsxs("div",{children:[jsxs("label",{htmlFor:`${n}-custom-section-title`,className:a$1("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Section Title ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsx("input",{id:`${n}-custom-section-title`,type:"text",value:t,onChange:a=>{i(a.target.value),l&&C("");},placeholder:"e.g. Cookie Policy",className:a$1(kr,r==null?void 0:r.input,e),"aria-required":"true"})]}),jsxs("div",{children:[jsxs("label",{htmlFor:`${n}-custom-section-content`,className:a$1("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Content ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsx("textarea",{id:`${n}-custom-section-content`,value:u,onChange:a=>{b(a.target.value),l&&C("");},placeholder:"Write the section content here...",rows:5,className:a$1(`${kr} resize-y`,r==null?void 0:r.textarea,e),"aria-required":"true"})]})]}),jsx("div",{className:a$1("flex items-center gap-2",r==null?void 0:r.footer,e),children:jsx("button",{type:"button",onClick:g,className:a$1("ndpr-button ndpr-button--primary ndpr-button--sm",r==null?void 0:r.addButton,e),children:"Add Section"})})]})};var Sr={compliant:{bg:"ndpr-alert ndpr-alert--success",text:"ndpr-text-success",border:"border-green-200 dark:border-green-700"},nearly_compliant:{bg:"bg-amber-50 dark:bg-amber-900/20",text:"ndpr-text-warning",border:"border-amber-200 dark:border-amber-700"},not_compliant:{bg:"ndpr-alert ndpr-alert--destructive",text:"ndpr-text-destructive",border:"border-red-200 dark:border-red-700"}},sr={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},N=({icon:d,label:p,description:r,actionLabel:e,loading:n,onClick:t,classNames:i,unstyled:u})=>jsxs("div",{className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex flex-col gap-3",i==null?void 0:i.formatCard,u),children:[jsxs("div",{className:a$1("flex items-center gap-3",i==null?void 0:i.formatHeader,u),children:[jsx("div",{className:a$1("w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center flex-shrink-0",i==null?void 0:i.formatIcon,u),"aria-hidden":"true",children:d}),jsxs("div",{className:"min-w-0",children:[jsx("p",{className:a$1("ndpr-section-heading",i==null?void 0:i.formatLabel,u),children:p}),jsx("p",{className:a$1("ndpr-form-field__hint",i==null?void 0:i.formatDescription,u),children:r})]})]}),jsx("button",{type:"button",onClick:t,disabled:n,className:a$1("w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2",i==null?void 0:i.formatButton,u),children:n?jsxs(Fragment,{children:[jsxs("svg",{className:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),"Generating\u2026"]}):e})]}),mr=({complianceResult:d$1,onExportPDF:p,onExportDOCX:r,onExportHTML:e,onExportMarkdown:n,classNames:t,unstyled:i})=>{var c;let[u,b]=useState(false),[l,C]=useState(false),g=(c=Sr[d$1.rating])!=null?c:Sr.not_compliant,a=()=>d(null,null,function*(){b(true);try{yield p();}finally{b(false);}}),v=()=>d(null,null,function*(){C(true);try{yield r();}finally{C(false);}});return jsxs("div",{"data-ndpr-component":"policy-export-panel",className:a$1("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxs("div",{className:a$1(`rounded-lg border p-4 flex items-center gap-4 ${g.bg} ${g.border}`,t==null?void 0:t.complianceSummary,i),children:[jsxs("div",{className:a$1(`text-3xl font-bold ${g.text}`,t==null?void 0:t.complianceScore,i),"aria-label":`Compliance score: ${d$1.percentage}%`,children:[d$1.percentage,"%"]}),jsxs("div",{children:[jsx("p",{className:a$1(`text-sm font-semibold ${g.text}`,t==null?void 0:t.complianceRating,i),children:sr[d$1.rating]}),jsxs("p",{className:a$1("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.complianceDetail,i),children:[d$1.score," / ",d$1.maxScore," points \u2022"," ",d$1.gaps.length," gap",d$1.gaps.length!==1?"s":""," remaining"]})]})]}),jsxs("div",{children:[jsx("h3",{className:a$1("ndpr-section-heading",t==null?void 0:t.formatsHeading,i),children:"Export Format"}),jsxs("div",{className:a$1("grid grid-cols-1 sm:grid-cols-2 gap-3",t==null?void 0:t.formatsGrid,i),children:[jsx(N,{icon:jsx("svg",{className:"w-5 h-5 text-red-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 7v-1h4v1h-4zm0-3v-1h4v1h-4zm-2-5h8v1H8v-1z"})}),label:"PDF",description:"Professional formatted document, ideal for publishing.",actionLabel:"Download PDF",loading:u,onClick:a,classNames:t,unstyled:i}),jsx(N,{icon:jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-5 8v-5h1.5l1 3 1-3H13v5h-1v-3.5l-.75 2.25h-.5L10 13.5V17H9zm5-1.5h.75c.55 0 .75-.25.75-.75 0-.4-.2-.65-.75-.65H14V15.5zm1 1.5h-2v-4h2c1.1 0 1.75.6 1.75 1.5 0 .55-.25.95-.65 1.15.5.2.8.65.8 1.2 0 1-.65 1.65-1.9 1.65V17zm-.25-1c.6 0 .9-.25.9-.75 0-.45-.3-.75-.9-.75H14V16h.75z"})}),label:"DOCX",description:"Editable Word document for further customisation.",actionLabel:"Download DOCX",loading:l,onClick:v,classNames:t,unstyled:i}),jsx(N,{icon:jsxs("svg",{className:"w-5 h-5 text-orange-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15H9V8h2v9zm4 0h-2V8h2v9z"}),jsx("path",{d:"M9.5 6.5h1v1h-1zm4 0h1v1h-1z"}),jsx("path",{d:"M5 5h14v2H5zm0 12h14v2H5z"})]}),label:"HTML",description:"Copy-ready HTML to embed on your website.",actionLabel:"Copy HTML",onClick:e,classNames:t,unstyled:i}),jsx(N,{icon:jsx("svg",{className:"w-5 h-5 ndpr-text-muted",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M3 5h18v2H3V5zm0 4h12v2H3V9zm0 4h18v2H3v-2zm0 4h12v2H3v-2z"})}),label:"Markdown",description:"Plain-text format for documentation or Git repos.",actionLabel:"Copy Markdown",onClick:n,classNames:t,unstyled:i})]})]})]})};var Lr=({sections:d,customSections:p,sectionOverrides:r,complianceResult:e,onEditSection:n,onAddCustomSection:t,onRemoveCustomSection:i,onReorderSection:u,onExportPDF:b$1,onExportDOCX:l,onExportHTML:C,onExportMarkdown:g,classNames:a,unstyled:v})=>{let[c,S]=useState(null),[B,J]=useState(false),Z=new Set(p.map(h=>h.id)),or=(h,D)=>{n(h,D),S(null);},er=d.length>0?Math.max(...d.map(h=>{var D;return (D=h.order)!=null?D:0}))+1:1;return jsxs("div",{"data-ndpr-component":"policy-step-review",className:a$1("ndpr-form-section",a==null?void 0:a.root,v),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",a==null?void 0:a.heading,v),children:"Review & Export"}),jsx("p",{className:a$1("ndpr-form-field__hint",a==null?void 0:a.subheading,v),children:"Review your generated policy sections, reorder or edit content, then export."})]}),jsx("div",{className:a$1("space-y-3",a==null?void 0:a.sectionList,v),"aria-live":"polite",children:d.map((h,D)=>jsx(Cr,{section:r[h.id]?b(a$2({},h),{template:r[h.id]}):h,index:D,isCustom:Z.has(h.id),isEditing:c===h.id,editedContent:r[h.id],onEdit:()=>S(h.id),onSaveEdit:ir=>or(h.id,ir),onCancelEdit:()=>S(null),onMoveUp:D>0?()=>u(h.id,"up"):void 0,onMoveDown:D<d.length-1?()=>u(h.id,"down"):void 0,onDelete:Z.has(h.id)?()=>i(h.id):void 0,classNames:a,unstyled:v},h.id))}),!B&&jsxs("button",{type:"button",onClick:()=>J(true),className:a$1("flex items-center gap-2 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",a==null?void 0:a.addSectionButton,v),children:[jsx("span",{className:a$1("w-5 h-5 rounded-full border-2 border-[rgb(var(--ndpr-primary))] flex items-center justify-center text-xs font-bold leading-none",a==null?void 0:a.addSectionIcon,v),"aria-hidden":"true",children:"+"}),"Add Custom Section"]}),B&&jsxs("div",{className:a$1("space-y-2",a==null?void 0:a.customFormWrapper,v),children:[jsx(wr,{onAdd:h=>{t(h),J(false);},nextOrder:er,classNames:a,unstyled:v}),jsx("button",{type:"button",onClick:()=>J(false),className:a$1("text-sm ndpr-text-muted hover:underline",a==null?void 0:a.cancelCustomForm,v),children:"Cancel"})]}),jsx("hr",{className:a$1("border-gray-200 dark:border-gray-700",a==null?void 0:a.divider,v)}),jsx(mr,{complianceResult:e,onExportPDF:b$1,onExportDOCX:l,onExportHTML:C,onExportMarkdown:g,classNames:a,unstyled:v})]})};var Dr={compliant:{stroke:"stroke-green-500 dark:stroke-green-400",text:"ndpr-text-success"},nearly_compliant:{stroke:"stroke-amber-500 dark:stroke-amber-400",text:"ndpr-text-warning"},not_compliant:{stroke:"stroke-red-500 dark:stroke-red-400",text:"ndpr-text-destructive"}},tt={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},Fr=({score:d,maxScore:p,rating:r,classNames:e,unstyled:n})=>{var C,g;let t=p>0?Math.round(d/p*100):0,i=(C=Dr[r])!=null?C:Dr.not_compliant,u=36,b=2*Math.PI*u,l=b-t/100*b;return jsxs("div",{"data-ndpr-component":"compliance-score-ring",className:a$1("flex flex-col items-center gap-2",e==null?void 0:e.root,n),children:[jsxs("div",{className:a$1("relative w-24 h-24",e==null?void 0:e.svgWrapper,n),children:[jsxs("svg",{className:"w-24 h-24 -rotate-90",viewBox:"0 0 96 96","aria-hidden":"true",children:[jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:"8"}),jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:i.stroke,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:b,strokeDashoffset:l,style:{transition:"stroke-dashoffset 0.5s ease-out"}})]}),jsx("div",{className:a$1("absolute inset-0 flex flex-col items-center justify-center",e==null?void 0:e.centerText,n),children:jsxs("span",{className:a$1(`text-xl font-bold leading-none ${i.text}`,e==null?void 0:e.scoreValue,n),"aria-label":`${t}% compliance score`,children:[t,"%"]})})]}),jsx("p",{className:a$1(`text-xs font-semibold text-center ${i.text}`,e==null?void 0:e.ratingLabel,n),children:(g=tt[r])!=null?g:r}),jsxs("p",{className:a$1("text-xs ndpr-text-muted text-center",e==null?void 0:e.scoreDetail,n),children:[d," / ",p," pts"]})]})};var et={critical:"ndpr-text-destructive",important:"ndpr-text-warning",recommended:"ndpr-text-info"},Er=({gap:d,isPassed:p,onFix:r,classNames:e,unstyled:n})=>{let[t,i]=useState(false);return jsxs("div",{"data-ndpr-component":"compliance-requirement-item",className:a$1("border-b border-gray-100 dark:border-gray-700 last:border-0 py-2",e==null?void 0:e.root,n),children:[jsxs("button",{type:"button",onClick:()=>!p&&i(u=>!u),className:a$1("w-full flex items-start gap-2 text-left group",e==null?void 0:e.row,n),"aria-expanded":p?void 0:t,"aria-disabled":p,children:[jsx("span",{className:a$1(["mt-0.5 flex-shrink-0 w-4 h-4 rounded-full flex items-center justify-center",p?"bg-green-500":d.severity==="critical"?"bg-red-500":d.severity==="important"?"bg-amber-500":"bg-blue-400"].join(" "),e==null?void 0:e.statusIcon,n),"aria-hidden":"true",children:p?jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center justify-between gap-1",children:[jsx("p",{className:a$1(`text-xs font-medium ${p?"ndpr-text-muted":"ndpr-text-foreground"}`,e==null?void 0:e.requirementLabel,n),children:d.requirement}),!p&&jsx("svg",{className:`flex-shrink-0 w-3 h-3 text-gray-400 transition-transform ${t?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),jsxs("p",{className:a$1("text-xs text-gray-400 dark:text-gray-500 mt-0.5",e==null?void 0:e.ndpaSection,n),children:["NDPA ",d.ndpaSection]})]})]}),!p&&t&&jsxs("div",{className:a$1("mt-2 ml-6 space-y-2",e==null?void 0:e.detail,n),children:[jsx("p",{className:a$1(`text-xs ${et[d.severity]}`,e==null?void 0:e.message,n),children:d.message}),jsx("button",{type:"button",onClick:()=>{r(d.requirementId),i(false);},className:a$1("text-xs font-medium px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",e==null?void 0:e.fixButton,n),children:d.fixLabel})]})]})};function nt(d,p){let r=p.map(t=>({gap:{requirementId:t,requirement:t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "),ndpaSection:"\u2014",severity:"recommended",message:"",fixType:"fill_field",fixLabel:""},isPassed:true})),e=d.map(t=>({gap:t,isPassed:false})),n={critical:0,important:1,recommended:2};return e.sort((t,i)=>n[t.gap.severity]-n[i.gap.severity]),[...e,...r]}var $r=({complianceResult:d,onFix:p,classNames:r,unstyled:e})=>{let[n,t]=useState(false),i=nt(d.gaps,d.passed);return jsxs("aside",{"data-ndpr-component":"compliance-checker-sidebar",className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",r==null?void 0:r.root,e),"aria-label":"NDPA compliance checker",children:[jsxs("div",{className:a$1("flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50",r==null?void 0:r.header,e),children:[jsx("h2",{className:a$1("ndpr-section-heading",r==null?void 0:r.title,e),children:"NDPA Compliance"}),jsx("button",{type:"button",onClick:()=>t(u=>!u),className:a$1("p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",r==null?void 0:r.collapseButton,e),"aria-expanded":!n,"aria-label":n?"Expand compliance checker":"Collapse compliance checker",children:jsx("svg",{className:`w-4 h-4 transition-transform ${n?"-rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]}),!n&&jsxs("div",{className:a$1("p-4 space-y-4",r==null?void 0:r.body,e),children:[jsx("div",{className:a$1("flex justify-center",r==null?void 0:r.ringWrapper,e),children:jsx(Fr,{score:d.score,maxScore:d.maxScore,rating:d.rating,classNames:r,unstyled:e})}),jsx("div",{className:a$1("grid grid-cols-3 gap-2 text-center",r==null?void 0:r.statsRow,e),children:[{count:d.gaps.filter(u=>u.severity==="critical").length,label:"Critical",color:"ndpr-text-destructive"},{count:d.gaps.filter(u=>u.severity==="important").length,label:"Important",color:"ndpr-text-warning"},{count:d.passed.length,label:"Passed",color:"ndpr-text-success"}].map(({count:u,label:b,color:l})=>jsxs("div",{children:[jsx("p",{className:a$1(`text-base font-bold ${l}`,r==null?void 0:r.statValue,e),children:u}),jsx("p",{className:a$1("ndpr-form-field__hint",r==null?void 0:r.statLabel,e),children:b})]},b))}),jsx("div",{className:a$1("overflow-y-auto max-h-80",r==null?void 0:r.requirementsList,e),children:i.length===0?jsx("p",{className:a$1("ndpr-empty-state",r==null?void 0:r.emptyState,e),children:"No requirements to display."}):i.map(({gap:u,isPassed:b})=>jsx(Er,{gap:u,isPassed:b,onFix:p,classNames:r,unstyled:e},u.requirementId))})]})]})};function dt(d){let p=Date.now()-d;return p<1e4?"just now":p<6e4?`${Math.floor(p/1e3)}s ago`:p<36e5?`${Math.floor(p/6e4)}m ago`:new Date(d).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var Ir=({lastSavedAt:d,isSaving:p,hasError:r,classNames:e,unstyled:n})=>{let t="idle";if(p?t="saving":r?t="error":d!==null&&(t="saved"),t==="idle")return null;let i=t==="saving"?"Saving\u2026":t==="error"?"Unable to save":`Draft saved ${d?dt(d):""}`;return jsxs("div",{"data-ndpr-component":"draft-save-indicator",role:"status","aria-live":"polite","aria-atomic":"true",className:a$1(`flex items-center gap-1.5 ${t==="error"?"text-red-500 dark:text-red-400":t==="saving"?"ndpr-card__subtitle":"ndpr-text-success"}`,e==null?void 0:e.root,n),children:[t==="saving"&&jsxs("svg",{className:"animate-spin w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),t==="saved"&&jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),t==="error"&&jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),jsx("span",{className:a$1("text-xs font-medium",e==null?void 0:e.text,n),children:i})]})};var mo=({adapter:d$1,onComplete:p,classNames:r,unstyled:e})=>{let{currentStep:n,nextStep:t,prevStep:i,canProceed:u,context:b,updateOrg:l,updateContext:C,toggleDataCategory:g,togglePurpose:a$2,addProcessor:v,removeProcessor:c,sections:S,customSections:B,sectionOverrides:J,editSectionContent:Z,addCustomSection:or,removeCustomSection:er,reorderSections:h,complianceResult:D,applyFix:ir,handleExportPDF:Tr,handleExportDOCX:_r,handleExportHTML:Mr,handleExportMarkdown:Br,lastSavedAt:zr,isLoading:jr}=a({adapter:d$1,onComplete:p}),nr=(F,K)=>{let O=URL.createObjectURL(F),H=document.createElement("a");H.href=O,H.download=K,H.click(),URL.revokeObjectURL(O);},qr=()=>d(null,null,function*(){let F=yield Tr();nr(F,"privacy-policy.pdf");}),Or=()=>d(null,null,function*(){let F=yield _r();nr(F,"privacy-policy.docx");}),Hr=()=>{let F=Mr();navigator.clipboard.writeText(F).catch(()=>{let K=new Blob([F],{type:"text/html"}),O=URL.createObjectURL(K),H=window.open(O,"_blank");H?H.addEventListener("load",()=>URL.revokeObjectURL(O)):URL.revokeObjectURL(O);});},Wr=()=>{let F=Br();navigator.clipboard.writeText(F).catch(()=>{let K=new Blob([F],{type:"text/markdown"});nr(K,"privacy-policy.md");});};return jr?jsxs("div",{"data-ndpr-component":"adaptive-policy-wizard",className:a$1("flex items-center justify-center min-h-64 text-gray-400 dark:text-gray-500",r==null?void 0:r.root,e),"aria-busy":"true","aria-label":"Loading policy wizard",children:[jsxs("svg",{className:"animate-spin w-6 h-6 mr-2",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),jsx("span",{className:"ndpr-text-sm",children:"Loading\u2026"})]}):jsx("div",{"data-ndpr-component":"adaptive-policy-wizard",className:a$1("min-h-screen bg-gray-50 dark:bg-gray-900",r==null?void 0:r.root,e),children:jsxs("div",{className:a$1("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",r==null?void 0:r.container,e),children:[jsxs("div",{className:a$1("flex items-center justify-between mb-6",r==null?void 0:r.topBar,e),children:[jsx("h1",{className:a$1("text-2xl font-bold ndpr-text-foreground",r==null?void 0:r.wizardTitle,e),children:"Privacy Policy Builder"}),jsx(Ir,{lastSavedAt:zr,isSaving:false,hasError:false,classNames:r,unstyled:e})]}),jsx("div",{className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-4 mb-6",r==null?void 0:r.stepIndicatorWrapper,e),children:jsx(lr,{currentStep:n,classNames:r,unstyled:e})}),jsxs("div",{className:a$1("flex flex-col lg:flex-row gap-6 items-start",r==null?void 0:r.panels,e),children:[jsxs("main",{"aria-live":"polite",className:a$1("flex-1 min-w-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6",r==null?void 0:r.mainPanel,e),children:[n===1&&jsx(fr,{context:b,onUpdateOrg:l,classNames:r,unstyled:e}),n===2&&jsx(xr,{categories:b.dataCategories,onToggle:g,classNames:r,unstyled:e}),n===3&&jsx(hr,{context:b,onTogglePurpose:a$2,onUpdateContext:C,onAddProcessor:v,onRemoveProcessor:c,classNames:r,unstyled:e}),n===4&&jsx(Lr,{sections:S,customSections:B,sectionOverrides:J,complianceResult:D,onEditSection:Z,onAddCustomSection:or,onRemoveCustomSection:er,onReorderSection:h,onExportPDF:qr,onExportDOCX:Or,onExportHTML:Hr,onExportMarkdown:Wr,classNames:r,unstyled:e}),jsxs("div",{className:a$1("flex items-center justify-between mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",r==null?void 0:r.navigation,e),children:[jsx("button",{type:"button",onClick:i,disabled:n===1,className:a$1("px-4 py-2 bg-gray-200 dark:bg-gray-700 ndpr-text-foreground rounded-md text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors",r==null?void 0:r.backButton,e),children:"Back"}),jsx("div",{className:"flex items-center gap-2",children:jsxs("span",{className:a$1("ndpr-form-field__hint",r==null?void 0:r.stepCounter,e),children:["Step ",n," of 4"]})}),n<4?jsx("button",{type:"button",onClick:t,disabled:!u,className:a$1("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-colors",r==null?void 0:r.nextButton,e),children:"Next"}):jsx("span",{})]})]}),jsx("aside",{className:a$1("w-full lg:w-80 flex-shrink-0",r==null?void 0:r.sidebarWrapper,e),children:jsx($r,{complianceResult:D,onFix:ir,classNames:r,unstyled:e})})]})]})})};
|
|
2
|
+
export{mo as a};//# sourceMappingURL=chunk-QVULSG6J.mjs.map
|
|
3
|
+
//# sourceMappingURL=chunk-QVULSG6J.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e={consent:{title:"A M\u1ECDy\xEC \xC0\u1E63\xEDr\xED R\u1EB9",description:"A \u0144 lo k\xFAk\xEC \xE0ti \xE0w\u1ECDn \xECm\u1ECD\u0300-\u1EB9\u0300r\u1ECD t\xF3 j\u1ECDra l\xE1ti p\xE8s\xE8 i\u1E63\u1EB9\u0301 wa \xE0ti l\xE1ti m\xFA \xECr\xEDr\xED r\u1EB9 d\xE1ra s\xED i. A \u0144 gba \xECfoh\xF9n\u1E63\u1ECD\u0300kan r\u1EB9 g\u1EB9\u0301g\u1EB9\u0301 b\xED Abala 25-26 ti \xD2fin \xCCd\xE1\xE0b\xF2b\xF2 D\xE1t\xE0 ti N\xE0\xECj\xEDr\xED\xE0.",acceptAll:"Gba Gbogbo",rejectAll:"K\u1ECD Gbogbo",customize:"\u1E62\xE0t\xFAn\u1E63e",savePreferences:"T\u1ECD\u0301j\xFA \xC0\u1E63\xE0y\xE0n",selectAll:"Yan Gbogbo",deselectAll:"Y\u1ECD Gbogbo K\xFAr\xF2",required:"K\xF2 \u1E62e Y\u1EB9ra F\xFAn",cookieNotice:'N\xEDpa t\xEDt\u1EB9 "Gba Gbogbo", o foh\xF9n \u1E63\u1ECD\u0300kan p\u1EB9\u0300l\xFA l\xEDlo gbogbo k\xFAk\xEC. \u1E62\xE0b\u1EB9\u0300w\xF2 \xCCl\xE0n\xE0 K\xFAk\xEC wa l\xE1ti k\u1EB9\u0301k\u1ECD\u0300\u1ECD\u0301 s\xEDi.'},dsr:{title:"Fi \xCCb\xE9\xE8r\xE8 On\xED-d\xE1t\xE0 S\xEDl\u1EB9\u0300",description:"Lo f\u1ECD\u0301\u1ECD\u0300m\xF9 y\xEC\xED l\xE1ti lo \xE0w\u1ECDn \u1EB9\u0300t\u1ECD\u0301 r\u1EB9 l\xE1b\u1EB9\u0301 \xD2fin \xCCd\xE1\xE0b\xF2b\xF2 D\xE1t\xE0 ti N\xE0\xECj\xEDr\xED\xE0 (NDPA), Ap\xE1 K\u1EB9rin, Abala 29-36.",submitRequest:"Fi \xCCb\xE9\xE8r\xE8 S\xEDl\u1EB9\u0300",reset:"T\xFAn B\u1EB9\u0300r\u1EB9\u0300",fullName:"Or\xFAk\u1ECD K\xEDk\xFAn",email:"\xC0d\xEDr\u1EB9\u0301s\xEC \xCDme\xE8l\xEC",phone:"N\u1ECD\u0301mb\xE0 F\xF3\xF2n\xF9 (\xC0\u1E63\xE0y\xE0n)",requestType:"Ir\xFA \xCCb\xE9\xE8r\xE8",additionalInfo:"\xC0l\xE0y\xE9 \xC0fik\xFAn",identityVerification:"\xCCd\xE1nil\xF3j\xFA \xCCd\xE1nim\u1ECD\u0300",identifierType:"Ir\xFA \xCCd\xE1nim\u1ECD\u0300",identifierValue:"Iye \xCCd\xE1nim\u1ECD\u0300",privacyNotice:"\xC0w\u1ECDn \xECr\xF2y\xECn t\xED o b\xE1 p\xE8s\xE8 n\xEDn\xFA f\u1ECD\u0301\u1ECD\u0300m\xF9 y\xEC\xED ni a \xF3 l\xF2 f\xFAn \xE8te \u1E63\xED\u1E63e \xE0b\xF3j\xFAt\xF3 \xECb\xE9\xE8r\xE8 on\xED-d\xE1t\xE0 r\u1EB9 n\xECkan.",successMessage:"A ti fi \xECb\xE9\xE8r\xE8 r\u1EB9 s\xEDl\u1EB9\u0300 d\xE1rad\xE1ra."},breach:{title:"\u1E62e \xCCr\xF2y\xECn \xCCr\xFAfin D\xE1t\xE0",description:"Lo f\u1ECD\u0301\u1ECD\u0300m\xF9 y\xEC\xED l\xE1ti \u1E63e \xECr\xF2y\xECn \xECr\xFAfin d\xE1t\xE0 t\xED a fura s\xED t\xE0b\xED t\xED a ti fidi r\u1EB9\u0300 m\xFAl\u1EB9\u0300 g\u1EB9\u0301g\u1EB9\u0301 b\xED Abala 40 ti NDPA.",submitReport:"Fi \xCCr\xF2y\xECn S\xEDl\u1EB9\u0300",breachTitle:"\xC0k\u1ECDl\xE9/\xC0k\xF3p\u1ECD\u0300 \xCCr\xFAfin",category:"\u1EB8\u0300ka",discoveredAt:"\u1ECCj\u1ECD\u0301 T\xED A R\xED I",detailedDescription:"\xC0l\xE0y\xE9 K\xEDk\xFAn"},dpia:{title:"\xCCgb\xE9l\xE9w\u1ECD\u0300n Ipa \xCCd\xE1\xE0b\xF2b\xF2 D\xE1t\xE0",next:"T\u1EB9\u0300l\xE9",previous:"S\u1EB9\u0301y\xECn",complete:"Par\xED \xCCgb\xE9l\xE9w\u1ECD\u0300n",progress:"\xCCl\u1ECDs\xEDw\xE1j\xFA"},policy:{title:"Ol\xF9pil\u1EB9\u0300\u1E63\u1EB9\u0300 \xCCl\xE0n\xE0 \xC0\u1E63\xEDr\xED",generate:"\u1E62\u1EB9\u0300d\xE1 \xCCl\xE0n\xE0",preview:"\xC0y\u1EB9\u0300w\xF2",export:"Gb\xE9 J\xE1de",sections:"\xC0w\u1ECDn Abala",variables:"\xC0w\u1ECDn On\xEDy\xEDpad\xE0"},compliance:{score:"\xC0m\xEC \xCCb\xE1mu",excellent:"K\xF2 L\xE8 D\xE1ra Ju",good:"\xD3 D\xE1ra",needsWork:"N\xEDl\xF2 \xC0t\xFAn\u1E63e",critical:"P\xE0t\xE0k\xEC Gan",recommendations:"\xC0w\u1ECDn \xC0b\xE1",passed:"K\u1ECDj\xE1",gaps:"\xC0w\u1ECDn \xC0\xECp\xE9"},common:{loading:"\u0143 gb\xE9y\u1EB9\u0300w\xF2...",error:"\xC0\u1E63\xEC\u1E63e kan \u1E63\u1EB9l\u1EB9\u0300",save:"T\u1ECD\u0301j\xFA",cancel:"Fagil\xE9",delete:"Pa r\u1EB9\u0301",edit:"\u1E62\xE0t\xFAn\u1E63e",add:"Fik\xFAn",back:"Pad\xE0",next:"T\u1EB9\u0300l\xE9",search:"W\xE1",noResults:"K\xF2 s\xED \xE8s\xEC kankan"}};var i={consent:{title:"Any\u1ECB Na-akwanyere Nzuzo G\u1ECB \xD9gw\xF9",description:"Any\u1ECB na-eji kuki na tekn\u1ECDl\u1ECDj\u1ECB nd\u1ECB yiri ya enyere \u1ECDr\u1EE5 any\u1ECB aka ma melite ah\u1EE5m\u1ECBhe g\u1ECB. A na-anak\u1ECDta nkwenye g\u1ECB d\u1ECBka iwu NDPA Ngalaba 25-26 si kwuo.",acceptAll:"Nabata Niile",rejectAll:"J\u1EE5 Niile",customize:"Hazie",savePreferences:"Chekwaa Nh\u1ECDr\u1ECD",selectAll:"H\u1ECDr\u1ECD Niile",deselectAll:"Wep\u1EE5 Niile",required:"Ach\u1ECDr\u1ECD",cookieNotice:'Site na \u1ECBp\u1ECB "Nabata Niile", \u1ECB kwenyere na iji kuki niile. Gaa na Am\u1EE5ma Kuki any\u1ECB \u1ECBm\u1EE5takwu.'},dsr:{title:"Tinye Ar\u1ECBr\u1ECB\u1ECD Onye Nwe Data",description:"Jiri f\u1ECD\u1ECDm\u1EE5 a mee ka ikike g\u1ECB n'okpuru Iwu Nchedo Data nke Na\u1ECBjir\u1ECBa (NDPA), Nkebi An\u1ECD, Ngalaba 29-36 r\u1EE5\u1ECD \u1ECDr\u1EE5.",submitRequest:"Tinye Ar\u1ECBr\u1ECB\u1ECD",reset:"Maliteghar\u1ECBa",fullName:"Aha Zuru Oke",email:"Adrees\u1ECB Email",phone:"N\u1ECDmb\xE0 Ekwent\u1ECB (Nh\u1ECDr\u1ECD)",requestType:"\u1EE4d\u1ECB Ar\u1ECBr\u1ECB\u1ECD",additionalInfo:"Ozi Nd\u1ECB \u1ECCz\u1ECD",identityVerification:"Nyocha Njirimara",identifierType:"\u1EE4d\u1ECB Njirimara",identifierValue:"Uru Njirimara",privacyNotice:"A ga-eji ozi \u1ECB nyere na f\u1ECD\u1ECDm\u1EE5 a naan\u1ECB maka ebumnuche nke ilek\u1ECDta ar\u1ECBr\u1ECB\u1ECD onye nwe data g\u1ECB.",successMessage:"Etinyela ar\u1ECBr\u1ECB\u1ECD g\u1ECB nke \u1ECDma."},breach:{title:"K\u1ECD\u1ECD Mwap\u1EE5 Data",description:"Jiri f\u1ECD\u1ECDm\u1EE5 a k\u1ECD\u1ECD mwap\u1EE5 data a na-echere ma \u1ECD b\u1EE5 nke e gosip\u1EE5tara d\u1ECBka iwu NDPA Ngalaba 40 si kwuo.",submitReport:"Tinye Ak\u1EE5k\u1ECD",breachTitle:"Isiokwu/Nch\u1ECBk\u1ECDta Mwap\u1EE5",category:"Udi",discoveredAt:"\u1EE4b\u1ECDch\u1ECB A Ch\u1ECDp\u1EE5tara",detailedDescription:"Nk\u1ECDwa Zuru Oke"},dpia:{title:"Nyocha Mmet\u1EE5ta Nchedo Data",next:"\u1ECCz\u1ECD",previous:"Az\u1EE5",complete:"Mechaa Nyocha",progress:"\u1ECCganihu"},policy:{title:"Ngwa Mmep\u1EE5ta Am\u1EE5ma Nzuzo",generate:"Mep\u1EE5ta Am\u1EE5ma",preview:"Lelee",export:"Bup\u1EE5ta",sections:"Ngalaba",variables:"Mgbanwe"},compliance:{score:"Akara Ndabere",excellent:"Kachas\u1ECB Mma",good:"\u1ECC D\u1ECB Mma",needsWork:"Ch\u1ECDr\u1ECD Mmezighar\u1ECB",critical:"D\u1ECB Oke Mkpa",recommendations:"Nd\u1EE5m\u1ECDd\u1EE5",passed:"Gafere",gaps:"Oghere"},common:{loading:"Na-ebugo...",error:"Mperi mere",save:"Chekwaa",cancel:"Kagbuo",delete:"Hichap\u1EE5",edit:"Dezie",add:"Tinye",back:"Laghachi",next:"\u1ECCz\u1ECD",search:"Ch\u1ECD\u1ECD",noResults:"Enwegh\u1ECB nsonaaz\u1EE5"}};var t={consent:{title:"Muna Daraja Sirrin Ka",description:"Muna amfani da kukis da fasahohi irin su don samar da ayyukanmu da inganta kwarewar ka. Ana tattara yardar ka bisa ga Sashe na 25-26 na Dokar Kare Bayanan Nijeriya.",acceptAll:"Kar\u0253i Duka",rejectAll:"\u0198i Duka",customize:"Gyara Za\u0253i",savePreferences:"Ajiye Za\u0253u\u0253\u0253uka",selectAll:"Za\u0253i Duka",deselectAll:"Cire Duka",required:"Wajibi Ne",cookieNotice:'Ta hanyar danna "Kar\u0253i Duka", ka yarda da amfani da dukkan kukis. Ziyarci Manufar Kukis don \u0199arin bayani.'},dsr:{title:"\u0198addamar da Bu\u0199atar Mai Bayanan",description:"Yi amfani da wannan fom don aiwatar da ha\u0199\u0199o\u0199in ka a \u0199ar\u0199ashin Dokar Kare Bayanan Nijeriya (NDPA), Bangare na Hu\u0257u, Sashe 29-36.",submitRequest:"\u0198addamar da Bu\u0199ata",reset:"Sake Saiti",fullName:"Sunan Cikakke",email:"Adireshin Imel",phone:"Lambar Waya (Na Za\u0253i)",requestType:"Nau'in Bu\u0199ata",additionalInfo:"\u0198arin Bayani",identityVerification:"Tabbatar da Ainihi",identifierType:"Nau'in Ganewa",identifierValue:"Darajar Ganewa",privacyNotice:"Za a yi amfani da bayanan da ka bayar a cikin wannan fom ne kawai don sarrafa bu\u0199atar mai bayanan ka.",successMessage:"An \u0199addamar da bu\u0199atar ka cikin nasara."},breach:{title:"Bayar da Rahoton Karya Bayanan",description:"Yi amfani da wannan fom don bayar da rahoton zargin ko tabbatar da karya bayanan bisa ga Sashe na 40 na NDPA.",submitReport:"\u0198addamar da Rahoto",breachTitle:"Taken/Ta\u0199aitaccen Karya",category:"Rukunin",discoveredAt:"Ranar da Aka Gano",detailedDescription:"Cikakken Bayani"},dpia:{title:"Tantance Tasirin Kare Bayanan",next:"Na Gaba",previous:"Na Baya",complete:"Kammala Tantancewa",progress:"Ci Gaba"},policy:{title:"Mai \u0198ir\u0199irar Manufar Sirri",generate:"\u0198ir\u0199iri Manufa",preview:"Duba",export:"Fitar",sections:"Sassa",variables:"Masu Canjin"},compliance:{score:"Makin Bin Doka",excellent:"Kyakkyawa Sosai",good:"Mai Kyau",needsWork:"Yana Bu\u0199atar Gyara",critical:"Mai Muhimmanci",recommendations:"Shawarwari",passed:"Ya Wuce",gaps:"Gi\u0253i"},common:{loading:"Ana lodawa...",error:"Kuskure ya faru",save:"Ajiye",cancel:"Soke",delete:"Goge",edit:"Gyara",add:"\u0198ara",back:"Komawa",next:"Na Gaba",search:"Bincika",noResults:"Ba a sami sakamako ba"}};var o={consent:{title:"Your Privacy Dey Important to Us",description:"We dey use cookies and technologies wey dey similar to give you beta service and make your experience sweet. We dey collect your consent as NDPA Sections 25-26 talk am.",acceptAll:"Accept Everything",rejectAll:"Reject Everything",customize:"Choose Wetin You Want",savePreferences:"Save Your Choice",selectAll:"Select Everything",deselectAll:"Remove Everything",required:"E Dey Required",cookieNotice:'If you click "Accept Everything", you don agree say we fit use all the cookies. Check our Cookie Policy to sabi more.'},dsr:{title:"Send Data Subject Request",description:"Use this form take exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",submitRequest:"Send Your Request",reset:"Start Again",fullName:"Your Full Name",email:"Email Address",phone:"Phone Number (If You Want)",requestType:"Type of Request",additionalInfo:"Any Other Information",identityVerification:"Verify Your Identity",identifierType:"Type of ID",identifierValue:"ID Value",privacyNotice:"The information wey you give for this form, na only for processing your data subject request we go use am.",successMessage:"We don receive your request successfully."},breach:{title:"Report Data Breach",description:"Use this form report any data breach wey you suspect or wey don happen, as NDPA Section 40 talk am.",submitReport:"Send Report",breachTitle:"Breach Title/Summary",category:"Category",discoveredAt:"Date Wey You Discover Am",detailedDescription:"Full Gist About Wetin Happen"},dpia:{title:"Data Protection Impact Assessment",next:"Next",previous:"Go Back",complete:"Finish Assessment",progress:"Progress"},policy:{title:"Privacy Policy Generator",generate:"Create Policy",preview:"Preview",export:"Export",sections:"Sections",variables:"Variables"},compliance:{score:"Compliance Score",excellent:"E Dey Excellent",good:"E Good",needsWork:"E Need Work",critical:"E Dey Critical",recommendations:"Wetin We Recommend",passed:"E Pass",gaps:"Gaps"},common:{loading:"E dey load...",error:"Error don happen",save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",add:"Add",back:"Go Back",next:"Next",search:"Search",noResults:"We no find any result"}};export{e as a,i as b,t as c,o as d};//# sourceMappingURL=chunk-R5FW5XUQ.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-R5FW5XUQ.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkP2YV6DR3_js=require('./chunk-P2YV6DR3.js'),chunkELKB2AFZ_js=require('./chunk-ELKB2AFZ.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function H(e,s){return s?chunkELKB2AFZ_js.a(e):{load:()=>null,save:()=>{},remove:()=>{}}}function L({templates:e,initialPolicy:s,adapter:P,storageKey:c="ndpr_privacy_policy",useLocalStorage:m=true,onGenerate:T}){let w=P!=null?P:H(c,m),l=react.useRef(w);l.current=w;let[r,f]=react.useState(s||null),[o,p]=react.useState(null),[y,z]=react.useState({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),[A,O]=react.useState(true),h=react.useRef(e);h.current=e,react.useEffect(()=>{if(s){O(false);return}let t=false;try{let n=l.current.load(),i=a=>{if(a){if(f(a),a.templateId){let g=h.current.find(b=>b.id===a.templateId);g&&p(g);}a.organizationInfo&&z(a.organizationInfo);}O(!1);};n instanceof Promise?n.then(a=>{t||i(a);},()=>{t||O(!1);}):i(n);}catch(n){t||O(false);}return ()=>{t=true;}},[s]);let q=t=>{Promise.resolve(l.current.save(t)).catch(n=>{console.warn("[ndpr-toolkit] Failed to save policy:",n);});},_=react.useCallback(t=>{let n=e.find(b=>b.id===t);if(!n)return false;p(n);let i=n.sections.map(b=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},b),{customContent:void 0})),a={};Object.keys(n.variables).forEach(b=>{a[b]=n.variables[b].defaultValue||"";});let g=Date.now();return f({id:"policy_"+g+"_"+Math.random().toString(36).substr(2,9),title:"",templateId:n.id,organizationInfo:y,sections:i,variableValues:a,effectiveDate:g,lastUpdated:g,version:"1.0"}),true},[e,y]),C=react.useCallback(t=>{z(n=>chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},n),t));},[]),k=react.useCallback((t,n)=>{o&&(r?f(i=>i&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{sections:i.sections.map(a=>a.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{included:n}):a)})):p(i=>i&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{sections:i.sections.map(a=>a.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{included:n}):a)})));},[o,r]),j=react.useCallback((t,n)=>{o&&(r?f(i=>i&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{sections:i.sections.map(a=>a.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{customContent:n}):a)})):p(i=>i&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{sections:i.sections.map(a=>a.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},a),{customContent:n}):a)})));},[o,r]),I=react.useCallback((t,n)=>{r&&f(i=>i&&chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{variableValues:chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i.variableValues),{[t]:n})}));},[r]),F=()=>"policy_"+Date.now()+"_"+Math.random().toString(36).substr(2,9),M=react.useCallback(()=>{if(!o)return null;let t=Date.now(),n={id:(r==null?void 0:r.id)||F(),title:`Privacy Policy for ${y.name}`,templateId:o.id,organizationInfo:y,sections:o.sections.map(i=>{var a;return chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},i),{customContent:(a=r==null?void 0:r.sections.find(g=>g.id===i.id))==null?void 0:a.customContent})}),variableValues:(r==null?void 0:r.variableValues)||{},effectiveDate:t,lastUpdated:t,version:"1.0"};return f(n),q(n),T&&T(n),n},[o,r,y,T]),$=react.useCallback(()=>{if(!r)return {fullText:"",sectionTexts:{},missingVariables:[]};let t=chunkP2YV6DR3_js.b(r.sections,r.organizationInfo);return typeof t=="string"?{fullText:t,sectionTexts:{full:t},missingVariables:[]}:t},[r]),B=react.useCallback(()=>{f(null),p(null),z({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),Promise.resolve(l.current.remove()).catch(t=>{console.warn("[ndpr-toolkit] Failed to remove policy:",t);});},[]),G=react.useCallback(()=>{let t=[];if(o||t.push("No template selected"),y.name||t.push("Organization name is required"),y.website||t.push("Organization website is required"),y.privacyEmail||t.push("Privacy contact email is required"),o){let n=o.sections.filter(a=>a.required),i=(r==null?void 0:r.sections.filter(a=>a.included))||[];n.forEach(a=>{i.some(g=>g.id===a.id)||t.push(`Required section "${a.title}" must be included`);});}return o&&r&&Object.entries(o.variables).forEach(([n,i])=>{i.required&&!r.variableValues[n]&&t.push(`Required variable "${i.name}" must have a value`);}),{valid:t.length===0,errors:t}},[o,y,r]);return {policy:r,selectedTemplate:o,organizationInfo:y,selectTemplate:_,updateOrganizationInfo:C,toggleSection:k,updateSectionContent:j,updateVariableValue:I,generatePolicy:M,getPolicyText:$,resetPolicy:B,isValid:G,isLoading:A}}var x="default-business";function J(e){let{sections:s,variables:P}=chunkP2YV6DR3_js.e(),c={};return e&&(e.name&&(c.orgName=e.name),e.email&&(c.privacyEmail=e.email),e.website&&(c.website=e.website),e.address&&(c.address=e.address),e.industry&&(c.industry=e.industry),e.dpoName&&(c.dpoName=e.dpoName),e.dpoEmail&&(c.dpoEmail=e.dpoEmail)),{id:x,name:"Default Business Policy",description:"NDPA-compliant privacy policy template for businesses.",organizationType:"business",sections:s,variables:Object.fromEntries(P.map(m=>[m.name,{name:m.name,description:m.description,required:m.required,defaultValue:c[m.name]||m.value||void 0}])),version:"1.0",lastUpdated:Date.now(),ndpaCompliant:true}}function Q(e){if(!e)return {};let s={};return e.name&&(s.name=e.name),e.email&&(s.privacyEmail=e.email),e.website&&(s.website=e.website),e.address&&(s.address=e.address),e.industry&&(s.industry=e.industry),e.dpoName&&(s.dpoName=e.dpoName),e.dpoEmail&&(s.dpoEmail=e.dpoEmail),s}function ne(e={}){let{orgInfo:s,autoGenerate:P=true,storageKey:c,useLocalStorage:m,adapter:T}=e,w=react.useRef(null);w.current===null&&(w.current=J(s));let l=L({templates:[w.current],adapter:T,storageKey:c,useLocalStorage:m}),r=react.useRef(false),f=react.useRef(false);return react.useEffect(()=>{if(!P||l.isLoading||r.current)return;if(!T&&m!==false&&typeof window!="undefined"&&typeof window.localStorage!="undefined")try{if(window.localStorage.getItem(c!=null?c:"ndpr_privacy_policy")){r.current=!0,f.current=!0;return}}catch(y){}if(l.policy){r.current=true,f.current=true;return}r.current=true;let p=Q(s);Object.keys(p).length>0&&l.updateOrganizationInfo(p),l.selectedTemplate||l.selectTemplate(x);},[P,l.isLoading]),react.useEffect(()=>{var p;if(!P||f.current||!r.current||!l.selectedTemplate)return;let o=(p=s==null?void 0:s.name)!=null?p:"";o&&l.organizationInfo.name!==o||(f.current=true,l.generatePolicy());},[P,l.selectedTemplate,l.organizationInfo]),l}exports.a=L;exports.b=ne;//# sourceMappingURL=chunk-RGNP45VR.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-RGNP45VR.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var G=({options:p,settings:d,onSave:S,title:l="Manage Your Privacy Settings",description:R="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:w="Save Preferences",resetButtonText:M="Reset to Defaults",version:_="1.0",className:f="",buttonClassName:v="",primaryButtonClassName:T="",secondaryButtonClassName:k="",classNames:n,unstyled:e,showSuccessMessage:$=true,successMessage:D="Your preferences have been saved.",successMessageDuration:P=3e3})=>{let[u,c]=react.useState({}),[q,b]=react.useState(false),g=react.useRef(null);react.useEffect(()=>()=>{g.current&&clearTimeout(g.current);},[]),react.useEffect(()=>{if(d&&d.consents)c(d.consents);else {let t={};p.forEach(o=>{t[o.id]=o.defaultValue||false;}),c(t);}},[p,d]);let x=(t,o)=>{c(s=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},s),{[t]:o}));},E=()=>{let t={consents:u,timestamp:Date.now(),version:_,method:"manager",hasInteracted:true};S(t),$&&(b(true),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{b(false);},P));},I=()=>{let t={};p.forEach(o=>{t[o.id]=o.defaultValue||false;}),c(t);},L=`ndpr-consent-manager__button ndpr-consent-manager__button--primary ${v} ${T}`.trim(),y=`ndpr-consent-manager__button ndpr-consent-manager__button--secondary ${v} ${k}`.trim(),V=(n==null?void 0:n.primaryButton)||(n==null?void 0:n.saveButton)||L,F=(n==null?void 0:n.secondaryButton)||(n==null?void 0:n.resetButton)||y,O=`ndpr-consent-manager${f?` ${f}`:""}`;return jsxRuntime.jsxs("div",{"data-ndpr-component":"consent-manager",className:chunkE64TU6IU_js.a(O,n==null?void 0:n.root,e),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("ndpr-consent-manager__title",n==null?void 0:n.title,e),children:l}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("ndpr-consent-manager__description",n==null?void 0:n.description,e),children:R}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("ndpr-consent-manager__options-list",n==null?void 0:n.optionsList,e),children:p.map(t=>{let o=`consent-manager-${t.id}`;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("ndpr-consent-manager__option",n==null?void 0:n.optionItem,e),children:[jsxRuntime.jsxs("div",{className:e?"":"ndpr-consent-manager__option-info",children:[jsxRuntime.jsx("h3",{className:e?"":"ndpr-consent-manager__option-label",children:t.label}),jsxRuntime.jsx("p",{className:e?"":"ndpr-consent-manager__option-description",children:t.description})]}),jsxRuntime.jsxs("label",{htmlFor:o,className:e?"":"ndpr-consent-manager__toggle-wrapper",children:[jsxRuntime.jsx("input",{id:o,type:"checkbox",className:e?"":"ndpr-consent-manager__toggle-input",checked:u[t.id]||false,onChange:s=>x(t.id,s.target.checked),disabled:t.required}),jsxRuntime.jsx("span",{"aria-hidden":"true",className:chunkE64TU6IU_js.a("ndpr-consent-manager__toggle",n==null?void 0:n.toggle,e)}),jsxRuntime.jsxs("span",{className:e?"":"ndpr-consent-manager__toggle-status",children:[u[t.id]?"Enabled":"Disabled",t.required&&jsxRuntime.jsx("span",{className:e?"":"ndpr-consent-manager__required-marker",children:"(Required)"})]})]})]},t.id)})}),q&&jsxRuntime.jsx("div",{className:e?"":"ndpr-consent-manager__success","aria-live":"polite",role:"status",children:D}),jsxRuntime.jsxs("div",{className:e?"":"ndpr-consent-manager__buttons",children:[jsxRuntime.jsx("button",{onClick:E,className:chunkE64TU6IU_js.a(V,n==null?void 0:n.saveButton,e),children:w}),jsxRuntime.jsx("button",{onClick:I,className:chunkE64TU6IU_js.a(F,n==null?void 0:n.resetButton,e),children:M})]}),jsxRuntime.jsxs("div",{className:e?"":"ndpr-consent-manager__meta",children:[jsxRuntime.jsxs("p",{children:["Last updated: ",d?new Date(d.timestamp).toLocaleString():"Never"]}),jsxRuntime.jsxs("p",{children:["Version: ",_]})]})]})};exports.a=G;//# sourceMappingURL=chunk-RLYTX3MM.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-RLYTX3MM.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';var chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js');var m=[{id:"full-name",label:"Full Name",group:"identity",dataPoints:["first name","last name","middle name","title"],selected:false},{id:"contact-details",label:"Contact Details",group:"identity",dataPoints:["email address","phone number","postal address"],selected:false},{id:"government-ids",label:"Government-Issued Identifiers",group:"identity",dataPoints:["NIN","passport number","driver's licence number","voter's card number"],selected:false},{id:"account-credentials",label:"Account Credentials",group:"identity",dataPoints:["username","hashed password","security questions"],selected:false},{id:"payment-info",label:"Payment Information",group:"financial",dataPoints:["credit/debit card number","bank account number","billing address"],selected:false},{id:"financial-records",label:"Financial Records",group:"financial",dataPoints:["transaction history","account balance","income details"],selected:false},{id:"bvn",label:"Bank Verification Number (BVN)",group:"financial",dataPoints:["BVN"],selected:false},{id:"device-info",label:"Device & Browser Information",group:"behavioral",dataPoints:["IP address","browser type","operating system","device identifiers"],selected:false},{id:"usage-data",label:"Usage & Analytics Data",group:"behavioral",dataPoints:["pages visited","click patterns","session duration","referral source"],selected:false},{id:"location-data",label:"Location Data",group:"behavioral",dataPoints:["GPS coordinates","city","country","timezone"],selected:false},{id:"cookies",label:"Cookies & Tracking Technologies",group:"behavioral",dataPoints:["cookie identifiers","pixel tags","local storage data"],selected:false},{id:"health-data",label:"Health & Medical Data",group:"sensitive",dataPoints:["medical history","prescriptions","health insurance details","disability status"],selected:false},{id:"biometric-data",label:"Biometric Data",group:"sensitive",dataPoints:["fingerprints","facial recognition data","voiceprints"],selected:false},{id:"ethnic-religious",label:"Ethnic Origin & Religious Beliefs",group:"sensitive",dataPoints:["ethnic origin","religious affiliation","political opinions"],selected:false},{id:"child-identity",label:"Child Identity Information",group:"children",dataPoints:["child's name","date of birth","school name","parent/guardian contact"],selected:false},{id:"child-activity",label:"Child Online Activity",group:"children",dataPoints:["content viewed","in-app activity","communications"],selected:false}];function f(){return {org:{name:"",website:"",privacyEmail:"",address:"",dpoName:"",dpoEmail:"",industry:"other",orgSize:"startup",country:"Nigeria"},dataCategories:m.map(e=>chunkMQFZHA2D_js.a({},e)),purposes:[],hasChildrenData:false,hasSensitiveData:false,hasFinancialData:false,hasCrossBorderTransfer:false,hasAutomatedDecisions:false,thirdPartyProcessors:[]}}function o(e,t){return e.sections.some(i=>i.id===t&&i.included)}function p(e,t){var a;let i=e.sections.find(s=>s.id===t&&s.included);return (a=i==null?void 0:i.template)!=null?a:""}function g(e){return e.sections.filter(t=>t.included).map(t=>t.template).join(`
|
|
2
|
+
`)}var u=[{id:"controller-identity",name:"Controller Identity",ndpaSection:"NDPA Section 24(1)(a)",severity:"critical",points:10,check:e=>{var t,i;return ((t=e.organizationInfo.name)!=null?t:"").trim().length>0&&((i=e.organizationInfo.privacyEmail)!=null?i:"").trim().length>0},gap:()=>({message:"The policy does not identify the data controller. The organisation name and contact email must be provided so data subjects know who is responsible for their data.",fixType:"fill_field",fixLabel:"Add organisation details",suggestedContent:"Provide your organisation's registered name and a valid privacy contact email address in the Organisation Info section."})},{id:"purpose-of-processing",name:"Purpose of Processing",ndpaSection:"NDPA Section 24(1)(b)",severity:"critical",points:10,check:(e,t)=>t.purposes.length>0,gap:()=>({message:"No processing purposes have been selected. The NDPA requires you to clearly state the specific purposes for which personal data is collected and processed.",fixType:"fill_field",fixLabel:"Select processing purposes",suggestedContent:"Select at least one processing purpose (e.g. service delivery, analytics, marketing) in the wizard."})},{id:"lawful-basis",name:"Lawful Basis Identified",ndpaSection:"NDPA Section 25",severity:"critical",points:10,check:e=>o(e,"legal-basis"),gap:()=>({message:"The policy does not include a section identifying the lawful basis for processing. Under the NDPA, every processing activity must be grounded in a lawful basis such as consent, contract, or legitimate interest.",fixType:"add_section",fixLabel:"Add legal basis section",suggestedContent:`We process personal data under one or more of the following lawful bases as prescribed by the NDPA 2023:
|
|
3
|
+
|
|
4
|
+
- Consent: where you have given clear, informed, and voluntary consent.
|
|
5
|
+
- Contract: where processing is necessary for the performance of a contract.
|
|
6
|
+
- Legal Obligation: where processing is required by Nigerian law.
|
|
7
|
+
- Legitimate Interest: where processing is necessary for our legitimate interests, provided they do not override your rights.`})},{id:"data-categories-disclosed",name:"Data Categories Disclosed",ndpaSection:"NDPA Section 24(1)(c)",severity:"critical",points:10,check:(e,t)=>t.dataCategories.some(i=>i.selected),gap:()=>({message:"No data categories have been selected. The NDPA requires you to disclose the categories of personal data you collect (e.g. identity, financial, behavioral data).",fixType:"fill_field",fixLabel:"Select data categories",suggestedContent:"Select the categories of personal data your organisation collects in the Data Collection step of the wizard."})},{id:"recipients-disclosed",name:"Recipients Disclosed",ndpaSection:"NDPA Section 24(1)(e)",severity:"critical",points:10,check:(e,t)=>{if(!o(e,"data-sharing"))return false;if(t.thirdPartyProcessors.length>0){let i=p(e,"data-sharing");return t.thirdPartyProcessors.every(a=>i.includes(a.name))}return true},gap:e=>({message:e.thirdPartyProcessors.length>0?"The data sharing section does not list all third-party processors. Each processor must be named with its purpose and location.":"The policy does not include a data sharing section. Even if you do not share data, you must state this clearly.",fixType:e.thirdPartyProcessors.length>0?"add_content":"add_section",fixLabel:e.thirdPartyProcessors.length>0?"Update sharing section":"Add data sharing section",suggestedContent:"We do not sell personal data. We may share your data with service providers under strict data processing agreements that comply with the NDPA 2023."})},{id:"retention-periods",name:"Retention Periods Specified",ndpaSection:"NDPA Section 24(1)(f)",severity:"critical",points:10,check:e=>o(e,"data-retention"),gap:()=>({message:"The policy does not include a data retention section. The NDPA requires you to specify the period for which personal data will be stored, or the criteria used to determine that period.",fixType:"add_section",fixLabel:"Add retention schedule",suggestedContent:"We retain personal data only for as long as necessary to fulfil the purposes for which it was collected, or as required by applicable Nigerian law. When personal data is no longer needed, it is securely deleted or anonymised."})},{id:"data-subject-rights",name:"Data Subject Rights Listed",ndpaSection:"NDPA Sections 34-39",severity:"important",points:7,check:e=>{if(!o(e,"data-subject-rights"))return false;let t=p(e,"data-subject-rights").toLowerCase();return ["access","rectification","erasure","portability","restrict","object"].every(a=>t.includes(a))},gap:()=>({message:"The data subject rights section is missing or does not cover all six NDPA rights: access, rectification, erasure, portability, restriction, and objection.",fixType:"add_content",fixLabel:"Add missing rights",suggestedContent:`Under the NDPA 2023, you have the following rights:
|
|
8
|
+
1. Right of Access (Section 34)
|
|
9
|
+
2. Right to Rectification (Section 35)
|
|
10
|
+
3. Right to Erasure (Section 36)
|
|
11
|
+
4. Right to Restrict Processing (Section 37)
|
|
12
|
+
5. Right to Data Portability (Section 38)
|
|
13
|
+
6. Right to Object (Section 37)`})},{id:"right-to-withdraw-consent",name:"Right to Withdraw Consent",ndpaSection:"NDPA Section 25(2)",severity:"important",points:7,check:e=>{let t=g(e).toLowerCase();return t.includes("withdraw")&&t.includes("consent")},gap:()=>({message:"The policy does not mention the right to withdraw consent. Data subjects must be informed that they can withdraw consent at any time without affecting the lawfulness of prior processing.",fixType:"add_content",fixLabel:"Add withdrawal clause",suggestedContent:"You have the right to withdraw your consent at any time, without affecting the lawfulness of processing carried out prior to withdrawal. To withdraw your consent, contact us at the email address provided in this policy."})},{id:"right-to-lodge-complaint",name:"Right to Lodge Complaint with NDPC",ndpaSection:"NDPA Section 40",severity:"important",points:7,check:e=>{let t=g(e).toLowerCase();return t.includes("ndpc")||t.includes("nigeria data protection commission")},gap:()=>({message:"The policy does not mention the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC). Data subjects must be informed of this right.",fixType:"add_content",fixLabel:"Add NDPC complaint reference",suggestedContent:"You have the right to lodge a complaint with the Nigeria Data Protection Commission (NDPC) if you believe your data protection rights have been infringed. Website: https://ndpc.gov.ng"})},{id:"cross-border-safeguards",name:"Cross-Border Transfer Safeguards",ndpaSection:"NDPA Sections 43-44",severity:"important",points:7,check:(e,t)=>t.hasCrossBorderTransfer?o(e,"cross-border-transfers"):true,gap:()=>({message:"Cross-border data transfers are indicated but the policy lacks a section describing the safeguards in place. The NDPA requires disclosure of transfer mechanisms and adequacy assessments.",fixType:"add_section",fixLabel:"Add cross-border section",suggestedContent:"Where we transfer personal data outside Nigeria, we ensure compliance with Sections 43 and 44 of the NDPA 2023 by implementing appropriate safeguards, including adequacy assessments and Standard Contractual Clauses."})},{id:"automated-decision-disclosure",name:"Automated Decision-Making Disclosure",ndpaSection:"NDPA Section 39",severity:"important",points:7,check:(e,t)=>t.hasAutomatedDecisions?o(e,"automated-decision-making"):true,gap:()=>({message:"Automated decision-making is indicated but the policy does not include a section disclosing this. The NDPA requires you to inform data subjects about automated decisions, including the logic involved and the right to human intervention.",fixType:"add_section",fixLabel:"Add automated decisions section",suggestedContent:"We use automated decision-making in certain processes. You have the right to request human intervention, express your point of view, and contest automated decisions, in accordance with Section 39 of the NDPA 2023."})},{id:"children-data-protection",name:"Children's Data Protection",ndpaSection:"NDPA Section 31",severity:"recommended",points:5,check:(e,t)=>t.hasChildrenData?o(e,"children-data-protection"):true,gap:()=>({message:"Children's data processing is indicated but the policy does not include a dedicated children's data protection section. The NDPA requires enhanced protections including parental consent for children under 13.",fixType:"add_section",fixLabel:"Add children's data section",suggestedContent:"We do not knowingly collect personal data from children under the age of 13 without verifiable parental or guardian consent. Parents and guardians may request access to, correction of, or deletion of their child's data at any time."})},{id:"dpo-contact-info",name:"DPO Contact Information",ndpaSection:"NDPA Section 30",severity:"recommended",points:5,check:e=>{var t,i;return ((t=e.organizationInfo.dpoName)!=null?t:"").trim().length>0&&((i=e.organizationInfo.dpoEmail)!=null?i:"").trim().length>0},gap:()=>({message:"The Data Protection Officer (DPO) contact information is not provided. While not always mandatory, appointing a DPO and publishing their contact details is strongly recommended under the NDPA.",fixType:"fill_field",fixLabel:"Add DPO details",suggestedContent:"Provide the full name and email address of your Data Protection Officer in the Organisation Info section."})},{id:"security-measures",name:"Security Measures Described",ndpaSection:"NDPA Section 28",severity:"recommended",points:5,check:e=>o(e,"data-security"),gap:()=>({message:"The policy does not describe the technical and organisational security measures in place to protect personal data. Describing these measures builds trust and demonstrates NDPA compliance.",fixType:"add_section",fixLabel:"Add security section",suggestedContent:"We implement appropriate technical and organisational measures to protect personal data, including encryption in transit and at rest, access controls, regular security assessments, and incident response procedures aligned with NDPA breach notification requirements."})},{id:"policy-effective-date",name:"Policy Effective Date",ndpaSection:"NDPA Section 24",severity:"recommended",points:5,check:e=>e.effectiveDate>0,gap:()=>({message:"The policy does not have an effective date set. An effective date is important for version control and for data subjects to know when the policy was last updated.",fixType:"fill_field",fixLabel:"Set effective date",suggestedContent:"Set the policy's effective date to the date you intend to publish it."})}];function P(e,t){let i=u.reduce((n,d)=>n+d.points,0),a=0,s=[],l=[];for(let n of u)if(n.check(e,t))a+=n.points,l.push(n.id);else {let d=n.gap(t);s.push(chunkMQFZHA2D_js.a({requirementId:n.id,requirement:n.name,ndpaSection:n.ndpaSection,severity:n.severity},d));}let h=Math.round(a/i*100),r;return a>=100?r="compliant":a>=80?r="nearly_compliant":r="not_compliant",{score:a,maxScore:i,percentage:h,rating:r,gaps:s,passed:l}}
|
|
14
|
+
exports.a=m;exports.b=f;exports.c=P;//# sourceMappingURL=chunk-RNTNHVKZ.js.map
|
|
15
|
+
//# sourceMappingURL=chunk-RNTNHVKZ.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-AYKLAEOU.mjs';import {jsxs,jsx}from'react/jsx-runtime';var f={consent:"Consent",dsr:"Data Subject Rights",dpia:"DPIA",breach:"Breach Notification",policy:"Privacy Policy",lawfulBasis:"Lawful Basis",crossBorder:"Cross-Border",ropa:"ROPA"},p={critical:"rgb(var(--ndpr-destructive))","needs-work":"rgb(var(--ndpr-warning))",good:"rgb(var(--ndpr-primary))",excellent:"rgb(var(--ndpr-success))"},m={critical:"Critical","needs-work":"Needs Work",good:"Good",excellent:"Excellent"},C={critical:"Critical",high:"High",medium:"Medium",low:"Low"},h=({score:t,rating:o,classNames:e,unstyled:l})=>{let r=p[o],i=2*Math.PI*40,g=i*(1-t/100);return jsxs("div",{className:a("relative inline-flex items-center justify-center",e==null?void 0:e.scoreCircle,l),role:"img","aria-label":`Compliance score: ${t} out of 100, rated ${m[o]}`,children:[jsxs("svg",{width:"120",height:"120",viewBox:"0 0 100 100","aria-hidden":"true",children:[jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:"rgba(0,0,0,0.08)",strokeWidth:"8"}),jsx("circle",{cx:"50",cy:"50",r:"40",fill:"none",stroke:r,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:g,transform:"rotate(-90 50 50)",style:{transition:"stroke-dashoffset 0.4s ease"}})]}),jsx("span",{className:a("absolute text-2xl font-bold tabular-nums",e==null?void 0:e.scoreValue,l),style:{color:r},children:t})]})},x=({rating:t,className:o,unstyled:e})=>{let l=p[t];return jsx("span",{className:a("inline-block px-3 py-1 rounded-full text-sm font-semibold",o,e),style:{backgroundColor:`${l.replace("rgb(","rgba(").replace(")",", 0.12)")}`,color:l,border:`1px solid ${l.replace("rgb(","rgba(").replace(")",", 0.3)")}`},role:"status","aria-live":"polite",children:m[t]})},R=({moduleKey:t,module:o,classNames:e,unstyled:l})=>{var b;let r=o.score>=90?"excellent":o.score>=70?"good":o.score>=40?"needs-work":"critical",i=p[r];Math.round(o.score/100*(o.gaps.length+Math.round(o.score/100*5)));let u=o.gaps.length,c=(b=f[t])!=null?b:t;return jsxs("div",{className:a("rounded-lg border p-4 flex flex-col gap-2",e==null?void 0:e.moduleCard,l),style:{borderColor:`${i.replace("rgb(","rgba(").replace(")",", 0.25)")}`,backgroundColor:`${i.replace("rgb(","rgba(").replace(")",", 0.04)")}`},children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:a("text-sm font-semibold truncate",e==null?void 0:e.moduleTitle,l),children:c}),jsx("span",{className:a("text-lg font-bold tabular-nums",e==null?void 0:e.moduleScore,l),style:{color:i},role:"status","aria-label":`${c} score: ${o.score}`,children:o.score})]}),jsx("div",{className:"h-1.5 rounded-full overflow-hidden",style:{backgroundColor:"rgba(0,0,0,0.08)"},role:"progressbar","aria-valuenow":o.score,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`${c} compliance score: ${o.score}%`,children:jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${o.score}%`,backgroundColor:i}})}),u>0&&jsxs("p",{className:a("ndpr-form-field__hint",e==null?void 0:e.moduleGaps,l),children:[u," gap",u!==1?"s":""," to address"]})]})},y=({rec:t,classNames:o,unstyled:e})=>{var i,g;let r=(i={critical:p.critical,high:p["needs-work"],medium:p.good,low:p.excellent}[t.priority])!=null?i:p.good;return jsxs("div",{"data-testid":"recommendation-item",className:a("flex gap-3 p-3 rounded-lg border border-gray-100 dark:border-gray-700 bg-white dark:bg-gray-800",o==null?void 0:o.recommendationItem,e),children:[jsx("span",{className:a("mt-0.5 shrink-0 inline-block px-2 py-0.5 rounded text-xs font-bold uppercase tracking-wide",o==null?void 0:o.recommendationPriority,e),style:{backgroundColor:`${r.replace("rgb(","rgba(").replace(")",", 0.12)")}`,color:r},children:(g=C[t.priority])!=null?g:t.priority}),jsxs("div",{className:"min-w-0 flex-1",children:[jsx("p",{className:a("text-sm font-medium ndpr-text-foreground",o==null?void 0:o.recommendationTitle,e),children:t.label}),jsx("p",{className:"mt-0.5 text-xs ndpr-text-muted leading-relaxed",children:t.recommendation}),jsxs("p",{className:"mt-1 text-xs text-gray-400 dark:text-gray-500",children:[t.ndpaSection," \u2022 Effort: ",t.effort]})]})]})},P=({report:t,title:o="NDPA Compliance Dashboard",showRecommendations:e=true,maxRecommendations:l=5,classNames:r,unstyled:i=false})=>{let g=t.recommendations.slice(0,l),u=Object.entries(t.modules);return jsxs("div",{"data-ndpr-component":"compliance-dashboard",className:a("w-full rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-sm p-6 flex flex-col gap-8",r==null?void 0:r.root,i),children:[jsxs("div",{className:a("flex flex-col sm:flex-row items-start sm:items-center gap-6",r==null?void 0:r.header,i),children:[jsx(h,{score:t.score,rating:t.rating,classNames:{scoreCircle:r==null?void 0:r.scoreCircle,scoreValue:r==null?void 0:r.scoreValue},unstyled:i}),jsxs("div",{className:"flex flex-col gap-2",children:[jsx("h2",{className:"text-xl font-bold ndpr-text-foreground leading-tight",children:o}),jsx(x,{rating:t.rating,className:r==null?void 0:r.ratingBadge,unstyled:i}),jsxs("p",{className:"ndpr-form-field__hint",children:["Generated on"," ",new Date(t.generatedAt).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})]})]})]}),jsx("div",{className:a("grid grid-cols-2 sm:grid-cols-2 md:grid-cols-4 gap-3",r==null?void 0:r.modulesGrid,i),children:u.map(([c,b])=>jsx(R,{moduleKey:c,module:b,classNames:{moduleCard:r==null?void 0:r.moduleCard,moduleTitle:r==null?void 0:r.moduleTitle,moduleScore:r==null?void 0:r.moduleScore,moduleGaps:r==null?void 0:r.moduleGaps},unstyled:i},c))}),e&&g.length>0&&jsxs("div",{className:a("flex flex-col gap-3",r==null?void 0:r.recommendationsSection,i),children:[jsx("h3",{className:"text-base font-semibold ndpr-text-foreground",children:"Recommendations"}),g.map(c=>jsx(y,{rec:c,classNames:{recommendationItem:r==null?void 0:r.recommendationItem,recommendationPriority:r==null?void 0:r.recommendationPriority,recommendationTitle:r==null?void 0:r.recommendationTitle},unstyled:i},`${c.module}-${c.key}`))]})]})};export{P as a};//# sourceMappingURL=chunk-RRVKUCFR.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-RRVKUCFR.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkC5QO3SX4_js=require('./chunk-C5QO3SX4.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var d=react.createContext({}),s=class extends react.Component{constructor(e){super(e);this.reset=()=>{this.setState({error:null});};this.state={error:null};}static getDerivedStateFromError(e){return {error:e}}componentDidCatch(e,r){var a,t;(t=(a=this.props).onError)==null||t.call(a,e,r);}render(){let{error:e}=this.state;if(e){let{fallback:r}=this.props;return typeof r=="function"?r(e,this.reset):r!==void 0?r:jsxRuntime.jsxs("div",{role:"alert",style:{padding:"16px",border:"1px solid #e53e3e",borderRadius:"4px",backgroundColor:"#fff5f5",color:"#c53030"},children:[jsxRuntime.jsx("h3",{style:{margin:"0 0 8px 0",fontSize:"16px"},children:"Something went wrong"}),jsxRuntime.jsx("p",{style:{margin:0,fontSize:"14px"},children:e.message})]})}return this.props.children}},E=a=>{var t=a,{children:o,fallback:p,onError:e}=t,r=chunkMQFZHA2D_js.c(t,["children","fallback","onError"]);let l=react.useMemo(()=>{if(!r.theme)return;let n={};return r.theme.primary&&(n["--ndpr-primary"]=r.theme.primary),r.theme.primaryHover&&(n["--ndpr-primary-hover"]=r.theme.primaryHover),r.theme.primaryForeground&&(n["--ndpr-primary-foreground"]=r.theme.primaryForeground),Object.keys(n).length>0?n:void 0},[r.theme]);return jsxRuntime.jsx(d.Provider,{value:r,children:jsxRuntime.jsx(s,{fallback:p,onError:e,children:l?jsxRuntime.jsx("div",{style:l,children:o}):o})})};function v(){return react.useContext(d)}function D(){let{locale:o}=react.useContext(d);return react.useMemo(()=>chunkC5QO3SX4_js.b(o),[o])}exports.a=E;exports.b=v;exports.c=D;//# sourceMappingURL=chunk-RXL6CZAI.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-RXL6CZAI.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {d,a}from'./chunk-WWT2ZSNU.mjs';function l(e,t={}){var a$1;let o=(a$1=t.headers)!=null?a$1:{};return {load(){return d(this,null,function*(){try{let r=yield fetch(e,{method:"GET",headers:a({},o)});return r.ok?yield r.json():null}catch(r){return null}})},save(r){return d(this,null,function*(){try{let n=yield fetch(e,{method:"POST",headers:a({"Content-Type":"application/json"},o),body:JSON.stringify(r)});n.ok||console.warn(`[ndpr-toolkit] Failed to save to ${e}: ${n.status}`);}catch(n){console.warn(`[ndpr-toolkit] Failed to save to ${e}`);}})},remove(){return d(this,null,function*(){try{let r=yield fetch(e,{method:"DELETE",headers:a({},o)});r.ok||console.warn(`[ndpr-toolkit] Failed to delete from ${e}: ${r.status}`);}catch(r){console.warn(`[ndpr-toolkit] Failed to delete from ${e}`);}})}}}function u(e){let t=e!=null?e:null;return {load(){return t},save(o){t=o;},remove(){t=null;}}}function f(e,...t){return {load(){return e.load()},save(o){let a=e.save(o),s=()=>{for(let r of t)try{r.save(o);}catch(n){console.warn("[ndpr-toolkit] Secondary adapter save failed:",n);}};if(a instanceof Promise)return a.then(()=>s());s();},remove(){let o=e.remove(),a=()=>{for(let s of t)try{s.remove();}catch(r){console.warn("[ndpr-toolkit] Secondary adapter remove failed:",r);}};if(o instanceof Promise)return o.then(()=>a());a();}}}export{l as a,u as b,f as c};//# sourceMappingURL=chunk-RY3PGVLZ.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-RY3PGVLZ.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
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 xn=({options:d,onSave:X,title:Z="We Value Your Privacy",description:m="We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",acceptAllButtonText:N="Accept All",rejectAllButtonText:nn="Reject All",customizeButtonText:tn="Customize",saveButtonText:en="Save Preferences",position:on="bottom",variant:y="bar",zIndex:s=9999,version:h="1.0",show:C,manageStorage:R=true,storageKey:L="ndpr_consent",className:H="",buttonClassName:z="",primaryButtonClassName:rn="",secondaryButtonClassName:dn="",classNames:n,unstyled:o,onAnalytics:k})=>{let[c,u]=react.useState(false),[b,D]=react.useState(false),[S,E]=react.useState({}),[O,cn]=react.useState(false),l=react.useRef(null),P=react.useRef(null),w=react.useRef(false);react.useEffect(()=>{cn(true);},[]);let p=react.useCallback((t,e)=>{k==null||k(chunkMQFZHA2D_js.a({action:t,timestamp:Date.now(),version:h},e!==void 0?{categories:e}:{}));},[k,h]);react.useEffect(()=>{let t={};if(d.forEach(e=>{t[e.id]=e.defaultValue||false;}),E(t),C===void 0)if(!R)u(true);else {let e=localStorage.getItem(L);if(e)try{JSON.parse(e).version!==h?u(!0):u(!1);}catch(B){u(true);}else u(true);}else u(C);},[d,L,h,R]),react.useEffect(()=>{C!==void 0&&u(C);},[C]);let un=()=>{let t={};d.forEach(e=>{t[e.id]=true;}),p("accepted_all",t),T(t);},F=()=>{let t={};d.forEach(e=>{t[e.id]=e.required||false;}),p("rejected_all",t),T(t);},bn=(t,e)=>{E(B=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},B),{[t]:e}));},ln=()=>{let t={};d.forEach(e=>{t[e.id]=true;}),E(t);},pn=()=>{let t={};d.forEach(e=>{t[e.id]=e.required||false;}),E(t);},M=d.length>0&&d.every(t=>S[t.id]),fn=()=>{p("customized",S),T(S);},T=t=>{let e={consents:t,timestamp:Date.now(),version:h,method:b?"customize":"banner",hasInteracted:true};R&&localStorage.setItem(L,JSON.stringify(e)),X(e),u(false),D(false);};if(react.useEffect(()=>{if(!c)return;let t=e=>{e.key==="Escape"&&(p("dismissed"),F());};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[c,p,d,b]),react.useEffect(()=>{c&&!w.current&&(w.current=true,p("shown")),c||(w.current=false);},[c,p]),react.useEffect(()=>{if(!c||!l.current)return;let t='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',B=setTimeout(()=>{if(!l.current)return;let f=l.current.querySelectorAll(t);f.length>0?f[0].focus():l.current.focus();},0),J=f=>{if(f.key!=="Tab"||!l.current)return;let x=l.current.querySelectorAll(t);if(x.length===0)return;let W=x[0],Y=x[x.length-1];f.shiftKey?document.activeElement===W&&(f.preventDefault(),Y.focus()):document.activeElement===Y&&(f.preventDefault(),W.focus());};return document.addEventListener("keydown",J),()=>{clearTimeout(B),document.removeEventListener("keydown",J);}},[c,b]),react.useEffect(()=>{if(b&&P.current){let t=P.current;t.style.maxHeight="0px",t.style.opacity="0",t.offsetHeight,t.style.maxHeight=`${t.scrollHeight}px`,t.style.opacity="1";}},[b]),!c)return null;let a=y==="modal"?"center":on,G=a==="inline",j=a==="center",_=["ndpr-consent-banner"];y!=="bar"&&_.push(`ndpr-consent-banner--${y}`),a==="top"?_.push("ndpr-consent-banner--top"):a==="bottom"?_.push("ndpr-consent-banner--bottom"):a==="inline"&&_.push("ndpr-consent-banner--inline"),H&&_.push(H);let gn=_.join(" "),K=`ndpr-consent-banner__button ndpr-consent-banner__button--primary ${z} ${rn}`.trim(),vn=`ndpr-consent-banner__button ndpr-consent-banner__button--secondary ${z} ${dn}`.trim(),an=`ndpr-consent-banner__button ndpr-consent-banner__button--ghost ${z}`.trim(),_n=(n==null?void 0:n.primaryButton)||(n==null?void 0:n.acceptButton)||K,V=(n==null?void 0:n.secondaryButton)||(n==null?void 0:n.rejectButton)||vn,hn=(n==null?void 0:n.customizeButton)||an,Cn=(n==null?void 0:n.saveButton)||K,I=jsxRuntime.jsx("div",{ref:l,tabIndex:-1,"data-ndpr-component":"consent-banner","data-ndpr-variant":y,"data-ndpr-position":a,className:chunkE64TU6IU_js.a(gn,n==null?void 0:n.root,o),style:!G&&!j?{zIndex:s}:void 0,role:"dialog","aria-modal":j||void 0,"aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("ndpr-consent-banner__container",n==null?void 0:n.container,o),children:[jsxRuntime.jsx("h2",{id:"consent-banner-title",className:chunkE64TU6IU_js.a("ndpr-consent-banner__title",n==null?void 0:n.title,o),children:Z}),jsxRuntime.jsx("p",{id:"consent-banner-description",className:chunkE64TU6IU_js.a("ndpr-consent-banner__description",n==null?void 0:n.description,o),children:m}),b&&jsxRuntime.jsxs("div",{ref:P,className:chunkE64TU6IU_js.a("ndpr-consent-banner__customize-panel",n==null?void 0:n.customizePanel,o),children:[jsxRuntime.jsx("div",{className:o?"":"ndpr-consent-banner__select-all-row",children:jsxRuntime.jsx("button",{type:"button",onClick:M?pn:ln,className:chunkE64TU6IU_js.a("ndpr-consent-banner__select-all-button",n==null?void 0:n.selectAllButton,o),children:M?"Deselect All":"Select All"})}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("ndpr-consent-banner__options-list",n==null?void 0:n.optionsList,o),children:d.map(t=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("ndpr-consent-banner__option",n==null?void 0:n.optionItem,o),children:[jsxRuntime.jsx("input",{id:`consent-${t.id}`,type:"checkbox",checked:S[t.id]||false,onChange:e=>bn(t.id,e.target.checked),disabled:t.required,className:chunkE64TU6IU_js.a("ndpr-consent-banner__option-checkbox",n==null?void 0:n.optionCheckbox,o)}),jsxRuntime.jsxs("div",{className:o?"":"ndpr-consent-banner__option-text",children:[jsxRuntime.jsxs("label",{htmlFor:`consent-${t.id}`,className:chunkE64TU6IU_js.a("ndpr-consent-banner__option-label",n==null?void 0:n.optionLabel,o),children:[t.label,t.required&&jsxRuntime.jsx("span",{className:o?"":"ndpr-consent-banner__required-marker",children:" *"})]}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("ndpr-consent-banner__option-description",n==null?void 0:n.optionDescription,o),children:t.description})]})]},t.id))}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("ndpr-consent-banner__buttons",n==null?void 0:n.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:fn,className:chunkE64TU6IU_js.a(Cn,n==null?void 0:n.saveButton,o),children:en}),jsxRuntime.jsx("button",{onClick:()=>D(false),className:chunkE64TU6IU_js.a(V,n==null?void 0:n.rejectButton,o),children:"Back"})]})]}),!b&&jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("ndpr-consent-banner__buttons",n==null?void 0:n.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:un,className:chunkE64TU6IU_js.a(_n,n==null?void 0:n.acceptButton,o),children:N}),jsxRuntime.jsx("button",{onClick:F,className:chunkE64TU6IU_js.a(V,n==null?void 0:n.rejectButton,o),children:nn}),jsxRuntime.jsx("button",{onClick:()=>D(true),className:chunkE64TU6IU_js.a(hn,n==null?void 0:n.customizeButton,o),children:tn})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("ndpr-consent-banner__footer-text",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(G)return I;if(j){let t=jsxRuntime.jsx("div",{className:o?"":"ndpr-consent-banner__overlay",style:{zIndex:s},children:I});return O?reactDom.createPortal(t,document.body):null}return O?reactDom.createPortal(I,document.body):null};exports.a=xn;//# sourceMappingURL=chunk-SUEGUY35.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-SUEGUY35.js.map
|