"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[4644,5683],{35683:(e,t,l)=>{l.r(t),l.d(t,{default:()=>n});var i=l(81621),s=l(9588);const n=(0,i.vt)(((e,t)=>({licenseStatus:cmplz_settings.licenseStatus,processing:!1,licenseNotices:[],noticesLoaded:!1,getLicenseNotices:async()=>{const{licenseStatus:t,notices:l}=await s.doAction("license_notices",{}).then((e=>e));e((e=>({noticesLoaded:!0,licenseNotices:l,licenseStatus:t})))},activateLicense:async t=>{let l={};l.license=t,e({processing:!0});const{licenseStatus:i,notices:n}=await s.doAction("activate_license",l);e((e=>({processing:!1,licenseNotices:n,licenseStatus:i})))},deactivateLicense:async()=>{e({processing:!0});const{licenseStatus:t,notices:l}=await s.doAction("deactivate_license");e((e=>({processing:!1,licenseNotices:l,licenseStatus:t})))}})))},54644:(e,t,l)=>{l.r(t),l.d(t,{default:()=>u});var i=l(86087),s=l(44124),n=l(27723),c=l(52043),a=l(35683),r=l(4219),m=l(88499),o=l(65170),d=l(42838),p=l.n(d);const u=e=>{const{highLightField:t,getFieldValue:d}=(0,r.default)(),{licenseStatus:u}=(0,a.default)(),{bannerDataLoaded:g}=(0,m.default)();let _="https://complianz.io/pricing/";const{subMenu:z,getMenuRegions:f,selectedSubMenuItem:h}=(0,c.default)();let v=f(),k=d("regions");Array.isArray(k)||(k=[k]),v=v.filter((e=>k.includes(e)));const[E,b]=(0,i.useState)(null);(0,i.useEffect)((()=>{Promise.resolve().then(l.bind(l,32636)).then((({default:e})=>{b((()=>e))}))}),[]);let N,y=[];for(const t of e.fields)t.group_id===e.group&&y.push(t);for(const e of z.menu_items)if(e.id===h?N=e:e.menu_items&&(N=e.menu_items.filter((e=>e.id===h))[0]),N)break;for(const t of z.menu_items)if(t.id===h&&t.hasOwnProperty("groups")){let l=t.groups.filter((t=>t.id===e.group));l.length>0&&(N=l[0])}if(!N)return null;let L=N.premium_text?N.premium_text:(0,n.__)("Learn more about %sPremium%s","complianz-gdpr");cmplz_settings.is_premium&&(L="empty"===u||"deactivated"===u?cmplz_settings.messageInactive:cmplz_settings.messageInvalid);let S=!1;N.premium&&(S=!cmplz_settings.is_premium),cmplz_settings.is_premium&&(S="valid"!==u&&"license"!==N.id),_=N.upgrade?N.upgrade:_;let w=N.helpLink_text?N.helpLink_text:(0,n.__)("Instructions","complianz-gdpr"),x=S?"cmplz-disabled":"";return y.filter((e=>e.conditionallyDisabled&&!0===e.conditionallyDisabled||e.visible&&!1===e.visible)).length===y.length?null:(0,i.createElement)("div",{className:"cmplz-grid-item cmplz-"+N.id+" "+x,key:N.id},N.title&&(0,i.createElement)("div",{className:"cmplz-grid-item-header"},(0,i.createElement)("h3",{className:"cmplz-h4"},N.title),v.length>0&&(0,i.createElement)("div",{className:"cmplz-grid-item-controls"},v.map(((e,t)=>(0,i.createElement)("div",{key:t},(0,i.createElement)("img",{className:"cmplz-settings-region",src:cmplz_settings.plugin_url+"/assets/images/"+e+".svg",alt:"region"}))))),0===v.length&&N.helpLink&&(0,i.createElement)("div",{className:"cmplz-grid-item-controls"},(0,i.createElement)(s.default,{target:"_blank",rel:"noopener noreferrer",className:"cmplz-helplink",text:w,url:N.helpLink}))),(0,i.createElement)("div",{className:"cmplz-grid-item-content"},N.intro&&(0,i.createElement)("div",{className:"cmplz-settings-block-intro",dangerouslySetInnerHTML:{__html:p().sanitize(N.intro)}})," ",E&&y.map(((e,l)=>(0,i.createElement)(o.default,{key:"field-"+e.id,fallback:"Could not load field "+e.id},(0,i.createElement)(E,{key:e.id,field:e,highLightField:t}))))),S&&(0,i.createElement)("div",{className:"cmplz-locked"},(0,i.createElement)("div",{className:"cmplz-locked-overlay"},(0,i.createElement)("span",{className:"cmplz-task-status cmplz-premium"},(0,n.__)("Upgrade","complianz-gdpr")),(0,i.createElement)("span",null,cmplz_settings.is_premium&&(0,i.createElement)("span",null,L," ",(0,i.createElement)("a",{className:"cmplz-locked-link",href:cmplz_settings.license_url},(0,n.__)("Check license","complianz-gdpr"))),!cmplz_settings.is_premium&&(0,i.createElement)(s.default,{target:"_blank",rel:"noopener noreferrer",text:L,url:_})))),"banner"===z.id&&!g&&(0,i.createElement)("div",{className:"cmplz-locked"},(0,i.createElement)("div",{className:"cmplz-locked-overlay"})))}}}]);