@tantainnovative/ndpr-toolkit 2.2.0 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +26 -11
  2. package/dist/breach.d.mts +94 -6
  3. package/dist/breach.d.ts +94 -6
  4. package/dist/breach.js +1 -1
  5. package/dist/breach.mjs +1 -1
  6. package/dist/chunk-2XFAV267.mjs +2 -0
  7. package/dist/chunk-32UIWTGD.js +72 -0
  8. package/dist/chunk-4JUDKBA2.mjs +7 -0
  9. package/dist/chunk-4VVARDN2.mjs +2 -0
  10. package/dist/chunk-5RSOLEEP.js +63 -0
  11. package/dist/chunk-AYKLAEOU.mjs +2 -0
  12. package/dist/chunk-BGHQTZAC.js +94 -0
  13. package/dist/chunk-BZTTQS4A.mjs +7 -0
  14. package/dist/chunk-CAB7O3GR.mjs +63 -0
  15. package/dist/chunk-CL53OI3I.js +7 -0
  16. package/dist/chunk-E64TU6IU.js +2 -0
  17. package/dist/chunk-EKVTLHBQ.js +2 -0
  18. package/dist/chunk-ELKEZEV5.mjs +2 -0
  19. package/dist/chunk-EPF7J2FK.js +3 -0
  20. package/dist/chunk-ER7X6E36.js +2 -0
  21. package/dist/chunk-FXTZDKDC.mjs +3 -0
  22. package/dist/chunk-IBEKLDBY.mjs +2 -0
  23. package/dist/chunk-ILCNDOBU.js +2 -0
  24. package/dist/chunk-K3GMTMQ6.js +2 -0
  25. package/dist/chunk-MJGOLP5M.js +2 -0
  26. package/dist/chunk-NW4A3JW6.mjs +2 -0
  27. package/dist/chunk-P3PULLYP.mjs +2 -0
  28. package/dist/chunk-SKJCQKFL.mjs +94 -0
  29. package/dist/chunk-TCJCE6WN.js +2 -0
  30. package/dist/chunk-UZ5EZOA7.js +2 -0
  31. package/dist/chunk-WSHSHIIM.mjs +2 -0
  32. package/dist/chunk-XMYUYQH7.mjs +72 -0
  33. package/dist/chunk-ZNTMZ6NM.js +7 -0
  34. package/dist/consent-audit-BdByjYlM.d.mts +65 -0
  35. package/dist/consent-audit-DhbfMR0n.d.ts +65 -0
  36. package/dist/consent.d.mts +55 -8
  37. package/dist/consent.d.ts +55 -8
  38. package/dist/consent.js +1 -1
  39. package/dist/consent.mjs +1 -1
  40. package/dist/core.d.mts +52 -2
  41. package/dist/core.d.ts +52 -2
  42. package/dist/core.js +1 -1
  43. package/dist/core.mjs +1 -1
  44. package/dist/{cross-border-entry-CtX8_o-_.d.ts → cross-border-entry-BrWVPly6.d.ts} +7 -0
  45. package/dist/{cross-border-entry-BfF7jw5o.d.mts → cross-border-entry-cCTvpwnT.d.mts} +7 -0
  46. package/dist/cross-border.d.mts +1 -1
  47. package/dist/cross-border.d.ts +1 -1
  48. package/dist/cross-border.js +1 -1
  49. package/dist/cross-border.mjs +1 -1
  50. package/dist/dpia.d.mts +14 -0
  51. package/dist/dpia.d.ts +14 -0
  52. package/dist/dpia.js +1 -1
  53. package/dist/dpia.mjs +1 -1
  54. package/dist/dsr.d.mts +60 -5
  55. package/dist/dsr.d.ts +60 -5
  56. package/dist/dsr.js +1 -1
  57. package/dist/dsr.mjs +1 -1
  58. package/dist/hooks.d.mts +1 -1
  59. package/dist/hooks.d.ts +1 -1
  60. package/dist/hooks.js +1 -1
  61. package/dist/hooks.mjs +1 -1
  62. package/dist/index.d.mts +11 -10
  63. package/dist/index.d.ts +11 -10
  64. package/dist/index.js +1 -1
  65. package/dist/index.mjs +1 -1
  66. package/dist/{lawful-basis-entry-BeSX7u0U.d.ts → lawful-basis-entry-15qjKcNO.d.ts} +6 -0
  67. package/dist/{lawful-basis-entry-CMPPM9Rh.d.mts → lawful-basis-entry-CxZrofwG.d.mts} +6 -0
  68. package/dist/lawful-basis.d.mts +1 -1
  69. package/dist/lawful-basis.d.ts +1 -1
  70. package/dist/lawful-basis.js +1 -1
  71. package/dist/lawful-basis.mjs +1 -1
  72. package/dist/{policy-dmsRlqgM.d.ts → policy-D2_jh5-T.d.ts} +15 -5
  73. package/dist/{policy-kZN23hrR.d.mts → policy-E0fXZkda.d.mts} +15 -5
  74. package/dist/policy-templates-CIKcV0i1.d.ts +36 -0
  75. package/dist/policy-templates-DMsPwOSZ.d.mts +36 -0
  76. package/dist/policy.d.mts +3 -3
  77. package/dist/policy.d.ts +3 -3
  78. package/dist/policy.js +1 -1
  79. package/dist/policy.mjs +1 -1
  80. package/dist/{ropa-entry-DIEQ9WFs.d.ts → ropa-entry-B0D7X1GV.d.ts} +10 -1
  81. package/dist/{ropa-entry-CZJ91ymk.d.mts → ropa-entry-DiOThOc2.d.mts} +10 -1
  82. package/dist/ropa.d.mts +1 -1
  83. package/dist/ropa.d.ts +1 -1
  84. package/dist/ropa.js +1 -1
  85. package/dist/ropa.mjs +1 -1
  86. package/dist/styles.css +40 -28
  87. package/dist/styles.d.ts +1 -0
  88. package/dist/{usePrivacyPolicy-CfySfBLS.d.ts → useDefaultPrivacyPolicy-B7kTHbZh.d.ts} +39 -2
  89. package/dist/{usePrivacyPolicy-Dit2sFuV.d.mts → useDefaultPrivacyPolicy-CUluF_ic.d.mts} +39 -2
  90. package/package.json +9 -7
  91. package/dist/chunk-4RGDNVR5.mjs +0 -72
  92. package/dist/chunk-6LM3RAFO.js +0 -7
  93. package/dist/chunk-7DNQSOER.js +0 -2
  94. package/dist/chunk-A7DRHSDQ.mjs +0 -2
  95. package/dist/chunk-DB3JH4DS.mjs +0 -2
  96. package/dist/chunk-FC6EG34C.js +0 -72
  97. package/dist/chunk-FDB6KZUD.mjs +0 -2
  98. package/dist/chunk-FZUCKGIM.mjs +0 -7
  99. package/dist/chunk-G3JNFZPT.js +0 -2
  100. package/dist/chunk-HXCRMA4J.mjs +0 -2
  101. package/dist/chunk-IC7VOOKJ.mjs +0 -2
  102. package/dist/chunk-ICUZG6CD.mjs +0 -2
  103. package/dist/chunk-IW5PHOG7.mjs +0 -7
  104. package/dist/chunk-IWUUVRLJ.js +0 -2
  105. package/dist/chunk-JKEAPTYP.js +0 -7
  106. package/dist/chunk-N52S64SU.js +0 -2
  107. package/dist/chunk-PM7CMTMB.js +0 -4
  108. package/dist/chunk-SKAMVXBI.mjs +0 -94
  109. package/dist/chunk-UYP64PV7.mjs +0 -4
  110. package/dist/chunk-VURIXCGY.js +0 -2
  111. package/dist/chunk-VXRY3V42.js +0 -94
  112. package/dist/chunk-YBPHGEL2.js +0 -2
  113. package/dist/consent-DCc5zjXI.d.mts +0 -24
  114. package/dist/consent-DLWb5ota.d.ts +0 -24
  115. package/dist/privacy-9FcJceMr.d.mts +0 -15
  116. package/dist/privacy-BXz7O2ej.d.ts +0 -15
