@tantainnovative/ndpr-toolkit 3.3.0 → 3.3.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 (68) hide show
  1. package/README.md +4 -4
  2. package/dist/breach.js +1 -1
  3. package/dist/breach.mjs +1 -1
  4. package/dist/chunk-2AW7KAZO.mjs +2 -0
  5. package/dist/chunk-5ECDPRSZ.js +7 -0
  6. package/dist/chunk-6FGCGLH5.mjs +2 -0
  7. package/dist/chunk-CYU6YUJQ.mjs +81 -0
  8. package/dist/chunk-DCJK5OZT.mjs +2 -0
  9. package/dist/chunk-EKHBORAH.js +81 -0
  10. package/dist/chunk-ENIMJ6SQ.js +2 -0
  11. package/dist/{chunk-QDHHD2KR.mjs → chunk-FLKJSGR7.mjs} +12 -12
  12. package/dist/{chunk-GQVNLUP2.js → chunk-FWLPJ5YI.js} +12 -12
  13. package/dist/chunk-M2TPT5GB.js +2 -0
  14. package/dist/chunk-MCWV7S2G.js +2 -0
  15. package/dist/chunk-OPYQIJKY.js +2 -0
  16. package/dist/chunk-OYR3L4XS.mjs +7 -0
  17. package/dist/chunk-QF6XNKU6.mjs +2 -0
  18. package/dist/{chunk-256APOQM.js → chunk-QJ3JNHO7.js} +2 -2
  19. package/dist/{chunk-Q7VHB64E.mjs → chunk-QNCGRCAX.mjs} +2 -2
  20. package/dist/chunk-XSEZDQLB.js +2 -0
  21. package/dist/chunk-Z6IIMLZU.mjs +2 -0
  22. package/dist/consent.js +1 -1
  23. package/dist/consent.mjs +1 -1
  24. package/dist/core.d.mts +5 -1
  25. package/dist/core.d.ts +5 -1
  26. package/dist/core.js +1 -1
  27. package/dist/core.mjs +1 -1
  28. package/dist/cross-border.d.mts +2 -2
  29. package/dist/cross-border.d.ts +2 -2
  30. package/dist/cross-border.js +1 -1
  31. package/dist/cross-border.mjs +1 -1
  32. package/dist/dpia.js +1 -1
  33. package/dist/dpia.mjs +1 -1
  34. package/dist/dsr.js +1 -1
  35. package/dist/dsr.mjs +1 -1
  36. package/dist/hooks.d.mts +2 -2
  37. package/dist/hooks.d.ts +2 -2
  38. package/dist/hooks.js +1 -1
  39. package/dist/hooks.mjs +1 -1
  40. package/dist/index.d.mts +2 -2
  41. package/dist/index.d.ts +2 -2
  42. package/dist/index.js +1 -1
  43. package/dist/index.mjs +1 -1
  44. package/dist/policy.d.mts +2 -2
  45. package/dist/policy.d.ts +2 -2
  46. package/dist/policy.js +1 -1
  47. package/dist/policy.mjs +1 -1
  48. package/dist/ropa.js +1 -1
  49. package/dist/ropa.mjs +1 -1
  50. package/dist/{useCrossBorderTransfer-BGNZt2lk.d.mts → useCrossBorderTransfer-DixjLjN1.d.mts} +1 -1
  51. package/dist/{useCrossBorderTransfer-COqjgjsu.d.ts → useCrossBorderTransfer-DvSq06lv.d.ts} +1 -1
  52. package/dist/{useDefaultPrivacyPolicy-C-mG-A5S.d.ts → useDefaultPrivacyPolicy-DvCbeEl1.d.ts} +5 -1
  53. package/dist/{useDefaultPrivacyPolicy-BsYttRey.d.mts → useDefaultPrivacyPolicy-ySWU7nc-.d.mts} +5 -1
  54. package/package.json +7 -5
  55. package/dist/chunk-6BXUVS6E.js +0 -81
  56. package/dist/chunk-6JCRDJQI.mjs +0 -2
  57. package/dist/chunk-6RQGQZT2.js +0 -2
  58. package/dist/chunk-CSIJCLGZ.mjs +0 -2
  59. package/dist/chunk-E63VPR7U.js +0 -2
  60. package/dist/chunk-FDDI426Y.mjs +0 -2
  61. package/dist/chunk-IQJO7WIH.js +0 -7
  62. package/dist/chunk-M6XETYNL.js +0 -2
  63. package/dist/chunk-NUDVUAD4.mjs +0 -81
  64. package/dist/chunk-NUULHXVL.mjs +0 -7
  65. package/dist/chunk-PM7O5IGE.mjs +0 -2
  66. package/dist/chunk-TKVJ3OOV.mjs +0 -2
  67. package/dist/chunk-VLSGE2YA.js +0 -2
  68. package/dist/chunk-ZGJA7OO4.js +0 -2
