@tantainnovative/ndpr-toolkit 3.12.0 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/dist/breach.d.mts +7 -1
- package/dist/breach.d.ts +7 -1
- package/dist/breach.js +1 -1
- package/dist/breach.mjs +1 -1
- package/dist/chunk-37VFK5SR.js +6 -0
- package/dist/chunk-3E4IH7CE.js +1 -0
- package/dist/chunk-3H6FYU3Z.mjs +93 -0
- package/dist/chunk-3I6FYA5C.js +103 -0
- package/dist/chunk-3SIYRGJF.js +93 -0
- package/dist/chunk-3XU6FL2I.js +1 -0
- package/dist/chunk-42JPSNVV.mjs +6 -0
- package/dist/chunk-42UJFTII.js +1 -0
- package/dist/chunk-737EMUUC.mjs +1 -0
- package/dist/chunk-7FXNGGMO.js +1 -0
- package/dist/chunk-B2EXRSYG.mjs +1 -0
- package/dist/chunk-BGV2AKT7.mjs +1 -0
- package/dist/chunk-BL5W472Q.js +1 -0
- package/dist/chunk-BPMVJOHH.mjs +1 -0
- package/dist/chunk-ELK6VFKC.mjs +2 -0
- package/dist/chunk-F5MGMNQF.js +2 -0
- package/dist/chunk-FRQFU44F.mjs +1 -0
- package/dist/{chunk-WYH3OA5L.mjs → chunk-I2ZBMR7F.mjs} +1 -1
- package/dist/chunk-J7BIJ45O.mjs +103 -0
- package/dist/{chunk-US2VGJ7I.js → chunk-KH3EQJQE.js} +1 -1
- package/dist/{chunk-IPWX5I5P.mjs → chunk-L3FR4PQE.mjs} +1 -1
- package/dist/chunk-N72RNTGP.mjs +6 -0
- package/dist/chunk-NB6SKG76.mjs +1 -0
- package/dist/chunk-NUIRMJKQ.mjs +2 -0
- package/dist/chunk-PXDSPF5B.js +2 -0
- package/dist/chunk-QGUOFGVJ.js +2 -0
- package/dist/chunk-RBKFNCGO.mjs +1 -0
- package/dist/chunk-TTMGFC6C.js +1 -0
- package/dist/{chunk-TWJHEIQH.js → chunk-UZNWXJ2W.js} +1 -1
- package/dist/chunk-V5TZJJWU.mjs +1 -0
- package/dist/chunk-WCTFED27.js +1 -0
- package/dist/chunk-WHQ4PEYS.mjs +2 -0
- package/dist/chunk-WMISQDSV.js +1 -0
- package/dist/{chunk-MTSZ7GL6.mjs → chunk-WVHMY2BV.mjs} +1 -1
- package/dist/chunk-XYGGUGTO.js +6 -0
- package/dist/chunk-YDKWD6MQ.js +1 -0
- package/dist/chunk-Z2M5VJX2.mjs +1 -0
- package/dist/{chunk-D3DVVJCT.js → chunk-ZD2W3YU2.js} +1 -1
- package/dist/chunk-ZM5DLFCZ.js +1 -0
- package/dist/chunk-ZQHGIOYP.mjs +1 -0
- package/dist/consent.js +1 -1
- package/dist/consent.mjs +1 -1
- package/dist/core.d.mts +62 -0
- package/dist/core.d.ts +62 -0
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/cross-border-lite.js +1 -1
- package/dist/cross-border-lite.mjs +1 -1
- package/dist/cross-border.js +1 -1
- package/dist/cross-border.mjs +1 -1
- package/dist/dpia.js +1 -1
- package/dist/dpia.mjs +1 -1
- package/dist/dsr.js +1 -1
- package/dist/dsr.mjs +1 -1
- package/dist/headless.js +1 -1
- package/dist/headless.mjs +1 -1
- package/dist/hooks.js +1 -1
- package/dist/hooks.mjs +1 -1
- package/dist/index.d.mts +69 -1
- package/dist/index.d.ts +69 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lawful-basis-lite.js +1 -1
- package/dist/lawful-basis-lite.mjs +1 -1
- package/dist/lawful-basis.js +1 -1
- package/dist/lawful-basis.mjs +1 -1
- package/dist/policy.js +1 -1
- package/dist/policy.mjs +1 -1
- package/dist/presets-consent.js +1 -1
- package/dist/presets-consent.mjs +1 -1
- package/dist/presets-dsr.js +1 -1
- package/dist/presets-dsr.mjs +1 -1
- package/dist/presets-policy.d.mts +23 -0
- package/dist/presets-policy.d.ts +23 -0
- package/dist/presets-policy.js +1 -1
- package/dist/presets-policy.mjs +1 -1
- package/dist/presets.d.mts +230 -1
- package/dist/presets.d.ts +230 -1
- package/dist/presets.js +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/ropa-lite.js +1 -1
- package/dist/ropa-lite.mjs +1 -1
- package/dist/ropa.js +1 -1
- package/dist/ropa.mjs +1 -1
- package/dist/server.d.mts +62 -0
- package/dist/server.d.ts +62 -0
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/dist/unstyled.js +1 -1
- package/dist/unstyled.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-25TNTLHJ.mjs +0 -1
- package/dist/chunk-4GIMXUMI.js +0 -6
- package/dist/chunk-5AECGMEB.js +0 -1
- package/dist/chunk-5EKQX6GM.mjs +0 -1
- package/dist/chunk-67KA345Q.mjs +0 -1
- package/dist/chunk-6GM2PBTF.js +0 -2
- package/dist/chunk-6OWCUDTN.mjs +0 -1
- package/dist/chunk-73BMSK67.js +0 -1
- package/dist/chunk-CAFCRCTZ.mjs +0 -1
- package/dist/chunk-EKNWO4DK.js +0 -1
- package/dist/chunk-FMJ6ICLJ.js +0 -1
- package/dist/chunk-G7JKRYM5.mjs +0 -1
- package/dist/chunk-GEP52QFH.mjs +0 -1
- package/dist/chunk-IB3KSUPZ.mjs +0 -1
- package/dist/chunk-JWAN5J4Y.js +0 -1
- package/dist/chunk-JYZOKO2W.mjs +0 -103
- package/dist/chunk-NDKDKDDX.js +0 -1
- package/dist/chunk-NX5MOBRI.js +0 -1
- package/dist/chunk-OLEUIYE2.mjs +0 -1
- package/dist/chunk-Q4CSVWSS.mjs +0 -1
- package/dist/chunk-QMAVEHOR.js +0 -1
- package/dist/chunk-RBMLGRDN.mjs +0 -1
- package/dist/chunk-ROC64RLP.js +0 -1
- package/dist/chunk-RR3KXNET.mjs +0 -6
- package/dist/chunk-TDHH7GS2.mjs +0 -2
- package/dist/chunk-TN4TH3CT.mjs +0 -2
- package/dist/chunk-VUFTRKKC.js +0 -2
- package/dist/chunk-WKTKTLMF.js +0 -1
- package/dist/chunk-WXUXCRAJ.js +0 -1
- package/dist/chunk-XN2UYZXH.mjs +0 -93
- package/dist/chunk-YK22SYCT.js +0 -103
- package/dist/chunk-YSD2DFBR.js +0 -6
- package/dist/chunk-YWCBI7SI.js +0 -93
- package/dist/chunk-ZHX62QAL.mjs +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-FRQFU44F.mjs';import {b,a as a$1}from'./chunk-ZJYULEER.mjs';import {useState,useRef,useEffect,useMemo}from'react';import {jsxs,jsx}from'react/jsx-runtime';var rn=({options:g,settings:d,onSave:L,title:s,description:_,saveButtonText:f,resetButtonText:v,version:C="1.0",className:h="",buttonClassName:l="",primaryButtonClassName:y="",secondaryButtonClassName:E="",classNames:n,unstyled:t,showSuccessMessage:I=true,successMessage:T="Your preferences have been saved.",successMessageDuration:V=3e3})=>{var R,B,D,M;let p=c(),F=(R=s!=null?s:p.consent.managerTitle)!=null?R:"Manage Your Privacy Settings",O=(B=_!=null?_:p.consent.managerDescription)!=null?B:"Update your consent preferences at any time. Required cookies cannot be disabled as they are necessary for the website to function. Consent management is provided in accordance with NDPA Sections 25-26.",Y=(D=f!=null?f:p.consent.savePreferences)!=null?D:"Save Preferences",A=(M=v!=null?v:p.consent.resetToDefaults)!=null?M:"Reset to Defaults",[b$1,u]=useState({}),[K,S]=useState(false),c$1=useRef(null);useEffect(()=>()=>{c$1.current&&clearTimeout(c$1.current);},[]);let U=useMemo(()=>g.map(e=>`${e.id}:${e.defaultValue?"1":"0"}`).join("|"),[g]);useEffect(()=>{if(d&&d.consents)u(d.consents);else {let e={};g.forEach(o=>{e[o.id]=o.defaultValue||false;}),u(e);}},[U,d]);let j=(e,o)=>{u(m=>b(a$1({},m),{[e]:o}));},z=()=>{let e={consents:b$1,timestamp:Date.now(),version:C,method:"manager",hasInteracted:true};L(e),I&&(S(true),c$1.current&&clearTimeout(c$1.current),c$1.current=setTimeout(()=>{S(false);},V));},G=()=>{let e={};g.forEach(o=>{e[o.id]=o.defaultValue||false;}),u(e);},H=`ndpr-consent-manager__button ndpr-consent-manager__button--primary ${l} ${y}`.trim(),J=`ndpr-consent-manager__button ndpr-consent-manager__button--secondary ${l} ${E}`.trim(),Q=(n==null?void 0:n.primaryButton)||(n==null?void 0:n.saveButton)||H,W=(n==null?void 0:n.secondaryButton)||(n==null?void 0:n.resetButton)||J,X=`ndpr-consent-manager${h?` ${h}`:""}`;return jsxs("div",{"data-ndpr-component":"consent-manager",className:a(X,n==null?void 0:n.root,t),children:[jsx("h2",{className:a("ndpr-consent-manager__title",n==null?void 0:n.title,t),children:F}),jsx("p",{className:a("ndpr-consent-manager__description",n==null?void 0:n.description,t),children:O}),jsx("div",{className:a("ndpr-consent-manager__options-list",n==null?void 0:n.optionsList,t),children:g.map(e=>{let o=`consent-manager-${e.id}`;return jsxs("div",{className:a("ndpr-consent-manager__option",n==null?void 0:n.optionItem,t),children:[jsxs("div",{className:t?"":"ndpr-consent-manager__option-info",children:[jsx("h3",{className:t?"":"ndpr-consent-manager__option-label",children:e.label}),jsx("p",{className:t?"":"ndpr-consent-manager__option-description",children:e.description})]}),jsxs("label",{htmlFor:o,className:t?"":"ndpr-consent-manager__toggle-wrapper",children:[jsx("input",{id:o,type:"checkbox",className:t?"":"ndpr-consent-manager__toggle-input",checked:b$1[e.id]||false,onChange:m=>j(e.id,m.target.checked),disabled:e.required}),jsx("span",{"aria-hidden":"true",className:a("ndpr-consent-manager__toggle",n==null?void 0:n.toggle,t)}),jsxs("span",{className:t?"":"ndpr-consent-manager__toggle-status",children:[b$1[e.id]?"Enabled":"Disabled",e.required&&jsx("span",{className:t?"":"ndpr-consent-manager__required-marker",children:"(Required)"})]})]})]},e.id)})}),K&&jsx("div",{className:t?"":"ndpr-consent-manager__success","aria-live":"polite",role:"status",children:T}),jsxs("div",{className:t?"":"ndpr-consent-manager__buttons",children:[jsx("button",{onClick:z,className:a(Q,n==null?void 0:n.saveButton,t),children:Y}),jsx("button",{onClick:G,className:a(W,n==null?void 0:n.resetButton,t),children:A})]}),jsxs("div",{className:t?"":"ndpr-consent-manager__meta",children:[jsxs("p",{children:["Last updated: ",d?new Date(d.timestamp).toLocaleString():"Never"]}),jsxs("p",{children:["Version: ",C]})]})]})};export{rn as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-KE2FZH2V.mjs';import {a as a$1}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-FRQFU44F.mjs';import {d,b,a as a$2}from'./chunk-ZJYULEER.mjs';import Nr,{useId,useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var cr=["Organization","Data Collection","Processing","Review & Export"],yr=({currentStep:n,classNames:p,unstyled:r})=>jsx("nav",{"data-ndpr-component":"policy-step-indicator","aria-label":"Policy wizard progress",className:a$1("w-full flex items-center justify-between px-2 py-4",p==null?void 0:p.root,r),children:cr.map((e,d)=>{let t=d+1,i=t<n,u=t===n,v=d===cr.length-1;return jsxs(Nr.Fragment,{children:[jsxs("div",{className:a$1("flex flex-col items-center gap-1",p==null?void 0:p.stepWrapper,r),children:[jsx("div",{"aria-current":u?"step":void 0,"aria-label":`Step ${t}: ${e}${i?" (completed)":u?" (current)":""}`,className:a$1(["flex items-center justify-center rounded-full border-2 font-semibold transition-all",i?"w-8 h-8 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))]":u?"w-9 h-9 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] shadow-md":"w-8 h-8 bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-600 text-gray-400 dark:text-gray-500"].join(" "),i?p==null?void 0:p.stepCompleted:u?p==null?void 0:p.stepCurrent:p==null?void 0:p.stepUpcoming,r),children:i?jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsx("span",{className:"text-xs leading-none",children:t})}),jsx("span",{className:a$1(["text-xs font-medium hidden sm:block",i||u?"text-[rgb(var(--ndpr-primary))]":"ndpr-card__subtitle"].join(" "),p==null?void 0:p.stepLabel,r),children:e})]}),!v&&jsx("div",{className:a$1(["flex-1 h-0.5 mx-2",i?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-700"].join(" "),p==null?void 0:p.connector,r),"aria-hidden":"true"})]},t)})});var $="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",rt="block text-sm font-medium ndpr-text-muted mb-1",A=({id:n,label:p,required:r,description:e,children:d,classNames:t,unstyled:i})=>{let u=e?`${n}-desc`:void 0;return jsxs("div",{className:a$1("flex flex-col",t==null?void 0:t.field,i),children:[jsxs("label",{htmlFor:n,className:a$1(rt,t==null?void 0:t.label,i),children:[p,r&&jsx("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),e&&jsx("p",{id:u,className:"text-xs ndpr-text-muted mb-1",children:e}),d]})},Cr=({context:n,onUpdateOrg:p,classNames:r,unstyled:e})=>{var i,u,l;let d=useId(),t=n.org;return jsxs("div",{"data-ndpr-component":"policy-step-about",className:a$1("ndpr-form-section",r==null?void 0:r.root,e),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Organisation Details"}),jsxs("p",{className:a$1("ndpr-form-field__hint",r==null?void 0:r.subheading,e),children:["Tell us about your organisation. Fields marked ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})," are required."]})]}),jsxs("div",{className:a$1("grid grid-cols-1 md:grid-cols-2 gap-4",r==null?void 0:r.grid,e),children:[jsx(A,{id:`${d}-org-name`,label:"Organisation Name",required:true,classNames:r,unstyled:e,children:jsx("input",{id:`${d}-org-name`,type:"text",value:t.name,onChange:v=>p({name:v.target.value}),placeholder:"Acme Corporation",className:a$1($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsx(A,{id:`${d}-website`,label:"Website",required:true,classNames:r,unstyled:e,children:jsx("input",{id:`${d}-website`,type:"url",value:t.website,onChange:v=>p({website:v.target.value}),placeholder:"https://example.com",className:a$1($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsx(A,{id:`${d}-privacy-email`,label:"Privacy Contact Email",required:true,classNames:r,unstyled:e,children:jsx("input",{id:`${d}-privacy-email`,type:"email",value:t.privacyEmail,onChange:v=>p({privacyEmail:v.target.value}),placeholder:"privacy@example.com",className:a$1($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsx(A,{id:`${d}-industry`,label:"Industry",classNames:r,unstyled:e,children:jsxs("select",{id:`${d}-industry`,value:t.industry,onChange:v=>p({industry:v.target.value}),className:a$1($,r==null?void 0:r.select,e),children:[jsx("option",{value:"fintech",children:"Fintech"}),jsx("option",{value:"healthcare",children:"Healthcare"}),jsx("option",{value:"ecommerce",children:"E-commerce"}),jsx("option",{value:"saas",children:"SaaS"}),jsx("option",{value:"education",children:"Education"}),jsx("option",{value:"government",children:"Government"}),jsx("option",{value:"other",children:"Other"})]})}),jsx(A,{id:`${d}-dpo-name`,label:"Data Protection Officer (DPO) Name",classNames:r,unstyled:e,children:jsx("input",{id:`${d}-dpo-name`,type:"text",value:(i=t.dpoName)!=null?i:"",onChange:v=>p({dpoName:v.target.value}),placeholder:"Jane Smith",className:a$1($,r==null?void 0:r.input,e)})}),jsx(A,{id:`${d}-dpo-email`,label:"DPO Email",classNames:r,unstyled:e,children:jsx("input",{id:`${d}-dpo-email`,type:"email",value:(u=t.dpoEmail)!=null?u:"",onChange:v=>p({dpoEmail:v.target.value}),placeholder:"dpo@example.com",className:a$1($,r==null?void 0:r.input,e)})}),jsx(A,{id:`${d}-address`,label:"Registered Address",classNames:r,unstyled:e,children:jsx("input",{id:`${d}-address`,type:"text",value:(l=t.address)!=null?l:"",onChange:v=>p({address:v.target.value}),placeholder:"1 Victoria Island, Lagos, Nigeria",className:a$1($,r==null?void 0:r.input,e)})}),jsx(A,{id:`${d}-org-size`,label:"Organisation Size",classNames:r,unstyled:e,children:jsxs("select",{id:`${d}-org-size`,value:t.orgSize,onChange:v=>p({orgSize:v.target.value}),className:a$1($,r==null?void 0:r.select,e),children:[jsx("option",{value:"startup",children:"Startup (1\u201350 employees)"}),jsx("option",{value:"midsize",children:"Mid-size (51\u2013500 employees)"}),jsx("option",{value:"enterprise",children:"Enterprise (500+ employees)"})]})}),jsx(A,{id:`${d}-country`,label:"Country of Operation",classNames:r,unstyled:e,children:jsx("input",{id:`${d}-country`,type:"text",value:t.country,onChange:v=>p({country:v.target.value}),placeholder:"Nigeria",className:a$1($,r==null?void 0:r.input,e)})})]})]})};var tt={identity:"Identity",financial:"Financial",behavioral:"Behavioural",sensitive:"Sensitive",children:"Children"},ot=["identity","financial","behavioral","sensitive","children"],et=["sensitive","children"],kr=({categories:n,onToggle:p,classNames:r,unstyled:e})=>{let d=ot.reduce((t,i)=>{let u=n.filter(l=>l.group===i);return u.length>0&&(t[i]=u),t},{});return jsxs("div",{"data-ndpr-component":"policy-step-data",className:a$1("space-y-8",r==null?void 0:r.root,e),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Data Categories"}),jsx("p",{id:"data-categories-desc",className:a$1("ndpr-form-field__hint",r==null?void 0:r.subheading,e),children:"Select the categories of personal data your organisation collects. You must select at least one."})]}),Object.entries(d).map(([t,i])=>{let u=et.includes(t);return jsxs("div",{className:a$1("space-y-3",r==null?void 0:r.group,e),children:[jsxs("div",{className:a$1("flex items-center gap-2",r==null?void 0:r.groupHeader,e),children:[jsx("h3",{className:a$1("text-sm font-semibold uppercase tracking-wide ndpr-text-muted",r==null?void 0:r.groupTitle,e),children:tt[t]}),u&&jsx("span",{className:a$1("text-xs font-medium ndpr-text-warning bg-amber-50 dark:bg-amber-900/20 px-2 py-0.5 rounded-full",r==null?void 0:r.sensitiveTag,e),children:"Sensitive"})]}),u&&jsx("p",{className:a$1("text-xs ndpr-text-warning",r==null?void 0:r.sensitiveWarning,e),children:t==="children"?"Processing children's data requires parental consent under NDPA Section 31 and imposes heightened obligations.":"Sensitive/special-category data requires explicit consent and additional safeguards under NDPA Section 30."}),jsx("div",{className:a$1("grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",r==null?void 0:r.cardsGrid,e),children:i.map(l=>jsx("button",{type:"button",onClick:()=>p(l.id),"aria-pressed":l.selected,className:a$1(["text-left rounded-lg border p-4 transition-all cursor-pointer focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",l.selected?"bg-[rgb(var(--ndpr-primary))]/5 border-[rgb(var(--ndpr-primary))] dark:bg-[rgb(var(--ndpr-primary))]/10":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"].join(" "),r==null?void 0:r.card,e),children:jsxs("div",{className:"flex items-start gap-3",children:[jsx("div",{className:a$1(["mt-0.5 w-4 h-4 rounded border-2 flex-shrink-0 flex items-center justify-center",l.selected?"bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))]":"border-gray-300 dark:border-gray-600"].join(" "),r==null?void 0:r.checkbox,e),"aria-hidden":"true",children:l.selected&&jsx("svg",{className:"w-2.5 h-2.5 text-[rgb(var(--ndpr-primary-foreground))]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),jsxs("div",{className:"min-w-0",children:[jsx("p",{className:a$1("text-sm font-medium ndpr-text-foreground",r==null?void 0:r.cardLabel,e),children:l.label}),jsx("p",{className:a$1("text-xs ndpr-text-muted mt-1 leading-relaxed",r==null?void 0:r.cardDataPoints,e),children:l.dataPoints.join(", ")})]})]})},l.id))})]},t)})]})};var nt=[{value:"service_delivery",label:"Service Delivery",description:"Processing required to deliver the core product or service."},{value:"marketing",label:"Marketing & Communications",description:"Sending promotional messages, newsletters or offers."},{value:"analytics",label:"Analytics & Insights",description:"Analysing usage patterns to improve the product."},{value:"research",label:"Research & Development",description:"Using data to develop new features or products."},{value:"legal_compliance",label:"Legal Compliance",description:"Meeting statutory, regulatory or contractual obligations."},{value:"fraud_prevention",label:"Fraud Prevention & Security",description:"Detecting and preventing fraudulent activity."}],dr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",pr="ndpr-card ndpr-card--compact",gr=({id:n,checked:p,onChange:r})=>jsx("button",{id:n,type:"button",role:"switch","aria-checked":p,onClick:()=>r(!p),className:["relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent cursor-pointer transition-colors focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",p?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-600"].join(" "),children:jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition-transform",p?"translate-x-5":"translate-x-0"].join(" ")})}),Pr=({context:n,onTogglePurpose:p,onUpdateContext:r,onAddProcessor:e,onRemoveProcessor:d,classNames:t,unstyled:i})=>{let u=useId(),[l,v]=useState({name:"",purpose:"",country:""}),[C,g]=useState(false),a=()=>{let{name:b,purpose:c,country:m}=l;!b.trim()||!c.trim()||!m.trim()||(e({name:b.trim(),purpose:c.trim(),country:m.trim()}),v({name:"",purpose:"",country:""}),g(false));};return jsxs("div",{"data-ndpr-component":"policy-step-processing",className:a$1("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",t==null?void 0:t.heading,i),children:"Processing Details"}),jsx("p",{className:a$1("ndpr-form-field__hint",t==null?void 0:t.subheading,i),children:"Define how and why you process personal data."})]}),jsxs("section",{className:a$1(pr,t==null?void 0:t.section,i),"aria-labelledby":"purposes-heading",children:[jsx("h3",{id:"purposes-heading",className:a$1("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Processing Purposes"}),jsx("p",{className:a$1("ndpr-form-field__hint",t==null?void 0:t.sectionDescription,i),children:"Select all purposes for which you process personal data. At least one is required."}),jsx("div",{className:a$1("space-y-3",t==null?void 0:t.purposeList,i),children:nt.map(b=>{let c=n.purposes.includes(b.value),m=`${u}-purpose-${b.value}`,B=`${u}-purpose-desc-${b.value}`;return jsxs("label",{htmlFor:m,className:a$1("flex items-start gap-3 cursor-pointer group",t==null?void 0:t.purposeItem,i),children:[jsx("input",{id:m,type:"checkbox",checked:c,onChange:()=>p(b.value),"aria-describedby":B,className:a$1("mt-0.5 h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] cursor-pointer",t==null?void 0:t.purposeCheckbox,i)}),jsxs("div",{children:[jsx("p",{className:a$1("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.purposeLabel,i),children:b.label}),jsx("p",{id:B,className:a$1("ndpr-form-field__hint",t==null?void 0:t.purposeDescription,i),children:b.description})]})]},b.value)})})]}),jsxs("section",{className:a$1(pr,t==null?void 0:t.section,i),"aria-labelledby":"thirdparty-heading",children:[jsxs("div",{className:"flex items-center justify-between",children:[jsx("h3",{id:"thirdparty-heading",className:a$1("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Third-Party Data Sharing"}),jsx(gr,{id:`${u}-thirdparty-toggle`,checked:n.thirdPartyProcessors.length>0||C,onChange:b=>{b?g(true):(n.thirdPartyProcessors.forEach((c,m)=>d(0)),g(false));}})]}),(n.thirdPartyProcessors.length>0||C)&&jsxs("div",{className:a$1("ndpr-form-section",t==null?void 0:t.processorSection,i),children:[n.thirdPartyProcessors.length>0&&jsx("div",{className:a$1("overflow-x-auto",t==null?void 0:t.processorTable,i),children:jsxs("table",{className:"w-full text-sm",children:[jsx("thead",{children:jsxs("tr",{className:a$1("text-left text-xs font-medium ndpr-text-muted border-b border-gray-200 dark:border-gray-700",t==null?void 0:t.tableHeader,i),children:[jsx("th",{className:"pb-2 pr-4",children:"Name"}),jsx("th",{className:"pb-2 pr-4",children:"Purpose"}),jsx("th",{className:"pb-2 pr-4",children:"Country"}),jsx("th",{className:"pb-2"})]})}),jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:n.thirdPartyProcessors.map((b,c)=>jsxs("tr",{children:[jsx("td",{className:a$1("py-2 pr-4 ndpr-text-foreground",t==null?void 0:t.tableCell,i),children:b.name}),jsx("td",{className:a$1("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:b.purpose}),jsx("td",{className:a$1("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:b.country}),jsx("td",{className:"py-2",children:jsx("button",{type:"button",onClick:()=>d(c),className:a$1("text-red-500 hover:ndpr-text-destructive dark:hover:text-red-300 text-xs font-medium",t==null?void 0:t.removeButton,i),"aria-label":`Remove ${b.name}`,children:"Remove"})})]},c))})]})}),C?jsxs("div",{className:a$1("grid grid-cols-1 sm:grid-cols-3 gap-3 items-end",t==null?void 0:t.processorForm,i),children:[jsxs("div",{children:[jsx("label",{htmlFor:`${u}-proc-name`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Processor Name"}),jsx("input",{id:`${u}-proc-name`,type:"text",placeholder:"Processor name",value:l.name,onChange:b$1=>v(c=>b(a$2({},c),{name:b$1.target.value})),"aria-required":"true",className:a$1(dr,t==null?void 0:t.input,i)})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${u}-proc-purpose`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Purpose"}),jsx("input",{id:`${u}-proc-purpose`,type:"text",placeholder:"Purpose",value:l.purpose,onChange:b$1=>v(c=>b(a$2({},c),{purpose:b$1.target.value})),"aria-required":"true",className:a$1(dr,t==null?void 0:t.input,i)})]}),jsxs("div",{children:[jsx("label",{htmlFor:`${u}-proc-country`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Country"}),jsx("input",{id:`${u}-proc-country`,type:"text",placeholder:"Country",value:l.country,onChange:b$1=>v(c=>b(a$2({},c),{country:b$1.target.value})),"aria-required":"true",className:a$1(dr,t==null?void 0:t.input,i)})]}),jsxs("div",{className:"sm:col-span-3 flex gap-2",children:[jsx("button",{type:"button",onClick:a,className:a$1("ndpr-button ndpr-button--primary ndpr-button--sm",t==null?void 0:t.addButton,i),children:"Add Processor"}),jsx("button",{type:"button",onClick:()=>g(false),className:a$1("ndpr-button ndpr-button--secondary ndpr-button--sm",t==null?void 0:t.cancelButton,i),children:"Cancel"})]})]}):jsxs("button",{type:"button",onClick:()=>g(true),className:a$1("flex items-center gap-1 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",t==null?void 0:t.addLink,i),children:[jsx("span",{"aria-hidden":"true",children:"+"})," Add processor"]})]})]}),jsxs("section",{className:a$1(pr,t==null?void 0:t.section,i),"aria-labelledby":"disclosures-heading",children:[jsx("h3",{id:"disclosures-heading",className:a$1("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Additional Disclosures"}),jsxs("div",{className:a$1("ndpr-form-section",t==null?void 0:t.disclosureList,i),children:[jsxs("div",{className:a$1("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxs("div",{children:[jsx("p",{id:`${u}-cross-border-label`,className:a$1("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Cross-border Data Transfers"}),jsx("p",{id:`${u}-cross-border-desc`,className:a$1("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you transfer personal data outside Nigeria? This triggers NDPA Chapter 6 obligations."})]}),jsx(gr,{id:`${u}-cross-border-toggle`,checked:n.hasCrossBorderTransfer,onChange:b=>r({hasCrossBorderTransfer:b})})]}),jsxs("div",{className:a$1("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxs("div",{children:[jsx("p",{id:`${u}-automated-label`,className:a$1("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Automated Decision-Making / Profiling"}),jsx("p",{id:`${u}-automated-desc`,className:a$1("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you use algorithms or automated systems to make decisions about individuals? Requires disclosure under NDPA Section 37."})]}),jsx(gr,{id:`${u}-automated-toggle`,checked:n.hasAutomatedDecisions,onChange:b=>r({hasAutomatedDecisions:b})})]})]})]})]})};var Sr=({section:n,index:p,isCustom:r,isEditing:e,editedContent:d,onEdit:t,onSaveEdit:i,onCancelEdit:u,onMoveUp:l,onMoveDown:v,onDelete:C,classNames:g,unstyled:a})=>{let[b,c]=useState(d!=null?d:n.template);return useEffect(()=>{d!==void 0&&c(d);},[d]),useEffect(()=>{e&&c(d!=null?d:n.template);},[e,d,n.template]),jsxs("div",{"data-ndpr-component":"policy-section-card",className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-3",g==null?void 0:g.root,a),children:[jsxs("div",{className:a$1("flex items-start justify-between gap-2",g==null?void 0:g.header,a),children:[jsxs("div",{className:a$1("flex items-center gap-3 min-w-0",g==null?void 0:g.titleRow,a),children:[jsx("span",{className:a$1("flex-shrink-0 w-7 h-7 rounded-full bg-gray-100 dark:bg-gray-700 ndpr-text-muted text-xs font-semibold flex items-center justify-center",g==null?void 0:g.sectionNumber,a),"aria-hidden":"true",children:p+1}),jsxs("h4",{className:a$1("text-sm font-semibold ndpr-text-foreground truncate",g==null?void 0:g.sectionTitle,a),children:[n.title,r&&jsx("span",{className:a$1("ml-2 text-xs font-normal ndpr-text-muted bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded",g==null?void 0:g.customBadge,a),children:"Custom"})]})]}),jsxs("div",{className:a$1("flex items-center gap-1 flex-shrink-0",g==null?void 0:g.actions,a),children:[l&&jsx("button",{type:"button",onClick:l,className:a$1("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${n.title}" up`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}),v&&jsx("button",{type:"button",onClick:v,className:a$1("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${n.title}" down`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}),!e&&jsx("button",{type:"button",onClick:t,className:a$1("p-1.5 text-gray-400 hover:text-[rgb(var(--ndpr-primary))] rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.editButton,a),"aria-label":`Edit "${n.title}"`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),r&&C&&jsx("button",{type:"button",onClick:C,className:a$1("p-1.5 text-gray-400 hover:text-red-500 dark:hover:text-red-400 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.deleteButton,a),"aria-label":`Delete "${n.title}"`,children:jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),e?jsxs("div",{className:a$1("space-y-2",g==null?void 0:g.editArea,a),children:[jsx("textarea",{value:b,onChange:m=>c(m.target.value),rows:8,className:a$1("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm font-mono resize-y",g==null?void 0:g.textarea,a),"aria-label":`Edit content for ${n.title}`}),jsxs("div",{className:a$1("flex gap-2",g==null?void 0:g.editActions,a),children:[jsx("button",{type:"button",onClick:()=>i(b),className:a$1("ndpr-button ndpr-button--primary ndpr-button--sm",g==null?void 0:g.saveButton,a),children:"Save"}),jsx("button",{type:"button",onClick:u,className:a$1("ndpr-button ndpr-button--secondary ndpr-button--sm",g==null?void 0:g.cancelButton,a),children:"Cancel"})]})]}):jsx("div",{className:a$1("text-sm ndpr-text-muted leading-relaxed line-clamp-4 whitespace-pre-wrap",g==null?void 0:g.content,a),children:n.template})]})};var Rr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",Lr=({onAdd:n,nextOrder:p,classNames:r,unstyled:e})=>{let d=useId(),[t,i]=useState(""),[u,l]=useState(""),[v,C]=useState(""),g=()=>{if(!t.trim()){C("Section title is required.");return}if(!u.trim()){C("Section content is required.");return}C(""),n({title:t.trim(),content:u.trim(),order:p}),i(""),l("");};return jsxs("div",{"data-ndpr-component":"custom-section-form",className:a$1("ndpr-card ndpr-card--compact",r==null?void 0:r.root,e),children:[jsx("h4",{className:a$1("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Add Custom Section"}),v&&jsx("p",{role:"alert",className:a$1("text-xs ndpr-text-destructive",r==null?void 0:r.error,e),children:v}),jsxs("div",{className:a$1("space-y-3",r==null?void 0:r.fields,e),children:[jsxs("div",{children:[jsxs("label",{htmlFor:`${d}-custom-section-title`,className:a$1("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Section Title ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsx("input",{id:`${d}-custom-section-title`,type:"text",value:t,onChange:a=>{i(a.target.value),v&&C("");},placeholder:"e.g. Cookie Policy",className:a$1(Rr,r==null?void 0:r.input,e),"aria-required":"true"})]}),jsxs("div",{children:[jsxs("label",{htmlFor:`${d}-custom-section-content`,className:a$1("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Content ",jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsx("textarea",{id:`${d}-custom-section-content`,value:u,onChange:a=>{l(a.target.value),v&&C("");},placeholder:"Write the section content here...",rows:5,className:a$1(`${Rr} resize-y`,r==null?void 0:r.textarea,e),"aria-required":"true"})]})]}),jsx("div",{className:a$1("flex items-center gap-2",r==null?void 0:r.footer,e),children:jsx("button",{type:"button",onClick:g,className:a$1("ndpr-button ndpr-button--primary ndpr-button--sm",r==null?void 0:r.addButton,e),children:"Add Section"})})]})};var Fr={compliant:{bg:"ndpr-alert ndpr-alert--success",text:"ndpr-text-success",border:"border-green-200 dark:border-green-700"},nearly_compliant:{bg:"bg-amber-50 dark:bg-amber-900/20",text:"ndpr-text-warning",border:"border-amber-200 dark:border-amber-700"},not_compliant:{bg:"ndpr-alert ndpr-alert--destructive",text:"ndpr-text-destructive",border:"border-red-200 dark:border-red-700"}},gt={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},N=({icon:n,label:p,description:r,actionLabel:e,loading:d,onClick:t,classNames:i,unstyled:u})=>jsxs("div",{className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex flex-col gap-3",i==null?void 0:i.formatCard,u),children:[jsxs("div",{className:a$1("flex items-center gap-3",i==null?void 0:i.formatHeader,u),children:[jsx("div",{className:a$1("w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center flex-shrink-0",i==null?void 0:i.formatIcon,u),"aria-hidden":"true",children:n}),jsxs("div",{className:"min-w-0",children:[jsx("p",{className:a$1("ndpr-section-heading",i==null?void 0:i.formatLabel,u),children:p}),jsx("p",{className:a$1("ndpr-form-field__hint",i==null?void 0:i.formatDescription,u),children:r})]})]}),jsx("button",{type:"button",onClick:t,disabled:d,className:a$1("w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2",i==null?void 0:i.formatButton,u),children:d?jsxs(Fragment,{children:[jsxs("svg",{className:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),"Generating\u2026"]}):e})]}),Er=({complianceResult:n,onExportPDF:p,onExportDOCX:r,onExportHTML:e,onExportMarkdown:d$1,classNames:t,unstyled:i})=>{var c;let[u,l]=useState(false),[v,C]=useState(false),g=(c=Fr[n.rating])!=null?c:Fr.not_compliant,a=()=>d(null,null,function*(){l(true);try{yield p();}finally{l(false);}}),b=()=>d(null,null,function*(){C(true);try{yield r();}finally{C(false);}});return jsxs("div",{"data-ndpr-component":"policy-export-panel",className:a$1("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxs("div",{className:a$1(`rounded-lg border p-4 flex items-center gap-4 ${g.bg} ${g.border}`,t==null?void 0:t.complianceSummary,i),children:[jsxs("div",{className:a$1(`text-3xl font-bold ${g.text}`,t==null?void 0:t.complianceScore,i),"aria-label":`Compliance score: ${n.percentage}%`,children:[n.percentage,"%"]}),jsxs("div",{children:[jsx("p",{className:a$1(`text-sm font-semibold ${g.text}`,t==null?void 0:t.complianceRating,i),children:gt[n.rating]}),jsxs("p",{className:a$1("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.complianceDetail,i),children:[n.score," / ",n.maxScore," points \u2022"," ",n.gaps.length," gap",n.gaps.length!==1?"s":""," remaining"]})]})]}),jsxs("div",{children:[jsx("h3",{className:a$1("ndpr-section-heading",t==null?void 0:t.formatsHeading,i),children:"Export Format"}),jsxs("div",{className:a$1("grid grid-cols-1 sm:grid-cols-2 gap-3",t==null?void 0:t.formatsGrid,i),children:[jsx(N,{icon:jsx("svg",{className:"w-5 h-5 text-red-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 7v-1h4v1h-4zm0-3v-1h4v1h-4zm-2-5h8v1H8v-1z"})}),label:"PDF",description:"Professional formatted document, ideal for publishing.",actionLabel:"Download PDF",loading:u,onClick:a,classNames:t,unstyled:i}),jsx(N,{icon:jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-5 8v-5h1.5l1 3 1-3H13v5h-1v-3.5l-.75 2.25h-.5L10 13.5V17H9zm5-1.5h.75c.55 0 .75-.25.75-.75 0-.4-.2-.65-.75-.65H14V15.5zm1 1.5h-2v-4h2c1.1 0 1.75.6 1.75 1.5 0 .55-.25.95-.65 1.15.5.2.8.65.8 1.2 0 1-.65 1.65-1.9 1.65V17zm-.25-1c.6 0 .9-.25.9-.75 0-.45-.3-.75-.9-.75H14V16h.75z"})}),label:"DOCX",description:"Editable Word document for further customisation.",actionLabel:"Download DOCX",loading:v,onClick:b,classNames:t,unstyled:i}),jsx(N,{icon:jsxs("svg",{className:"w-5 h-5 text-orange-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15H9V8h2v9zm4 0h-2V8h2v9z"}),jsx("path",{d:"M9.5 6.5h1v1h-1zm4 0h1v1h-1z"}),jsx("path",{d:"M5 5h14v2H5zm0 12h14v2H5z"})]}),label:"HTML",description:"Copy-ready HTML to embed on your website.",actionLabel:"Copy HTML",onClick:e,classNames:t,unstyled:i}),jsx(N,{icon:jsx("svg",{className:"w-5 h-5 ndpr-text-muted",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsx("path",{d:"M3 5h18v2H3V5zm0 4h12v2H3V9zm0 4h18v2H3v-2zm0 4h12v2H3v-2z"})}),label:"Markdown",description:"Plain-text format for documentation or Git repos.",actionLabel:"Copy Markdown",onClick:d$1,classNames:t,unstyled:i})]})]})]})};var Ar=({sections:n,customSections:p,sectionOverrides:r,complianceResult:e,onEditSection:d,onAddCustomSection:t,onRemoveCustomSection:i,onReorderSection:u,onExportPDF:l,onExportDOCX:v,onExportHTML:C,onExportMarkdown:g,classNames:a,unstyled:b$1})=>{let[c,m]=useState(null),[B,J]=useState(false),Z=new Set(p.map(h=>h.id)),or=(h,F)=>{d(h,F),m(null);},er=n.length>0?Math.max(...n.map(h=>{var F;return (F=h.order)!=null?F:0}))+1:1;return jsxs("div",{"data-ndpr-component":"policy-step-review",className:a$1("ndpr-form-section",a==null?void 0:a.root,b$1),children:[jsxs("div",{children:[jsx("h2",{className:a$1("ndpr-section-heading",a==null?void 0:a.heading,b$1),children:"Review & Export"}),jsx("p",{className:a$1("ndpr-form-field__hint",a==null?void 0:a.subheading,b$1),children:"Review your generated policy sections, reorder or edit content, then export."})]}),jsx("div",{className:a$1("space-y-3",a==null?void 0:a.sectionList,b$1),"aria-live":"polite",children:n.map((h,F)=>jsx(Sr,{section:r[h.id]?b(a$2({},h),{template:r[h.id]}):h,index:F,isCustom:Z.has(h.id),isEditing:c===h.id,editedContent:r[h.id],onEdit:()=>m(h.id),onSaveEdit:ir=>or(h.id,ir),onCancelEdit:()=>m(null),onMoveUp:F>0?()=>u(h.id,"up"):void 0,onMoveDown:F<n.length-1?()=>u(h.id,"down"):void 0,onDelete:Z.has(h.id)?()=>i(h.id):void 0,classNames:a,unstyled:b$1},h.id))}),!B&&jsxs("button",{type:"button",onClick:()=>J(true),className:a$1("flex items-center gap-2 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",a==null?void 0:a.addSectionButton,b$1),children:[jsx("span",{className:a$1("w-5 h-5 rounded-full border-2 border-[rgb(var(--ndpr-primary))] flex items-center justify-center text-xs font-bold leading-none",a==null?void 0:a.addSectionIcon,b$1),"aria-hidden":"true",children:"+"}),"Add Custom Section"]}),B&&jsxs("div",{className:a$1("space-y-2",a==null?void 0:a.customFormWrapper,b$1),children:[jsx(Lr,{onAdd:h=>{t(h),J(false);},nextOrder:er,classNames:a,unstyled:b$1}),jsx("button",{type:"button",onClick:()=>J(false),className:a$1("text-sm ndpr-text-muted hover:underline",a==null?void 0:a.cancelCustomForm,b$1),children:"Cancel"})]}),jsx("hr",{className:a$1("border-gray-200 dark:border-gray-700",a==null?void 0:a.divider,b$1)}),jsx(Er,{complianceResult:e,onExportPDF:l,onExportDOCX:v,onExportHTML:C,onExportMarkdown:g,classNames:a,unstyled:b$1})]})};var Tr={compliant:{stroke:"stroke-green-500 dark:stroke-green-400",text:"ndpr-text-success"},nearly_compliant:{stroke:"stroke-amber-500 dark:stroke-amber-400",text:"ndpr-text-warning"},not_compliant:{stroke:"stroke-red-500 dark:stroke-red-400",text:"ndpr-text-destructive"}},at={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},Ir=({score:n,maxScore:p,rating:r,classNames:e,unstyled:d})=>{var C,g;let t=p>0?Math.round(n/p*100):0,i=(C=Tr[r])!=null?C:Tr.not_compliant,u=36,l=2*Math.PI*u,v=l-t/100*l;return jsxs("div",{"data-ndpr-component":"compliance-score-ring",className:a$1("flex flex-col items-center gap-2",e==null?void 0:e.root,d),children:[jsxs("div",{className:a$1("relative w-24 h-24",e==null?void 0:e.svgWrapper,d),children:[jsxs("svg",{className:"w-24 h-24 -rotate-90",viewBox:"0 0 96 96","aria-hidden":"true",children:[jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:"8"}),jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:i.stroke,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:v,style:{transition:"stroke-dashoffset 0.5s ease-out"}})]}),jsx("div",{className:a$1("absolute inset-0 flex flex-col items-center justify-center",e==null?void 0:e.centerText,d),children:jsxs("span",{className:a$1(`text-xl font-bold leading-none ${i.text}`,e==null?void 0:e.scoreValue,d),"aria-label":`${t}% compliance score`,children:[t,"%"]})})]}),jsx("p",{className:a$1(`text-xs font-semibold text-center ${i.text}`,e==null?void 0:e.ratingLabel,d),children:(g=at[r])!=null?g:r}),jsxs("p",{className:a$1("text-xs ndpr-text-muted text-center",e==null?void 0:e.scoreDetail,d),children:[n," / ",p," pts"]})]})};var bt={critical:"ndpr-text-destructive",important:"ndpr-text-warning",recommended:"ndpr-text-info"},_r=({gap:n,isPassed:p,onFix:r,classNames:e,unstyled:d})=>{let[t,i]=useState(false);return jsxs("div",{"data-ndpr-component":"compliance-requirement-item",className:a$1("border-b border-gray-100 dark:border-gray-700 last:border-0 py-2",e==null?void 0:e.root,d),children:[jsxs("button",{type:"button",onClick:()=>!p&&i(u=>!u),className:a$1("w-full flex items-start gap-2 text-left group",e==null?void 0:e.row,d),"aria-expanded":p?void 0:t,"aria-disabled":p,children:[jsx("span",{className:a$1(["mt-0.5 flex-shrink-0 w-4 h-4 rounded-full flex items-center justify-center",p?"bg-green-500":n.severity==="critical"?"bg-red-500":n.severity==="important"?"bg-amber-500":"bg-blue-400"].join(" "),e==null?void 0:e.statusIcon,d),"aria-hidden":"true",children:p?jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center justify-between gap-1",children:[jsx("p",{className:a$1(`text-xs font-medium ${p?"ndpr-text-muted":"ndpr-text-foreground"}`,e==null?void 0:e.requirementLabel,d),children:n.requirement}),!p&&jsx("svg",{className:`flex-shrink-0 w-3 h-3 text-gray-400 transition-transform ${t?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),jsxs("p",{className:a$1("text-xs text-gray-400 dark:text-gray-500 mt-0.5",e==null?void 0:e.ndpaSection,d),children:["NDPA ",n.ndpaSection]})]})]}),!p&&t&&jsxs("div",{className:a$1("mt-2 ml-6 space-y-2",e==null?void 0:e.detail,d),children:[jsx("p",{className:a$1(`text-xs ${bt[n.severity]}`,e==null?void 0:e.message,d),children:n.message}),jsx("button",{type:"button",onClick:()=>{r(n.requirementId),i(false);},className:a$1("text-xs font-medium px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",e==null?void 0:e.fixButton,d),children:n.fixLabel})]})]})};function ft(n,p){let r=p.map(t=>({gap:{requirementId:t,requirement:t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "),ndpaSection:"\u2014",severity:"recommended",message:"",fixType:"fill_field",fixLabel:""},isPassed:true})),e=n.map(t=>({gap:t,isPassed:false})),d={critical:0,important:1,recommended:2};return e.sort((t,i)=>d[t.gap.severity]-d[i.gap.severity]),[...e,...r]}var Mr=({complianceResult:n,onFix:p,classNames:r,unstyled:e})=>{let[d,t]=useState(false),i=ft(n.gaps,n.passed);return jsxs("aside",{"data-ndpr-component":"compliance-checker-sidebar",className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",r==null?void 0:r.root,e),"aria-label":"NDPA compliance checker",children:[jsxs("div",{className:a$1("flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50",r==null?void 0:r.header,e),children:[jsx("h2",{className:a$1("ndpr-section-heading",r==null?void 0:r.title,e),children:"NDPA Compliance"}),jsx("button",{type:"button",onClick:()=>t(u=>!u),className:a$1("p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",r==null?void 0:r.collapseButton,e),"aria-expanded":!d,"aria-label":d?"Expand compliance checker":"Collapse compliance checker",children:jsx("svg",{className:`w-4 h-4 transition-transform ${d?"-rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]}),!d&&jsxs("div",{className:a$1("p-4 space-y-4",r==null?void 0:r.body,e),children:[jsx("div",{className:a$1("flex justify-center",r==null?void 0:r.ringWrapper,e),children:jsx(Ir,{score:n.score,maxScore:n.maxScore,rating:n.rating,classNames:r,unstyled:e})}),jsx("div",{className:a$1("grid grid-cols-3 gap-2 text-center",r==null?void 0:r.statsRow,e),children:[{count:n.gaps.filter(u=>u.severity==="critical").length,label:"Critical",color:"ndpr-text-destructive"},{count:n.gaps.filter(u=>u.severity==="important").length,label:"Important",color:"ndpr-text-warning"},{count:n.passed.length,label:"Passed",color:"ndpr-text-success"}].map(({count:u,label:l,color:v})=>jsxs("div",{children:[jsx("p",{className:a$1(`text-base font-bold ${v}`,r==null?void 0:r.statValue,e),children:u}),jsx("p",{className:a$1("ndpr-form-field__hint",r==null?void 0:r.statLabel,e),children:l})]},l))}),jsx("div",{className:a$1("overflow-y-auto max-h-80",r==null?void 0:r.requirementsList,e),children:i.length===0?jsx("p",{className:a$1("ndpr-empty-state",r==null?void 0:r.emptyState,e),children:"No requirements to display."}):i.map(({gap:u,isPassed:l})=>jsx(_r,{gap:u,isPassed:l,onFix:p,classNames:r,unstyled:e},u.requirementId))})]})]})};function xt(n){let p=Date.now()-n;return p<1e4?"just now":p<6e4?`${Math.floor(p/1e3)}s ago`:p<36e5?`${Math.floor(p/6e4)}m ago`:new Date(n).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var zr=({lastSavedAt:n,isSaving:p,hasError:r,classNames:e,unstyled:d})=>{let t="idle";if(p?t="saving":r?t="error":n!==null&&(t="saved"),t==="idle")return null;let i=t==="saving"?"Saving\u2026":t==="error"?"Unable to save":`Draft saved ${n?xt(n):""}`;return jsxs("div",{"data-ndpr-component":"draft-save-indicator",role:"status","aria-live":"polite","aria-atomic":"true",className:a$1(`flex items-center gap-1.5 ${t==="error"?"text-red-500 dark:text-red-400":t==="saving"?"ndpr-card__subtitle":"ndpr-text-success"}`,e==null?void 0:e.root,d),children:[t==="saving"&&jsxs("svg",{className:"animate-spin w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),t==="saved"&&jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),t==="error"&&jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),jsx("span",{className:a$1("text-xs font-medium",e==null?void 0:e.text,d),children:i})]})};var _o=({adapter:n,onComplete:p,classNames:r,unstyled:e,initialContext:d$1})=>{var vr,br,lr;let t=c(),i=(vr=t.policy.wizardTitle)!=null?vr:"Privacy Policy Builder",u=(br=t.common.back)!=null?br:"Back",l=(lr=t.common.next)!=null?lr:"Next",{currentStep:v,nextStep:C,prevStep:g,canProceed:a$2,context:b,updateOrg:c$1,updateContext:m,toggleDataCategory:B,togglePurpose:J,addProcessor:Z,removeProcessor:or,sections:er,customSections:h,sectionOverrides:F,editSectionContent:ir,addCustomSection:jr,removeCustomSection:qr,reorderSections:Or,complianceResult:ar,applyFix:Hr,handleExportPDF:Wr,handleExportDOCX:Gr,handleExportHTML:Ur,handleExportMarkdown:Vr,lastSavedAt:Xr,isLoading:Yr}=a({adapter:n,onComplete:p,initialContext:d$1}),nr=(D,K)=>{let O=URL.createObjectURL(D),H=document.createElement("a");H.href=O,H.download=K,H.click(),URL.revokeObjectURL(O);},Jr=()=>d(null,null,function*(){let D=yield Wr();nr(D,"privacy-policy.pdf");}),Kr=()=>d(null,null,function*(){let D=yield Gr();nr(D,"privacy-policy.docx");}),Qr=()=>{let D=Ur();navigator.clipboard.writeText(D).catch(()=>{let K=new Blob([D],{type:"text/html"}),O=URL.createObjectURL(K),H=window.open(O,"_blank");H?H.addEventListener("load",()=>URL.revokeObjectURL(O)):URL.revokeObjectURL(O);});},Zr=()=>{let D=Vr();navigator.clipboard.writeText(D).catch(()=>{let K=new Blob([D],{type:"text/markdown"});nr(K,"privacy-policy.md");});};return Yr?jsxs("div",{"data-ndpr-component":"adaptive-policy-wizard",className:a$1("flex items-center justify-center min-h-64 text-gray-400 dark:text-gray-500",r==null?void 0:r.root,e),"aria-busy":"true","aria-label":"Loading policy wizard",children:[jsxs("svg",{className:"animate-spin w-6 h-6 mr-2",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),jsx("span",{className:"ndpr-text-sm",children:"Loading\u2026"})]}):jsx("div",{"data-ndpr-component":"adaptive-policy-wizard",className:a$1("min-h-screen bg-gray-50 dark:bg-gray-900",r==null?void 0:r.root,e),children:jsxs("div",{className:a$1("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",r==null?void 0:r.container,e),children:[jsxs("div",{className:a$1("flex items-center justify-between mb-6",r==null?void 0:r.topBar,e),children:[jsx("h1",{className:a$1("text-2xl font-bold ndpr-text-foreground",r==null?void 0:r.wizardTitle,e),children:i}),jsx(zr,{lastSavedAt:Xr,isSaving:false,hasError:false,classNames:r,unstyled:e})]}),jsx("div",{className:a$1("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-4 mb-6",r==null?void 0:r.stepIndicatorWrapper,e),children:jsx(yr,{currentStep:v,classNames:r,unstyled:e})}),jsxs("div",{className:a$1("flex flex-col lg:flex-row gap-6 items-start",r==null?void 0:r.panels,e),children:[jsxs("main",{"aria-live":"polite",className:a$1("flex-1 min-w-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6",r==null?void 0:r.mainPanel,e),children:[v===1&&jsx(Cr,{context:b,onUpdateOrg:c$1,classNames:r,unstyled:e}),v===2&&jsx(kr,{categories:b.dataCategories,onToggle:B,classNames:r,unstyled:e}),v===3&&jsx(Pr,{context:b,onTogglePurpose:J,onUpdateContext:m,onAddProcessor:Z,onRemoveProcessor:or,classNames:r,unstyled:e}),v===4&&jsx(Ar,{sections:er,customSections:h,sectionOverrides:F,complianceResult:ar,onEditSection:ir,onAddCustomSection:jr,onRemoveCustomSection:qr,onReorderSection:Or,onExportPDF:Jr,onExportDOCX:Kr,onExportHTML:Qr,onExportMarkdown:Zr,classNames:r,unstyled:e}),jsxs("div",{className:a$1("flex items-center justify-between mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",r==null?void 0:r.navigation,e),children:[jsx("button",{type:"button",onClick:g,disabled:v===1,className:a$1("px-4 py-2 bg-gray-200 dark:bg-gray-700 ndpr-text-foreground rounded-md text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors",r==null?void 0:r.backButton,e),children:u}),jsx("div",{className:"flex items-center gap-2",children:jsxs("span",{className:a$1("ndpr-form-field__hint",r==null?void 0:r.stepCounter,e),children:["Step ",v," of 4"]})}),v<4?jsx("button",{type:"button",onClick:C,disabled:!a$2,className:a$1("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-colors",r==null?void 0:r.nextButton,e),children:l}):jsx("span",{})]})]}),jsx("aside",{className:a$1("w-full lg:w-80 flex-shrink-0",r==null?void 0:r.sidebarWrapper,e),children:jsx(Mr,{complianceResult:ar,onFix:Hr,classNames:r,unstyled:e})})]})]})})};
|
|
2
|
+
export{_o as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkQHW4UKGJ_js=require('./chunk-QHW4UKGJ.js'),chunkAME4HJR4_js=require('./chunk-AME4HJR4.js'),chunkYDKWD6MQ_js=require('./chunk-YDKWD6MQ.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),Nr=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Nr__default=/*#__PURE__*/_interopDefault(Nr);var cr=["Organization","Data Collection","Processing","Review & Export"],yr=({currentStep:n,classNames:p,unstyled:r})=>jsxRuntime.jsx("nav",{"data-ndpr-component":"policy-step-indicator","aria-label":"Policy wizard progress",className:chunkAME4HJR4_js.a("w-full flex items-center justify-between px-2 py-4",p==null?void 0:p.root,r),children:cr.map((e,d)=>{let t=d+1,i=t<n,u=t===n,v=d===cr.length-1;return jsxRuntime.jsxs(Nr__default.default.Fragment,{children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex flex-col items-center gap-1",p==null?void 0:p.stepWrapper,r),children:[jsxRuntime.jsx("div",{"aria-current":u?"step":void 0,"aria-label":`Step ${t}: ${e}${i?" (completed)":u?" (current)":""}`,className:chunkAME4HJR4_js.a(["flex items-center justify-center rounded-full border-2 font-semibold transition-all",i?"w-8 h-8 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))]":u?"w-9 h-9 bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] shadow-md":"w-8 h-8 bg-white dark:bg-gray-900 border-gray-300 dark:border-gray-600 text-gray-400 dark:text-gray-500"].join(" "),i?p==null?void 0:p.stepCompleted:u?p==null?void 0:p.stepCurrent:p==null?void 0:p.stepUpcoming,r),children:i?jsxRuntime.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsxRuntime.jsx("span",{className:"text-xs leading-none",children:t})}),jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(["text-xs font-medium hidden sm:block",i||u?"text-[rgb(var(--ndpr-primary))]":"ndpr-card__subtitle"].join(" "),p==null?void 0:p.stepLabel,r),children:e})]}),!v&&jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a(["flex-1 h-0.5 mx-2",i?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-700"].join(" "),p==null?void 0:p.connector,r),"aria-hidden":"true"})]},t)})});var $="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",rt="block text-sm font-medium ndpr-text-muted mb-1",A=({id:n,label:p,required:r,description:e,children:d,classNames:t,unstyled:i})=>{let u=e?`${n}-desc`:void 0;return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex flex-col",t==null?void 0:t.field,i),children:[jsxRuntime.jsxs("label",{htmlFor:n,className:chunkAME4HJR4_js.a(rt,t==null?void 0:t.label,i),children:[p,r&&jsxRuntime.jsx("span",{className:"text-red-500 ml-0.5","aria-hidden":"true",children:"*"})]}),e&&jsxRuntime.jsx("p",{id:u,className:"text-xs ndpr-text-muted mb-1",children:e}),d]})},Cr=({context:n,onUpdateOrg:p,classNames:r,unstyled:e})=>{var i,u,l;let d=Nr.useId(),t=n.org;return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-about",className:chunkAME4HJR4_js.a("ndpr-form-section",r==null?void 0:r.root,e),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Organisation Details"}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",r==null?void 0:r.subheading,e),children:["Tell us about your organisation. Fields marked ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})," are required."]})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 md:grid-cols-2 gap-4",r==null?void 0:r.grid,e),children:[jsxRuntime.jsx(A,{id:`${d}-org-name`,label:"Organisation Name",required:true,classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-org-name`,type:"text",value:t.name,onChange:v=>p({name:v.target.value}),placeholder:"Acme Corporation",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${d}-website`,label:"Website",required:true,classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-website`,type:"url",value:t.website,onChange:v=>p({website:v.target.value}),placeholder:"https://example.com",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${d}-privacy-email`,label:"Privacy Contact Email",required:true,classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-privacy-email`,type:"email",value:t.privacyEmail,onChange:v=>p({privacyEmail:v.target.value}),placeholder:"privacy@example.com",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e),"aria-required":"true"})}),jsxRuntime.jsx(A,{id:`${d}-industry`,label:"Industry",classNames:r,unstyled:e,children:jsxRuntime.jsxs("select",{id:`${d}-industry`,value:t.industry,onChange:v=>p({industry:v.target.value}),className:chunkAME4HJR4_js.a($,r==null?void 0:r.select,e),children:[jsxRuntime.jsx("option",{value:"fintech",children:"Fintech"}),jsxRuntime.jsx("option",{value:"healthcare",children:"Healthcare"}),jsxRuntime.jsx("option",{value:"ecommerce",children:"E-commerce"}),jsxRuntime.jsx("option",{value:"saas",children:"SaaS"}),jsxRuntime.jsx("option",{value:"education",children:"Education"}),jsxRuntime.jsx("option",{value:"government",children:"Government"}),jsxRuntime.jsx("option",{value:"other",children:"Other"})]})}),jsxRuntime.jsx(A,{id:`${d}-dpo-name`,label:"Data Protection Officer (DPO) Name",classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-dpo-name`,type:"text",value:(i=t.dpoName)!=null?i:"",onChange:v=>p({dpoName:v.target.value}),placeholder:"Jane Smith",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})}),jsxRuntime.jsx(A,{id:`${d}-dpo-email`,label:"DPO Email",classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-dpo-email`,type:"email",value:(u=t.dpoEmail)!=null?u:"",onChange:v=>p({dpoEmail:v.target.value}),placeholder:"dpo@example.com",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})}),jsxRuntime.jsx(A,{id:`${d}-address`,label:"Registered Address",classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-address`,type:"text",value:(l=t.address)!=null?l:"",onChange:v=>p({address:v.target.value}),placeholder:"1 Victoria Island, Lagos, Nigeria",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})}),jsxRuntime.jsx(A,{id:`${d}-org-size`,label:"Organisation Size",classNames:r,unstyled:e,children:jsxRuntime.jsxs("select",{id:`${d}-org-size`,value:t.orgSize,onChange:v=>p({orgSize:v.target.value}),className:chunkAME4HJR4_js.a($,r==null?void 0:r.select,e),children:[jsxRuntime.jsx("option",{value:"startup",children:"Startup (1\u201350 employees)"}),jsxRuntime.jsx("option",{value:"midsize",children:"Mid-size (51\u2013500 employees)"}),jsxRuntime.jsx("option",{value:"enterprise",children:"Enterprise (500+ employees)"})]})}),jsxRuntime.jsx(A,{id:`${d}-country`,label:"Country of Operation",classNames:r,unstyled:e,children:jsxRuntime.jsx("input",{id:`${d}-country`,type:"text",value:t.country,onChange:v=>p({country:v.target.value}),placeholder:"Nigeria",className:chunkAME4HJR4_js.a($,r==null?void 0:r.input,e)})})]})]})};var tt={identity:"Identity",financial:"Financial",behavioral:"Behavioural",sensitive:"Sensitive",children:"Children"},ot=["identity","financial","behavioral","sensitive","children"],et=["sensitive","children"],kr=({categories:n,onToggle:p,classNames:r,unstyled:e})=>{let d=ot.reduce((t,i)=>{let u=n.filter(l=>l.group===i);return u.length>0&&(t[i]=u),t},{});return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-data",className:chunkAME4HJR4_js.a("space-y-8",r==null?void 0:r.root,e),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Data Categories"}),jsxRuntime.jsx("p",{id:"data-categories-desc",className:chunkAME4HJR4_js.a("ndpr-form-field__hint",r==null?void 0:r.subheading,e),children:"Select the categories of personal data your organisation collects. You must select at least one."})]}),Object.entries(d).map(([t,i])=>{let u=et.includes(t);return jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-3",r==null?void 0:r.group,e),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-2",r==null?void 0:r.groupHeader,e),children:[jsxRuntime.jsx("h3",{className:chunkAME4HJR4_js.a("text-sm font-semibold uppercase tracking-wide ndpr-text-muted",r==null?void 0:r.groupTitle,e),children:tt[t]}),u&&jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("text-xs font-medium ndpr-text-warning bg-amber-50 dark:bg-amber-900/20 px-2 py-0.5 rounded-full",r==null?void 0:r.sensitiveTag,e),children:"Sensitive"})]}),u&&jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("text-xs ndpr-text-warning",r==null?void 0:r.sensitiveWarning,e),children:t==="children"?"Processing children's data requires parental consent under NDPA Section 31 and imposes heightened obligations.":"Sensitive/special-category data requires explicit consent and additional safeguards under NDPA Section 30."}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",r==null?void 0:r.cardsGrid,e),children:i.map(l=>jsxRuntime.jsx("button",{type:"button",onClick:()=>p(l.id),"aria-pressed":l.selected,className:chunkAME4HJR4_js.a(["text-left rounded-lg border p-4 transition-all cursor-pointer focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",l.selected?"bg-[rgb(var(--ndpr-primary))]/5 border-[rgb(var(--ndpr-primary))] dark:bg-[rgb(var(--ndpr-primary))]/10":"bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"].join(" "),r==null?void 0:r.card,e),children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a(["mt-0.5 w-4 h-4 rounded border-2 flex-shrink-0 flex items-center justify-center",l.selected?"bg-[rgb(var(--ndpr-primary))] border-[rgb(var(--ndpr-primary))]":"border-gray-300 dark:border-gray-600"].join(" "),r==null?void 0:r.checkbox,e),"aria-hidden":"true",children:l.selected&&jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-[rgb(var(--ndpr-primary-foreground))]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",r==null?void 0:r.cardLabel,e),children:l.label}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("text-xs ndpr-text-muted mt-1 leading-relaxed",r==null?void 0:r.cardDataPoints,e),children:l.dataPoints.join(", ")})]})]})},l.id))})]},t)})]})};var nt=[{value:"service_delivery",label:"Service Delivery",description:"Processing required to deliver the core product or service."},{value:"marketing",label:"Marketing & Communications",description:"Sending promotional messages, newsletters or offers."},{value:"analytics",label:"Analytics & Insights",description:"Analysing usage patterns to improve the product."},{value:"research",label:"Research & Development",description:"Using data to develop new features or products."},{value:"legal_compliance",label:"Legal Compliance",description:"Meeting statutory, regulatory or contractual obligations."},{value:"fraud_prevention",label:"Fraud Prevention & Security",description:"Detecting and preventing fraudulent activity."}],dr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",pr="ndpr-card ndpr-card--compact",gr=({id:n,checked:p,onChange:r})=>jsxRuntime.jsx("button",{id:n,type:"button",role:"switch","aria-checked":p,onClick:()=>r(!p),className:["relative inline-flex h-6 w-11 flex-shrink-0 rounded-full border-2 border-transparent cursor-pointer transition-colors focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))]",p?"bg-[rgb(var(--ndpr-primary))]":"bg-gray-200 dark:bg-gray-600"].join(" "),children:jsxRuntime.jsx("span",{"aria-hidden":"true",className:["pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition-transform",p?"translate-x-5":"translate-x-0"].join(" ")})}),Pr=({context:n,onTogglePurpose:p,onUpdateContext:r,onAddProcessor:e,onRemoveProcessor:d,classNames:t,unstyled:i})=>{let u=Nr.useId(),[l,v]=Nr.useState({name:"",purpose:"",country:""}),[C,g]=Nr.useState(false),a=()=>{let{name:b,purpose:c,country:m}=l;!b.trim()||!c.trim()||!m.trim()||(e({name:b.trim(),purpose:c.trim(),country:m.trim()}),v({name:"",purpose:"",country:""}),g(false));};return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-processing",className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",t==null?void 0:t.heading,i),children:"Processing Details"}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",t==null?void 0:t.subheading,i),children:"Define how and why you process personal data."})]}),jsxRuntime.jsxs("section",{className:chunkAME4HJR4_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"purposes-heading",children:[jsxRuntime.jsx("h3",{id:"purposes-heading",className:chunkAME4HJR4_js.a("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Processing Purposes"}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",t==null?void 0:t.sectionDescription,i),children:"Select all purposes for which you process personal data. At least one is required."}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("space-y-3",t==null?void 0:t.purposeList,i),children:nt.map(b=>{let c=n.purposes.includes(b.value),m=`${u}-purpose-${b.value}`,B=`${u}-purpose-desc-${b.value}`;return jsxRuntime.jsxs("label",{htmlFor:m,className:chunkAME4HJR4_js.a("flex items-start gap-3 cursor-pointer group",t==null?void 0:t.purposeItem,i),children:[jsxRuntime.jsx("input",{id:m,type:"checkbox",checked:c,onChange:()=>p(b.value),"aria-describedby":B,className:chunkAME4HJR4_js.a("mt-0.5 h-4 w-4 rounded border-gray-300 dark:border-gray-600 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))] cursor-pointer",t==null?void 0:t.purposeCheckbox,i)}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.purposeLabel,i),children:b.label}),jsxRuntime.jsx("p",{id:B,className:chunkAME4HJR4_js.a("ndpr-form-field__hint",t==null?void 0:t.purposeDescription,i),children:b.description})]})]},b.value)})})]}),jsxRuntime.jsxs("section",{className:chunkAME4HJR4_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"thirdparty-heading",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("h3",{id:"thirdparty-heading",className:chunkAME4HJR4_js.a("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Third-Party Data Sharing"}),jsxRuntime.jsx(gr,{id:`${u}-thirdparty-toggle`,checked:n.thirdPartyProcessors.length>0||C,onChange:b=>{b?g(true):(n.thirdPartyProcessors.forEach((c,m)=>d(0)),g(false));}})]}),(n.thirdPartyProcessors.length>0||C)&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.processorSection,i),children:[n.thirdPartyProcessors.length>0&&jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("overflow-x-auto",t==null?void 0:t.processorTable,i),children:jsxRuntime.jsxs("table",{className:"w-full text-sm",children:[jsxRuntime.jsx("thead",{children:jsxRuntime.jsxs("tr",{className:chunkAME4HJR4_js.a("text-left text-xs font-medium ndpr-text-muted border-b border-gray-200 dark:border-gray-700",t==null?void 0:t.tableHeader,i),children:[jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Name"}),jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Purpose"}),jsxRuntime.jsx("th",{className:"pb-2 pr-4",children:"Country"}),jsxRuntime.jsx("th",{className:"pb-2"})]})}),jsxRuntime.jsx("tbody",{className:"divide-y divide-gray-100 dark:divide-gray-700",children:n.thirdPartyProcessors.map((b,c)=>jsxRuntime.jsxs("tr",{children:[jsxRuntime.jsx("td",{className:chunkAME4HJR4_js.a("py-2 pr-4 ndpr-text-foreground",t==null?void 0:t.tableCell,i),children:b.name}),jsxRuntime.jsx("td",{className:chunkAME4HJR4_js.a("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:b.purpose}),jsxRuntime.jsx("td",{className:chunkAME4HJR4_js.a("py-2 pr-4 ndpr-text-muted",t==null?void 0:t.tableCell,i),children:b.country}),jsxRuntime.jsx("td",{className:"py-2",children:jsxRuntime.jsx("button",{type:"button",onClick:()=>d(c),className:chunkAME4HJR4_js.a("text-red-500 hover:ndpr-text-destructive dark:hover:text-red-300 text-xs font-medium",t==null?void 0:t.removeButton,i),"aria-label":`Remove ${b.name}`,children:"Remove"})})]},c))})]})}),C?jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 sm:grid-cols-3 gap-3 items-end",t==null?void 0:t.processorForm,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${u}-proc-name`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Processor Name"}),jsxRuntime.jsx("input",{id:`${u}-proc-name`,type:"text",placeholder:"Processor name",value:l.name,onChange:b=>v(c=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{name:b.target.value})),"aria-required":"true",className:chunkAME4HJR4_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${u}-proc-purpose`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Purpose"}),jsxRuntime.jsx("input",{id:`${u}-proc-purpose`,type:"text",placeholder:"Purpose",value:l.purpose,onChange:b=>v(c=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{purpose:b.target.value})),"aria-required":"true",className:chunkAME4HJR4_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{htmlFor:`${u}-proc-country`,className:"block text-xs font-medium ndpr-text-muted mb-1",children:"Country"}),jsxRuntime.jsx("input",{id:`${u}-proc-country`,type:"text",placeholder:"Country",value:l.country,onChange:b=>v(c=>chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},c),{country:b.target.value})),"aria-required":"true",className:chunkAME4HJR4_js.a(dr,t==null?void 0:t.input,i)})]}),jsxRuntime.jsxs("div",{className:"sm:col-span-3 flex gap-2",children:[jsxRuntime.jsx("button",{type:"button",onClick:a,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--primary ndpr-button--sm",t==null?void 0:t.addButton,i),children:"Add Processor"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>g(false),className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--secondary ndpr-button--sm",t==null?void 0:t.cancelButton,i),children:"Cancel"})]})]}):jsxRuntime.jsxs("button",{type:"button",onClick:()=>g(true),className:chunkAME4HJR4_js.a("flex items-center gap-1 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",t==null?void 0:t.addLink,i),children:[jsxRuntime.jsx("span",{"aria-hidden":"true",children:"+"})," Add processor"]})]})]}),jsxRuntime.jsxs("section",{className:chunkAME4HJR4_js.a(pr,t==null?void 0:t.section,i),"aria-labelledby":"disclosures-heading",children:[jsxRuntime.jsx("h3",{id:"disclosures-heading",className:chunkAME4HJR4_js.a("text-base font-semibold ndpr-text-foreground",t==null?void 0:t.sectionTitle,i),children:"Additional Disclosures"}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.disclosureList,i),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{id:`${u}-cross-border-label`,className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Cross-border Data Transfers"}),jsxRuntime.jsx("p",{id:`${u}-cross-border-desc`,className:chunkAME4HJR4_js.a("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you transfer personal data outside Nigeria? This triggers NDPA Chapter 6 obligations."})]}),jsxRuntime.jsx(gr,{id:`${u}-cross-border-toggle`,checked:n.hasCrossBorderTransfer,onChange:b=>r({hasCrossBorderTransfer:b})})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-start justify-between gap-4",t==null?void 0:t.disclosureItem,i),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{id:`${u}-automated-label`,className:chunkAME4HJR4_js.a("text-sm font-medium ndpr-text-foreground",t==null?void 0:t.disclosureLabel,i),children:"Automated Decision-Making / Profiling"}),jsxRuntime.jsx("p",{id:`${u}-automated-desc`,className:chunkAME4HJR4_js.a("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.disclosureDescription,i),children:"Do you use algorithms or automated systems to make decisions about individuals? Requires disclosure under NDPA Section 37."})]}),jsxRuntime.jsx(gr,{id:`${u}-automated-toggle`,checked:n.hasAutomatedDecisions,onChange:b=>r({hasAutomatedDecisions:b})})]})]})]})]})};var Sr=({section:n,index:p,isCustom:r,isEditing:e,editedContent:d,onEdit:t,onSaveEdit:i,onCancelEdit:u,onMoveUp:l,onMoveDown:v,onDelete:C,classNames:g,unstyled:a})=>{let[b,c]=Nr.useState(d!=null?d:n.template);return Nr.useEffect(()=>{d!==void 0&&c(d);},[d]),Nr.useEffect(()=>{e&&c(d!=null?d:n.template);},[e,d,n.template]),jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-section-card",className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 space-y-3",g==null?void 0:g.root,a),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-start justify-between gap-2",g==null?void 0:g.header,a),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-3 min-w-0",g==null?void 0:g.titleRow,a),children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("flex-shrink-0 w-7 h-7 rounded-full bg-gray-100 dark:bg-gray-700 ndpr-text-muted text-xs font-semibold flex items-center justify-center",g==null?void 0:g.sectionNumber,a),"aria-hidden":"true",children:p+1}),jsxRuntime.jsxs("h4",{className:chunkAME4HJR4_js.a("text-sm font-semibold ndpr-text-foreground truncate",g==null?void 0:g.sectionTitle,a),children:[n.title,r&&jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("ml-2 text-xs font-normal ndpr-text-muted bg-gray-100 dark:bg-gray-700 px-1.5 py-0.5 rounded",g==null?void 0:g.customBadge,a),children:"Custom"})]})]}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-1 flex-shrink-0",g==null?void 0:g.actions,a),children:[l&&jsxRuntime.jsx("button",{type:"button",onClick:l,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${n.title}" up`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})})}),v&&jsxRuntime.jsx("button",{type:"button",onClick:v,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--icon",g==null?void 0:g.moveButton,a),"aria-label":`Move "${n.title}" down`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}),!e&&jsxRuntime.jsx("button",{type:"button",onClick:t,className:chunkAME4HJR4_js.a("p-1.5 text-gray-400 hover:text-[rgb(var(--ndpr-primary))] rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.editButton,a),"aria-label":`Edit "${n.title}"`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),r&&C&&jsxRuntime.jsx("button",{type:"button",onClick:C,className:chunkAME4HJR4_js.a("p-1.5 text-gray-400 hover:text-red-500 dark:hover:text-red-400 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",g==null?void 0:g.deleteButton,a),"aria-label":`Delete "${n.title}"`,children:jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]}),e?jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-2",g==null?void 0:g.editArea,a),children:[jsxRuntime.jsx("textarea",{value:b,onChange:m=>c(m.target.value),rows:8,className:chunkAME4HJR4_js.a("w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm font-mono resize-y",g==null?void 0:g.textarea,a),"aria-label":`Edit content for ${n.title}`}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex gap-2",g==null?void 0:g.editActions,a),children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>i(b),className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--primary ndpr-button--sm",g==null?void 0:g.saveButton,a),children:"Save"}),jsxRuntime.jsx("button",{type:"button",onClick:u,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--secondary ndpr-button--sm",g==null?void 0:g.cancelButton,a),children:"Cancel"})]})]}):jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("text-sm ndpr-text-muted leading-relaxed line-clamp-4 whitespace-pre-wrap",g==null?void 0:g.content,a),children:n.template})]})};var Rr="w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md bg-white dark:bg-gray-800 ndpr-text-foreground focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] text-sm",Lr=({onAdd:n,nextOrder:p,classNames:r,unstyled:e})=>{let d=Nr.useId(),[t,i]=Nr.useState(""),[u,l]=Nr.useState(""),[v,C]=Nr.useState(""),g=()=>{if(!t.trim()){C("Section title is required.");return}if(!u.trim()){C("Section content is required.");return}C(""),n({title:t.trim(),content:u.trim(),order:p}),i(""),l("");};return jsxRuntime.jsxs("div",{"data-ndpr-component":"custom-section-form",className:chunkAME4HJR4_js.a("ndpr-card ndpr-card--compact",r==null?void 0:r.root,e),children:[jsxRuntime.jsx("h4",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.heading,e),children:"Add Custom Section"}),v&&jsxRuntime.jsx("p",{role:"alert",className:chunkAME4HJR4_js.a("text-xs ndpr-text-destructive",r==null?void 0:r.error,e),children:v}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-3",r==null?void 0:r.fields,e),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`${d}-custom-section-title`,className:chunkAME4HJR4_js.a("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Section Title ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsxRuntime.jsx("input",{id:`${d}-custom-section-title`,type:"text",value:t,onChange:a=>{i(a.target.value),v&&C("");},placeholder:"e.g. Cookie Policy",className:chunkAME4HJR4_js.a(Rr,r==null?void 0:r.input,e),"aria-required":"true"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:`${d}-custom-section-content`,className:chunkAME4HJR4_js.a("block text-xs font-medium ndpr-text-muted mb-1",r==null?void 0:r.label,e),children:["Content ",jsxRuntime.jsx("span",{className:"text-red-500","aria-hidden":"true",children:"*"})]}),jsxRuntime.jsx("textarea",{id:`${d}-custom-section-content`,value:u,onChange:a=>{l(a.target.value),v&&C("");},placeholder:"Write the section content here...",rows:5,className:chunkAME4HJR4_js.a(`${Rr} resize-y`,r==null?void 0:r.textarea,e),"aria-required":"true"})]})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("flex items-center gap-2",r==null?void 0:r.footer,e),children:jsxRuntime.jsx("button",{type:"button",onClick:g,className:chunkAME4HJR4_js.a("ndpr-button ndpr-button--primary ndpr-button--sm",r==null?void 0:r.addButton,e),children:"Add Section"})})]})};var Fr={compliant:{bg:"ndpr-alert ndpr-alert--success",text:"ndpr-text-success",border:"border-green-200 dark:border-green-700"},nearly_compliant:{bg:"bg-amber-50 dark:bg-amber-900/20",text:"ndpr-text-warning",border:"border-amber-200 dark:border-amber-700"},not_compliant:{bg:"ndpr-alert ndpr-alert--destructive",text:"ndpr-text-destructive",border:"border-red-200 dark:border-red-700"}},gt={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},N=({icon:n,label:p,description:r,actionLabel:e,loading:d,onClick:t,classNames:i,unstyled:u})=>jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-4 flex flex-col gap-3",i==null?void 0:i.formatCard,u),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center gap-3",i==null?void 0:i.formatHeader,u),children:[jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("w-10 h-10 rounded-lg bg-gray-100 dark:bg-gray-700 flex items-center justify-center flex-shrink-0",i==null?void 0:i.formatIcon,u),"aria-hidden":"true",children:n}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-section-heading",i==null?void 0:i.formatLabel,u),children:p}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",i==null?void 0:i.formatDescription,u),children:r})]})]}),jsxRuntime.jsx("button",{type:"button",onClick:t,disabled:d,className:chunkAME4HJR4_js.a("w-full px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-60 disabled:cursor-not-allowed flex items-center justify-center gap-2",i==null?void 0:i.formatButton,u),children:d?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{className:"animate-spin w-4 h-4",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),"Generating\u2026"]}):e})]}),Er=({complianceResult:n,onExportPDF:p,onExportDOCX:r,onExportHTML:e,onExportMarkdown:d,classNames:t,unstyled:i})=>{var c;let[u,l]=Nr.useState(false),[v,C]=Nr.useState(false),g=(c=Fr[n.rating])!=null?c:Fr.not_compliant,a=()=>chunkRFPLZDIO_js.d(null,null,function*(){l(true);try{yield p();}finally{l(false);}}),b=()=>chunkRFPLZDIO_js.d(null,null,function*(){C(true);try{yield r();}finally{C(false);}});return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-export-panel",className:chunkAME4HJR4_js.a("ndpr-form-section",t==null?void 0:t.root,i),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`rounded-lg border p-4 flex items-center gap-4 ${g.bg} ${g.border}`,t==null?void 0:t.complianceSummary,i),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a(`text-3xl font-bold ${g.text}`,t==null?void 0:t.complianceScore,i),"aria-label":`Compliance score: ${n.percentage}%`,children:[n.percentage,"%"]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-sm font-semibold ${g.text}`,t==null?void 0:t.complianceRating,i),children:gt[n.rating]}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("text-xs ndpr-text-muted mt-0.5",t==null?void 0:t.complianceDetail,i),children:[n.score," / ",n.maxScore," points \u2022"," ",n.gaps.length," gap",n.gaps.length!==1?"s":""," remaining"]})]})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h3",{className:chunkAME4HJR4_js.a("ndpr-section-heading",t==null?void 0:t.formatsHeading,i),children:"Export Format"}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("grid grid-cols-1 sm:grid-cols-2 gap-3",t==null?void 0:t.formatsGrid,i),children:[jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-red-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 7v-1h4v1h-4zm0-3v-1h4v1h-4zm-2-5h8v1H8v-1z"})}),label:"PDF",description:"Professional formatted document, ideal for publishing.",actionLabel:"Download PDF",loading:u,onClick:a,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-5 8v-5h1.5l1 3 1-3H13v5h-1v-3.5l-.75 2.25h-.5L10 13.5V17H9zm5-1.5h.75c.55 0 .75-.25.75-.75 0-.4-.2-.65-.75-.65H14V15.5zm1 1.5h-2v-4h2c1.1 0 1.75.6 1.75 1.5 0 .55-.25.95-.65 1.15.5.2.8.65.8 1.2 0 1-.65 1.65-1.9 1.65V17zm-.25-1c.6 0 .9-.25.9-.75 0-.45-.3-.75-.9-.75H14V16h.75z"})}),label:"DOCX",description:"Editable Word document for further customisation.",actionLabel:"Download DOCX",loading:v,onClick:b,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsxs("svg",{className:"w-5 h-5 text-orange-500",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15H9V8h2v9zm4 0h-2V8h2v9z"}),jsxRuntime.jsx("path",{d:"M9.5 6.5h1v1h-1zm4 0h1v1h-1z"}),jsxRuntime.jsx("path",{d:"M5 5h14v2H5zm0 12h14v2H5z"})]}),label:"HTML",description:"Copy-ready HTML to embed on your website.",actionLabel:"Copy HTML",onClick:e,classNames:t,unstyled:i}),jsxRuntime.jsx(N,{icon:jsxRuntime.jsx("svg",{className:"w-5 h-5 ndpr-text-muted",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:jsxRuntime.jsx("path",{d:"M3 5h18v2H3V5zm0 4h12v2H3V9zm0 4h18v2H3v-2zm0 4h12v2H3v-2z"})}),label:"Markdown",description:"Plain-text format for documentation or Git repos.",actionLabel:"Copy Markdown",onClick:d,classNames:t,unstyled:i})]})]})]})};var Ar=({sections:n,customSections:p,sectionOverrides:r,complianceResult:e,onEditSection:d,onAddCustomSection:t,onRemoveCustomSection:i,onReorderSection:u,onExportPDF:l,onExportDOCX:v,onExportHTML:C,onExportMarkdown:g,classNames:a,unstyled:b})=>{let[c,m]=Nr.useState(null),[B,J]=Nr.useState(false),Z=new Set(p.map(h=>h.id)),or=(h,F)=>{d(h,F),m(null);},er=n.length>0?Math.max(...n.map(h=>{var F;return (F=h.order)!=null?F:0}))+1:1;return jsxRuntime.jsxs("div",{"data-ndpr-component":"policy-step-review",className:chunkAME4HJR4_js.a("ndpr-form-section",a==null?void 0:a.root,b),children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",a==null?void 0:a.heading,b),children:"Review & Export"}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",a==null?void 0:a.subheading,b),children:"Review your generated policy sections, reorder or edit content, then export."})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("space-y-3",a==null?void 0:a.sectionList,b),"aria-live":"polite",children:n.map((h,F)=>jsxRuntime.jsx(Sr,{section:r[h.id]?chunkRFPLZDIO_js.b(chunkRFPLZDIO_js.a({},h),{template:r[h.id]}):h,index:F,isCustom:Z.has(h.id),isEditing:c===h.id,editedContent:r[h.id],onEdit:()=>m(h.id),onSaveEdit:ir=>or(h.id,ir),onCancelEdit:()=>m(null),onMoveUp:F>0?()=>u(h.id,"up"):void 0,onMoveDown:F<n.length-1?()=>u(h.id,"down"):void 0,onDelete:Z.has(h.id)?()=>i(h.id):void 0,classNames:a,unstyled:b},h.id))}),!B&&jsxRuntime.jsxs("button",{type:"button",onClick:()=>J(true),className:chunkAME4HJR4_js.a("flex items-center gap-2 text-sm text-[rgb(var(--ndpr-primary))] hover:underline font-medium",a==null?void 0:a.addSectionButton,b),children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("w-5 h-5 rounded-full border-2 border-[rgb(var(--ndpr-primary))] flex items-center justify-center text-xs font-bold leading-none",a==null?void 0:a.addSectionIcon,b),"aria-hidden":"true",children:"+"}),"Add Custom Section"]}),B&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("space-y-2",a==null?void 0:a.customFormWrapper,b),children:[jsxRuntime.jsx(Lr,{onAdd:h=>{t(h),J(false);},nextOrder:er,classNames:a,unstyled:b}),jsxRuntime.jsx("button",{type:"button",onClick:()=>J(false),className:chunkAME4HJR4_js.a("text-sm ndpr-text-muted hover:underline",a==null?void 0:a.cancelCustomForm,b),children:"Cancel"})]}),jsxRuntime.jsx("hr",{className:chunkAME4HJR4_js.a("border-gray-200 dark:border-gray-700",a==null?void 0:a.divider,b)}),jsxRuntime.jsx(Er,{complianceResult:e,onExportPDF:l,onExportDOCX:v,onExportHTML:C,onExportMarkdown:g,classNames:a,unstyled:b})]})};var Tr={compliant:{stroke:"stroke-green-500 dark:stroke-green-400",text:"ndpr-text-success"},nearly_compliant:{stroke:"stroke-amber-500 dark:stroke-amber-400",text:"ndpr-text-warning"},not_compliant:{stroke:"stroke-red-500 dark:stroke-red-400",text:"ndpr-text-destructive"}},at={compliant:"Compliant",nearly_compliant:"Nearly Compliant",not_compliant:"Not Compliant"},Ir=({score:n,maxScore:p,rating:r,classNames:e,unstyled:d})=>{var C,g;let t=p>0?Math.round(n/p*100):0,i=(C=Tr[r])!=null?C:Tr.not_compliant,u=36,l=2*Math.PI*u,v=l-t/100*l;return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-score-ring",className:chunkAME4HJR4_js.a("flex flex-col items-center gap-2",e==null?void 0:e.root,d),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("relative w-24 h-24",e==null?void 0:e.svgWrapper,d),children:[jsxRuntime.jsxs("svg",{className:"w-24 h-24 -rotate-90",viewBox:"0 0 96 96","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:"stroke-gray-200 dark:stroke-gray-700",strokeWidth:"8"}),jsxRuntime.jsx("circle",{cx:"48",cy:"48",r:u,fill:"none",className:i.stroke,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:v,style:{transition:"stroke-dashoffset 0.5s ease-out"}})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("absolute inset-0 flex flex-col items-center justify-center",e==null?void 0:e.centerText,d),children:jsxRuntime.jsxs("span",{className:chunkAME4HJR4_js.a(`text-xl font-bold leading-none ${i.text}`,e==null?void 0:e.scoreValue,d),"aria-label":`${t}% compliance score`,children:[t,"%"]})})]}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-xs font-semibold text-center ${i.text}`,e==null?void 0:e.ratingLabel,d),children:(g=at[r])!=null?g:r}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("text-xs ndpr-text-muted text-center",e==null?void 0:e.scoreDetail,d),children:[n," / ",p," pts"]})]})};var bt={critical:"ndpr-text-destructive",important:"ndpr-text-warning",recommended:"ndpr-text-info"},_r=({gap:n,isPassed:p,onFix:r,classNames:e,unstyled:d})=>{let[t,i]=Nr.useState(false);return jsxRuntime.jsxs("div",{"data-ndpr-component":"compliance-requirement-item",className:chunkAME4HJR4_js.a("border-b border-gray-100 dark:border-gray-700 last:border-0 py-2",e==null?void 0:e.root,d),children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>!p&&i(u=>!u),className:chunkAME4HJR4_js.a("w-full flex items-start gap-2 text-left group",e==null?void 0:e.row,d),"aria-expanded":p?void 0:t,"aria-disabled":p,children:[jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a(["mt-0.5 flex-shrink-0 w-4 h-4 rounded-full flex items-center justify-center",p?"bg-green-500":n.severity==="critical"?"bg-red-500":n.severity==="important"?"bg-amber-500":"bg-blue-400"].join(" "),e==null?void 0:e.statusIcon,d),"aria-hidden":"true",children:p?jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):jsxRuntime.jsx("svg",{className:"w-2.5 h-2.5 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-1",children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-xs font-medium ${p?"ndpr-text-muted":"ndpr-text-foreground"}`,e==null?void 0:e.requirementLabel,d),children:n.requirement}),!p&&jsxRuntime.jsx("svg",{className:`flex-shrink-0 w-3 h-3 text-gray-400 transition-transform ${t?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),jsxRuntime.jsxs("p",{className:chunkAME4HJR4_js.a("text-xs text-gray-400 dark:text-gray-500 mt-0.5",e==null?void 0:e.ndpaSection,d),children:["NDPA ",n.ndpaSection]})]})]}),!p&&t&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("mt-2 ml-6 space-y-2",e==null?void 0:e.detail,d),children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-xs ${bt[n.severity]}`,e==null?void 0:e.message,d),children:n.message}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{r(n.requirementId),i(false);},className:chunkAME4HJR4_js.a("text-xs font-medium px-3 py-1 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded hover:bg-[rgb(var(--ndpr-primary-hover))]",e==null?void 0:e.fixButton,d),children:n.fixLabel})]})]})};function ft(n,p){let r=p.map(t=>({gap:{requirementId:t,requirement:t.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "),ndpaSection:"\u2014",severity:"recommended",message:"",fixType:"fill_field",fixLabel:""},isPassed:true})),e=n.map(t=>({gap:t,isPassed:false})),d={critical:0,important:1,recommended:2};return e.sort((t,i)=>d[t.gap.severity]-d[i.gap.severity]),[...e,...r]}var Mr=({complianceResult:n,onFix:p,classNames:r,unstyled:e})=>{let[d,t]=Nr.useState(false),i=ft(n.gaps,n.passed);return jsxRuntime.jsxs("aside",{"data-ndpr-component":"compliance-checker-sidebar",className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",r==null?void 0:r.root,e),"aria-label":"NDPA compliance checker",children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/50",r==null?void 0:r.header,e),children:[jsxRuntime.jsx("h2",{className:chunkAME4HJR4_js.a("ndpr-section-heading",r==null?void 0:r.title,e),children:"NDPA Compliance"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>t(u=>!u),className:chunkAME4HJR4_js.a("p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",r==null?void 0:r.collapseButton,e),"aria-expanded":!d,"aria-label":d?"Expand compliance checker":"Collapse compliance checker",children:jsxRuntime.jsx("svg",{className:`w-4 h-4 transition-transform ${d?"-rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})})]}),!d&&jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("p-4 space-y-4",r==null?void 0:r.body,e),children:[jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("flex justify-center",r==null?void 0:r.ringWrapper,e),children:jsxRuntime.jsx(Ir,{score:n.score,maxScore:n.maxScore,rating:n.rating,classNames:r,unstyled:e})}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("grid grid-cols-3 gap-2 text-center",r==null?void 0:r.statsRow,e),children:[{count:n.gaps.filter(u=>u.severity==="critical").length,label:"Critical",color:"ndpr-text-destructive"},{count:n.gaps.filter(u=>u.severity==="important").length,label:"Important",color:"ndpr-text-warning"},{count:n.passed.length,label:"Passed",color:"ndpr-text-success"}].map(({count:u,label:l,color:v})=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a(`text-base font-bold ${v}`,r==null?void 0:r.statValue,e),children:u}),jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",r==null?void 0:r.statLabel,e),children:l})]},l))}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("overflow-y-auto max-h-80",r==null?void 0:r.requirementsList,e),children:i.length===0?jsxRuntime.jsx("p",{className:chunkAME4HJR4_js.a("ndpr-empty-state",r==null?void 0:r.emptyState,e),children:"No requirements to display."}):i.map(({gap:u,isPassed:l})=>jsxRuntime.jsx(_r,{gap:u,isPassed:l,onFix:p,classNames:r,unstyled:e},u.requirementId))})]})]})};function xt(n){let p=Date.now()-n;return p<1e4?"just now":p<6e4?`${Math.floor(p/1e3)}s ago`:p<36e5?`${Math.floor(p/6e4)}m ago`:new Date(n).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}var zr=({lastSavedAt:n,isSaving:p,hasError:r,classNames:e,unstyled:d})=>{let t="idle";if(p?t="saving":r?t="error":n!==null&&(t="saved"),t==="idle")return null;let i=t==="saving"?"Saving\u2026":t==="error"?"Unable to save":`Draft saved ${n?xt(n):""}`;return jsxRuntime.jsxs("div",{"data-ndpr-component":"draft-save-indicator",role:"status","aria-live":"polite","aria-atomic":"true",className:chunkAME4HJR4_js.a(`flex items-center gap-1.5 ${t==="error"?"text-red-500 dark:text-red-400":t==="saving"?"ndpr-card__subtitle":"ndpr-text-success"}`,e==null?void 0:e.root,d),children:[t==="saving"&&jsxRuntime.jsxs("svg",{className:"animate-spin w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),t==="saved"&&jsxRuntime.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:3,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}),t==="error"&&jsxRuntime.jsx("svg",{className:"w-3 h-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),jsxRuntime.jsx("span",{className:chunkAME4HJR4_js.a("text-xs font-medium",e==null?void 0:e.text,d),children:i})]})};var _o=({adapter:n,onComplete:p,classNames:r,unstyled:e,initialContext:d})=>{var vr,br,lr;let t=chunkYDKWD6MQ_js.c(),i=(vr=t.policy.wizardTitle)!=null?vr:"Privacy Policy Builder",u=(br=t.common.back)!=null?br:"Back",l=(lr=t.common.next)!=null?lr:"Next",{currentStep:v,nextStep:C,prevStep:g,canProceed:a,context:b,updateOrg:c,updateContext:m,toggleDataCategory:B,togglePurpose:J,addProcessor:Z,removeProcessor:or,sections:er,customSections:h,sectionOverrides:F,editSectionContent:ir,addCustomSection:jr,removeCustomSection:qr,reorderSections:Or,complianceResult:ar,applyFix:Hr,handleExportPDF:Wr,handleExportDOCX:Gr,handleExportHTML:Ur,handleExportMarkdown:Vr,lastSavedAt:Xr,isLoading:Yr}=chunkQHW4UKGJ_js.a({adapter:n,onComplete:p,initialContext:d}),nr=(D,K)=>{let O=URL.createObjectURL(D),H=document.createElement("a");H.href=O,H.download=K,H.click(),URL.revokeObjectURL(O);},Jr=()=>chunkRFPLZDIO_js.d(null,null,function*(){let D=yield Wr();nr(D,"privacy-policy.pdf");}),Kr=()=>chunkRFPLZDIO_js.d(null,null,function*(){let D=yield Gr();nr(D,"privacy-policy.docx");}),Qr=()=>{let D=Ur();navigator.clipboard.writeText(D).catch(()=>{let K=new Blob([D],{type:"text/html"}),O=URL.createObjectURL(K),H=window.open(O,"_blank");H?H.addEventListener("load",()=>URL.revokeObjectURL(O)):URL.revokeObjectURL(O);});},Zr=()=>{let D=Vr();navigator.clipboard.writeText(D).catch(()=>{let K=new Blob([D],{type:"text/markdown"});nr(K,"privacy-policy.md");});};return Yr?jsxRuntime.jsxs("div",{"data-ndpr-component":"adaptive-policy-wizard",className:chunkAME4HJR4_js.a("flex items-center justify-center min-h-64 text-gray-400 dark:text-gray-500",r==null?void 0:r.root,e),"aria-busy":"true","aria-label":"Loading policy wizard",children:[jsxRuntime.jsxs("svg",{className:"animate-spin w-6 h-6 mr-2",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",children:[jsxRuntime.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4l3-3-3-3v4a10 10 0 100 10l-1.73-3A8 8 0 014 12z"})]}),jsxRuntime.jsx("span",{className:"ndpr-text-sm",children:"Loading\u2026"})]}):jsxRuntime.jsx("div",{"data-ndpr-component":"adaptive-policy-wizard",className:chunkAME4HJR4_js.a("min-h-screen bg-gray-50 dark:bg-gray-900",r==null?void 0:r.root,e),children:jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",r==null?void 0:r.container,e),children:[jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center justify-between mb-6",r==null?void 0:r.topBar,e),children:[jsxRuntime.jsx("h1",{className:chunkAME4HJR4_js.a("text-2xl font-bold ndpr-text-foreground",r==null?void 0:r.wizardTitle,e),children:i}),jsxRuntime.jsx(zr,{lastSavedAt:Xr,isSaving:false,hasError:false,classNames:r,unstyled:e})]}),jsxRuntime.jsx("div",{className:chunkAME4HJR4_js.a("bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-4 mb-6",r==null?void 0:r.stepIndicatorWrapper,e),children:jsxRuntime.jsx(yr,{currentStep:v,classNames:r,unstyled:e})}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex flex-col lg:flex-row gap-6 items-start",r==null?void 0:r.panels,e),children:[jsxRuntime.jsxs("main",{"aria-live":"polite",className:chunkAME4HJR4_js.a("flex-1 min-w-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg p-6",r==null?void 0:r.mainPanel,e),children:[v===1&&jsxRuntime.jsx(Cr,{context:b,onUpdateOrg:c,classNames:r,unstyled:e}),v===2&&jsxRuntime.jsx(kr,{categories:b.dataCategories,onToggle:B,classNames:r,unstyled:e}),v===3&&jsxRuntime.jsx(Pr,{context:b,onTogglePurpose:J,onUpdateContext:m,onAddProcessor:Z,onRemoveProcessor:or,classNames:r,unstyled:e}),v===4&&jsxRuntime.jsx(Ar,{sections:er,customSections:h,sectionOverrides:F,complianceResult:ar,onEditSection:ir,onAddCustomSection:jr,onRemoveCustomSection:qr,onReorderSection:Or,onExportPDF:Jr,onExportDOCX:Kr,onExportHTML:Qr,onExportMarkdown:Zr,classNames:r,unstyled:e}),jsxRuntime.jsxs("div",{className:chunkAME4HJR4_js.a("flex items-center justify-between mt-8 pt-4 border-t border-gray-200 dark:border-gray-700",r==null?void 0:r.navigation,e),children:[jsxRuntime.jsx("button",{type:"button",onClick:g,disabled:v===1,className:chunkAME4HJR4_js.a("px-4 py-2 bg-gray-200 dark:bg-gray-700 ndpr-text-foreground rounded-md text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors",r==null?void 0:r.backButton,e),children:u}),jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:jsxRuntime.jsxs("span",{className:chunkAME4HJR4_js.a("ndpr-form-field__hint",r==null?void 0:r.stepCounter,e),children:["Step ",v," of 4"]})}),v<4?jsxRuntime.jsx("button",{type:"button",onClick:C,disabled:!a,className:chunkAME4HJR4_js.a("px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-[rgb(var(--ndpr-primary-foreground))] rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed transition-colors",r==null?void 0:r.nextButton,e),children:l}):jsxRuntime.jsx("span",{})]})]}),jsxRuntime.jsx("aside",{className:chunkAME4HJR4_js.a("w-full lg:w-80 flex-shrink-0",r==null?void 0:r.sidebarWrapper,e),children:jsxRuntime.jsx(Mr,{complianceResult:ar,onFix:Hr,classNames:r,unstyled:e})})]})]})})};
|
|
2
|
+
exports.a=_o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b}from'./chunk-V5TZJJWU.mjs';import {c}from'./chunk-ZJYULEER.mjs';import {createContext,useMemo,useContext,Component}from'react';import {jsx,jsxs}from'react/jsx-runtime';var p=createContext({}),l=class extends Component{constructor(e){super(e);this.reset=()=>{this.setState({error:null});};this.state={error:null};}static getDerivedStateFromError(e){return {error:e}}componentDidCatch(e,r){var o,n;(n=(o=this.props).onError)==null||n.call(o,e,r);}render(){var r;let{error:e}=this.state;if(e){let{fallback:o}=this.props;return typeof o=="function"?o(e,this.reset):o!==void 0?o:jsxs("div",{role:"alert",style:{padding:"16px",border:"1px solid #e53e3e",borderRadius:"4px",backgroundColor:"#fff5f5",color:"#c53030"},children:[jsx("h3",{style:{margin:"0 0 8px 0",fontSize:"16px"},children:(r=this.props.errorTitle)!=null?r:"Something went wrong"}),jsx("p",{style:{margin:0,fontSize:"14px"},children:e.message})]})}return this.props.children}},x=o=>{var n=o,{children:t,fallback:c$1,onError:e}=n,r=c(n,["children","fallback","onError"]);var u;let m=useMemo(()=>{if(!r.theme)return;let i={};return r.theme.primary&&(i["--ndpr-primary"]=r.theme.primary),r.theme.primaryHover&&(i["--ndpr-primary-hover"]=r.theme.primaryHover),r.theme.primaryForeground&&(i["--ndpr-primary-foreground"]=r.theme.primaryForeground),Object.keys(i).length>0?i:void 0},[r.theme]),y=(u=useMemo(()=>b(r.locale),[r.locale]).common.error)!=null?u:"Something went wrong";return jsx(p.Provider,{value:r,children:jsx(l,{fallback:c$1,onError:e,errorTitle:y,children:m?jsx("div",{style:m,children:t}):t})})};function C(){return useContext(p)}function S(){let{locale:t}=useContext(p);return useMemo(()=>b(t),[t])}export{x as a,C as b,S as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-YTU4FNM2.mjs';import {
|
|
1
|
+
import {a}from'./chunk-YTU4FNM2.mjs';import {a as a$2}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-FRQFU44F.mjs';import {a as a$1,b}from'./chunk-ZJYULEER.mjs';import {useState,useRef,useEffect,useCallback}from'react';import {createPortal}from'react-dom';import {jsx,jsxs}from'react/jsx-runtime';var Vn=({options:d,onSave:bn,title:A,description:y,acceptAllButtonText:P,rejectAllButtonText:E,customizeButtonText:D,saveButtonText:z,position:pn="bottom",variant:a$3="bar",zIndex:x=9999,version:C="1.0",show:h,manageStorage:L=true,storageKey:w="ndpr_consent",className:V="",buttonClassName:j="",primaryButtonClassName:ln="",secondaryButtonClassName:fn="",classNames:n,unstyled:o,onAnalytics:k})=>{var U,X,Z,T,m,N,nn,tn,en;let c$1=c(),gn=(U=A!=null?A:c$1.consent.title)!=null?U:"We Value Your Privacy",vn=(X=y!=null?y:c$1.consent.description)!=null?X:"We use cookies and similar technologies to provide our services and enhance your experience. Your consent is collected in accordance with NDPA Sections 25-26.",_n=(Z=P!=null?P:c$1.consent.acceptAll)!=null?Z:"Accept All",Cn=(T=E!=null?E:c$1.consent.rejectAll)!=null?T:"Reject All",hn=(m=D!=null?D:c$1.consent.customize)!=null?m:"Customize",an=(N=z!=null?z:c$1.consent.savePreferences)!=null?N:"Save Preferences",kn=(nn=c$1.consent.selectAll)!=null?nn:"Select All",Sn=(tn=c$1.consent.deselectAll)!=null?tn:"Deselect All",[b$1,u]=useState(false),[f,I]=useState(false),[S,B]=useState({}),[s,Bn]=useState(false),Rn=a({active:b$1}),$=useRef(null),q=useRef(false);useEffect(()=>{Bn(true);},[]);let p=useCallback((t,e)=>{k==null||k(a$1({action:t,timestamp:Date.now(),version:C},e!==void 0?{categories:e}:{}));},[k,C]);useEffect(()=>{let t={};if(d.forEach(e=>{t[e.id]=e.defaultValue||false;}),B(t),h===void 0)if(!L)u(true);else {let e=localStorage.getItem(w);if(e)try{JSON.parse(e).version!==C?u(!0):u(!1);}catch(G){u(true);}else u(true);}else u(h);},[d,w,C,L]),useEffect(()=>{h!==void 0&&u(h);},[h]);let An=()=>{let t={};d.forEach(e=>{t[e.id]=true;}),p("accepted_all",t),H(t);},J=()=>{let t={};d.forEach(e=>{t[e.id]=e.required||false;}),p("rejected_all",t),H(t);},yn=(t,e)=>{B(G=>b(a$1({},G),{[t]:e}));},Pn=()=>{let t={};d.forEach(e=>{t[e.id]=true;}),B(t);},En=()=>{let t={};d.forEach(e=>{t[e.id]=e.required||false;}),B(t);},W=d.length>0&&d.every(t=>S[t.id]),Dn=()=>{p("customized",S),H(S);},H=t=>{let e={consents:t,timestamp:Date.now(),version:C,method:f?"customize":"banner",hasInteracted:true};L&&localStorage.setItem(w,JSON.stringify(e)),bn(e),u(false),I(false);};if(useEffect(()=>{if(!b$1)return;let t=e=>{e.key==="Escape"&&(p("dismissed"),J());};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[b$1,p,d,f]),useEffect(()=>{b$1&&!q.current&&(q.current=true,p("shown")),b$1||(q.current=false);},[b$1,p]),useEffect(()=>{if(f&&$.current){let t=$.current;t.style.maxHeight="0px",t.style.opacity="0",t.offsetHeight,t.style.maxHeight=`${t.scrollHeight}px`,t.style.opacity="1";}},[f]),!b$1)return null;let g=a$3==="modal"?"center":pn,Y=g==="inline",O=g==="center",v=["ndpr-consent-banner"];a$3!=="bar"&&v.push(`ndpr-consent-banner--${a$3}`),g==="top"?v.push("ndpr-consent-banner--top"):g==="bottom"?v.push("ndpr-consent-banner--bottom"):g==="inline"&&v.push("ndpr-consent-banner--inline"),V&&v.push(V);let zn=v.join(" "),K=`ndpr-consent-banner__button ndpr-consent-banner__button--primary ${j} ${ln}`.trim(),Ln=`ndpr-consent-banner__button ndpr-consent-banner__button--secondary ${j} ${fn}`.trim(),wn=`ndpr-consent-banner__button ndpr-consent-banner__button--ghost ${j}`.trim(),jn=(n==null?void 0:n.primaryButton)||(n==null?void 0:n.acceptButton)||K,Q=(n==null?void 0:n.secondaryButton)||(n==null?void 0:n.rejectButton)||Ln,In=(n==null?void 0:n.customizeButton)||wn,$n=(n==null?void 0:n.saveButton)||K,F=jsx("div",{ref:Rn,tabIndex:-1,"data-ndpr-component":"consent-banner","data-ndpr-variant":a$3,"data-ndpr-position":g,className:a$2(zn,n==null?void 0:n.root,o),style:!Y&&!O?{zIndex:x}:void 0,role:"dialog","aria-modal":O||void 0,"aria-labelledby":"consent-banner-title","aria-describedby":"consent-banner-description",children:jsxs("div",{className:a$2("ndpr-consent-banner__container",n==null?void 0:n.container,o),children:[jsx("h2",{id:"consent-banner-title",className:a$2("ndpr-consent-banner__title",n==null?void 0:n.title,o),children:gn}),jsx("p",{id:"consent-banner-description",className:a$2("ndpr-consent-banner__description",n==null?void 0:n.description,o),children:vn}),f&&jsxs("div",{ref:$,className:a$2("ndpr-consent-banner__customize-panel",n==null?void 0:n.customizePanel,o),children:[jsx("div",{className:o?"":"ndpr-consent-banner__select-all-row",children:jsx("button",{type:"button",onClick:W?En:Pn,className:a$2("ndpr-consent-banner__select-all-button",n==null?void 0:n.selectAllButton,o),children:W?Sn:kn})}),jsx("div",{className:a$2("ndpr-consent-banner__options-list",n==null?void 0:n.optionsList,o),children:d.map(t=>jsxs("div",{className:a$2("ndpr-consent-banner__option",n==null?void 0:n.optionItem,o),children:[jsx("input",{id:`consent-${t.id}`,type:"checkbox",checked:S[t.id]||false,onChange:e=>yn(t.id,e.target.checked),disabled:t.required,className:a$2("ndpr-consent-banner__option-checkbox",n==null?void 0:n.optionCheckbox,o)}),jsxs("div",{className:o?"":"ndpr-consent-banner__option-text",children:[jsxs("label",{htmlFor:`consent-${t.id}`,className:a$2("ndpr-consent-banner__option-label",n==null?void 0:n.optionLabel,o),children:[t.label,t.required&&jsx("span",{className:o?"":"ndpr-consent-banner__required-marker",children:" *"})]}),jsx("p",{className:a$2("ndpr-consent-banner__option-description",n==null?void 0:n.optionDescription,o),children:t.description})]})]},t.id))}),jsxs("div",{className:a$2("ndpr-consent-banner__buttons",n==null?void 0:n.buttonGroup,o),children:[jsx("button",{onClick:Dn,className:a$2($n,n==null?void 0:n.saveButton,o),children:an}),jsx("button",{onClick:()=>I(false),className:a$2(Q,n==null?void 0:n.rejectButton,o),children:(en=c$1.common.back)!=null?en:"Back"})]})]}),!f&&jsxs("div",{className:a$2("ndpr-consent-banner__buttons",n==null?void 0:n.buttonGroup,o),children:[jsx("button",{onClick:An,className:a$2(jn,n==null?void 0:n.acceptButton,o),children:_n}),jsx("button",{onClick:J,className:a$2(Q,n==null?void 0:n.rejectButton,o),children:Cn}),jsx("button",{onClick:()=>I(true),className:a$2(In,n==null?void 0:n.customizeButton,o),children:hn})]}),jsx("div",{className:a$2("ndpr-consent-banner__footer-text",void 0,o),children:'By clicking "Accept All", you agree to the use of ALL cookies. Visit our Cookie Policy to learn more.'})]})});if(Y)return F;if(O){let t=jsx("div",{className:o?"":"ndpr-consent-banner__overlay",style:{zIndex:x},children:F});return s?createPortal(t,document.body):null}return s?createPortal(F,document.body):null};export{Vn as a};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-WTGKZX7J.mjs';import {b,a as a$2}from'./chunk-ITCY2Z66.mjs';import {a}from'./chunk-SFGW37LE.mjs';import {c}from'./chunk-FRQFU44F.mjs';import {useState,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var Ie=({breachData:l,initialAssessment:f={},onComplete:A,title:H,description:L,submitButtonText:$,className:q="",buttonClassName:G="",classNames:x={},unstyled:o=false,showBreachSummary:c$1=true,showNotificationRequirements:D=true})=>{var N,b,C;let Q=c(),le=(N=H!=null?H:Q.breach.riskAssessmentTitle)!=null?N:"Breach Risk Assessment",se=(b=L!=null?L:Q.breach.riskAssessmentDescription)!=null?b:"Assess the risk level of this data breach to determine notification requirements under NDPA Section 40.",Z=(C=$!=null?$:Q.dpia.complete)!=null?C:"Complete Assessment",[E,me]=useState(f.confidentialityImpact||3),[v,T]=useState(f.integrityImpact||3),[k,U]=useState(f.availabilityImpact||3),[P,V]=useState(f.harmLikelihood||3),[_,W]=useState(f.harmSeverity||3),[F,Y]=useState(f.risksToRightsAndFreedoms!==void 0?f.risksToRightsAndFreedoms:false),[O,X]=useState(f.highRisksToRightsAndFreedoms!==void 0?f.highRisksToRightsAndFreedoms:false),[J,ce]=useState(f.justification||""),[z,I]=useState(0),[h,w]=useState("low"),[g,R]=useState(false),[ae,ie]=useState(0),[j,ne]=useState(0),[re,ee]=useState(false),[u]=useState(()=>Date.now());useEffect(()=>{let fe=E*.2+v*.1+k*.1+P*.3+_*.3;I(Number(fe.toFixed(1)));let te;fe<2?te="low":fe<3?te="medium":fe<4?te="high":te="critical",w(te),R(F||te==="high"||te==="critical");let Ne=l.discoveredAt+4320*60*1e3;ie(Ne);let Re=Date.now(),ye=(Ne-Re)/(3600*1e3);ne(Number(ye.toFixed(1)));},[E,v,k,P,_,F,l.discoveredAt]);let y=d=>new Date(d).toLocaleString(),B=d=>{d.preventDefault();let K={id:f.id||`assessment_${Date.now()}`,breachId:l.id,assessedAt:Date.now(),assessor:f.assessor||{name:"Assessment User",role:"Data Protection Officer",email:"dpo@example.com"},confidentialityImpact:E,integrityImpact:v,availabilityImpact:k,harmLikelihood:P,harmSeverity:_,overallRiskScore:z,riskLevel:h,risksToRightsAndFreedoms:F,highRisksToRightsAndFreedoms:O,justification:J};A(K),ee(true);},t=d=>{switch(d){case 1:return "Minimal";case 2:return "Low";case 3:return "Moderate";case 4:return "High";case 5:return "Severe";default:return "Unknown"}},m=d=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--warning",critical:"ndpr-badge ndpr-badge--destructive"}[d]}`,x.riskBadge,o),children:d.charAt(0).toUpperCase()+d.slice(1)});return jsxs("div",{"data-ndpr-component":"breach-risk-assessment",className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${q}`,x.root,o),children:[jsx("h2",{className:a("ndpr-section-heading",x.title,o),children:le}),jsx("p",{className:"ndpr-card__subtitle",children:se}),c$1&&jsxs("div",{className:"ndpr-panel",children:[jsx("h3",{className:"text-lg font-medium mb-2",children:"Breach Summary"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Title:"})," ",l.title]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Discovered:"})," ",y(l.discoveredAt)]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Status:"})," ",l.status.charAt(0).toUpperCase()+l.status.slice(1)]})]}),jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Data Types:"})," ",l.dataTypes.join(", ")]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",l.affectedSystems.join(", ")]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",l.estimatedAffectedSubjects||"Unknown"]})]})]})]}),re?jsxs("div",{children:[jsxs("div",{className:"ndpr-alert ndpr-alert--info",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Assessment Results"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Overall Risk Level:"})," ",m(h)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risk Score:"})," ",z," / 5"]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Assessed On:"})," ",y(u)]})]}),jsxs("div",{children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",F?"Yes":"No"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",O?"Yes":"No"]})]})]}),jsxs("div",{className:"mt-3",children:[jsx("p",{className:"text-sm mb-1",children:jsx("span",{className:"font-medium",children:"Justification:"})}),jsx("p",{className:"text-sm bg-white dark:bg-gray-800 p-2 rounded",children:J})]})]}),D&&jsxs("div",{className:a(`mb-6 p-4 rounded-md ${g?j>24?"ndpr-alert ndpr-alert--warning":"ndpr-alert ndpr-alert--destructive":"ndpr-alert ndpr-alert--success"}`,x.notificationStatus,o),children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Requirements"}),g?jsxs("div",{children:[jsx("p",{className:`text-sm font-bold mb-2 ${j>24?"ndpr-text-warning":"ndpr-text-destructive"}`,children:"NDPC Notification Required"}),jsx("p",{className:"text-sm mb-2",children:"Under the NDPA (Section 40), this breach must be reported to the NDPC within 72 hours of discovery."}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Notification Deadline:"})," ",y(ae)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Time Remaining:"})," ",jsx("span",{className:j<24?"ndpr-text-destructive font-bold":"",children:j>0?`${j} hours`:"Deadline passed"})]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Data Subject Notification:"})," ",O?"Required (NDPA Section 40(4))":"Not required unless directed by NDPC"]})]}):jsxs("div",{children:[jsx("p",{className:"text-sm font-bold mb-2 ndpr-text-success",children:"NDPC Notification Not Required"}),jsx("p",{className:"text-sm mb-2",children:"Based on this assessment, this breach does not need to be reported to the NDPC."}),jsx("p",{className:"text-sm mb-2",children:"However, the breach should still be documented internally for compliance purposes."})]}),jsxs("div",{className:"mt-3 text-sm",children:[jsx("p",{className:"font-medium",children:"Next Steps:"}),jsx("ul",{className:"list-disc pl-5 mt-1",children:g?jsxs(Fragment,{children:[jsx("li",{children:"Prepare a notification report for the NDPC"}),jsx("li",{children:"Document all aspects of the breach and your response"}),O&&jsx("li",{children:"Prepare communications for affected data subjects"}),jsx("li",{children:"Implement measures to mitigate the impact of the breach"})]}):jsxs(Fragment,{children:[jsx("li",{children:"Document the breach and this assessment in your internal records"}),jsx("li",{children:"Implement measures to prevent similar breaches in the future"}),jsx("li",{children:"Review and update security measures as needed"})]})})]})]}),jsx("button",{onClick:()=>ee(false),className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${G}`,x.primaryButton||x.submitButton,o),children:"Edit Assessment"})]}):jsx("form",{onSubmit:B,children:jsxs("div",{className:"ndpr-form-section",children:[jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Impact Assessment"}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"confidentialityImpact",className:"ndpr-form-field__label",children:["Confidentiality Impact (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",children:"How much has the confidentiality of data been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"confidentialityImpact",min:"1",max:"5",step:"1",value:E,onChange:d=>me(parseInt(d.target.value)),className:a("ndpr-form-field__range",x.slider,o)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[t(E)," (",E,")"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"integrityImpact",className:"ndpr-form-field__label",children:["Integrity Impact (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",children:"How much has the integrity of data been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"integrityImpact",min:"1",max:"5",step:"1",value:v,onChange:d=>T(parseInt(d.target.value)),className:a("ndpr-form-field__range",x.slider,o)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[t(v)," (",v,")"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"availabilityImpact",className:"ndpr-form-field__label",children:["Availability Impact (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",children:"How much has the availability of data or systems been compromised?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"availabilityImpact",min:"1",max:"5",step:"1",value:k,onChange:d=>U(parseInt(d.target.value)),className:a("ndpr-form-field__range",x.slider,o)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[t(k)," (",k,")"]})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Risk to Data Subjects"}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"harmLikelihood",className:"ndpr-form-field__label",children:["Likelihood of Harm (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",children:"How likely is it that data subjects will experience harm?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"harmLikelihood",min:"1",max:"5",step:"1",value:P,onChange:d=>V(parseInt(d.target.value)),className:a("ndpr-form-field__range",x.slider,o)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[t(P)," (",P,")"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"harmSeverity",className:"ndpr-form-field__label",children:["Severity of Harm (1-5)",jsx("span",{className:"ml-2 text-sm ndpr-text-muted",children:"How severe would the harm be to affected data subjects?"})]}),jsxs("div",{className:"flex items-center",children:[jsx("input",{type:"range",id:"harmSeverity",min:"1",max:"5",step:"1",value:_,onChange:d=>W(parseInt(d.target.value)),className:a("ndpr-form-field__range",x.slider,o)}),jsxs("span",{className:"ml-3 w-24 text-sm",children:[t(_)," (",_,")"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("input",{type:"checkbox",id:"risksToRightsAndFreedoms",checked:F,onChange:d=>Y(d.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"risksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a risk to the rights and freedoms of data subjects"})]}),jsx("p",{className:"text-xs ndpr-text-muted ml-6",children:"Under the NDPA (Section 40), breaches that pose a risk to rights and freedoms must be reported to the NDPC within 72 hours."})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("div",{className:"flex items-center mb-2",children:[jsx("input",{type:"checkbox",id:"highRisksToRightsAndFreedoms",checked:O,onChange:d=>X(d.target.checked),className:"h-4 w-4 rounded border-gray-300 text-[rgb(var(--ndpr-primary))] focus:ring-[rgb(var(--ndpr-ring))]"}),jsx("label",{htmlFor:"highRisksToRightsAndFreedoms",className:"ml-2 text-sm font-medium",children:"This breach poses a high risk to the rights and freedoms of data subjects"})]}),jsx("p",{className:"text-xs ndpr-text-muted ml-6",children:"Under the NDPA (Section 40(4)), breaches that pose a high risk to rights and freedoms also require notification to affected data subjects without undue delay."})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Overall Assessment"}),jsxs("div",{className:"ndpr-panel",children:[jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsx("span",{className:"font-medium",children:"Overall Risk Score:"}),jsxs("span",{className:a("",x.riskScore,o),children:[z," / 5"]})]}),jsxs("div",{className:"flex items-center justify-between",children:[jsx("span",{className:"font-medium",children:"Risk Level:"}),m(h)]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsxs("label",{htmlFor:"justification",className:"ndpr-form-field__label",children:["Justification for Assessment ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"justification",value:J,onChange:d=>ce(d.target.value),rows:4,placeholder:"Explain the reasoning behind your assessment, including any factors that influenced your decision.",className:"ndpr-form-field__input",required:true})]})]}),jsxs("div",{className:"ndpr-alert ndpr-alert--info",children:[jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"ndpr-text-info text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This assessment will determine if notification is required for this breach."})]}),jsx("div",{className:"mt-6",children:jsx("button",{type:"submit",className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${G}`,x.primaryButton||x.submitButton,o),children:Z})})]})})]})};var je=({breachReports:l,riskAssessments:f,regulatoryNotifications:A,onSelectBreach:H,onRequestAssessment:L,onRequestNotification:$,title:q,description:G,className:x="",buttonClassName:o="",classNames:c$1={},unstyled:D=false,showBreachDetails:Q=true,showNotificationTimeline:le=true,showDeadlineAlerts:se=true})=>{var u,y,B;let Z=c(),E=(u=q!=null?q:Z.breach.notificationManagerTitle)!=null?u:"Breach Notification Manager",me=(y=G!=null?G:Z.breach.notificationManagerDescription)!=null?y:"Manage data breach notifications and track compliance with NDPA Section 40 requirements.",[v,T]=useState(null),[k,U]=useState(l),[P,V]=useState("all"),[_,W]=useState(""),[F,Y]=useState("discoveredAt"),[O,X]=useState("desc");useEffect(()=>{let t=[...l];if(P!=="all"&&(t=t.filter(m=>m.status===P)),_){let m=_.toLowerCase();t=t.filter(N=>N.title.toLowerCase().includes(m)||N.description.toLowerCase().includes(m)||N.affectedSystems.some(b=>b.toLowerCase().includes(m))||N.dataTypes.some(b=>b.toLowerCase().includes(m)));}t.sort((m,N)=>{let b=0;switch(F){case "title":b=m.title.localeCompare(N.title);break;case "discoveredAt":b=m.discoveredAt-N.discoveredAt;break;case "status":b=m.status.localeCompare(N.status);break;case "riskLevel":let C=f.find(ue=>ue.breachId===m.id),d=f.find(ue=>ue.breachId===N.id),K=(C==null?void 0:C.riskLevel)||"unknown",pe=(d==null?void 0:d.riskLevel)||"unknown";b=K.localeCompare(pe);break;default:b=m.discoveredAt-N.discoveredAt;}return O==="asc"?b:-b}),U(t);},[l,P,_,F,O,f]),useEffect(()=>{k.length>0&&(v&&k.some(m=>m.id===v)||T(k[0].id));},[k,v]);let J=t=>{T(t),H&&H(t);},ce=()=>{v&&L&&L(v);},z=()=>{v&&$&&$(v);},I=t=>new Date(t).toLocaleString(),h=v?l.find(t=>t.id===v):null,w=v?f.find(t=>t.breachId===v):null,g=v?A.find(t=>t.breachId===v):null,R=h?ae(h,w):null;function ae(t,m){let N=a$1(t,m||void 0),b=t.discoveredAt+N.timeframeHours*60*60*1e3;return {ndpcNotificationRequired:N.notificationRequired,ndpcNotificationDeadline:b,dataSubjectNotificationRequired:(m==null?void 0:m.highRisksToRightsAndFreedoms)||false,justification:N.justification}}function ie(t){let m=Date.now(),N=(t-m)/(3600*1e3);return Number(N.toFixed(1))}let j=t=>t?jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{low:"ndpr-badge ndpr-badge--success",medium:"ndpr-badge ndpr-badge--warning",high:"ndpr-badge ndpr-badge--warning",critical:"ndpr-badge ndpr-badge--destructive"}[t]}`,c$1.statusBadge,D),children:t.charAt(0).toUpperCase()+t.slice(1)}):null,ne=t=>jsx("span",{className:a(`px-2 py-1 rounded text-xs font-medium ${{ongoing:"ndpr-badge ndpr-badge--destructive",contained:"ndpr-badge ndpr-badge--warning",resolved:"ndpr-badge ndpr-badge--success"}[t]||"ndpr-badge ndpr-badge--neutral"}`,c$1.statusBadge,D),children:t.charAt(0).toUpperCase()+t.slice(1)}),re=()=>{if(!h||!R)return null;if(!R.ndpcNotificationRequired)return jsxs("div",{"data-ndpr-component":"breach-notification-manager",className:"ndpr-alert ndpr-alert--success",children:[jsx("p",{className:"text-sm ndpr-text-success font-medium",children:"Notification Not Required"}),jsx("p",{className:"text-xs ndpr-text-success mt-1",children:"Based on the risk assessment, NDPC notification is not required for this breach."})]});if(g)return jsxs("div",{className:"ndpr-alert ndpr-alert--success",children:[jsx("p",{className:"text-sm ndpr-text-success font-medium",children:"Notification Sent"}),jsxs("p",{className:"text-xs ndpr-text-success mt-1",children:["Notification was sent to the NDPC on ",I(g.sentAt),"."]})]});let t=ie(R.ndpcNotificationDeadline);return t<=0?jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",children:[jsx("p",{className:"text-sm ndpr-text-destructive font-medium",children:"Notification Deadline Passed"}),jsx("p",{className:"text-xs ndpr-text-destructive mt-1",children:"The 72-hour deadline for NDPC notification has passed. Notification should be sent immediately."})]}):t<=24?jsxs("div",{className:"ndpr-alert ndpr-alert--destructive",children:[jsx("p",{className:"text-sm ndpr-text-destructive font-medium",children:"Urgent: Notification Due Soon"}),jsxs("p",{className:"text-xs ndpr-text-destructive mt-1",children:["Only ",t," hours remaining until the NDPC notification deadline."]})]}):jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm ndpr-text-warning font-medium",children:"Notification Required"}),jsxs("p",{className:"text-xs ndpr-text-warning mt-1",children:["NDPC notification is required by ",I(R.ndpcNotificationDeadline)," (",t," hours remaining)."]})]})},ee=()=>{if(!h)return null;let t=[{title:"Breach Discovered",date:h.discoveredAt,completed:true,description:`Breach was discovered on ${I(h.discoveredAt)}.`},{title:"Risk Assessment",date:w==null?void 0:w.assessedAt,completed:!!w,description:w?`Risk assessment completed on ${I(w.assessedAt)}.`:"Risk assessment has not been completed yet."}];return R!=null&&R.ndpcNotificationRequired&&t.push({title:"NDPC Notification",date:g==null?void 0:g.sentAt,completed:!!g,description:g?`Notification sent to the NDPC on ${I(g.sentAt)}.`:`Notification must be sent to the NDPC by ${I(R.ndpcNotificationDeadline)}.`}),R!=null&&R.dataSubjectNotificationRequired&&t.push({title:"Data Subject Notification",date:void 0,completed:false,description:"Notification to affected data subjects is required but has not been sent yet."}),jsxs("div",{className:a("mt-6",c$1.timeline,D),children:[jsx("h3",{className:"text-lg font-medium mb-4",children:"Notification Timeline"}),jsx("ol",{className:"relative border-l border-gray-200 dark:border-gray-700",children:t.map((m,N)=>jsxs("li",{className:a("mb-6 ml-4",c$1.timelineStep,D),children:[jsx("div",{className:`absolute w-3 h-3 rounded-full mt-1.5 -left-1.5 border ${m.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"}`}),jsx("time",{className:"mb-1 text-sm font-normal leading-none ndpr-text-muted",children:m.date?I(m.date):"Pending"}),jsx("h4",{className:"ndpr-section-heading",children:m.title}),jsx("p",{className:"ndpr-form-field__hint",children:m.description})]},N))})]})};return jsxs("div",{className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${x}`,c$1.root,D),children:[jsxs("div",{className:a("",c$1.header,D),children:[jsx("h2",{className:a("ndpr-section-heading",c$1.title,D),children:E}),jsx("p",{className:"ndpr-card__subtitle",children:me})]}),jsxs("div",{className:"mb-6 grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxs("div",{children:[jsx("label",{htmlFor:"statusFilter",className:"ndpr-form-field__label",children:"Status Filter"}),jsxs("select",{id:"statusFilter",value:P,onChange:t=>V(t.target.value),className:"ndpr-form-field__input",children:[jsx("option",{value:"all",children:"All Statuses"}),jsx("option",{value:"ongoing",children:"Ongoing"}),jsx("option",{value:"contained",children:"Contained"}),jsx("option",{value:"resolved",children:"Resolved"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"sortBy",className:"ndpr-form-field__label",children:"Sort By"}),jsxs("select",{id:"sortBy",value:F,onChange:t=>Y(t.target.value),className:"ndpr-form-field__input",children:[jsx("option",{value:"discoveredAt",children:"Discovery Date"}),jsx("option",{value:"title",children:"Title"}),jsx("option",{value:"status",children:"Status"}),jsx("option",{value:"riskLevel",children:"Risk Level"})]})]}),jsxs("div",{children:[jsx("label",{htmlFor:"searchTerm",className:"ndpr-form-field__label",children:"Search"}),jsx("input",{type:"text",id:"searchTerm",value:_,onChange:t=>W(t.target.value),placeholder:"Search breaches...",className:"ndpr-form-field__input"})]})]}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[jsxs("div",{className:"md:col-span-1",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Breach Reports"}),k.length===0?jsx("p",{className:"ndpr-card__subtitle",children:"No breach reports found."}):jsx("div",{className:a("space-y-2 max-h-96 overflow-y-auto pr-2",c$1.breachList,D),children:k.map(t=>{let m=f.find(d=>d.breachId===t.id),N=A.find(d=>d.breachId===t.id),b=ae(t,m),C=null;if(b!=null&&b.ndpcNotificationRequired)if(N)C=jsx("span",{className:"text-xs ndpr-text-success",children:"Notified"});else {let d=ie(b.ndpcNotificationDeadline);d<=0?C=jsx("span",{className:"text-xs ndpr-text-destructive font-bold",children:"Overdue"}):d<=24?C=jsx("span",{className:"text-xs ndpr-text-destructive",children:"Urgent"}):C=jsx("span",{className:"text-xs ndpr-text-warning",children:"Required"});}else C=jsx("span",{className:"text-xs ndpr-text-success",children:"Not Required"});return jsxs("div",{role:"button",tabIndex:0,"aria-label":`View breach ${t.title}`,"aria-selected":v===t.id,className:a(`p-3 rounded-md cursor-pointer ${v===t.id?"ndpr-alert ndpr-alert--info":"ndpr-panel"}`,c$1.breachItem,D),onClick:()=>J(t.id),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),J(t.id));},children:[jsxs("div",{className:"flex justify-between items-start mb-1",children:[jsx("h4",{className:"font-medium text-sm",children:t.title}),ne(t.status)]}),jsxs("p",{className:"text-xs ndpr-text-muted mb-1",children:["Discovered: ",new Date(t.discoveredAt).toLocaleDateString()]}),jsxs("div",{className:"flex justify-between items-center mt-2",children:[jsx("div",{children:m&&j(m.riskLevel)}),jsx("div",{children:C})]})]},t.id)})})]}),jsx("div",{className:a("md:col-span-2",c$1.detailPanel,D),children:h?jsxs("div",{children:[jsxs("div",{className:"flex justify-between items-start mb-4",children:[jsx("h3",{className:"ndpr-section-heading",children:h.title}),ne(h.status)]}),se&&jsx("div",{className:"ndpr-form-field",children:re()}),Q&&jsxs("div",{className:"mb-6",children:[jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Discovered:"})," ",I(h.discoveredAt)]}),h.occurredAt&&jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Occurred:"})," ",I(h.occurredAt)]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Reporter:"})," ",h.reporter.name]})]}),jsxs("div",{children:[jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Systems:"})," ",h.affectedSystems.join(", ")]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Data Types:"})," ",h.dataTypes.join(", ")]}),jsxs("p",{className:"ndpr-text-sm",children:[jsx("span",{className:"font-medium",children:"Affected Subjects:"})," ",h.estimatedAffectedSubjects||"Unknown"]})]})]}),jsxs("div",{className:"ndpr-form-field",children:[jsx("p",{className:"ndpr-text-sm ndpr-font-medium",children:"Description:"}),jsx("p",{className:"ndpr-panel",children:h.description})]}),h.initialActions&&jsxs("div",{children:[jsx("p",{className:"ndpr-text-sm ndpr-font-medium",children:"Initial Actions Taken:"}),jsx("p",{className:"ndpr-panel",children:h.initialActions})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Risk Assessment"}),w?jsxs("div",{className:"ndpr-panel",children:[jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsx("p",{className:"ndpr-text-sm ndpr-font-medium",children:"Risk Level:"}),j(w.riskLevel)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risk Score:"})," ",w.overallRiskScore," / 5"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Risks to Rights and Freedoms:"})," ",w.risksToRightsAndFreedoms?"Yes":"No"]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"High Risks to Rights and Freedoms:"})," ",w.highRisksToRightsAndFreedoms?"Yes":"No"]}),jsx("p",{className:"text-sm mb-1",children:jsx("span",{className:"font-medium",children:"Justification:"})}),jsx("p",{className:"text-xs ndpr-text-muted bg-white dark:bg-gray-800 p-2 rounded-md",children:w.justification})]}):jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm ndpr-text-warning",children:"Risk assessment has not been conducted yet."}),jsx("button",{onClick:ce,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${o}`,children:"Conduct Risk Assessment"})]})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"text-lg font-medium mb-3",children:"Notification Status"}),g?jsxs("div",{className:"ndpr-panel",children:[jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Notification Sent:"})," ",I(g.sentAt)]}),jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Method:"})," ",g.method.charAt(0).toUpperCase()+g.method.slice(1)]}),g.referenceNumber&&jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"Reference Number:"})," ",g.referenceNumber]}),(g.ndpcContact||g.nitdaContact)&&jsxs("p",{className:"text-sm mb-2",children:[jsx("span",{className:"font-medium",children:"NDPC Contact:"})," ",(B=g.ndpcContact||g.nitdaContact)==null?void 0:B.name]})]}):jsx("div",{children:R!=null&&R.ndpcNotificationRequired?jsxs("div",{className:"ndpr-alert ndpr-alert--warning",children:[jsx("p",{className:"text-sm ndpr-text-warning",children:"NDPC notification is required but has not been sent yet."}),jsx("button",{onClick:z,className:`mt-2 px-3 py-1 text-xs bg-yellow-600 text-white rounded hover:bg-yellow-700 ${o}`,children:"Generate Notification"})]}):jsx("div",{className:"ndpr-alert ndpr-alert--success",children:jsx("p",{className:"text-sm ndpr-text-success",children:"NDPC notification is not required for this breach."})})})]}),le&&ee()]}):jsx("div",{className:"ndpr-empty-state",children:jsx("p",{className:"ndpr-card__subtitle",children:"Select a breach to view details"})})})]})]})};var Ye=({breachData:l,assessmentData:f,organizationInfo:A,onGenerate:H,title:L,description:$,generateButtonText:q,className:G="",buttonClassName:x="",classNames:o={},unstyled:c$1=false,showPreview:D=true,allowEditing:Q=true,allowDownload:le=true,downloadFormat:se="pdf"})=>{var re,ee;let Z=c(),E=(re=L!=null?L:Z.breach.regulatoryReportTitle)!=null?re:"Generate NDPC Notification Report",me=(ee=$!=null?$:Z.breach.regulatoryReportDescription)!=null?ee:"Generate a report for submission to the NDPC in compliance with NDPA Section 40 breach notification requirements.",v=q!=null?q:"Generate Report",[T,k]=useState(""),[U,P]=useState(""),[V,_]=useState(""),[W,F]=useState(""),[Y,O]=useState("email"),[X,J]=useState(""),[ce,z]=useState(""),[I,h]=useState(false),[w,g]=useState(false);useEffect(()=>{let u=ae();k(u),h(true);},[l,f,A]);let R=u=>new Date(u).toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),ae=()=>{var N,b$1,C,d,K,pe;let y=new Date().toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"}),B=((N=l.dpoContact)==null?void 0:N.name)||A.dpoName,t=((b$1=l.dpoContact)==null?void 0:b$1.email)||A.dpoEmail,m=((C=l.dpoContact)==null?void 0:C.phone)||A.dpoPhone;return `
|
|
2
|
+
NDPC DATA BREACH NOTIFICATION
|
|
3
|
+
|
|
4
|
+
Date: ${y}
|
|
5
|
+
${l.isPhasedReport?"Report Type: PHASED / INTERIM REPORT":"Report Type: Full Report"}
|
|
6
|
+
${l.supplementsReportId?`Supplements Report ID: ${l.supplementsReportId}`:""}
|
|
7
|
+
|
|
8
|
+
Reference: NDPA Section 40 - Personal Data Breaches
|
|
9
|
+
|
|
10
|
+
ORGANIZATION DETAILS
|
|
11
|
+
-------------------
|
|
12
|
+
Organization Name: ${A.name}
|
|
13
|
+
${A.registrationNumber?`Registration Number: ${A.registrationNumber}`:""}
|
|
14
|
+
Address: ${A.address}
|
|
15
|
+
${A.website?`Website: ${A.website}`:""}
|
|
16
|
+
|
|
17
|
+
DATA PROTECTION OFFICER (Section 32 contact point)
|
|
18
|
+
----------------------
|
|
19
|
+
Name: ${B}
|
|
20
|
+
Email: ${t}
|
|
21
|
+
${m?`Phone: ${m}`:""}
|
|
22
|
+
|
|
23
|
+
BREACH DETAILS
|
|
24
|
+
-------------
|
|
25
|
+
Breach Title: ${l.title}
|
|
26
|
+
Date Discovered: ${R(l.discoveredAt)}
|
|
27
|
+
${l.occurredAt?`Date Occurred: ${R(l.occurredAt)}`:"Date Occurred: Unknown"}
|
|
28
|
+
Status: ${l.status.charAt(0).toUpperCase()+l.status.slice(1)}
|
|
29
|
+
|
|
30
|
+
Nature of the Personal Data Breach (Section 40(2)):
|
|
31
|
+
${l.description}
|
|
32
|
+
|
|
33
|
+
Affected Systems/Applications:
|
|
34
|
+
${l.affectedSystems.join(", ")}
|
|
35
|
+
|
|
36
|
+
Types of Personal Data Involved:
|
|
37
|
+
${l.dataTypes.join(", ")}
|
|
38
|
+
${l.involvesSensitiveData?"Sensitive personal data (Section 30) involved: YES":""}
|
|
39
|
+
|
|
40
|
+
Categories of Data Subjects Affected (Section 40(2)):
|
|
41
|
+
${((d=l.dataSubjectCategories)==null?void 0:d.join(", "))||"[Not specified \u2014 required by NDPC]"}
|
|
42
|
+
|
|
43
|
+
Approximate Number of Data Subjects Affected:
|
|
44
|
+
${(K=l.estimatedAffectedSubjects)!=null?K:"Unknown"}
|
|
45
|
+
|
|
46
|
+
Approximate Number of Personal Data Records Concerned (Section 40(2)):
|
|
47
|
+
${(pe=l.approximateRecordCount)!=null?pe:"Unknown"}
|
|
48
|
+
|
|
49
|
+
RISK ASSESSMENT
|
|
50
|
+
--------------
|
|
51
|
+
${f?`
|
|
52
|
+
Overall Risk Level: ${f.riskLevel.charAt(0).toUpperCase()+f.riskLevel.slice(1)}
|
|
53
|
+
Risk to Rights and Freedoms of Data Subjects: ${f.risksToRightsAndFreedoms?"Yes":"No"}
|
|
54
|
+
High Risk to Rights and Freedoms of Data Subjects: ${f.highRisksToRightsAndFreedoms?"Yes":"No"}
|
|
55
|
+
|
|
56
|
+
Justification for Risk Assessment:
|
|
57
|
+
${f.justification}
|
|
58
|
+
`:"Risk assessment has not been conducted yet."}
|
|
59
|
+
|
|
60
|
+
LIKELY CONSEQUENCES OF THE BREACH (Section 40(3))
|
|
61
|
+
--------------------------------
|
|
62
|
+
${l.likelyConsequences||"[Please describe likely consequences for affected data subjects \u2014 identity theft, financial loss, discrimination, etc.]"}
|
|
63
|
+
|
|
64
|
+
MEASURES TAKEN OR PROPOSED
|
|
65
|
+
-------------
|
|
66
|
+
Measures taken to address the breach:
|
|
67
|
+
${l.initialActions||"To be determined"}
|
|
68
|
+
|
|
69
|
+
Measures taken or proposed to mitigate possible adverse effects (Section 40(3)):
|
|
70
|
+
${l.mitigationMeasures||"[Please specify mitigation measures]"}
|
|
71
|
+
|
|
72
|
+
NOTIFICATION TO DATA SUBJECTS (Section 40(3))
|
|
73
|
+
----------------------------
|
|
74
|
+
Have data subjects been notified: [Yes/No]
|
|
75
|
+
If yes, date of notification: [Date]
|
|
76
|
+
If no, planned date of notification: [Date]
|
|
77
|
+
Reason for delay (if applicable): [Reason]
|
|
78
|
+
|
|
79
|
+
${l.isPhasedReport?`PHASED REPORT NOTE
|
|
80
|
+
---------------------
|
|
81
|
+
This report is submitted in phases under NDPA Section 40(2) because complete
|
|
82
|
+
information was not available within 72 hours of discovery. A supplementary
|
|
83
|
+
report will be filed once additional facts are confirmed.
|
|
84
|
+
`:""}
|
|
85
|
+
ADDITIONAL INFORMATION
|
|
86
|
+
---------------------
|
|
87
|
+
[Any additional information relevant to the breach]
|
|
88
|
+
|
|
89
|
+
This notification is made in compliance with the Nigeria Data Protection Act (NDPA), Section 40.
|
|
90
|
+
|
|
91
|
+
IMPORTANT NOTICE
|
|
92
|
+
---------------------
|
|
93
|
+
${b}
|
|
94
|
+
`},ie=u=>{u.preventDefault();let y={id:`notification_${Date.now()}`,breachId:l.id,sentAt:Date.now(),method:Y,referenceNumber:X||void 0,ndpcContact:U?{name:U,email:V,phone:W||void 0}:void 0,content:T,attachments:[]};H(y),g(true);},j=()=>{let u,y,B;switch(se){case "html":{u="text/html",y="html",B=`<!DOCTYPE html>
|
|
95
|
+
<html lang="en">
|
|
96
|
+
<head>
|
|
97
|
+
<meta charset="UTF-8">
|
|
98
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
99
|
+
<title>NDPC Breach Notification Report</title>
|
|
100
|
+
<style>body{font-family:monospace;white-space:pre-wrap;max-width:800px;margin:2rem auto;padding:0 1rem;}</style>
|
|
101
|
+
</head>
|
|
102
|
+
<body>${T.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}</body>
|
|
103
|
+
</html>`;break}case "pdf":u="text/plain",y="pdf.txt",B=T;break;case "docx":u="text/plain",y="docx.txt",B=T;break;default:u="text/plain",y="txt",B=T;}let t=document.createElement("a"),m=new Blob([B],{type:u});t.href=URL.createObjectURL(m),t.download=`NDPC_Breach_Notification_${new Date().toISOString().split("T")[0]}.${y}`,document.body.appendChild(t),t.click(),document.body.removeChild(t);},ne=()=>[{value:"email",label:"Email"},{value:"portal",label:"NDPC Portal"},{value:"letter",label:"Formal Letter"},{value:"other",label:"Other"}].map(y=>jsx("option",{value:y.value,children:y.label},y.value));return jsxs("div",{"data-ndpr-component":"regulatory-report-generator",className:a(`bg-white dark:bg-gray-800 p-6 rounded-lg shadow-md ${G}`,o.root,c$1),children:[jsxs("div",{className:a("",o.header,c$1),children:[jsx("h2",{className:a("ndpr-section-heading",o.title,c$1),children:E}),jsx("p",{className:"ndpr-card__subtitle",children:me})]}),w?jsxs("div",{children:[jsxs("div",{className:"ndpr-alert ndpr-alert--success",children:[jsx("h3",{className:"text-lg font-bold ndpr-text-success mb-2",children:"Report Generated Successfully"}),jsx("p",{className:"ndpr-text-success",children:"Your NDPC notification report has been generated and is ready for submission. Please review the report carefully before submitting it to the NDPC."})]}),jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"ndpr-section-heading",children:"Submission Details"}),jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[jsxs("div",{children:[jsxs("p",{className:a("ndpr-text-sm",o.field,c$1),children:[jsx("span",{className:a("font-medium",o.fieldLabel,c$1),children:"Method:"})," ",jsx("span",{className:a("",o.fieldValue,c$1),children:Y.charAt(0).toUpperCase()+Y.slice(1)})]}),U&&jsxs("p",{className:a("ndpr-text-sm",o.field,c$1),children:[jsx("span",{className:a("font-medium",o.fieldLabel,c$1),children:"Contact Name:"})," ",jsx("span",{className:a("",o.fieldValue,c$1),children:U})]}),V&&jsxs("p",{className:a("ndpr-text-sm",o.field,c$1),children:[jsx("span",{className:a("font-medium",o.fieldLabel,c$1),children:"Contact Email:"})," ",jsx("span",{className:a("",o.fieldValue,c$1),children:V})]}),W&&jsxs("p",{className:a("ndpr-text-sm",o.field,c$1),children:[jsx("span",{className:a("font-medium",o.fieldLabel,c$1),children:"Contact Phone:"})," ",jsx("span",{className:a("",o.fieldValue,c$1),children:W})]})]}),jsxs("div",{children:[jsxs("p",{className:a("ndpr-text-sm",o.field,c$1),children:[jsx("span",{className:a("font-medium",o.fieldLabel,c$1),children:"Date Generated:"})," ",jsx("span",{className:a("",o.fieldValue,c$1),children:R(Date.now())})]}),jsxs("p",{className:a("ndpr-text-sm",o.field,c$1),children:[jsx("span",{className:a("font-medium",o.fieldLabel,c$1),children:"Breach ID:"})," ",jsx("span",{className:a("",o.fieldValue,c$1),children:l.id})]}),X&&jsxs("p",{className:a("ndpr-text-sm",o.field,c$1),children:[jsx("span",{className:a("font-medium",o.fieldLabel,c$1),children:"Reference Number:"})," ",jsx("span",{className:a("",o.fieldValue,c$1),children:X})]})]})]})]}),D&&jsxs("div",{className:"mb-6",children:[jsx("h3",{className:"ndpr-section-heading",children:"Report Preview"}),jsx("div",{className:a("ndpr-panel",o.reportPreview,c$1),children:jsx("pre",{className:"whitespace-pre-wrap text-sm font-mono text-gray-800 dark:text-gray-200",children:T})})]}),jsxs("div",{className:"ndpr-card__footer",children:[le&&jsxs("button",{onClick:j,className:a(`px-4 py-2 bg-[rgb(var(--ndpr-primary))] text-white rounded hover:bg-[rgb(var(--ndpr-primary-hover))] ${x}`,o.secondaryButton||o.downloadButton,c$1),children:["Download Report (",se.toUpperCase(),")"]}),jsx("button",{onClick:()=>g(false),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 ${x}`,children:"Edit Report"})]})]}):jsx("form",{onSubmit:ie,children:jsxs("div",{className:"ndpr-form-section",children:[jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Notification Method"}),jsxs("div",{className:"ndpr-form-grid ndpr-form-grid--2",children:[jsxs("div",{children:[jsxs("label",{htmlFor:"method",className:"ndpr-form-field__label",children:["Method of Submission ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("select",{id:"method",value:Y,onChange:u=>O(u.target.value),className:"ndpr-form-field__input",required:true,children:ne()})]}),jsxs("div",{children:[jsx("label",{htmlFor:"referenceNumber",className:"ndpr-form-field__label",children:"Reference Number (if available)"}),jsx("input",{type:"text",id:"referenceNumber",value:X,onChange:u=>J(u.target.value),placeholder:"e.g. NDPC/BR/2024/001",className:"ndpr-form-field__input"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"NDPC Contact (if known)"}),jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[jsxs("div",{children:[jsx("label",{htmlFor:"contactName",className:"ndpr-form-field__label",children:"Contact Name"}),jsx("input",{type:"text",id:"contactName",value:U,onChange:u=>P(u.target.value),className:"ndpr-form-field__input"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"contactEmail",className:"ndpr-form-field__label",children:"Contact Email"}),jsx("input",{type:"email",id:"contactEmail",value:V,onChange:u=>_(u.target.value),className:"ndpr-form-field__input"})]}),jsxs("div",{children:[jsx("label",{htmlFor:"contactPhone",className:"ndpr-form-field__label",children:"Contact Phone"}),jsx("input",{type:"tel",id:"contactPhone",value:W,onChange:u=>F(u.target.value),className:"ndpr-form-field__input"})]})]})]}),jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Additional Information"}),jsxs("div",{children:[jsx("label",{htmlFor:"additionalInfo",className:"ndpr-form-field__label",children:"Additional Information to Include"}),jsx("textarea",{id:"additionalInfo",value:ce,onChange:u=>z(u.target.value),rows:3,placeholder:"Any additional information you want to include in the report",className:"ndpr-form-field__input"})]})]}),Q&&jsxs("div",{children:[jsx("h3",{className:"ndpr-section-heading",children:"Report Content"}),jsxs("div",{children:[jsxs("label",{htmlFor:"reportContent",className:"ndpr-form-field__label",children:["Edit Report Content ",jsx("span",{className:"ndpr-form-field__required",children:"*"})]}),jsx("textarea",{id:"reportContent",value:T,onChange:u=>k(u.target.value),rows:20,className:"ndpr-form-field__input ndpr-form-field__input--mono",required:true})]})]}),jsxs("div",{className:"ndpr-alert ndpr-alert--info",children:[jsx("h3",{className:"text-sm font-bold ndpr-text-info mb-2",children:"NDPA Breach Notification Requirements"}),jsx("p",{className:"ndpr-text-info text-sm",children:"Under the Nigeria Data Protection Act (NDPA), Section 40, data breaches that pose a risk to the rights and freedoms of data subjects must be reported to the NDPC within 72 hours of discovery. This report will help you comply with this requirement."}),jsx("p",{className:"ndpr-text-muted text-xs mt-2 italic",role:"note",children:a$2})]}),jsx("div",{className:"mt-6",children:jsx("button",{type:"submit",className:a(`px-6 py-3 bg-[rgb(var(--ndpr-primary))] text-white rounded-md hover:bg-[rgb(var(--ndpr-primary-hover))] focus:outline-none focus:ring-2 focus:ring-[rgb(var(--ndpr-ring))] focus:ring-offset-2 ${x}`,o.primaryButton||o.generateButton,c$1),children:v})})]})})]})};export{Ie as a,je as b,Ye as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkUZNWXJ2W_js=require('./chunk-UZNWXJ2W.js'),chunkRFPLZDIO_js=require('./chunk-RFPLZDIO.js'),jsxRuntime=require('react/jsx-runtime');var q=[{id:"access",name:"Access My Data",description:"Request a copy of your personal data held by us",ndpaSection:"Section 34(1)(a)\u2013(b)",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"rectification",name:"Correct My Data",description:"Request corrections to inaccurate personal data",ndpaSection:"Section 34(1)(c)",estimatedCompletionTime:30,requiresAdditionalInfo:true,additionalFields:[{id:"correction_details",label:"What data needs to be corrected?",type:"textarea",required:true,placeholder:"Please describe the inaccurate data and what the correct information should be"}]},{id:"erasure",name:"Delete My Data",description:"Request deletion of your personal data",ndpaSection:"Section 34(1)(d), Section 34(2)",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"portability",name:"Export My Data",description:"Receive your data in a portable format",ndpaSection:"Section 38",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"restrict",name:"Restrict Processing",description:"Request restriction of data processing",ndpaSection:"Section 34(1)(e)",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"object",name:"Object to Processing",description:"Object to processing of your personal data",ndpaSection:"Section 36",estimatedCompletionTime:30,requiresAdditionalInfo:false},{id:"withdraw_consent",name:"Withdraw My Consent",description:"Withdraw consent previously given for processing",ndpaSection:"Section 35",estimatedCompletionTime:30,requiresAdditionalInfo:false}],C=({requestTypes:R=q,adapter:s,classNames:y,unstyled:S,onSubmit:u=()=>{},submitTo:n,submitOptions:e,onSubmitError:t,onSubmitSuccess:r})=>jsxRuntime.jsx(chunkUZNWXJ2W_js.a,{requestTypes:R,onSubmit:a=>chunkRFPLZDIO_js.d(null,null,function*(){var d,c;if(n){let h=typeof(e==null?void 0:e.headers)=="function"?e.headers():(d=e==null?void 0:e.headers)!=null?d:{};try{let o=yield fetch(n,{method:"POST",headers:chunkRFPLZDIO_js.a({"Content-Type":"application/json"},h),credentials:(c=e==null?void 0:e.credentials)!=null?c:"same-origin",body:JSON.stringify(a)});if(!o.ok)t==null||t({response:o});else if(r){let l;try{let i=yield o.clone().text();i&&(l=JSON.parse(i));}catch(i){}r({response:o,data:a,body:l});}}catch(o){t==null||t({error:o});}}else s&&s.save(a);u(a);}),classNames:y,unstyled:S});exports.a=C;
|