"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[8284,1136,6472,4056],{41136:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var o=n(30809),a=n(61744);const l=(0,o.Su)(((e,t)=>({documents:[],documentDataLoaded:!1,processingAgreementOptions:[],proofOfConsentOptions:[],dataBreachOptions:[],region:"",setRegion:t=>{"undefined"!=typeof Storage&&(sessionStorage.cmplzSelectedRegion=t),e((e=>({region:t})))},getRegion:()=>{let t="all";"undefined"!=typeof Storage&&sessionStorage.cmplzSelectedRegion&&(t=sessionStorage.cmplzSelectedRegion),e((e=>({region:t})))},getDocuments:async()=>{const{documents:t,processingAgreementOptions:n,proofOfConsentOptions:o,dataBreachOptions:l}=await a.doAction("documents_block_data").then((e=>e));e((e=>({documentDataLoaded:!0,documents:t,processingAgreementOptions:n,proofOfConsentOptions:o,dataBreachOptions:l})))}})))},38284:(e,t,n)=>{n.r(t),n.d(t,{default:()=>i});var o=n(51280),a=n(93396),l=n(88496),r=n(41136),s=n(25536),c=n(36472);const i=()=>{const{getFieldValue:e,fields:t}=(0,s.default)(),[n,i]=(0,l.useState)(!1);(0,l.useEffect)((()=>{i(e("records_of_consent"))}),[t]);const{processingAgreementOptions:p,dataBreachOptions:m,proofOfConsentOptions:d}=(0,r.default)();return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h3",{className:"cmplz-h4"},(0,a.__)("Other documents","complianz-gdpr")),(0,o.createElement)(c.default,{type:"processing-agreements",link:"#tools/processing-agreements",name:(0,a.__)("Processing Agreement","complianz-gdpr"),options:p}),(0,o.createElement)(c.default,{type:"data-breaches",link:"#tools/data-breach-reports",name:(0,a.__)("Data Breach","complianz-gdpr"),options:m}),(0,o.createElement)(c.default,{type:"proof-of-consent",link:n?"#tools/records-of-consent":"#tools/proof-of-consent",name:(0,a.__)("Proof of Consent","complianz-gdpr"),options:d}))}},36472:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var o=n(51280),a=n(15832),l=n(93396),r=n(88496),s=n(14056);const c=e=>{const[t,n]=(0,r.useState)(!1),[c,i]=(0,r.useState)(!1),[p,m]=(0,r.useState)(!1);(0,r.useEffect)((()=>{let t=e.options;if(0===t.length){let n={label:e.name,value:0};t.unshift(n)}else if(!t.filter((e=>0===e.value)).length>0){let n={label:e.name,value:0};t.unshift(n)}m(t)}),[e.options]);const d=()=>{if(c||!t||0===t)return;i(!0);let e=new XMLHttpRequest;e.responseType="blob",e.open("get",t,!0),e.send(),e.onreadystatechange=function(){if(4==this.readyState&&200==this.status){var e=window.URL.createObjectURL(this.response),n=window.document.createElement("a");n.setAttribute("href",e),n.setAttribute("download",p.filter((e=>e.value===t))[0].label),window.document.body.appendChild(n),n.click(),setTimeout((function(){window.URL.revokeObjectURL(e)}),6e4)}},e.onprogress=function(e){i(!0)}};return(0,o.createElement)("div",{className:"cmplz-single-document-other-documents"},(0,o.createElement)(s.default,{onChange:e=>n(e),defaultValue:"0",canBeEmpty:!1,value:t,options:p}),(0,o.createElement)("div",{onClick:()=>d()},(0,o.createElement)(a.default,{name:"file-download",color:0==t||c?"grey":"black",tooltip:(0,l.__)("Download file","complianz-gdpr"),size:14})),p.length>0&&(0,o.createElement)("a",{href:e.link},(0,o.createElement)(a.default,{name:"circle-chevron-right",color:"black",tooltip:(0,l.__)("Go to overview","complianz-gdpr"),size:14})),0===p.length&&(0,o.createElement)("a",{href:e.link},(0,o.createElement)(a.default,{name:"plus",color:"black",tooltip:(0,l.__)("Create new","complianz-gdpr"),size:14})))}},14056:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var o=n(51280),a=n(88496),l=n(39992),r=n(15832),s=n(93396);const c=(0,a.memo)((({value:e=!1,onChange:t,required:n,defaultValue:a,disabled:c,options:i={},canBeEmpty:p=!0,label:m})=>{if(Array.isArray(i)){let e={};i.map((t=>{e[t.value]=t.label})),i=e}return p?(""===e||!1===e||0===e)&&(e="0",i={0:(0,s.__)("Select an option","complianz-gdpr"),...i}):e||(e=Object.keys(i)[0]),(0,o.createElement)("div",{className:"cmplz-input-group cmplz-select-group",key:m},(0,o.createElement)(l.Ss,{value:e,defaultValue:a,onValueChange:t,required:n,disabled:c&&!Array.isArray(c)},(0,o.createElement)(l.mf,{className:"cmplz-select-group__trigger"},(0,o.createElement)(l.s3,null),(0,o.createElement)(r.default,{name:"chevron-down"})),(0,o.createElement)(l.kP,{className:"cmplz-select-group__content",position:"popper"},(0,o.createElement)(l.O4,{className:"cmplz-select-group__scroll-button"},(0,o.createElement)(r.default,{name:"chevron-up"})),(0,o.createElement)(l.mm,{className:"cmplz-select-group__viewport"},(0,o.createElement)(l.WM,null,Object.entries(i).map((([e,t])=>(0,o.createElement)(l.iY,{disabled:Array.isArray(c)&&c.includes(e),className:"cmplz-select-group__item",key:e,value:e},(0,o.createElement)(l.CC,null,t)))))),(0,o.createElement)(l.y8,{className:"cmplz-select-group__scroll-button"},(0,o.createElement)(r.default,{name:"chevron-down"})))))}))}}]);