@tantainnovative/ndpr-toolkit 2.4.1 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +226 -246
- package/dist/BreachReportForm-DpRrBoxU.d.ts +158 -0
- package/dist/BreachReportForm-yJ2Zl6gz.d.mts +158 -0
- package/dist/ConsentBanner-CDRT0o2k.d.mts +146 -0
- package/dist/ConsentBanner-Vxyt8SCX.d.ts +146 -0
- package/dist/{cross-border-entry-BrWVPly6.d.ts → CrossBorderTransferManager-D5Lc0e46.d.ts} +4 -5
- package/dist/{cross-border-entry-cCTvpwnT.d.mts → CrossBorderTransferManager-DkZhv9vD.d.mts} +4 -5
- package/dist/DPIAQuestionnaire-BkejviPj.d.mts +123 -0
- package/dist/DPIAQuestionnaire-DdSqXG3x.d.ts +123 -0
- package/dist/DSRRequestForm-BY8PogCU.d.mts +146 -0
- package/dist/DSRRequestForm-CHUg9cZh.d.ts +146 -0
- package/dist/DSRTracker-C6u_jAaK.d.mts +163 -0
- package/dist/DSRTracker-Dr_aT0pg.d.ts +163 -0
- package/dist/{lawful-basis-entry-CxZrofwG.d.mts → LawfulBasisTracker-CBqOxX1D.d.mts} +3 -5
- package/dist/{lawful-basis-entry-15qjKcNO.d.ts → LawfulBasisTracker-Cg30NbDA.d.ts} +3 -5
- package/dist/NDPRDashboard-CLJpEg0X.d.mts +44 -0
- package/dist/NDPRDashboard-DDWNd2Ah.d.ts +44 -0
- package/dist/{policy-E0fXZkda.d.mts → PolicyExporter-Bgi6nz82.d.mts} +5 -7
- package/dist/{policy-D2_jh5-T.d.ts → PolicyExporter-BnvuFncj.d.ts} +5 -7
- package/dist/{ropa-entry-B0D7X1GV.d.ts → ROPAManager-BS4eB8Hw.d.mts} +4 -5
- package/dist/{ropa-entry-DiOThOc2.d.mts → ROPAManager-qxTrXLkD.d.ts} +4 -5
- package/dist/RegulatoryReportGenerator-BUYgzTTT.d.ts +282 -0
- package/dist/RegulatoryReportGenerator-DwcHcEFp.d.mts +282 -0
- package/dist/StepIndicator-D-nwRTyo.d.mts +171 -0
- package/dist/StepIndicator-D9ZATz_O.d.ts +171 -0
- package/dist/adapters.d.mts +25 -0
- package/dist/adapters.d.ts +25 -0
- package/dist/adapters.js +2 -0
- package/dist/adapters.mjs +2 -0
- package/dist/breach.d.mts +36 -431
- package/dist/breach.d.ts +36 -431
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-27NYSWUG.mjs +2 -0
- package/dist/chunk-2ORDHJRD.js +2 -0
- package/dist/chunk-2W7ARAW2.js +2 -0
- package/dist/chunk-3F34NACG.js +2 -0
- package/dist/chunk-3UWT64FI.mjs +2 -0
- package/dist/chunk-3V23O4ZJ.js +2 -0
- package/dist/chunk-3XAUN5IM.mjs +3 -0
- package/dist/chunk-44W4H2EY.js +2 -0
- package/dist/chunk-5VMHKNJY.js +2 -0
- package/dist/chunk-6D3ZUGBB.mjs +2 -0
- package/dist/chunk-6E54NSAO.mjs +2 -0
- package/dist/chunk-7F5F5YWI.mjs +2 -0
- package/dist/chunk-DQLDX5X6.js +316 -0
- package/dist/chunk-FR7ZYZXB.js +2 -0
- package/dist/chunk-FY5G6DGZ.js +7 -0
- package/dist/chunk-G26I6MP5.mjs +2 -0
- package/dist/chunk-GCQRHMTQ.mjs +144 -0
- package/dist/chunk-GPJVTGHR.mjs +2 -0
- package/dist/chunk-GVANK6PL.js +3 -0
- package/dist/chunk-HNZK7LY3.mjs +2 -0
- package/dist/chunk-IKEPXHCZ.js +2 -0
- package/dist/chunk-IQQW52EF.js +2 -0
- package/dist/chunk-ISSGO2YT.mjs +72 -0
- package/dist/chunk-JZKH5RMC.js +3 -0
- package/dist/chunk-KHRBU5K7.js +2 -0
- package/dist/chunk-LFNA6WYQ.mjs +2 -0
- package/dist/chunk-LU4PFST7.js +144 -0
- package/dist/chunk-NPI5T6NH.mjs +7 -0
- package/dist/chunk-NPLXE43Q.mjs +2 -0
- package/dist/chunk-P7BSBCB3.js +2 -0
- package/dist/chunk-PEH5GIMN.js +2 -0
- package/dist/chunk-RSUDIFZV.mjs +2 -0
- package/dist/chunk-SBNAMPAP.mjs +2 -0
- package/dist/chunk-SVCRYM4I.mjs +2 -0
- package/dist/chunk-TKBZRULW.mjs +316 -0
- package/dist/chunk-TVW6KBVV.mjs +2 -0
- package/dist/chunk-U6VWHC46.js +72 -0
- package/dist/chunk-UK656RCG.js +2 -0
- package/dist/chunk-UNKXYVXY.js +2 -0
- package/dist/chunk-UOSEH6DC.js +2 -0
- package/dist/chunk-V37BM2LF.js +2 -0
- package/dist/chunk-V3MXWGXU.mjs +2 -0
- package/dist/chunk-VDZKGCAF.js +2 -0
- package/dist/chunk-WLSW4Z4W.mjs +2 -0
- package/dist/chunk-XSK4BSZJ.mjs +2 -0
- package/dist/chunk-YJCGEOLO.mjs +2 -0
- package/dist/chunk-ZCZ5RRZO.js +2 -0
- package/dist/chunk-ZQSX5ZHB.mjs +3 -0
- package/dist/compliance-score-racQe_E_.d.mts +115 -0
- package/dist/compliance-score-racQe_E_.d.ts +115 -0
- package/dist/consent.d.mts +67 -295
- package/dist/consent.d.ts +67 -295
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +14 -48
- package/dist/core.d.ts +14 -48
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border-BBi9rZyO.d.mts +54 -0
- package/dist/cross-border-Dy-U9Hu6.d.ts +54 -0
- package/dist/{cross-border-BMcqLvjC.d.mts → cross-border-UyT00llA.d.mts} +1 -52
- package/dist/{cross-border-BMcqLvjC.d.ts → cross-border-UyT00llA.d.ts} +1 -52
- package/dist/cross-border.d.mts +32 -4
- package/dist/cross-border.d.ts +32 -4
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/dpia.d.mts +28 -284
- package/dist/dpia.d.ts +28 -284
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/dsr.d.mts +29 -300
- package/dist/dsr.d.ts +29 -300
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/hooks.d.mts +23 -10
- package/dist/hooks.d.ts +23 -10
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +28 -19
- package/dist/index.d.ts +28 -19
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis.d.mts +31 -4
- package/dist/lawful-basis.d.ts +31 -4
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/policy-engine-C-tShzZH.d.mts +154 -0
- package/dist/policy-engine-DSQpT55_.d.ts +154 -0
- package/dist/policy-sections-CfNVBLCh.d.mts +54 -0
- package/dist/policy-sections-DqH0iZRf.d.ts +54 -0
- package/dist/policy.d.mts +117 -4
- package/dist/policy.d.ts +117 -4
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets.d.mts +114 -0
- package/dist/presets.d.ts +114 -0
- package/dist/presets.js +2 -0
- package/dist/presets.mjs +2 -0
- package/dist/{ropa-Li6UlL5H.d.ts → ropa-BDTM06tr.d.ts} +1 -49
- package/dist/{ropa-DP7pPPql.d.mts → ropa-CFHuT7jE.d.mts} +1 -49
- package/dist/ropa-CyynscU6.d.ts +51 -0
- package/dist/ropa-NIgxd8uP.d.mts +51 -0
- package/dist/ropa.d.mts +30 -4
- package/dist/ropa.d.ts +30 -4
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/sanitize-9mOO_cJW.d.mts +147 -0
- package/dist/sanitize-9mOO_cJW.d.ts +147 -0
- package/dist/styling-B7CBzYG7.d.ts +165 -0
- package/dist/styling-uJLsBbER.d.mts +165 -0
- package/dist/types-DK2CoKOC.d.mts +10 -0
- package/dist/types-DK2CoKOC.d.ts +10 -0
- package/dist/unstyled.d.mts +4 -4
- package/dist/unstyled.d.ts +4 -4
- package/dist/useAdaptivePolicyWizard-B9Op2gYM.d.ts +52 -0
- package/dist/useAdaptivePolicyWizard-N4eUM4Tj.d.mts +52 -0
- package/dist/{useBreach-BBSoIcZO.d.mts → useBreach-CPr86Yan.d.mts} +18 -2
- package/dist/{useBreach-lFLbSyAN.d.ts → useBreach-DkVXvtJK.d.ts} +18 -2
- package/dist/{useConsent-D0pAfTlb.d.ts → useConsent-DCNkIJHR.d.mts} +12 -2
- package/dist/{useConsent-DOt2Njst.d.mts → useConsent-dOcELSfX.d.ts} +12 -2
- package/dist/{useCrossBorderTransfer-DmtACeqW.d.ts → useCrossBorderTransfer-BGNZt2lk.d.mts} +15 -3
- package/dist/{useCrossBorderTransfer-BZVFCXfr.d.mts → useCrossBorderTransfer-COqjgjsu.d.ts} +15 -3
- package/dist/{useDPIA-DBsg2yZx.d.ts → useDPIA-Dl16Te3r.d.ts} +13 -2
- package/dist/{useDPIA-Da7-Q_yW.d.mts → useDPIA-DzWye8JB.d.mts} +13 -2
- package/dist/{useDSR-YYZ6FYFs.d.mts → useDSR-C1LksCfP.d.mts} +13 -2
- package/dist/{useDSR-CYI7WCXr.d.ts → useDSR-DZel52O1.d.ts} +13 -2
- package/dist/{useDefaultPrivacyPolicy-CUluF_ic.d.mts → useDefaultPrivacyPolicy-BsYttRey.d.mts} +13 -2
- package/dist/{useDefaultPrivacyPolicy-B7kTHbZh.d.ts → useDefaultPrivacyPolicy-C-mG-A5S.d.ts} +13 -2
- package/dist/{useLawfulBasis-CpWuHtyh.d.mts → useLawfulBasis-CKJ-kw84.d.mts} +13 -2
- package/dist/{useLawfulBasis-CCWF9waR.d.ts → useLawfulBasis-DFTmu1ca.d.ts} +13 -2
- package/dist/{useROPA-BhJ3kvHp.d.ts → useROPA-BSSU1rfx.d.ts} +14 -2
- package/dist/{useROPA-DLFdjkxP.d.mts → useROPA-C2hjaBTz.d.mts} +14 -2
- package/package.json +24 -3
- package/dist/chunk-2XFAV267.mjs +0 -2
- package/dist/chunk-32UIWTGD.js +0 -72
- package/dist/chunk-3YCV2BA6.js +0 -2
- package/dist/chunk-4A354HL3.js +0 -2
- package/dist/chunk-5ZBO2UPH.js +0 -2
- package/dist/chunk-6GGGTRDZ.mjs +0 -2
- package/dist/chunk-BZTTQS4A.mjs +0 -7
- package/dist/chunk-EKVTLHBQ.js +0 -2
- package/dist/chunk-GMLNWS2N.mjs +0 -2
- package/dist/chunk-IBEKLDBY.mjs +0 -2
- package/dist/chunk-ILCNDOBU.js +0 -2
- package/dist/chunk-K3GMTMQ6.js +0 -2
- package/dist/chunk-L52PDW6O.mjs +0 -2
- package/dist/chunk-LI6WJ3LZ.js +0 -2
- package/dist/chunk-LXRXDTPI.js +0 -2
- package/dist/chunk-NW4A3JW6.mjs +0 -2
- package/dist/chunk-OITITR6K.mjs +0 -2
- package/dist/chunk-PDJGTQMY.mjs +0 -2
- package/dist/chunk-T44JQT2O.mjs +0 -2
- package/dist/chunk-TCJCE6WN.js +0 -2
- package/dist/chunk-VMJBW3EF.mjs +0 -2
- package/dist/chunk-WSHSHIIM.mjs +0 -2
- package/dist/chunk-WW3X3ELF.js +0 -2
- package/dist/chunk-XMYUYQH7.mjs +0 -72
- package/dist/chunk-ZNTMZ6NM.js +0 -7
- package/dist/chunk-ZU73VG3X.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-AYKLAEOU.mjs';import {jsxs,jsx}from'react/jsx-runtime';var T=({sections:o,answers:p,onAnswerChange:n,currentSectionIndex:g,onNextSection:k,onPrevSection:h,validationErrors:N={},readOnly:i=false,className:w="",buttonClassName:y="",nextButtonText:$="Next",prevButtonText:P="Previous",submitButtonText:B="Submit",showProgress:A=true,progress:u,classNames:v={},unstyled:C=false})=>{let c=o[g],D=g===o.length-1,l=(e,s)=>{let r=s?v[s]:void 0;return !r&&s==="nextButton"&&(r=v.primaryButton),!r&&s==="prevButton"&&(r=v.secondaryButton),a(e,r,C)},I=e=>e.showWhen?e.showWhen.every(s=>{let r=p[s.questionId];switch(s.operator){case "equals":return r===s.value;case "contains":return Array.isArray(r)?r.includes(s.value):false;case "greaterThan":return typeof r=="number"?r>s.value:false;case "lessThan":return typeof r=="number"?r<s.value:false;default:return true}}):true,m=e=>l(`w-full px-3 py-2 border rounded-md ${e?"border-red-500":"border-gray-300 dark:border-gray-600"} focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100`,"input"),Q=e=>{if(!I(e))return null;let s=N[e.id],r=p[e.id];return jsxs("div",{className:l("mb-6","question"),children:[jsxs("div",{className:"mb-2",children:[jsxs("label",{htmlFor:e.id,className:l("block text-sm font-medium text-gray-900 dark:text-gray-100","questionText"),children:[e.text,e.required&&jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),e.guidance&&jsx("p",{className:l("mt-1 text-sm text-gray-600 dark:text-gray-400","guidance"),children:e.guidance})]}),e.type==="text"&&jsx("input",{type:"text",id:e.id,value:r||"",onChange:a=>n(e.id,a.target.value),disabled:i,className:m(s)}),e.type==="textarea"&&jsx("textarea",{id:e.id,value:r||"",onChange:a=>n(e.id,a.target.value),disabled:i,rows:4,className:m(s)}),e.type==="select"&&e.options&&jsxs("select",{id:e.id,value:r||"",onChange:a=>n(e.id,a.target.value),disabled:i,className:m(s),children:[jsx("option",{value:"",children:"Select an option"}),e.options.map(a=>jsx("option",{value:a.value,children:a.label},a.value))]}),e.type==="radio"&&e.options&&jsx("div",{className:l("space-y-2","radioGroup"),children:e.options.map(a=>jsxs("div",{className:l("flex items-center","radioOption"),children:[jsx("input",{type:"radio",id:`${e.id}_${a.value}`,name:e.id,value:a.value,checked:r===a.value,onChange:()=>n(e.id,a.value),disabled:i,className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] border-gray-300 dark:border-gray-600"}),jsxs("label",{htmlFor:`${e.id}_${a.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:[a.label,a.riskLevel&&jsxs("span",{className:`ml-2 text-xs px-2 py-1 rounded ${a.riskLevel==="low"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":a.riskLevel==="medium"?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:[a.riskLevel.charAt(0).toUpperCase()+a.riskLevel.slice(1)," Risk"]})]})]},a.value))}),e.type==="checkbox"&&e.options&&jsx("div",{className:"space-y-2",children:e.options.map(a=>jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"checkbox",id:`${e.id}_${a.value}`,value:a.value,checked:Array.isArray(r)?r.includes(a.value):false,onChange:b=>{let x=Array.isArray(r)?[...r]:[];b.target.checked?n(e.id,[...x,a.value]):n(e.id,x.filter(L=>L!==a.value));},disabled:i,className:"h-4 w-4 rounded text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] border-gray-300 dark:border-gray-600"}),jsx("label",{htmlFor:`${e.id}_${a.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:a.label})]},a.value))}),e.type==="scale"&&jsxs("div",{children:[jsx("div",{className:"flex justify-between mb-2",children:e.scaleLabels&&Object.entries(e.scaleLabels).map(([a,b])=>jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 text-center",style:{width:`${100/Object.keys(e.scaleLabels||{}).length}%`},children:b},a))}),jsx("input",{type:"range",id:e.id,min:e.minValue||1,max:e.maxValue||5,value:r||e.minValue||1,onChange:a=>n(e.id,parseInt(a.target.value,10)),disabled:i,className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"}),jsxs("div",{className:"mt-1 text-sm text-gray-600 dark:text-gray-400 text-center",children:["Selected value: ",r||e.minValue||1]})]}),s&&jsx("p",{className:"mt-1 text-sm text-red-500",children:s})]},e.id)};return c?jsxs("div",{className:`${l("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6","root")} ${w}`,children:[A&&jsxs("div",{className:l("mb-6","header"),children:[jsxs("div",{className:"flex justify-between text-sm text-gray-600 dark:text-gray-400 mb-1",children:[jsxs("span",{children:["Section ",g+1," of ",o.length]}),jsx("span",{children:u!==void 0?`${u}% Complete`:""})]}),jsx("div",{className:l("w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700","progressBar"),children:jsx("div",{className:"bg-[rgb(var(--ndpr-primary))] h-2.5 rounded-full",style:{width:`${u!==void 0?u:(g+1)/o.length*100}%`}})})]}),jsx("h2",{className:l("text-xl font-bold mb-2 text-gray-900 dark:text-white","title"),children:c.title}),c.description&&jsx("p",{className:l("mb-6 text-gray-600 dark:text-gray-300","sectionTitle"),children:c.description}),jsx("div",{className:l("space-y-6","section"),children:c.questions.map(e=>Q(e))}),jsxs("div",{className:l("mt-8 flex justify-between","navigation"),children:[jsx("button",{type:"button",onClick:h,disabled:g===0||i,className:`${l("px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 disabled:opacity-50 disabled:cursor-not-allowed","prevButton")} ${y}`,children:P}),jsx("button",{type:"button",onClick:k,disabled:i,className:`${l("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] disabled:opacity-50 disabled:cursor-not-allowed","nextButton")} ${y}`,children:D?B:$})]})]}):jsx("div",{children:"No section found."})};export{T as a};//# sourceMappingURL=chunk-V3MXWGXU.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-V3MXWGXU.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var p=["critical","high","medium","low"];function m(e){let i=new Date(e).getTime();return (Date.now()-i)/(1e3*60*60*24*30.44)}function u(e){if(e.length===0)return 100;let i=e.filter(t=>t.pass).length;return Math.round(i/e.length*100)}function f(e){return [{key:"hasConsentMechanism",label:"Consent collection mechanism",priority:"critical",effort:"high",recommendation:"Implement a clear, affirmative consent collection mechanism before processing personal data.",ndpaSection:"Section 25",pass:e.hasConsentMechanism},{key:"hasPurposeSpecification",label:"Purpose specification at collection",priority:"critical",effort:"medium",recommendation:"Specify and communicate the purpose of data collection at the point of consent.",ndpaSection:"Section 25",pass:e.hasPurposeSpecification},{key:"hasWithdrawalMechanism",label:"Consent withdrawal mechanism",priority:"high",effort:"medium",recommendation:"Provide a simple mechanism for data subjects to withdraw consent at any time.",ndpaSection:"Section 26",pass:e.hasWithdrawalMechanism},{key:"hasMinorProtection",label:"Minor (child) data protection controls",priority:"high",effort:"high",recommendation:"Implement age-verification and parental-consent controls for processing data of minors.",ndpaSection:"Section 26",pass:e.hasMinorProtection},{key:"consentRecordsRetained",label:"Consent records retained",priority:"medium",effort:"low",recommendation:"Retain records of all consents obtained, including what was agreed to and when.",ndpaSection:"Section 25",pass:e.consentRecordsRetained}]}function g(e){let i=e.responseTimelineDays<=30;return [{key:"hasRequestMechanism",label:"DSR submission mechanism",priority:"critical",effort:"high",recommendation:"Implement a formal channel (e.g. a web form or email address) for data subjects to submit requests.",ndpaSection:"Section 34",pass:e.hasRequestMechanism},{key:"supportsAccess",label:"Right of access supported",priority:"high",effort:"medium",recommendation:"Enable data subjects to request and receive a copy of their personal data.",ndpaSection:"Section 34",pass:e.supportsAccess},{key:"supportsRectification",label:"Right to rectification supported",priority:"high",effort:"medium",recommendation:"Allow data subjects to request correction of inaccurate or incomplete personal data.",ndpaSection:"Section 35",pass:e.supportsRectification},{key:"supportsErasure",label:"Right to erasure supported",priority:"high",effort:"high",recommendation:"Implement processes to delete personal data upon valid erasure requests.",ndpaSection:"Section 36",pass:e.supportsErasure},{key:"supportsPortability",label:"Right to data portability supported",priority:"medium",effort:"high",recommendation:"Provide personal data in a structured, machine-readable format upon request.",ndpaSection:"Section 37",pass:e.supportsPortability},{key:"supportsObjection",label:"Right to object supported",priority:"medium",effort:"medium",recommendation:"Honour objections to processing where no compelling legitimate grounds override the data subject's interests.",ndpaSection:"Section 38",pass:e.supportsObjection},{key:"responseTimeline",label:"DSR response within 30 days",priority:"high",effort:"medium",recommendation:"Reduce DSR response time to 30 days or less as required by the NDPA.",ndpaSection:"Section 39",pass:i}]}function y(e){return [{key:"conductedForHighRisk",label:"DPIA conducted for high-risk processing",priority:"critical",effort:"high",recommendation:"Conduct a Data Protection Impact Assessment before undertaking high-risk processing activities.",ndpaSection:"Section 28",pass:e.conductedForHighRisk},{key:"documentedRisks",label:"Risks documented in DPIA",priority:"high",effort:"medium",recommendation:"Document identified risks to data subjects' rights and freedoms within the DPIA.",ndpaSection:"Section 28",pass:e.documentedRisks},{key:"mitigationMeasures",label:"Mitigation measures documented",priority:"high",effort:"medium",recommendation:"Document mitigation measures and residual risk acceptance within the DPIA.",ndpaSection:"Section 28",pass:e.mitigationMeasures}]}function b(e){return [{key:"hasNotificationProcess",label:"Breach notification process in place",priority:"critical",effort:"high",recommendation:"Establish a documented breach notification process covering detection, assessment, and reporting.",ndpaSection:"Section 40",pass:e.hasNotificationProcess},{key:"notifiesWithin72Hours",label:"NDPC notified within 72 hours",priority:"critical",effort:"medium",recommendation:"Ensure the NDPC is notified of qualifying breaches within 72 hours of discovery.",ndpaSection:"Section 40",pass:e.notifiesWithin72Hours},{key:"hasRiskAssessment",label:"Breach risk assessment performed",priority:"high",effort:"medium",recommendation:"Perform a risk assessment for every identified breach to determine notification obligations.",ndpaSection:"Section 40",pass:e.hasRiskAssessment},{key:"hasRecordKeeping",label:"Breach records maintained",priority:"medium",effort:"low",recommendation:"Maintain a breach register documenting all incidents, assessments, and actions taken.",ndpaSection:"Section 40",pass:e.hasRecordKeeping}]}function S(e){let t=m(e.lastUpdated)<=13;return [{key:"hasPrivacyPolicy",label:"Privacy policy exists",priority:"critical",effort:"high",recommendation:"Draft and publish a comprehensive privacy policy that satisfies NDPA requirements.",ndpaSection:"Section 29",pass:e.hasPrivacyPolicy},{key:"isPubliclyAccessible",label:"Privacy policy publicly accessible",priority:"high",effort:"low",recommendation:"Make the privacy policy easily accessible to data subjects on your website or app.",ndpaSection:"Section 29",pass:e.isPubliclyAccessible},{key:"policyUpToDate",label:"Privacy policy reviewed within 13 months",priority:"medium",effort:"medium",recommendation:"Review and update the privacy policy at least annually to reflect current practices.",ndpaSection:"Section 29",pass:t},{key:"coversAllSections",label:"Privacy policy covers all required sections",priority:"high",effort:"medium",recommendation:"Ensure the privacy policy addresses all NDPA-mandated disclosures including lawful basis, retention, and subject rights.",ndpaSection:"Section 29",pass:e.coversAllSections}]}function R(e){return [{key:"documentedForAllProcessing",label:"Lawful basis documented for all processing",priority:"critical",effort:"high",recommendation:"Identify and document a valid lawful basis for every processing activity before it begins.",ndpaSection:"Section 25(1)",pass:e.documentedForAllProcessing},{key:"hasLegitimateInterestAssessment",label:"Legitimate interest assessment completed",priority:"medium",effort:"medium",recommendation:"Complete a Legitimate Interest Assessment (LIA) where legitimate interests is the chosen lawful basis.",ndpaSection:"Section 25(1)",pass:e.hasLegitimateInterestAssessment}]}function v(e){return [{key:"hasTransferMechanisms",label:"Transfer mechanisms in place",priority:"critical",effort:"high",recommendation:"Implement appropriate transfer mechanisms (SCCs, BCRs, or adequacy decisions) for all cross-border transfers.",ndpaSection:"Section 43",pass:e.hasTransferMechanisms},{key:"adequacyAssessed",label:"Adequacy of destination country assessed",priority:"high",effort:"medium",recommendation:"Assess whether the destination country provides an adequate level of data protection before transferring.",ndpaSection:"Section 43",pass:e.adequacyAssessed},{key:"ndpcApprovalObtained",label:"NDPC approval obtained where required",priority:"high",effort:"high",recommendation:"Obtain NDPC approval for transfers to countries without adequacy decisions where required.",ndpaSection:"Section 44",pass:e.ndpcApprovalObtained}]}function w(e){let t=m(e.lastReviewed)<=6;return [{key:"maintained",label:"Record of Processing Activities maintained",priority:"critical",effort:"high",recommendation:"Create and maintain a comprehensive Record of Processing Activities (ROPA) as required by the NDPA.",ndpaSection:"Section 30",pass:e.maintained},{key:"includesAllProcessing",label:"ROPA includes all processing activities",priority:"high",effort:"medium",recommendation:"Ensure the ROPA captures every processing activity across all departments and systems.",ndpaSection:"Section 30",pass:e.includesAllProcessing},{key:"ropaUpToDate",label:"ROPA reviewed within 6 months",priority:"medium",effort:"low",recommendation:"Review and update the ROPA at least every six months to reflect changes in processing activities.",ndpaSection:"Section 30",pass:t}]}var k=[{name:"consent",weight:.2,ndpaSections:["Section 25","Section 26"],evaluate:e=>f(e.consent)},{name:"dsr",weight:.15,ndpaSections:["Section 34","Section 35","Section 36","Section 37","Section 38","Section 39"],evaluate:e=>g(e.dsr)},{name:"breach",weight:.15,ndpaSections:["Section 40"],evaluate:e=>b(e.breach)},{name:"policy",weight:.12,ndpaSections:["Section 29"],evaluate:e=>S(e.policy)},{name:"dpia",weight:.12,ndpaSections:["Section 28"],evaluate:e=>y(e.dpia)},{name:"lawfulBasis",weight:.1,ndpaSections:["Section 25(1)"],evaluate:e=>R(e.lawfulBasis)},{name:"crossBorder",weight:.08,ndpaSections:["Section 43","Section 44"],evaluate:e=>v(e.crossBorder)},{name:"ropa",weight:.08,ndpaSections:["Section 30"],evaluate:e=>w(e.ropa)}];function P(e){return e>=90?"excellent":e>=70?"good":e>=40?"needs-work":"critical"}function A(e){let i={},t=[],s=0;for(let o of k){let a=o.evaluate(e),c=u(a),l=c*o.weight;s+=l;let d=[];for(let n of a)n.pass||(d.push(n.label),t.push({module:o.name,key:n.key,label:n.label,priority:n.priority,effort:n.effort,recommendation:n.recommendation,ndpaSection:n.ndpaSection}));i[o.name]={name:o.name,score:c,maxScore:100,weightedScore:Math.round(l*100)/100,ndpaSections:o.ndpaSections,gaps:d};}t.sort((o,a)=>p.indexOf(o.priority)-p.indexOf(a.priority));let r=Math.round(s),h=[{section:"Section 25",title:"Consent and lawful basis for processing"},{section:"Section 26",title:"Withdrawal of consent and minor protection"},{section:"Section 28",title:"Data Protection Impact Assessment"},{section:"Section 29",title:"Privacy notice requirements"},{section:"Section 30",title:"Records of processing activities"},{section:"Section 34",title:"Right of access"},{section:"Section 35",title:"Right to rectification"},{section:"Section 36",title:"Right to erasure"},{section:"Section 37",title:"Right to data portability"},{section:"Section 38",title:"Right to object"},{section:"Section 39",title:"Response timelines for data subject requests"},{section:"Section 40",title:"Data breach notification"},{section:"Section 43",title:"Cross-border transfer restrictions"},{section:"Section 44",title:"NDPC approval for cross-border transfers"}];return {score:r,rating:P(r),modules:i,recommendations:t,regulatoryReferences:h,generatedAt:new Date().toISOString()}}exports.a=A;//# sourceMappingURL=chunk-VDZKGCAF.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-VDZKGCAF.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b as b$1,c,d}from'./chunk-PYEX7DFR.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function E({initialData:S,adapter:l,onRecordAdd:p,onRecordUpdate:g,onRecordArchive:f}){let d$1=useRef(l);d$1.current=l;let[s,u]=useState(S),[v,P]=useState(l!==void 0);useEffect(()=>{if(!d$1.current)return;let t=false;try{let e=d$1.current.load();e instanceof Promise?e.then(r=>{t||(r&&u(r),P(!1));},()=>{t||P(!1);}):(e&&u(e),P(!1));}catch(e){t||P(false);}return ()=>{t=true;}},[]);let n=useCallback(t=>{d$1.current&&Promise.resolve(d$1.current.save(t)).catch(e=>{console.warn("[ndpr-toolkit] Failed to save ROPA:",e);});},[]),C=useCallback(t=>{u(e=>{let r=b(a({},e),{records:[...e.records,t],lastUpdated:Date.now()});return n(r),r}),p==null||p(t);},[p,n]),w=useCallback((t,e)=>{u(r=>{let a$1=b(a({},r),{records:r.records.map(R=>R.id===t?b(a(a({},R),e),{updatedAt:Date.now()}):R),lastUpdated:Date.now()});return n(a$1),a$1}),g==null||g(t,e);},[g,n]),x=useCallback(t=>{u(e=>{let r=b(a({},e),{records:e.records.map(a$1=>a$1.id===t?b(a({},a$1),{status:"archived",updatedAt:Date.now()}):a$1),lastUpdated:Date.now()});return n(r),r}),f==null||f(t);},[f,n]),D=useCallback(t=>s.records.find(e=>e.id===t),[s.records]),G=useCallback(()=>b$1(s),[s]),b$2=useCallback(()=>c(s),[s]),L=useCallback(()=>d(s),[s]);return {ropa:s,addRecord:C,updateRecord:w,archiveRecord:x,getRecord:D,getSummary:G,exportCSV:b$2,getComplianceGaps:L,isLoading:v}}export{E as a};//# sourceMappingURL=chunk-WLSW4Z4W.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-WLSW4Z4W.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-2SYNHRP6.mjs';import {a as a$2}from'./chunk-SBNAMPAP.mjs';import {b,a as a$1,c}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function _(c,a){return a?a$2(c):{load:()=>null,save:()=>{},remove:()=>{}}}function Q({initialRequests:c$1=[],requestTypes:a$2,adapter:S,storageKey:h="ndpr_dsr_requests",useLocalStorage:P=true,onSubmit:D,onUpdate:f}){let m=S!=null?S:_(h,P),i=useRef(m);i.current=m;let[q,r]=useState(c$1),[x,d]=useState(true);useEffect(()=>{let e=false;try{let t=i.current.load();t instanceof Promise?t.then(s=>{e||(s&&r(s),d(!1));},()=>{e||d(!1);}):(t&&r(t),d(!1));}catch(t){e||d(false);}return ()=>{e=true;}},[]);let g=useCallback(e=>{Promise.resolve(i.current.save(e)).catch(t=>{console.warn("[ndpr-toolkit] Failed to save DSR requests:",t);});},[]),I=()=>"dsr_"+Date.now()+"_"+Math.random().toString(36).substr(2,9);return {requests:q,submitRequest:e=>{let t=a$2.find(p=>p.id===e.type),s=(t==null?void 0:t.estimatedCompletionTime)||30,u=Date.now(),n=u+s*24*60*60*1e3,A=e,{createdAt:y}=A,o=c(A,["createdAt"]),R=a$1({id:I(),status:"pending",createdAt:u,updatedAt:u,dueDate:n},o);return r(p=>{let b=[...p,R];return g(b),b}),D&&D(R),R},updateRequest:(e,t)=>{let s=null;return r(u=>{let n=u.findIndex(R=>R.id===e);if(n===-1)return u;let y=u[n];s=b(a$1(a$1({},y),t),{updatedAt:Date.now()});let o=[...u];return o[n]=s,g(o),o}),s&&f&&f(s),s},getRequest:e=>q.find(t=>t.id===e)||null,getRequestsByStatus:e=>q.filter(t=>t.status===e),getRequestsByType:e=>q.filter(t=>t.type===e),getRequestType:e=>a$2.find(t=>t.id===e),formatRequest:e=>{let{formattedRequest:t}=a(e);return t},clearRequests:()=>{r([]),Promise.resolve(i.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove DSR requests:",e);});},isLoading:x}}export{Q as a};//# sourceMappingURL=chunk-XSK4BSZJ.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-XSK4BSZJ.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function p(t){return {load(){if(typeof window=="undefined")return null;try{let n=sessionStorage.getItem(t);return n?JSON.parse(n):null}catch(n){return null}},save(n){typeof window!="undefined"&&sessionStorage.setItem(t,JSON.stringify(n));},remove(){typeof window!="undefined"&&sessionStorage.removeItem(t);}}}function f(t,n={}){let{domain:r,path:a="/",expires:s=365,secure:d=true,sameSite:u="Lax"}=n;return {load(){if(typeof document=="undefined")return null;try{let e=document.cookie.split(";").map(o=>o.trim()).find(o=>o.startsWith(`${t}=`));return e?JSON.parse(decodeURIComponent(e.split("=")[1])):null}catch(e){return null}},save(e){if(typeof document=="undefined")return;let o=new Date;o.setDate(o.getDate()+s);let i=`${t}=${encodeURIComponent(JSON.stringify(e))}; path=${a}; expires=${o.toUTCString()}; samesite=${u}`;r&&(i+=`; domain=${r}`),d&&(i+="; secure"),document.cookie=i;},remove(){if(typeof document=="undefined")return;let e=`${t}=; path=${a}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;r&&(e+=`; domain=${r}`),document.cookie=e;}}}export{p as a,f as b};//# sourceMappingURL=chunk-YJCGEOLO.mjs.map
|
|
2
|
+
//# sourceMappingURL=chunk-YJCGEOLO.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkSSGJREE3_js=require('./chunk-SSGJREE3.js'),chunkUK656RCG_js=require('./chunk-UK656RCG.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function H(a,A){return A?chunkUK656RCG_js.a(a):{load:()=>null,save:()=>{},remove:()=>{}}}function Y({sections:a,initialAnswers:A={},adapter:h,storageKey:E="ndpr_dpia_data",useLocalStorage:T=true,onComplete:I}){let w=h!=null?h:H(E,T),d=react.useRef(w);d.current=w;let[f,g]=react.useState(0),[o,p]=react.useState(A),[C,m]=react.useState(true);react.useEffect(()=>{let r=false;try{let s=d.current.load();s instanceof Promise?s.then(e=>{r||(e&&p(e),m(!1));},()=>{r||m(!1);}):(s&&p(s),m(!1));}catch(s){r||m(false);}return ()=>{r=true;}},[]);let c=a[f]||null,W=r=>{Promise.resolve(d.current.save(r)).catch(s=>{console.warn("[ndpr-toolkit] Failed to save DPIA answers:",s);});},_=(r,s)=>{p(e=>{let t=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{[r]:s});return W(t),t});},b=r=>r.showWhen?r.showWhen.every(s=>{let e=o[s.questionId];switch(s.operator){case "equals":return e===s.value;case "contains":return Array.isArray(e)?e.includes(s.value):false;case "greaterThan":return typeof e=="number"?e>s.value:false;case "lessThan":return typeof e=="number"?e<s.value:false;default:return true}}):true,v=()=>c?c.questions.filter(b):[],P=()=>c?v().every(s=>{if(!s.required)return true;let e=o[s.id];return !(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0)}):false,$=()=>{let r={};return c&&v().forEach(e=>{if(!e.required)return;let t=o[e.id];t==null||typeof t=="string"&&t.trim()===""?r[e.id]="This question is required":Array.isArray(t)&&t.length===0&&(r[e.id]="At least one option must be selected");}),r},O=()=>P()&&f<a.length-1?(g(r=>r+1),true):false,U=()=>f>0?(g(r=>r-1),true):false,V=r=>r>=0&&r<a.length?(g(r),true):false,B=()=>a.every(r=>r.questions.filter(e=>!e.showWhen||e.showWhen.length===0?true:e.showWhen.some(t=>{let n=o[t.questionId];switch(t.operator){case "equals":return n===t.value;case "contains":return Array.isArray(n)&&n.includes(t.value);case "greaterThan":return typeof n=="number"&&n>t.value;case "lessThan":return typeof n=="number"&&n<t.value;default:return false}})).every(e=>{if(!e.required)return true;let t=o[e.id];return !(t==null||typeof t=="string"&&t.trim()===""||Array.isArray(t)&&t.length===0)})),F=()=>{let r=[];return a.forEach(s=>{s.questions.forEach(e=>{let t=o[e.id];if(t!=null&&e.riskLevel)if(["select","radio","checkbox"].includes(e.type)&&e.options)(Array.isArray(t)?t:[t]).forEach(i=>{var D;let l=(D=e.options)==null?void 0:D.find(u=>u.value===i);if(l!=null&&l.riskLevel){let u=l.riskLevel,R=u==="low"?1:u==="medium"?3:5,S=u==="low"?1:u==="medium"?3:5;r.push({id:`risk_${r.length+1}`,description:`${e.text} - ${l.label}`,likelihood:R,impact:S,score:R*S,level:u,mitigated:false,relatedQuestionIds:[e.id]});}});else {let n=e.riskLevel,i=n==="low"?1:n==="medium"?3:5,l=n==="low"?1:n==="medium"?3:5;r.push({id:`risk_${r.length+1}`,description:e.text,likelihood:i,impact:l,score:i*l,level:n,mitigated:false,relatedQuestionIds:[e.id]});}});}),r},K=(r,s,e)=>{let t=F(),n={id:`dpia_${Date.now()}`,title:s,processingDescription:e,startedAt:Date.now(),completedAt:Date.now(),assessor:r,answers:o,risks:t,overallRiskLevel:"low",canProceed:true,conclusion:"",version:"1.0"},i=chunkSSGJREE3_js.a(n);return n.overallRiskLevel=i.overallRiskLevel,n.canProceed=i.canProceed,n.conclusion=i.canProceed?"Based on the assessment, the processing can proceed with appropriate safeguards.":"Based on the assessment, the processing should not proceed without further mitigation measures.",n.recommendations=i.recommendations,I&&I(n),n},M=()=>{p({}),g(0),Promise.resolve(d.current.remove()).catch(r=>{console.warn("[ndpr-toolkit] Failed to remove DPIA data:",r);});},j=(()=>{let r=0,s=0;return a.forEach(e=>{e.questions.forEach(t=>{if(t.required&&b(t)){s++;let n=o[t.id];n!=null&&!(typeof n=="string"&&n.trim()==="")&&!(Array.isArray(n)&&n.length===0)&&r++;}});}),s>0?Math.round(r/s*100):0})();return {currentSectionIndex:f,currentSection:c,answers:o,updateAnswer:_,nextSection:O,prevSection:U,goToSection:V,isCurrentSectionValid:P,getCurrentSectionErrors:$,isComplete:B,completeDPIA:K,getVisibleQuestions:v,resetDPIA:M,progress:j,isLoading:C}}exports.a=Y;//# sourceMappingURL=chunk-ZCZ5RRZO.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-ZCZ5RRZO.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import {e}from'./chunk-TKBZRULW.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {d,b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import Gr,{useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var vr=["Organization","Data Collection","Processing","Review & Export"],ur=({currentStep:n,classNames:d,unstyled:r})=>jsx("div",{"data-ndpr-component":"policy-step-indicator",className:a("w-full flex items-center justify-between px-2 py-4",d==null?void 0:d.root,r),children:vr.map((o,p)=>{let t=p+1,i=t<n,v=t===n,h=p===vr.length-1;return jsxs(Gr.Fragment,{children:[jsxs("div",{className:a("flex flex-col items-center gap-1",d==null?void 0:d.stepWrapper,r),children:[jsx("div",{"aria-current":v?"step":void 0,className:a(["flex items-center justify-center rounded-full border-2 font-semibold transition-all",i?"w-8 h-8 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))]":v?"w-9 h-9 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] shadow-md":"w-8 h-8 bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-600 text-gray-400 dark:text-gray-500"].join(" "),i?d==null?void 0:d.stepCompleted:v?d==null?void 0:d.stepCurrent:d==null?void 0:d.stepUpcoming,r),children:i?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(["text-xs font-medium hidden sm:block",i||v?"text-[rgb(var(--ndpr-primary))]":"text-gray-400 dark:text-gray-500"].join(" "),d==null?void 0:d.stepLabel,r),children:o})]}),!h&&jsx("div",{className:a(["flex-1 h-0.5 mx-2",i?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-700"].join(" "),d==null?void 0:d.connector,r),"aria-hidden":"true"})]},t)})});var F="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",Ur="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",A=({label:n,required:d,children:r,classNames:o,unstyled:p})=>jsxs("div",{className:a("flex flex-col",o==null?void 0:o.field,p),children:[jsxs("label",{className:a(Ur,o==null?void 0:o.label,p),children:[n,d&&jsx("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),r]}),yr=({context:n,onUpdateOrg:d,classNames:r,unstyled:o})=>{var t,i,v;let p=n.org;return jsxs("div",{"data-ndpr-component":"policy-step-about",className:a("space-y-6",r==null?void 0:r.root,o),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Organisation Details"}),jsxs("p",{className:a("text-sm text-gray-500 dark:text-gray-400 mt-1",r==null?void 0:r.subheading,o),children:["Tell us about your organisation. Fields marked ",jsx("span",{className:"text-red-500",children:"*"})," are required."]})]}),jsxs("div",{className:a("grid grid-cols-1 md:grid-cols-2 gap-4",r==null?void 0:r.grid,o),children:[jsx(A,{label:"Organisation Name",required:true,classNames:r,unstyled:o,children:jsx("input",{type:"text",value:p.name,onChange:x=>d({name:x.target.value}),placeholder:"Acme Corporation",className:a(F,r==null?void 0:r.input,o),"aria-required":"true"})}),jsx(A,{label:"Website",required:true,classNames:r,unstyled:o,children:jsx("input",{type:"url",value:p.website,onChange:x=>d({website:x.target.value}),placeholder:"https://example.com",className:a(F,r==null?void 0:r.input,o),"aria-required":"true"})}),jsx(A,{label:"Privacy Contact Email",required:true,classNames:r,unstyled:o,children:jsx("input",{type:"email",value:p.privacyEmail,onChange:x=>d({privacyEmail:x.target.value}),placeholder:"privacy@example.com",className:a(F,r==null?void 0:r.input,o),"aria-required":"true"})}),jsx(A,{label:"Industry",classNames:r,unstyled:o,children:jsxs("select",{value:p.industry,onChange:x=>d({industry:x.target.value}),className:a(F,r==null?void 0:r.select,o),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,{label:"Data Protection Officer (DPO) Name",classNames:r,unstyled:o,children:jsx("input",{type:"text",value:(t=p.dpoName)!=null?t:"",onChange:x=>d({dpoName:x.target.value}),placeholder:"Jane Smith",className:a(F,r==null?void 0:r.input,o)})}),jsx(A,{label:"DPO Email",classNames:r,unstyled:o,children:jsx("input",{type:"email",value:(i=p.dpoEmail)!=null?i:"",onChange:x=>d({dpoEmail:x.target.value}),placeholder:"dpo@example.com",className:a(F,r==null?void 0:r.input,o)})}),jsx(A,{label:"Registered Address",classNames:r,unstyled:o,children:jsx("input",{type:"text",value:(v=p.address)!=null?v:"",onChange:x=>d({address:x.target.value}),placeholder:"1 Victoria Island, Lagos, Nigeria",className:a(F,r==null?void 0:r.input,o)})}),jsx(A,{label:"Organisation Size",classNames:r,unstyled:o,children:jsxs("select",{value:p.orgSize,onChange:x=>d({orgSize:x.target.value}),className:a(F,r==null?void 0:r.select,o),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,{label:"Country of Operation",classNames:r,unstyled:o,children:jsx("input",{type:"text",value:p.country,onChange:x=>d({country:x.target.value}),placeholder:"Nigeria",className:a(F,r==null?void 0:r.input,o)})})]})]})};var Vr={identity:"Identity",financial:"Financial",behavioral:"Behavioural",sensitive:"Sensitive",children:"Children"},Xr=["identity","financial","behavioral","sensitive","children"],Yr=["sensitive","children"],hr=({categories:n,onToggle:d,classNames:r,unstyled:o})=>{let p=Xr.reduce((t,i)=>{let v=n.filter(x=>x.group===i);return v.length>0&&(t[i]=v),t},{});return jsxs("div",{"data-ndpr-component":"policy-step-data",className:a("space-y-8",r==null?void 0:r.root,o),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Data Categories"}),jsx("p",{className:a("text-sm text-gray-500 dark:text-gray-400 mt-1",r==null?void 0:r.subheading,o),children:"Select the categories of personal data your organisation collects. You must select at least one."})]}),Object.entries(p).map(([t,i])=>{let v=Yr.includes(t);return jsxs("div",{className:a("space-y-3",r==null?void 0:r.group,o),children:[jsxs("div",{className:a("flex items-center gap-2",r==null?void 0:r.groupHeader,o),children:[jsx("h3",{className:a("text-sm font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",r==null?void 0:r.groupTitle,o),children:Vr[t]}),v&&jsx("span",{className:a("text-xs font-medium text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20 px-2 py-0.5 rounded-full",r==null?void 0:r.sensitiveTag,o),children:"Sensitive"})]}),v&&jsx("p",{className:a("text-xs text-amber-700 dark:text-amber-400",r==null?void 0:r.sensitiveWarning,o),children:t==="children"?"Processing children's data requires parental consent under NDPA Section 31 and imposes heightened obligations.":"Sensitive/special-category data requires explicit consent and additional safeguards under NDPA Section 30."}),jsx("div",{className:a("grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",r==null?void 0:r.cardsGrid,o),children:i.map(x=>jsx("button",{type:"button",onClick:()=>d(x.id),"aria-pressed":x.selected,className:a(["text-left rounded-lg border p-4 transition-all cursor-pointer focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",x.selected?"bg-[rgb(var(--ndpr-primary))]/5 border-[rgb(var(--ndpr-primary))] dark:bg-[rgb(var(--ndpr-primary))]/10":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"].join(" "),r==null?void 0:r.card,o),children:jsxs("div",{className:"flex items-start gap-3",children:[jsx("div",{className:a(["mt-0.5 w-4 h-4 rounded border-2 flex-shrink-0 flex items-center justify-center",x.selected?"bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))]":"border-gray-300 dark:border-gray-600"].join(" "),r==null?void 0:r.checkbox,o),"aria-hidden":"true",children:x.selected&&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("text-sm font-medium text-gray-900 dark:text-gray-100",r==null?void 0:r.cardLabel,o),children:x.label}),jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400 mt-1 leading-relaxed",r==null?void 0:r.cardDataPoints,o),children:x.dataPoints.join(", ")})]})]})},x.id))})]},t)})]})};var Jr=[{value:"service_delivery",label:"Service Delivery",description:"Processing required to deliver the core product or service."},{value:"marketing",label:"Marketing & Communications",description:"Sending promotional messages, newsletters or offers."},{value:"analytics",label:"Analytics & Insights",description:"Analysing usage patterns to improve the product."},{value:"research",label:"Research & Development",description:"Using data to develop new features or products."},{value:"legal_compliance",label:"Legal Compliance",description:"Meeting statutory, regulatory or contractual obligations."},{value:"fraud_prevention",label:"Fraud Prevention & Security",description:"Detecting and preventing fraudulent activity."}],dr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",pr="bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-4",gr=({id:n,checked:d,onChange:r})=>jsx("button",{id:n,type:"button",role:"switch","aria-checked":d,onClick:()=>r(!d),className:["relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent cursor-pointer transition-colors focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",d?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-600"].join(" "),children:jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition-transform",d?"translate-x-5":"translate-x-0"].join(" ")})}),lr=({context:n,onTogglePurpose:d,onUpdateContext:r,onAddProcessor:o,onRemoveProcessor:p,classNames:t,unstyled:i})=>{let[v,x]=useState({name:"",purpose:"",country:""}),[h,c]=useState(false),a$2=()=>{let{name:g,purpose:u,country:P}=v;!g.trim()||!u.trim()||!P.trim()||(o({name:g.trim(),purpose:u.trim(),country:P.trim()}),x({name:"",purpose:"",country:""}),c(false));};return jsxs("div",{"data-ndpr-component":"policy-step-processing",className:a("space-y-6",t==null?void 0:t.root,i),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.heading,i),children:"Processing Details"}),jsx("p",{className:a("text-sm text-gray-500 dark:text-gray-400 mt-1",t==null?void 0:t.subheading,i),children:"Define how and why you process personal data."})]}),jsxs("section",{className:a(pr,t==null?void 0:t.section,i),"aria-labelledby":"purposes-heading",children:[jsx("h3",{id:"purposes-heading",className:a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Processing Purposes"}),jsx("p",{className:a("text-sm text-gray-500 dark:text-gray-400",t==null?void 0:t.sectionDescription,i),children:"Select all purposes for which you process personal data. At least one is required."}),jsx("div",{className:a("space-y-3",t==null?void 0:t.purposeList,i),children:Jr.map(g=>{let u=n.purposes.includes(g.value);return jsxs("label",{className:a("flex items-start gap-3 cursor-pointer group",t==null?void 0:t.purposeItem,i),children:[jsx("input",{type:"checkbox",checked:u,onChange:()=>d(g.value),className:a("mt-0.5 h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] cursor-pointer",t==null?void 0:t.purposeCheckbox,i)}),jsxs("div",{children:[jsx("p",{className:a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.purposeLabel,i),children:g.label}),jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400",t==null?void 0:t.purposeDescription,i),children:g.description})]})]},g.value)})})]}),jsxs("section",{className:a(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("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Third-Party Data Sharing"}),jsx(gr,{id:"thirdparty-toggle",checked:n.thirdPartyProcessors.length>0||h,onChange:g=>{g?c(true):(n.thirdPartyProcessors.forEach((u,P)=>p(0)),c(false));}})]}),(n.thirdPartyProcessors.length>0||h)&&jsxs("div",{className:a("space-y-4",t==null?void 0:t.processorSection,i),children:[n.thirdPartyProcessors.length>0&&jsx("div",{className:a("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("text-left text-xs font-medium text-gray-500 dark:text-gray-400 border-b border-gray-200 dark:border-gray-700",t==null?void 0:t.tableHeader,i),children:[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:n.thirdPartyProcessors.map((g,u)=>jsxs("tr",{children:[jsx("td",{className:a("py-2 pr-4 text-gray-900 dark:text-gray-100",t==null?void 0:t.tableCell,i),children:g.name}),jsx("td",{className:a("py-2 pr-4 text-gray-700 dark:text-gray-300",t==null?void 0:t.tableCell,i),children:g.purpose}),jsx("td",{className:a("py-2 pr-4 text-gray-700 dark:text-gray-300",t==null?void 0:t.tableCell,i),children:g.country}),jsx("td",{className:"py-2",children:jsx("button",{type:"button",onClick:()=>p(u),className:a("text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 text-xs font-medium",t==null?void 0:t.removeButton,i),"aria-label":`Remove ${g.name}`,children:"Remove"})})]},u))})]})}),h?jsxs("div",{className:a("grid grid-cols-1 sm:grid-cols-3 gap-3 items-end",t==null?void 0:t.processorForm,i),children:[jsx("input",{type:"text",placeholder:"Processor name",value:v.name,onChange:g=>x(u=>b(a$1({},u),{name:g.target.value})),className:a(dr,t==null?void 0:t.input,i)}),jsx("input",{type:"text",placeholder:"Purpose",value:v.purpose,onChange:g=>x(u=>b(a$1({},u),{purpose:g.target.value})),className:a(dr,t==null?void 0:t.input,i)}),jsx("input",{type:"text",placeholder:"Country",value:v.country,onChange:g=>x(u=>b(a$1({},u),{country:g.target.value})),className:a(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$2,className:a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",t==null?void 0:t.addButton,i),children:"Add Processor"}),jsx("button",{type:"button",onClick:()=>c(false),className:a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm",t==null?void 0:t.cancelButton,i),children:"Cancel"})]})]}):jsxs("button",{type:"button",onClick:()=>c(true),className:a("flex items-center gap-1 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",t==null?void 0:t.addLink,i),children:[jsx("span",{"aria-hidden":"true",children:"+"})," Add processor"]})]})]}),jsxs("section",{className:a(pr,t==null?void 0:t.section,i),"aria-labelledby":"disclosures-heading",children:[jsx("h3",{id:"disclosures-heading",className:a("text-base font-semibold text-gray-900 dark:text-gray-100",t==null?void 0:t.sectionTitle,i),children:"Additional Disclosures"}),jsxs("div",{className:a("space-y-4",t==null?void 0:t.disclosureList,i),children:[jsxs("div",{className:a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxs("div",{children:[jsx("p",{className:a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.disclosureLabel,i),children:"Cross-border Data Transfers"}),jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you transfer personal data outside Nigeria? This triggers NDPA Chapter 6 obligations."})]}),jsx(gr,{id:"cross-border-toggle",checked:n.hasCrossBorderTransfer,onChange:g=>r({hasCrossBorderTransfer:g})})]}),jsxs("div",{className:a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxs("div",{children:[jsx("p",{className:a("text-sm font-medium text-gray-900 dark:text-gray-100",t==null?void 0:t.disclosureLabel,i),children:"Automated Decision-Making / Profiling"}),jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you use algorithms or AI to make decisions about individuals? Requires disclosure under NDPA Section 37."})]}),jsx(gr,{id:"automated-toggle",checked:n.hasAutomatedDecisions,onChange:g=>r({hasAutomatedDecisions:g})})]})]})]})]})};var kr=({section:n,index:d,isCustom:r,isEditing:o,editedContent:p,onEdit:t,onSaveEdit:i,onCancelEdit:v,onMoveUp:x,onMoveDown:h,onDelete:c,classNames:a$1,unstyled:g})=>{let[u,P]=useState(p!=null?p:n.template);return useEffect(()=>{p!==void 0&&P(p);},[p]),useEffect(()=>{o&&P(p!=null?p:n.template);},[o,p,n.template]),jsxs("div",{"data-ndpr-component":"policy-section-card",className:a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-3",a$1==null?void 0:a$1.root,g),children:[jsxs("div",{className:a("flex items-start justify-between gap-2",a$1==null?void 0:a$1.header,g),children:[jsxs("div",{className:a("flex items-center gap-3 min-w-0",a$1==null?void 0:a$1.titleRow,g),children:[jsx("span",{className:a("flex-shrink-0 w-7 h-7 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 text-xs font-semibold flex items-center justify-center",a$1==null?void 0:a$1.sectionNumber,g),"aria-hidden":"true",children:d+1}),jsxs("h4",{className:a("text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",a$1==null?void 0:a$1.sectionTitle,g),children:[n.title,r&&jsx("span",{className:a("ml-2 text-xs font-normal text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded",a$1==null?void 0:a$1.customBadge,g),children:"Custom"})]})]}),jsxs("div",{className:a("flex items-center gap-1 flex-shrink-0",a$1==null?void 0:a$1.actions,g),children:[x&&jsx("button",{type:"button",onClick:x,className:a("p-1.5 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",a$1==null?void 0:a$1.moveButton,g),"aria-label":`Move "${n.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"})})}),h&&jsx("button",{type:"button",onClick:h,className:a("p-1.5 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",a$1==null?void 0:a$1.moveButton,g),"aria-label":`Move "${n.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"})})}),!o&&jsx("button",{type:"button",onClick:t,className:a("p-1.5 text-gray-400 hover:text-[rgb(var(--ndpr-primary))] rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",a$1==null?void 0:a$1.editButton,g),"aria-label":`Edit "${n.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("p-1.5 text-gray-400 hover:text-red-500 dark:hover:text-red-400 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",a$1==null?void 0:a$1.deleteButton,g),"aria-label":`Delete "${n.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"})})})]})]}),o?jsxs("div",{className:a("space-y-2",a$1==null?void 0:a$1.editArea,g),children:[jsx("textarea",{value:u,onChange:z=>P(z.target.value),rows:8,className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm font-mono resize-y",a$1==null?void 0:a$1.textarea,g),"aria-label":`Edit content for ${n.title}`}),jsxs("div",{className:a("flex gap-2",a$1==null?void 0:a$1.editActions,g),children:[jsx("button",{type:"button",onClick:()=>i(u),className:a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",a$1==null?void 0:a$1.saveButton,g),children:"Save"}),jsx("button",{type:"button",onClick:v,className:a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm",a$1==null?void 0:a$1.cancelButton,g),children:"Cancel"})]})]}):jsx("div",{className:a("text-sm text-gray-600 dark:text-gray-300 leading-relaxed line-clamp-4 whitespace-pre-wrap",a$1==null?void 0:a$1.content,g),children:n.template})]})};var Cr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",wr=({onAdd:n,nextOrder:d,classNames:r,unstyled:o})=>{let[p,t]=useState(""),[i,v]=useState(""),[x,h]=useState(""),c=()=>{if(!p.trim()){h("Section title is required.");return}if(!i.trim()){h("Section content is required.");return}h(""),n({title:p.trim(),content:i.trim(),order:d}),t(""),v("");};return jsxs("div",{"data-ndpr-component":"custom-section-form",className:a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-4",r==null?void 0:r.root,o),children:[jsx("h4",{className:a("text-sm font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.heading,o),children:"Add Custom Section"}),x&&jsx("p",{role:"alert",className:a("text-xs text-red-600 dark:text-red-400",r==null?void 0:r.error,o),children:x}),jsxs("div",{className:a("space-y-3",r==null?void 0:r.fields,o),children:[jsxs("div",{children:[jsxs("label",{htmlFor:"custom-section-title",className:a("block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",r==null?void 0:r.label,o),children:["Section Title ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsx("input",{id:"custom-section-title",type:"text",value:p,onChange:a=>{t(a.target.value),x&&h("");},placeholder:"e.g. Cookie Policy",className:a(Cr,r==null?void 0:r.input,o),"aria-required":"true"})]}),jsxs("div",{children:[jsxs("label",{htmlFor:"custom-section-content",className:a("block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1",r==null?void 0:r.label,o),children:["Content ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsx("textarea",{id:"custom-section-content",value:i,onChange:a=>{v(a.target.value),x&&h("");},placeholder:"Write the section content here...",rows:5,className:a(`${Cr} resize-y`,r==null?void 0:r.textarea,o),"aria-required":"true"})]})]}),jsx("div",{className:a("flex items-center gap-2",r==null?void 0:r.footer,o),children:jsx("button",{type:"button",onClick:c,className:a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium",r==null?void 0:r.addButton,o),children:"Add Section"})})]})};var Sr={compliant:{bg:"bg-green-50 dark:bg-green-900/20",text:"text-green-700 dark:text-green-300",border:"border-green-200 dark:border-green-700"},nearly_compliant:{bg:"bg-amber-50 dark:bg-amber-900/20",text:"text-amber-700 dark:text-amber-300",border:"border-amber-200 dark:border-amber-700"},not_compliant:{bg:"bg-red-50 dark:bg-red-900/20",text:"text-red-700 dark:text-red-300",border:"border-red-200 dark:border-red-700"}},Qr={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},N=({icon:n,label:d,description:r,actionLabel:o,loading:p,onClick:t,classNames:i,unstyled:v})=>jsxs("div",{className:a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex flex-col gap-3",i==null?void 0:i.formatCard,v),children:[jsxs("div",{className:a("flex items-center gap-3",i==null?void 0:i.formatHeader,v),children:[jsx("div",{className:a("w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center flex-shrink-0",i==null?void 0:i.formatIcon,v),"aria-hidden":"true",children:n}),jsxs("div",{className:"min-w-0",children:[jsx("p",{className:a("text-sm font-semibold text-gray-900 dark:text-gray-100",i==null?void 0:i.formatLabel,v),children:d}),jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400",i==null?void 0:i.formatDescription,v),children:r})]})]}),jsx("button",{type:"button",onClick:t,disabled:p,className:a("w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2",i==null?void 0:i.formatButton,v),children:p?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"]}):o})]}),mr=({complianceResult:n,onExportPDF:d$1,onExportDOCX:r,onExportHTML:o,onExportMarkdown:p,classNames:t,unstyled:i})=>{var P;let[v,x]=useState(false),[h,c]=useState(false),a$1=(P=Sr[n.rating])!=null?P:Sr.not_compliant,g=()=>d(null,null,function*(){x(true);try{yield d$1();}finally{x(false);}}),u=()=>d(null,null,function*(){c(true);try{yield r();}finally{c(false);}});return jsxs("div",{"data-ndpr-component":"policy-export-panel",className:a("space-y-6",t==null?void 0:t.root,i),children:[jsxs("div",{className:a(`rounded-lg border p-4 flex items-center gap-4 ${a$1.bg} ${a$1.border}`,t==null?void 0:t.complianceSummary,i),children:[jsxs("div",{className:a(`text-3xl font-bold ${a$1.text}`,t==null?void 0:t.complianceScore,i),"aria-label":`Compliance score: ${n.percentage}%`,children:[n.percentage,"%"]}),jsxs("div",{children:[jsx("p",{className:a(`text-sm font-semibold ${a$1.text}`,t==null?void 0:t.complianceRating,i),children:Qr[n.rating]}),jsxs("p",{className:a("text-xs text-gray-500 dark:text-gray-400 mt-0.5",t==null?void 0:t.complianceDetail,i),children:[n.score," / ",n.maxScore," points \u2022"," ",n.gaps.length," gap",n.gaps.length!==1?"s":""," remaining"]})]})]}),jsxs("div",{children:[jsx("h3",{className:a("text-sm font-semibold text-gray-900 dark:text-gray-100 mb-3",t==null?void 0:t.formatsHeading,i),children:"Export Format"}),jsxs("div",{className:a("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:v,onClick:g,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:h,onClick:u,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:o,classNames:t,unstyled:i}),jsx(N,{icon:jsx("svg",{className:"w-5 h-5 text-gray-500 dark:text-gray-300",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M3 5h18v2H3V5zm0 4h12v2H3V9zm0 4h18v2H3v-2zm0 4h12v2H3v-2z"})}),label:"Markdown",description:"Plain-text format for documentation or Git repos.",actionLabel:"Copy Markdown",onClick:p,classNames:t,unstyled:i})]})]})]})};var Lr=({sections:n,customSections:d,sectionOverrides:r,complianceResult:o,onEditSection:p,onAddCustomSection:t,onRemoveCustomSection:i,onReorderSection:v,onExportPDF:x,onExportDOCX:h,onExportHTML:c,onExportMarkdown:a$2,classNames:g,unstyled:u})=>{let[P,z]=useState(null),[Q,Y]=useState(false),Z=new Set(d.map(f=>f.id)),er=(f,L)=>{p(f,L),z(null);},or=n.length>0?Math.max(...n.map(f=>{var L;return (L=f.order)!=null?L:0}))+1:1;return jsxs("div",{"data-ndpr-component":"policy-step-review",className:a("space-y-6",g==null?void 0:g.root,u),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-semibold text-gray-900 dark:text-gray-100",g==null?void 0:g.heading,u),children:"Review & Export"}),jsx("p",{className:a("text-sm text-gray-500 dark:text-gray-400 mt-1",g==null?void 0:g.subheading,u),children:"Review your generated policy sections, reorder or edit content, then export."})]}),jsx("div",{className:a("space-y-3",g==null?void 0:g.sectionList,u),children:n.map((f,L)=>jsx(kr,{section:r[f.id]?b(a$1({},f),{template:r[f.id]}):f,index:L,isCustom:Z.has(f.id),isEditing:P===f.id,editedContent:r[f.id],onEdit:()=>z(f.id),onSaveEdit:ir=>er(f.id,ir),onCancelEdit:()=>z(null),onMoveUp:L>0?()=>v(f.id,"up"):void 0,onMoveDown:L<n.length-1?()=>v(f.id,"down"):void 0,onDelete:Z.has(f.id)?()=>i(f.id):void 0,classNames:g,unstyled:u},f.id))}),!Q&&jsxs("button",{type:"button",onClick:()=>Y(true),className:a("flex items-center gap-2 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",g==null?void 0:g.addSectionButton,u),children:[jsx("span",{className:a("w-5 h-5 rounded-full border-2 border-[rgb(var(--ndpr-primary))] flex items-center justify-center text-xs font-bold leading-none",g==null?void 0:g.addSectionIcon,u),"aria-hidden":"true",children:"+"}),"Add Custom Section"]}),Q&&jsxs("div",{className:a("space-y-2",g==null?void 0:g.customFormWrapper,u),children:[jsx(wr,{onAdd:f=>{t(f),Y(false);},nextOrder:or,classNames:g,unstyled:u}),jsx("button",{type:"button",onClick:()=>Y(false),className:a("text-sm text-gray-500 dark:text-gray-400 hover:underline",g==null?void 0:g.cancelCustomForm,u),children:"Cancel"})]}),jsx("hr",{className:a("border-gray-200 dark:border-gray-700",g==null?void 0:g.divider,u)}),jsx(mr,{complianceResult:o,onExportPDF:x,onExportDOCX:h,onExportHTML:c,onExportMarkdown:a$2,classNames:g,unstyled:u})]})};var Dr={compliant:{stroke:"stroke-green-500 dark:stroke-green-400",text:"text-green-600 dark:text-green-400"},nearly_compliant:{stroke:"stroke-amber-500 dark:stroke-amber-400",text:"text-amber-600 dark:text-amber-400"},not_compliant:{stroke:"stroke-red-500 dark:stroke-red-400",text:"text-red-600 dark:text-red-400"}},Nr={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},Er=({score:n,maxScore:d,rating:r,classNames:o,unstyled:p})=>{var c,a$1;let t=d>0?Math.round(n/d*100):0,i=(c=Dr[r])!=null?c:Dr.not_compliant,v=36,x=2*Math.PI*v,h=x-t/100*x;return jsxs("div",{"data-ndpr-component":"compliance-score-ring",className:a("flex flex-col items-center gap-2",o==null?void 0:o.root,p),children:[jsxs("div",{className:a("relative w-24 h-24",o==null?void 0:o.svgWrapper,p),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:v,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:"8"}),jsx("circle",{cx:"48",cy:"48",r:v,fill:"none",className:i.stroke,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:x,strokeDashoffset:h,style:{transition:"stroke-dashoffset 0.5s ease-out"}})]}),jsx("div",{className:a("absolute inset-0 flex flex-col items-center justify-center",o==null?void 0:o.centerText,p),children:jsxs("span",{className:a(`text-xl font-bold leading-none ${i.text}`,o==null?void 0:o.scoreValue,p),"aria-label":`${t}% compliance score`,children:[t,"%"]})})]}),jsx("p",{className:a(`text-xs font-semibold text-center ${i.text}`,o==null?void 0:o.ratingLabel,p),children:(a$1=Nr[r])!=null?a$1:r}),jsxs("p",{className:a("text-xs text-gray-500 dark:text-gray-400 text-center",o==null?void 0:o.scoreDetail,p),children:[n," / ",d," pts"]})]})};var rt={critical:"text-red-600 dark:text-red-400",important:"text-amber-600 dark:text-amber-400",recommended:"text-blue-600 dark:text-blue-400"},Fr=({gap:n,isPassed:d,onFix:r,classNames:o,unstyled:p})=>{let[t,i]=useState(false);return jsxs("div",{"data-ndpr-component":"compliance-requirement-item",className:a("border-b border-gray-100 dark:border-gray-700 last:border-0 py-2",o==null?void 0:o.root,p),children:[jsxs("button",{type:"button",onClick:()=>!d&&i(v=>!v),className:a("w-full flex items-start gap-2 text-left group",o==null?void 0:o.row,p),"aria-expanded":d?void 0:t,"aria-disabled":d,children:[jsx("span",{className:a(["mt-0.5 flex-shrink-0 w-4 h-4 rounded-full flex items-center justify-center",d?"bg-green-500":n.severity==="critical"?"bg-red-500":n.severity==="important"?"bg-amber-500":"bg-blue-400"].join(" "),o==null?void 0:o.statusIcon,p),"aria-hidden":"true",children:d?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(`text-xs font-medium ${d?"text-gray-700 dark:text-gray-300":"text-gray-900 dark:text-gray-100"}`,o==null?void 0:o.requirementLabel,p),children:n.requirement}),!d&&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("text-xs text-gray-400 dark:text-gray-500 mt-0.5",o==null?void 0:o.ndpaSection,p),children:["NDPA ",n.ndpaSection]})]})]}),!d&&t&&jsxs("div",{className:a("mt-2 ml-6 space-y-2",o==null?void 0:o.detail,p),children:[jsx("p",{className:a(`text-xs ${rt[n.severity]}`,o==null?void 0:o.message,p),children:n.message}),jsx("button",{type:"button",onClick:()=>{r(n.requirementId),i(false);},className:a("text-xs font-medium px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",o==null?void 0:o.fixButton,p),children:n.fixLabel})]})]})};function et(n,d){let r=d.map(t=>({gap:{requirementId:t,requirement:t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "),ndpaSection:"\u2014",severity:"recommended",message:"",fixType:"fill_field",fixLabel:""},isPassed:true})),o=n.map(t=>({gap:t,isPassed:false})),p={critical:0,important:1,recommended:2};return o.sort((t,i)=>p[t.gap.severity]-p[i.gap.severity]),[...o,...r]}var Ar=({complianceResult:n,onFix:d,classNames:r,unstyled:o})=>{let[p,t]=useState(false),i=et(n.gaps,n.passed);return jsxs("aside",{"data-ndpr-component":"compliance-checker-sidebar",className:a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",r==null?void 0:r.root,o),"aria-label":"NDPA compliance checker",children:[jsxs("div",{className:a("flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50",r==null?void 0:r.header,o),children:[jsx("h2",{className:a("text-sm font-semibold text-gray-900 dark:text-gray-100",r==null?void 0:r.title,o),children:"NDPA Compliance"}),jsx("button",{type:"button",onClick:()=>t(v=>!v),className:a("p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",r==null?void 0:r.collapseButton,o),"aria-expanded":!p,"aria-label":p?"Expand compliance checker":"Collapse compliance checker",children:jsx("svg",{className:`w-4 h-4 transition-transform ${p?"-rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]}),!p&&jsxs("div",{className:a("p-4 space-y-4",r==null?void 0:r.body,o),children:[jsx("div",{className:a("flex justify-center",r==null?void 0:r.ringWrapper,o),children:jsx(Er,{score:n.score,maxScore:n.maxScore,rating:n.rating,classNames:r,unstyled:o})}),jsx("div",{className:a("grid grid-cols-3 gap-2 text-center",r==null?void 0:r.statsRow,o),children:[{count:n.gaps.filter(v=>v.severity==="critical").length,label:"Critical",color:"text-red-600 dark:text-red-400"},{count:n.gaps.filter(v=>v.severity==="important").length,label:"Important",color:"text-amber-600 dark:text-amber-400"},{count:n.passed.length,label:"Passed",color:"text-green-600 dark:text-green-400"}].map(({count:v,label:x,color:h})=>jsxs("div",{children:[jsx("p",{className:a(`text-base font-bold ${h}`,r==null?void 0:r.statValue,o),children:v}),jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400",r==null?void 0:r.statLabel,o),children:x})]},x))}),jsx("div",{className:a("overflow-y-auto max-h-80",r==null?void 0:r.requirementsList,o),children:i.length===0?jsx("p",{className:a("text-xs text-gray-500 dark:text-gray-400 text-center py-4",r==null?void 0:r.emptyState,o),children:"No requirements to display."}):i.map(({gap:v,isPassed:x})=>jsx(Fr,{gap:v,isPassed:x,onFix:d,classNames:r,unstyled:o},v.requirementId))})]})]})};function ot(n){let d=Date.now()-n;return d<1e4?"just now":d<6e4?`${Math.floor(d/1e3)}s ago`:d<36e5?`${Math.floor(d/6e4)}m ago`:new Date(n).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var Mr=({lastSavedAt:n,isSaving:d,hasError:r,classNames:o,unstyled:p})=>{let t="idle";if(d?t="saving":r?t="error":n!==null&&(t="saved"),t==="idle")return null;let i=t==="saving"?"Saving\u2026":t==="error"?"Unable to save":`Draft saved ${n?ot(n):""}`;return jsxs("div",{"data-ndpr-component":"draft-save-indicator",role:"status","aria-live":"polite","aria-atomic":"true",className:a(`flex items-center gap-1.5 ${t==="error"?"text-red-500 dark:text-red-400":t==="saving"?"text-gray-400 dark:text-gray-500":"text-green-600 dark:text-green-400"}`,o==null?void 0:o.root,p),children:[t==="saving"&&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("text-xs font-medium",o==null?void 0:o.text,p),children:i})]})};var ce=({adapter:n,onComplete:d$1,classNames:r,unstyled:o})=>{let{currentStep:p,nextStep:t,prevStep:i,canProceed:v,context:x,updateOrg:h,updateContext:c,toggleDataCategory:a$1,togglePurpose:g,addProcessor:u,removeProcessor:P,sections:z,customSections:Q,sectionOverrides:Y,editSectionContent:Z,addCustomSection:er,removeCustomSection:or,reorderSections:f,complianceResult:L,applyFix:ir,handleExportPDF:Br,handleExportDOCX:Ir,handleExportHTML:zr,handleExportMarkdown:jr,lastSavedAt:Or,isLoading:_r}=e({adapter:n,onComplete:d$1}),nr=(D,J)=>{let H=URL.createObjectURL(D),q=document.createElement("a");q.href=H,q.download=J,q.click(),URL.revokeObjectURL(H);},Hr=()=>d(null,null,function*(){let D=yield Br();nr(D,"privacy-policy.pdf");}),qr=()=>d(null,null,function*(){let D=yield Ir();nr(D,"privacy-policy.docx");}),Wr=()=>{let D=zr();navigator.clipboard.writeText(D).catch(()=>{let J=new Blob([D],{type:"text/html"}),H=URL.createObjectURL(J),q=window.open(H,"_blank");q?q.addEventListener("load",()=>URL.revokeObjectURL(H)):URL.revokeObjectURL(H);});},$r=()=>{let D=jr();navigator.clipboard.writeText(D).catch(()=>{let J=new Blob([D],{type:"text/markdown"});nr(J,"privacy-policy.md");});};return _r?jsxs("div",{"data-ndpr-component":"adaptive-policy-wizard",className:a("flex items-center justify-center min-h-64 text-gray-400 dark:text-gray-500",r==null?void 0:r.root,o),"aria-busy":"true","aria-label":"Loading policy wizard",children:[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:"text-sm",children:"Loading\u2026"})]}):jsx("div",{"data-ndpr-component":"adaptive-policy-wizard",className:a("min-h-screen bg-gray-50 dark:bg-gray-900",r==null?void 0:r.root,o),children:jsxs("div",{className:a("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",r==null?void 0:r.container,o),children:[jsxs("div",{className:a("flex items-center justify-between mb-6",r==null?void 0:r.topBar,o),children:[jsx("h1",{className:a("text-2xl font-bold text-gray-900 dark:text-gray-100",r==null?void 0:r.wizardTitle,o),children:"Privacy Policy Builder"}),jsx(Mr,{lastSavedAt:Or,isSaving:false,hasError:false,classNames:r,unstyled:o})]}),jsx("div",{className:a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-4 mb-6",r==null?void 0:r.stepIndicatorWrapper,o),children:jsx(ur,{currentStep:p,classNames:r,unstyled:o})}),jsxs("div",{className:a("flex flex-col lg:flex-row gap-6 items-start",r==null?void 0:r.panels,o),children:[jsxs("main",{className:a("flex-1 min-w-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6",r==null?void 0:r.mainPanel,o),children:[p===1&&jsx(yr,{context:x,onUpdateOrg:h,classNames:r,unstyled:o}),p===2&&jsx(hr,{categories:x.dataCategories,onToggle:a$1,classNames:r,unstyled:o}),p===3&&jsx(lr,{context:x,onTogglePurpose:g,onUpdateContext:c,onAddProcessor:u,onRemoveProcessor:P,classNames:r,unstyled:o}),p===4&&jsx(Lr,{sections:z,customSections:Q,sectionOverrides:Y,complianceResult:L,onEditSection:Z,onAddCustomSection:er,onRemoveCustomSection:or,onReorderSection:f,onExportPDF:Hr,onExportDOCX:qr,onExportHTML:Wr,onExportMarkdown:$r,classNames:r,unstyled:o}),jsxs("div",{className:a("flex items-center justify-between mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",r==null?void 0:r.navigation,o),children:[jsx("button",{type:"button",onClick:i,disabled:p===1,className:a("px-4 py-2 bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-white rounded-md text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors",r==null?void 0:r.backButton,o),children:"Back"}),jsx("div",{className:"flex items-center gap-2",children:jsxs("span",{className:a("text-xs text-gray-400 dark:text-gray-500",r==null?void 0:r.stepCounter,o),children:["Step ",p," of 4"]})}),p<4?jsx("button",{type:"button",onClick:t,disabled:!v,className:a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-colors",r==null?void 0:r.nextButton,o),children:"Next"}):jsx("span",{})]})]}),jsx("aside",{className:a("w-full lg:w-80 flex-shrink-0",r==null?void 0:r.sidebarWrapper,o),children:jsx(Ar,{complianceResult:L,onFix:ir,classNames:r,unstyled:o})})]})]})})};
|
|
2
|
+
export{ce as a};//# sourceMappingURL=chunk-ZQSX5ZHB.mjs.map
|
|
3
|
+
//# sourceMappingURL=chunk-ZQSX5ZHB.mjs.map
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compliance Score Engine
|
|
3
|
+
*
|
|
4
|
+
* Evaluates an organisation's NDPA compliance posture across eight modules and
|
|
5
|
+
* returns a scored, rated report with per-module breakdowns and sorted
|
|
6
|
+
* recommendations.
|
|
7
|
+
*
|
|
8
|
+
* Pure utility — zero React dependency.
|
|
9
|
+
*/
|
|
10
|
+
type ComplianceRating = 'excellent' | 'good' | 'needs-work' | 'critical';
|
|
11
|
+
type RecommendationPriority = 'critical' | 'high' | 'medium' | 'low';
|
|
12
|
+
type EffortLevel = 'low' | 'medium' | 'high';
|
|
13
|
+
interface RegulatoryReference {
|
|
14
|
+
section: string;
|
|
15
|
+
title: string;
|
|
16
|
+
url?: string;
|
|
17
|
+
}
|
|
18
|
+
interface Recommendation {
|
|
19
|
+
module: string;
|
|
20
|
+
key: string;
|
|
21
|
+
label: string;
|
|
22
|
+
priority: RecommendationPriority;
|
|
23
|
+
effort: EffortLevel;
|
|
24
|
+
recommendation: string;
|
|
25
|
+
ndpaSection: string;
|
|
26
|
+
}
|
|
27
|
+
interface ModuleScore {
|
|
28
|
+
/** Module name (e.g. "consent") */
|
|
29
|
+
name: string;
|
|
30
|
+
/** Raw module score 0-100 */
|
|
31
|
+
score: number;
|
|
32
|
+
/** Maximum possible score for this module (always 100) */
|
|
33
|
+
maxScore: number;
|
|
34
|
+
/** Weighted contribution to the overall score */
|
|
35
|
+
weightedScore: number;
|
|
36
|
+
/** NDPA sections this module maps to */
|
|
37
|
+
ndpaSections: string[];
|
|
38
|
+
/** Gaps found — list of human-readable gap descriptions */
|
|
39
|
+
gaps: string[];
|
|
40
|
+
}
|
|
41
|
+
interface ComplianceReport {
|
|
42
|
+
/** Overall compliance score, 0–100 */
|
|
43
|
+
score: number;
|
|
44
|
+
/** Rating bucket */
|
|
45
|
+
rating: ComplianceRating;
|
|
46
|
+
/** Per-module breakdown keyed by module name */
|
|
47
|
+
modules: Record<string, ModuleScore>;
|
|
48
|
+
/** Recommendations sorted by priority (critical first) */
|
|
49
|
+
recommendations: Recommendation[];
|
|
50
|
+
/** Top-level regulatory references */
|
|
51
|
+
regulatoryReferences: RegulatoryReference[];
|
|
52
|
+
/** ISO date of when the report was generated */
|
|
53
|
+
generatedAt: string;
|
|
54
|
+
}
|
|
55
|
+
interface ComplianceInput {
|
|
56
|
+
consent: {
|
|
57
|
+
hasConsentMechanism: boolean;
|
|
58
|
+
hasPurposeSpecification: boolean;
|
|
59
|
+
hasWithdrawalMechanism: boolean;
|
|
60
|
+
hasMinorProtection: boolean;
|
|
61
|
+
consentRecordsRetained: boolean;
|
|
62
|
+
};
|
|
63
|
+
dsr: {
|
|
64
|
+
hasRequestMechanism: boolean;
|
|
65
|
+
supportsAccess: boolean;
|
|
66
|
+
supportsRectification: boolean;
|
|
67
|
+
supportsErasure: boolean;
|
|
68
|
+
supportsPortability: boolean;
|
|
69
|
+
supportsObjection: boolean;
|
|
70
|
+
/** Expected max response time in days (>30 counts as a gap) */
|
|
71
|
+
responseTimelineDays: number;
|
|
72
|
+
};
|
|
73
|
+
dpia: {
|
|
74
|
+
conductedForHighRisk: boolean;
|
|
75
|
+
documentedRisks: boolean;
|
|
76
|
+
mitigationMeasures: boolean;
|
|
77
|
+
};
|
|
78
|
+
breach: {
|
|
79
|
+
hasNotificationProcess: boolean;
|
|
80
|
+
notifiesWithin72Hours: boolean;
|
|
81
|
+
hasRiskAssessment: boolean;
|
|
82
|
+
hasRecordKeeping: boolean;
|
|
83
|
+
};
|
|
84
|
+
policy: {
|
|
85
|
+
hasPrivacyPolicy: boolean;
|
|
86
|
+
isPubliclyAccessible: boolean;
|
|
87
|
+
/** ISO date string (YYYY-MM-DD); >13 months old counts as a gap */
|
|
88
|
+
lastUpdated: string;
|
|
89
|
+
coversAllSections: boolean;
|
|
90
|
+
};
|
|
91
|
+
lawfulBasis: {
|
|
92
|
+
documentedForAllProcessing: boolean;
|
|
93
|
+
hasLegitimateInterestAssessment: boolean;
|
|
94
|
+
};
|
|
95
|
+
crossBorder: {
|
|
96
|
+
hasTransferMechanisms: boolean;
|
|
97
|
+
adequacyAssessed: boolean;
|
|
98
|
+
ndpcApprovalObtained: boolean;
|
|
99
|
+
};
|
|
100
|
+
ropa: {
|
|
101
|
+
maintained: boolean;
|
|
102
|
+
includesAllProcessing: boolean;
|
|
103
|
+
/** ISO date string (YYYY-MM-DD); >6 months since review counts as a gap */
|
|
104
|
+
lastReviewed: string;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Evaluate an organisation's NDPA compliance across all modules.
|
|
109
|
+
*
|
|
110
|
+
* @param input - Compliance input object
|
|
111
|
+
* @returns ComplianceReport with overall score, per-module breakdown, and sorted recommendations
|
|
112
|
+
*/
|
|
113
|
+
declare function getComplianceScore(input: ComplianceInput): ComplianceReport;
|
|
114
|
+
|
|
115
|
+
export { type ComplianceInput as C, type EffortLevel as E, type ModuleScore as M, type Recommendation as R, type ComplianceRating as a, type ComplianceReport as b, type RecommendationPriority as c, type RegulatoryReference as d, getComplianceScore as g };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compliance Score Engine
|
|
3
|
+
*
|
|
4
|
+
* Evaluates an organisation's NDPA compliance posture across eight modules and
|
|
5
|
+
* returns a scored, rated report with per-module breakdowns and sorted
|
|
6
|
+
* recommendations.
|
|
7
|
+
*
|
|
8
|
+
* Pure utility — zero React dependency.
|
|
9
|
+
*/
|
|
10
|
+
type ComplianceRating = 'excellent' | 'good' | 'needs-work' | 'critical';
|
|
11
|
+
type RecommendationPriority = 'critical' | 'high' | 'medium' | 'low';
|
|
12
|
+
type EffortLevel = 'low' | 'medium' | 'high';
|
|
13
|
+
interface RegulatoryReference {
|
|
14
|
+
section: string;
|
|
15
|
+
title: string;
|
|
16
|
+
url?: string;
|
|
17
|
+
}
|
|
18
|
+
interface Recommendation {
|
|
19
|
+
module: string;
|
|
20
|
+
key: string;
|
|
21
|
+
label: string;
|
|
22
|
+
priority: RecommendationPriority;
|
|
23
|
+
effort: EffortLevel;
|
|
24
|
+
recommendation: string;
|
|
25
|
+
ndpaSection: string;
|
|
26
|
+
}
|
|
27
|
+
interface ModuleScore {
|
|
28
|
+
/** Module name (e.g. "consent") */
|
|
29
|
+
name: string;
|
|
30
|
+
/** Raw module score 0-100 */
|
|
31
|
+
score: number;
|
|
32
|
+
/** Maximum possible score for this module (always 100) */
|
|
33
|
+
maxScore: number;
|
|
34
|
+
/** Weighted contribution to the overall score */
|
|
35
|
+
weightedScore: number;
|
|
36
|
+
/** NDPA sections this module maps to */
|
|
37
|
+
ndpaSections: string[];
|
|
38
|
+
/** Gaps found — list of human-readable gap descriptions */
|
|
39
|
+
gaps: string[];
|
|
40
|
+
}
|
|
41
|
+
interface ComplianceReport {
|
|
42
|
+
/** Overall compliance score, 0–100 */
|
|
43
|
+
score: number;
|
|
44
|
+
/** Rating bucket */
|
|
45
|
+
rating: ComplianceRating;
|
|
46
|
+
/** Per-module breakdown keyed by module name */
|
|
47
|
+
modules: Record<string, ModuleScore>;
|
|
48
|
+
/** Recommendations sorted by priority (critical first) */
|
|
49
|
+
recommendations: Recommendation[];
|
|
50
|
+
/** Top-level regulatory references */
|
|
51
|
+
regulatoryReferences: RegulatoryReference[];
|
|
52
|
+
/** ISO date of when the report was generated */
|
|
53
|
+
generatedAt: string;
|
|
54
|
+
}
|
|
55
|
+
interface ComplianceInput {
|
|
56
|
+
consent: {
|
|
57
|
+
hasConsentMechanism: boolean;
|
|
58
|
+
hasPurposeSpecification: boolean;
|
|
59
|
+
hasWithdrawalMechanism: boolean;
|
|
60
|
+
hasMinorProtection: boolean;
|
|
61
|
+
consentRecordsRetained: boolean;
|
|
62
|
+
};
|
|
63
|
+
dsr: {
|
|
64
|
+
hasRequestMechanism: boolean;
|
|
65
|
+
supportsAccess: boolean;
|
|
66
|
+
supportsRectification: boolean;
|
|
67
|
+
supportsErasure: boolean;
|
|
68
|
+
supportsPortability: boolean;
|
|
69
|
+
supportsObjection: boolean;
|
|
70
|
+
/** Expected max response time in days (>30 counts as a gap) */
|
|
71
|
+
responseTimelineDays: number;
|
|
72
|
+
};
|
|
73
|
+
dpia: {
|
|
74
|
+
conductedForHighRisk: boolean;
|
|
75
|
+
documentedRisks: boolean;
|
|
76
|
+
mitigationMeasures: boolean;
|
|
77
|
+
};
|
|
78
|
+
breach: {
|
|
79
|
+
hasNotificationProcess: boolean;
|
|
80
|
+
notifiesWithin72Hours: boolean;
|
|
81
|
+
hasRiskAssessment: boolean;
|
|
82
|
+
hasRecordKeeping: boolean;
|
|
83
|
+
};
|
|
84
|
+
policy: {
|
|
85
|
+
hasPrivacyPolicy: boolean;
|
|
86
|
+
isPubliclyAccessible: boolean;
|
|
87
|
+
/** ISO date string (YYYY-MM-DD); >13 months old counts as a gap */
|
|
88
|
+
lastUpdated: string;
|
|
89
|
+
coversAllSections: boolean;
|
|
90
|
+
};
|
|
91
|
+
lawfulBasis: {
|
|
92
|
+
documentedForAllProcessing: boolean;
|
|
93
|
+
hasLegitimateInterestAssessment: boolean;
|
|
94
|
+
};
|
|
95
|
+
crossBorder: {
|
|
96
|
+
hasTransferMechanisms: boolean;
|
|
97
|
+
adequacyAssessed: boolean;
|
|
98
|
+
ndpcApprovalObtained: boolean;
|
|
99
|
+
};
|
|
100
|
+
ropa: {
|
|
101
|
+
maintained: boolean;
|
|
102
|
+
includesAllProcessing: boolean;
|
|
103
|
+
/** ISO date string (YYYY-MM-DD); >6 months since review counts as a gap */
|
|
104
|
+
lastReviewed: string;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Evaluate an organisation's NDPA compliance across all modules.
|
|
109
|
+
*
|
|
110
|
+
* @param input - Compliance input object
|
|
111
|
+
* @returns ComplianceReport with overall score, per-module breakdown, and sorted recommendations
|
|
112
|
+
*/
|
|
113
|
+
declare function getComplianceScore(input: ComplianceInput): ComplianceReport;
|
|
114
|
+
|
|
115
|
+
export { type ComplianceInput as C, type EffortLevel as E, type ModuleScore as M, type Recommendation as R, type ComplianceRating as a, type ComplianceReport as b, type RecommendationPriority as c, type RegulatoryReference as d, getComplianceScore as g };
|