@@ -0,0 +1,94 @@
1
+ 'use strict';var chunk5RSOLEEP_js=require('./chunk-5RSOLEEP.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var ur=({sections:P=chunk5RSOLEEP_js.b,variables:R=chunk5RSOLEEP_js.c,onGenerate:S,title:q="NDPA Privacy Policy Generator",description:B="Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 24.",className:j="",buttonClassName:L="",generateButtonText:z="Generate Policy",showPreview:A=true,allowEditing:V=true,classNames:e,unstyled:x=false})=>{let[T,U]=react.useState(P),[a,t]=react.useState(R),[m,C]=react.useState("sections"),[E,X]=react.useState(""),[F,D]=react.useState(""),[_,G]=react.useState(false),[h,W]=react.useState({});react.useEffect(()=>{U(P);},[P]),react.useEffect(()=>{t(R);},[R]);let s=n=>{U(b=>b.map(p=>p.id===n?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},p),{included:!p.included}):p));},g=(n,b)=>{t(p=>p.map(u=>u.id===n?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{value:b}):u)),h[n]&&W(p=>{let u=chunkMQFZHA2D_js.a({},p);return delete u[n],u});},v=()=>{let n={},b=true;return a.forEach(p=>{p.required&&!p.value&&(n[p.id]=`${p.name} is required`,b=false);}),W(n),b},k=()=>{if(!v()){C("variables");return}let n=T.filter(u=>u.included),b=Object.fromEntries(a.map(u=>[u.name,u.value])),p="";n.forEach(u=>{p+=`## ${u.title}
2
+
3
+ `,p+=chunk5RSOLEEP_js.a(u.template,b),p+=`
4
+
5
+ `;}),X(p),D(p),G(true),C("preview");},H=()=>{S({sections:T,variables:a,content:V?F:E});},I=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",e==null?void 0:e.sectionList,x),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Select Policy Sections"}),T.map(n=>jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("border border-gray-200 dark:border-gray-700 rounded-md p-4",e==null?void 0:e.sectionItem,x),children:jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:`section-${n.id}`,type:"checkbox",checked:n.included,onChange:()=>s(n.id),disabled:n.required,className:chunkE64TU6IU_js.a("w-4 h-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))] dark:focus:ring-[rgb(var(--ndpr-ring))] dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600",e==null?void 0:e.input,x)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:`section-${n.id}`,className:"font-medium text-gray-900 dark:text-white",children:[n.title," ",n.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),n.description&&jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-1",children:n.description})]})]})},n.id)),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{onClick:()=>C("variables"),className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${L}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.generateButton),x),children:"Next: Fill Variables"})})]}),J=()=>{let n={};return a.forEach(b=>{let p=b.id.split(".")[0];n[p]||(n[p]=[]),n[p].push(b);}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",e==null?void 0:e.form,x),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Fill Policy Variables"}),jsxRuntime.jsx("div",{className:"space-y-6",children:Object.entries(n).map(([b,p])=>{let u=T.find(r=>r.id===b);return u&&!u.included?null:jsxRuntime.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsxRuntime.jsx("h4",{className:"font-medium text-lg mb-3",children:u?u.title:"General Information"}),jsxRuntime.jsx("div",{className:"space-y-4",children:p.map(r=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`var-${r.id}`,className:"block text-sm font-medium mb-1",children:[r.name," ",r.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),r.description&&jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-2",children:r.description}),r.inputType==="textarea"?jsxRuntime.jsx("textarea",{id:`var-${r.id}`,value:r.value,onChange:c=>g(r.id,c.target.value),rows:4,className:chunkE64TU6IU_js.a(`w-full px-3 py-2 border ${h[r.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,e==null?void 0:e.input,x),required:r.required}):r.inputType==="select"&&r.options?jsxRuntime.jsxs("select",{id:`var-${r.id}`,value:r.value,onChange:c=>g(r.id,c.target.value),className:chunkE64TU6IU_js.a(`w-full px-3 py-2 border ${h[r.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,e==null?void 0:e.input,x),required:r.required,children:[jsxRuntime.jsx("option",{value:"",children:"Select an option"}),r.options.map(c=>jsxRuntime.jsx("option",{value:c,children:c},c))]}):jsxRuntime.jsx("input",{id:`var-${r.id}`,type:r.inputType,value:r.value,onChange:c=>g(r.id,c.target.value),className:chunkE64TU6IU_js.a(`w-full px-3 py-2 border ${h[r.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,e==null?void 0:e.input,x),required:r.required}),h[r.id]&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-500",children:h[r.id]})]},r.id))})]},b)})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>C("sections"),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${L}`,children:"Back to Sections"}),jsxRuntime.jsx("button",{onClick:k,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${L}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.generateButton),x),children:z})]})]})},N=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Preview Generated Policy"}),V?jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("label",{htmlFor:"policy-content",className:"block text-sm font-medium mb-1",children:"Edit Policy Content"}),jsxRuntime.jsx("textarea",{id:"policy-content",value:F,onChange:n=>D(n.target.value),rows:20,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] font-mono text-sm"})]}):jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4",children:jsxRuntime.jsx("div",{className:"prose dark:prose-invert max-w-none",children:E.split(`
6
+ `).map((n,b)=>n.startsWith("## ")?jsxRuntime.jsx("h2",{className:"text-xl font-bold mt-6 mb-3",children:n.substring(3)},b):n.startsWith("### ")?jsxRuntime.jsx("h3",{className:"text-lg font-bold mt-4 mb-2",children:n.substring(4)},b):n===""?jsxRuntime.jsx("br",{},b):jsxRuntime.jsx("p",{className:"mb-2",children:n},b))})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>C("variables"),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${L}`,children:"Back to Variables"}),jsxRuntime.jsx("button",{onClick:H,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${L}`,children:"Save Policy"})]})]}),K=()=>{switch(m){case "sections":return I();case "variables":return J();case "preview":return N();default:return I()}};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${j}`,e==null?void 0:e.root,x),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",e==null?void 0:e.header,x),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",e==null?void 0:e.title,x),children:q}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-300",e==null?void 0:e.description,x),children:B})]}),jsxRuntime.jsx("div",{className:"mb-8",children:jsxRuntime.jsxs("ol",{className:"flex items-center w-full",children:[jsxRuntime.jsxs("li",{className:`flex w-full items-center ${m==="sections"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${m==="sections"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"1"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Sections"})]}),jsxRuntime.jsxs("li",{className:`flex w-full items-center ${m==="variables"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${m==="variables"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"2"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Variables"})]}),jsxRuntime.jsxs("li",{className:`flex items-center ${m==="preview"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"}`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${m==="preview"?"bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)]":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"3"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Preview"})]})]})}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",e==null?void 0:e.complianceNotice,x),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"This tool helps you generate a privacy policy that aligns with the Nigeria Data Protection Act (NDPA) 2023. While we strive to ensure compliance, we recommend having the final policy reviewed by a legal professional familiar with NDPA requirements."})]}),K()]})};var wr=({content:P,sections:R,variables:S,onExport:q,onEdit:B,title:j="Privacy Policy Preview",description:L="Preview your NDPA-compliant privacy policy before exporting.",className:z="",buttonClassName:A="",showExportOptions:V=true,showEditButton:e=true,showTableOfContents:x=true,showMetadata:T=true,organizationName:U,lastUpdated:a=new Date,classNames:t,unstyled:m=false})=>{let[C,E]=react.useState("preview"),F=(()=>{let s=P.split(`
7
+ `),g=[];return s.forEach(v=>{if(v.startsWith("## ")){let k=v.substring(3).trim(),H=k.toLowerCase().replace(/[^a-z0-9]+/g,"-");g.push({id:H,title:k,level:2});}else if(v.startsWith("### ")){let k=v.substring(4).trim(),H=k.toLowerCase().replace(/[^a-z0-9]+/g,"-");g.push({id:H,title:k,level:3});}}),g})(),D=s=>{if(q)q(s);else if(s==="markdown"){let g=document.createElement("a"),v=new Blob([P],{type:"text/markdown"});g.href=URL.createObjectURL(v),g.download=`privacy-policy-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(g),g.click(),document.body.removeChild(g);}},_=()=>!x||F.length===0?null:jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Table of Contents"}),jsxRuntime.jsx("ul",{className:"space-y-1",children:F.map((s,g)=>jsxRuntime.jsx("li",{style:{marginLeft:`${(s.level-2)*1.5}rem`},children:jsxRuntime.jsx("a",{href:`#${s.id}`,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline",children:s.title})},g))})]}),G=()=>T?jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h1",{className:"text-2xl font-bold mb-2",children:U?`${U} Privacy Policy`:"Privacy Policy"}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Last Updated: ",a.toLocaleDateString()]})]}):null,h=()=>jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("prose dark:prose-invert max-w-none",t==null?void 0:t.sectionContent,m),children:P.split(`
8
+ `).map((s,g)=>{if(s.startsWith("## ")){let v=s.substring(3).trim(),k=v.toLowerCase().replace(/[^a-z0-9]+/g,"-");return jsxRuntime.jsx("h2",{id:k,className:chunkE64TU6IU_js.a("text-xl font-bold mt-6 mb-3",t==null?void 0:t.sectionTitle,m),children:v},g)}else if(s.startsWith("### ")){let v=s.substring(4).trim(),k=v.toLowerCase().replace(/[^a-z0-9]+/g,"-");return jsxRuntime.jsx("h3",{id:k,className:chunkE64TU6IU_js.a("text-lg font-bold mt-4 mb-2",t==null?void 0:t.sectionTitle,m),children:v},g)}else return s===""?jsxRuntime.jsx("br",{},g):jsxRuntime.jsx("p",{className:"mb-2",children:s},g)})}),W=()=>V?jsxRuntime.jsxs("div",{className:"mt-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Export Options"}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-3",children:[jsxRuntime.jsx("button",{onClick:()=>D("pdf"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${A}`,children:"Export as PDF"}),jsxRuntime.jsx("button",{onClick:()=>D("docx"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${A}`,children:"Export as DOCX"}),jsxRuntime.jsx("button",{onClick:()=>D("html"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${A}`,children:"Export as HTML"}),jsxRuntime.jsx("button",{onClick:()=>D("markdown"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${A}`,children:"Export as Markdown"})]})]}):null;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${z}`,t==null?void 0:t.root,m),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex justify-between items-start mb-6",t==null?void 0:t.header,m),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",t==null?void 0:t.title,m),children:j}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-300",t==null?void 0:t.description,m),children:L})]}),e&&B&&jsxRuntime.jsx("button",{onClick:B,className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${A}`,children:"Edit Policy"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",t==null?void 0:t.complianceNotice,m),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"This privacy policy has been generated to align with the Nigeria Data Protection Act (NDPA) 2023. We recommend having the final policy reviewed by a legal professional familiar with NDPA requirements before publishing it on your website or sharing it with your users."})]}),jsxRuntime.jsx("div",{className:"mb-6 border-b border-gray-200 dark:border-gray-700",children:jsxRuntime.jsxs("ul",{className:"flex flex-wrap -mb-px",children:[jsxRuntime.jsx("li",{className:"mr-2",children:jsxRuntime.jsx("button",{onClick:()=>E("preview"),className:`inline-block p-4 ${C==="preview"?"text-[rgb(var(--ndpr-primary))] border-b-2 border-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]":"text-gray-600 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Preview"})}),jsxRuntime.jsx("li",{className:"mr-2",children:jsxRuntime.jsx("button",{onClick:()=>E("markdown"),className:`inline-block p-4 ${C==="markdown"?"text-[rgb(var(--ndpr-primary))] border-b-2 border-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]":"text-gray-600 hover:text-gray-700 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Markdown"})})]})}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-800 p-4 rounded-md",t==null?void 0:t.content,m),children:C==="preview"?jsxRuntime.jsxs("div",{children:[G(),_(),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("bg-gray-50 dark:bg-gray-700 p-6 rounded-md",t==null?void 0:t.section,m),children:h()})]}):jsxRuntime.jsx("div",{children:jsxRuntime.jsx("pre",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md overflow-auto whitespace-pre-wrap font-mono text-sm text-gray-800 dark:text-gray-200",children:P})})}),W()]})};var Sr=({content:P,title:R="Privacy Policy",organizationName:S,lastUpdated:q=new Date,onExportComplete:B,componentTitle:j="Export Privacy Policy",description:L="Export your NDPA-compliant privacy policy in various formats.",className:z="",buttonClassName:A="",showExportHistory:V=true,includeComplianceNotice:e=true,includeLogo:x=false,logoUrl:T,customStyles:U,classNames:a,unstyled:t=false})=>{let[m,C]=react.useState([]),[E,X]=react.useState("pdf"),[F,D]=react.useState(false),[_,G]=react.useState(null),[h,W]=react.useState(""),[s,g]=react.useState(""),[v,k]=react.useState(""),[H,I]=react.useState(false),J=r=>{let c=new Date().toISOString().split("T")[0];return `${S?S.toLowerCase().replace(/[^a-z0-9]+/g,"-"):"privacy-policy"}-privacy-policy-${c}.${r.toLowerCase()}`},N=r=>h?h.endsWith(`.${r.toLowerCase()}`)?h:`${h}.${r.toLowerCase()}`:J(r),K=()=>{let r=S?`${S} ${R}`:R,c=q.toLocaleDateString(),w=`<!DOCTYPE html>
9
+ <html lang="en">
10
+ <head>
11
+ <meta charset="UTF-8">
12
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
13
+ <title>${r}</title>
14
+ <style>
15
+ body {
16
+ font-family: Arial, sans-serif;
17
+ line-height: 1.6;
18
+ color: #333;
19
+ max-width: 800px;
20
+ margin: 0 auto;
21
+ padding: 20px;
22
+ }
23
+ h1 {
24
+ font-size: 24px;
25
+ margin-bottom: 10px;
26
+ }
27
+ h2 {
28
+ font-size: 20px;
29
+ margin-top: 30px;
30
+ margin-bottom: 10px;
31
+ border-bottom: 1px solid #eee;
32
+ padding-bottom: 5px;
33
+ }
34
+ h3 {
35
+ font-size: 18px;
36
+ margin-top: 20px;
37
+ margin-bottom: 10px;
38
+ }
39
+ p {
40
+ margin-bottom: 15px;
41
+ }
42
+ .header {
43
+ text-align: center;
44
+ margin-bottom: 30px;
45
+ }
46
+ .footer {
47
+ margin-top: 50px;
48
+ text-align: center;
49
+ font-size: 12px;
50
+ color: #666;
51
+ border-top: 1px solid #eee;
52
+ padding-top: 20px;
53
+ }
54
+ .logo {
55
+ max-width: 200px;
56
+ margin-bottom: 20px;
57
+ }
58
+ .last-updated {
59
+ font-size: 12px;
60
+ color: #666;
61
+ margin-bottom: 30px;
62
+ }
63
+ .compliance-notice {
64
+ background-color: #f8f9fa;
65
+ border: 1px solid #e9ecef;
66
+ padding: 15px;
67
+ margin-bottom: 30px;
68
+ font-size: 14px;
69
+ }
70
+ ${U||""}
71
+ </style>
72
+ </head>
73
+ <body>
74
+ <div class="header">
75
+ ${x&&T?`<img src="${T}" alt="${S||"Company"} Logo" class="logo">`:""}
76
+ ${s?`<div class="custom-header">${s}</div>`:""}
77
+ <h1>${r}</h1>
78
+ <div class="last-updated">Last Updated: ${c}</div>
79
+ </div>`;e&&(w+=`
80
+ <div class="compliance-notice">
81
+ <strong>NDPA Compliance Notice:</strong> This privacy policy has been created to comply with the Nigeria Data Protection Act (NDPA) 2023.
82
+ It outlines how we collect, use, disclose, and protect your personal information in accordance with NDPA requirements.
83
+ </div>`);let Q=P.replace(/^## (.*?)$/gm,"<h2>$1</h2>").replace(/^### (.*?)$/gm,"<h3>$1</h3>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>");return w+=`
84
+ <div class="content">
85
+ <p>${Q}</p>
86
+ </div>
87
+
88
+ <div class="footer">
89
+ ${v?`<div class="custom-footer">${v}</div>`:""}
90
+ <p>&copy; ${new Date().getFullYear()} ${S||"Company"}. All rights reserved.</p>
91
+ </div>
92
+ </body>
93
+ </html>`,w},n=()=>chunkMQFZHA2D_js.d(null,null,function*(){D(true),G(null);try{let r=E.toLowerCase(),c="",w;switch(r){case "pdf":let rr=K();w=new Blob([rr],{type:"text/html"}),c=URL.createObjectURL(w);break;case "docx":w=new Blob([P],{type:"text/plain"}),c=URL.createObjectURL(w);break;case "html":let lr=K();w=new Blob([lr],{type:"text/html"}),c=URL.createObjectURL(w);break;default:w=new Blob([P],{type:"text/markdown"}),c=URL.createObjectURL(w);break}let Q=N(r),Y=document.createElement("a");Y.href=c,Y.download=Q,document.body.appendChild(Y),Y.click(),document.body.removeChild(Y);let dr={id:`export_${Date.now()}`,format:r,timestamp:Date.now(),url:c,filename:Q};C(rr=>[dr,...rr]),B&&B(r,c);}catch(r){console.error("Export error:",r),G("An error occurred during export. Please try again.");}finally{D(false);}}),b=()=>{let r=[{value:"pdf",label:"PDF Document (.pdf)"},{value:"docx",label:"Word Document (.docx)"},{value:"html",label:"Web Page (.html)"},{value:"markdown",label:"Markdown (.md)"}];return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",a==null?void 0:a.formatSelector,t),children:[jsxRuntime.jsx("label",{htmlFor:"export-format",className:"block text-sm font-medium mb-1",children:"Export Format"}),jsxRuntime.jsx("select",{id:"export-format",value:E,onChange:c=>X(c.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",a==null?void 0:a.formatOption,t),children:r.map(c=>jsxRuntime.jsx("option",{value:c.value,children:c.label},c.value))})]})},p=()=>H?jsxRuntime.jsxs("div",{className:"mb-6 space-y-4 border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsx("h3",{className:"text-md font-medium",children:"Advanced Export Options"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>I(false),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] text-sm",children:"Hide Advanced Options"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"custom-filename",className:"block text-sm font-medium mb-1",children:"Custom Filename"}),jsxRuntime.jsx("input",{type:"text",id:"custom-filename",value:h,onChange:r=>W(r.target.value),placeholder:J(E),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:"Leave blank to use the default filename format."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"custom-header",className:"block text-sm font-medium mb-1",children:"Custom Header HTML (for HTML/PDF exports)"}),jsxRuntime.jsx("textarea",{id:"custom-header",value:s,onChange:r=>g(r.target.value),rows:3,placeholder:"<div>Custom header content</div>",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"custom-footer",className:"block text-sm font-medium mb-1",children:"Custom Footer HTML (for HTML/PDF exports)"}),jsxRuntime.jsx("textarea",{id:"custom-footer",value:v,onChange:r=>k(r.target.value),rows:3,placeholder:"<div>Custom footer content</div>",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]}),jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:"include-compliance-notice",type:"checkbox",checked:e,onChange:r=>I(r.target.checked),className:"w-4 h-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))] dark:focus:ring-[rgb(var(--ndpr-ring))] dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsx("label",{htmlFor:"include-compliance-notice",className:"font-medium text-gray-900 dark:text-white",children:"Include NDPA Compliance Notice"}),jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Adds a notice explaining that this policy complies with NDPA requirements."})]})]})]}):jsxRuntime.jsx("button",{type:"button",onClick:()=>I(true),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] text-sm mb-6",children:"Show Advanced Options"}),u=()=>!V||m.length===0?null:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-6",a==null?void 0:a.preview,t),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Export History"}),jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 rounded-md overflow-hidden",children:jsxRuntime.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-600",children:[jsxRuntime.jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Date"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Format"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Filename"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-700 divide-y divide-gray-200 dark:divide-gray-600",children:m.map(r=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:new Date(r.timestamp).toLocaleString()}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:r.format.toUpperCase()}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:r.filename}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:jsxRuntime.jsx("a",{href:r.url,download:r.filename,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:text-[rgb(var(--ndpr-primary-hover))] dark:hover:text-[rgb(var(--ndpr-primary-hover))] mr-4",children:"Download"})})]},r.id))})]})})]});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${z}`,a==null?void 0:a.root,t),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",a==null?void 0:a.header,t),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",a==null?void 0:a.title,t),children:j}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-300",a==null?void 0:a.description,t),children:L})]}),b(),p(),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("button",{onClick:n,disabled:F,className:chunkE64TU6IU_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${A} ${F?"opacity-70 cursor-not-allowed":""}`,(a==null?void 0:a.primaryButton)||(a==null?void 0:a.exportButton),t),children:F?"Exporting...":`Export as ${E.toUpperCase()}`}),_&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-500",children:_})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",a==null?void 0:a.complianceNotice,t),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"Export Tips"}),jsxRuntime.jsxs("ul",{className:"text-blue-700 dark:text-blue-300 text-sm list-disc list-inside space-y-1",children:[jsxRuntime.jsx("li",{children:"PDF format is recommended for printing or sharing with stakeholders."}),jsxRuntime.jsx("li",{children:"HTML format is ideal for publishing on your website."}),jsxRuntime.jsx("li",{children:"DOCX format allows for further editing in Microsoft Word or similar applications."}),jsxRuntime.jsx("li",{children:"Markdown format is useful for version control systems or technical documentation."})]})]}),u()]})};exports.a=ur;exports.b=wr;exports.c=Sr;//# sourceMappingURL=chunk-BGHQTZAC.js.map
94
+ //# sourceMappingURL=chunk-BGHQTZAC.js.map
@@ -0,0 +1,7 @@
1
+ import {a}from'./chunk-AYKLAEOU.mjs';import {jsxs,jsx}from'react/jsx-runtime';import F from'react';var E=({sections:d,answers:k,onAnswerChange:y,currentSectionIndex:b,onNextSection:C,onPrevSection:P,validationErrors:$={},readOnly:x=false,className:A="",buttonClassName:D="",nextButtonText:o="Next",prevButtonText:N="Previous",submitButtonText:h="Submit",showProgress:c=true,progress:v,classNames:w={},unstyled:S=false})=>{let u=d[b],i=b===d.length-1,a$1=(e,m)=>{let n=m?w[m]:void 0;return !n&&m==="nextButton"&&(n=w.primaryButton),!n&&m==="prevButton"&&(n=w.secondaryButton),a(e,n,S)},g=e=>e.showWhen?e.showWhen.every(m=>{let n=k[m.questionId];switch(m.operator){case "equals":return n===m.value;case "contains":return Array.isArray(n)?n.includes(m.value):false;case "greaterThan":return typeof n=="number"?n>m.value:false;case "lessThan":return typeof n=="number"?n<m.value:false;default:return true}}):true,R=e=>a$1(`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"),B=e=>{if(!g(e))return null;let m=$[e.id],n=k[e.id];return jsxs("div",{className:a$1("mb-6","question"),children:[jsxs("div",{className:"mb-2",children:[jsxs("label",{htmlFor:e.id,className:a$1("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:a$1("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:n||"",onChange:s=>y(e.id,s.target.value),disabled:x,className:R(m)}),e.type==="textarea"&&jsx("textarea",{id:e.id,value:n||"",onChange:s=>y(e.id,s.target.value),disabled:x,rows:4,className:R(m)}),e.type==="select"&&e.options&&jsxs("select",{id:e.id,value:n||"",onChange:s=>y(e.id,s.target.value),disabled:x,className:R(m),children:[jsx("option",{value:"",children:"Select an option"}),e.options.map(s=>jsx("option",{value:s.value,children:s.label},s.value))]}),e.type==="radio"&&e.options&&jsx("div",{className:a$1("space-y-2","radioGroup"),children:e.options.map(s=>jsxs("div",{className:a$1("flex items-center","radioOption"),children:[jsx("input",{type:"radio",id:`${e.id}_${s.value}`,name:e.id,value:s.value,checked:n===s.value,onChange:()=>y(e.id,s.value),disabled:x,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}_${s.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:[s.label,s.riskLevel&&jsxs("span",{className:`ml-2 text-xs px-2 py-1 rounded ${s.riskLevel==="low"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":s.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:[s.riskLevel.charAt(0).toUpperCase()+s.riskLevel.slice(1)," Risk"]})]})]},s.value))}),e.type==="checkbox"&&e.options&&jsx("div",{className:"space-y-2",children:e.options.map(s=>jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"checkbox",id:`${e.id}_${s.value}`,value:s.value,checked:Array.isArray(n)?n.includes(s.value):false,onChange:L=>{let Q=Array.isArray(n)?[...n]:[];L.target.checked?y(e.id,[...Q,s.value]):y(e.id,Q.filter(j=>j!==s.value));},disabled:x,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}_${s.value}`,className:"ml-2 block text-sm text-gray-900 dark:text-gray-100",children:s.label})]},s.value))}),e.type==="scale"&&jsxs("div",{children:[jsx("div",{className:"flex justify-between mb-2",children:e.scaleLabels&&Object.entries(e.scaleLabels).map(([s,L])=>jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 text-center",style:{width:`${100/Object.keys(e.scaleLabels||{}).length}%`},children:L},s))}),jsx("input",{type:"range",id:e.id,min:e.minValue||1,max:e.maxValue||5,value:n||e.minValue||1,onChange:s=>y(e.id,parseInt(s.target.value,10)),disabled:x,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: ",n||e.minValue||1]})]}),m&&jsx("p",{className:"mt-1 text-sm text-red-500",children:m})]},e.id)};return u?jsxs("div",{className:`${a$1("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6","root")} ${A}`,children:[c&&jsxs("div",{className:a$1("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 ",b+1," of ",d.length]}),jsx("span",{children:v!==void 0?`${v}% Complete`:""})]}),jsx("div",{className:a$1("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:`${v!==void 0?v:(b+1)/d.length*100}%`}})})]}),jsx("h2",{className:a$1("text-xl font-bold mb-2 text-gray-900 dark:text-white","title"),children:u.title}),u.description&&jsx("p",{className:a$1("mb-6 text-gray-600 dark:text-gray-300","sectionTitle"),children:u.description}),jsx("div",{className:a$1("space-y-6","section"),children:u.questions.map(e=>B(e))}),jsxs("div",{className:a$1("mt-8 flex justify-between","navigation"),children:[jsx("button",{type:"button",onClick:P,disabled:b===0||x,className:`${a$1("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")} ${D}`,children:N}),jsx("button",{type:"button",onClick:C,disabled:x,className:`${a$1("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")} ${D}`,children:i?h:o})]})]}):jsx("div",{children:"No section found."})};var U=({result:d,sections:k,showFullReport:y=true,allowPrint:b=true,allowExport:C=true,onExport:P,className:$="",buttonClassName:x="",classNames:A={},unstyled:D=false})=>{let o=(i,a$1)=>{let g=a$1?A[a$1]:void 0;return !g&&a$1==="printButton"&&(g=A.primaryButton),a(i,g,D)},N=i=>new Date(i).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),v=i=>{let a=d.answers[i];return a==null?"Not answered":typeof a=="boolean"?a?"Yes":"No":Array.isArray(a)?a.join(", "):String(a)},w=()=>{window.print();},S=i=>{P&&P(i);},u=i=>jsx("span",{className:o(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",critical:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[i]}`,"riskBadge"),children:i.charAt(0).toUpperCase()+i.slice(1)});return jsxs("div",{className:`${o("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 print:shadow-none print:p-0","root")} ${$}`,children:[jsxs("div",{className:o("mb-8 border-b border-gray-200 dark:border-gray-700 pb-6 print:pb-4","header"),children:[jsxs("div",{className:"flex justify-between items-start",children:[jsxs("div",{children:[jsx("h1",{className:o("text-2xl font-bold text-gray-900 dark:text-white mb-2","title"),children:"Data Protection Impact Assessment Report"}),jsx("h2",{className:"text-xl text-gray-700 dark:text-gray-300 mb-4",children:d.title})]}),(b||C)&&jsxs("div",{className:"flex space-x-2 print:hidden",children:[b&&jsx("button",{onClick:w,className:`${o("px-3 py-1 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600","printButton")} ${x}`,children:jsxs("span",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z"})}),"Print"]})}),C&&jsx("div",{className:"relative inline-block",children:jsx("button",{onClick:()=>S("pdf"),className:`px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${x}`,children:jsxs("span",{className:"flex items-center",children:[jsx("svg",{className:"w-4 h-4 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Export PDF"]})})})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Assessor:"})," ",d.assessor.name,", ",d.assessor.role]}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Contact:"})," ",d.assessor.email]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Started:"})," ",N(d.startedAt)]}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Completed:"})," ",d.completedAt?N(d.completedAt):"In progress"]}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Next review:"})," ",d.reviewDate?N(d.reviewDate):"Not scheduled"]})]})]})]}),jsxs("div",{className:o("mb-8","summary"),children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Executive Summary"}),jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("span",{className:"font-medium mr-2",children:"Overall Risk Level:"}),u(d.overallRiskLevel)]}),jsxs("div",{className:o("mb-2","conclusion"),children:[jsx("span",{className:"font-medium",children:"Conclusion:"})," ",d.conclusion]}),jsxs("div",{children:[jsx("span",{className:"font-medium",children:"Can Proceed:"})," ",d.canProceed?"Yes":"No"]})]}),jsxs("div",{children:[jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Processing Activity Description"}),jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-4",children:d.processingDescription}),d.recommendations&&d.recommendations.length>0&&jsxs("div",{children:[jsx("h3",{className:"font-medium text-gray-900 dark:text-white mb-2",children:"Key Recommendations"}),jsx("ul",{className:"list-disc pl-5 text-gray-700 dark:text-gray-300",children:d.recommendations.map((i,a)=>jsx("li",{className:o("","recommendation"),children:i},a))})]})]})]}),jsxs("div",{className:"mb-8",children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Identified Risks"}),d.risks.length===0?jsx("p",{className:"text-gray-700 dark:text-gray-300",children:"No risks identified."}):jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:o("min-w-full divide-y divide-gray-200 dark:divide-gray-700","riskTable"),children:[jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Risk"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Likelihood"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Impact"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Risk Level"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Mitigated"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:d.risks.map(i=>jsxs("tr",{className:o("","riskRow"),children:[jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:i.description}),jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[i.likelihood," / 5"]}),jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[i.impact," / 5"]}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:u(i.level)}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:i.mitigated?jsx("span",{className:"text-green-600 dark:text-green-400",children:"Yes"}):jsx("span",{className:"text-red-600 dark:text-red-400",children:"No"})})]},i.id))})]})})]}),y&&jsxs("div",{children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Full Assessment Details"}),k.map(i=>{let a=i.questions.filter(g=>d.answers[g.id]!==void 0);return a.length===0?null:jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:i.title}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:jsxs("tr",{children:[jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Question"}),jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-600 dark:text-gray-300 uppercase tracking-wider",children:"Answer"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:a.map(g=>jsxs("tr",{children:[jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:g.text}),jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-600 dark:text-gray-400",children:v(g.id)})]},g.id))})]})})]},i.id)})]}),jsxs("div",{className:"mt-8 pt-4 border-t border-gray-200 dark:border-gray-700 text-sm text-gray-600 dark:text-gray-400",children:[jsx("p",{children:"This DPIA was conducted in accordance with the Nigeria Data Protection Act (NDPA) 2023."}),jsxs("p",{children:["DPIA Report Version: ",d.version]}),jsxs("p",{children:["Generated on: ",new Date().toLocaleDateString()]})]})]})};var K=({steps:d,onStepClick:k,clickable:y=true,orientation:b="horizontal",className:C="",activeStepClassName:P="",completedStepClassName:$="",incompleteStepClassName:x="",classNames:A={},unstyled:D=false})=>{let o=(c,v)=>a(c,v?A[v]:void 0,D),N=c=>{y&&k&&k(c);},h=b==="vertical";return jsx("div",{className:`${o(h?"flex flex-col space-y-4":"flex items-center justify-between","root")} ${C}`,children:d.map((c,v)=>{let w=v===d.length-1,S=c.active?o(`font-medium ${P||"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]"}`,"label"):c.completed?o($||"text-green-600 dark:text-green-400","label"):o(x||"text-gray-600 dark:text-gray-400","label"),u=c.active?o("flex items-center justify-center w-8 h-8 rounded-full bg-[rgb(var(--ndpr-primary)/0.1)] dark:bg-[rgb(var(--ndpr-primary)/0.2)] text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] border-2 border-[rgb(var(--ndpr-primary))] dark:border-[rgb(var(--ndpr-primary))]","stepActive"):c.completed?o("flex items-center justify-center w-8 h-8 rounded-full bg-green-100 dark:bg-green-900 text-green-600 dark:text-green-400 border-2 border-green-600 dark:border-green-400","stepCompleted"):o("flex items-center justify-center w-8 h-8 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400 border-2 border-gray-300 dark:border-gray-600","stepPending");return jsxs(F.Fragment,{children:[jsxs("div",{className:o(`${h?"flex items-start":"flex flex-col items-center"} ${y?"cursor-pointer":""}`,"step"),onClick:()=>N(c.id),children:[jsx("div",{className:`
2
+ flex items-center justify-center
3
+ ${h?"mr-4":""}
4
+ `,children:jsx("div",{className:u,children:c.icon?c.icon:c.completed?jsx("svg",{className:"w-4 h-4",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}):jsx("span",{children:v+1})})}),jsxs("div",{className:`
5
+ ${h?"flex-1":"mt-2 text-center"}
6
+ `,children:[jsx("div",{className:`text-sm font-medium ${S}`,children:c.label}),c.description&&jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:c.description})]})]}),!w&&jsx("div",{className:o(h?"ml-4 h-8 border-l-2 border-gray-300 dark:border-gray-600":"w-full border-t-2 border-gray-300 dark:border-gray-600 hidden sm:block","connector")})]},c.id)})})};export{E as a,U as b,K as c};//# sourceMappingURL=chunk-BZTTQS4A.mjs.map
7
+ //# sourceMappingURL=chunk-BZTTQS4A.mjs.map
@@ -0,0 +1,63 @@
1
+ import {a}from'./chunk-WWT2ZSNU.mjs';function f(i,u){if(typeof i=="string"){let a=i,o=u,r=a,n=/\{\{([^}]+)\}\}/g,c;for(;(c=n.exec(a))!==null;){let e=c[1].trim(),t=o[e]||"";r=r.replace(new RegExp(`\\{\\{\\s*${e}\\s*\\}\\}`,"g"),t);}return r}else {let a=i,o=u,r={},n=[];return a.filter(e=>e.included).sort((e,t)=>(e.order||0)-(t.order||0)).forEach(e=>{let t=e.template||e.customContent||e.defaultContent||"",m=/\{\{([^}]+)\}\}/g,p,g=[];for(;(p=m.exec(t))!==null;)g.push(p[1].trim());g.forEach(s=>{let l="";s in o&&(l=o[s]||""),l||n.push(s),t=t.replace(new RegExp(`\\{\\{\\s*${s}\\s*\\}\\}`,"g"),l);}),r[e.id]=t;}),{fullText:Object.values(r).join(`
2
+
3
+ `),sectionTexts:r,missingVariables:Array.from(new Set(n))}}}var h=[{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
+
5
+ - Consent: where you have given clear, informed, and voluntary consent for a specific purpose.
6
+ - Contract: where processing is necessary to fulfil a contract with you or to take steps at your request before entering a contract.
7
+ - Legal obligation: where processing is required to comply with applicable Nigerian law.
8
+ - Vital interest: where processing is necessary to protect your life or that of another person.
9
+ - Public interest: where processing is necessary for the performance of a task carried out in the public interest.
10
+ - Legitimate interest: where processing is necessary for our legitimate interests, provided these are not overridden by your rights and freedoms.`,variables:["orgName"]},{id:"data-usage",title:"Data Usage",description:"Explains the purposes for which personal data is processed.",order:3,required:true,included:true,template:`We use the personal data we collect for the following purposes:
11
+
12
+ - Providing and improving our services at {{website}}.
13
+ - Communicating with you regarding your account, enquiries, or support requests.
14
+ - Sending relevant updates, where you have opted in to receive them.
15
+ - Ensuring the security and integrity of our platform.
16
+ - Complying with legal and regulatory obligations under Nigerian law.
17
+ - Conducting analytics to improve user experience and service quality.
18
+
19
+ We will not process your data for purposes incompatible with those stated above without providing you with notice and, where required, obtaining your consent.`,variables:["website"]},{id:"data-sharing",title:"Data Sharing and Disclosure",description:"Details when and with whom personal data may be shared.",order:4,required:true,included:true,template:`{{orgName}} does not sell personal data. We may share your data with the following categories of recipients:
20
+
21
+ - Service providers and processors who assist us in operating our services, under strict data processing agreements.
22
+ - Regulatory and law enforcement authorities when required by Nigerian law or valid legal process.
23
+ - Professional advisers, including lawyers, auditors, and insurers, where necessary.
24
+ - Business partners, only with your explicit consent and for clearly stated purposes.
25
+
26
+ Any cross-border transfer of personal data will comply with the requirements of the NDPA 2023, including ensuring adequate safeguards are in place in the receiving jurisdiction.`,variables:["orgName"]},{id:"data-subject-rights",title:"Data Subject Rights",description:"Outlines the rights of data subjects under the NDPA.",order:5,required:true,included:true,template:`Under the NDPA 2023, you have the following rights regarding your personal data:
27
+
28
+ - Right of access: request a copy of the personal data we hold about you.
29
+ - Right to rectification: request correction of inaccurate or incomplete data.
30
+ - Right to erasure: request deletion of your personal data where there is no compelling reason for continued processing.
31
+ - Right to restrict processing: request limitation of how we process your data.
32
+ - Right to data portability: receive your data in a structured, commonly used format.
33
+ - Right to object: object to processing based on legitimate interest or for direct marketing purposes.
34
+ - Right to withdraw consent: withdraw previously given consent at any time without affecting prior processing.
35
+
36
+ To exercise any of these rights, contact us at {{privacyEmail}}. We will respond to your request within 30 days.`,variables:["privacyEmail"]},{id:"data-retention",title:"Data Retention",description:"Describes how long personal data is retained and the criteria for retention periods.",order:6,required:true,included:true,template:`{{orgName}} retains personal data only for as long as necessary to fulfil the purposes for which it was collected, or as required by applicable Nigerian law. Retention periods are determined based on:
37
+
38
+ - The nature of the data and the purposes for processing.
39
+ - Legal, regulatory, and contractual obligations.
40
+ - Legitimate business needs such as maintaining records for audits or dispute resolution.
41
+
42
+ When personal data is no longer needed, it will be securely deleted or anonymised in accordance with our data retention policy.`,variables:["orgName"]},{id:"data-security",title:"Data Security",description:"Describes the security measures in place to protect personal data.",order:7,required:true,included:true,template:`We implement appropriate technical and organisational measures to protect personal data against unauthorised access, alteration, disclosure, or destruction. These measures include:
43
+
44
+ - Encryption of data in transit and at rest.
45
+ - Access controls and authentication mechanisms.
46
+ - Regular security assessments and vulnerability testing.
47
+ - Staff training on data protection and information security.
48
+ - Incident response procedures in line with NDPA breach notification requirements.
49
+
50
+ While we strive to protect your data, no method of transmission or storage is completely secure. If you become aware of any security incident, please contact us immediately at {{privacyEmail}}.`,variables:["privacyEmail"]},{id:"contact-info",title:"Contact Information",description:"Provides contact details for privacy-related enquiries and the Data Protection Officer.",order:8,required:true,included:true,template:`If you have questions, concerns, or requests regarding this privacy policy or our data practices, please contact us:
51
+
52
+ Organisation: {{orgName}}
53
+ Address: {{address}}
54
+ Email: {{privacyEmail}}
55
+ Website: {{website}}
56
+
57
+ Data Protection Officer: {{dpoName}}
58
+ DPO Email: {{dpoEmail}}
59
+
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
+
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"]}],y=[{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 v(){return {sections:h.map(i=>a({},i)),variables:y.map(i=>a({},i))}}export{f as a,h as b,y as c,v as d};//# sourceMappingURL=chunk-CAB7O3GR.mjs.map
63
+ //# sourceMappingURL=chunk-CAB7O3GR.mjs.map
@@ -0,0 +1,7 @@
1
+ 'use strict';var chunkIQF726GS_js=require('./chunk-IQF726GS.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var M=[{value:"adequacy_decision",label:"Adequacy Decision (Section 41)"},{value:"standard_clauses",label:"Standard Contractual Clauses (Section 42)"},{value:"binding_corporate_rules",label:"Binding Corporate Rules (Section 43)"},{value:"ndpc_authorization",label:"NDPC Authorization (Section 44)"},{value:"explicit_consent",label:"Explicit Consent (Section 45(a))"},{value:"contract_performance",label:"Contract Performance (Section 45(b))"},{value:"public_interest",label:"Public Interest (Section 45(c))"},{value:"legal_claims",label:"Legal Claims (Section 45(d))"},{value:"vital_interests",label:"Vital Interests (Section 45(e))"}],H=[{value:"adequate",label:"Adequate"},{value:"inadequate",label:"Inadequate"},{value:"pending_review",label:"Pending Review"},{value:"unknown",label:"Unknown"}],Y=[{value:"one_time",label:"One-Time"},{value:"periodic",label:"Periodic"},{value:"continuous",label:"Continuous"}],Q=[{value:"active",label:"Active"},{value:"suspended",label:"Suspended"},{value:"terminated",label:"Terminated"},{value:"pending_approval",label:"Pending Approval"}],W={destinationCountry:"",destinationCountryCode:"",adequacyStatus:"unknown",transferMechanism:"adequacy_decision",dataCategories:"",includesSensitiveData:false,estimatedDataSubjects:"",recipientOrganization:"",recipientContactName:"",recipientContactEmail:"",recipientContactPhone:"",recipientContactAddress:"",purpose:"",safeguards:"",riskAssessment:"",riskLevel:"medium",frequency:"one_time",status:"active",tiaCompleted:false,tiaReference:"",ndpcApprovalApplied:false,ndpcApprovalApproved:false,ndpcApprovalReference:""},xe=({transfers:c,onAddTransfer:P,onUpdateTransfer:F,onRemoveTransfer:B,summary:G,title:K="Cross-Border Data Transfer Manager",description:J="Manage and document cross-border personal data transfers in compliance with NDPA 2023 Part VI (Sections 41-45).",className:X="",buttonClassName:T="",showSummary:Z=true,showTIA:ee=true,classNames:r,unstyled:o})=>{let[v,D]=react.useState(null),[I,x]=react.useState(false),[y,O]=react.useState(null),[i,R]=react.useState(W),[f,_]=react.useState(null),[C,te]=react.useState("all"),[A,re]=react.useState("all"),[k,ae]=react.useState(c);react.useEffect(()=>{let t=[...c];C!=="all"&&(t=t.filter(a=>a.status===C)),A!=="all"&&(t=t.filter(a=>a.transferMechanism===A)),t.sort((a,l)=>l.updatedAt-a.updatedAt),ae(t);},[c,C,A]),react.useEffect(()=>{k.length>0&&!v&&D(k[0].id);},[k,v]);let j=v?c.find(t=>t.id===v):null,h=t=>new Date(t).toLocaleDateString(),w=()=>{R(W),O(null),_(null);},ne=()=>{w(),x(true);},ie=t=>{var a,l,u,b;O(t.id),R({destinationCountry:t.destinationCountry,destinationCountryCode:t.destinationCountryCode||"",adequacyStatus:t.adequacyStatus,transferMechanism:t.transferMechanism,dataCategories:t.dataCategories.join(", "),includesSensitiveData:t.includesSensitiveData,estimatedDataSubjects:((a=t.estimatedDataSubjects)==null?void 0:a.toString())||"",recipientOrganization:t.recipientOrganization,recipientContactName:t.recipientContact.name,recipientContactEmail:t.recipientContact.email,recipientContactPhone:t.recipientContact.phone||"",recipientContactAddress:t.recipientContact.address||"",purpose:t.purpose,safeguards:t.safeguards.join(`
2
+ `),riskAssessment:t.riskAssessment,riskLevel:t.riskLevel,frequency:t.frequency,status:t.status,tiaCompleted:t.tiaCompleted,tiaReference:t.tiaReference||"",ndpcApprovalApplied:((l=t.ndpcApproval)==null?void 0:l.applied)||false,ndpcApprovalApproved:((u=t.ndpcApproval)==null?void 0:u.approved)||false,ndpcApprovalReference:((b=t.ndpcApproval)==null?void 0:b.referenceNumber)||""}),x(true);},p=(t,a)=>{R(l=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},l),{[t]:a}));},de=()=>{let t=chunkIQF726GS_js.a(i.transferMechanism),a=Date.now();return {destinationCountry:i.destinationCountry.trim(),destinationCountryCode:i.destinationCountryCode.trim()||void 0,adequacyStatus:i.adequacyStatus,transferMechanism:i.transferMechanism,dataCategories:i.dataCategories.split(",").map(l=>l.trim()).filter(Boolean),includesSensitiveData:i.includesSensitiveData,estimatedDataSubjects:i.estimatedDataSubjects?parseInt(i.estimatedDataSubjects,10):void 0,recipientOrganization:i.recipientOrganization.trim(),recipientContact:{name:i.recipientContactName.trim(),email:i.recipientContactEmail.trim(),phone:i.recipientContactPhone.trim()||void 0,address:i.recipientContactAddress.trim()||void 0},purpose:i.purpose.trim(),safeguards:i.safeguards.split(`
3
+ `).map(l=>l.trim()).filter(Boolean),riskAssessment:i.riskAssessment.trim(),riskLevel:i.riskLevel,frequency:i.frequency,status:t&&!i.ndpcApprovalApproved?"pending_approval":i.status,tiaCompleted:i.tiaCompleted,tiaReference:i.tiaReference.trim()||void 0,ndpcApproval:t?{required:true,applied:i.ndpcApprovalApplied,approved:i.ndpcApprovalApproved||void 0,referenceNumber:i.ndpcApprovalReference.trim()||void 0,appliedAt:i.ndpcApprovalApplied?a:void 0,approvedAt:i.ndpcApprovalApproved?a:void 0}:void 0,startDate:a,reviewDate:a+365*24*60*60*1e3}},oe=()=>{let t=de(),a=chunkMQFZHA2D_js.a({id:y||"temp",createdAt:Date.now(),updatedAt:Date.now()},t),l=chunkIQF726GS_js.c(a);_(l),l.isValid&&(y?F&&F(y,t):P&&P(t),w(),x(false));},le=t=>{B&&B(t),v===t&&D(null);},E=t=>jsxRuntime.jsxs("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{low:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",medium:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",high:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}[t]}`,r==null?void 0:r.riskBadge,o),children:[t.charAt(0).toUpperCase()+t.slice(1)," Risk"]}),L=t=>{let a={active:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",suspended:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",terminated:"bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200",pending_approval:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200"},l={active:"Active",suspended:"Suspended",terminated:"Terminated",pending_approval:"Pending Approval"};return jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${a[t]}`,r==null?void 0:r.statusBadge,o),children:l[t]})},pe=t=>{var u;let a=chunkIQF726GS_js.a(t),l=((u=M.find(b=>b.value===t))==null?void 0:u.label)||t;return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${a?"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200":"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200"}`,children:l})},se=()=>{let t=G||{totalActiveTransfers:c.filter(a=>a.status==="active").length,pendingApproval:c.filter(a=>{var l,u;return a.status==="pending_approval"||((l=a.ndpcApproval)==null?void 0:l.required)&&!((u=a.ndpcApproval)!=null&&u.approved)}),highRiskTransfers:c.filter(a=>a.riskLevel==="high"&&a.status==="active"),missingTIA:c.filter(a=>!a.tiaCompleted&&a.status==="active")};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 grid grid-cols-2 md:grid-cols-4 gap-4",r==null?void 0:r.summary,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-blue-50 dark:bg-blue-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-blue-800 dark:text-blue-200",children:t.totalActiveTransfers}),jsxRuntime.jsx("p",{className:"text-sm text-blue-600 dark:text-blue-300",children:"Active Transfers"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-purple-50 dark:bg-purple-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-purple-800 dark:text-purple-200",children:t.pendingApproval.length}),jsxRuntime.jsx("p",{className:"text-sm text-purple-600 dark:text-purple-300",children:"Pending Approval"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-red-50 dark:bg-red-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-red-800 dark:text-red-200",children:t.highRiskTransfers.length}),jsxRuntime.jsx("p",{className:"text-sm text-red-600 dark:text-red-300",children:"High Risk"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-yellow-50 dark:bg-yellow-900/20 p-4 rounded-lg",r==null?void 0:r.summaryCard,o),children:[jsxRuntime.jsx("p",{className:"text-2xl font-bold text-yellow-800 dark:text-yellow-200",children:t.missingTIA.length}),jsxRuntime.jsx("p",{className:"text-sm text-yellow-600 dark:text-yellow-300",children:"Missing TIA"})]})]})},ue=()=>{let t=chunkIQF726GS_js.a(i.transferMechanism);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-gray-50 dark:bg-gray-700 p-6 rounded-lg mb-6",r==null?void 0:r.form,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex justify-between items-center mb-4",r==null?void 0:r.header,o),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:y?"Edit Transfer":"Add New Transfer"}),jsxRuntime.jsx("button",{onClick:()=>{w(),x(false);},className:"text-gray-600 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:"Cancel"})]}),f&&!f.isValid&&jsxRuntime.jsxs("div",{className:"mb-4 bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Please fix the following errors:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-red-700 dark:text-red-300",children:f.errors.map((a,l)=>jsxRuntime.jsx("li",{children:a},l))})]}),f&&f.warnings.length>0&&jsxRuntime.jsxs("div",{className:"mb-4 bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-1",children:"Warnings:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-yellow-700 dark:text-yellow-300",children:f.warnings.map((a,l)=>jsxRuntime.jsx("li",{children:a},l))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Destination Country ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",value:i.destinationCountry,onChange:a=>p("destinationCountry",a.target.value),placeholder:"e.g. United Kingdom",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Country Code (ISO)"}),jsxRuntime.jsx("input",{type:"text",value:i.destinationCountryCode,onChange:a=>p("destinationCountryCode",a.target.value),placeholder:"e.g. GB",maxLength:3,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Organization ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",value:i.recipientOrganization,onChange:a=>p("recipientOrganization",a.target.value),placeholder:"Organization name",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Transfer Mechanism ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("select",{value:i.transferMechanism,onChange:a=>p("transferMechanism",a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:M.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Adequacy Status"}),jsxRuntime.jsx("select",{value:i.adequacyStatus,onChange:a=>p("adequacyStatus",a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:H.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Risk Level"}),jsxRuntime.jsxs("select",{value:i.riskLevel,onChange:a=>p("riskLevel",a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"low",children:"Low"}),jsxRuntime.jsx("option",{value:"medium",children:"Medium"}),jsxRuntime.jsx("option",{value:"high",children:"High"})]})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Data Categories ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",value:i.dataCategories,onChange:a=>p("dataCategories",a.target.value),placeholder:"Comma-separated, e.g. Names, Email addresses, Phone numbers",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"includesSensitiveData",checked:i.includesSensitiveData,onChange:a=>p("includesSensitiveData",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"includesSensitiveData",className:"text-sm font-medium",children:"Includes sensitive personal data"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Estimated Data Subjects"}),jsxRuntime.jsx("input",{type:"number",value:i.estimatedDataSubjects,onChange:a=>p("estimatedDataSubjects",a.target.value),placeholder:"Number of data subjects",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Contact Name ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",value:i.recipientContactName,onChange:a=>p("recipientContactName",a.target.value),placeholder:"Contact person name",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Recipient Contact Email ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",value:i.recipientContactEmail,onChange:a=>p("recipientContactEmail",a.target.value),placeholder:"contact@example.com",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Recipient Contact Phone"}),jsxRuntime.jsx("input",{type:"text",value:i.recipientContactPhone,onChange:a=>p("recipientContactPhone",a.target.value),placeholder:"Phone number",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Recipient Contact Address"}),jsxRuntime.jsx("input",{type:"text",value:i.recipientContactAddress,onChange:a=>p("recipientContactAddress",a.target.value),placeholder:"Address",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Purpose of Transfer ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{value:i.purpose,onChange:a=>p("purpose",a.target.value),placeholder:"Describe the purpose of this data transfer",rows:2,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Safeguards ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{value:i.safeguards,onChange:a=>p("safeguards",a.target.value),placeholder:`One safeguard per line, e.g.
4
+ End-to-end encryption
5
+ Access control policies
6
+ Regular security audits`,rows:3,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:["Risk Assessment Summary ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("textarea",{value:i.riskAssessment,onChange:a=>p("riskAssessment",a.target.value),placeholder:"Summarize the risk assessment for this transfer",rows:2,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Transfer Frequency"}),jsxRuntime.jsx("select",{value:i.frequency,onChange:a=>p("frequency",a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:Y.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"Status"}),jsxRuntime.jsx("select",{value:i.status,onChange:a=>p("status",a.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:Q.map(a=>jsxRuntime.jsx("option",{value:a.value,children:a.label},a.value))})]})]}),t&&jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-blue-800 dark:text-blue-200 mb-3",children:"NDPC Approval Required"}),jsxRuntime.jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300 mb-3",children:"The selected transfer mechanism requires approval from the Nigeria Data Protection Commission."}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"ndpcApprovalApplied",checked:i.ndpcApprovalApplied,onChange:a=>p("ndpcApprovalApplied",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"ndpcApprovalApplied",className:"text-sm",children:"Application submitted"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"ndpcApprovalApproved",checked:i.ndpcApprovalApproved,onChange:a=>p("ndpcApprovalApproved",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"ndpcApprovalApproved",className:"text-sm",children:"Approval granted"})]}),jsxRuntime.jsxs("div",{className:"md:col-span-2",children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"NDPC Reference Number"}),jsxRuntime.jsx("input",{type:"text",value:i.ndpcApprovalReference,onChange:a=>p("ndpcApprovalReference",a.target.value),placeholder:"Reference number (if available)",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]})]}),ee&&jsxRuntime.jsxs("div",{className:"mt-4 p-4 bg-gray-100 dark:bg-gray-600 rounded-md",children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium mb-3",children:"Transfer Impact Assessment"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("input",{type:"checkbox",id:"tiaCompleted",checked:i.tiaCompleted,onChange:a=>p("tiaCompleted",a.target.checked),className:"h-4 w-4 text-[rgb(var(--ndpr-primary))] border-gray-300 rounded focus:ring-[rgb(var(--ndpr-ring))]"}),jsxRuntime.jsx("label",{htmlFor:"tiaCompleted",className:"text-sm",children:"TIA completed"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:"TIA Reference"}),jsxRuntime.jsx("input",{type:"text",value:i.tiaReference,onChange:a=>p("tiaReference",a.target.value),placeholder:"Document reference",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.input,o)})]})]})]}),jsxRuntime.jsxs("div",{className:"mt-4 flex justify-end gap-3",children:[jsxRuntime.jsx("button",{onClick:()=>{w(),x(false);},className:"px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-md text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-600",children:"Cancel"}),jsxRuntime.jsx("button",{onClick:oe,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:y?"Update Transfer":"Add Transfer"})]})]})},me=t=>{var u,b;let a=chunkIQF726GS_js.d(t),l=chunkIQF726GS_js.c(t);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",r==null?void 0:r.detailPanel,o),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsxs("h3",{className:"text-lg font-medium",children:[t.destinationCountry," \u2014 ",t.recipientOrganization]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[L(t.status),E(t.riskLevel)]})]}),!l.isValid&&jsxRuntime.jsxs("div",{className:"mb-4 bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-red-800 dark:text-red-200 mb-1",children:"Compliance Issues"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-red-700 dark:text-red-300",children:l.errors.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]}),l.warnings.length>0&&jsxRuntime.jsxs("div",{className:"mb-4 bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium text-yellow-800 dark:text-yellow-200 mb-1",children:"Warnings"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-yellow-700 dark:text-yellow-300",children:l.warnings.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-6",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Destination:"})," ",t.destinationCountry,t.destinationCountryCode?` (${t.destinationCountryCode})`:""]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Adequacy:"})," ",(u=H.find(s=>s.value===t.adequacyStatus))==null?void 0:u.label]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Frequency:"})," ",(b=Y.find(s=>s.value===t.frequency))==null?void 0:b.label]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Start Date:"})," ",h(t.startDate)]}),t.endDate&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"End Date:"})," ",h(t.endDate)]}),t.reviewDate&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Next Review:"})," ",h(t.reviewDate)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Recipient:"})," ",t.recipientOrganization]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Contact:"})," ",t.recipientContact.name," (",t.recipientContact.email,")"]}),t.estimatedDataSubjects&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Data Subjects:"})," ",t.estimatedDataSubjects.toLocaleString()]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Sensitive Data:"})," ",t.includesSensitiveData?"Yes":"No"]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Transfer Mechanism"}),jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200",children:chunkIQF726GS_js.b(t.transferMechanism)})})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Purpose"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md",children:t.purpose})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Data Categories"}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-1",children:t.dataCategories.map((s,m)=>jsxRuntime.jsx("span",{className:"px-2 py-1 bg-gray-100 dark:bg-gray-600 rounded text-xs",children:s},m))})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Safeguards"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-sm text-gray-600 dark:text-gray-300",children:t.safeguards.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Risk Assessment"}),jsxRuntime.jsxs("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-200 mb-2",children:t.riskAssessment}),jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsxs("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:["Automated Assessment (Score: ",a.riskScore,")"]}),a.factors.length>0&&jsxRuntime.jsx("ul",{className:"list-disc list-inside text-xs text-gray-600 dark:text-gray-400",children:a.factors.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))}),a.recommendations.length>0&&jsxRuntime.jsxs("div",{className:"mt-2",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Recommendations:"}),jsxRuntime.jsx("ul",{className:"list-disc list-inside text-xs text-gray-600 dark:text-gray-400",children:a.recommendations.map((s,m)=>jsxRuntime.jsx("li",{children:s},m))})]})]})]})]}),t.ndpcApproval&&jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"NDPC Approval"}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md ${t.ndpcApproval.approved?"bg-green-50 dark:bg-green-900/20":t.ndpcApproval.applied?"bg-yellow-50 dark:bg-yellow-900/20":"bg-red-50 dark:bg-red-900/20"}`,r==null?void 0:r.approvalStatus,o),children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",t.ndpcApproval.approved?"Approved":t.ndpcApproval.applied?"Application Submitted":"Not Applied"]}),t.ndpcApproval.referenceNumber&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference:"})," ",t.ndpcApproval.referenceNumber]}),t.ndpcApproval.appliedAt&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Applied:"})," ",h(t.ndpcApproval.appliedAt)]}),t.ndpcApproval.approvedAt&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Approved:"})," ",h(t.ndpcApproval.approvedAt)]})]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-1",children:"Transfer Impact Assessment"}),jsxRuntime.jsxs("div",{className:`p-3 rounded-md ${t.tiaCompleted?"bg-green-50 dark:bg-green-900/20":"bg-yellow-50 dark:bg-yellow-900/20"}`,children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",t.tiaCompleted?"Completed":"Not Completed"]}),t.tiaReference&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Reference:"})," ",t.tiaReference]})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-3 mt-6",children:[jsxRuntime.jsx("button",{onClick:()=>ie(t),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,children:"Edit"}),jsxRuntime.jsx("button",{onClick:()=>le(t.id),className:"px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700",children:"Remove"})]})]})};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${X}`,r==null?void 0:r.root,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",r==null?void 0:r.title,o),children:K}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:J}),Z&&se(),!I&&jsxRuntime.jsx("div",{className:"mb-6",children:jsxRuntime.jsx("button",{onClick:ne,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] ${T}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.submitButton),o),children:"Add Transfer"})}),I&&ue(),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cbStatusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxRuntime.jsxs("select",{id:"cbStatusFilter",value:C,onChange:t=>te(t.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Statuses"}),Q.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"cbMechanismFilter",className:"block text-sm font-medium mb-1",children:"Mechanism Filter"}),jsxRuntime.jsxs("select",{id:"cbMechanismFilter",value:A,onChange:t=>re(t.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",r==null?void 0:r.select,o),children:[jsxRuntime.jsx("option",{value:"all",children:"All Mechanisms"}),M.map(t=>jsxRuntime.jsx("option",{value:t.value,children:t.label},t.value))]})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxRuntime.jsxs("div",{className:"md:col-span-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Transfers"}),k.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No cross-border transfers found."}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",r==null?void 0:r.transferList,o),children:k.map(t=>{var a,l;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md cursor-pointer ${v===t.id?"bg-[rgb(var(--ndpr-primary)/0.05)] dark:bg-[rgb(var(--ndpr-primary)/0.1)] border border-[rgb(var(--ndpr-primary)/0.2)] dark:border-[rgb(var(--ndpr-primary)/0.3)]":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,r==null?void 0:r.transferItem,o),onClick:()=>D(t.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:t.destinationCountry}),E(t.riskLevel)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:t.recipientOrganization}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:pe(t.transferMechanism)}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[L(t.status),((a=t.ndpcApproval)==null?void 0:a.required)&&!((l=t.ndpcApproval)!=null&&l.approved)&&jsxRuntime.jsx("span",{className:"text-xs text-purple-600 dark:text-purple-400",children:"NDPC Pending"})]})]},t.id)})})]}),jsxRuntime.jsx("div",{className:"md:col-span-2",children:j?me(j):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Select a transfer to view details"})})})]})]})};exports.a=xe;//# sourceMappingURL=chunk-CL53OI3I.js.map
7
+ //# sourceMappingURL=chunk-CL53OI3I.js.map
@@ -0,0 +1,2 @@
1
+ 'use strict';function s(t,n,r){return r?n||"":n||t}exports.a=s;//# sourceMappingURL=chunk-E64TU6IU.js.map
2
+ //# sourceMappingURL=chunk-E64TU6IU.js.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkCMZTI7SG_js=require('./chunk-CMZTI7SG.js'),chunkEPF7J2FK_js=require('./chunk-EPF7J2FK.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var ke=({requestTypes:A,onSubmit:z,onValidationError:M,title:K="Submit a Data Subject Request",description:te="Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA), Part IV, Sections 29-36.",submitButtonText:oe="Submit Request",className:W="",buttonClassName:H="",showConfirmation:re=true,confirmationMessage:ie="Your request has been submitted successfully. You will receive a confirmation email shortly.",requireIdentityVerification:V=true,identifierTypes:l=[{id:"email",label:"Email Address"},{id:"account",label:"Account Number"},{id:"customer_id",label:"Customer ID"}],collectAdditionalContact:b=true,labels:D={},classNames:e,unstyled:m=false,isSubmitting:C=false,defaultValues:k,onReset:$})=>{var t,d,h,q,se,ge;let[I,_]=react.useState((k==null?void 0:k.requestType)||""),[E,F]=react.useState(((t=k==null?void 0:k.dataSubject)==null?void 0:t.fullName)||""),[B,L]=react.useState(((d=k==null?void 0:k.dataSubject)==null?void 0:d.email)||""),[Y,Z]=react.useState(((h=k==null?void 0:k.dataSubject)==null?void 0:h.phone)||""),[ae,P]=react.useState(((q=k==null?void 0:k.dataSubject)==null?void 0:q.identifierType)||((se=l[0])==null?void 0:se.id)||""),[G,Q]=react.useState(((ge=k==null?void 0:k.dataSubject)==null?void 0:ge.identifierValue)||""),[j,J]=react.useState((k==null?void 0:k.additionalInfo)||{}),[T,U]=react.useState(false),[o,i]=react.useState({}),v=()=>{var r;_(""),F(""),L(""),Z(""),P(((r=l[0])==null?void 0:r.id)||""),Q(""),J({}),U(false),i({}),$==null||$();},u=A.find(r=>r.id===I),R=r=>{_(r.target.value),J({});},s=(r,w)=>{J(X=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},X),{[r]:w}));},x=()=>{let r={};return E.trim()||(r.fullName="Full name is required"),B.trim()?/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(B)||(r.email="Email is invalid"):r.email="Email is required",I||(r.requestType="Please select a request type"),V&&!G.trim()&&(r.identifierValue="Identifier value is required"),u!=null&&u.requiresAdditionalInfo&&u.additionalFields&&u.additionalFields.forEach(w=>{w.required&&!j[w.id]&&(r[`additional_${w.id}`]=`${w.label} is required`);}),i(r),r},S=r=>{r.preventDefault();let w=x();if(Object.keys(w).length>0){M==null||M(w);return}let X=Object.keys(j).length>0?Object.fromEntries(Object.entries(j).map(([be,le])=>[be,typeof le=="string"?chunkEPF7J2FK_js.a(le):le])):void 0,ne={requestType:I,dataSubject:{fullName:chunkEPF7J2FK_js.a(E),email:chunkEPF7J2FK_js.a(B),phone:Y?chunkEPF7J2FK_js.a(Y):void 0,identifierType:ae,identifierValue:chunkEPF7J2FK_js.a(G)},additionalInfo:X,submittedAt:Date.now()};z(ne),re&&U(true);};return T?jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${W}`,e==null?void 0:e.successMessage,m),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-lg font-bold text-green-800 dark:text-green-200 mb-2",e==null?void 0:e.title,m),children:"Request Submitted"}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-green-700 dark:text-green-300",e==null?void 0:e.description,m),children:ie}),jsxRuntime.jsx("button",{onClick:()=>U(false),className:chunkE64TU6IU_js.a(`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${H}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),m),children:"Submit Another Request"})]}):jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${W}`,e==null?void 0:e.root,m),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",e==null?void 0:e.title,m),children:K}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("mb-6 text-gray-600 dark:text-gray-300",e==null?void 0:e.description,m),children:te}),jsxRuntime.jsx("form",{onSubmit:S,className:chunkE64TU6IU_js.a("",e==null?void 0:e.form,m),children:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",e==null?void 0:e.fieldGroup,m),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Personal Information"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"fullName",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",e==null?void 0:e.label,m),children:[D.name||"Full Name"," ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"fullName",value:E,onChange:r=>F(r.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,m),required:true,"aria-invalid":!!o.fullName,"aria-describedby":o.fullName?"fullName-error":void 0}),o.fullName&&jsxRuntime.jsx("p",{id:"fullName-error",role:"alert",className:"mt-1 text-sm text-red-500",children:o.fullName})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"email",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",e==null?void 0:e.label,m),children:[D.email||"Email Address"," ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",id:"email",value:B,onChange:r=>L(r.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,m),required:true,"aria-invalid":!!o.email,"aria-describedby":o.email?"email-error":void 0}),o.email&&jsxRuntime.jsx("p",{id:"email-error",role:"alert",className:"mt-1 text-sm text-red-500",children:o.email})]}),b&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"phone",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",e==null?void 0:e.label,m),children:"Phone Number (Optional)"}),jsxRuntime.jsx("input",{type:"tel",id:"phone",value:Y,onChange:r=>Z(r.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,m)})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Request Details"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"requestType",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",e==null?void 0:e.label,m),children:[D.requestType||"Request Type"," ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsxs("select",{id:"requestType",value:I,onChange:R,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,m),required:true,"aria-invalid":!!o.requestType,"aria-describedby":o.requestType?"requestType-error":void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select a request type"}),A.map(r=>jsxRuntime.jsx("option",{value:r.id,children:r.name},r.id))]}),o.requestType&&jsxRuntime.jsx("p",{id:"requestType-error",role:"alert",className:"mt-1 text-sm text-red-500",children:o.requestType})]}),u&&jsxRuntime.jsxs("div",{className:"mb-4 p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:u.description}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Estimated completion time: ",u.estimatedCompletionTime," ",u.estimatedCompletionTime===1?"day":"days"]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("label",{htmlFor:"requestDescription",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",e==null?void 0:e.label,m),children:D.description||"Additional Information"}),jsxRuntime.jsx("textarea",{id:"requestDescription",className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.textarea,m),rows:4,placeholder:"Please provide any additional details that might help us process your request"})]})]}),V&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Identity Verification"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3",children:"To protect your privacy, we need to verify your identity before processing your request."}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"identifierType",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",e==null?void 0:e.label,m),children:["Identifier Type ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("select",{id:"identifierType",value:ae,onChange:r=>P(r.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,m),required:true,children:l.map(r=>jsxRuntime.jsx("option",{value:r.id,children:r.label},r.id))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"identifierValue",className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",e==null?void 0:e.label,m),children:["Identifier Value ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"identifierValue",value:G,onChange:r=>Q(r.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,m),required:true,"aria-invalid":!!o.identifierValue,"aria-describedby":o.identifierValue?"identifierValue-error":void 0}),o.identifierValue&&jsxRuntime.jsx("p",{id:"identifierValue-error",role:"alert",className:"mt-1 text-sm text-red-500",children:o.identifierValue})]})]})]}),(u==null?void 0:u.requiresAdditionalInfo)&&u.additionalFields&&u.additionalFields.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsxRuntime.jsx("div",{className:"space-y-4",children:u.additionalFields.map(r=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:r.id,className:chunkE64TU6IU_js.a("block text-sm font-medium mb-1",e==null?void 0:e.label,m),children:[r.label," ",r.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),r.type==="text"&&jsxRuntime.jsx("input",{type:"text",id:r.id,value:j[r.id]||"",onChange:w=>s(r.id,w.target.value),placeholder:r.placeholder,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,m),required:r.required,"aria-invalid":!!o[`additional_${r.id}`],"aria-describedby":o[`additional_${r.id}`]?`additional-${r.id}-error`:void 0}),r.type==="textarea"&&jsxRuntime.jsx("textarea",{id:r.id,value:j[r.id]||"",onChange:w=>s(r.id,w.target.value),placeholder:r.placeholder,className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.textarea,m),rows:4,required:r.required,"aria-invalid":!!o[`additional_${r.id}`],"aria-describedby":o[`additional_${r.id}`]?`additional-${r.id}-error`:void 0}),r.type==="select"&&r.options&&jsxRuntime.jsxs("select",{id:r.id,value:j[r.id]||"",onChange:w=>s(r.id,w.target.value),className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.select,m),required:r.required,"aria-invalid":!!o[`additional_${r.id}`],"aria-describedby":o[`additional_${r.id}`]?`additional-${r.id}-error`:void 0,children:[jsxRuntime.jsx("option",{value:"",children:r.placeholder||"Select an option"}),r.options.map(w=>jsxRuntime.jsx("option",{value:w,children:w},w))]}),r.type==="checkbox"&&jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{type:"checkbox",id:r.id,checked:!!j[r.id],onChange:w=>s(r.id,w.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]",required:r.required,"aria-invalid":!!o[`additional_${r.id}`],"aria-describedby":o[`additional_${r.id}`]?`additional-${r.id}-error`:void 0})}),jsxRuntime.jsx("div",{className:"ml-3 text-sm",children:jsxRuntime.jsx("label",{htmlFor:r.id,className:"text-gray-700 dark:text-gray-300",children:r.placeholder||r.label})})]}),r.type==="file"&&jsxRuntime.jsx("input",{type:"file",id:r.id,onChange:w=>{var ne;let X=(ne=w.target.files)==null?void 0:ne[0];X&&s(r.id,X);},className:chunkE64TU6IU_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",e==null?void 0:e.input,m),required:r.required,"aria-invalid":!!o[`additional_${r.id}`],"aria-describedby":o[`additional_${r.id}`]?`additional-${r.id}-error`:void 0}),o[`additional_${r.id}`]&&jsxRuntime.jsx("p",{id:`additional-${r.id}-error`,role:"alert",className:"mt-1 text-sm text-red-500",children:o[`additional_${r.id}`]})]},r.id))})]}),jsxRuntime.jsxs("div",{className:"mt-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold mb-2",children:"Privacy Notice"}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300",children:"The information you provide in this form will be used solely for the purpose of processing your data subject request. We will retain this information for as long as necessary to fulfill your request and to comply with our legal obligations. For more information, please refer to our Privacy Policy."})]}),jsxRuntime.jsxs("div",{className:"mt-6 flex gap-3 relative",children:[C&&(e==null?void 0:e.loadingOverlay)&&jsxRuntime.jsx("div",{className:e.loadingOverlay}),jsxRuntime.jsx("button",{type:"submit",disabled:C,className:chunkE64TU6IU_js.a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${H} ${C?"opacity-50 cursor-not-allowed":""}`,(e==null?void 0:e.primaryButton)||(e==null?void 0:e.submitButton),m),children:C?"Submitting...":D.submit||oe}),jsxRuntime.jsx("button",{type:"button",onClick:v,className:chunkE64TU6IU_js.a("px-6 py-3 bg-gray-200 dark:bg-gray-600 text-gray-700 dark:text-gray-200 rounded-md hover:bg-gray-300 dark:hover:bg-gray-500 focus:outline-none focus:ring-2 focus:ring-gray-400 focus:ring-offset-2",void 0,m),children:"Reset"})]})]})})]})};var je=({requests:A,onSelectRequest:z,onUpdateStatus:M,onAssignRequest:K,title:te="Data Subject Request Dashboard",description:oe="Track and manage data subject requests in compliance with NDPA Part IV requirements.",className:W="",buttonClassName:H="",showRequestDetails:re=true,showRequestTimeline:ie=true,showDeadlineAlerts:V=true,assignees:l=[],classNames:b,unstyled:D=false})=>{let[e,m]=react.useState(null),[C,k]=react.useState(A),[$,I]=react.useState("all"),[_,E]=react.useState("all"),[F,B]=react.useState(""),[L,Y]=react.useState("createdAt"),[Z,ae]=react.useState("desc"),[P,G]=react.useState("");react.useEffect(()=>{let t=[...A];if($!=="all"&&(t=t.filter(d=>d.status===$)),_!=="all"&&(t=t.filter(d=>d.type===_)),F){let d=F.toLowerCase();t=t.filter(h=>h.subject.name.toLowerCase().includes(d)||h.subject.email.toLowerCase().includes(d)||h.description&&h.description.toLowerCase().includes(d));}t.sort((d,h)=>{let q=0;switch(L){case "createdAt":q=d.createdAt-h.createdAt;break;case "dueDate":q=(d.dueDate||0)-(h.dueDate||0);break;case "type":q=d.type.localeCompare(h.type);break;case "status":q=d.status.localeCompare(h.status);break;default:q=d.createdAt-h.createdAt;}return Z==="asc"?q:-q}),k(t);},[A,$,_,F,L,Z]),react.useEffect(()=>{C.length>0&&!e&&m(C[0].id);},[C,e]);let Q=t=>{m(t),z&&z(t);},j=t=>{e&&M&&M(e,t);},J=()=>{e&&P&&K&&(K(e,P),G(""));},T=t=>new Date(t).toLocaleDateString(),U=t=>{let d=Date.now(),h=(t-d)/(1440*60*1e3);return Math.ceil(h)},o=e?A.find(t=>t.id===e):null,i=t=>{let d={information:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",access:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",rectification:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",erasure:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",restriction:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",portability:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",objection:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",automated_decision_making:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},h={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${d[t]}`,children:h[t]})},v=t=>jsxRuntime.jsx("span",{className:chunkE64TU6IU_js.a(`px-2 py-1 rounded text-xs font-medium ${{pending:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",inProgress:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",completed:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",rejected:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",awaitingVerification:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200"}[t]}`,b==null?void 0:b.statusBadge,D),children:t==="inProgress"?"In Progress":t==="awaitingVerification"?"Awaiting Verification":t.charAt(0).toUpperCase()+t.slice(1)}),u=t=>{if(!t.dueDate)return null;let d=U(t.dueDate);return d<=0?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Deadline Passed"}),jsxRuntime.jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The response deadline has passed. Immediate action is required."})]}):d<=3?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Deadline Approaching"}),jsxRuntime.jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",d," day",d!==1?"s":""," remaining until the response deadline."]})]}):d<=7?jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Deadline Approaching"}),jsxRuntime.jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:[d," days remaining until the response deadline."]})]}):jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Deadline Tracking"}),jsxRuntime.jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:[d," days remaining until the response deadline."]})]})},R=t=>{let d=[{title:"Request Received",date:t.createdAt,completed:true,description:`Request was received on ${T(t.createdAt)}.`}];return t.verifiedAt?d.push({title:"Identity Verified",date:t.verifiedAt,completed:true,description:`Data subject's identity was verified on ${T(t.verifiedAt)}.`}):t.status==="awaitingVerification"&&d.push({title:"Identity Verification",date:Date.now(),completed:false,description:"Awaiting verification of data subject's identity."}),(t.status==="inProgress"||t.status==="completed"||t.status==="rejected")&&d.push({title:"Processing Started",date:t.updatedAt,completed:true,description:`Request processing started on ${T(t.updatedAt)}.`}),t.status==="completed"?d.push({title:"Request Completed",date:t.completedAt||Date.now(),completed:true,description:`Request was completed on ${T(t.completedAt||Date.now())}.`}):t.status==="rejected"&&d.push({title:"Request Rejected",date:t.completedAt||Date.now(),completed:true,description:`Request was rejected on ${T(t.completedAt||Date.now())}.${t.rejectionReason?` Reason: ${t.rejectionReason}`:""}`}),t.dueDate&&d.push({title:"Response Deadline",date:t.dueDate,completed:Date.now()>t.dueDate,description:`Response is due by ${T(t.dueDate)}.`}),jsxRuntime.jsxs("div",{className:"mt-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Request Timeline"}),jsxRuntime.jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:d.map((h,q)=>jsxRuntime.jsxs("li",{className:"mb-6 ml-4",children:[jsxRuntime.jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${h.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsxRuntime.jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-600 dark:text-gray-500",children:h.date?T(h.date):"Pending"}),jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:h.title}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:h.description})]},q))})]})},s=()=>[{value:"all",label:"All Types"},{value:"information",label:"Information (NDPA Section 29)"},{value:"access",label:"Access (NDPA Section 30)"},{value:"rectification",label:"Rectification (NDPA Section 31)"},{value:"erasure",label:"Erasure (NDPA Section 32)"},{value:"restriction",label:"Restriction (NDPA Section 33)"},{value:"portability",label:"Portability (NDPA Section 34)"},{value:"objection",label:"Objection (NDPA Section 35)"},{value:"automated_decision_making",label:"Automated Decision-Making (NDPA Section 36)"}].map(d=>jsxRuntime.jsx("option",{value:d.value,children:d.label},d.value)),x=()=>[{value:"all",label:"All Statuses"},{value:"pending",label:"Pending"},{value:"awaitingVerification",label:"Awaiting Verification"},{value:"inProgress",label:"In Progress"},{value:"completed",label:"Completed"},{value:"rejected",label:"Rejected"}].map(d=>jsxRuntime.jsx("option",{value:d.value,children:d.label},d.value)),S=()=>[{value:"pending",label:"Pending"},{value:"awaitingVerification",label:"Awaiting Verification"},{value:"inProgress",label:"In Progress"},{value:"completed",label:"Completed"},{value:"rejected",label:"Rejected"}].map(d=>jsxRuntime.jsx("option",{value:d.value,children:d.label},d.value));return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${W}`,b==null?void 0:b.root,D),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",b==null?void 0:b.header,D),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",b==null?void 0:b.title,D),children:te}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:oe})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",b==null?void 0:b.filters,D),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxRuntime.jsx("select",{id:"statusFilter",value:$,onChange:t=>I(t.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:x()})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"typeFilter",className:"block text-sm font-medium mb-1",children:"Request Type Filter"}),jsxRuntime.jsx("select",{id:"typeFilter",value:_,onChange:t=>E(t.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:s()})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxRuntime.jsxs("select",{id:"sortBy",value:L,onChange:t=>Y(t.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"createdAt",children:"Date Received"}),jsxRuntime.jsx("option",{value:"dueDate",children:"Due Date"}),jsxRuntime.jsx("option",{value:"type",children:"Request Type"}),jsxRuntime.jsx("option",{value:"status",children:"Status"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"searchTerm",value:F,onChange:t=>B(t.target.value),placeholder:"Search requests...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]"})]})]}),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:"DSR Requests"}),C.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data subject requests found."}):jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",b==null?void 0:b.requestList,D),children:C.map(t=>{let d=t.dueDate?U(t.dueDate):null,h=null;return d!==null&&(d<=0?h=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):d<=3?h=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):d<=7&&(h=jsxRuntime.jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Soon"}))),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`p-3 rounded-md cursor-pointer ${e===t.id?"bg-[rgb(var(--ndpr-primary)/0.05)] dark:bg-[rgb(var(--ndpr-primary)/0.1)] border border-[rgb(var(--ndpr-primary)/0.2)] dark:border-[rgb(var(--ndpr-primary)/0.3)]":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,b==null?void 0:b.requestItem,D),onClick:()=>Q(t.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:t.subject.name}),i(t.type)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:t.subject.email}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:["Received: ",T(t.createdAt)]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsxRuntime.jsx("div",{children:v(t.status)}),jsxRuntime.jsx("div",{children:h})]})]},t.id)})})]}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("md:col-span-2",b==null?void 0:b.detailPanel,D),children:o?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:o.subject.name}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[i(o.type),v(o.status)]})]}),V&&o.dueDate&&jsxRuntime.jsx("div",{className:"mb-4",children:u(o)}),re&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Email:"})," ",o.subject.email]}),o.subject.phone&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Phone:"})," ",o.subject.phone]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Received:"})," ",T(o.createdAt)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Request Type:"})," ",{information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"}[o.type]||o.type]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",o.status==="inProgress"?"In Progress":o.status==="awaitingVerification"?"Awaiting Verification":o.status.charAt(0).toUpperCase()+o.status.slice(1)]}),o.dueDate&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Due Date:"})," ",T(o.dueDate)]})]})]}),o.description&&jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Request Details:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:o.description})]}),o.additionalInfo&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Additional Information:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:typeof o.additionalInfo=="object"?JSON.stringify(o.additionalInfo,null,2):String(o.additionalInfo||"No additional information provided")})]})]}),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-md font-medium mb-2",children:"Update Status"}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsx("select",{value:o.status,onChange:t=>j(t.target.value),className:"flex-grow px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:S()}),jsxRuntime.jsx("button",{onClick:()=>j(o.status),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${H}`,children:"Update"})]})]}),l.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-md font-medium mb-2",children:"Assign Request"}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsxs("select",{value:P,onChange:t=>G(t.target.value),className:"flex-grow px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"",children:"Select Assignee"}),l.map(t=>jsxRuntime.jsx("option",{value:t,children:t},t))]}),jsxRuntime.jsx("button",{onClick:J,disabled:!P,className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] disabled:bg-gray-300 disabled:text-gray-500 ${H}`,children:"Assign"})]})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Request Summary"}),jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:jsxRuntime.jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:jsxRuntime.jsx("pre",{children:JSON.stringify(chunkCMZTI7SG_js.a(o),null,2)})})})]}),ie&&R(o)]}):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:"Select a request to view details"})})})]})]})};var _e=({requests:A,onSelectRequest:z,title:M="DSR Request Tracker",description:K="Track the status and progress of data subject requests as required by NDPA Part IV.",className:te="",buttonClassName:oe="",showSummaryStats:W=true,showTypeBreakdown:H=true,showStatusBreakdown:re=true,showTimelineChart:ie=true,showOverdueRequests:V=true,classNames:l,unstyled:b=false})=>{let[D,e]=react.useState("30days"),[m,C]=react.useState(A),[k,$]=react.useState([]),[I,_]=react.useState([]);react.useEffect(()=>{let i=Date.now(),v;switch(D){case "7days":v=A.filter(s=>i-s.createdAt<=10080*60*1e3);break;case "30days":v=A.filter(s=>i-s.createdAt<=720*60*60*1e3);break;case "90days":v=A.filter(s=>i-s.createdAt<=2160*60*60*1e3);break;default:v=[...A];}C(v);let u=v.filter(s=>s.dueDate&&i>s.dueDate&&s.status!=="completed"&&s.status!=="rejected");$(u);let R=v.filter(s=>s.dueDate&&i<s.dueDate&&s.dueDate-i<=10080*60*1e3&&s.status!=="completed"&&s.status!=="rejected");_(R);},[A,D]);let E=i=>{z&&z(i);},F=i=>new Date(i).toLocaleDateString(),B=i=>{let v=Date.now(),u=(i-v)/(1440*60*1e3);return Math.ceil(u)},L=()=>{let i=m.filter(u=>u.status==="completed"&&u.completedAt&&u.createdAt);if(i.length===0)return null;let v=i.reduce((u,R)=>{let s=((R.completedAt||0)-R.createdAt)/864e5;return u+s},0);return Number((v/i.length).toFixed(1))},Y=()=>{let i=m.filter(u=>(u.status==="completed"||u.status==="rejected")&&u.completedAt&&u.dueDate);if(i.length===0)return null;let v=i.filter(u=>(u.completedAt||0)<=(u.dueDate||0));return Math.round(v.length/i.length*100)},Z=()=>{let i={};return m.forEach(v=>{i[v.type]=(i[v.type]||0)+1;}),{information:i.information||0,access:i.access||0,rectification:i.rectification||0,erasure:i.erasure||0,restriction:i.restriction||0,portability:i.portability||0,objection:i.objection||0,automated_decision_making:i.automated_decision_making||0}},ae=()=>{let i={};return m.forEach(v=>{i[v.status]=(i[v.status]||0)+1;}),{pending:i.pending||0,awaitingVerification:i.awaitingVerification||0,inProgress:i.inProgress||0,completed:i.completed||0,rejected:i.rejected||0}},P=i=>{let v={information:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",access:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",rectification:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",erasure:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",restriction:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",portability:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",objection:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",automated_decision_making:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},u={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${v[i]}`,children:u[i]})},Q=()=>{let i=m.length,v=m.filter(x=>x.status!=="completed"&&x.status!=="rejected").length;m.filter(x=>x.status==="completed"||x.status==="rejected").length;let R=L(),s=Y();return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",l==null?void 0:l.stats,b),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",l==null?void 0:l.statCard,b),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Total Requests"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:i})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",l==null?void 0:l.statCard,b),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Pending Requests"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:v})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",l==null?void 0:l.statCard,b),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Avg. Response Time"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:R!==null?`${R} days`:"N/A"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",l==null?void 0:l.statCard,b),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-600 dark:text-gray-400 mb-1",children:"Compliance Rate"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:s!==null?`${s}%`:"N/A"})]})]})},j=()=>{let i=Z(),v=m.length,u=Object.entries(i).sort(([,R],[,s])=>s-R).map(([R])=>R);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",l==null?void 0:l.table,b),children:[jsxRuntime.jsx("h3",{className:chunkE64TU6IU_js.a("text-lg font-medium mb-4",l==null?void 0:l.tableHeader,b),children:"Request Types"}),v===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxRuntime.jsx("div",{className:"space-y-4",children:u.map(R=>{let s=i[R],x=Math.round(s/v*100);return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[P(R),jsxRuntime.jsxs("span",{className:"ml-2 text-sm",children:[s," requests"]})]}),jsxRuntime.jsxs("span",{className:"text-sm font-medium",children:[x,"%"]})]}),jsxRuntime.jsx("div",{className:"w-full bg-gray-200 dark:bg-gray-600 rounded-full h-2.5",children:jsxRuntime.jsx("div",{className:"bg-[rgb(var(--ndpr-primary))] h-2.5 rounded-full",style:{width:`${x}%`}})})]},R)})})]})},J=()=>{let i=ae(),v=m.length,u=["pending","awaitingVerification","inProgress","completed","rejected"],R={pending:"bg-yellow-500",awaitingVerification:"bg-purple-500",inProgress:"bg-blue-500",completed:"bg-green-500",rejected:"bg-red-500"};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",l==null?void 0:l.table,b),children:[jsxRuntime.jsx("h3",{className:chunkE64TU6IU_js.a("text-lg font-medium mb-4",l==null?void 0:l.tableHeader,b),children:"Request Status"}),v===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"flex h-4 mb-2",children:u.map(s=>{let x=i[s],S=x/v*100;return S>0?jsxRuntime.jsx("div",{className:`${R[s]} first:rounded-l-full last:rounded-r-full`,style:{width:`${S}%`},title:`${s}: ${x} (${Math.round(S)}%)`},s):null})}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 mt-4",children:u.map(s=>{let x=i[s],S=Math.round(x/v*100);return jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("div",{className:`w-3 h-3 rounded-full ${R[s]} mr-2`}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium",children:s==="inProgress"?"In Progress":s==="awaitingVerification"?"Awaiting Verification":s.charAt(0).toUpperCase()+s.slice(1)}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:[x," (",S,"%)"]})]})]},s)})})]})]})},T=()=>{let i={};m.forEach(x=>{let S=new Date(x.createdAt),t=`${S.getFullYear()}-${String(S.getMonth()+1).padStart(2,"0")}`;i[t]=(i[t]||0)+1;});let u=Object.keys(i).sort().slice(-6),R=Math.max(...Object.values(i).filter(x=>x>0),1),s=x=>{let[S,t]=x.split("-");return `${t}/${S.slice(2)}`};return jsxRuntime.jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Request Timeline"}),u.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxRuntime.jsxs("div",{className:"h-40",children:[jsxRuntime.jsx("div",{className:"flex h-32 items-end justify-between space-x-2",children:u.map(x=>{let S=i[x],t=`${S/R*100}%`;return jsxRuntime.jsx("div",{className:"flex flex-col items-center flex-1",children:jsxRuntime.jsx("div",{className:"w-full bg-[rgb(var(--ndpr-primary))] rounded-t",style:{height:t},title:`${s(x)}: ${S} requests`})},x)})}),jsxRuntime.jsx("div",{className:"flex justify-between mt-2",children:u.map(x=>jsxRuntime.jsx("div",{className:"text-xs text-center",children:s(x)},x))})]})]})},U=()=>jsxRuntime.jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Overdue Requests"}),k.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No overdue requests."}):jsxRuntime.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:k.map(i=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md cursor-pointer hover:bg-red-100 dark:hover:bg-red-900/30",l==null?void 0:l.tableRow,b),onClick:()=>E(i.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:i.subject.name}),P(i.type)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:i.subject.email}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:["Due: ",F(i.dueDate||0)]}),jsxRuntime.jsxs("p",{className:"text-xs font-bold text-red-600 dark:text-red-400",children:["Overdue by ",Math.abs(B(i.dueDate||0))," days"]})]})]},i.id))})]}),o=()=>jsxRuntime.jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Upcoming Deadlines"}),I.length===0?jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-sm",children:"No upcoming deadlines in the next 7 days."}):jsxRuntime.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:I.map(i=>{let v=B(i.dueDate||0);return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("p-3 bg-yellow-50 dark:bg-yellow-900/20 rounded-md cursor-pointer hover:bg-yellow-100 dark:hover:bg-yellow-900/30",l==null?void 0:l.tableRow,b),onClick:()=>E(i.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:i.subject.name}),P(i.type)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-400 mb-1",children:i.subject.email}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsxs("p",{className:"text-xs text-gray-600 dark:text-gray-400",children:["Due: ",F(i.dueDate||0)]}),jsxRuntime.jsxs("p",{className:`text-xs font-bold ${v<=3?"text-red-600 dark:text-red-400":"text-yellow-600 dark:text-yellow-400"}`,children:["Due in ",v," days"]})]})]},i.id)})})]});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${te}`,l==null?void 0:l.root,b),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex flex-col md:flex-row md:justify-between md:items-center mb-6",l==null?void 0:l.header,b),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",l==null?void 0:l.title,b),children:M}),jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:K})]}),jsxRuntime.jsxs("div",{className:"mt-4 md:mt-0",children:[jsxRuntime.jsx("label",{htmlFor:"timeframe",className:"block text-sm font-medium mb-1",children:"Timeframe"}),jsxRuntime.jsxs("select",{id:"timeframe",value:D,onChange:i=>e(i.target.value),className:"px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",children:[jsxRuntime.jsx("option",{value:"7days",children:"Last 7 Days"}),jsxRuntime.jsx("option",{value:"30days",children:"Last 30 Days"}),jsxRuntime.jsx("option",{value:"90days",children:"Last 90 Days"}),jsxRuntime.jsx("option",{value:"all",children:"All Time"})]})]})]}),W&&Q(),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{children:[H&&j(),re&&J()]}),jsxRuntime.jsxs("div",{children:[ie&&T(),V&&U(),V&&o()]})]})]})};exports.a=ke;exports.b=je;exports.c=_e;//# sourceMappingURL=chunk-EKVTLHBQ.js.map
2
+ //# sourceMappingURL=chunk-EKVTLHBQ.js.map