@@ -1,11 +1,11 @@
1
- import {b,c,a as a$2}from'./chunk-ZEOQYWOE.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {d,b as b$1,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useId,useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var fe=({sections:E=b,variables:M=c,onGenerate:T,title:Y="NDPA Privacy Policy Generator",description:V="Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 24.",className:N="",buttonClassName:F="",generateButtonText:Q="Generate Policy",showPreview:R=true,allowEditing:X=true,classNames:r,unstyled:h=false})=>{let P=useId(),[A,a$3]=useState(E),[o,g]=useState(M),[s,$]=useState("sections"),[L,J]=useState(""),[I,q]=useState(""),[K,Z]=useState(false),[v,O]=useState({});useEffect(()=>{a$3(E);},[E]),useEffect(()=>{g(M);},[M]);let G=l=>{a$3(c=>c.map(d=>d.id===l?b$1(a$1({},d),{included:!d.included}):d));},W=(l,c)=>{g(d=>d.map(u=>u.id===l?b$1(a$1({},u),{value:c}):u)),v[l]&&O(d=>{let u=a$1({},d);return delete u[l],u});},j=()=>{let l={},c=true;return o.forEach(d=>{d.required&&!d.value&&(l[d.id]=`${d.name} is required`,c=false);}),O(l),c},ee=()=>{if(!j()){$("variables");return}let l=A.filter(u=>u.included),c=Object.fromEntries(o.map(u=>[u.name,u.value])),d="";l.forEach(u=>{d+=`## ${u.title}
1
+ import {b,c,a as a$2}from'./chunk-ZEOQYWOE.mjs';import {a}from'./chunk-AYKLAEOU.mjs';import {d,b as b$1,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useId,useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var fe=({sections:E=b,variables:M=c,onGenerate:T,title:V="NDPA Privacy Policy Generator",description:G="Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 24.",className:K="",buttonClassName:A="",generateButtonText:Q="Generate Policy",showPreview:R=true,allowEditing:N=true,classNames:r,unstyled:h=false})=>{let P=useId(),[F,n]=useState(E),[o,g]=useState(M),[s,$]=useState("sections"),[L,X]=useState(""),[I,q]=useState(""),[J,Z]=useState(false),[v,O]=useState({});useEffect(()=>{n(E);},[E]),useEffect(()=>{g(M);},[M]);let W=l=>{n(c=>c.map(d=>d.id===l?b$1(a$1({},d),{included:!d.included}):d));},j=(l,c)=>{g(d=>d.map(u=>u.id===l?b$1(a$1({},u),{value:c}):u)),v[l]&&O(d=>{let u=a$1({},d);return delete u[l],u});},z=()=>{let l={},c=true;return o.forEach(d=>{d.required&&!d.value&&(l[d.id]=`${d.name} is required`,c=false);}),O(l),c},ee=()=>{if(!z()){$("variables");return}let l=F.filter(u=>u.included),c=Object.fromEntries(o.map(u=>[u.name,u.value])),d="";l.forEach(u=>{d+=`## ${u.title}
2
2
 
3
3
  `,d+=a$2(u.template,c),d+=`
4
4
 
5
- `;}),J(d),q(d),Z(true),$("preview");},x=()=>{T({sections:A,variables:o,content:X?I:L});},m=()=>jsxs("div",{className:a("space-y-4",r==null?void 0:r.sectionList,h),role:"group","aria-labelledby":`${P}-sections-heading`,children:[jsx("h3",{id:`${P}-sections-heading`,className:"text-lg font-medium mb-4",children:"Select Policy Sections"}),A.map(l=>{let c=`${P}-section-${l.id}`,d=l.description?`${P}-section-desc-${l.id}`:void 0;return jsx("div",{className:a("border border-gray-200 dark:border-gray-700 rounded-md p-4",r==null?void 0:r.sectionItem,h),children:jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:c,type:"checkbox",checked:l.included,onChange:()=>G(l.id),disabled:l.required,"aria-describedby":d,className: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",r==null?void 0:r.input,h)})}),jsxs("div",{className:"ml-3 text-sm",children:[jsxs("label",{htmlFor:c,className:"font-medium text-gray-900 dark:text-white",children:[l.title," ",l.required&&jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"}),l.required&&jsx("span",{className:"sr-only",children:" (required)"})]}),l.description&&jsx("p",{id:d,className:"text-gray-600 dark:text-gray-400 mt-1",children:l.description})]})]})},l.id)}),jsx("div",{className:"mt-6",children:jsx("button",{onClick:()=>$("variables"),className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${F}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),h),children:"Next: Fill Variables"})})]}),w=()=>{let l={};return o.forEach(c=>{let d=c.id.split(".")[0];l[d]||(l[d]=[]),l[d].push(c);}),jsxs("div",{className:a("",r==null?void 0:r.form,h),children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Fill Policy Variables"}),jsx("div",{className:"space-y-6",children:Object.entries(l).map(([c,d])=>{let u=A.find(e=>e.id===c);return u&&!u.included?null:jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsx("h4",{className:"font-medium text-lg mb-3",children:u?u.title:"General Information"}),jsx("div",{className:"space-y-4",children:d.map(e=>{let f=`${P}-var-${e.id}`,b=e.description?`${P}-var-desc-${e.id}`:void 0,z=v[e.id]?`${P}-var-err-${e.id}`:void 0,B=[b,z].filter(Boolean).join(" ")||void 0;return jsxs("div",{children:[jsxs("label",{htmlFor:f,className:"block text-sm font-medium mb-1",children:[e.name," ",e.required&&jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),e.description&&jsx("p",{id:b,className:"text-xs text-gray-600 dark:text-gray-400 mb-2",children:e.description}),e.inputType==="textarea"?jsx("textarea",{id:f,value:e.value,onChange:D=>W(e.id,D.target.value),rows:4,className: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-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0}):e.inputType==="select"&&e.options?jsxs("select",{id:f,value:e.value,onChange:D=>W(e.id,D.target.value),className: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-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0,children:[jsx("option",{value:"",children:"Select an option"}),e.options.map(D=>jsx("option",{value:D,children:D},D))]}):jsx("input",{id:f,type:e.inputType,value:e.value,onChange:D=>W(e.id,D.target.value),className: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-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0}),v[e.id]&&jsx("p",{id:z,role:"alert",className:"mt-1 text-sm text-red-600 dark:text-red-500",children:v[e.id]})]},e.id)})})]},c)})}),jsxs("div",{className:"mt-6 flex space-x-4",children:[jsx("button",{onClick:()=>$("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 ${F}`,children:"Back to Sections"}),jsx("button",{onClick:ee,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${F}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),h),children:Q})]})]})},C=()=>{let l=`${P}-policy-content`;return jsxs("div",{children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Preview Generated Policy"}),X?jsxs("div",{className:"mb-4",children:[jsx("label",{htmlFor:l,className:"block text-sm font-medium mb-1",children:"Edit Policy Content"}),jsx("textarea",{id:l,value:I,onChange:c=>q(c.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"})]}):jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4","aria-live":"polite",children:jsx("div",{className:"prose dark:prose-invert max-w-none",children:L.split(`
6
- `).map((c,d)=>c.startsWith("## ")?jsx("h3",{className:"text-xl font-bold mt-6 mb-3",children:c.substring(3)},d):c.startsWith("### ")?jsx("h4",{className:"text-lg font-bold mt-4 mb-2",children:c.substring(4)},d):c===""?jsx("br",{},d):jsx("p",{className:"mb-2",children:c},d))})}),jsxs("div",{className:"mt-6 flex space-x-4",children:[jsx("button",{onClick:()=>$("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 ${F}`,children:"Back to Variables"}),jsx("button",{onClick:x,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${F}`,children:"Save Policy"})]})]})},U=()=>{switch(s){case "sections":return m();case "variables":return w();case "preview":return C();default:return m()}};return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${N}`,r==null?void 0:r.root,h),children:[jsxs("div",{className:a("mb-6",r==null?void 0:r.header,h),children:[jsx("h2",{className:a("text-xl font-bold mb-2",r==null?void 0:r.title,h),children:Y}),jsx("p",{className:a("text-gray-600 dark:text-gray-300",r==null?void 0:r.description,h),children:V})]}),jsx("nav",{"aria-label":"Policy generation steps",className:"mb-8",children:jsxs("ol",{className:"flex items-center w-full",children:[jsxs("li",{className:`flex w-full items-center ${s==="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:[jsx("span",{className:`flex items-center justify-center w-8 h-8 ${s==="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`,"aria-current":s==="sections"?"step":void 0,children:"1"}),jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Sections"}),jsx("span",{className:"sr-only",children:s==="sections"?" (current step)":""})]}),jsxs("li",{className:`flex w-full items-center ${s==="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:[jsx("span",{className:`flex items-center justify-center w-8 h-8 ${s==="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`,"aria-current":s==="variables"?"step":void 0,children:"2"}),jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Variables"}),jsx("span",{className:"sr-only",children:s==="variables"?" (current step)":""})]}),jsxs("li",{className:`flex items-center ${s==="preview"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"}`,children:[jsx("span",{className:`flex items-center justify-center w-8 h-8 ${s==="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`,"aria-current":s==="preview"?"step":void 0,children:"3"}),jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Preview"}),jsx("span",{className:"sr-only",children:s==="preview"?" (current step)":""})]})]})}),jsxs("div",{className:a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",r==null?void 0:r.complianceNotice,h),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),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."})]}),U()]})};var Ee=({content:E,sections:M,variables:T,onExport:Y,onEdit:V,title:N="Privacy Policy Preview",description:F="Preview your NDPA-compliant privacy policy before exporting.",className:Q="",buttonClassName:R="",showExportOptions:X=true,showEditButton:r=true,showTableOfContents:h=true,showMetadata:P=true,organizationName:A,lastUpdated:a$1=new Date,classNames:o,unstyled:g=false})=>{let s=useId(),[$,L]=useState("preview"),J=`${s}-tab-preview`,I=`${s}-tab-markdown`,q=`${s}-panel-preview`,K=`${s}-panel-markdown`,v=(()=>{let x=E.split(`
7
- `),m=[];return x.forEach(w=>{if(w.startsWith("## ")){let C=w.substring(3).trim(),U=`${s}-${C.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;m.push({id:U,title:C,level:2});}else if(w.startsWith("### ")){let C=w.substring(4).trim(),U=`${s}-${C.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;m.push({id:U,title:C,level:3});}}),m})(),O=x=>{if(Y)Y(x);else if(x==="markdown"){let m=document.createElement("a"),w=new Blob([E],{type:"text/markdown"});m.href=URL.createObjectURL(w),m.download=`privacy-policy-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(m),m.click(),document.body.removeChild(m);}},G=()=>!h||v.length===0?null:jsxs("nav",{"aria-label":"Table of contents",className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Table of Contents"}),jsx("ul",{className:"space-y-1",children:v.map((x,m)=>jsx("li",{style:{marginLeft:`${(x.level-2)*1.5}rem`},children:jsx("a",{href:`#${x.id}`,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline",children:x.title})},m))})]}),W=()=>P?jsxs("div",{className:"mb-6",children:[jsx("h1",{className:"text-2xl font-bold mb-2",children:A?`${A} Privacy Policy`:"Privacy Policy"}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Last Updated: ",a$1.toLocaleDateString()]})]}):null,j=()=>jsx("div",{className:a("prose dark:prose-invert max-w-none",o==null?void 0:o.sectionContent,g),children:E.split(`
8
- `).map((x,m)=>{if(x.startsWith("## ")){let w=x.substring(3).trim(),C=`${s}-${w.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return jsx("h3",{id:C,className:a("text-xl font-bold mt-6 mb-3",o==null?void 0:o.sectionTitle,g),children:w},m)}else if(x.startsWith("### ")){let w=x.substring(4).trim(),C=`${s}-${w.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return jsx("h4",{id:C,className:a("text-lg font-bold mt-4 mb-2",o==null?void 0:o.sectionTitle,g),children:w},m)}else return x===""?jsx("br",{},m):jsx("p",{className:"mb-2",children:x},m)})}),ee=()=>X?jsxs("div",{className:"mt-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Export Options"}),jsxs("div",{className:"flex flex-wrap gap-3",children:[jsx("button",{onClick:()=>O("pdf"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as PDF"}),jsx("button",{onClick:()=>O("docx"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as DOCX"}),jsx("button",{onClick:()=>O("html"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as HTML"}),jsx("button",{onClick:()=>O("markdown"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as Markdown"})]})]}):null;return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,o==null?void 0:o.root,g),children:[jsxs("div",{className:a("flex justify-between items-start mb-6",o==null?void 0:o.header,g),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-bold mb-2",o==null?void 0:o.title,g),children:N}),jsx("p",{className:a("text-gray-600 dark:text-gray-300",o==null?void 0:o.description,g),children:F})]}),r&&V&&jsx("button",{onClick:V,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 ${R}`,children:"Edit Policy"})]}),jsxs("div",{className:a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",o==null?void 0:o.complianceNotice,g),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),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."})]}),jsx("div",{className:"mb-6 border-b border-gray-200 dark:border-gray-700",children:jsxs("div",{role:"tablist","aria-label":"Policy view options",className:"flex flex-wrap -mb-px",children:[jsx("div",{className:"mr-2",children:jsx("button",{role:"tab",id:J,"aria-selected":$==="preview","aria-controls":q,onClick:()=>L("preview"),className:`inline-block p-4 ${$==="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"})}),jsx("div",{className:"mr-2",children:jsx("button",{role:"tab",id:I,"aria-selected":$==="markdown","aria-controls":K,onClick:()=>L("markdown"),className:`inline-block p-4 ${$==="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"})})]})}),jsx("div",{className:a("bg-white dark:bg-gray-800 p-4 rounded-md",o==null?void 0:o.content,g),children:$==="preview"?jsxs("div",{role:"tabpanel",id:q,"aria-labelledby":J,"aria-live":"polite",children:[W(),G(),jsx("div",{className:a("bg-gray-50 dark:bg-gray-700 p-6 rounded-md",o==null?void 0:o.section,g),children:j()})]}):jsx("div",{role:"tabpanel",id:K,"aria-labelledby":I,children: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:E})})}),ee()]})};var Ae=({content:E,title:M="Privacy Policy",organizationName:T,lastUpdated:Y=new Date,onExportComplete:V,componentTitle:N="Export Privacy Policy",description:F="Export your NDPA-compliant privacy policy in various formats.",className:Q="",buttonClassName:R="",showExportHistory:X=true,includeComplianceNotice:r=true,includeLogo:h=false,logoUrl:P,customStyles:A,classNames:a$1,unstyled:o=false})=>{let g=useId(),[s,$]=useState([]),[L,J]=useState("pdf"),[I,q]=useState(false),[K,Z]=useState(null),[v,O]=useState(""),[G,W]=useState(""),[j,ee]=useState(""),[x,m]=useState(false),w=e=>{let f=new Date().toISOString().split("T")[0];return `${T?T.toLowerCase().replace(/[^a-z0-9]+/g,"-"):"privacy-policy"}-privacy-policy-${f}.${e.toLowerCase()}`},C=e=>v?v.endsWith(`.${e.toLowerCase()}`)?v:`${v}.${e.toLowerCase()}`:w(e),U=()=>{let e=T?`${T} ${M}`:M,f=Y.toLocaleDateString(),b=`<!DOCTYPE html>
5
+ `;}),X(d),q(d),Z(true),$("preview");},x=()=>{T({sections:F,variables:o,content:N?I:L});},m=()=>jsxs("div",{className:a("space-y-4",r==null?void 0:r.sectionList,h),role:"group","aria-labelledby":`${P}-sections-heading`,children:[jsx("h3",{id:`${P}-sections-heading`,className:"text-lg font-medium mb-4",children:"Select Policy Sections"}),F.map(l=>{let c=`${P}-section-${l.id}`,d=l.description?`${P}-section-desc-${l.id}`:void 0;return jsx("div",{className:a("border border-gray-200 dark:border-gray-700 rounded-md p-4",r==null?void 0:r.sectionItem,h),children:jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:c,type:"checkbox",checked:l.included,onChange:()=>W(l.id),disabled:l.required,"aria-describedby":d,className: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",r==null?void 0:r.input,h)})}),jsxs("div",{className:"ml-3 text-sm",children:[jsxs("label",{htmlFor:c,className:"font-medium text-gray-900 dark:text-white",children:[l.title," ",l.required&&jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"}),l.required&&jsx("span",{className:"sr-only",children:" (required)"})]}),l.description&&jsx("p",{id:d,className:"text-gray-600 dark:text-gray-400 mt-1",children:l.description})]})]})},l.id)}),jsx("div",{className:"mt-6",children:jsx("button",{onClick:()=>$("variables"),className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${A}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),h),children:"Next: Fill Variables"})})]}),k=()=>{let l={};return o.forEach(c=>{let d=c.id.split(".")[0];l[d]||(l[d]=[]),l[d].push(c);}),jsxs("div",{className:a("",r==null?void 0:r.form,h),children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Fill Policy Variables"}),jsx("div",{className:"space-y-6",children:Object.entries(l).map(([c,d])=>{let u=F.find(e=>e.id===c);return u&&!u.included?null:jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsx("h4",{className:"font-medium text-lg mb-3",children:u?u.title:"General Information"}),jsx("div",{className:"space-y-4",children:d.map(e=>{let f=`${P}-var-${e.id}`,b=e.description?`${P}-var-desc-${e.id}`:void 0,_=v[e.id]?`${P}-var-err-${e.id}`:void 0,B=[b,_].filter(Boolean).join(" ")||void 0;return jsxs("div",{children:[jsxs("label",{htmlFor:f,className:"block text-sm font-medium mb-1",children:[e.name," ",e.required&&jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),e.description&&jsx("p",{id:b,className:"text-xs text-gray-600 dark:text-gray-400 mb-2",children:e.description}),e.inputType==="textarea"?jsx("textarea",{id:f,value:e.value,onChange:D=>j(e.id,D.target.value),rows:4,className: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-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0}):e.inputType==="select"&&e.options?jsxs("select",{id:f,value:e.value,onChange:D=>j(e.id,D.target.value),className: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-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0,children:[jsx("option",{value:"",children:"Select an option"}),e.options.map(D=>jsx("option",{value:D,children:D},D))]}):jsx("input",{id:f,type:e.inputType,value:e.value,onChange:D=>j(e.id,D.target.value),className: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-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0}),v[e.id]&&jsx("p",{id:_,role:"alert",className:"mt-1 text-sm text-red-600 dark:text-red-500",children:v[e.id]})]},e.id)})})]},c)})}),jsxs("div",{className:"mt-6 flex space-x-4",children:[jsx("button",{onClick:()=>$("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 ${A}`,children:"Back to Sections"}),jsx("button",{onClick:ee,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${A}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),h),children:Q})]})]})},C=()=>{let l=`${P}-policy-content`;return jsxs("div",{children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Preview Generated Policy"}),N?jsxs("div",{className:"mb-4",children:[jsx("label",{htmlFor:l,className:"block text-sm font-medium mb-1",children:"Edit Policy Content"}),jsx("textarea",{id:l,value:I,onChange:c=>q(c.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"})]}):jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4","aria-live":"polite",children:jsx("div",{className:"prose dark:prose-invert max-w-none",children:L.split(`
6
+ `).map((c,d)=>c.startsWith("## ")?jsx("h3",{className:"text-xl font-bold mt-6 mb-3",children:c.substring(3)},d):c.startsWith("### ")?jsx("h4",{className:"text-lg font-bold mt-4 mb-2",children:c.substring(4)},d):c===""?jsx("br",{},d):jsx("p",{className:"mb-2",children:c},d))})}),jsxs("div",{className:"mt-6 flex space-x-4",children:[jsx("button",{onClick:()=>$("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 ${A}`,children:"Back to Variables"}),jsx("button",{onClick:x,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${A}`,children:"Save Policy"})]})]})},H=()=>{switch(s){case "sections":return m();case "variables":return k();case "preview":return C();default:return m()}};return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${K}`,r==null?void 0:r.root,h),children:[jsxs("div",{className:a("mb-6",r==null?void 0:r.header,h),children:[jsx("h2",{className:a("text-xl font-bold mb-2",r==null?void 0:r.title,h),children:V}),jsx("p",{className:a("text-gray-600 dark:text-gray-300",r==null?void 0:r.description,h),children:G})]}),jsx("nav",{"aria-label":"Policy generation steps",className:"mb-8",children:jsxs("ol",{className:"flex items-center w-full",children:[jsxs("li",{className:`flex w-full items-center ${s==="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:[jsx("span",{className:`flex items-center justify-center w-8 h-8 ${s==="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`,"aria-current":s==="sections"?"step":void 0,children:"1"}),jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Sections"}),jsx("span",{className:"sr-only",children:s==="sections"?" (current step)":""})]}),jsxs("li",{className:`flex w-full items-center ${s==="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:[jsx("span",{className:`flex items-center justify-center w-8 h-8 ${s==="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`,"aria-current":s==="variables"?"step":void 0,children:"2"}),jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Variables"}),jsx("span",{className:"sr-only",children:s==="variables"?" (current step)":""})]}),jsxs("li",{className:`flex items-center ${s==="preview"?"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]":"text-gray-600 dark:text-gray-400"}`,children:[jsx("span",{className:`flex items-center justify-center w-8 h-8 ${s==="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`,"aria-current":s==="preview"?"step":void 0,children:"3"}),jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Preview"}),jsx("span",{className:"sr-only",children:s==="preview"?" (current step)":""})]})]})}),jsxs("div",{className:a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",r==null?void 0:r.complianceNotice,h),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),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."})]}),H()]})};var Ee=({content:E,sections:M,variables:T,onExport:V,onEdit:G,title:K="Privacy Policy Preview",description:A="Preview your NDPA-compliant privacy policy before exporting.",className:Q="",buttonClassName:R="",showExportOptions:N=true,showEditButton:r=true,showTableOfContents:h=true,showMetadata:P=true,organizationName:F,lastUpdated:n,classNames:o,unstyled:g=false})=>{let s=useId(),[$,L]=useState("preview"),X=`${s}-tab-preview`,I=`${s}-tab-markdown`,q=`${s}-panel-preview`,J=`${s}-panel-markdown`,v=(()=>{let x=E.split(`
7
+ `),m=[];return x.forEach(k=>{if(k.startsWith("## ")){let C=k.substring(3).trim(),H=`${s}-${C.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;m.push({id:H,title:C,level:2});}else if(k.startsWith("### ")){let C=k.substring(4).trim(),H=`${s}-${C.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;m.push({id:H,title:C,level:3});}}),m})(),O=x=>{if(V)V(x);else if(x==="markdown"){let m=document.createElement("a"),k=new Blob([E],{type:"text/markdown"});m.href=URL.createObjectURL(k),m.download=`privacy-policy-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(m),m.click(),document.body.removeChild(m);}},W=()=>!h||v.length===0?null:jsxs("nav",{"aria-label":"Table of contents",className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Table of Contents"}),jsx("ul",{className:"space-y-1",children:v.map((x,m)=>jsx("li",{style:{marginLeft:`${(x.level-2)*1.5}rem`},children:jsx("a",{href:`#${x.id}`,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline",children:x.title})},m))})]}),j=()=>P?jsxs("div",{className:"mb-6",children:[jsx("h1",{className:"text-2xl font-bold mb-2",children:F?`${F} Privacy Policy`:"Privacy Policy"}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Last Updated: ",n?n.toLocaleDateString():"N/A"]})]}):null,z=()=>jsx("div",{className:a("prose dark:prose-invert max-w-none",o==null?void 0:o.sectionContent,g),children:E.split(`
8
+ `).map((x,m)=>{if(x.startsWith("## ")){let k=x.substring(3).trim(),C=`${s}-${k.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return jsx("h3",{id:C,className:a("text-xl font-bold mt-6 mb-3",o==null?void 0:o.sectionTitle,g),children:k},m)}else if(x.startsWith("### ")){let k=x.substring(4).trim(),C=`${s}-${k.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return jsx("h4",{id:C,className:a("text-lg font-bold mt-4 mb-2",o==null?void 0:o.sectionTitle,g),children:k},m)}else return x===""?jsx("br",{},m):jsx("p",{className:"mb-2",children:x},m)})}),ee=()=>N?jsxs("div",{className:"mt-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Export Options"}),jsxs("div",{className:"flex flex-wrap gap-3",children:[jsx("button",{onClick:()=>O("pdf"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as PDF"}),jsx("button",{onClick:()=>O("docx"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as DOCX"}),jsx("button",{onClick:()=>O("html"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as HTML"}),jsx("button",{onClick:()=>O("markdown"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as Markdown"})]})]}):null;return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,o==null?void 0:o.root,g),children:[jsxs("div",{className:a("flex justify-between items-start mb-6",o==null?void 0:o.header,g),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-bold mb-2",o==null?void 0:o.title,g),children:K}),jsx("p",{className:a("text-gray-600 dark:text-gray-300",o==null?void 0:o.description,g),children:A})]}),r&&G&&jsx("button",{onClick:G,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 ${R}`,children:"Edit Policy"})]}),jsxs("div",{className:a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",o==null?void 0:o.complianceNotice,g),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),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."})]}),jsx("div",{className:"mb-6 border-b border-gray-200 dark:border-gray-700",children:jsxs("div",{role:"tablist","aria-label":"Policy view options",className:"flex flex-wrap -mb-px",children:[jsx("div",{className:"mr-2",children:jsx("button",{role:"tab",id:X,"aria-selected":$==="preview","aria-controls":q,onClick:()=>L("preview"),className:`inline-block p-4 ${$==="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"})}),jsx("div",{className:"mr-2",children:jsx("button",{role:"tab",id:I,"aria-selected":$==="markdown","aria-controls":J,onClick:()=>L("markdown"),className:`inline-block p-4 ${$==="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"})})]})}),jsx("div",{className:a("bg-white dark:bg-gray-800 p-4 rounded-md",o==null?void 0:o.content,g),children:$==="preview"?jsxs("div",{role:"tabpanel",id:q,"aria-labelledby":X,"aria-live":"polite",children:[j(),W(),jsx("div",{className:a("bg-gray-50 dark:bg-gray-700 p-6 rounded-md",o==null?void 0:o.section,g),children:z()})]}):jsx("div",{role:"tabpanel",id:J,"aria-labelledby":I,children: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:E})})}),ee()]})};var Fe=({content:E,title:M="Privacy Policy",organizationName:T,lastUpdated:V,onExportComplete:G,componentTitle:K="Export Privacy Policy",description:A="Export your NDPA-compliant privacy policy in various formats.",className:Q="",buttonClassName:R="",showExportHistory:N=true,includeComplianceNotice:r=true,includeLogo:h=false,logoUrl:P,customStyles:F,classNames:n,unstyled:o=false})=>{let g=useId(),[s,$]=useState([]),[L,X]=useState("pdf"),[I,q]=useState(false),[J,Z]=useState(null),[v,O]=useState(""),[W,j]=useState(""),[z,ee]=useState(""),[x,m]=useState(false),k=e=>{let f=new Date().toISOString().split("T")[0];return `${T?T.toLowerCase().replace(/[^a-z0-9]+/g,"-"):"privacy-policy"}-privacy-policy-${f}.${e.toLowerCase()}`},C=e=>v?v.endsWith(`.${e.toLowerCase()}`)?v:`${v}.${e.toLowerCase()}`:k(e),H=()=>{let e=T?`${T} ${M}`:M,f=V?V.toLocaleDateString():"N/A",b=`<!DOCTYPE html>
9
9
  <html lang="en">
10
10
  <head>
11
11
  <meta charset="UTF-8">
@@ -67,28 +67,28 @@ import {b,c,a as a$2}from'./chunk-ZEOQYWOE.mjs';import {a}from'./chunk-AYKLAEOU.
67
67
  margin-bottom: 30px;
68
68
  font-size: 14px;
69
69
  }
70
- ${A||""}
70
+ ${F||""}
71
71
  </style>
72
72
  </head>
73
73
  <body>
74
74
  <div class="header">
75
75
  ${h&&P?`<img src="${P}" alt="${T||"Company"} Logo" class="logo">`:""}
76
- ${G?`<div class="custom-header">${G}</div>`:""}
76
+ ${W?`<div class="custom-header">${W}</div>`:""}
77
77
  <h1>${e}</h1>
78
78
  <div class="last-updated">Last Updated: ${f}</div>
79
79
  </div>`;r&&(b+=`
80
80
  <div class="compliance-notice">
81
81
  <strong>NDPA Compliance Notice:</strong> This privacy policy has been created to comply with the Nigeria Data Protection Act (NDPA) 2023.
82
82
  It outlines how we collect, use, disclose, and protect your personal information in accordance with NDPA requirements.
83
- </div>`);let z=E.replace(/^## (.*?)$/gm,"<h2>$1</h2>").replace(/^### (.*?)$/gm,"<h3>$1</h3>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>");return b+=`
83
+ </div>`);let _=E.replace(/^## (.*?)$/gm,"<h2>$1</h2>").replace(/^### (.*?)$/gm,"<h3>$1</h3>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>");return b+=`
84
84
  <div class="content">
85
- <p>${z}</p>
85
+ <p>${_}</p>
86
86
  </div>
87
87
 
88
88
  <div class="footer">
89
- ${j?`<div class="custom-footer">${j}</div>`:""}
89
+ ${z?`<div class="custom-footer">${z}</div>`:""}
90
90
  <p>&copy; ${new Date().getFullYear()} ${T||"Company"}. All rights reserved.</p>
91
91
  </div>
92
92
  </body>
93
- </html>`,b},l=()=>d(null,null,function*(){q(true),Z(null);try{let e=L.toLowerCase(),f="",b;switch(e){case "pdf":let te=U();b=new Blob([te],{type:"text/html"}),f=URL.createObjectURL(b);break;case "docx":b=new Blob([E],{type:"text/plain"}),f=URL.createObjectURL(b);break;case "html":let pe=U();b=new Blob([pe],{type:"text/html"}),f=URL.createObjectURL(b);break;default:b=new Blob([E],{type:"text/markdown"}),f=URL.createObjectURL(b);break}let z=C(e),B=document.createElement("a");B.href=f,B.download=z,document.body.appendChild(B),B.click(),document.body.removeChild(B);let D={id:`export_${Date.now()}`,format:e,timestamp:Date.now(),url:f,filename:z};$(te=>[D,...te]),V&&V(e,f);}catch(e){console.error("Export error:",e),Z("An error occurred during export. Please try again.");}finally{q(false);}}),c=()=>{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)"}],f=`${g}-export-format`;return jsxs("div",{className:a("mb-6",a$1==null?void 0:a$1.formatSelector,o),children:[jsx("label",{htmlFor:f,className:"block text-sm font-medium mb-1",children:"Export Format"}),jsx("select",{id:f,value:L,onChange:b=>J(b.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",a$1==null?void 0:a$1.formatOption,o),children:e.map(b=>jsx("option",{value:b.value,children:b.label},b.value))})]})},d$1=()=>x?jsxs("div",{className:"mb-6 space-y-4 border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsxs("div",{className:"flex justify-between items-center",children:[jsx("h3",{className:"text-md font-medium",children:"Advanced Export Options"}),jsx("button",{type:"button",onClick:()=>m(false),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] text-sm",children:"Hide Advanced Options"})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${g}-custom-filename`,className:"block text-sm font-medium mb-1",children:"Custom Filename"}),jsx("input",{type:"text",id:`${g}-custom-filename`,value:v,onChange:e=>O(e.target.value),placeholder:w(L),"aria-describedby":`${g}-custom-filename-desc`,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))]"}),jsx("p",{id:`${g}-custom-filename-desc`,className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:"Leave blank to use the default filename format."})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${g}-custom-header`,className:"block text-sm font-medium mb-1",children:"Custom Header HTML (for HTML/PDF exports)"}),jsx("textarea",{id:`${g}-custom-header`,value:G,onChange:e=>W(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-[rgb(var(--ndpr-ring))]"})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${g}-custom-footer`,className:"block text-sm font-medium mb-1",children:"Custom Footer HTML (for HTML/PDF exports)"}),jsx("textarea",{id:`${g}-custom-footer`,value:j,onChange:e=>ee(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-[rgb(var(--ndpr-ring))]"})]}),jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:`${g}-include-compliance-notice`,type:"checkbox",checked:r,onChange:e=>m(e.target.checked),"aria-describedby":`${g}-compliance-notice-desc`,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"})}),jsxs("div",{className:"ml-3 text-sm",children:[jsx("label",{htmlFor:`${g}-include-compliance-notice`,className:"font-medium text-gray-900 dark:text-white",children:"Include NDPA Compliance Notice"}),jsx("p",{id:`${g}-compliance-notice-desc`,className:"text-gray-600 dark:text-gray-400",children:"Adds a notice explaining that this policy complies with NDPA requirements."})]})]})]}):jsx("button",{type:"button",onClick:()=>m(true),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] text-sm mb-6",children:"Show Advanced Options"}),u=()=>!X||s.length===0?null:jsxs("div",{className:a("mt-6",a$1==null?void 0:a$1.preview,o),children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Export History"}),jsx("div",{className:"bg-gray-50 dark:bg-gray-700 rounded-md overflow-hidden",children:jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-600",children:[jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",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:"Date"}),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"}),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"}),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"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-700 divide-y divide-gray-200 dark:divide-gray-600",children:s.map(e=>jsxs("tr",{children:[jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:new Date(e.timestamp).toLocaleString()}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:e.format.toUpperCase()}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:e.filename}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:jsx("a",{href:e.url,download:e.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"})})]},e.id))})]})})]});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,a$1==null?void 0:a$1.root,o),children:[jsxs("div",{className:a("mb-6",a$1==null?void 0:a$1.header,o),children:[jsx("h2",{className:a("text-xl font-bold mb-2",a$1==null?void 0:a$1.title,o),children:N}),jsx("p",{className:a("text-gray-600 dark:text-gray-300",a$1==null?void 0:a$1.description,o),children:F})]}),c(),d$1(),jsxs("div",{className:"mb-6",children:[jsx("button",{onClick:l,disabled:I,className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${R} ${I?"opacity-70 cursor-not-allowed":""}`,(a$1==null?void 0:a$1.primaryButton)||(a$1==null?void 0:a$1.exportButton),o),children:I?"Exporting...":`Export as ${L.toUpperCase()}`}),K&&jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-500",children:K})]}),jsxs("div",{className:a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",a$1==null?void 0:a$1.complianceNotice,o),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"Export Tips"}),jsxs("ul",{className:"text-blue-700 dark:text-blue-300 text-sm list-disc list-inside space-y-1",children:[jsx("li",{children:"PDF format is recommended for printing or sharing with stakeholders."}),jsx("li",{children:"HTML format is ideal for publishing on your website."}),jsx("li",{children:"DOCX format allows for further editing in Microsoft Word or similar applications."}),jsx("li",{children:"Markdown format is useful for version control systems or technical documentation."})]})]}),u()]})};export{fe as a,Ee as b,Ae as c};//# sourceMappingURL=chunk-QDHHD2KR.mjs.map
94
- //# sourceMappingURL=chunk-QDHHD2KR.mjs.map
93
+ </html>`,b},l=()=>d(null,null,function*(){q(true),Z(null);try{let e=L.toLowerCase(),f="",b;switch(e){case "pdf":let te=H();b=new Blob([te],{type:"text/html"}),f=URL.createObjectURL(b);break;case "docx":b=new Blob([E],{type:"text/plain"}),f=URL.createObjectURL(b);break;case "html":let pe=H();b=new Blob([pe],{type:"text/html"}),f=URL.createObjectURL(b);break;default:b=new Blob([E],{type:"text/markdown"}),f=URL.createObjectURL(b);break}let _=C(e),B=document.createElement("a");B.href=f,B.download=_,document.body.appendChild(B),B.click(),document.body.removeChild(B);let D={id:`export_${Date.now()}`,format:e,timestamp:Date.now(),url:f,filename:_};$(te=>[D,...te]),G&&G(e,f);}catch(e){console.error("[ndpr-toolkit] Export error:",e),Z("An error occurred during export. Please try again.");}finally{q(false);}}),c=()=>{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)"}],f=`${g}-export-format`;return jsxs("div",{className:a("mb-6",n==null?void 0:n.formatSelector,o),children:[jsx("label",{htmlFor:f,className:"block text-sm font-medium mb-1",children:"Export Format"}),jsx("select",{id:f,value:L,onChange:b=>X(b.target.value),className:a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",n==null?void 0:n.formatOption,o),children:e.map(b=>jsx("option",{value:b.value,children:b.label},b.value))})]})},d$1=()=>x?jsxs("div",{className:"mb-6 space-y-4 border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsxs("div",{className:"flex justify-between items-center",children:[jsx("h3",{className:"text-md font-medium",children:"Advanced Export Options"}),jsx("button",{type:"button",onClick:()=>m(false),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] text-sm",children:"Hide Advanced Options"})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${g}-custom-filename`,className:"block text-sm font-medium mb-1",children:"Custom Filename"}),jsx("input",{type:"text",id:`${g}-custom-filename`,value:v,onChange:e=>O(e.target.value),placeholder:k(L),"aria-describedby":`${g}-custom-filename-desc`,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))]"}),jsx("p",{id:`${g}-custom-filename-desc`,className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:"Leave blank to use the default filename format."})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${g}-custom-header`,className:"block text-sm font-medium mb-1",children:"Custom Header HTML (for HTML/PDF exports)"}),jsx("textarea",{id:`${g}-custom-header`,value:W,onChange:e=>j(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-[rgb(var(--ndpr-ring))]"})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${g}-custom-footer`,className:"block text-sm font-medium mb-1",children:"Custom Footer HTML (for HTML/PDF exports)"}),jsx("textarea",{id:`${g}-custom-footer`,value:z,onChange:e=>ee(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-[rgb(var(--ndpr-ring))]"})]}),jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:`${g}-include-compliance-notice`,type:"checkbox",checked:r,onChange:e=>m(e.target.checked),"aria-describedby":`${g}-compliance-notice-desc`,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"})}),jsxs("div",{className:"ml-3 text-sm",children:[jsx("label",{htmlFor:`${g}-include-compliance-notice`,className:"font-medium text-gray-900 dark:text-white",children:"Include NDPA Compliance Notice"}),jsx("p",{id:`${g}-compliance-notice-desc`,className:"text-gray-600 dark:text-gray-400",children:"Adds a notice explaining that this policy complies with NDPA requirements."})]})]})]}):jsx("button",{type:"button",onClick:()=>m(true),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] text-sm mb-6",children:"Show Advanced Options"}),u=()=>!N||s.length===0?null:jsxs("div",{className:a("mt-6",n==null?void 0:n.preview,o),children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Export History"}),jsx("div",{className:"bg-gray-50 dark:bg-gray-700 rounded-md overflow-hidden",children:jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-600",children:[jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",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:"Date"}),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"}),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"}),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"})]})}),jsx("tbody",{className:"bg-white dark:bg-gray-700 divide-y divide-gray-200 dark:divide-gray-600",children:s.map(e=>jsxs("tr",{children:[jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:new Date(e.timestamp).toLocaleString()}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:e.format.toUpperCase()}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:e.filename}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:jsx("a",{href:e.url,download:e.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"})})]},e.id))})]})})]});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,n==null?void 0:n.root,o),children:[jsxs("div",{className:a("mb-6",n==null?void 0:n.header,o),children:[jsx("h2",{className:a("text-xl font-bold mb-2",n==null?void 0:n.title,o),children:K}),jsx("p",{className:a("text-gray-600 dark:text-gray-300",n==null?void 0:n.description,o),children:A})]}),c(),d$1(),jsxs("div",{className:"mb-6",children:[jsx("button",{onClick:l,disabled:I,className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${R} ${I?"opacity-70 cursor-not-allowed":""}`,(n==null?void 0:n.primaryButton)||(n==null?void 0:n.exportButton),o),children:I?"Exporting...":`Export as ${L.toUpperCase()}`}),J&&jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-500",children:J})]}),jsxs("div",{className:a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",n==null?void 0:n.complianceNotice,o),children:[jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"Export Tips"}),jsxs("ul",{className:"text-blue-700 dark:text-blue-300 text-sm list-disc list-inside space-y-1",children:[jsx("li",{children:"PDF format is recommended for printing or sharing with stakeholders."}),jsx("li",{children:"HTML format is ideal for publishing on your website."}),jsx("li",{children:"DOCX format allows for further editing in Microsoft Word or similar applications."}),jsx("li",{children:"Markdown format is useful for version control systems or technical documentation."})]})]}),u()]})};export{fe as a,Ee as b,Fe as c};//# sourceMappingURL=chunk-FLKJSGR7.mjs.map
94
+ //# sourceMappingURL=chunk-FLKJSGR7.mjs.map
@@ -1,11 +1,11 @@
1
- 'use strict';var chunkUXMGBIX6_js=require('./chunk-UXMGBIX6.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var fe=({sections:E=chunkUXMGBIX6_js.b,variables:M=chunkUXMGBIX6_js.c,onGenerate:T,title:Y="NDPA Privacy Policy Generator",description:V="Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 24.",className:N="",buttonClassName:F="",generateButtonText:Q="Generate Policy",showPreview:R=true,allowEditing:X=true,classNames:r,unstyled:h=false})=>{let P=react.useId(),[A,a]=react.useState(E),[o,g]=react.useState(M),[s,$]=react.useState("sections"),[L,J]=react.useState(""),[I,q]=react.useState(""),[K,Z]=react.useState(false),[v,O]=react.useState({});react.useEffect(()=>{a(E);},[E]),react.useEffect(()=>{g(M);},[M]);let G=l=>{a(c=>c.map(d=>d.id===l?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},d),{included:!d.included}):d));},W=(l,c)=>{g(d=>d.map(u=>u.id===l?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{value:c}):u)),v[l]&&O(d=>{let u=chunkMQFZHA2D_js.a({},d);return delete u[l],u});},j=()=>{let l={},c=true;return o.forEach(d=>{d.required&&!d.value&&(l[d.id]=`${d.name} is required`,c=false);}),O(l),c},ee=()=>{if(!j()){$("variables");return}let l=A.filter(u=>u.included),c=Object.fromEntries(o.map(u=>[u.name,u.value])),d="";l.forEach(u=>{d+=`## ${u.title}
1
+ 'use strict';var chunkUXMGBIX6_js=require('./chunk-UXMGBIX6.js'),chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var fe=({sections:E=chunkUXMGBIX6_js.b,variables:M=chunkUXMGBIX6_js.c,onGenerate:T,title:V="NDPA Privacy Policy Generator",description:G="Generate an NDPA-compliant privacy policy for your organization in accordance with NDPA Section 24.",className:K="",buttonClassName:A="",generateButtonText:Q="Generate Policy",showPreview:R=true,allowEditing:N=true,classNames:r,unstyled:h=false})=>{let P=react.useId(),[F,n]=react.useState(E),[o,g]=react.useState(M),[s,$]=react.useState("sections"),[L,X]=react.useState(""),[I,q]=react.useState(""),[J,Z]=react.useState(false),[v,O]=react.useState({});react.useEffect(()=>{n(E);},[E]),react.useEffect(()=>{g(M);},[M]);let W=l=>{n(c=>c.map(d=>d.id===l?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},d),{included:!d.included}):d));},j=(l,c)=>{g(d=>d.map(u=>u.id===l?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},u),{value:c}):u)),v[l]&&O(d=>{let u=chunkMQFZHA2D_js.a({},d);return delete u[l],u});},z=()=>{let l={},c=true;return o.forEach(d=>{d.required&&!d.value&&(l[d.id]=`${d.name} is required`,c=false);}),O(l),c},ee=()=>{if(!z()){$("variables");return}let l=F.filter(u=>u.included),c=Object.fromEntries(o.map(u=>[u.name,u.value])),d="";l.forEach(u=>{d+=`## ${u.title}
2
2
 
3
3
  `,d+=chunkUXMGBIX6_js.a(u.template,c),d+=`
4
4
 
5
- `;}),J(d),q(d),Z(true),$("preview");},x=()=>{T({sections:A,variables:o,content:X?I:L});},m=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",r==null?void 0:r.sectionList,h),role:"group","aria-labelledby":`${P}-sections-heading`,children:[jsxRuntime.jsx("h3",{id:`${P}-sections-heading`,className:"text-lg font-medium mb-4",children:"Select Policy Sections"}),A.map(l=>{let c=`${P}-section-${l.id}`,d=l.description?`${P}-section-desc-${l.id}`:void 0;return jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("border border-gray-200 dark:border-gray-700 rounded-md p-4",r==null?void 0:r.sectionItem,h),children:jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:c,type:"checkbox",checked:l.included,onChange:()=>G(l.id),disabled:l.required,"aria-describedby":d,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",r==null?void 0:r.input,h)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:c,className:"font-medium text-gray-900 dark:text-white",children:[l.title," ",l.required&&jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"}),l.required&&jsxRuntime.jsx("span",{className:"sr-only",children:" (required)"})]}),l.description&&jsxRuntime.jsx("p",{id:d,className:"text-gray-600 dark:text-gray-400 mt-1",children:l.description})]})]})},l.id)}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{onClick:()=>$("variables"),className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${F}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),h),children:"Next: Fill Variables"})})]}),w=()=>{let l={};return o.forEach(c=>{let d=c.id.split(".")[0];l[d]||(l[d]=[]),l[d].push(c);}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",r==null?void 0:r.form,h),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(l).map(([c,d])=>{let u=A.find(e=>e.id===c);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:d.map(e=>{let f=`${P}-var-${e.id}`,b=e.description?`${P}-var-desc-${e.id}`:void 0,z=v[e.id]?`${P}-var-err-${e.id}`:void 0,B=[b,z].filter(Boolean).join(" ")||void 0;return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:f,className:"block text-sm font-medium mb-1",children:[e.name," ",e.required&&jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),e.description&&jsxRuntime.jsx("p",{id:b,className:"text-xs text-gray-600 dark:text-gray-400 mb-2",children:e.description}),e.inputType==="textarea"?jsxRuntime.jsx("textarea",{id:f,value:e.value,onChange:D=>W(e.id,D.target.value),rows:4,className:chunkE64TU6IU_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-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0}):e.inputType==="select"&&e.options?jsxRuntime.jsxs("select",{id:f,value:e.value,onChange:D=>W(e.id,D.target.value),className:chunkE64TU6IU_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-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select an option"}),e.options.map(D=>jsxRuntime.jsx("option",{value:D,children:D},D))]}):jsxRuntime.jsx("input",{id:f,type:e.inputType,value:e.value,onChange:D=>W(e.id,D.target.value),className:chunkE64TU6IU_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-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0}),v[e.id]&&jsxRuntime.jsx("p",{id:z,role:"alert",className:"mt-1 text-sm text-red-600 dark:text-red-500",children:v[e.id]})]},e.id)})})]},c)})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>$("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 ${F}`,children:"Back to Sections"}),jsxRuntime.jsx("button",{onClick:ee,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${F}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),h),children:Q})]})]})},C=()=>{let l=`${P}-policy-content`;return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Preview Generated Policy"}),X?jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("label",{htmlFor:l,className:"block text-sm font-medium mb-1",children:"Edit Policy Content"}),jsxRuntime.jsx("textarea",{id:l,value:I,onChange:c=>q(c.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","aria-live":"polite",children:jsxRuntime.jsx("div",{className:"prose dark:prose-invert max-w-none",children:L.split(`
6
- `).map((c,d)=>c.startsWith("## ")?jsxRuntime.jsx("h3",{className:"text-xl font-bold mt-6 mb-3",children:c.substring(3)},d):c.startsWith("### ")?jsxRuntime.jsx("h4",{className:"text-lg font-bold mt-4 mb-2",children:c.substring(4)},d):c===""?jsxRuntime.jsx("br",{},d):jsxRuntime.jsx("p",{className:"mb-2",children:c},d))})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>$("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 ${F}`,children:"Back to Variables"}),jsxRuntime.jsx("button",{onClick:x,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${F}`,children:"Save Policy"})]})]})},U=()=>{switch(s){case "sections":return m();case "variables":return w();case "preview":return C();default:return m()}};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${N}`,r==null?void 0:r.root,h),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",r==null?void 0:r.header,h),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",r==null?void 0:r.title,h),children:Y}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-300",r==null?void 0:r.description,h),children:V})]}),jsxRuntime.jsx("nav",{"aria-label":"Policy generation steps",className:"mb-8",children:jsxRuntime.jsxs("ol",{className:"flex items-center w-full",children:[jsxRuntime.jsxs("li",{className:`flex w-full items-center ${s==="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 ${s==="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`,"aria-current":s==="sections"?"step":void 0,children:"1"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Sections"}),jsxRuntime.jsx("span",{className:"sr-only",children:s==="sections"?" (current step)":""})]}),jsxRuntime.jsxs("li",{className:`flex w-full items-center ${s==="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 ${s==="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`,"aria-current":s==="variables"?"step":void 0,children:"2"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Variables"}),jsxRuntime.jsx("span",{className:"sr-only",children:s==="variables"?" (current step)":""})]}),jsxRuntime.jsxs("li",{className:`flex items-center ${s==="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 ${s==="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`,"aria-current":s==="preview"?"step":void 0,children:"3"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Preview"}),jsxRuntime.jsx("span",{className:"sr-only",children:s==="preview"?" (current step)":""})]})]})}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",r==null?void 0:r.complianceNotice,h),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."})]}),U()]})};var Ee=({content:E,sections:M,variables:T,onExport:Y,onEdit:V,title:N="Privacy Policy Preview",description:F="Preview your NDPA-compliant privacy policy before exporting.",className:Q="",buttonClassName:R="",showExportOptions:X=true,showEditButton:r=true,showTableOfContents:h=true,showMetadata:P=true,organizationName:A,lastUpdated:a=new Date,classNames:o,unstyled:g=false})=>{let s=react.useId(),[$,L]=react.useState("preview"),J=`${s}-tab-preview`,I=`${s}-tab-markdown`,q=`${s}-panel-preview`,K=`${s}-panel-markdown`,v=(()=>{let x=E.split(`
7
- `),m=[];return x.forEach(w=>{if(w.startsWith("## ")){let C=w.substring(3).trim(),U=`${s}-${C.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;m.push({id:U,title:C,level:2});}else if(w.startsWith("### ")){let C=w.substring(4).trim(),U=`${s}-${C.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;m.push({id:U,title:C,level:3});}}),m})(),O=x=>{if(Y)Y(x);else if(x==="markdown"){let m=document.createElement("a"),w=new Blob([E],{type:"text/markdown"});m.href=URL.createObjectURL(w),m.download=`privacy-policy-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(m),m.click(),document.body.removeChild(m);}},G=()=>!h||v.length===0?null:jsxRuntime.jsxs("nav",{"aria-label":"Table of contents",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:v.map((x,m)=>jsxRuntime.jsx("li",{style:{marginLeft:`${(x.level-2)*1.5}rem`},children:jsxRuntime.jsx("a",{href:`#${x.id}`,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline",children:x.title})},m))})]}),W=()=>P?jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h1",{className:"text-2xl font-bold mb-2",children:A?`${A} Privacy Policy`:"Privacy Policy"}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Last Updated: ",a.toLocaleDateString()]})]}):null,j=()=>jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("prose dark:prose-invert max-w-none",o==null?void 0:o.sectionContent,g),children:E.split(`
8
- `).map((x,m)=>{if(x.startsWith("## ")){let w=x.substring(3).trim(),C=`${s}-${w.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return jsxRuntime.jsx("h3",{id:C,className:chunkE64TU6IU_js.a("text-xl font-bold mt-6 mb-3",o==null?void 0:o.sectionTitle,g),children:w},m)}else if(x.startsWith("### ")){let w=x.substring(4).trim(),C=`${s}-${w.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return jsxRuntime.jsx("h4",{id:C,className:chunkE64TU6IU_js.a("text-lg font-bold mt-4 mb-2",o==null?void 0:o.sectionTitle,g),children:w},m)}else return x===""?jsxRuntime.jsx("br",{},m):jsxRuntime.jsx("p",{className:"mb-2",children:x},m)})}),ee=()=>X?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:()=>O("pdf"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as PDF"}),jsxRuntime.jsx("button",{onClick:()=>O("docx"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as DOCX"}),jsxRuntime.jsx("button",{onClick:()=>O("html"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as HTML"}),jsxRuntime.jsx("button",{onClick:()=>O("markdown"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,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 ${Q}`,o==null?void 0:o.root,g),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex justify-between items-start mb-6",o==null?void 0:o.header,g),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",o==null?void 0:o.title,g),children:N}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-300",o==null?void 0:o.description,g),children:F})]}),r&&V&&jsxRuntime.jsx("button",{onClick:V,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 ${R}`,children:"Edit Policy"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",o==null?void 0:o.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("div",{role:"tablist","aria-label":"Policy view options",className:"flex flex-wrap -mb-px",children:[jsxRuntime.jsx("div",{className:"mr-2",children:jsxRuntime.jsx("button",{role:"tab",id:J,"aria-selected":$==="preview","aria-controls":q,onClick:()=>L("preview"),className:`inline-block p-4 ${$==="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("div",{className:"mr-2",children:jsxRuntime.jsx("button",{role:"tab",id:I,"aria-selected":$==="markdown","aria-controls":K,onClick:()=>L("markdown"),className:`inline-block p-4 ${$==="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",o==null?void 0:o.content,g),children:$==="preview"?jsxRuntime.jsxs("div",{role:"tabpanel",id:q,"aria-labelledby":J,"aria-live":"polite",children:[W(),G(),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("bg-gray-50 dark:bg-gray-700 p-6 rounded-md",o==null?void 0:o.section,g),children:j()})]}):jsxRuntime.jsx("div",{role:"tabpanel",id:K,"aria-labelledby":I,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:E})})}),ee()]})};var Ae=({content:E,title:M="Privacy Policy",organizationName:T,lastUpdated:Y=new Date,onExportComplete:V,componentTitle:N="Export Privacy Policy",description:F="Export your NDPA-compliant privacy policy in various formats.",className:Q="",buttonClassName:R="",showExportHistory:X=true,includeComplianceNotice:r=true,includeLogo:h=false,logoUrl:P,customStyles:A,classNames:a,unstyled:o=false})=>{let g=react.useId(),[s,$]=react.useState([]),[L,J]=react.useState("pdf"),[I,q]=react.useState(false),[K,Z]=react.useState(null),[v,O]=react.useState(""),[G,W]=react.useState(""),[j,ee]=react.useState(""),[x,m]=react.useState(false),w=e=>{let f=new Date().toISOString().split("T")[0];return `${T?T.toLowerCase().replace(/[^a-z0-9]+/g,"-"):"privacy-policy"}-privacy-policy-${f}.${e.toLowerCase()}`},C=e=>v?v.endsWith(`.${e.toLowerCase()}`)?v:`${v}.${e.toLowerCase()}`:w(e),U=()=>{let e=T?`${T} ${M}`:M,f=Y.toLocaleDateString(),b=`<!DOCTYPE html>
5
+ `;}),X(d),q(d),Z(true),$("preview");},x=()=>{T({sections:F,variables:o,content:N?I:L});},m=()=>jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("space-y-4",r==null?void 0:r.sectionList,h),role:"group","aria-labelledby":`${P}-sections-heading`,children:[jsxRuntime.jsx("h3",{id:`${P}-sections-heading`,className:"text-lg font-medium mb-4",children:"Select Policy Sections"}),F.map(l=>{let c=`${P}-section-${l.id}`,d=l.description?`${P}-section-desc-${l.id}`:void 0;return jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("border border-gray-200 dark:border-gray-700 rounded-md p-4",r==null?void 0:r.sectionItem,h),children:jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:c,type:"checkbox",checked:l.included,onChange:()=>W(l.id),disabled:l.required,"aria-describedby":d,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",r==null?void 0:r.input,h)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:c,className:"font-medium text-gray-900 dark:text-white",children:[l.title," ",l.required&&jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"}),l.required&&jsxRuntime.jsx("span",{className:"sr-only",children:" (required)"})]}),l.description&&jsxRuntime.jsx("p",{id:d,className:"text-gray-600 dark:text-gray-400 mt-1",children:l.description})]})]})},l.id)}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{onClick:()=>$("variables"),className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${A}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),h),children:"Next: Fill Variables"})})]}),k=()=>{let l={};return o.forEach(c=>{let d=c.id.split(".")[0];l[d]||(l[d]=[]),l[d].push(c);}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("",r==null?void 0:r.form,h),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(l).map(([c,d])=>{let u=F.find(e=>e.id===c);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:d.map(e=>{let f=`${P}-var-${e.id}`,b=e.description?`${P}-var-desc-${e.id}`:void 0,_=v[e.id]?`${P}-var-err-${e.id}`:void 0,B=[b,_].filter(Boolean).join(" ")||void 0;return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:f,className:"block text-sm font-medium mb-1",children:[e.name," ",e.required&&jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),e.description&&jsxRuntime.jsx("p",{id:b,className:"text-xs text-gray-600 dark:text-gray-400 mb-2",children:e.description}),e.inputType==="textarea"?jsxRuntime.jsx("textarea",{id:f,value:e.value,onChange:D=>j(e.id,D.target.value),rows:4,className:chunkE64TU6IU_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-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0}):e.inputType==="select"&&e.options?jsxRuntime.jsxs("select",{id:f,value:e.value,onChange:D=>j(e.id,D.target.value),className:chunkE64TU6IU_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-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0,children:[jsxRuntime.jsx("option",{value:"",children:"Select an option"}),e.options.map(D=>jsxRuntime.jsx("option",{value:D,children:D},D))]}):jsxRuntime.jsx("input",{id:f,type:e.inputType,value:e.value,onChange:D=>j(e.id,D.target.value),className:chunkE64TU6IU_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-[rgb(var(--ndpr-ring))]"} rounded-md focus:outline-none focus:ring-2`,r==null?void 0:r.input,h),required:e.required,"aria-required":e.required||void 0,"aria-describedby":B,"aria-invalid":v[e.id]?true:void 0}),v[e.id]&&jsxRuntime.jsx("p",{id:_,role:"alert",className:"mt-1 text-sm text-red-600 dark:text-red-500",children:v[e.id]})]},e.id)})})]},c)})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>$("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 ${A}`,children:"Back to Sections"}),jsxRuntime.jsx("button",{onClick:ee,className:chunkE64TU6IU_js.a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${A}`,(r==null?void 0:r.primaryButton)||(r==null?void 0:r.generateButton),h),children:Q})]})]})},C=()=>{let l=`${P}-policy-content`;return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Preview Generated Policy"}),N?jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("label",{htmlFor:l,className:"block text-sm font-medium mb-1",children:"Edit Policy Content"}),jsxRuntime.jsx("textarea",{id:l,value:I,onChange:c=>q(c.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","aria-live":"polite",children:jsxRuntime.jsx("div",{className:"prose dark:prose-invert max-w-none",children:L.split(`
6
+ `).map((c,d)=>c.startsWith("## ")?jsxRuntime.jsx("h3",{className:"text-xl font-bold mt-6 mb-3",children:c.substring(3)},d):c.startsWith("### ")?jsxRuntime.jsx("h4",{className:"text-lg font-bold mt-4 mb-2",children:c.substring(4)},d):c===""?jsxRuntime.jsx("br",{},d):jsxRuntime.jsx("p",{className:"mb-2",children:c},d))})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>$("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 ${A}`,children:"Back to Variables"}),jsxRuntime.jsx("button",{onClick:x,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${A}`,children:"Save Policy"})]})]})},H=()=>{switch(s){case "sections":return m();case "variables":return k();case "preview":return C();default:return m()}};return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${K}`,r==null?void 0:r.root,h),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",r==null?void 0:r.header,h),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",r==null?void 0:r.title,h),children:V}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-300",r==null?void 0:r.description,h),children:G})]}),jsxRuntime.jsx("nav",{"aria-label":"Policy generation steps",className:"mb-8",children:jsxRuntime.jsxs("ol",{className:"flex items-center w-full",children:[jsxRuntime.jsxs("li",{className:`flex w-full items-center ${s==="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 ${s==="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`,"aria-current":s==="sections"?"step":void 0,children:"1"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Sections"}),jsxRuntime.jsx("span",{className:"sr-only",children:s==="sections"?" (current step)":""})]}),jsxRuntime.jsxs("li",{className:`flex w-full items-center ${s==="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 ${s==="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`,"aria-current":s==="variables"?"step":void 0,children:"2"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Variables"}),jsxRuntime.jsx("span",{className:"sr-only",children:s==="variables"?" (current step)":""})]}),jsxRuntime.jsxs("li",{className:`flex items-center ${s==="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 ${s==="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`,"aria-current":s==="preview"?"step":void 0,children:"3"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Preview"}),jsxRuntime.jsx("span",{className:"sr-only",children:s==="preview"?" (current step)":""})]})]})}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",r==null?void 0:r.complianceNotice,h),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."})]}),H()]})};var Ee=({content:E,sections:M,variables:T,onExport:V,onEdit:G,title:K="Privacy Policy Preview",description:A="Preview your NDPA-compliant privacy policy before exporting.",className:Q="",buttonClassName:R="",showExportOptions:N=true,showEditButton:r=true,showTableOfContents:h=true,showMetadata:P=true,organizationName:F,lastUpdated:n,classNames:o,unstyled:g=false})=>{let s=react.useId(),[$,L]=react.useState("preview"),X=`${s}-tab-preview`,I=`${s}-tab-markdown`,q=`${s}-panel-preview`,J=`${s}-panel-markdown`,v=(()=>{let x=E.split(`
7
+ `),m=[];return x.forEach(k=>{if(k.startsWith("## ")){let C=k.substring(3).trim(),H=`${s}-${C.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;m.push({id:H,title:C,level:2});}else if(k.startsWith("### ")){let C=k.substring(4).trim(),H=`${s}-${C.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;m.push({id:H,title:C,level:3});}}),m})(),O=x=>{if(V)V(x);else if(x==="markdown"){let m=document.createElement("a"),k=new Blob([E],{type:"text/markdown"});m.href=URL.createObjectURL(k),m.download=`privacy-policy-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(m),m.click(),document.body.removeChild(m);}},W=()=>!h||v.length===0?null:jsxRuntime.jsxs("nav",{"aria-label":"Table of contents",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:v.map((x,m)=>jsxRuntime.jsx("li",{style:{marginLeft:`${(x.level-2)*1.5}rem`},children:jsxRuntime.jsx("a",{href:`#${x.id}`,className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] hover:underline",children:x.title})},m))})]}),j=()=>P?jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h1",{className:"text-2xl font-bold mb-2",children:F?`${F} Privacy Policy`:"Privacy Policy"}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Last Updated: ",n?n.toLocaleDateString():"N/A"]})]}):null,z=()=>jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("prose dark:prose-invert max-w-none",o==null?void 0:o.sectionContent,g),children:E.split(`
8
+ `).map((x,m)=>{if(x.startsWith("## ")){let k=x.substring(3).trim(),C=`${s}-${k.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return jsxRuntime.jsx("h3",{id:C,className:chunkE64TU6IU_js.a("text-xl font-bold mt-6 mb-3",o==null?void 0:o.sectionTitle,g),children:k},m)}else if(x.startsWith("### ")){let k=x.substring(4).trim(),C=`${s}-${k.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return jsxRuntime.jsx("h4",{id:C,className:chunkE64TU6IU_js.a("text-lg font-bold mt-4 mb-2",o==null?void 0:o.sectionTitle,g),children:k},m)}else return x===""?jsxRuntime.jsx("br",{},m):jsxRuntime.jsx("p",{className:"mb-2",children:x},m)})}),ee=()=>N?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:()=>O("pdf"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as PDF"}),jsxRuntime.jsx("button",{onClick:()=>O("docx"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as DOCX"}),jsxRuntime.jsx("button",{onClick:()=>O("html"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,children:"Export as HTML"}),jsxRuntime.jsx("button",{onClick:()=>O("markdown"),className:`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${R}`,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 ${Q}`,o==null?void 0:o.root,g),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("flex justify-between items-start mb-6",o==null?void 0:o.header,g),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",o==null?void 0:o.title,g),children:K}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-300",o==null?void 0:o.description,g),children:A})]}),r&&G&&jsxRuntime.jsx("button",{onClick:G,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 ${R}`,children:"Edit Policy"})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",o==null?void 0:o.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("div",{role:"tablist","aria-label":"Policy view options",className:"flex flex-wrap -mb-px",children:[jsxRuntime.jsx("div",{className:"mr-2",children:jsxRuntime.jsx("button",{role:"tab",id:X,"aria-selected":$==="preview","aria-controls":q,onClick:()=>L("preview"),className:`inline-block p-4 ${$==="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("div",{className:"mr-2",children:jsxRuntime.jsx("button",{role:"tab",id:I,"aria-selected":$==="markdown","aria-controls":J,onClick:()=>L("markdown"),className:`inline-block p-4 ${$==="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",o==null?void 0:o.content,g),children:$==="preview"?jsxRuntime.jsxs("div",{role:"tabpanel",id:q,"aria-labelledby":X,"aria-live":"polite",children:[j(),W(),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("bg-gray-50 dark:bg-gray-700 p-6 rounded-md",o==null?void 0:o.section,g),children:z()})]}):jsxRuntime.jsx("div",{role:"tabpanel",id:J,"aria-labelledby":I,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:E})})}),ee()]})};var Fe=({content:E,title:M="Privacy Policy",organizationName:T,lastUpdated:V,onExportComplete:G,componentTitle:K="Export Privacy Policy",description:A="Export your NDPA-compliant privacy policy in various formats.",className:Q="",buttonClassName:R="",showExportHistory:N=true,includeComplianceNotice:r=true,includeLogo:h=false,logoUrl:P,customStyles:F,classNames:n,unstyled:o=false})=>{let g=react.useId(),[s,$]=react.useState([]),[L,X]=react.useState("pdf"),[I,q]=react.useState(false),[J,Z]=react.useState(null),[v,O]=react.useState(""),[W,j]=react.useState(""),[z,ee]=react.useState(""),[x,m]=react.useState(false),k=e=>{let f=new Date().toISOString().split("T")[0];return `${T?T.toLowerCase().replace(/[^a-z0-9]+/g,"-"):"privacy-policy"}-privacy-policy-${f}.${e.toLowerCase()}`},C=e=>v?v.endsWith(`.${e.toLowerCase()}`)?v:`${v}.${e.toLowerCase()}`:k(e),H=()=>{let e=T?`${T} ${M}`:M,f=V?V.toLocaleDateString():"N/A",b=`<!DOCTYPE html>
9
9
  <html lang="en">
10
10
  <head>
11
11
  <meta charset="UTF-8">
@@ -67,28 +67,28 @@
67
67
  margin-bottom: 30px;
68
68
  font-size: 14px;
69
69
  }
70
- ${A||""}
70
+ ${F||""}
71
71
  </style>
72
72
  </head>
73
73
  <body>
74
74
  <div class="header">
75
75
  ${h&&P?`<img src="${P}" alt="${T||"Company"} Logo" class="logo">`:""}
76
- ${G?`<div class="custom-header">${G}</div>`:""}
76
+ ${W?`<div class="custom-header">${W}</div>`:""}
77
77
  <h1>${e}</h1>
78
78
  <div class="last-updated">Last Updated: ${f}</div>
79
79
  </div>`;r&&(b+=`
80
80
  <div class="compliance-notice">
81
81
  <strong>NDPA Compliance Notice:</strong> This privacy policy has been created to comply with the Nigeria Data Protection Act (NDPA) 2023.
82
82
  It outlines how we collect, use, disclose, and protect your personal information in accordance with NDPA requirements.
83
- </div>`);let z=E.replace(/^## (.*?)$/gm,"<h2>$1</h2>").replace(/^### (.*?)$/gm,"<h3>$1</h3>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>");return b+=`
83
+ </div>`);let _=E.replace(/^## (.*?)$/gm,"<h2>$1</h2>").replace(/^### (.*?)$/gm,"<h3>$1</h3>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>");return b+=`
84
84
  <div class="content">
85
- <p>${z}</p>
85
+ <p>${_}</p>
86
86
  </div>
87
87
 
88
88
  <div class="footer">
89
- ${j?`<div class="custom-footer">${j}</div>`:""}
89
+ ${z?`<div class="custom-footer">${z}</div>`:""}
90
90
  <p>&copy; ${new Date().getFullYear()} ${T||"Company"}. All rights reserved.</p>
91
91
  </div>
92
92
  </body>
93
- </html>`,b},l=()=>chunkMQFZHA2D_js.d(null,null,function*(){q(true),Z(null);try{let e=L.toLowerCase(),f="",b;switch(e){case "pdf":let te=U();b=new Blob([te],{type:"text/html"}),f=URL.createObjectURL(b);break;case "docx":b=new Blob([E],{type:"text/plain"}),f=URL.createObjectURL(b);break;case "html":let pe=U();b=new Blob([pe],{type:"text/html"}),f=URL.createObjectURL(b);break;default:b=new Blob([E],{type:"text/markdown"}),f=URL.createObjectURL(b);break}let z=C(e),B=document.createElement("a");B.href=f,B.download=z,document.body.appendChild(B),B.click(),document.body.removeChild(B);let D={id:`export_${Date.now()}`,format:e,timestamp:Date.now(),url:f,filename:z};$(te=>[D,...te]),V&&V(e,f);}catch(e){console.error("Export error:",e),Z("An error occurred during export. Please try again.");}finally{q(false);}}),c=()=>{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)"}],f=`${g}-export-format`;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",a==null?void 0:a.formatSelector,o),children:[jsxRuntime.jsx("label",{htmlFor:f,className:"block text-sm font-medium mb-1",children:"Export Format"}),jsxRuntime.jsx("select",{id:f,value:L,onChange:b=>J(b.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,o),children:e.map(b=>jsxRuntime.jsx("option",{value:b.value,children:b.label},b.value))})]})},d=()=>x?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:()=>m(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:`${g}-custom-filename`,className:"block text-sm font-medium mb-1",children:"Custom Filename"}),jsxRuntime.jsx("input",{type:"text",id:`${g}-custom-filename`,value:v,onChange:e=>O(e.target.value),placeholder:w(L),"aria-describedby":`${g}-custom-filename-desc`,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",{id:`${g}-custom-filename-desc`,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:`${g}-custom-header`,className:"block text-sm font-medium mb-1",children:"Custom Header HTML (for HTML/PDF exports)"}),jsxRuntime.jsx("textarea",{id:`${g}-custom-header`,value:G,onChange:e=>W(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-[rgb(var(--ndpr-ring))]"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${g}-custom-footer`,className:"block text-sm font-medium mb-1",children:"Custom Footer HTML (for HTML/PDF exports)"}),jsxRuntime.jsx("textarea",{id:`${g}-custom-footer`,value:j,onChange:e=>ee(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-[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:`${g}-include-compliance-notice`,type:"checkbox",checked:r,onChange:e=>m(e.target.checked),"aria-describedby":`${g}-compliance-notice-desc`,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:`${g}-include-compliance-notice`,className:"font-medium text-gray-900 dark:text-white",children:"Include NDPA Compliance Notice"}),jsxRuntime.jsx("p",{id:`${g}-compliance-notice-desc`,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:()=>m(true),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] text-sm mb-6",children:"Show Advanced Options"}),u=()=>!X||s.length===0?null:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-6",a==null?void 0:a.preview,o),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:s.map(e=>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(e.timestamp).toLocaleString()}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:e.format.toUpperCase()}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 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-[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"})})]},e.id))})]})})]});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,a==null?void 0:a.root,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",a==null?void 0:a.header,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",a==null?void 0:a.title,o),children:N}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-300",a==null?void 0:a.description,o),children:F})]}),c(),d(),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("button",{onClick:l,disabled:I,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 ${R} ${I?"opacity-70 cursor-not-allowed":""}`,(a==null?void 0:a.primaryButton)||(a==null?void 0:a.exportButton),o),children:I?"Exporting...":`Export as ${L.toUpperCase()}`}),K&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-500",children:K})]}),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,o),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=fe;exports.b=Ee;exports.c=Ae;//# sourceMappingURL=chunk-GQVNLUP2.js.map
94
- //# sourceMappingURL=chunk-GQVNLUP2.js.map
93
+ </html>`,b},l=()=>chunkMQFZHA2D_js.d(null,null,function*(){q(true),Z(null);try{let e=L.toLowerCase(),f="",b;switch(e){case "pdf":let te=H();b=new Blob([te],{type:"text/html"}),f=URL.createObjectURL(b);break;case "docx":b=new Blob([E],{type:"text/plain"}),f=URL.createObjectURL(b);break;case "html":let pe=H();b=new Blob([pe],{type:"text/html"}),f=URL.createObjectURL(b);break;default:b=new Blob([E],{type:"text/markdown"}),f=URL.createObjectURL(b);break}let _=C(e),B=document.createElement("a");B.href=f,B.download=_,document.body.appendChild(B),B.click(),document.body.removeChild(B);let D={id:`export_${Date.now()}`,format:e,timestamp:Date.now(),url:f,filename:_};$(te=>[D,...te]),G&&G(e,f);}catch(e){console.error("[ndpr-toolkit] Export error:",e),Z("An error occurred during export. Please try again.");}finally{q(false);}}),c=()=>{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)"}],f=`${g}-export-format`;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",n==null?void 0:n.formatSelector,o),children:[jsxRuntime.jsx("label",{htmlFor:f,className:"block text-sm font-medium mb-1",children:"Export Format"}),jsxRuntime.jsx("select",{id:f,value:L,onChange:b=>X(b.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))]",n==null?void 0:n.formatOption,o),children:e.map(b=>jsxRuntime.jsx("option",{value:b.value,children:b.label},b.value))})]})},d=()=>x?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:()=>m(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:`${g}-custom-filename`,className:"block text-sm font-medium mb-1",children:"Custom Filename"}),jsxRuntime.jsx("input",{type:"text",id:`${g}-custom-filename`,value:v,onChange:e=>O(e.target.value),placeholder:k(L),"aria-describedby":`${g}-custom-filename-desc`,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",{id:`${g}-custom-filename-desc`,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:`${g}-custom-header`,className:"block text-sm font-medium mb-1",children:"Custom Header HTML (for HTML/PDF exports)"}),jsxRuntime.jsx("textarea",{id:`${g}-custom-header`,value:W,onChange:e=>j(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-[rgb(var(--ndpr-ring))]"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${g}-custom-footer`,className:"block text-sm font-medium mb-1",children:"Custom Footer HTML (for HTML/PDF exports)"}),jsxRuntime.jsx("textarea",{id:`${g}-custom-footer`,value:z,onChange:e=>ee(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-[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:`${g}-include-compliance-notice`,type:"checkbox",checked:r,onChange:e=>m(e.target.checked),"aria-describedby":`${g}-compliance-notice-desc`,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:`${g}-include-compliance-notice`,className:"font-medium text-gray-900 dark:text-white",children:"Include NDPA Compliance Notice"}),jsxRuntime.jsx("p",{id:`${g}-compliance-notice-desc`,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:()=>m(true),className:"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))] text-sm mb-6",children:"Show Advanced Options"}),u=()=>!N||s.length===0?null:jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mt-6",n==null?void 0:n.preview,o),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:s.map(e=>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(e.timestamp).toLocaleString()}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-300",children:e.format.toUpperCase()}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 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-[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"})})]},e.id))})]})})]});return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,n==null?void 0:n.root,o),children:[jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6",n==null?void 0:n.header,o),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",n==null?void 0:n.title,o),children:K}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("text-gray-600 dark:text-gray-300",n==null?void 0:n.description,o),children:A})]}),c(),d(),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("button",{onClick:l,disabled:I,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 ${R} ${I?"opacity-70 cursor-not-allowed":""}`,(n==null?void 0:n.primaryButton)||(n==null?void 0:n.exportButton),o),children:I?"Exporting...":`Export as ${L.toUpperCase()}`}),J&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-500",children:J})]}),jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",n==null?void 0:n.complianceNotice,o),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=fe;exports.b=Ee;exports.c=Fe;//# sourceMappingURL=chunk-FWLPJ5YI.js.map
94
+ //# sourceMappingURL=chunk-FWLPJ5YI.js.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkGOU6FU6Y_js=require('./chunk-GOU6FU6Y.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function E({initialData:S,adapter:R,onRecordAdd:g,onRecordUpdate:f,onRecordArchive:P}){let d=react.useRef(R);d.current=R;let[s,u]=react.useState(S),[v,p]=react.useState(true);react.useEffect(()=>{if(!d.current){p(false);return}let t=false;try{let e=d.current.load();e instanceof Promise?e.then(r=>{t||(r&&u(r),p(!1));},()=>{t||p(!1);}):(e&&u(e),p(!1));}catch(e){t||p(false);}return ()=>{t=true;}},[]);let a=react.useCallback(t=>{d.current&&Promise.resolve(d.current.save(t)).catch(e=>{console.warn("[ndpr-toolkit] Failed to save ROPA:",e);});},[]),C=react.useCallback(t=>{u(e=>{let r=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{records:[...e.records,t],lastUpdated:Date.now()});return a(r),r}),g==null||g(t);},[g,a]),w=react.useCallback((t,e)=>{u(r=>{let n=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},r),{records:r.records.map(l=>l.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},l),e),{updatedAt:Date.now()}):l),lastUpdated:Date.now()});return a(n),n}),f==null||f(t,e);},[f,a]),x=react.useCallback(t=>{u(e=>{let r=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{records:e.records.map(n=>n.id===t?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},n),{status:"archived",updatedAt:Date.now()}):n),lastUpdated:Date.now()});return a(r),r}),P==null||P(t);},[P,a]),D=react.useCallback(t=>s.records.find(e=>e.id===t),[s.records]),G=react.useCallback(()=>chunkGOU6FU6Y_js.b(s),[s]),b=react.useCallback(()=>chunkGOU6FU6Y_js.c(s),[s]),L=react.useCallback(()=>chunkGOU6FU6Y_js.d(s),[s]);return {ropa:s,addRecord:C,updateRecord:w,archiveRecord:x,getRecord:D,getSummary:G,exportCSV:b,getComplianceGaps:L,isLoading:v}}exports.a=E;//# sourceMappingURL=chunk-M2TPT5GB.js.map
2
+ //# sourceMappingURL=chunk-M2TPT5GB.js.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkC4YM4UMI_js=require('./chunk-C4YM4UMI.js'),chunkELKB2AFZ_js=require('./chunk-ELKB2AFZ.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function j(m,l){return l?chunkELKB2AFZ_js.a(m):{load:()=>null,save:()=>{},remove:()=>{}}}function Q({initialTransfers:m=[],adapter:l,storageKey:R="ndpr_cross_border_transfers",useLocalStorage:q=true,onAdd:g,onUpdate:C,onRemove:B}={}){let y=l!=null?l:j(R,q),v=react.useRef(y);v.current=y;let[i,u]=react.useState(m),[x,T]=react.useState(true);react.useEffect(()=>{let r=false;try{let e=v.current.load();e instanceof Promise?e.then(t=>{r||(t&&u(t),T(!1));},()=>{r||T(!1);}):(e&&u(e),T(!1));}catch(e){r||T(false);}return ()=>{r=true;}},[]);let f=react.useCallback(r=>{Promise.resolve(v.current.save(r)).catch(e=>{console.warn("[ndpr-toolkit] Failed to save cross-border transfers:",e);});},[]),M=()=>"cbt_"+Date.now()+"_"+Math.random().toString(36).substring(2,11),D=react.useCallback(r=>{let e=Date.now(),t=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},r),{id:M(),createdAt:e,updatedAt:e});return u(a=>{let n=[...a,t];return f(n),n}),g&&g(t),t},[g,f]),k=react.useCallback((r,e)=>{let t=null;return u(a=>{let n=a.findIndex(A=>A.id===r);if(n===-1)return a;t=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a(chunkMQFZHA2D_js.a({},a[n]),e),{updatedAt:Date.now()});let o=[...a];return o[n]=t,f(o),o}),t&&C&&C(t),t},[C,f]),I=react.useCallback(r=>{let e=false;u(t=>{if(t.findIndex(o=>o.id===r)===-1)return t;e=true;let n=t.filter(o=>o.id!==r);return f(n),n}),e&&B&&B(r);},[B,f]),L=react.useCallback(r=>i.find(e=>e.id===r)||null,[i]),U=react.useCallback(()=>{let r=Date.now(),e=i.filter(s=>s.status==="active"),t=["adequacy_decision","standard_clauses","binding_corporate_rules","ndpc_authorization","explicit_consent","contract_performance","public_interest","legal_claims","vital_interests"],a={};for(let s of t)a[s]=e.filter(c=>c.transferMechanism===s).length;let n=["adequate","inadequate","pending_review","unknown"],o={};for(let s of n)o[s]=e.filter(c=>c.adequacyStatus===s).length;let A=i.filter(s=>{var c,S;return s.status==="pending_approval"||((c=s.ndpcApproval)==null?void 0:c.required)&&!((S=s.ndpcApproval)!=null&&S.approved)}),P=720*60*60*1e3,V=i.filter(s=>s.reviewDate&&s.reviewDate<=r+P&&s.status==="active"),F=i.filter(s=>!s.tiaCompleted&&s.status==="active"),z=i.filter(s=>s.riskLevel==="high"&&s.status==="active");return {totalActiveTransfers:e.length,byMechanism:a,byAdequacy:o,pendingApproval:A,dueForReview:V,missingTIA:F,highRiskTransfers:z,lastUpdated:r}},[i]),O=react.useCallback(r=>chunkC4YM4UMI_js.g(r),[]);return {transfers:i,addTransfer:D,updateTransfer:k,removeTransfer:I,getTransfer:L,getSummary:U,validateTransfer:O,isLoading:x}}exports.a=Q;//# sourceMappingURL=chunk-MCWV7S2G.js.map
2
+ //# sourceMappingURL=chunk-MCWV7S2G.js.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkP42Z5CFE_js=require('./chunk-P42Z5CFE.js'),chunkELKB2AFZ_js=require('./chunk-ELKB2AFZ.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react');function J(a,h){return h?chunkELKB2AFZ_js.a(a):{load:()=>null,save:()=>{},remove:()=>{}}}function Z({sections:a,initialAnswers:h={},adapter:P,storageKey:V="ndpr_dpia_data",useLocalStorage:T=true,onComplete:w}){let y=P!=null?P:J(V,T),g=react.useRef(y);g.current=y;let[f,m]=react.useState(0),[o,v]=react.useState(h),[_,I]=react.useState(true);react.useEffect(()=>{let r=false;try{let t=g.current.load();t instanceof Promise?t.then(e=>{r||(e&&v(e),I(!1));},()=>{r||I(!1);}):(t&&v(t),I(!1));}catch(t){r||I(false);}return ()=>{r=true;}},[]);let u=a[f]||null,S=react.useCallback(r=>{Promise.resolve(g.current.save(r)).catch(t=>{console.warn("[ndpr-toolkit] Failed to save DPIA answers:",t);});},[]),$=react.useCallback((r,t)=>{v(e=>{let s=chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},e),{[r]:t});return S(s),s});},[S]),A=react.useCallback(r=>r.showWhen?r.showWhen.every(t=>{let e=o[t.questionId];switch(t.operator){case "equals":return e===t.value;case "contains":return Array.isArray(e)?e.includes(String(t.value)):false;case "greaterThan":return typeof e=="number"&&typeof t.value=="number"?e>t.value:false;case "lessThan":return typeof e=="number"&&typeof t.value=="number"?e<t.value:false;default:return true}}):true,[o]),p=react.useCallback(()=>u?u.questions.filter(A):[],[u,A]),D=react.useCallback(()=>u?p().every(t=>{if(!t.required)return true;let e=o[t.id];return !(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0)}):false,[o,u,p]),O=react.useCallback(()=>{let r={};return u&&p().forEach(e=>{if(!e.required)return;let s=o[e.id];s==null||typeof s=="string"&&s.trim()===""?r[e.id]="This question is required":Array.isArray(s)&&s.length===0&&(r[e.id]="At least one option must be selected");}),r},[o,u,p]),U=react.useCallback(()=>D()&&f<a.length-1?(m(r=>r+1),true):false,[f,a.length,D]),B=react.useCallback(()=>f>0?(m(r=>r-1),true):false,[f]),F=react.useCallback(r=>r>=0&&r<a.length?(m(r),true):false,[a.length]),W=react.useCallback(()=>a.every(r=>r.questions.filter(A).every(e=>{if(!e.required)return true;let s=o[e.id];return !(s==null||typeof s=="string"&&s.trim()===""||Array.isArray(s)&&s.length===0)})),[o,a,A]),k=react.useCallback(()=>{let r=[];return a.forEach(t=>{t.questions.forEach(e=>{let s=o[e.id];if(s!=null&&e.riskLevel)if(["select","radio","checkbox"].includes(e.type)&&e.options)(Array.isArray(s)?s:[s]).forEach(l=>{var R;let c=(R=e.options)==null?void 0:R.find(d=>d.value===l);if(c!=null&&c.riskLevel){let d=c.riskLevel,Q=d==="low"?1:d==="medium"?3:5,L=d==="low"?1:d==="medium"?3:5;r.push({id:`risk_${r.length+1}`,description:`${e.text} - ${c.label}`,likelihood:Q,impact:L,score:Q*L,level:d,mitigated:false,relatedQuestionIds:[e.id]});}});else {let n=e.riskLevel,l=n==="low"?1:n==="medium"?3:5,c=n==="low"?1:n==="medium"?3:5;r.push({id:`risk_${r.length+1}`,description:e.text,likelihood:l,impact:c,score:l*c,level:n,mitigated:false,relatedQuestionIds:[e.id]});}});}),r},[o,a]),K=react.useCallback((r,t,e)=>{let s=k(),n={id:`dpia_${Date.now()}`,title:t,processingDescription:e,startedAt:Date.now(),completedAt:Date.now(),assessor:r,answers:o,risks:s,overallRiskLevel:"low",canProceed:true,conclusion:"",version:"1.0"},l=chunkP42Z5CFE_js.a(n);return n.overallRiskLevel=l.overallRiskLevel,n.canProceed=l.canProceed,n.conclusion=l.canProceed?"Based on the assessment, the processing can proceed with appropriate safeguards.":"Based on the assessment, the processing should not proceed without further mitigation measures.",n.recommendations=l.recommendations,w&&w(n),n},[o,k,w]),j=react.useCallback(()=>{v({}),m(0),Promise.resolve(g.current.remove()).catch(r=>{console.warn("[ndpr-toolkit] Failed to remove DPIA data:",r);});},[]),z=(()=>{let r=0,t=0;return a.forEach(e=>{e.questions.forEach(s=>{if(s.required&&A(s)){t++;let n=o[s.id];n!=null&&!(typeof n=="string"&&n.trim()==="")&&!(Array.isArray(n)&&n.length===0)&&r++;}});}),t>0?Math.round(r/t*100):0})();return {currentSectionIndex:f,currentSection:u,answers:o,updateAnswer:$,nextSection:U,prevSection:B,goToSection:F,isCurrentSectionValid:D,getCurrentSectionErrors:O,isComplete:W,completeDPIA:K,getVisibleQuestions:p,resetDPIA:j,progress:z,isLoading:_}}exports.a=Z;//# sourceMappingURL=chunk-OPYQIJKY.js.map
2
+ //# sourceMappingURL=chunk-OPYQIJKY.js.map
@@ -0,0 +1,7 @@
1
+ import {a}from'./chunk-AYKLAEOU.mjs';import S,{useMemo}from'react';import {jsxs,jsx}from'react/jsx-runtime';var j=({result:r,sections:c,showFullReport:p=true,allowPrint:x=true,allowExport:y=true,onExport:v,className:u="",buttonClassName:b="",classNames:k={},unstyled:f=false})=>{let o=useMemo(()=>new Date().toLocaleDateString(),[]),d=(a$1,s)=>{let n=s?k[s]:void 0;return !n&&s==="printButton"&&(n=k.primaryButton),a(a$1,n,f)},l=a=>new Date(a).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),N=a=>{let s=r.answers[a];return s==null?"Not answered":typeof s=="boolean"?s?"Yes":"No":Array.isArray(s)?s.join(", "):String(s)},w=()=>{window.print();},C=a=>{v&&v(a);},A=a=>jsx("span",{className:d(`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"}[a]}`,"riskBadge"),children:a.charAt(0).toUpperCase()+a.slice(1)});return jsxs("div",{className:`${d("bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 print:shadow-none print:p-0","root")} ${u}`,children:[jsxs("div",{className:d("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:d("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:r.title})]}),(x||y)&&jsxs("div",{className:"flex space-x-2 print:hidden",children:[x&&jsx("button",{onClick:w,className:`${d("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")} ${b}`,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"]})}),y&&jsx("div",{className:"relative inline-block",children:jsx("button",{onClick:()=>C("pdf"),className:`px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${b}`,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:"})," ",r.assessor.name,", ",r.assessor.role]}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Contact:"})," ",r.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:"})," ",l(r.startedAt)]}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Completed:"})," ",r.completedAt?l(r.completedAt):"In progress"]}),jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[jsx("span",{className:"font-medium",children:"Next review:"})," ",r.reviewDate?l(r.reviewDate):"Not scheduled"]})]})]})]}),jsxs("div",{className:d("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",role:"status","aria-live":"polite",children:[jsx("span",{className:"font-medium mr-2",children:"Overall Risk Level:"}),A(r.overallRiskLevel)]}),jsxs("div",{className:d("mb-2","conclusion"),children:[jsx("span",{className:"font-medium",children:"Conclusion:"})," ",r.conclusion]}),jsxs("div",{role:"status","aria-live":"polite",children:[jsx("span",{className:"font-medium",children:"Can Proceed:"})," ",r.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:r.processingDescription}),r.recommendations&&r.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:r.recommendations.map((a,s)=>jsx("li",{className:d("","recommendation"),children:a},s))})]})]})]}),jsxs("div",{className:"mb-8",children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Identified Risks"}),r.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:d("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:r.risks.map(a=>jsxs("tr",{className:d("","riskRow"),children:[jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:a.description}),jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[a.likelihood," / 5"]}),jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:[a.impact," / 5"]}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:A(a.level)}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600 dark:text-gray-400",children:a.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"})})]},a.id))})]})})]}),p&&jsxs("div",{children:[jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-white mb-4",children:"Full Assessment Details"}),c.map(a=>{let s=a.questions.filter(n=>r.answers[n.id]!==void 0);return s.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:a.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:s.map(n=>jsxs("tr",{children:[jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-900 dark:text-gray-100",children:n.text}),jsx("td",{className:"px-6 py-4 whitespace-normal text-sm text-gray-600 dark:text-gray-400",children:N(n.id)})]},n.id))})]})})]},a.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: ",r.version]}),jsxs("p",{children:["Generated on: ",o]})]})]})};var E=({steps:r,onStepClick:c,clickable:p=true,orientation:x="horizontal",className:y="",activeStepClassName:v="",completedStepClassName:u="",incompleteStepClassName:b="",classNames:k={},unstyled:f=false})=>{let o=(i,g)=>a(i,g?k[g]:void 0,f),d=i=>{p&&c&&c(i);},l=x==="vertical";return jsx("div",{role:"navigation","aria-label":"Step progress",className:`${o(l?"flex flex-col space-y-4":"flex items-center justify-between","root")} ${y}`,children:r.map((i,g)=>{let N=g===r.length-1,w=i.active?o(`font-medium ${v||"text-[rgb(var(--ndpr-primary))] dark:text-[rgb(var(--ndpr-primary))]"}`,"label"):i.completed?o(u||"text-green-600 dark:text-green-400","label"):o(b||"text-gray-600 dark:text-gray-400","label"),C=i.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"):i.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(S.Fragment,{children:[jsxs("div",{className:o(`${l?"flex items-start":"flex flex-col items-center"} ${p?"cursor-pointer":""}`,"step"),onClick:()=>d(i.id),"aria-current":i.active?"step":void 0,children:[jsx("div",{className:`
2
+ flex items-center justify-center
3
+ ${l?"mr-4":""}
4
+ `,children:jsx("div",{className:C,children:i.icon?i.icon:i.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:g+1})})}),jsxs("div",{className:`
5
+ ${l?"flex-1":"mt-2 text-center"}
6
+ `,children:[jsx("div",{className:`text-sm font-medium ${w}`,children:i.label}),i.description&&jsx("div",{className:"text-xs text-gray-600 dark:text-gray-400 mt-1",children:i.description})]})]}),!N&&jsx("div",{className:o(l?"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")})]},i.id)})})};export{j as a,E as b};//# sourceMappingURL=chunk-OYR3L4XS.mjs.map
7
+ //# sourceMappingURL=chunk-OYR3L4XS.mjs.map
@@ -0,0 +1,2 @@
1
+ import {a as a$1,d}from'./chunk-ZEOQYWOE.mjs';import {a as a$2}from'./chunk-6WIP33TW.mjs';import {b,a}from'./chunk-WWT2ZSNU.mjs';import {useRef,useState,useEffect,useCallback}from'react';function F(y,l){return l?a$2(y):{load:()=>null,save:()=>{},remove:()=>{}}}function E({templates:y,initialPolicy:l,adapter:g,storageKey:S="ndpr_privacy_policy",useLocalStorage:h=true,onGenerate:P}){let b$1=g!=null?g:F(S,h),f=useRef(b$1);f.current=b$1;let[n,s]=useState(l||null),[r,v]=useState(null),[u,O]=useState({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),[q,T]=useState(true),V=useRef(y);V.current=y,useEffect(()=>{if(l){T(false);return}let e=false;try{let a=f.current.load(),t=i=>{if(i){if(s(i),i.templateId){let d=V.current.find(p=>p.id===i.templateId);d&&v(d);}i.organizationInfo&&O(i.organizationInfo);}T(!1);};a instanceof Promise?a.then(i=>{e||t(i);},()=>{e||T(!1);}):t(a);}catch(a){e||T(false);}return ()=>{e=true;}},[l]);let R=e=>{Promise.resolve(f.current.save(e)).catch(a=>{console.warn("[ndpr-toolkit] Failed to save policy:",a);});},A=useCallback(e=>{let a$1=y.find(p=>p.id===e);if(!a$1)return false;v(a$1);let t=a$1.sections.map(p=>b(a({},p),{customContent:void 0})),i={};Object.keys(a$1.variables).forEach(p=>{i[p]=a$1.variables[p].defaultValue||"";});let d=Date.now();return s({id:"policy_"+d+"_"+Math.random().toString(36).substr(2,9),title:"",templateId:a$1.id,organizationInfo:u,sections:t,variableValues:i,effectiveDate:d,lastUpdated:d,version:"1.0"}),true},[y,u]),C=useCallback(e=>{O(a$1=>a(a({},a$1),e));},[]),N=useCallback((e,a$1)=>{r&&(n?s(t=>t&&b(a({},t),{sections:t.sections.map(i=>i.id===e?b(a({},i),{included:a$1}):i)})):v(t=>t&&b(a({},t),{sections:t.sections.map(i=>i.id===e?b(a({},i),{included:a$1}):i)})));},[r,n]),U=useCallback((e,a$1)=>{r&&(n?s(t=>t&&b(a({},t),{sections:t.sections.map(i=>i.id===e?b(a({},i),{customContent:a$1}):i)})):v(t=>t&&b(a({},t),{sections:t.sections.map(i=>i.id===e?b(a({},i),{customContent:a$1}):i)})));},[r,n]),L=useCallback((e,a$1)=>{n&&s(t=>t&&b(a({},t),{variableValues:b(a({},t.variableValues),{[e]:a$1})}));},[n]),_=()=>"policy_"+Date.now()+"_"+Math.random().toString(36).substr(2,9),k=useCallback(()=>{if(!r)return null;let e=Date.now(),a$1={id:(n==null?void 0:n.id)||_(),title:`Privacy Policy for ${u.name}`,templateId:r.id,organizationInfo:u,sections:r.sections.map(t=>{var i;return b(a({},t),{customContent:(i=n==null?void 0:n.sections.find(d=>d.id===t.id))==null?void 0:i.customContent})}),variableValues:(n==null?void 0:n.variableValues)||{},effectiveDate:e,lastUpdated:e,version:"1.0"};return s(a$1),R(a$1),P&&P(a$1),a$1},[r,n,u,P]),j=useCallback(()=>{if(!n)return {fullText:"",sectionTexts:{},missingVariables:[]};let e=a$1(n.sections,n.organizationInfo);return typeof e=="string"?{fullText:e,sectionTexts:{full:e},missingVariables:[]}:e},[n]),K=useCallback(()=>{s(null),v(null),O({name:"",website:"",privacyEmail:"",address:"",privacyPhone:"",dpoName:"",dpoEmail:"",industry:""}),Promise.resolve(f.current.remove()).catch(e=>{console.warn("[ndpr-toolkit] Failed to remove policy:",e);});},[]),$=useCallback(()=>{let e=[];if(r||e.push("No template selected"),u.name||e.push("Organization name is required"),u.website||e.push("Organization website is required"),u.privacyEmail||e.push("Privacy contact email is required"),r){let a=r.sections.filter(i=>i.required),t=(n==null?void 0:n.sections.filter(i=>i.included))||[];a.forEach(i=>{t.some(d=>d.id===i.id)||e.push(`Required section "${i.title}" must be included`);});}return r&&n&&Object.entries(r.variables).forEach(([a,t])=>{t.required&&!n.variableValues[a]&&e.push(`Required variable "${t.name}" must have a value`);}),{valid:e.length===0,errors:e}},[r,u,n]);return {policy:n,selectedTemplate:r,organizationInfo:u,selectTemplate:A,updateOrganizationInfo:C,toggleSection:N,updateSectionContent:U,updateVariableValue:L,generatePolicy:k,getPolicyText:j,resetPolicy:K,isValid:$,isLoading:q}}function Z(y={}){let{orgInfo:l,storageKey:g,useLocalStorage:S,adapter:h}=y,{sections:P,variables:b}=d(),f={};l&&(l.name&&(f.orgName=l.name),l.email&&(f.privacyEmail=l.email),l.dpoName&&(f.dpoName=l.dpoName));let n={id:"default-business",name:"Default Business Policy",description:"NDPA-compliant privacy policy template for businesses.",organizationType:"business",sections:P,variables:Object.fromEntries(b.map(s=>[s.name,{name:s.name,description:s.description,required:s.required,defaultValue:f[s.name]||s.value||void 0}])),version:"1.0",lastUpdated:Date.now(),ndpaCompliant:true};return E({templates:[n],adapter:h,storageKey:g,useLocalStorage:S})}export{E as a,Z as b};//# sourceMappingURL=chunk-QF6XNKU6.mjs.map
2
+ //# sourceMappingURL=chunk-QF6XNKU6.mjs.map
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var _=({options:b,settings:l,onSave:v,title:h="Manage Your Privacy Settings",description:R="Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function. Consent management is provided in accordance with NDPA Sections 25-26.",saveButtonText:B="Save Preferences",resetButtonText:x="Reset to Defaults",version:$="1.0",className:S="",buttonClassName:o="",primaryButtonClassName:i="",secondaryButtonClassName:y="",classNames:e,unstyled:s,showSuccessMessage:m=true,successMessage:k="Your preferences have been saved.",successMessageDuration:T=3e3})=>{let[p,t]=react.useState({}),[r,d]=react.useState(false),g=react.useRef(null);react.useEffect(()=>()=>{g.current&&clearTimeout(g.current);},[]),react.useEffect(()=>{if(l&&l.consents)t(l.consents);else {let n={};b.forEach(c=>{n[c.id]=c.defaultValue||false;}),t(n);}},[b,l]);let I=(n,c)=>{t(Y=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},Y),{[n]:c}));},M=()=>{let n={consents:p,timestamp:Date.now(),version:$,method:"manager",hasInteracted:true};v(n),m&&(d(true),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{d(false);},T));},O=()=>{let n={};b.forEach(c=>{n[c.id]=c.defaultValue||false;}),t(n);},w=(e==null?void 0:e.primaryButton)||(e==null?void 0:e.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${o} ${i}`,C=(e==null?void 0:e.secondaryButton)||(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 ${o} ${y}`;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 ${S}`,e==null?void 0:e.root,s),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",e==null?void 0:e.title,s),children:h}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("mb-6 text-gray-600 dark:text-gray-300",e==null?void 0:e.description,s),children:R}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-6",e==null?void 0:e.optionsList,s),children:b.map(n=>jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("border-b border-gray-200 dark:border-gray-700 pb-4 last:border-0",e==null?void 0:e.optionItem,s),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:n.label}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:n.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:p[n.id]||false,onChange:c=>I(n.id,c.target.checked),disabled:n.required}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a(`w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-[rgb(var(--ndpr-ring)/0.3)] rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-[rgb(var(--ndpr-primary))] ${n.required?"opacity-60":""}`,e==null?void 0:e.toggle,s)}),jsxRuntime.jsxs("span",{className:"ml-3 text-sm font-medium text-gray-900 dark:text-gray-300",children:[p[n.id]?"Enabled":"Disabled",n.required&&jsxRuntime.jsx("span",{className:"text-xs text-red-500 ml-1",children:"(Required)"})]})]})})]})},n.id))}),r&&jsxRuntime.jsx("div",{className:"mt-4 p-3 bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-200 rounded-md","aria-live":"polite",role:"status",children:k}),jsxRuntime.jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[jsxRuntime.jsx("button",{onClick:M,className:chunkE64TU6IU_js.a(w,e==null?void 0:e.saveButton,s),children:B}),jsxRuntime.jsx("button",{onClick:O,className:chunkE64TU6IU_js.a(C,e==null?void 0:e.resetButton,s),children:x})]}),jsxRuntime.jsxs("div",{className:"mt-4 text-xs text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsxs("p",{children:["Last updated: ",l?new Date(l.timestamp).toLocaleString():"Never"]}),jsxRuntime.jsxs("p",{children:["Version: ",$]})]})]})};var N=({settings:b,storageOptions:l={},onLoad:v,onSave:h,autoSave:R=true,autoLoad:B=true,classNames:x,unstyled:$,children:S})=>{let{storageKey:o="ndpr_consent",storageType:i="localStorage",cookieOptions:y={}}=l,[e,s]=react.useState(false),m=react.useCallback(()=>{let t=null;try{if(i==="localStorage"&&typeof window!="undefined"){let r=localStorage.getItem(o);r&&(t=JSON.parse(r));}else if(i==="sessionStorage"&&typeof window!="undefined"){let r=sessionStorage.getItem(o);r&&(t=JSON.parse(r));}else if(i==="cookie"&&typeof document!="undefined"){let d=document.cookie.split(";").find(g=>g.trim().startsWith(`${o}=`));if(d){let g=d.split("=")[1];t=JSON.parse(decodeURIComponent(g));}}s(!0),v&&v(t);}catch(r){console.error("Error loading consent settings:",r),s(true),v&&v(null);}return t},[i,o,v]),k=react.useCallback(t=>{try{let r=JSON.stringify(t);if(i==="localStorage"&&typeof window!="undefined")localStorage.setItem(o,r);else if(i==="sessionStorage"&&typeof window!="undefined")sessionStorage.setItem(o,r);else if(i==="cookie"&&typeof document!="undefined"){let{domain:d,path:g="/",expires:I=365,secure:M=!0,sameSite:O="Lax"}=y,w=new Date;w.setDate(w.getDate()+I);let C=`${o}=${encodeURIComponent(r)}; path=${g}; expires=${w.toUTCString()}`;d&&(C+=`; domain=${d}`),M&&(C+="; secure"),C+=`; samesite=${O}`,document.cookie=C;}return h&&h(t),!0}catch(r){return console.error("Error saving consent settings:",r),false}},[i,o,y,h]),T=react.useCallback(()=>{try{if(i==="localStorage"&&typeof window!="undefined")localStorage.removeItem(o);else if(i==="sessionStorage"&&typeof window!="undefined")sessionStorage.removeItem(o);else if(i==="cookie"&&typeof document!="undefined"){let{domain:t,path:r="/"}=y,d=`${o}=; path=${r}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;t&&(d+=`; domain=${t}`),document.cookie=d;}return !0}catch(t){return console.error("Error clearing consent settings:",t),false}},[i,o,y]);react.useEffect(()=>{B&&!e&&m();},[B,e,m]),react.useEffect(()=>{R&&e&&k(b);},[b,R,e,k]);let p=chunkE64TU6IU_js.a("",x==null?void 0:x.root,$);if(typeof S=="function"){let t=S({loadSettings:m,saveSettings:k,clearSettings:T,loaded:e});return p?jsxRuntime.jsx("div",{className:p,children:t}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:t})}return p?jsxRuntime.jsx("div",{className:p,children:S}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:S})};exports.a=_;exports.b=N;//# sourceMappingURL=chunk-256APOQM.js.map
2
- //# sourceMappingURL=chunk-256APOQM.js.map
1
+ 'use strict';var chunkE64TU6IU_js=require('./chunk-E64TU6IU.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var _=({options:b,settings:l,onSave:v,title:h="Manage Your Privacy Settings",description:R="Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function. Consent management is provided in accordance with NDPA Sections 25-26.",saveButtonText:B="Save Preferences",resetButtonText:x="Reset to Defaults",version:$="1.0",className:S="",buttonClassName:o="",primaryButtonClassName:i="",secondaryButtonClassName:y="",classNames:e,unstyled:s,showSuccessMessage:m=true,successMessage:k="Your preferences have been saved.",successMessageDuration:T=3e3})=>{let[p,t]=react.useState({}),[r,d]=react.useState(false),g=react.useRef(null);react.useEffect(()=>()=>{g.current&&clearTimeout(g.current);},[]),react.useEffect(()=>{if(l&&l.consents)t(l.consents);else {let n={};b.forEach(c=>{n[c.id]=c.defaultValue||false;}),t(n);}},[b,l]);let I=(n,c)=>{t(Y=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},Y),{[n]:c}));},M=()=>{let n={consents:p,timestamp:Date.now(),version:$,method:"manager",hasInteracted:true};v(n),m&&(d(true),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{d(false);},T));},O=()=>{let n={};b.forEach(c=>{n[c.id]=c.defaultValue||false;}),t(n);},w=(e==null?void 0:e.primaryButton)||(e==null?void 0:e.saveButton)||`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${o} ${i}`,C=(e==null?void 0:e.secondaryButton)||(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 ${o} ${y}`;return jsxRuntime.jsxs("div",{className:chunkE64TU6IU_js.a(`bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 ${S}`,e==null?void 0:e.root,s),children:[jsxRuntime.jsx("h2",{className:chunkE64TU6IU_js.a("text-xl font-bold mb-2",e==null?void 0:e.title,s),children:h}),jsxRuntime.jsx("p",{className:chunkE64TU6IU_js.a("mb-6 text-gray-600 dark:text-gray-300",e==null?void 0:e.description,s),children:R}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("space-y-6",e==null?void 0:e.optionsList,s),children:b.map(n=>jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a("border-b border-gray-200 dark:border-gray-700 pb-4 last:border-0",e==null?void 0:e.optionItem,s),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:n.label}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:n.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:p[n.id]||false,onChange:c=>I(n.id,c.target.checked),disabled:n.required}),jsxRuntime.jsx("div",{className:chunkE64TU6IU_js.a(`w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-[rgb(var(--ndpr-ring)/0.3)] rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-[rgb(var(--ndpr-primary))] ${n.required?"opacity-60":""}`,e==null?void 0:e.toggle,s)}),jsxRuntime.jsxs("span",{className:"ml-3 text-sm font-medium text-gray-900 dark:text-gray-300",children:[p[n.id]?"Enabled":"Disabled",n.required&&jsxRuntime.jsx("span",{className:"text-xs text-red-500 ml-1",children:"(Required)"})]})]})})]})},n.id))}),r&&jsxRuntime.jsx("div",{className:"mt-4 p-3 bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-200 rounded-md","aria-live":"polite",role:"status",children:k}),jsxRuntime.jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[jsxRuntime.jsx("button",{onClick:M,className:chunkE64TU6IU_js.a(w,e==null?void 0:e.saveButton,s),children:B}),jsxRuntime.jsx("button",{onClick:O,className:chunkE64TU6IU_js.a(C,e==null?void 0:e.resetButton,s),children:x})]}),jsxRuntime.jsxs("div",{className:"mt-4 text-xs text-gray-600 dark:text-gray-400",children:[jsxRuntime.jsxs("p",{children:["Last updated: ",l?new Date(l.timestamp).toLocaleString():"Never"]}),jsxRuntime.jsxs("p",{children:["Version: ",$]})]})]})};var N=({settings:b,storageOptions:l={},onLoad:v,onSave:h,autoSave:R=true,autoLoad:B=true,classNames:x,unstyled:$,children:S})=>{let{storageKey:o="ndpr_consent",storageType:i="localStorage",cookieOptions:y={}}=l,[e,s]=react.useState(false),m=react.useCallback(()=>{let t=null;try{if(i==="localStorage"&&typeof window!="undefined"){let r=localStorage.getItem(o);r&&(t=JSON.parse(r));}else if(i==="sessionStorage"&&typeof window!="undefined"){let r=sessionStorage.getItem(o);r&&(t=JSON.parse(r));}else if(i==="cookie"&&typeof document!="undefined"){let d=document.cookie.split(";").find(g=>g.trim().startsWith(`${o}=`));if(d){let g=d.split("=")[1];t=JSON.parse(decodeURIComponent(g));}}s(!0),v&&v(t);}catch(r){console.error("[ndpr-toolkit] Error loading consent settings:",r),s(true),v&&v(null);}return t},[i,o,v]),k=react.useCallback(t=>{try{let r=JSON.stringify(t);if(i==="localStorage"&&typeof window!="undefined")localStorage.setItem(o,r);else if(i==="sessionStorage"&&typeof window!="undefined")sessionStorage.setItem(o,r);else if(i==="cookie"&&typeof document!="undefined"){let{domain:d,path:g="/",expires:I=365,secure:M=!0,sameSite:O="Lax"}=y,w=new Date;w.setDate(w.getDate()+I);let C=`${o}=${encodeURIComponent(r)}; path=${g}; expires=${w.toUTCString()}`;d&&(C+=`; domain=${d}`),M&&(C+="; secure"),C+=`; samesite=${O}`,document.cookie=C;}return h&&h(t),!0}catch(r){return console.error("[ndpr-toolkit] Error saving consent settings:",r),false}},[i,o,y,h]),T=react.useCallback(()=>{try{if(i==="localStorage"&&typeof window!="undefined")localStorage.removeItem(o);else if(i==="sessionStorage"&&typeof window!="undefined")sessionStorage.removeItem(o);else if(i==="cookie"&&typeof document!="undefined"){let{domain:t,path:r="/"}=y,d=`${o}=; path=${r}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;t&&(d+=`; domain=${t}`),document.cookie=d;}return !0}catch(t){return console.error("[ndpr-toolkit] Error clearing consent settings:",t),false}},[i,o,y]);react.useEffect(()=>{B&&!e&&m();},[B,e,m]),react.useEffect(()=>{R&&e&&k(b);},[b,R,e,k]);let p=chunkE64TU6IU_js.a("",x==null?void 0:x.root,$);if(typeof S=="function"){let t=S({loadSettings:m,saveSettings:k,clearSettings:T,loaded:e});return p?jsxRuntime.jsx("div",{className:p,children:t}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:t})}return p?jsxRuntime.jsx("div",{className:p,children:S}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:S})};exports.a=_;exports.b=N;//# sourceMappingURL=chunk-QJ3JNHO7.js.map
2
+ //# sourceMappingURL=chunk-QJ3JNHO7.js.map