@tantainnovative/ndpr-toolkit 2.2.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/README.md +26 -11
  2. package/dist/breach-ouXoVTWs.d.ts +438 -0
  3. package/dist/breach-yRiyyc4n.d.mts +438 -0
  4. package/dist/breach.d.mts +3 -349
  5. package/dist/breach.d.ts +3 -349
  6. package/dist/breach.js +1 -1
  7. package/dist/breach.mjs +1 -1
  8. package/dist/chunk-2XFAV267.mjs +2 -0
  9. package/dist/chunk-32UIWTGD.js +72 -0
  10. package/dist/chunk-4JUDKBA2.mjs +7 -0
  11. package/dist/chunk-4VVARDN2.mjs +2 -0
  12. package/dist/chunk-5RSOLEEP.js +63 -0
  13. package/dist/chunk-AYKLAEOU.mjs +2 -0
  14. package/dist/chunk-BGHQTZAC.js +94 -0
  15. package/dist/chunk-BZTTQS4A.mjs +7 -0
  16. package/dist/chunk-CAB7O3GR.mjs +63 -0
  17. package/dist/chunk-CL53OI3I.js +7 -0
  18. package/dist/chunk-E64TU6IU.js +2 -0
  19. package/dist/chunk-EKVTLHBQ.js +2 -0
  20. package/dist/chunk-ELKEZEV5.mjs +2 -0
  21. package/dist/chunk-EPF7J2FK.js +3 -0
  22. package/dist/chunk-ER7X6E36.js +2 -0
  23. package/dist/chunk-FXTZDKDC.mjs +3 -0
  24. package/dist/chunk-IBEKLDBY.mjs +2 -0
  25. package/dist/chunk-ILCNDOBU.js +2 -0
  26. package/dist/chunk-K3GMTMQ6.js +2 -0
  27. package/dist/chunk-MJGOLP5M.js +2 -0
  28. package/dist/chunk-NW4A3JW6.mjs +2 -0
  29. package/dist/chunk-P3PULLYP.mjs +2 -0
  30. package/dist/chunk-SKJCQKFL.mjs +94 -0
  31. package/dist/chunk-TCJCE6WN.js +2 -0
  32. package/dist/chunk-UZ5EZOA7.js +2 -0
  33. package/dist/chunk-WSHSHIIM.mjs +2 -0
  34. package/dist/chunk-XMYUYQH7.mjs +72 -0
  35. package/dist/chunk-ZNTMZ6NM.js +7 -0
  36. package/dist/consent-audit-BdByjYlM.d.mts +65 -0
  37. package/dist/consent-audit-DhbfMR0n.d.ts +65 -0
  38. package/dist/consent.d.mts +55 -8
  39. package/dist/consent.d.ts +55 -8
  40. package/dist/consent.js +1 -1
  41. package/dist/consent.mjs +1 -1
  42. package/dist/core.d.mts +52 -2
  43. package/dist/core.d.ts +52 -2
  44. package/dist/core.js +1 -1
  45. package/dist/core.mjs +1 -1
  46. package/dist/{cross-border-entry-CtX8_o-_.d.ts → cross-border-entry-BrWVPly6.d.ts} +7 -0
  47. package/dist/{cross-border-entry-BfF7jw5o.d.mts → cross-border-entry-cCTvpwnT.d.mts} +7 -0
  48. package/dist/cross-border.d.mts +1 -1
  49. package/dist/cross-border.d.ts +1 -1
  50. package/dist/cross-border.js +1 -1
  51. package/dist/cross-border.mjs +1 -1
  52. package/dist/dpia.d.mts +14 -0
  53. package/dist/dpia.d.ts +14 -0
  54. package/dist/dpia.js +1 -1
  55. package/dist/dpia.mjs +1 -1
  56. package/dist/dsr-190YpijW.d.ts +307 -0
  57. package/dist/dsr-BTT-Xd7H.d.mts +307 -0
  58. package/dist/dsr.d.mts +3 -251
  59. package/dist/dsr.d.ts +3 -251
  60. package/dist/dsr.js +1 -1
  61. package/dist/dsr.mjs +1 -1
  62. package/dist/hooks.d.mts +1 -1
  63. package/dist/hooks.d.ts +1 -1
  64. package/dist/hooks.js +1 -1
  65. package/dist/hooks.mjs +1 -1
  66. package/dist/index.d.mts +11 -10
  67. package/dist/index.d.ts +11 -10
  68. package/dist/index.js +1 -1
  69. package/dist/index.mjs +1 -1
  70. package/dist/{lawful-basis-entry-BeSX7u0U.d.ts → lawful-basis-entry-15qjKcNO.d.ts} +6 -0
  71. package/dist/{lawful-basis-entry-CMPPM9Rh.d.mts → lawful-basis-entry-CxZrofwG.d.mts} +6 -0
  72. package/dist/lawful-basis.d.mts +1 -1
  73. package/dist/lawful-basis.d.ts +1 -1
  74. package/dist/lawful-basis.js +1 -1
  75. package/dist/lawful-basis.mjs +1 -1
  76. package/dist/{policy-dmsRlqgM.d.ts → policy-D2_jh5-T.d.ts} +15 -5
  77. package/dist/{policy-kZN23hrR.d.mts → policy-E0fXZkda.d.mts} +15 -5
  78. package/dist/policy-templates-CIKcV0i1.d.ts +36 -0
  79. package/dist/policy-templates-DMsPwOSZ.d.mts +36 -0
  80. package/dist/policy.d.mts +3 -3
  81. package/dist/policy.d.ts +3 -3
  82. package/dist/policy.js +1 -1
  83. package/dist/policy.mjs +1 -1
  84. package/dist/{ropa-entry-DIEQ9WFs.d.ts → ropa-entry-B0D7X1GV.d.ts} +10 -1
  85. package/dist/{ropa-entry-CZJ91ymk.d.mts → ropa-entry-DiOThOc2.d.mts} +10 -1
  86. package/dist/ropa.d.mts +1 -1
  87. package/dist/ropa.d.ts +1 -1
  88. package/dist/ropa.js +1 -1
  89. package/dist/ropa.mjs +1 -1
  90. package/dist/styles.css +40 -28
  91. package/dist/styles.d.ts +1 -0
  92. package/dist/{usePrivacyPolicy-CfySfBLS.d.ts → useDefaultPrivacyPolicy-B7kTHbZh.d.ts} +39 -2
  93. package/dist/{usePrivacyPolicy-Dit2sFuV.d.mts → useDefaultPrivacyPolicy-CUluF_ic.d.mts} +39 -2
  94. package/package.json +9 -7
  95. package/dist/chunk-4RGDNVR5.mjs +0 -72
  96. package/dist/chunk-6LM3RAFO.js +0 -7
  97. package/dist/chunk-7DNQSOER.js +0 -2
  98. package/dist/chunk-A7DRHSDQ.mjs +0 -2
  99. package/dist/chunk-DB3JH4DS.mjs +0 -2
  100. package/dist/chunk-FC6EG34C.js +0 -72
  101. package/dist/chunk-FDB6KZUD.mjs +0 -2
  102. package/dist/chunk-FZUCKGIM.mjs +0 -7
  103. package/dist/chunk-G3JNFZPT.js +0 -2
  104. package/dist/chunk-HXCRMA4J.mjs +0 -2
  105. package/dist/chunk-IC7VOOKJ.mjs +0 -2
  106. package/dist/chunk-ICUZG6CD.mjs +0 -2
  107. package/dist/chunk-IW5PHOG7.mjs +0 -7
  108. package/dist/chunk-IWUUVRLJ.js +0 -2
  109. package/dist/chunk-JKEAPTYP.js +0 -7
  110. package/dist/chunk-N52S64SU.js +0 -2
  111. package/dist/chunk-PM7CMTMB.js +0 -4
  112. package/dist/chunk-SKAMVXBI.mjs +0 -94
  113. package/dist/chunk-UYP64PV7.mjs +0 -4
  114. package/dist/chunk-VURIXCGY.js +0 -2
  115. package/dist/chunk-VXRY3V42.js +0 -94
  116. package/dist/chunk-YBPHGEL2.js +0 -2
  117. package/dist/consent-DCc5zjXI.d.mts +0 -24
  118. package/dist/consent-DLWb5ota.d.ts +0 -24
  119. package/dist/privacy-9FcJceMr.d.mts +0 -15
  120. package/dist/privacy-BXz7O2ej.d.ts +0 -15
