"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[9664,2456,9296,408],{62456:(e,t,a)=>{a.r(t),a.d(t,{default:()=>_});var s=a(51280),c=a(93396),i=a(15832),n=a(37752),l=a(61744),o=a(90408),d=a(25536),r=a(64224),m=a(38924),u=a(24300),p=a.n(u);const _=({notice:e,index:t})=>{const{dismissNotice:a,fetchProgressData:u}=(0,r.default)(),{getField:_,setHighLightField:g,fetchFieldsData:h}=(0,d.default)(),{setSelectedSubMenuItem:f}=(0,m.default)();let b="premium"===e.icon,v=e.url&&-1!==e.url.indexOf("complianz.io"),z=e.status.charAt(0).toUpperCase()+e.status.slice(1);return(0,s.createElement)("div",{key:t,className:"cmplz-task-element"},(0,s.createElement)("span",{className:"cmplz-task-status cmplz-"+e.status},z),(0,s.createElement)("p",{className:"cmplz-task-message",dangerouslySetInnerHTML:{__html:p().sanitize(e.message)}}),v&&e.url&&(0,s.createElement)("a",{target:"_blank",href:e.url,rel:"noopener noreferrer"},(0,c.__)("More info","complianz-gdpr")),e.clear_cache_id&&(0,s.createElement)("span",{className:"cmplz-task-enable button button-secondary",onClick:()=>(async e=>{let t={};t.cache_id=e,l.doAction("clear_cache",t).then((async e=>{(0,n.dispatch)("core/notices").createNotice("success",(0,c.__)("Re-started test","complianz-gdpr"),{__unstableHTML:!0,id:"cmplz_clear_cache",type:"snackbar",isDismissible:!0}).then((0,o.default)(3e3)).then((e=>{(0,n.dispatch)("core/notices").removeNotice("rsssl_clear_cache")})),await h(),await u()}))})(e.clear_cache_id)},(0,c.__)("Re-check","complianz-gdpr")),!b&&!v&&e.url&&(0,s.createElement)("a",{className:"cmplz-task-enable button button-secondary",href:e.url},(0,c.__)("View","complianz-gdpr")),!b&&e.highlight_field_id&&(0,s.createElement)("span",{className:"cmplz-task-enable button button-secondary",onClick:()=>(async()=>{g(e.highlight_field_id);let t=_(e.highlight_field_id);await f(t.menu_id)})()},(0,c.__)("View","complianz-gdpr")),e.plus_one&&(0,s.createElement)("span",{className:"cmplz-plusone"},"1"),e.dismissible&&"completed"!==e.status&&(0,s.createElement)("div",{className:"cmplz-task-dismiss"},(0,s.createElement)("button",{type:"button",onClick:t=>a(e.id)},(0,s.createElement)(i.default,{name:"times"}))))}},69664:(e,t,a)=>{a.r(t),a.d(t,{default:()=>m});var s=a(51280),c=a(62456),i=a(60312),n=a(93396),l=a(25536),o=a(59296),d=a(88496),r=a(64224);const m=(0,d.memo)((e=>{const{fields:t,setChangedField:a,updateField:m}=(0,l.default)(),{setProgressLoaded:u}=(0,r.default)(),{licenseStatus:p,licenseNotices:_,getLicenseNotices:g,noticesLoaded:h,activateLicense:f,deactivateLicense:b,processing:v}=(0,o.default)();(0,d.useEffect)((()=>{h||g()}),[]);let z=e.field,N=v?"cmplz-processing":"";return(0,s.createElement)("div",{className:"components-base-control"},(0,s.createElement)("div",{className:"cmplz-license-field"},(0,s.createElement)("input",{className:"components-text-control__input",type:"password",id:z.id,value:z.value,onChange:e=>{return t=e.target.value,a(z.id,t),void m(z.id,t);var t}}),(0,s.createElement)("button",{className:"button button-default",disabled:v,onClick:()=>(async()=>{"valid"===p?await b():await f(e.field.value),u(!1)})()},"valid"===p&&(0,n.__)("Deactivate","complianz-gdpr"),"valid"!==p&&(0,n.__)("Activate","complianz-gdpr"))),!h&&(0,s.createElement)(i.default,null),h&&(0,s.createElement)("div",{className:N},_.map(((e,t)=>(0,s.createElement)(c.default,{key:t,index:t,notice:e,highLightField:""})))))}))},59296:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var s=a(30809),c=a(61744);const i=(0,s.Su)(((e,t)=>({licenseStatus:cmplz_settings.licenseStatus,processing:!1,licenseNotices:[],noticesLoaded:!1,getLicenseNotices:async()=>{const{licenseStatus:t,notices:a}=await c.doAction("license_notices",{}).then((e=>e));e((e=>({noticesLoaded:!0,licenseNotices:a,licenseStatus:t})))},activateLicense:async t=>{let a={};a.license=t,e({processing:!0});const{licenseStatus:s,notices:i}=await c.doAction("activate_license",a);e((e=>({processing:!1,licenseNotices:i,licenseStatus:s})))},deactivateLicense:async()=>{e({processing:!0});const{licenseStatus:t,notices:a}=await c.doAction("deactivate_license");e((e=>({processing:!1,licenseNotices:a,licenseStatus:t})))}})))},90408:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});const s=e=>function(t){return new Promise((a=>setTimeout((()=>a(t)),e)))}}}]);