@tantainnovative/ndpr-toolkit 2.1.2 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/README.md +56 -0
  2. package/dist/{breach-6z0r-KuE.d.mts → breach-B_-6lDqS.d.mts} +1 -1
  3. package/dist/{breach-BFfnvtRk.d.ts → breach-CzXqSsaY.d.ts} +1 -1
  4. package/dist/{breach-BtFbDOmV.d.mts → breach-Eu9byel8.d.mts} +1 -1
  5. package/dist/{breach-BtFbDOmV.d.ts → breach-Eu9byel8.d.ts} +1 -1
  6. package/dist/breach.d.mts +81 -5
  7. package/dist/breach.d.ts +81 -5
  8. package/dist/breach.js +1 -1
  9. package/dist/breach.mjs +1 -1
  10. package/dist/chunk-4RGDNVR5.mjs +72 -0
  11. package/dist/chunk-6LM3RAFO.js +7 -0
  12. package/dist/chunk-7DNQSOER.js +2 -0
  13. package/dist/chunk-A7DRHSDQ.mjs +2 -0
  14. package/dist/chunk-FC6EG34C.js +72 -0
  15. package/dist/chunk-FDB6KZUD.mjs +2 -0
  16. package/dist/chunk-FZUCKGIM.mjs +7 -0
  17. package/dist/chunk-G3JNFZPT.js +2 -0
  18. package/dist/chunk-HXCRMA4J.mjs +2 -0
  19. package/dist/chunk-IC7VOOKJ.mjs +2 -0
  20. package/dist/chunk-ICUZG6CD.mjs +2 -0
  21. package/dist/chunk-IW5PHOG7.mjs +7 -0
  22. package/dist/chunk-JKEAPTYP.js +7 -0
  23. package/dist/chunk-N52S64SU.js +2 -0
  24. package/dist/chunk-SKAMVXBI.mjs +94 -0
  25. package/dist/chunk-VURIXCGY.js +2 -0
  26. package/dist/chunk-VXRY3V42.js +94 -0
  27. package/dist/chunk-YBPHGEL2.js +2 -0
  28. package/dist/consent.d.mts +68 -2
  29. package/dist/consent.d.ts +68 -2
  30. package/dist/consent.js +1 -1
  31. package/dist/consent.mjs +1 -1
  32. package/dist/core.d.mts +10 -10
  33. package/dist/core.d.ts +10 -10
  34. package/dist/{cross-border-BrIy1ieh.d.ts → cross-border-BMcqLvjC.d.mts} +1 -1
  35. package/dist/{cross-border-BrIy1ieh.d.mts → cross-border-BMcqLvjC.d.ts} +1 -1
  36. package/dist/cross-border-entry-BfF7jw5o.d.mts +84 -0
  37. package/dist/cross-border-entry-CtX8_o-_.d.ts +84 -0
  38. package/dist/cross-border.d.mts +4 -58
  39. package/dist/cross-border.d.ts +4 -58
  40. package/dist/cross-border.js +1 -1
  41. package/dist/cross-border.mjs +1 -1
  42. package/dist/{dpia-vWfE_9bO.d.mts → dpia-5OQVA1R_.d.mts} +1 -1
  43. package/dist/{dpia-vWfE_9bO.d.ts → dpia-5OQVA1R_.d.ts} +1 -1
  44. package/dist/{dpia-fdtTd2DI.d.ts → dpia-B0Pok5us.d.ts} +1 -1
  45. package/dist/{dpia-B9ZZJG5a.d.mts → dpia-CUfOmzvX.d.mts} +1 -1
  46. package/dist/dpia.d.mts +105 -5
  47. package/dist/dpia.d.ts +105 -5
  48. package/dist/dpia.js +1 -1
  49. package/dist/dpia.mjs +1 -1
  50. package/dist/{dsr-pQzQ3H1O.d.mts → dsr-Cm9lzWG7.d.mts} +1 -1
  51. package/dist/{dsr-pQzQ3H1O.d.ts → dsr-Cm9lzWG7.d.ts} +1 -1
  52. package/dist/{dsr-whPkiI0_.d.mts → dsr-D_eTNc4S.d.mts} +1 -1
  53. package/dist/{dsr-jq5NUEdz.d.ts → dsr-pNtVb1BK.d.ts} +1 -1
  54. package/dist/dsr.d.mts +66 -5
  55. package/dist/dsr.d.ts +66 -5
  56. package/dist/dsr.js +1 -1
  57. package/dist/dsr.mjs +1 -1
  58. package/dist/hooks.d.mts +13 -13
  59. package/dist/hooks.d.ts +13 -13
  60. package/dist/index.d.mts +24 -24
  61. package/dist/index.d.ts +24 -24
  62. package/dist/index.js +1 -1
  63. package/dist/index.mjs +1 -1
  64. package/dist/{lawful-basis-v04AhbK2.d.ts → lawful-basis-BEyI0kGg.d.ts} +2 -2
  65. package/dist/{lawful-basis-D-oXFizg.d.mts → lawful-basis-C2eGaoHM.d.mts} +2 -2
  66. package/dist/{lawful-basis-CWtvDG1x.d.mts → lawful-basis-Cv1VmDLn.d.mts} +1 -1
  67. package/dist/{lawful-basis-CWtvDG1x.d.ts → lawful-basis-Cv1VmDLn.d.ts} +1 -1
  68. package/dist/lawful-basis-entry-BeSX7u0U.d.ts +81 -0
  69. package/dist/lawful-basis-entry-CMPPM9Rh.d.mts +81 -0
  70. package/dist/lawful-basis.d.mts +5 -55
  71. package/dist/lawful-basis.d.ts +5 -55
  72. package/dist/lawful-basis.js +1 -1
  73. package/dist/lawful-basis.mjs +1 -1
  74. package/dist/policy-dmsRlqgM.d.ts +283 -0
  75. package/dist/policy-kZN23hrR.d.mts +283 -0
  76. package/dist/policy.d.mts +3 -193
  77. package/dist/policy.d.ts +3 -193
  78. package/dist/policy.js +1 -1
  79. package/dist/policy.mjs +1 -1
  80. package/dist/{ropa-Rb4dsFSz.d.mts → ropa-DP7pPPql.d.mts} +2 -2
  81. package/dist/{ropa-BebGfqKQ.d.ts → ropa-Li6UlL5H.d.ts} +2 -2
  82. package/dist/ropa-entry-CZJ91ymk.d.mts +71 -0
  83. package/dist/ropa-entry-DIEQ9WFs.d.ts +71 -0
  84. package/dist/ropa.d.mts +5 -45
  85. package/dist/ropa.d.ts +5 -45
  86. package/dist/ropa.js +1 -1
  87. package/dist/ropa.mjs +1 -1
  88. package/dist/unstyled.js +1 -1
  89. package/dist/unstyled.mjs +1 -1
  90. package/dist/{useBreach-WrZzJilM.d.mts → useBreach-BBSoIcZO.d.mts} +1 -1
  91. package/dist/{useBreach-vrh_XMpI.d.ts → useBreach-lFLbSyAN.d.ts} +1 -1
  92. package/dist/{useCrossBorderTransfer-TVnY8_UX.d.mts → useCrossBorderTransfer-BZVFCXfr.d.mts} +1 -1
  93. package/dist/{useCrossBorderTransfer-D4FQYfFt.d.ts → useCrossBorderTransfer-DmtACeqW.d.ts} +1 -1
  94. package/dist/{useDPIA-DFDHBLSa.d.ts → useDPIA-DBsg2yZx.d.ts} +1 -1
  95. package/dist/{useDPIA-FqPofFaV.d.mts → useDPIA-Da7-Q_yW.d.mts} +1 -1
  96. package/dist/{useDSR-DAqqOBXb.d.ts → useDSR-CYI7WCXr.d.ts} +1 -1
  97. package/dist/{useDSR-OXM5Q9rf.d.mts → useDSR-YYZ6FYFs.d.mts} +1 -1
  98. package/dist/{useLawfulBasis-RILM_xsx.d.ts → useLawfulBasis-CCWF9waR.d.ts} +2 -2
  99. package/dist/{useLawfulBasis-DNQ8YszQ.d.mts → useLawfulBasis-CpWuHtyh.d.mts} +2 -2
  100. package/dist/{useROPA-Bcs6cRdi.d.ts → useROPA-BhJ3kvHp.d.ts} +1 -1
  101. package/dist/{useROPA-nmcSiUYv.d.mts → useROPA-DLFdjkxP.d.mts} +1 -1
  102. package/package.json +22 -15
  103. package/dist/chunk-2XHD22J7.mjs +0 -7
  104. package/dist/chunk-4DKT6IB6.js +0 -94
  105. package/dist/chunk-6JFTAYXV.mjs +0 -2
  106. package/dist/chunk-6JVYYLS7.js +0 -2
  107. package/dist/chunk-6SGG6WPA.mjs +0 -2
  108. package/dist/chunk-AQEGDEQM.js +0 -7
  109. package/dist/chunk-C2IJWCZQ.mjs +0 -2
  110. package/dist/chunk-FFW7RUAG.mjs +0 -94
  111. package/dist/chunk-FK3CSFLJ.js +0 -2
  112. package/dist/chunk-JUN6YPLL.mjs +0 -72
  113. package/dist/chunk-L3FKTBGV.js +0 -72
  114. package/dist/chunk-RB26MIRI.js +0 -2
  115. package/dist/chunk-RHWW5FDP.js +0 -16
  116. package/dist/chunk-SLNMKGQ2.mjs +0 -2
  117. package/dist/chunk-UUWVBENC.js +0 -2
  118. package/dist/chunk-XMKA6GVK.mjs +0 -16
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkCMZTI7SG_js=require('./chunk-CMZTI7SG.js'),chunkVURIXCGY_js=require('./chunk-VURIXCGY.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var ge=({requestTypes:S,onSubmit:E,title:U="Submit a Data Subject Request",description:H="Use this form to exercise your rights under the Nigeria Data Protection Act (NDPA).",submitButtonText:Q="Submit Request",className:X="",buttonClassName:Y="",showConfirmation:G=true,confirmationMessage:Z="Your request has been submitted successfully. You will receive a confirmation email shortly.",requireIdentityVerification:J=true,identifierTypes:M=[{id:"email",label:"Email Address"},{id:"account",label:"Account Number"},{id:"customer_id",label:"Customer ID"}],collectAdditionalContact:l=true,labels:u={},classNames:e,unstyled:p=false})=>{var x;let[R,T]=react.useState(""),[$,I]=react.useState(""),[j,V]=react.useState(""),[O,q]=react.useState(""),[_,L]=react.useState(((x=M[0])==null?void 0:x.id)||""),[N,K]=react.useState(""),[C,A]=react.useState({}),[ee,W]=react.useState(false),[D,te]=react.useState({}),h=S.find(t=>t.id===R),z=t=>{T(t.target.value),A({});},f=(t,a)=>{A(v=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},v),{[t]:a}));},i=()=>{let t={};return $.trim()||(t.fullName="Full name is required"),j.trim()?/\S+@\S+\.\S+/.test(j)||(t.email="Email is invalid"):t.email="Email is required",R||(t.requestType="Please select a request type"),J&&!N.trim()&&(t.identifierValue="Identifier value is required"),h!=null&&h.requiresAdditionalInfo&&h.additionalFields&&h.additionalFields.forEach(a=>{a.required&&!C[a.id]&&(t[`additional_${a.id}`]=`${a.label} is required`);}),te(t),Object.keys(t).length===0},m=t=>{if(t.preventDefault(),!i())return;let a={requestType:R,dataSubject:{fullName:$,email:j,phone:O||void 0,identifierType:_,identifierValue:N},additionalInfo:Object.keys(C).length>0?C:void 0,submittedAt:Date.now()};E(a),G&&W(true);};return ee?jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`p-4 bg-green-50 dark:bg-green-900/20 rounded-md ${X}`,e==null?void 0:e.successMessage,p),children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-lg font-bold text-green-800 dark:text-green-200 mb-2",e==null?void 0:e.title,p),children:"Request Submitted"}),jsxRuntime.jsx("p",{className:chunkVURIXCGY_js.a("text-green-700 dark:text-green-300",e==null?void 0:e.description,p),children:Z}),jsxRuntime.jsx("button",{onClick:()=>W(false),className:chunkVURIXCGY_js.a(`mt-4 px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${Y}`,e==null?void 0:e.submitButton,p),children:"Submit Another Request"})]}):jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${X}`,e==null?void 0:e.root,p),children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-xl font-bold mb-2",e==null?void 0:e.title,p),children:U}),jsxRuntime.jsx("p",{className:chunkVURIXCGY_js.a("mb-6 text-gray-600 dark:text-gray-300",e==null?void 0:e.description,p),children:H}),jsxRuntime.jsx("form",{onSubmit:m,className:chunkVURIXCGY_js.a("",e==null?void 0:e.form,p),children:jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("space-y-4",e==null?void 0:e.fieldGroup,p),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Personal Information"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"fullName",className:chunkVURIXCGY_js.a("block text-sm font-medium mb-1",e==null?void 0:e.label,p),children:[u.name||"Full Name"," ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"fullName",value:$,onChange:t=>I(t.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.input,p),required:true}),D.fullName&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:D.fullName})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"email",className:chunkVURIXCGY_js.a("block text-sm font-medium mb-1",e==null?void 0:e.label,p),children:[u.email||"Email Address"," ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"email",id:"email",value:j,onChange:t=>V(t.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.input,p),required:true}),D.email&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:D.email})]}),l&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"phone",className:chunkVURIXCGY_js.a("block text-sm font-medium mb-1",e==null?void 0:e.label,p),children:"Phone Number (Optional)"}),jsxRuntime.jsx("input",{type:"tel",id:"phone",value:O,onChange:t=>q(t.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.input,p)})]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Request Details"}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsxs("label",{htmlFor:"requestType",className:chunkVURIXCGY_js.a("block text-sm font-medium mb-1",e==null?void 0:e.label,p),children:[u.requestType||"Request Type"," ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsxs("select",{id:"requestType",value:R,onChange:z,className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.select,p),required:true,children:[jsxRuntime.jsx("option",{value:"",children:"Select a request type"}),S.map(t=>jsxRuntime.jsx("option",{value:t.id,children:t.name},t.id))]}),D.requestType&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:D.requestType})]}),h&&jsxRuntime.jsxs("div",{className:"mb-4 p-3 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-2",children:h.description}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Estimated completion time: ",h.estimatedCompletionTime," ",h.estimatedCompletionTime===1?"day":"days"]})]}),jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("label",{htmlFor:"requestDescription",className:chunkVURIXCGY_js.a("block text-sm font-medium mb-1",e==null?void 0:e.label,p),children:u.description||"Additional Information"}),jsxRuntime.jsx("textarea",{id:"requestDescription",className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.textarea,p),rows:4,placeholder:"Please provide any additional details that might help us process your request"})]})]}),J&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Identity Verification"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 mb-3",children:"To protect your privacy, we need to verify your identity before processing your request."}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"identifierType",className:chunkVURIXCGY_js.a("block text-sm font-medium mb-1",e==null?void 0:e.label,p),children:["Identifier Type ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("select",{id:"identifierType",value:_,onChange:t=>L(t.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.select,p),required:true,children:M.map(t=>jsxRuntime.jsx("option",{value:t.id,children:t.label},t.id))})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:"identifierValue",className:chunkVURIXCGY_js.a("block text-sm font-medium mb-1",e==null?void 0:e.label,p),children:["Identifier Value ",jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("input",{type:"text",id:"identifierValue",value:N,onChange:t=>K(t.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.input,p),required:true}),D.identifierValue&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:D.identifierValue})]})]})]}),(h==null?void 0:h.requiresAdditionalInfo)&&h.additionalFields&&h.additionalFields.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Additional Information"}),jsxRuntime.jsx("div",{className:"space-y-4",children:h.additionalFields.map(t=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:t.id,className:chunkVURIXCGY_js.a("block text-sm font-medium mb-1",e==null?void 0:e.label,p),children:[t.label," ",t.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),t.type==="text"&&jsxRuntime.jsx("input",{type:"text",id:t.id,value:C[t.id]||"",onChange:a=>f(t.id,a.target.value),placeholder:t.placeholder,className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.input,p),required:t.required}),t.type==="textarea"&&jsxRuntime.jsx("textarea",{id:t.id,value:C[t.id]||"",onChange:a=>f(t.id,a.target.value),placeholder:t.placeholder,className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.textarea,p),rows:4,required:t.required}),t.type==="select"&&t.options&&jsxRuntime.jsxs("select",{id:t.id,value:C[t.id]||"",onChange:a=>f(t.id,a.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.select,p),required:t.required,children:[jsxRuntime.jsx("option",{value:"",children:t.placeholder||"Select an option"}),t.options.map(a=>jsxRuntime.jsx("option",{value:a,children:a},a))]}),t.type==="checkbox"&&jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{type:"checkbox",id:t.id,checked:!!C[t.id],onChange:a=>f(t.id,a.target.checked),className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",required:t.required})}),jsxRuntime.jsx("div",{className:"ml-3 text-sm",children:jsxRuntime.jsx("label",{htmlFor:t.id,className:"text-gray-700 dark:text-gray-300",children:t.placeholder||t.label})})]}),t.type==="file"&&jsxRuntime.jsx("input",{type:"file",id:t.id,onChange:a=>{var w;let v=(w=a.target.files)==null?void 0:w[0];v&&f(t.id,v);},className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",e==null?void 0:e.input,p),required:t.required}),D[`additional_${t.id}`]&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-500",children:D[`additional_${t.id}`]})]},t.id))})]}),jsxRuntime.jsxs("div",{className:"mt-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold mb-2",children:"Privacy Notice"}),jsxRuntime.jsx("p",{className:"text-xs text-gray-600 dark:text-gray-300",children:"The information you provide in this form will be used solely for the purpose of processing your data subject request. We will retain this information for as long as necessary to fulfill your request and to comply with our legal obligations. For more information, please refer to our Privacy Policy."})]}),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{type:"submit",className:chunkVURIXCGY_js.a(`px-6 py-3 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${Y}`,e==null?void 0:e.submitButton,p),children:u.submit||Q})})]})})]})};var ye=({requests:S,onSelectRequest:E,onUpdateStatus:U,onAssignRequest:H,title:Q="Data Subject Request Dashboard",description:X="Track and manage data subject requests in compliance with NDPA requirements.",className:Y="",buttonClassName:G="",showRequestDetails:Z=true,showRequestTimeline:J=true,showDeadlineAlerts:M=true,assignees:l=[],classNames:u,unstyled:e=false})=>{let[p,R]=react.useState(null),[T,$]=react.useState(S),[I,j]=react.useState("all"),[V,O]=react.useState("all"),[q,_]=react.useState(""),[L,N]=react.useState("createdAt"),[K,C]=react.useState("desc"),[A,ee]=react.useState("");react.useEffect(()=>{let r=[...S];if(I!=="all"&&(r=r.filter(n=>n.status===I)),V!=="all"&&(r=r.filter(n=>n.type===V)),q){let n=q.toLowerCase();r=r.filter(k=>k.subject.name.toLowerCase().includes(n)||k.subject.email.toLowerCase().includes(n)||k.description&&k.description.toLowerCase().includes(n));}r.sort((n,k)=>{let P=0;switch(L){case "createdAt":P=n.createdAt-k.createdAt;break;case "dueDate":P=(n.dueDate||0)-(k.dueDate||0);break;case "type":P=n.type.localeCompare(k.type);break;case "status":P=n.status.localeCompare(k.status);break;default:P=n.createdAt-k.createdAt;}return K==="asc"?P:-P}),$(r);},[S,I,V,q,L,K]),react.useEffect(()=>{T.length>0&&!p&&R(T[0].id);},[T,p]);let W=r=>{R(r),E&&E(r);},D=r=>{p&&U&&U(p,r);},te=()=>{p&&A&&H&&(H(p,A),ee(""));},h=r=>new Date(r).toLocaleDateString(),z=r=>{let n=Date.now(),k=(r-n)/(1440*60*1e3);return Math.ceil(k)},f=p?S.find(r=>r.id===p):null,i=r=>{let n={information:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",access:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",rectification:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",erasure:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",restriction:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",portability:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",objection:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",automated_decision_making:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},k={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${n[r]}`,children:k[r]})},m=r=>jsxRuntime.jsx("span",{className:chunkVURIXCGY_js.a(`px-2 py-1 rounded text-xs font-medium ${{pending:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",inProgress:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",completed:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",rejected:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",awaitingVerification:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200"}[r]}`,u==null?void 0:u.statusBadge,e),children:r==="inProgress"?"In Progress":r==="awaitingVerification"?"Awaiting Verification":r.charAt(0).toUpperCase()+r.slice(1)}),x=r=>{if(!r.dueDate)return null;let n=z(r.dueDate);return n<=0?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Deadline Passed"}),jsxRuntime.jsx("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:"The response deadline has passed. Immediate action is required."})]}):n<=3?jsxRuntime.jsxs("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-red-800 dark:text-red-200 font-medium",children:"Urgent: Deadline Approaching"}),jsxRuntime.jsxs("p",{className:"text-xs text-red-700 dark:text-red-300 mt-1",children:["Only ",n," day",n!==1?"s":""," remaining until the response deadline."]})]}):n<=7?jsxRuntime.jsxs("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 font-medium",children:"Deadline Approaching"}),jsxRuntime.jsxs("p",{className:"text-xs text-yellow-700 dark:text-yellow-300 mt-1",children:[n," days remaining until the response deadline."]})]}):jsxRuntime.jsxs("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-md",children:[jsxRuntime.jsx("p",{className:"text-sm text-green-800 dark:text-green-200 font-medium",children:"Deadline Tracking"}),jsxRuntime.jsxs("p",{className:"text-xs text-green-700 dark:text-green-300 mt-1",children:[n," days remaining until the response deadline."]})]})},t=r=>{let n=[{title:"Request Received",date:r.createdAt,completed:true,description:`Request was received on ${h(r.createdAt)}.`}];return r.verifiedAt?n.push({title:"Identity Verified",date:r.verifiedAt,completed:true,description:`Data subject's identity was verified on ${h(r.verifiedAt)}.`}):r.status==="awaitingVerification"&&n.push({title:"Identity Verification",date:Date.now(),completed:false,description:"Awaiting verification of data subject's identity."}),(r.status==="inProgress"||r.status==="completed"||r.status==="rejected")&&n.push({title:"Processing Started",date:r.updatedAt,completed:true,description:`Request processing started on ${h(r.updatedAt)}.`}),r.status==="completed"?n.push({title:"Request Completed",date:r.completedAt||Date.now(),completed:true,description:`Request was completed on ${h(r.completedAt||Date.now())}.`}):r.status==="rejected"&&n.push({title:"Request Rejected",date:r.completedAt||Date.now(),completed:true,description:`Request was rejected on ${h(r.completedAt||Date.now())}.${r.rejectionReason?` Reason: ${r.rejectionReason}`:""}`}),r.dueDate&&n.push({title:"Response Deadline",date:r.dueDate,completed:Date.now()>r.dueDate,description:`Response is due by ${h(r.dueDate)}.`}),jsxRuntime.jsxs("div",{className:"mt-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Request Timeline"}),jsxRuntime.jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:n.map((k,P)=>jsxRuntime.jsxs("li",{className:"mb-6 ml-4",children:[jsxRuntime.jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${k.completed?"bg-green-500 border-green-500 dark:border-green-500":"bg-gray-200 border-gray-200 dark:bg-gray-700 dark:border-gray-700"}`}),jsxRuntime.jsx("time",{className:"mb-1 text-sm font-normal leading-none text-gray-400 dark:text-gray-500",children:k.date?h(k.date):"Pending"}),jsxRuntime.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-white",children:k.title}),jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:k.description})]},P))})]})},a=()=>[{value:"all",label:"All Types"},{value:"information",label:"Information (NDPA Section 29)"},{value:"access",label:"Access (NDPA Section 30)"},{value:"rectification",label:"Rectification (NDPA Section 31)"},{value:"erasure",label:"Erasure (NDPA Section 32)"},{value:"restriction",label:"Restriction (NDPA Section 33)"},{value:"portability",label:"Portability (NDPA Section 34)"},{value:"objection",label:"Objection (NDPA Section 35)"},{value:"automated_decision_making",label:"Automated Decision-Making (NDPA Section 36)"}].map(n=>jsxRuntime.jsx("option",{value:n.value,children:n.label},n.value)),v=()=>[{value:"all",label:"All Statuses"},{value:"pending",label:"Pending"},{value:"awaitingVerification",label:"Awaiting Verification"},{value:"inProgress",label:"In Progress"},{value:"completed",label:"Completed"},{value:"rejected",label:"Rejected"}].map(n=>jsxRuntime.jsx("option",{value:n.value,children:n.label},n.value)),w=()=>[{value:"pending",label:"Pending"},{value:"awaitingVerification",label:"Awaiting Verification"},{value:"inProgress",label:"In Progress"},{value:"completed",label:"Completed"},{value:"rejected",label:"Rejected"}].map(n=>jsxRuntime.jsx("option",{value:n.value,children:n.label},n.value));return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Y}`,u==null?void 0:u.root,e),children:[jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("",u==null?void 0:u.header,e),children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-xl font-bold mb-2",u==null?void 0:u.title,e),children:Q}),jsxRuntime.jsx("p",{className:"mb-6 text-gray-600 dark:text-gray-300",children:X})]}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("mb-6 grid grid-cols-1 md:grid-cols-4 gap-4",u==null?void 0:u.filters,e),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"statusFilter",className:"block text-sm font-medium mb-1",children:"Status Filter"}),jsxRuntime.jsx("select",{id:"statusFilter",value:I,onChange:r=>j(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:v()})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"typeFilter",className:"block text-sm font-medium mb-1",children:"Request Type Filter"}),jsxRuntime.jsx("select",{id:"typeFilter",value:V,onChange:r=>O(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:a()})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"sortBy",className:"block text-sm font-medium mb-1",children:"Sort By"}),jsxRuntime.jsxs("select",{id:"sortBy",value:L,onChange:r=>N(r.target.value),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:[jsxRuntime.jsx("option",{value:"createdAt",children:"Date Received"}),jsxRuntime.jsx("option",{value:"dueDate",children:"Due Date"}),jsxRuntime.jsx("option",{value:"type",children:"Request Type"}),jsxRuntime.jsx("option",{value:"status",children:"Status"})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"searchTerm",className:"block text-sm font-medium mb-1",children:"Search"}),jsxRuntime.jsx("input",{type:"text",id:"searchTerm",value:q,onChange:r=>_(r.target.value),placeholder:"Search requests...",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxRuntime.jsxs("div",{className:"md:col-span-1",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"DSR Requests"}),T.length===0?jsxRuntime.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No data subject requests found."}):jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("space-y-2 max-h-96 overflow-y-auto pr-2",u==null?void 0:u.requestList,e),children:T.map(r=>{let n=r.dueDate?z(r.dueDate):null,k=null;return n!==null&&(n<=0?k=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400 font-bold",children:"Overdue"}):n<=3?k=jsxRuntime.jsx("span",{className:"text-xs text-red-600 dark:text-red-400",children:"Urgent"}):n<=7&&(k=jsxRuntime.jsx("span",{className:"text-xs text-yellow-600 dark:text-yellow-400",children:"Soon"}))),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`p-3 rounded-md cursor-pointer ${p===r.id?"bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800":"bg-gray-50 dark:bg-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600"}`,u==null?void 0:u.requestItem,e),onClick:()=>W(r.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:r.subject.name}),i(r.type)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:r.subject.email}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:["Received: ",h(r.createdAt)]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsxRuntime.jsx("div",{children:m(r.status)}),jsxRuntime.jsx("div",{children:k})]})]},r.id)})})]}),jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("md:col-span-2",u==null?void 0:u.detailPanel,e),children:f?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium",children:f.subject.name}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[i(f.type),m(f.status)]})]}),M&&f.dueDate&&jsxRuntime.jsx("div",{className:"mb-4",children:x(f)}),Z&&jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Email:"})," ",f.subject.email]}),f.subject.phone&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Phone:"})," ",f.subject.phone]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Received:"})," ",h(f.createdAt)]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Request Type:"})," ",{information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"}[f.type]||f.type]}),jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Status:"})," ",f.status==="inProgress"?"In Progress":f.status==="awaitingVerification"?"Awaiting Verification":f.status.charAt(0).toUpperCase()+f.status.slice(1)]}),f.dueDate&&jsxRuntime.jsxs("p",{className:"text-sm",children:[jsxRuntime.jsx("span",{className:"font-medium",children:"Due Date:"})," ",h(f.dueDate)]})]})]}),f.description&&jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Request Details:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:f.description})]}),f.additionalInfo&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Additional Information:"}),jsxRuntime.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300 bg-gray-50 dark:bg-gray-700 p-2 rounded-md mt-1",children:typeof f.additionalInfo=="object"?JSON.stringify(f.additionalInfo,null,2):String(f.additionalInfo||"No additional information provided")})]})]}),jsxRuntime.jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-md font-medium mb-2",children:"Update Status"}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsx("select",{value:f.status,onChange:r=>D(r.target.value),className:"flex-grow px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:w()}),jsxRuntime.jsx("button",{onClick:()=>D(f.status),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${G}`,children:"Update"})]})]}),l.length>0&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-md font-medium mb-2",children:"Assign Request"}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsxs("select",{value:A,onChange:r=>ee(r.target.value),className:"flex-grow px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:[jsxRuntime.jsx("option",{value:"",children:"Select Assignee"}),l.map(r=>jsxRuntime.jsx("option",{value:r,children:r},r))]}),jsxRuntime.jsx("button",{onClick:te,disabled:!A,className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:bg-gray-300 disabled:text-gray-500 ${G}`,children:"Assign"})]})]})]}),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Request Summary"}),jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-3 rounded-md",children:jsxRuntime.jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:jsxRuntime.jsx("pre",{children:JSON.stringify(chunkCMZTI7SG_js.a(f),null,2)})})})]}),J&&t(f)]}):jsxRuntime.jsx("div",{className:"flex items-center justify-center h-64 bg-gray-50 dark:bg-gray-700 rounded-md",children:jsxRuntime.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"Select a request to view details"})})})]})]})};var Se=({requests:S,onSelectRequest:E,title:U="DSR Request Tracker",description:H="Track the status and progress of data subject requests.",className:Q="",buttonClassName:X="",showSummaryStats:Y=true,showTypeBreakdown:G=true,showStatusBreakdown:Z=true,showTimelineChart:J=true,showOverdueRequests:M=true,classNames:l,unstyled:u=false})=>{let[e,p]=react.useState("30days"),[R,T]=react.useState(S),[$,I]=react.useState([]),[j,V]=react.useState([]);react.useEffect(()=>{let i=Date.now(),m;switch(e){case "7days":m=S.filter(a=>i-a.createdAt<=10080*60*1e3);break;case "30days":m=S.filter(a=>i-a.createdAt<=720*60*60*1e3);break;case "90days":m=S.filter(a=>i-a.createdAt<=2160*60*60*1e3);break;default:m=[...S];}T(m);let x=m.filter(a=>a.dueDate&&i>a.dueDate&&a.status!=="completed"&&a.status!=="rejected");I(x);let t=m.filter(a=>a.dueDate&&i<a.dueDate&&a.dueDate-i<=10080*60*1e3&&a.status!=="completed"&&a.status!=="rejected");V(t);},[S,e]);let O=i=>{E&&E(i);},q=i=>new Date(i).toLocaleDateString(),_=i=>{let m=Date.now(),x=(i-m)/(1440*60*1e3);return Math.ceil(x)},L=()=>{let i=R.filter(x=>x.status==="completed"&&x.completedAt&&x.createdAt);if(i.length===0)return null;let m=i.reduce((x,t)=>{let a=((t.completedAt||0)-t.createdAt)/864e5;return x+a},0);return Number((m/i.length).toFixed(1))},N=()=>{let i=R.filter(x=>(x.status==="completed"||x.status==="rejected")&&x.completedAt&&x.dueDate);if(i.length===0)return null;let m=i.filter(x=>(x.completedAt||0)<=(x.dueDate||0));return Math.round(m.length/i.length*100)},K=()=>{let i={};return R.forEach(m=>{i[m.type]=(i[m.type]||0)+1;}),{information:i.information||0,access:i.access||0,rectification:i.rectification||0,erasure:i.erasure||0,restriction:i.restriction||0,portability:i.portability||0,objection:i.objection||0,automated_decision_making:i.automated_decision_making||0}},C=()=>{let i={};return R.forEach(m=>{i[m.status]=(i[m.status]||0)+1;}),{pending:i.pending||0,awaitingVerification:i.awaitingVerification||0,inProgress:i.inProgress||0,completed:i.completed||0,rejected:i.rejected||0}},A=i=>{let m={information:"bg-teal-100 text-teal-800 dark:bg-teal-900 dark:text-teal-200",access:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",rectification:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",erasure:"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",restriction:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",portability:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",objection:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",automated_decision_making:"bg-indigo-100 text-indigo-800 dark:bg-indigo-900 dark:text-indigo-200"},x={information:"Information",access:"Access",rectification:"Rectification",erasure:"Erasure",restriction:"Restriction",portability:"Portability",objection:"Objection",automated_decision_making:"Automated Decision-Making"};return jsxRuntime.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${m[i]}`,children:x[i]})},W=()=>{let i=R.length,m=R.filter(v=>v.status!=="completed"&&v.status!=="rejected").length;R.filter(v=>v.status==="completed"||v.status==="rejected").length;let t=L(),a=N();return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",l==null?void 0:l.stats,u),children:[jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",l==null?void 0:l.statCard,u),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Total Requests"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:i})]}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",l==null?void 0:l.statCard,u),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Pending Requests"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:m})]}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",l==null?void 0:l.statCard,u),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Avg. Response Time"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:t!==null?`${t} days`:"N/A"})]}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow",l==null?void 0:l.statCard,u),children:[jsxRuntime.jsx("h4",{className:"text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:"Compliance Rate"}),jsxRuntime.jsx("p",{className:"text-2xl font-bold",children:a!==null?`${a}%`:"N/A"})]})]})},D=()=>{let i=K(),m=R.length,x=Object.entries(i).sort(([,t],[,a])=>a-t).map(([t])=>t);return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",l==null?void 0:l.table,u),children:[jsxRuntime.jsx("h3",{className:chunkVURIXCGY_js.a("text-lg font-medium mb-4",l==null?void 0:l.tableHeader,u),children:"Request Types"}),m===0?jsxRuntime.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxRuntime.jsx("div",{className:"space-y-4",children:x.map(t=>{let a=i[t],v=Math.round(a/m*100);return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-1",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[A(t),jsxRuntime.jsxs("span",{className:"ml-2 text-sm",children:[a," requests"]})]}),jsxRuntime.jsxs("span",{className:"text-sm font-medium",children:[v,"%"]})]}),jsxRuntime.jsx("div",{className:"w-full bg-gray-200 dark:bg-gray-600 rounded-full h-2.5",children:jsxRuntime.jsx("div",{className:"bg-blue-600 h-2.5 rounded-full",style:{width:`${v}%`}})})]},t)})})]})},te=()=>{let i=C(),m=R.length,x=["pending","awaitingVerification","inProgress","completed","rejected"],t={pending:"bg-yellow-500",awaitingVerification:"bg-purple-500",inProgress:"bg-blue-500",completed:"bg-green-500",rejected:"bg-red-500"};return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",l==null?void 0:l.table,u),children:[jsxRuntime.jsx("h3",{className:chunkVURIXCGY_js.a("text-lg font-medium mb-4",l==null?void 0:l.tableHeader,u),children:"Request Status"}),m===0?jsxRuntime.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"flex h-4 mb-2",children:x.map(a=>{let v=i[a],w=v/m*100;return w>0?jsxRuntime.jsx("div",{className:`${t[a]} first:rounded-l-full last:rounded-r-full`,style:{width:`${w}%`},title:`${a}: ${v} (${Math.round(w)}%)`},a):null})}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-2 mt-4",children:x.map(a=>{let v=i[a],w=Math.round(v/m*100);return jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("div",{className:`w-3 h-3 rounded-full ${t[a]} mr-2`}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs font-medium",children:a==="inProgress"?"In Progress":a==="awaitingVerification"?"Awaiting Verification":a.charAt(0).toUpperCase()+a.slice(1)}),jsxRuntime.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:[v," (",w,"%)"]})]})]},a)})})]})]})},h=()=>{let i={};R.forEach(v=>{let w=new Date(v.createdAt),r=`${w.getFullYear()}-${String(w.getMonth()+1).padStart(2,"0")}`;i[r]=(i[r]||0)+1;});let x=Object.keys(i).sort().slice(-6),t=Math.max(...Object.values(i).filter(v=>v>0),1),a=v=>{let[w,r]=v.split("-");return `${r}/${w.slice(2)}`};return jsxRuntime.jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Request Timeline"}),x.length===0?jsxRuntime.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No data available for the selected timeframe."}):jsxRuntime.jsxs("div",{className:"h-40",children:[jsxRuntime.jsx("div",{className:"flex h-32 items-end justify-between space-x-2",children:x.map(v=>{let w=i[v],r=`${w/t*100}%`;return jsxRuntime.jsx("div",{className:"flex flex-col items-center flex-1",children:jsxRuntime.jsx("div",{className:"w-full bg-blue-500 rounded-t",style:{height:r},title:`${a(v)}: ${w} requests`})},v)})}),jsxRuntime.jsx("div",{className:"flex justify-between mt-2",children:x.map(v=>jsxRuntime.jsx("div",{className:"text-xs text-center",children:a(v)},v))})]})]})},z=()=>jsxRuntime.jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Overdue Requests"}),$.length===0?jsxRuntime.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No overdue requests."}):jsxRuntime.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:$.map(i=>jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("p-3 bg-red-50 dark:bg-red-900/20 rounded-md cursor-pointer hover:bg-red-100 dark:hover:bg-red-900/30",l==null?void 0:l.tableRow,u),onClick:()=>O(i.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:i.subject.name}),A(i.type)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:i.subject.email}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:["Due: ",q(i.dueDate||0)]}),jsxRuntime.jsxs("p",{className:"text-xs font-bold text-red-600 dark:text-red-400",children:["Overdue by ",Math.abs(_(i.dueDate||0))," days"]})]})]},i.id))})]}),f=()=>jsxRuntime.jsxs("div",{className:"bg-white dark:bg-gray-700 p-4 rounded-lg shadow mb-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Upcoming Deadlines"}),j.length===0?jsxRuntime.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"No upcoming deadlines in the next 7 days."}):jsxRuntime.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:j.map(i=>{let m=_(i.dueDate||0);return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("p-3 bg-yellow-50 dark:bg-yellow-900/20 rounded-md cursor-pointer hover:bg-yellow-100 dark:hover:bg-yellow-900/30",l==null?void 0:l.tableRow,u),onClick:()=>O(i.id),children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-sm",children:i.subject.name}),A(i.type)]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:i.subject.email}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsxs("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:["Due: ",q(i.dueDate||0)]}),jsxRuntime.jsxs("p",{className:`text-xs font-bold ${m<=3?"text-red-600 dark:text-red-400":"text-yellow-600 dark:text-yellow-400"}`,children:["Due in ",m," days"]})]})]},i.id)})})]});return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${Q}`,l==null?void 0:l.root,u),children:[jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("flex flex-col md:flex-row md:justify-between md:items-center mb-6",l==null?void 0:l.header,u),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-xl font-bold mb-2",l==null?void 0:l.title,u),children:U}),jsxRuntime.jsx("p",{className:"text-gray-600 dark:text-gray-300",children:H})]}),jsxRuntime.jsxs("div",{className:"mt-4 md:mt-0",children:[jsxRuntime.jsx("label",{htmlFor:"timeframe",className:"block text-sm font-medium mb-1",children:"Timeframe"}),jsxRuntime.jsxs("select",{id:"timeframe",value:e,onChange:i=>p(i.target.value),className:"px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:[jsxRuntime.jsx("option",{value:"7days",children:"Last 7 Days"}),jsxRuntime.jsx("option",{value:"30days",children:"Last 30 Days"}),jsxRuntime.jsx("option",{value:"90days",children:"Last 90 Days"}),jsxRuntime.jsx("option",{value:"all",children:"All Time"})]})]})]}),Y&&W(),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[jsxRuntime.jsxs("div",{children:[G&&D(),Z&&te()]}),jsxRuntime.jsxs("div",{children:[J&&h(),M&&z(),M&&f()]})]})]})};exports.a=ge;exports.b=ye;exports.c=Se;//# sourceMappingURL=chunk-N52S64SU.js.map
2
+ //# sourceMappingURL=chunk-N52S64SU.js.map
@@ -0,0 +1,94 @@
1
+ import {a as a$2}from'./chunk-UYP64PV7.mjs';import {a}from'./chunk-FDB6KZUD.mjs';import {d,b,a as a$1}from'./chunk-WWT2ZSNU.mjs';import {useState,useEffect}from'react';import {jsxs,jsx}from'react/jsx-runtime';var ge=({sections:P,variables:R,onGenerate:S,title:q="NDPA Privacy Policy Generator",description:H="Generate an NDPA-compliant privacy policy for your organization.",className:N="",buttonClassName:L="",generateButtonText:z="Generate Policy",showPreview:A=true,allowEditing:G=true,classNames:t,unstyled:f=false})=>{let[T,U]=useState(P),[d,r]=useState(R),[g,C]=useState("sections"),[E,Y]=useState(""),[F,D]=useState(""),[I,V]=useState(false),[v,W]=useState({});useEffect(()=>{U(P);},[P]),useEffect(()=>{r(R);},[R]);let u=n=>{U(b$1=>b$1.map(c=>c.id===n?b(a$1({},c),{included:!c.included}):c));},s=(n,b$1)=>{r(c=>c.map(m=>m.id===n?b(a$1({},m),{value:b$1}):m)),v[n]&&W(c=>{let m=a$1({},c);return delete m[n],m});},y=()=>{let n={},b=true;return d.forEach(c=>{c.required&&!c.value&&(n[c.id]=`${c.name} is required`,b=false);}),W(n),b},k=()=>{if(!y()){C("variables");return}let n=T.filter(m=>m.included),b=Object.fromEntries(d.map(m=>[m.name,m.value])),c="";n.forEach(m=>{c+=`## ${m.title}
2
+
3
+ `,c+=a$2(m.template,b),c+=`
4
+
5
+ `;}),Y(c),D(c),V(true),C("preview");},B=()=>{S({sections:T,variables:d,content:G?F:E});},j=()=>jsxs("div",{className:a("space-y-4",t==null?void 0:t.sectionList,f),children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Select Policy Sections"}),T.map(n=>jsx("div",{className:a("border border-gray-200 dark:border-gray-700 rounded-md p-4",t==null?void 0:t.sectionItem,f),children:jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:`section-${n.id}`,type:"checkbox",checked:n.included,onChange:()=>u(n.id),disabled:n.required,className:a("w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600",t==null?void 0:t.input,f)})}),jsxs("div",{className:"ml-3 text-sm",children:[jsxs("label",{htmlFor:`section-${n.id}`,className:"font-medium text-gray-900 dark:text-white",children:[n.title," ",n.required&&jsx("span",{className:"text-red-500",children:"*"})]}),n.description&&jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:n.description})]})]})},n.id)),jsx("div",{className:"mt-6",children:jsx("button",{onClick:()=>C("variables"),className:a(`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${L}`,t==null?void 0:t.generateButton,f),children:"Next: Fill Variables"})})]}),_=()=>{let n={};return d.forEach(b=>{let c=b.id.split(".")[0];n[c]||(n[c]=[]),n[c].push(b);}),jsxs("div",{className:a("",t==null?void 0:t.form,f),children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Fill Policy Variables"}),jsx("div",{className:"space-y-6",children:Object.entries(n).map(([b,c])=>{let m=T.find(e=>e.id===b);return m&&!m.included?null: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:m?m.title:"General Information"}),jsx("div",{className:"space-y-4",children:c.map(e=>jsxs("div",{children:[jsxs("label",{htmlFor:`var-${e.id}`,className:"block text-sm font-medium mb-1",children:[e.name," ",e.required&&jsx("span",{className:"text-red-500",children:"*"})]}),e.description&&jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:e.description}),e.inputType==="textarea"?jsx("textarea",{id:`var-${e.id}`,value:e.value,onChange:p=>s(e.id,p.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-blue-500"} rounded-md focus:outline-none focus:ring-2`,t==null?void 0:t.input,f),required:e.required}):e.inputType==="select"&&e.options?jsxs("select",{id:`var-${e.id}`,value:e.value,onChange:p=>s(e.id,p.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-blue-500"} rounded-md focus:outline-none focus:ring-2`,t==null?void 0:t.input,f),required:e.required,children:[jsx("option",{value:"",children:"Select an option"}),e.options.map(p=>jsx("option",{value:p,children:p},p))]}):jsx("input",{id:`var-${e.id}`,type:e.inputType,value:e.value,onChange:p=>s(e.id,p.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-blue-500"} rounded-md focus:outline-none focus:ring-2`,t==null?void 0:t.input,f),required:e.required}),v[e.id]&&jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-500",children:v[e.id]})]},e.id))})]},b)})}),jsxs("div",{className:"mt-6 flex space-x-4",children:[jsx("button",{onClick:()=>C("sections"),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${L}`,children:"Back to Sections"}),jsx("button",{onClick:k,className:a(`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${L}`,t==null?void 0:t.generateButton,f),children:z})]})]})},Z=()=>jsxs("div",{children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Preview Generated Policy"}),G?jsxs("div",{className:"mb-4",children:[jsx("label",{htmlFor:"policy-content",className:"block text-sm font-medium mb-1",children:"Edit Policy Content"}),jsx("textarea",{id:"policy-content",value:F,onChange:n=>D(n.target.value),rows:20,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono text-sm"})]}):jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4",children:jsx("div",{className:"prose dark:prose-invert max-w-none",children:E.split(`
6
+ `).map((n,b)=>n.startsWith("## ")?jsx("h2",{className:"text-xl font-bold mt-6 mb-3",children:n.substring(3)},b):n.startsWith("### ")?jsx("h3",{className:"text-lg font-bold mt-4 mb-2",children:n.substring(4)},b):n===""?jsx("br",{},b):jsx("p",{className:"mb-2",children:n},b))})}),jsxs("div",{className:"mt-6 flex space-x-4",children:[jsx("button",{onClick:()=>C("variables"),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${L}`,children:"Back to Variables"}),jsx("button",{onClick:B,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${L}`,children:"Save Policy"})]})]}),J=()=>{switch(g){case "sections":return j();case "variables":return _();case "preview":return Z();default:return j()}};return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${N}`,t==null?void 0:t.root,f),children:[jsxs("div",{className:a("mb-6",t==null?void 0:t.header,f),children:[jsx("h2",{className:a("text-xl font-bold mb-2",t==null?void 0:t.title,f),children:q}),jsx("p",{className:a("text-gray-600 dark:text-gray-300",t==null?void 0:t.description,f),children:H})]}),jsx("div",{className:"mb-8",children:jsxs("ol",{className:"flex items-center w-full",children:[jsxs("li",{className:`flex w-full items-center ${g==="sections"?"text-blue-600 dark:text-blue-500":"text-gray-500 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsx("span",{className:`flex items-center justify-center w-8 h-8 ${g==="sections"?"bg-blue-100 dark:bg-blue-800":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"1"}),jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Sections"})]}),jsxs("li",{className:`flex w-full items-center ${g==="variables"?"text-blue-600 dark:text-blue-500":"text-gray-500 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsx("span",{className:`flex items-center justify-center w-8 h-8 ${g==="variables"?"bg-blue-100 dark:bg-blue-800":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"2"}),jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Variables"})]}),jsxs("li",{className:`flex items-center ${g==="preview"?"text-blue-600 dark:text-blue-500":"text-gray-500 dark:text-gray-400"}`,children:[jsx("span",{className:`flex items-center justify-center w-8 h-8 ${g==="preview"?"bg-blue-100 dark:bg-blue-800":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"3"}),jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Preview"})]})]})}),jsxs("div",{className:a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",t==null?void 0:t.complianceNotice,f),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."})]}),J()]})};var he=({content:P,sections:R,variables:S,onExport:q,onEdit:H,title:N="Privacy Policy Preview",description:L="Preview your NDPA-compliant privacy policy before exporting.",className:z="",buttonClassName:A="",showExportOptions:G=true,showEditButton:t=true,showTableOfContents:f=true,showMetadata:T=true,organizationName:U,lastUpdated:d=new Date,classNames:r,unstyled:g=false})=>{let[C,E]=useState("preview"),F=(()=>{let u=P.split(`
7
+ `),s=[];return u.forEach(y=>{if(y.startsWith("## ")){let k=y.substring(3).trim(),B=k.toLowerCase().replace(/[^a-z0-9]+/g,"-");s.push({id:B,title:k,level:2});}else if(y.startsWith("### ")){let k=y.substring(4).trim(),B=k.toLowerCase().replace(/[^a-z0-9]+/g,"-");s.push({id:B,title:k,level:3});}}),s})(),D=u=>{if(q)q(u);else if(u==="markdown"){let s=document.createElement("a"),y=new Blob([P],{type:"text/markdown"});s.href=URL.createObjectURL(y),s.download=`privacy-policy-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(s),s.click(),document.body.removeChild(s);}},I=()=>!f||F.length===0?null:jsxs("div",{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:F.map((u,s)=>jsx("li",{style:{marginLeft:`${(u.level-2)*1.5}rem`},children:jsx("a",{href:`#${u.id}`,className:"text-blue-600 dark:text-blue-400 hover:underline",children:u.title})},s))})]}),V=()=>T?jsxs("div",{className:"mb-6",children:[jsx("h1",{className:"text-2xl font-bold mb-2",children:U?`${U} Privacy Policy`:"Privacy Policy"}),jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Last Updated: ",d.toLocaleDateString()]})]}):null,v=()=>jsx("div",{className:a("prose dark:prose-invert max-w-none",r==null?void 0:r.sectionContent,g),children:P.split(`
8
+ `).map((u,s)=>{if(u.startsWith("## ")){let y=u.substring(3).trim(),k=y.toLowerCase().replace(/[^a-z0-9]+/g,"-");return jsx("h2",{id:k,className:a("text-xl font-bold mt-6 mb-3",r==null?void 0:r.sectionTitle,g),children:y},s)}else if(u.startsWith("### ")){let y=u.substring(4).trim(),k=y.toLowerCase().replace(/[^a-z0-9]+/g,"-");return jsx("h3",{id:k,className:a("text-lg font-bold mt-4 mb-2",r==null?void 0:r.sectionTitle,g),children:y},s)}else return u===""?jsx("br",{},s):jsx("p",{className:"mb-2",children:u},s)})}),W=()=>G?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:()=>D("pdf"),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${A}`,children:"Export as PDF"}),jsx("button",{onClick:()=>D("docx"),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${A}`,children:"Export as DOCX"}),jsx("button",{onClick:()=>D("html"),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${A}`,children:"Export as HTML"}),jsx("button",{onClick:()=>D("markdown"),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${A}`,children:"Export as Markdown"})]})]}):null;return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${z}`,r==null?void 0:r.root,g),children:[jsxs("div",{className:a("flex justify-between items-start mb-6",r==null?void 0:r.header,g),children:[jsxs("div",{children:[jsx("h2",{className:a("text-xl font-bold mb-2",r==null?void 0:r.title,g),children:N}),jsx("p",{className:a("text-gray-600 dark:text-gray-300",r==null?void 0:r.description,g),children:L})]}),t&&H&&jsx("button",{onClick:H,className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${A}`,children:"Edit Policy"})]}),jsxs("div",{className:a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",r==null?void 0:r.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("ul",{className:"flex flex-wrap -mb-px",children:[jsx("li",{className:"mr-2",children:jsx("button",{onClick:()=>E("preview"),className:`inline-block p-4 ${C==="preview"?"text-blue-600 border-b-2 border-blue-600 dark:text-blue-500 dark:border-blue-500":"text-gray-500 hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Preview"})}),jsx("li",{className:"mr-2",children:jsx("button",{onClick:()=>E("markdown"),className:`inline-block p-4 ${C==="markdown"?"text-blue-600 border-b-2 border-blue-600 dark:text-blue-500 dark:border-blue-500":"text-gray-500 hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Markdown"})})]})}),jsx("div",{className:a("bg-white dark:bg-gray-800 p-4 rounded-md",r==null?void 0:r.content,g),children:C==="preview"?jsxs("div",{children:[V(),I(),jsx("div",{className:a("bg-gray-50 dark:bg-gray-700 p-6 rounded-md",r==null?void 0:r.section,g),children:v()})]}):jsx("div",{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:P})})}),W()]})};var $e=({content:P,title:R="Privacy Policy",organizationName:S,lastUpdated:q=new Date,onExportComplete:H,componentTitle:N="Export Privacy Policy",description:L="Export your NDPA-compliant privacy policy in various formats.",className:z="",buttonClassName:A="",showExportHistory:G=true,includeComplianceNotice:t=true,includeLogo:f=false,logoUrl:T,customStyles:U,classNames:d$1,unstyled:r=false})=>{let[g,C]=useState([]),[E,Y]=useState("pdf"),[F,D]=useState(false),[I,V]=useState(null),[v,W]=useState(""),[u,s]=useState(""),[y,k]=useState(""),[B,j]=useState(false),_=e=>{let p=new Date().toISOString().split("T")[0];return `${S?S.toLowerCase().replace(/[^a-z0-9]+/g,"-"):"privacy-policy"}-privacy-policy-${p}.${e.toLowerCase()}`},Z=e=>v?v.endsWith(`.${e.toLowerCase()}`)?v:`${v}.${e.toLowerCase()}`:_(e),J=()=>{let e=S?`${S} ${R}`:R,p=q.toLocaleDateString(),w=`<!DOCTYPE html>
9
+ <html lang="en">
10
+ <head>
11
+ <meta charset="UTF-8">
12
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
13
+ <title>${e}</title>
14
+ <style>
15
+ body {
16
+ font-family: Arial, sans-serif;
17
+ line-height: 1.6;
18
+ color: #333;
19
+ max-width: 800px;
20
+ margin: 0 auto;
21
+ padding: 20px;
22
+ }
23
+ h1 {
24
+ font-size: 24px;
25
+ margin-bottom: 10px;
26
+ }
27
+ h2 {
28
+ font-size: 20px;
29
+ margin-top: 30px;
30
+ margin-bottom: 10px;
31
+ border-bottom: 1px solid #eee;
32
+ padding-bottom: 5px;
33
+ }
34
+ h3 {
35
+ font-size: 18px;
36
+ margin-top: 20px;
37
+ margin-bottom: 10px;
38
+ }
39
+ p {
40
+ margin-bottom: 15px;
41
+ }
42
+ .header {
43
+ text-align: center;
44
+ margin-bottom: 30px;
45
+ }
46
+ .footer {
47
+ margin-top: 50px;
48
+ text-align: center;
49
+ font-size: 12px;
50
+ color: #666;
51
+ border-top: 1px solid #eee;
52
+ padding-top: 20px;
53
+ }
54
+ .logo {
55
+ max-width: 200px;
56
+ margin-bottom: 20px;
57
+ }
58
+ .last-updated {
59
+ font-size: 12px;
60
+ color: #666;
61
+ margin-bottom: 30px;
62
+ }
63
+ .compliance-notice {
64
+ background-color: #f8f9fa;
65
+ border: 1px solid #e9ecef;
66
+ padding: 15px;
67
+ margin-bottom: 30px;
68
+ font-size: 14px;
69
+ }
70
+ ${U||""}
71
+ </style>
72
+ </head>
73
+ <body>
74
+ <div class="header">
75
+ ${f&&T?`<img src="${T}" alt="${S||"Company"} Logo" class="logo">`:""}
76
+ ${u?`<div class="custom-header">${u}</div>`:""}
77
+ <h1>${e}</h1>
78
+ <div class="last-updated">Last Updated: ${p}</div>
79
+ </div>`;t&&(w+=`
80
+ <div class="compliance-notice">
81
+ <strong>NDPA Compliance Notice:</strong> This privacy policy has been created to comply with the Nigeria Data Protection Act (NDPA) 2023.
82
+ It outlines how we collect, use, disclose, and protect your personal information in accordance with NDPA requirements.
83
+ </div>`);let K=P.replace(/^## (.*?)$/gm,"<h2>$1</h2>").replace(/^### (.*?)$/gm,"<h3>$1</h3>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>");return w+=`
84
+ <div class="content">
85
+ <p>${K}</p>
86
+ </div>
87
+
88
+ <div class="footer">
89
+ ${y?`<div class="custom-footer">${y}</div>`:""}
90
+ <p>&copy; ${new Date().getFullYear()} ${S||"Company"}. All rights reserved.</p>
91
+ </div>
92
+ </body>
93
+ </html>`,w},n=()=>d(null,null,function*(){D(true),V(null);try{let e=E.toLowerCase(),p="",w;switch(e){case "pdf":let ee=J();w=new Blob([ee],{type:"text/html"}),p=URL.createObjectURL(w);break;case "docx":w=new Blob([P],{type:"text/plain"}),p=URL.createObjectURL(w);break;case "html":let ae=J();w=new Blob([ae],{type:"text/html"}),p=URL.createObjectURL(w);break;default:w=new Blob([P],{type:"text/markdown"}),p=URL.createObjectURL(w);break}let K=Z(e),X=document.createElement("a");X.href=p,X.download=K,document.body.appendChild(X),X.click(),document.body.removeChild(X);let ne={id:`export_${Date.now()}`,format:e,timestamp:Date.now(),url:p,filename:K};C(ee=>[ne,...ee]),H&&H(e,p);}catch(e){console.error("Export error:",e),V("An error occurred during export. Please try again.");}finally{D(false);}}),b=()=>{let e=[{value:"pdf",label:"PDF Document (.pdf)"},{value:"docx",label:"Word Document (.docx)"},{value:"html",label:"Web Page (.html)"},{value:"markdown",label:"Markdown (.md)"}];return jsxs("div",{className:a("mb-6",d$1==null?void 0:d$1.formatSelector,r),children:[jsx("label",{htmlFor:"export-format",className:"block text-sm font-medium mb-1",children:"Export Format"}),jsx("select",{id:"export-format",value:E,onChange:p=>Y(p.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-blue-500",d$1==null?void 0:d$1.formatOption,r),children:e.map(p=>jsx("option",{value:p.value,children:p.label},p.value))})]})},c=()=>B?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:()=>j(false),className:"text-blue-600 dark:text-blue-400 text-sm",children:"Hide Advanced Options"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"custom-filename",className:"block text-sm font-medium mb-1",children:"Custom Filename"}),jsx("input",{type:"text",id:"custom-filename",value:v,onChange:e=>W(e.target.value),placeholder:_(E),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"}),jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Leave blank to use the default filename format."})]}),jsxs("div",{children:[jsx("label",{htmlFor:"custom-header",className:"block text-sm font-medium mb-1",children:"Custom Header HTML (for HTML/PDF exports)"}),jsx("textarea",{id:"custom-header",value:u,onChange:e=>s(e.target.value),rows:3,placeholder:"<div>Custom header content</div>",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"custom-footer",className:"block text-sm font-medium mb-1",children:"Custom Footer HTML (for HTML/PDF exports)"}),jsx("textarea",{id:"custom-footer",value:y,onChange:e=>k(e.target.value),rows:3,placeholder:"<div>Custom footer content</div>",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),jsxs("div",{className:"flex items-start",children:[jsx("div",{className:"flex items-center h-5",children:jsx("input",{id:"include-compliance-notice",type:"checkbox",checked:t,onChange:e=>j(e.target.checked),className:"w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"})}),jsxs("div",{className:"ml-3 text-sm",children:[jsx("label",{htmlFor:"include-compliance-notice",className:"font-medium text-gray-900 dark:text-white",children:"Include NDPA Compliance Notice"}),jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"Adds a notice explaining that this policy complies with NDPA requirements."})]})]})]}):jsx("button",{type:"button",onClick:()=>j(true),className:"text-blue-600 dark:text-blue-400 text-sm mb-6",children:"Show Advanced Options"}),m=()=>!G||g.length===0?null:jsxs("div",{className:a("mt-6",d$1==null?void 0:d$1.preview,r),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-500 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-500 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-500 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-500 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:g.map(e=>jsxs("tr",{children:[jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300",children:new Date(e.timestamp).toLocaleString()}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300",children:e.format.toUpperCase()}),jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 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-blue-600 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 mr-4",children:"Download"})})]},e.id))})]})})]});return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${z}`,d$1==null?void 0:d$1.root,r),children:[jsxs("div",{className:a("mb-6",d$1==null?void 0:d$1.header,r),children:[jsx("h2",{className:a("text-xl font-bold mb-2",d$1==null?void 0:d$1.title,r),children:N}),jsx("p",{className:a("text-gray-600 dark:text-gray-300",d$1==null?void 0:d$1.description,r),children:L})]}),b(),c(),jsxs("div",{className:"mb-6",children:[jsx("button",{onClick:n,disabled:F,className:a(`px-6 py-3 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${A} ${F?"opacity-70 cursor-not-allowed":""}`,d$1==null?void 0:d$1.exportButton,r),children:F?"Exporting...":`Export as ${E.toUpperCase()}`}),I&&jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-500",children:I})]}),jsxs("div",{className:a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",d$1==null?void 0:d$1.complianceNotice,r),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."})]})]}),m()]})};export{ge as a,he as b,$e as c};//# sourceMappingURL=chunk-SKAMVXBI.mjs.map
94
+ //# sourceMappingURL=chunk-SKAMVXBI.mjs.map
@@ -0,0 +1,2 @@
1
+ 'use strict';function s(t,n,r){return r?n||"":n||t}exports.a=s;//# sourceMappingURL=chunk-VURIXCGY.js.map
2
+ //# sourceMappingURL=chunk-VURIXCGY.js.map
@@ -0,0 +1,94 @@
1
+ 'use strict';var chunkPM7CMTMB_js=require('./chunk-PM7CMTMB.js'),chunkVURIXCGY_js=require('./chunk-VURIXCGY.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var ge=({sections:P,variables:R,onGenerate:S,title:q="NDPA Privacy Policy Generator",description:H="Generate an NDPA-compliant privacy policy for your organization.",className:N="",buttonClassName:L="",generateButtonText:z="Generate Policy",showPreview:A=true,allowEditing:G=true,classNames:t,unstyled:f=false})=>{let[T,U]=react.useState(P),[d,r]=react.useState(R),[g,C]=react.useState("sections"),[E,Y]=react.useState(""),[F,D]=react.useState(""),[I,V]=react.useState(false),[v,W]=react.useState({});react.useEffect(()=>{U(P);},[P]),react.useEffect(()=>{r(R);},[R]);let u=n=>{U(b=>b.map(c=>c.id===n?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},c),{included:!c.included}):c));},s=(n,b)=>{r(c=>c.map(m=>m.id===n?chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},m),{value:b}):m)),v[n]&&W(c=>{let m=chunkMQFZHA2D_js.a({},c);return delete m[n],m});},y=()=>{let n={},b=true;return d.forEach(c=>{c.required&&!c.value&&(n[c.id]=`${c.name} is required`,b=false);}),W(n),b},k=()=>{if(!y()){C("variables");return}let n=T.filter(m=>m.included),b=Object.fromEntries(d.map(m=>[m.name,m.value])),c="";n.forEach(m=>{c+=`## ${m.title}
2
+
3
+ `,c+=chunkPM7CMTMB_js.a(m.template,b),c+=`
4
+
5
+ `;}),Y(c),D(c),V(true),C("preview");},B=()=>{S({sections:T,variables:d,content:G?F:E});},j=()=>jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("space-y-4",t==null?void 0:t.sectionList,f),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Select Policy Sections"}),T.map(n=>jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("border border-gray-200 dark:border-gray-700 rounded-md p-4",t==null?void 0:t.sectionItem,f),children:jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:`section-${n.id}`,type:"checkbox",checked:n.included,onChange:()=>u(n.id),disabled:n.required,className:chunkVURIXCGY_js.a("w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600",t==null?void 0:t.input,f)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:`section-${n.id}`,className:"font-medium text-gray-900 dark:text-white",children:[n.title," ",n.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),n.description&&jsxRuntime.jsx("p",{className:"text-gray-500 dark:text-gray-400 mt-1",children:n.description})]})]})},n.id)),jsxRuntime.jsx("div",{className:"mt-6",children:jsxRuntime.jsx("button",{onClick:()=>C("variables"),className:chunkVURIXCGY_js.a(`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${L}`,t==null?void 0:t.generateButton,f),children:"Next: Fill Variables"})})]}),_=()=>{let n={};return d.forEach(b=>{let c=b.id.split(".")[0];n[c]||(n[c]=[]),n[c].push(b);}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("",t==null?void 0:t.form,f),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Fill Policy Variables"}),jsxRuntime.jsx("div",{className:"space-y-6",children:Object.entries(n).map(([b,c])=>{let m=T.find(e=>e.id===b);return m&&!m.included?null:jsxRuntime.jsxs("div",{className:"border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsxRuntime.jsx("h4",{className:"font-medium text-lg mb-3",children:m?m.title:"General Information"}),jsxRuntime.jsx("div",{className:"space-y-4",children:c.map(e=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`var-${e.id}`,className:"block text-sm font-medium mb-1",children:[e.name," ",e.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),e.description&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2",children:e.description}),e.inputType==="textarea"?jsxRuntime.jsx("textarea",{id:`var-${e.id}`,value:e.value,onChange:p=>s(e.id,p.target.value),rows:4,className:chunkVURIXCGY_js.a(`w-full px-3 py-2 border ${v[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-blue-500"} rounded-md focus:outline-none focus:ring-2`,t==null?void 0:t.input,f),required:e.required}):e.inputType==="select"&&e.options?jsxRuntime.jsxs("select",{id:`var-${e.id}`,value:e.value,onChange:p=>s(e.id,p.target.value),className:chunkVURIXCGY_js.a(`w-full px-3 py-2 border ${v[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-blue-500"} rounded-md focus:outline-none focus:ring-2`,t==null?void 0:t.input,f),required:e.required,children:[jsxRuntime.jsx("option",{value:"",children:"Select an option"}),e.options.map(p=>jsxRuntime.jsx("option",{value:p,children:p},p))]}):jsxRuntime.jsx("input",{id:`var-${e.id}`,type:e.inputType,value:e.value,onChange:p=>s(e.id,p.target.value),className:chunkVURIXCGY_js.a(`w-full px-3 py-2 border ${v[e.id]?"border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:ring-blue-500"} rounded-md focus:outline-none focus:ring-2`,t==null?void 0:t.input,f),required:e.required}),v[e.id]&&jsxRuntime.jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-500",children:v[e.id]})]},e.id))})]},b)})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>C("sections"),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${L}`,children:"Back to Sections"}),jsxRuntime.jsx("button",{onClick:k,className:chunkVURIXCGY_js.a(`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${L}`,t==null?void 0:t.generateButton,f),children:z})]})]})},Z=()=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-4",children:"Preview Generated Policy"}),G?jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("label",{htmlFor:"policy-content",className:"block text-sm font-medium mb-1",children:"Edit Policy Content"}),jsxRuntime.jsx("textarea",{id:"policy-content",value:F,onChange:n=>D(n.target.value),rows:20,className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono text-sm"})]}):jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md mb-4",children:jsxRuntime.jsx("div",{className:"prose dark:prose-invert max-w-none",children:E.split(`
6
+ `).map((n,b)=>n.startsWith("## ")?jsxRuntime.jsx("h2",{className:"text-xl font-bold mt-6 mb-3",children:n.substring(3)},b):n.startsWith("### ")?jsxRuntime.jsx("h3",{className:"text-lg font-bold mt-4 mb-2",children:n.substring(4)},b):n===""?jsxRuntime.jsx("br",{},b):jsxRuntime.jsx("p",{className:"mb-2",children:n},b))})}),jsxRuntime.jsxs("div",{className:"mt-6 flex space-x-4",children:[jsxRuntime.jsx("button",{onClick:()=>C("variables"),className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${L}`,children:"Back to Variables"}),jsxRuntime.jsx("button",{onClick:B,className:`px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 ${L}`,children:"Save Policy"})]})]}),J=()=>{switch(g){case "sections":return j();case "variables":return _();case "preview":return Z();default:return j()}};return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${N}`,t==null?void 0:t.root,f),children:[jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("mb-6",t==null?void 0:t.header,f),children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-xl font-bold mb-2",t==null?void 0:t.title,f),children:q}),jsxRuntime.jsx("p",{className:chunkVURIXCGY_js.a("text-gray-600 dark:text-gray-300",t==null?void 0:t.description,f),children:H})]}),jsxRuntime.jsx("div",{className:"mb-8",children:jsxRuntime.jsxs("ol",{className:"flex items-center w-full",children:[jsxRuntime.jsxs("li",{className:`flex w-full items-center ${g==="sections"?"text-blue-600 dark:text-blue-500":"text-gray-500 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${g==="sections"?"bg-blue-100 dark:bg-blue-800":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"1"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Sections"})]}),jsxRuntime.jsxs("li",{className:`flex w-full items-center ${g==="variables"?"text-blue-600 dark:text-blue-500":"text-gray-500 dark:text-gray-400"} after:content-[''] after:w-full after:h-1 after:border-b after:border-gray-200 after:border-1 after:hidden sm:after:inline-block after:mx-6 xl:after:mx-10`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${g==="variables"?"bg-blue-100 dark:bg-blue-800":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"2"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Variables"})]}),jsxRuntime.jsxs("li",{className:`flex items-center ${g==="preview"?"text-blue-600 dark:text-blue-500":"text-gray-500 dark:text-gray-400"}`,children:[jsxRuntime.jsx("span",{className:`flex items-center justify-center w-8 h-8 ${g==="preview"?"bg-blue-100 dark:bg-blue-800":"bg-gray-100 dark:bg-gray-700"} rounded-full shrink-0`,children:"3"}),jsxRuntime.jsx("span",{className:"hidden sm:inline-flex sm:ml-2",children:"Preview"})]})]})}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",t==null?void 0:t.complianceNotice,f),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"This tool helps you generate a privacy policy that aligns with the Nigeria Data Protection Act (NDPA) 2023. While we strive to ensure compliance, we recommend having the final policy reviewed by a legal professional familiar with NDPA requirements."})]}),J()]})};var he=({content:P,sections:R,variables:S,onExport:q,onEdit:H,title:N="Privacy Policy Preview",description:L="Preview your NDPA-compliant privacy policy before exporting.",className:z="",buttonClassName:A="",showExportOptions:G=true,showEditButton:t=true,showTableOfContents:f=true,showMetadata:T=true,organizationName:U,lastUpdated:d=new Date,classNames:r,unstyled:g=false})=>{let[C,E]=react.useState("preview"),F=(()=>{let u=P.split(`
7
+ `),s=[];return u.forEach(y=>{if(y.startsWith("## ")){let k=y.substring(3).trim(),B=k.toLowerCase().replace(/[^a-z0-9]+/g,"-");s.push({id:B,title:k,level:2});}else if(y.startsWith("### ")){let k=y.substring(4).trim(),B=k.toLowerCase().replace(/[^a-z0-9]+/g,"-");s.push({id:B,title:k,level:3});}}),s})(),D=u=>{if(q)q(u);else if(u==="markdown"){let s=document.createElement("a"),y=new Blob([P],{type:"text/markdown"});s.href=URL.createObjectURL(y),s.download=`privacy-policy-${new Date().toISOString().split("T")[0]}.md`,document.body.appendChild(s),s.click(),document.body.removeChild(s);}},I=()=>!f||F.length===0?null:jsxRuntime.jsxs("div",{className:"mb-6 p-4 bg-gray-50 dark:bg-gray-700 rounded-md",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Table of Contents"}),jsxRuntime.jsx("ul",{className:"space-y-1",children:F.map((u,s)=>jsxRuntime.jsx("li",{style:{marginLeft:`${(u.level-2)*1.5}rem`},children:jsxRuntime.jsx("a",{href:`#${u.id}`,className:"text-blue-600 dark:text-blue-400 hover:underline",children:u.title})},s))})]}),V=()=>T?jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("h1",{className:"text-2xl font-bold mb-2",children:U?`${U} Privacy Policy`:"Privacy Policy"}),jsxRuntime.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Last Updated: ",d.toLocaleDateString()]})]}):null,v=()=>jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("prose dark:prose-invert max-w-none",r==null?void 0:r.sectionContent,g),children:P.split(`
8
+ `).map((u,s)=>{if(u.startsWith("## ")){let y=u.substring(3).trim(),k=y.toLowerCase().replace(/[^a-z0-9]+/g,"-");return jsxRuntime.jsx("h2",{id:k,className:chunkVURIXCGY_js.a("text-xl font-bold mt-6 mb-3",r==null?void 0:r.sectionTitle,g),children:y},s)}else if(u.startsWith("### ")){let y=u.substring(4).trim(),k=y.toLowerCase().replace(/[^a-z0-9]+/g,"-");return jsxRuntime.jsx("h3",{id:k,className:chunkVURIXCGY_js.a("text-lg font-bold mt-4 mb-2",r==null?void 0:r.sectionTitle,g),children:y},s)}else return u===""?jsxRuntime.jsx("br",{},s):jsxRuntime.jsx("p",{className:"mb-2",children:u},s)})}),W=()=>G?jsxRuntime.jsxs("div",{className:"mt-6",children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Export Options"}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-3",children:[jsxRuntime.jsx("button",{onClick:()=>D("pdf"),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${A}`,children:"Export as PDF"}),jsxRuntime.jsx("button",{onClick:()=>D("docx"),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${A}`,children:"Export as DOCX"}),jsxRuntime.jsx("button",{onClick:()=>D("html"),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${A}`,children:"Export as HTML"}),jsxRuntime.jsx("button",{onClick:()=>D("markdown"),className:`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${A}`,children:"Export as Markdown"})]})]}):null;return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${z}`,r==null?void 0:r.root,g),children:[jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("flex justify-between items-start mb-6",r==null?void 0:r.header,g),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-xl font-bold mb-2",r==null?void 0:r.title,g),children:N}),jsxRuntime.jsx("p",{className:chunkVURIXCGY_js.a("text-gray-600 dark:text-gray-300",r==null?void 0:r.description,g),children:L})]}),t&&H&&jsxRuntime.jsx("button",{onClick:H,className:`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${A}`,children:"Edit Policy"})]}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",r==null?void 0:r.complianceNotice,g),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"NDPA Compliance Notice"}),jsxRuntime.jsx("p",{className:"text-blue-700 dark:text-blue-300 text-sm",children:"This privacy policy has been generated to align with the Nigeria Data Protection Act (NDPA) 2023. We recommend having the final policy reviewed by a legal professional familiar with NDPA requirements before publishing it on your website or sharing it with your users."})]}),jsxRuntime.jsx("div",{className:"mb-6 border-b border-gray-200 dark:border-gray-700",children:jsxRuntime.jsxs("ul",{className:"flex flex-wrap -mb-px",children:[jsxRuntime.jsx("li",{className:"mr-2",children:jsxRuntime.jsx("button",{onClick:()=>E("preview"),className:`inline-block p-4 ${C==="preview"?"text-blue-600 border-b-2 border-blue-600 dark:text-blue-500 dark:border-blue-500":"text-gray-500 hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Preview"})}),jsxRuntime.jsx("li",{className:"mr-2",children:jsxRuntime.jsx("button",{onClick:()=>E("markdown"),className:`inline-block p-4 ${C==="markdown"?"text-blue-600 border-b-2 border-blue-600 dark:text-blue-500 dark:border-blue-500":"text-gray-500 hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"}`,children:"Markdown"})})]})}),jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("bg-white dark:bg-gray-800 p-4 rounded-md",r==null?void 0:r.content,g),children:C==="preview"?jsxRuntime.jsxs("div",{children:[V(),I(),jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("bg-gray-50 dark:bg-gray-700 p-6 rounded-md",r==null?void 0:r.section,g),children:v()})]}):jsxRuntime.jsx("div",{children:jsxRuntime.jsx("pre",{className:"bg-gray-50 dark:bg-gray-700 p-4 rounded-md overflow-auto whitespace-pre-wrap font-mono text-sm text-gray-800 dark:text-gray-200",children:P})})}),W()]})};var $e=({content:P,title:R="Privacy Policy",organizationName:S,lastUpdated:q=new Date,onExportComplete:H,componentTitle:N="Export Privacy Policy",description:L="Export your NDPA-compliant privacy policy in various formats.",className:z="",buttonClassName:A="",showExportHistory:G=true,includeComplianceNotice:t=true,includeLogo:f=false,logoUrl:T,customStyles:U,classNames:d,unstyled:r=false})=>{let[g,C]=react.useState([]),[E,Y]=react.useState("pdf"),[F,D]=react.useState(false),[I,V]=react.useState(null),[v,W]=react.useState(""),[u,s]=react.useState(""),[y,k]=react.useState(""),[B,j]=react.useState(false),_=e=>{let p=new Date().toISOString().split("T")[0];return `${S?S.toLowerCase().replace(/[^a-z0-9]+/g,"-"):"privacy-policy"}-privacy-policy-${p}.${e.toLowerCase()}`},Z=e=>v?v.endsWith(`.${e.toLowerCase()}`)?v:`${v}.${e.toLowerCase()}`:_(e),J=()=>{let e=S?`${S} ${R}`:R,p=q.toLocaleDateString(),w=`<!DOCTYPE html>
9
+ <html lang="en">
10
+ <head>
11
+ <meta charset="UTF-8">
12
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
13
+ <title>${e}</title>
14
+ <style>
15
+ body {
16
+ font-family: Arial, sans-serif;
17
+ line-height: 1.6;
18
+ color: #333;
19
+ max-width: 800px;
20
+ margin: 0 auto;
21
+ padding: 20px;
22
+ }
23
+ h1 {
24
+ font-size: 24px;
25
+ margin-bottom: 10px;
26
+ }
27
+ h2 {
28
+ font-size: 20px;
29
+ margin-top: 30px;
30
+ margin-bottom: 10px;
31
+ border-bottom: 1px solid #eee;
32
+ padding-bottom: 5px;
33
+ }
34
+ h3 {
35
+ font-size: 18px;
36
+ margin-top: 20px;
37
+ margin-bottom: 10px;
38
+ }
39
+ p {
40
+ margin-bottom: 15px;
41
+ }
42
+ .header {
43
+ text-align: center;
44
+ margin-bottom: 30px;
45
+ }
46
+ .footer {
47
+ margin-top: 50px;
48
+ text-align: center;
49
+ font-size: 12px;
50
+ color: #666;
51
+ border-top: 1px solid #eee;
52
+ padding-top: 20px;
53
+ }
54
+ .logo {
55
+ max-width: 200px;
56
+ margin-bottom: 20px;
57
+ }
58
+ .last-updated {
59
+ font-size: 12px;
60
+ color: #666;
61
+ margin-bottom: 30px;
62
+ }
63
+ .compliance-notice {
64
+ background-color: #f8f9fa;
65
+ border: 1px solid #e9ecef;
66
+ padding: 15px;
67
+ margin-bottom: 30px;
68
+ font-size: 14px;
69
+ }
70
+ ${U||""}
71
+ </style>
72
+ </head>
73
+ <body>
74
+ <div class="header">
75
+ ${f&&T?`<img src="${T}" alt="${S||"Company"} Logo" class="logo">`:""}
76
+ ${u?`<div class="custom-header">${u}</div>`:""}
77
+ <h1>${e}</h1>
78
+ <div class="last-updated">Last Updated: ${p}</div>
79
+ </div>`;t&&(w+=`
80
+ <div class="compliance-notice">
81
+ <strong>NDPA Compliance Notice:</strong> This privacy policy has been created to comply with the Nigeria Data Protection Act (NDPA) 2023.
82
+ It outlines how we collect, use, disclose, and protect your personal information in accordance with NDPA requirements.
83
+ </div>`);let K=P.replace(/^## (.*?)$/gm,"<h2>$1</h2>").replace(/^### (.*?)$/gm,"<h3>$1</h3>").replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>");return w+=`
84
+ <div class="content">
85
+ <p>${K}</p>
86
+ </div>
87
+
88
+ <div class="footer">
89
+ ${y?`<div class="custom-footer">${y}</div>`:""}
90
+ <p>&copy; ${new Date().getFullYear()} ${S||"Company"}. All rights reserved.</p>
91
+ </div>
92
+ </body>
93
+ </html>`,w},n=()=>chunkMQFZHA2D_js.d(null,null,function*(){D(true),V(null);try{let e=E.toLowerCase(),p="",w;switch(e){case "pdf":let ee=J();w=new Blob([ee],{type:"text/html"}),p=URL.createObjectURL(w);break;case "docx":w=new Blob([P],{type:"text/plain"}),p=URL.createObjectURL(w);break;case "html":let ae=J();w=new Blob([ae],{type:"text/html"}),p=URL.createObjectURL(w);break;default:w=new Blob([P],{type:"text/markdown"}),p=URL.createObjectURL(w);break}let K=Z(e),X=document.createElement("a");X.href=p,X.download=K,document.body.appendChild(X),X.click(),document.body.removeChild(X);let ne={id:`export_${Date.now()}`,format:e,timestamp:Date.now(),url:p,filename:K};C(ee=>[ne,...ee]),H&&H(e,p);}catch(e){console.error("Export error:",e),V("An error occurred during export. Please try again.");}finally{D(false);}}),b=()=>{let e=[{value:"pdf",label:"PDF Document (.pdf)"},{value:"docx",label:"Word Document (.docx)"},{value:"html",label:"Web Page (.html)"},{value:"markdown",label:"Markdown (.md)"}];return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("mb-6",d==null?void 0:d.formatSelector,r),children:[jsxRuntime.jsx("label",{htmlFor:"export-format",className:"block text-sm font-medium mb-1",children:"Export Format"}),jsxRuntime.jsx("select",{id:"export-format",value:E,onChange:p=>Y(p.target.value),className:chunkVURIXCGY_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",d==null?void 0:d.formatOption,r),children:e.map(p=>jsxRuntime.jsx("option",{value:p.value,children:p.label},p.value))})]})},c=()=>B?jsxRuntime.jsxs("div",{className:"mb-6 space-y-4 border border-gray-200 dark:border-gray-700 rounded-md p-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center",children:[jsxRuntime.jsx("h3",{className:"text-md font-medium",children:"Advanced Export Options"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>j(false),className:"text-blue-600 dark:text-blue-400 text-sm",children:"Hide Advanced Options"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"custom-filename",className:"block text-sm font-medium mb-1",children:"Custom Filename"}),jsxRuntime.jsx("input",{type:"text",id:"custom-filename",value:v,onChange:e=>W(e.target.value),placeholder:_(E),className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"}),jsxRuntime.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:"Leave blank to use the default filename format."})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"custom-header",className:"block text-sm font-medium mb-1",children:"Custom Header HTML (for HTML/PDF exports)"}),jsxRuntime.jsx("textarea",{id:"custom-header",value:u,onChange:e=>s(e.target.value),rows:3,placeholder:"<div>Custom header content</div>",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:"custom-footer",className:"block text-sm font-medium mb-1",children:"Custom Footer HTML (for HTML/PDF exports)"}),jsxRuntime.jsx("textarea",{id:"custom-footer",value:y,onChange:e=>k(e.target.value),rows:3,placeholder:"<div>Custom footer content</div>",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),jsxRuntime.jsxs("div",{className:"flex items-start",children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:"include-compliance-notice",type:"checkbox",checked:t,onChange:e=>j(e.target.checked),className:"w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsx("label",{htmlFor:"include-compliance-notice",className:"font-medium text-gray-900 dark:text-white",children:"Include NDPA Compliance Notice"}),jsxRuntime.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:"Adds a notice explaining that this policy complies with NDPA requirements."})]})]})]}):jsxRuntime.jsx("button",{type:"button",onClick:()=>j(true),className:"text-blue-600 dark:text-blue-400 text-sm mb-6",children:"Show Advanced Options"}),m=()=>!G||g.length===0?null:jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("mt-6",d==null?void 0:d.preview,r),children:[jsxRuntime.jsx("h3",{className:"text-lg font-medium mb-3",children:"Export History"}),jsxRuntime.jsx("div",{className:"bg-gray-50 dark:bg-gray-700 rounded-md overflow-hidden",children:jsxRuntime.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-600",children:[jsxRuntime.jsx("thead",{className:"bg-gray-100 dark:bg-gray-800",children:jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"Date"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"Format"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"Filename"}),jsxRuntime.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:"Actions"})]})}),jsxRuntime.jsx("tbody",{className:"bg-white dark:bg-gray-700 divide-y divide-gray-200 dark:divide-gray-600",children:g.map(e=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300",children:new Date(e.timestamp).toLocaleString()}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300",children:e.format.toUpperCase()}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-300",children:e.filename}),jsxRuntime.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:jsxRuntime.jsx("a",{href:e.url,download:e.filename,className:"text-blue-600 dark:text-blue-400 hover:text-blue-900 dark:hover:text-blue-300 mr-4",children:"Download"})})]},e.id))})]})})]});return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${z}`,d==null?void 0:d.root,r),children:[jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("mb-6",d==null?void 0:d.header,r),children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-xl font-bold mb-2",d==null?void 0:d.title,r),children:N}),jsxRuntime.jsx("p",{className:chunkVURIXCGY_js.a("text-gray-600 dark:text-gray-300",d==null?void 0:d.description,r),children:L})]}),b(),c(),jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsx("button",{onClick:n,disabled:F,className:chunkVURIXCGY_js.a(`px-6 py-3 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${A} ${F?"opacity-70 cursor-not-allowed":""}`,d==null?void 0:d.exportButton,r),children:F?"Exporting...":`Export as ${E.toUpperCase()}`}),I&&jsxRuntime.jsx("p",{className:"mt-2 text-sm text-red-600 dark:text-red-500",children:I})]}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("mb-6 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-md",d==null?void 0:d.complianceNotice,r),children:[jsxRuntime.jsx("h3",{className:"text-sm font-bold text-blue-800 dark:text-blue-200 mb-2",children:"Export Tips"}),jsxRuntime.jsxs("ul",{className:"text-blue-700 dark:text-blue-300 text-sm list-disc list-inside space-y-1",children:[jsxRuntime.jsx("li",{children:"PDF format is recommended for printing or sharing with stakeholders."}),jsxRuntime.jsx("li",{children:"HTML format is ideal for publishing on your website."}),jsxRuntime.jsx("li",{children:"DOCX format allows for further editing in Microsoft Word or similar applications."}),jsxRuntime.jsx("li",{children:"Markdown format is useful for version control systems or technical documentation."})]})]}),m()]})};exports.a=ge;exports.b=he;exports.c=$e;//# sourceMappingURL=chunk-VXRY3V42.js.map
94
+ //# sourceMappingURL=chunk-VXRY3V42.js.map
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkVURIXCGY_js=require('./chunk-VURIXCGY.js'),chunkMQFZHA2D_js=require('./chunk-MQFZHA2D.js'),react=require('react'),jsxRuntime=require('react/jsx-runtime');var et=({options:b,onSave:h,title:k="We Value Your Privacy",description:I="We use cookies and similar technologies to provide our services and enhance your experience.",acceptAllButtonText:O="Accept All",rejectAllButtonText:D="Reject All",customizeButtonText:w="Customize",saveButtonText:E="Save Preferences",position:C="bottom",version:c="1.0",show:p,storageKey:y="ndpr_consent",className:e="",buttonClassName:a="",primaryButtonClassName:B="",secondaryButtonClassName:A="",classNames:t,unstyled:o})=>{let[i,d]=react.useState(false),[f,v]=react.useState(false),[P,T]=react.useState({});react.useEffect(()=>{let g={};if(b.forEach(u=>{g[u.id]=u.defaultValue||false;}),T(g),p===void 0){let u=localStorage.getItem(y);d(!u);}else d(p);},[b,p,y]);let m=()=>{let g={};b.forEach(u=>{g[u.id]=true;}),z(g);},R=()=>{let g={};b.forEach(u=>{g[u.id]=u.required||false;}),z(g);},r=(g,u)=>{T(H=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},H),{[g]:u}));},x=()=>{z(P);},z=g=>{let u={consents:g,timestamp:Date.now(),version:c,method:f?"customize":"banner",hasInteracted:true};localStorage.setItem(y,JSON.stringify(u)),h(u),d(false),v(false);};if(!i)return null;let F=C==="top"?"top-0 left-0 right-0":C==="center"?"top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 max-w-lg":"bottom-0 left-0 right-0",W=(t==null?void 0:t.acceptButton)||`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${a} ${B}`,V=(t==null?void 0:t.rejectButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${a} ${A}`,Y=(t==null?void 0:t.customizeButton)||`px-4 py-2 bg-transparent text-gray-800 dark:text-white hover:underline ${a}`,_=(t==null?void 0:t.saveButton)||`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${a} ${B}`;return jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a(`fixed z-50 bg-white dark:bg-gray-800 shadow-lg p-4 border border-gray-200 dark:border-gray-700 ${F} ${e}`,t==null?void 0:t.root,o),role:"dialog","aria-labelledby":"consent-banner-title",children:jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("max-w-6xl mx-auto",t==null?void 0:t.container,o),children:[jsxRuntime.jsx("h2",{id:"consent-banner-title",className:chunkVURIXCGY_js.a("text-lg font-bold mb-2",t==null?void 0:t.title,o),children:k}),jsxRuntime.jsx("p",{className:chunkVURIXCGY_js.a("mb-4",t==null?void 0:t.description,o),children:I}),f?jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("space-y-3",t==null?void 0:t.optionsList,o),children:b.map(g=>jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("flex items-start",t==null?void 0:t.optionItem,o),children:[jsxRuntime.jsx("div",{className:"flex items-center h-5",children:jsxRuntime.jsx("input",{id:`consent-${g.id}`,type:"checkbox",checked:P[g.id]||false,onChange:u=>r(g.id,u.target.checked),disabled:g.required,className:chunkVURIXCGY_js.a("h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500",t==null?void 0:t.optionCheckbox,o)})}),jsxRuntime.jsxs("div",{className:"ml-3 text-sm",children:[jsxRuntime.jsxs("label",{htmlFor:`consent-${g.id}`,className:chunkVURIXCGY_js.a("font-medium",t==null?void 0:t.optionLabel,o),children:[g.label," ",g.required&&jsxRuntime.jsx("span",{className:"text-red-500",children:"*"})]}),jsxRuntime.jsx("p",{className:chunkVURIXCGY_js.a("text-gray-500 dark:text-gray-400",t==null?void 0:t.optionDescription,o),children:g.description})]})]},g.id))}),jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("mt-4 flex flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:x,className:chunkVURIXCGY_js.a(_,t==null?void 0:t.saveButton,o),children:E}),jsxRuntime.jsx("button",{onClick:()=>v(false),className:chunkVURIXCGY_js.a(V,t==null?void 0:t.rejectButton,o),children:"Back"})]})]}):jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a("flex flex-wrap gap-2",t==null?void 0:t.buttonGroup,o),children:[jsxRuntime.jsx("button",{onClick:m,className:chunkVURIXCGY_js.a(W,t==null?void 0:t.acceptButton,o),children:O}),jsxRuntime.jsx("button",{onClick:R,className:chunkVURIXCGY_js.a(V,t==null?void 0:t.rejectButton,o),children:D}),jsxRuntime.jsx("button",{onClick:()=>v(true),className:chunkVURIXCGY_js.a(Y,t==null?void 0:t.customizeButton,o),children:w})]}),jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("mt-2 text-xs text-gray-500 dark:text-gray-400",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})})};var at=({options:b,settings:h,onSave:k,title:I="Manage Your Privacy Settings",description:O="Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function.",saveButtonText:D="Save Preferences",resetButtonText:w="Reset to Defaults",version:E="1.0",className:C="",buttonClassName:c="",primaryButtonClassName:p="",secondaryButtonClassName:y="",classNames:e,unstyled:a,showSuccessMessage:B=true,successMessage:A="Your preferences have been saved.",successMessageDuration:t=3e3})=>{let[o,i]=react.useState({}),[d,f]=react.useState(false);react.useEffect(()=>{if(h&&h.consents)i(h.consents);else {let r={};b.forEach(x=>{r[x.id]=x.defaultValue||false;}),i(r);}},[b,h]);let v=(r,x)=>{i(z=>chunkMQFZHA2D_js.b(chunkMQFZHA2D_js.a({},z),{[r]:x}));},P=()=>{let r={consents:o,timestamp:Date.now(),version:E,method:"manager",hasInteracted:true};k(r),B&&(f(true),setTimeout(()=>{f(false);},t));},T=()=>{let r={};b.forEach(x=>{r[x.id]=x.defaultValue||false;}),i(r);},m=(e==null?void 0:e.saveButton)||`px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 ${c} ${p}`,R=(e==null?void 0:e.resetButton)||`px-4 py-2 bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-white rounded hover:bg-gray-300 dark:hover:bg-gray-600 ${c} ${y}`;return jsxRuntime.jsxs("div",{className:chunkVURIXCGY_js.a(`bg-white dark:bg-gray-800 rounded-lg shadow-md p-6 ${C}`,e==null?void 0:e.root,a),children:[jsxRuntime.jsx("h2",{className:chunkVURIXCGY_js.a("text-xl font-bold mb-2",e==null?void 0:e.title,a),children:I}),jsxRuntime.jsx("p",{className:chunkVURIXCGY_js.a("mb-6 text-gray-600 dark:text-gray-300",e==null?void 0:e.description,a),children:O}),jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("space-y-6",e==null?void 0:e.optionsList,a),children:b.map(r=>jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a("border-b border-gray-200 dark:border-gray-700 pb-4 last:border-0",e==null?void 0:e.optionItem,a),children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:"font-medium text-gray-900 dark:text-white",children:r.label}),jsxRuntime.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:r.description})]}),jsxRuntime.jsx("div",{className:"ml-4 flex-shrink-0",children:jsxRuntime.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",className:"sr-only peer",checked:o[r.id]||false,onChange:x=>v(r.id,x.target.checked),disabled:r.required}),jsxRuntime.jsx("div",{className:chunkVURIXCGY_js.a(`w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600 ${r.required?"opacity-60":""}`,e==null?void 0:e.toggle,a)}),jsxRuntime.jsxs("span",{className:"ml-3 text-sm font-medium text-gray-900 dark:text-gray-300",children:[o[r.id]?"Enabled":"Disabled",r.required&&jsxRuntime.jsx("span",{className:"text-xs text-red-500 ml-1",children:"(Required)"})]})]})})]})},r.id))}),d&&jsxRuntime.jsx("div",{className:"mt-4 p-3 bg-green-50 dark:bg-green-900/20 text-green-800 dark:text-green-200 rounded-md",children:A}),jsxRuntime.jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[jsxRuntime.jsx("button",{onClick:P,className:chunkVURIXCGY_js.a(m,e==null?void 0:e.saveButton,a),children:D}),jsxRuntime.jsx("button",{onClick:T,className:chunkVURIXCGY_js.a(R,e==null?void 0:e.resetButton,a),children:w})]}),jsxRuntime.jsxs("div",{className:"mt-4 text-xs text-gray-500 dark:text-gray-400",children:[jsxRuntime.jsxs("p",{children:["Last updated: ",h?new Date(h.timestamp).toLocaleString():"Never"]}),jsxRuntime.jsxs("p",{children:["Version: ",E]})]})]})};var st=({settings:b,storageOptions:h={},onLoad:k,onSave:I,autoSave:O=true,autoLoad:D=true,classNames:w,unstyled:E,children:C})=>{let{storageKey:c="ndpr_consent",storageType:p="localStorage",cookieOptions:y={}}=h,[e,a]=react.useState(false);react.useEffect(()=>{D&&!e&&B();},[D,e]),react.useEffect(()=>{O&&e&&A(b);},[b,O,e]);let B=()=>{let i=null;try{if(p==="localStorage"&&typeof window!="undefined"){let d=localStorage.getItem(c);d&&(i=JSON.parse(d));}else if(p==="sessionStorage"&&typeof window!="undefined"){let d=sessionStorage.getItem(c);d&&(i=JSON.parse(d));}else if(p==="cookie"&&typeof document!="undefined"){let f=document.cookie.split(";").find(v=>v.trim().startsWith(`${c}=`));if(f){let v=f.split("=")[1];i=JSON.parse(decodeURIComponent(v));}}a(!0),k&&k(i);}catch(d){console.error("Error loading consent settings:",d),a(true),k&&k(null);}return i},A=i=>{try{let d=JSON.stringify(i);if(p==="localStorage"&&typeof window!="undefined")localStorage.setItem(c,d);else if(p==="sessionStorage"&&typeof window!="undefined")sessionStorage.setItem(c,d);else if(p==="cookie"&&typeof document!="undefined"){let{domain:f,path:v="/",expires:P=365,secure:T=!0,sameSite:m="Lax"}=y,R=new Date;R.setDate(R.getDate()+P);let r=`${c}=${encodeURIComponent(d)}; path=${v}; expires=${R.toUTCString()}`;f&&(r+=`; domain=${f}`),T&&(r+="; secure"),r+=`; samesite=${m}`,document.cookie=r;}return I&&I(i),!0}catch(d){return console.error("Error saving consent settings:",d),false}},t=()=>{try{if(p==="localStorage"&&typeof window!="undefined")localStorage.removeItem(c);else if(p==="sessionStorage"&&typeof window!="undefined")sessionStorage.removeItem(c);else if(p==="cookie"&&typeof document!="undefined"){let{domain:i,path:d="/"}=y,f=`${c}=; path=${d}; expires=Thu, 01 Jan 1970 00:00:00 GMT`;i&&(f+=`; domain=${i}`),document.cookie=f;}return !0}catch(i){return console.error("Error clearing consent settings:",i),false}},o=chunkVURIXCGY_js.a("",w==null?void 0:w.root,E);if(typeof C=="function"){let i=C({loadSettings:B,saveSettings:A,clearSettings:t,loaded:e});return o?jsxRuntime.jsx("div",{className:o,children:i}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:i})}return o?jsxRuntime.jsx("div",{className:o,children:C}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:C})};exports.a=et;exports.b=at;exports.c=st;//# sourceMappingURL=chunk-YBPHGEL2.js.map
2
+ //# sourceMappingURL=chunk-YBPHGEL2.js.map
@@ -4,6 +4,22 @@ export { L as LawfulBasisType } from './consent-CmVzqZUk.mjs';
4
4
  export { u as useConsent } from './useConsent-DOt2Njst.mjs';
5
5
  export { v as validateConsent, a as validateConsentOptions } from './consent-DCc5zjXI.mjs';
6
6
 
7
+ interface ConsentBannerClassNames {
8
+ root?: string;
9
+ container?: string;
10
+ title?: string;
11
+ description?: string;
12
+ optionsList?: string;
13
+ optionItem?: string;
14
+ optionCheckbox?: string;
15
+ optionLabel?: string;
16
+ optionDescription?: string;
17
+ buttonGroup?: string;
18
+ acceptButton?: string;
19
+ rejectButton?: string;
20
+ customizeButton?: string;
21
+ saveButton?: string;
22
+ }
7
23
  interface ConsentBannerProps {
8
24
  /**
9
25
  * Array of consent options to display
@@ -79,9 +95,30 @@ interface ConsentBannerProps {
79
95
  * Custom CSS class for the secondary button
80
96
  */
81
97
  secondaryButtonClassName?: string;
98
+ /**
99
+ * Object of CSS class overrides keyed by semantic section name.
100
+ * Takes priority over buttonClassName / primaryButtonClassName / secondaryButtonClassName.
101
+ */
102
+ classNames?: ConsentBannerClassNames;
103
+ /**
104
+ * When true, all default Tailwind classes are removed so consumers
105
+ * can style from scratch using classNames.
106
+ */
107
+ unstyled?: boolean;
82
108
  }
83
109
  declare const ConsentBanner: React.FC<ConsentBannerProps>;
84
110
 
111
+ interface ConsentManagerClassNames {
112
+ root?: string;
113
+ header?: string;
114
+ title?: string;
115
+ description?: string;
116
+ optionsList?: string;
117
+ optionItem?: string;
118
+ toggle?: string;
119
+ saveButton?: string;
120
+ resetButton?: string;
121
+ }
85
122
  interface ConsentManagerProps {
86
123
  /**
87
124
  * Array of consent options to display
@@ -136,6 +173,16 @@ interface ConsentManagerProps {
136
173
  * Custom CSS class for the secondary button
137
174
  */
138
175
  secondaryButtonClassName?: string;
176
+ /**
177
+ * Object of CSS class overrides keyed by semantic section name.
178
+ * Takes priority over buttonClassName / primaryButtonClassName / secondaryButtonClassName.
179
+ */
180
+ classNames?: ConsentManagerClassNames;
181
+ /**
182
+ * When true, all default Tailwind classes are removed so consumers
183
+ * can style from scratch using classNames.
184
+ */
185
+ unstyled?: boolean;
139
186
  /**
140
187
  * Whether to show a success message after saving
141
188
  * @default true
@@ -154,6 +201,9 @@ interface ConsentManagerProps {
154
201
  }
155
202
  declare const ConsentManager: React.FC<ConsentManagerProps>;
156
203
 
204
+ interface ConsentStorageClassNames {
205
+ root?: string;
206
+ }
157
207
  interface ConsentStorageProps {
158
208
  /**
159
209
  * Current consent settings
@@ -181,6 +231,15 @@ interface ConsentStorageProps {
181
231
  * @default true
182
232
  */
183
233
  autoLoad?: boolean;
234
+ /**
235
+ * Object of CSS class overrides keyed by semantic section name.
236
+ */
237
+ classNames?: ConsentStorageClassNames;
238
+ /**
239
+ * When true, all default classes are removed so consumers
240
+ * can style from scratch using classNames.
241
+ */
242
+ unstyled?: boolean;
184
243
  /**
185
244
  * Children to render
186
245
  * Can be either React nodes or a render prop function that receives storage methods
@@ -192,6 +251,13 @@ interface ConsentStorageProps {
192
251
  loaded: boolean;
193
252
  }) => React.ReactNode);
194
253
  }
195
- declare const ConsentStorage: ({ settings, storageOptions, onLoad, onSave, autoSave, autoLoad, children }: ConsentStorageProps) => React.ReactElement | null;
254
+ declare const ConsentStorage: ({ settings, storageOptions, onLoad, onSave, autoSave, autoLoad, classNames, unstyled, children }: ConsentStorageProps) => React.ReactElement | null;
255
+
256
+ /**
257
+ * Resolves class names for a component section.
258
+ * If unstyled is true, only the override class is used.
259
+ * Otherwise, the override is appended to the default.
260
+ */
261
+ declare function resolveClass(defaultClass: string, override?: string, unstyled?: boolean): string;
196
262
 
197
- export { ConsentBanner, ConsentManager, ConsentOption, ConsentSettings, ConsentStorage, ConsentStorageOptions };
263
+ export { ConsentBanner, type ConsentBannerClassNames, ConsentManager, type ConsentManagerClassNames, ConsentOption, ConsentSettings, ConsentStorage, type ConsentStorageClassNames, ConsentStorageOptions, resolveClass };