@@ -1,94 +0,0 @@
1
- 'use strict';var chunkPM7CMTMB_js=require('./chunk-PM7CMTMB.js'),chunkVURIXCGY_js=require('./chunk-VURIXCGY.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var ge=({sections:P,variables:R,onGenerate:S,title:q="NDPA Privacy Policy Generator",description:H="Generate an NDPA-compliant privacy policy for your organization.",className:N="",buttonClassName:L="",generateButtonText:z="Generate Policy",showPreview:A=true,allowEditing:G=true,classNames:t,unstyled:f=false})=>{let[T,U]=react.useState(P),[d,r]=react.useState(R),[g,C]=react.useState("sections"),[E,Y]=react.useState(""),[F,D]=react.useState(""),[I,V]=react.useState(false),[v,W]=react.useState({});react.useEffect(()=>{U(P);},[P]),react.useEffect(()=>{r(R);},[R]);let u=n=>{U(b=>b.map(c=>c.id===n?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},c),{included:!c.included}):c));},s=(n,b)=>{r(c=>c.map(m=>m.id===n?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},m),{value:b}):m)),v[n]&&W(c=>{let m=chunkMQFZHA2D_js.a({},c);return delete m[n],m});},y=()=>{let n={},b=true;return d.forEach(c=>{c.required&&!c.value&&(n[c.id]=`${c.name} is required`,b=false);}),W(n),b},k=()=>{if(!y()){C("variables");return}let n=T.filter(m=>m.included),b=Object.fromEntries(d.map(m=>[m.name,m.value])),c="";n.forEach(m=>{c+=`## ${m.title}
2
-
3
- `,c+=chunkPM7CMTMB_js.a(m.template,b),c+=`
4
-
5
- `;}),Y(c),D(c),V(true),C("preview");},B=()=>{S({sections:T,variables:d,content:G?F:E});},j=()=>jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("space-y-4",t==null?void 0:t.sectionList,f),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Select Policy Sections"}),T.map(n=>jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("border border-gray-200 dark:border-gray-700 rounded-md p-4",t==null?void 0:t.sectionItem,f),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:()=>u(n.id),disabled:n.required,className:chunkVURIXCGY_js.a("w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600",t==null?void 0:t.input,f)})}),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-500 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:chunkVURIXCGY_js.a(`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${L}`,t==null?void 0:t.generateButton,f),children:"Next: Fill Variables"})})]}),_=()=>{let n={};return d.forEach(b=>{let c=b.id.split(".")[0];n[c]||(n[c]=[]),n[c].push(b);}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("",t==null?void 0:t.form,f),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,c])=>{let m=T.find(e=>e.id===b);return m&&!m.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:m?m.title:"General Information"}),jsxRuntime.jsx("div",{className:"space-y-4",children:c.map(e=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`var-${e.id}`,className:"block text-sm font-medium mb-1",children:[e.name," ",e.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),e.description&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:e.description}),e.inputType==="textarea"?jsxRuntime.jsx("textarea",{id:`var-${e.id}`,value:e.value,onChange:p=>s(e.id,p.target.value),rows:4,className:chunkVURIXCGY_js.a(`w-full px-3 py-2 border ${v[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-blue-500"} rounded-md focus:outline-none focus:ring-2`,t==null?void 0:t.input,f),required:e.required}):e.inputType==="select"&&e.options?jsxRuntime.jsxs("select",{id:`var-${e.id}`,value:e.value,onChange:p=>s(e.id,p.target.value),className:chunkVURIXCGY_js.a(`w-full px-3 py-2 border ${v[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-blue-500"} rounded-md focus:outline-none focus:ring-2`,t==null?void 0:t.input,f),required:e.required,children:[jsxRuntime.jsx("option",{value:"",children:"Select an option"}),e.options.map(p=>jsxRuntime.jsx("option",{value:p,children:p},p))]}):jsxRuntime.jsx("input",{id:`var-${e.id}`,type:e.inputType,value:e.value,onChange:p=>s(e.id,p.target.value),className:chunkVURIXCGY_js.a(`w-full px-3 py-2 border ${v[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-blue-500"} rounded-md focus:outline-none focus:ring-2`,t==null?void 0:t.input,f),required:e.required}),v[e.id]&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-500",children:v[e.id]})]},e.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:chunkVURIXCGY_js.a(`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${L}`,t==null?void 0:t.generateButton,f),children:z})]})]})},Z=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Preview Generated Policy"}),G?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-blue-500 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:B,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${L}`,children:"Save Policy"})]})]}),J=()=>{switch(g){case "sections":return j();case "variables":return _();case "preview":return Z();default:return j()}};return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${N}`,t==null?void 0:t.root,f),children:[jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("mb-6",t==null?void 0:t.header,f),children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-xl font-bold mb-2",t==null?void 0:t.title,f),children:q}),jsxRuntime.jsx("p",{className:chunkVURIXCGY_js.a("text-gray-600 dark:text-gray-300",t==null?void 0:t.description,f),children:H})]}),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 ${g==="sections"?"text-blue-600 dark:text-blue-500":"text-gray-500 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 ${g==="sections"?"bg-blue-100 dark:bg-blue-800":"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 ${g==="variables"?"text-blue-600 dark:text-blue-500":"text-gray-500 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 ${g==="variables"?"bg-blue-100 dark:bg-blue-800":"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 ${g==="preview"?"text-blue-600 dark:text-blue-500":"text-gray-500 dark:text-gray-400"}`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${g==="preview"?"bg-blue-100 dark:bg-blue-800":"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:chunkVURIXCGY_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",t==null?void 0:t.complianceNotice,f),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."})]}),J()]})};var he=({content:P,sections:R,variables:S,onExport:q,onEdit:H,title:N="Privacy Policy Preview",description:L="Preview your NDPA-compliant privacy policy before exporting.",className:z="",buttonClassName:A="",showExportOptions:G=true,showEditButton:t=true,showTableOfContents:f=true,showMetadata:T=true,organizationName:U,lastUpdated:d=new Date,classNames:r,unstyled:g=false})=>{let[C,E]=react.useState("preview"),F=(()=>{let u=P.split(`
7
- `),s=[];return u.forEach(y=>{if(y.startsWith("## ")){let k=y.substring(3).trim(),B=k.toLowerCase().replace(/[^a-z0-9]+/g,"-");s.push({id:B,title:k,level:2});}else if(y.startsWith("### ")){let k=y.substring(4).trim(),B=k.toLowerCase().replace(/[^a-z0-9]+/g,"-");s.push({id:B,title:k,level:3});}}),s})(),D=u=>{if(q)q(u);else if(u==="markdown"){let s=document.createElement("a"),y=new Blob([P],{type:"text/markdown"});s.href=URL.createObjectURL(y),s.download=`privacy-policy-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(s),s.click(),document.body.removeChild(s);}},I=()=>!f||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((u,s)=>jsxRuntime.jsx("li",{style:{marginLeft:`${(u.level-2)*1.5}rem`},children:jsxRuntime.jsx("a",{href:`#${u.id}`,className:"text-blue-600 dark:text-blue-400 hover:underline",children:u.title})},s))})]}),V=()=>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-500 dark:text-gray-400",children:["Last Updated: ",d.toLocaleDateString()]})]}):null,v=()=>jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("prose dark:prose-invert max-w-none",r==null?void 0:r.sectionContent,g),children:P.split(`
8
- `).map((u,s)=>{if(u.startsWith("## ")){let y=u.substring(3).trim(),k=y.toLowerCase().replace(/[^a-z0-9]+/g,"-");return jsxRuntime.jsx("h2",{id:k,className:chunkVURIXCGY_js.a("text-xl font-bold mt-6 mb-3",r==null?void 0:r.sectionTitle,g),children:y},s)}else if(u.startsWith("### ")){let y=u.substring(4).trim(),k=y.toLowerCase().replace(/[^a-z0-9]+/g,"-");return jsxRuntime.jsx("h3",{id:k,className:chunkVURIXCGY_js.a("text-lg font-bold mt-4 mb-2",r==null?void 0:r.sectionTitle,g),children:y},s)}else return u===""?jsxRuntime.jsx("br",{},s):jsxRuntime.jsx("p",{className:"mb-2",children:u},s)})}),W=()=>G?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-blue-600 text-white rounded hover:bg-blue-700 ${A}`,children:"Export as PDF"}),jsxRuntime.jsx("button",{onClick:()=>D("docx"),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${A}`,children:"Export as DOCX"}),jsxRuntime.jsx("button",{onClick:()=>D("html"),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${A}`,children:"Export as HTML"}),jsxRuntime.jsx("button",{onClick:()=>D("markdown"),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${A}`,children:"Export as Markdown"})]})]}):null;return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${z}`,r==null?void 0:r.root,g),children:[jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("flex justify-between items-start mb-6",r==null?void 0:r.header,g),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-xl font-bold mb-2",r==null?void 0:r.title,g),children:N}),jsxRuntime.jsx("p",{className:chunkVURIXCGY_js.a("text-gray-600 dark:text-gray-300",r==null?void 0:r.description,g),children:L})]}),t&&H&&jsxRuntime.jsx("button",{onClick:H,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:chunkVURIXCGY_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",r==null?void 0:r.complianceNotice,g),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-blue-600 border-b-2 border-blue-600 dark:text-blue-500 dark:border-blue-500":"text-gray-500 hover:text-gray-600 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-blue-600 border-b-2 border-blue-600 dark:text-blue-500 dark:border-blue-500":"text-gray-500 hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Markdown"})})]})}),jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("bg-white dark:bg-gray-800 p-4 rounded-md",r==null?void 0:r.content,g),children:C==="preview"?jsxRuntime.jsxs("div",{children:[V(),I(),jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("bg-gray-50 dark:bg-gray-700 p-6 rounded-md",r==null?void 0:r.section,g),children:v()})]}):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 $e=({content:P,title:R="Privacy Policy",organizationName:S,lastUpdated:q=new Date,onExportComplete:H,componentTitle:N="Export Privacy Policy",description:L="Export your NDPA-compliant privacy policy in various formats.",className:z="",buttonClassName:A="",showExportHistory:G=true,includeComplianceNotice:t=true,includeLogo:f=false,logoUrl:T,customStyles:U,classNames:d,unstyled:r=false})=>{let[g,C]=react.useState([]),[E,Y]=react.useState("pdf"),[F,D]=react.useState(false),[I,V]=react.useState(null),[v,W]=react.useState(""),[u,s]=react.useState(""),[y,k]=react.useState(""),[B,j]=react.useState(false),_=e=>{let p=new Date().toISOString().split("T")[0];return `${S?S.toLowerCase().replace(/[^a-z0-9]+/g,"-"):"privacy-policy"}-privacy-policy-${p}.${e.toLowerCase()}`},Z=e=>v?v.endsWith(`.${e.toLowerCase()}`)?v:`${v}.${e.toLowerCase()}`:_(e),J=()=>{let e=S?`${S} ${R}`:R,p=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>${e}</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
- ${f&&T?`<img src="${T}" alt="${S||"Company"} Logo" class="logo">`:""}
76
- ${u?`<div class="custom-header">${u}</div>`:""}
77
- <h1>${e}</h1>
78
- <div class="last-updated">Last Updated: ${p}</div>
79
- </div>`;t&&(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 K=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>${K}</p>
86
- </div>
87
-
88
- <div class="footer">
89
- ${y?`<div class="custom-footer">${y}</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),V(null);try{let e=E.toLowerCase(),p="",w;switch(e){case "pdf":let ee=J();w=new Blob([ee],{type:"text/html"}),p=URL.createObjectURL(w);break;case "docx":w=new Blob([P],{type:"text/plain"}),p=URL.createObjectURL(w);break;case "html":let ae=J();w=new Blob([ae],{type:"text/html"}),p=URL.createObjectURL(w);break;default:w=new Blob([P],{type:"text/markdown"}),p=URL.createObjectURL(w);break}let K=Z(e),X=document.createElement("a");X.href=p,X.download=K,document.body.appendChild(X),X.click(),document.body.removeChild(X);let ne={id:`export_${Date.now()}`,format:e,timestamp:Date.now(),url:p,filename:K};C(ee=>[ne,...ee]),H&&H(e,p);}catch(e){console.error("Export error:",e),V("An error occurred during export. Please try again.");}finally{D(false);}}),b=()=>{let e=[{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:chunkVURIXCGY_js.a("mb-6",d==null?void 0:d.formatSelector,r),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:p=>Y(p.target.value),className:chunkVURIXCGY_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-blue-500",d==null?void 0:d.formatOption,r),children:e.map(p=>jsxRuntime.jsx("option",{value:p.value,children:p.label},p.value))})]})},c=()=>B?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:()=>j(false),className:"text-blue-600 dark:text-blue-400 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:v,onChange:e=>W(e.target.value),placeholder:_(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-blue-500"}),jsxRuntime.jsx("p",{className:"text-xs text-gray-500 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:u,onChange:e=>s(e.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-blue-500"})]}),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:y,onChange:e=>k(e.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-blue-500"})]}),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:t,onChange:e=>j(e.target.checked),className:"w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 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-500 dark:text-gray-400",children:"Adds a notice explaining that this policy complies with NDPA requirements."})]})]})]}):jsxRuntime.jsx("button",{type:"button",onClick:()=>j(true),className:"text-blue-600 dark:text-blue-400 text-sm mb-6",children:"Show Advanced Options"}),m=()=>!G||g.length===0?null:jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("mt-6",d==null?void 0:d.preview,r),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-500 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-500 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-500 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-500 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:g.map(e=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300",children:new Date(e.timestamp).toLocaleString()}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300",children:e.format.toUpperCase()}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300",children:e.filename}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:jsxRuntime.jsx("a",{href:e.url,download:e.filename,className:"text-blue-600 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 mr-4",children:"Download"})})]},e.id))})]})})]});return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${z}`,d==null?void 0:d.root,r),children:[jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("mb-6",d==null?void 0:d.header,r),children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-xl font-bold mb-2",d==null?void 0:d.title,r),children:N}),jsxRuntime.jsx("p",{className:chunkVURIXCGY_js.a("text-gray-600 dark:text-gray-300",d==null?void 0:d.description,r),children:L})]}),b(),c(),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("button",{onClick:n,disabled:F,className:chunkVURIXCGY_js.a(`px-6 py-3 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${A} ${F?"opacity-70 cursor-not-allowed":""}`,d==null?void 0:d.exportButton,r),children:F?"Exporting...":`Export as ${E.toUpperCase()}`}),I&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-500",children:I})]}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",d==null?void 0:d.complianceNotice,r),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."})]})]}),m()]})};exports.a=ge;exports.b=he;exports.c=$e;//# sourceMappingURL=chunk-VXRY3V42.js.map
94
- //# sourceMappingURL=chunk-VXRY3V42.js.map
@@ -1,2 +0,0 @@
1
- 'use strict';var chunkVURIXCGY_js=require('./chunk-VURIXCGY.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var et=({options:b,onSave:h,title:k="We Value Your Privacy",description:I="We use cookies and similar technologies to provide our services and enhance your experience.",acceptAllButtonText:O="Accept All",rejectAllButtonText:D="Reject All",customizeButtonText:w="Customize",saveButtonText:E="Save Preferences",position:C="bottom",version:c="1.0",show:p,storageKey:y="ndpr_consent",className:e="",buttonClassName:a="",primaryButtonClassName:B="",secondaryButtonClassName:A="",classNames:t,unstyled:o})=>{let[i,d]=react.useState(false),[f,v]=react.useState(false),[P,T]=react.useState({});react.useEffect(()=>{let g={};if(b.forEach(u=>{g[u.id]=u.defaultValue||false;}),T(g),p===void 0){let u=localStorage.getItem(y);d(!u);}else d(p);},[b,p,y]);let m=()=>{let g={};b.forEach(u=>{g[u.id]=true;}),z(g);},R=()=>{let g={};b.forEach(u=>{g[u.id]=u.required||false;}),z(g);},r=(g,u)=>{T(H=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},H),{[g]:u}));},x=()=>{z(P);},z=g=>{let u={consents:g,timestamp:Date.now(),version:c,method:f?"customize":"banner",hasInteracted:true};localStorage.setItem(y,JSON.stringify(u)),h(u),d(false),v(false);};if(!i)return null;let F=C==="top"?"top-0 left-0 right-0":C==="center"?"top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 max-w-lg":"bottom-0 left-0 right-0",W=(t==null?void 0:t.acceptButton)||`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${a} ${B}`,V=(t==null?void 0:t.rejectButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${a} ${A}`,Y=(t==null?void 0:t.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${a}`,_=(t==null?void 0:t.saveButton)||`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${a} ${B}`;return jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a(`fixed z-50 bg-white dark:bg-gray-800 shadow-lg p-4 border border-gray-200 dark:border-gray-700 ${F} ${e}`,t==null?void 0:t.root,o),role:"dialog","aria-labelledby":"consent-banner-title",children:jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("max-w-6xl mx-auto",t==null?void 0:t.container,o),children:[jsxRuntime.jsx("h2",{id:"consent-banner-title",className:chunkVURIXCGY_js.a("text-lg font-bold mb-2",t==null?void 0:t.title,o),children:k}),jsxRuntime.jsx("p",{className:chunkVURIXCGY_js.a("mb-4",t==null?void 0:t.description,o),children:I}),f?jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("space-y-3",t==null?void 0:t.optionsList,o),children:b.map(g=>jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("flex items-start",t==null?void 0:t.optionItem,o),children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:`consent-${g.id}`,type:"checkbox",checked:P[g.id]||false,onChange:u=>r(g.id,u.target.checked),disabled:g.required,className:chunkVURIXCGY_js.a("h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",t==null?void 0:t.optionCheckbox,o)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:`consent-${g.id}`,className:chunkVURIXCGY_js.a("font-medium",t==null?void 0:t.optionLabel,o),children:[g.label," ",g.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("p",{className:chunkVURIXCGY_js.a("text-gray-500 dark:text-gray-400",t==null?void 0:t.optionDescription,o),children:g.description})]})]},g.id))}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("mt-4 flex flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:x,className:chunkVURIXCGY_js.a(_,t==null?void 0:t.saveButton,o),children:E}),jsxRuntime.jsx("button",{onClick:()=>v(false),className:chunkVURIXCGY_js.a(V,t==null?void 0:t.rejectButton,o),children:"Back"})]})]}):jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("flex flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:m,className:chunkVURIXCGY_js.a(W,t==null?void 0:t.acceptButton,o),children:O}),jsxRuntime.jsx("button",{onClick:R,className:chunkVURIXCGY_js.a(V,t==null?void 0:t.rejectButton,o),children:D}),jsxRuntime.jsx("button",{onClick:()=>v(true),className:chunkVURIXCGY_js.a(Y,t==null?void 0:t.customizeButton,o),children:w})]}),jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("mt-2 text-xs text-gray-500 dark:text-gray-400",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})})};var at=({options:b,settings:h,onSave:k,title:I="Manage Your Privacy Settings",description:O="Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function.",saveButtonText:D="Save Preferences",resetButtonText:w="Reset to Defaults",version:E="1.0",className:C="",buttonClassName:c="",primaryButtonClassName:p="",secondaryButtonClassName:y="",classNames:e,unstyled:a,showSuccessMessage:B=true,successMessage:A="Your preferences have been saved.",successMessageDuration:t=3e3})=>{let[o,i]=react.useState({}),[d,f]=react.useState(false);react.useEffect(()=>{if(h&&h.consents)i(h.consents);else {let r={};b.forEach(x=>{r[x.id]=x.defaultValue||false;}),i(r);}},[b,h]);let v=(r,x)=>{i(z=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},z),{[r]:x}));},P=()=>{let r={consents:o,timestamp:Date.now(),version:E,method:"manager",hasInteracted:true};k(r),B&&(f(true),setTimeout(()=>{f(false);},t));},T=()=>{let r={};b.forEach(x=>{r[x.id]=x.defaultValue||false;}),i(r);},m=(e==null?void 0:e.saveButton)||`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${c} ${p}`,R=(e==null?void 0:e.resetButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${c} ${y}`;return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 ${C}`,e==null?void 0:e.root,a),children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-xl font-bold mb-2",e==null?void 0:e.title,a),children:I}),jsxRuntime.jsx("p",{className:chunkVURIXCGY_js.a("mb-6 text-gray-600 dark:text-gray-300",e==null?void 0:e.description,a),children:O}),jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("space-y-6",e==null?void 0:e.optionsList,a),children:b.map(r=>jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("border-b border-gray-200 dark:border-gray-700 pb-4 last:border-0",e==null?void 0:e.optionItem,a),children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:r.label}),jsxRuntime.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:r.description})]}),jsxRuntime.jsx("div",{className:"ml-4 flex-shrink-0",children:jsxRuntime.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",className:"sr-only peer",checked:o[r.id]||false,onChange:x=>v(r.id,x.target.checked),disabled:r.required}),jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a(`w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600 ${r.required?"opacity-60":""}`,e==null?void 0:e.toggle,a)}),jsxRuntime.jsxs("span",{className:"ml-3 text-sm font-medium text-gray-900 dark:text-gray-300",children:[o[r.id]?"Enabled":"Disabled",r.required&&jsxRuntime.jsx("span",{className:"text-xs text-red-500 ml-1",children:"(Required)"})]})]})})]})},r.id))}),d&&jsxRuntime.jsx("div",{className:"mt-4 p-3 bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-200 rounded-md",children:A}),jsxRuntime.jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[jsxRuntime.jsx("button",{onClick:P,className:chunkVURIXCGY_js.a(m,e==null?void 0:e.saveButton,a),children:D}),jsxRuntime.jsx("button",{onClick:T,className:chunkVURIXCGY_js.a(R,e==null?void 0:e.resetButton,a),children:w})]}),jsxRuntime.jsxs("div",{className:"mt-4 text-xs text-gray-500 dark:text-gray-400",children:[jsxRuntime.jsxs("p",{children:["Last updated: ",h?new Date(h.timestamp).toLocaleString():"Never"]}),jsxRuntime.jsxs("p",{children:["Version: ",E]})]})]})};var st=({settings:b,storageOptions:h={},onLoad:k,onSave:I,autoSave:O=true,autoLoad:D=true,classNames:w,unstyled:E,children:C})=>{let{storageKey:c="ndpr_consent",storageType:p="localStorage",cookieOptions:y={}}=h,[e,a]=react.useState(false);react.useEffect(()=>{D&&!e&&B();},[D,e]),react.useEffect(()=>{O&&e&&A(b);},[b,O,e]);let B=()=>{let i=null;try{if(p==="localStorage"&&typeof window!="undefined"){let d=localStorage.getItem(c);d&&(i=JSON.parse(d));}else if(p==="sessionStorage"&&typeof window!="undefined"){let d=sessionStorage.getItem(c);d&&(i=JSON.parse(d));}else if(p==="cookie"&&typeof document!="undefined"){let f=document.cookie.split(";").find(v=>v.trim().startsWith(`${c}=`));if(f){let v=f.split("=")[1];i=JSON.parse(decodeURIComponent(v));}}a(!0),k&&k(i);}catch(d){console.error("Error loading consent settings:",d),a(true),k&&k(null);}return i},A=i=>{try{let d=JSON.stringify(i);if(p==="localStorage"&&typeof window!="undefined")localStorage.setItem(c,d);else if(p==="sessionStorage"&&typeof window!="undefined")sessionStorage.setItem(c,d);else if(p==="cookie"&&typeof document!="undefined"){let{domain:f,path:v="/",expires:P=365,secure:T=!0,sameSite:m="Lax"}=y,R=new Date;R.setDate(R.getDate()+P);let r=`${c}=${encodeURIComponent(d)}; path=${v}; expires=${R.toUTCString()}`;f&&(r+=`; domain=${f}`),T&&(r+="; secure"),r+=`; samesite=${m}`,document.cookie=r;}return I&&I(i),!0}catch(d){return console.error("Error saving consent settings:",d),false}},t=()=>{try{if(p==="localStorage"&&typeof window!="undefined")localStorage.removeItem(c);else if(p==="sessionStorage"&&typeof window!="undefined")sessionStorage.removeItem(c);else if(p==="cookie"&&typeof document!="undefined"){let{domain:i,path:d="/"}=y,f=`${c}=; path=${d}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;i&&(f+=`; domain=${i}`),document.cookie=f;}return !0}catch(i){return console.error("Error clearing consent settings:",i),false}},o=chunkVURIXCGY_js.a("",w==null?void 0:w.root,E);if(typeof C=="function"){let i=C({loadSettings:B,saveSettings:A,clearSettings:t,loaded:e});return o?jsxRuntime.jsx("div",{className:o,children:i}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:i})}return o?jsxRuntime.jsx("div",{className:o,children:C}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:C})};exports.a=et;exports.b=at;exports.c=st;//# sourceMappingURL=chunk-YBPHGEL2.js.map
2
- //# sourceMappingURL=chunk-YBPHGEL2.js.map
@@ -1,24 +0,0 @@
1
- import { a as ConsentSettings, C as ConsentOption } from './consent-CmVzqZUk.mjs';
2
-
3
- /**
4
- * Validates consent settings to ensure they meet NDPA requirements
5
- * @param settings The consent settings to validate
6
- * @returns An object containing validation result and any error messages
7
- */
8
- declare function validateConsent(settings: ConsentSettings): {
9
- valid: boolean;
10
- errors: string[];
11
- };
12
- /**
13
- * Validates that consent options meet NDPA Section 26 requirements.
14
- * Each consent option must specify a purpose for which data will be processed,
15
- * as consent must be specific and informed per the Nigeria Data Protection Act.
16
- * @param options The consent options to validate
17
- * @returns An object containing validation result and any error messages
18
- */
19
- declare function validateConsentOptions(options: ConsentOption[]): {
20
- valid: boolean;
21
- errors: string[];
22
- };
23
-
24
- export { validateConsentOptions as a, validateConsent as v };
@@ -1,24 +0,0 @@
1
- import { a as ConsentSettings, C as ConsentOption } from './consent-CmVzqZUk.js';
2
-
3
- /**
4
- * Validates consent settings to ensure they meet NDPA requirements
5
- * @param settings The consent settings to validate
6
- * @returns An object containing validation result and any error messages
7
- */
8
- declare function validateConsent(settings: ConsentSettings): {
9
- valid: boolean;
10
- errors: string[];
11
- };
12
- /**
13
- * Validates that consent options meet NDPA Section 26 requirements.
14
- * Each consent option must specify a purpose for which data will be processed,
15
- * as consent must be specific and informed per the Nigeria Data Protection Act.
16
- * @param options The consent options to validate
17
- * @returns An object containing validation result and any error messages
18
- */
19
- declare function validateConsentOptions(options: ConsentOption[]): {
20
- valid: boolean;
21
- errors: string[];
22
- };
23
-
24
- export { validateConsentOptions as a, validateConsent as v };
@@ -1,15 +0,0 @@
1
- import { P as PolicySection, O as OrganizationInfo } from './privacy-Ca6te9Ir.mjs';
2
-
3
- /**
4
- * Generates policy text by replacing variables in a template with organization-specific values
5
- * @param sectionsOrTemplate The policy sections or template string to generate text for
6
- * @param organizationInfoOrVariables The organization information or variable map to use for replacement
7
- * @returns The generated policy text or an object with the generated text and metadata
8
- */
9
- declare function generatePolicyText(sectionsOrTemplate: PolicySection[] | string, organizationInfoOrVariables: OrganizationInfo | Record<string, string>): string | {
10
- fullText: string;
11
- sectionTexts: Record<string, string>;
12
- missingVariables: string[];
13
- };
14
-
15
- export { generatePolicyText as g };
@@ -1,15 +0,0 @@
1
- import { P as PolicySection, O as OrganizationInfo } from './privacy-Ca6te9Ir.js';
2
-
3
- /**
4
- * Generates policy text by replacing variables in a template with organization-specific values
5
- * @param sectionsOrTemplate The policy sections or template string to generate text for
6
- * @param organizationInfoOrVariables The organization information or variable map to use for replacement
7
- * @returns The generated policy text or an object with the generated text and metadata
8
- */
9
- declare function generatePolicyText(sectionsOrTemplate: PolicySection[] | string, organizationInfoOrVariables: OrganizationInfo | Record<string, string>): string | {
10
- fullText: string;
11
- sectionTexts: Record<string, string>;
12
- missingVariables: string[];
13
- };
14
-
15
- export { generatePolicyText as g };