D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
aramrprl
/
www
/
wp-content
/
plugins
/
complianz-gdpr
/
settings
/
build
/
Filename :
11.e9c71a310cc4e025c93b.js
back
Copy
"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[11,273,625,4644,5683,7771],{17771:(e,t,n)=>{n.r(t),n.d(t,{UseMenuData:()=>r});var i=n(81621),s=n(9588),l=n(16535),a=n(55446),c=n(27723);const r=(0,i.vt)((e,t)=>({menuDataLoaded:!1,saving:!1,menu:[],menuChanged:!1,changedMenuType:"per_document",emptyMenuLink:"#",requiredDocuments:[],createdDocuments:[],genericDocuments:[],documentsNotInMenu:[],pageTypes:[],regions:[],fetchMenuData:async()=>{const t=await o(!1);let n=t.required_documents.filter(e=>e.page_id);e({menuDataLoaded:!0,emptyMenuLink:t.empty_menu_link,menu:t.menu,requiredDocuments:t.required_documents,genericDocuments:t.generic_documents_list,createdDocuments:n,pageTypes:t.page_types,documentsNotInMenu:t.documents_not_in_menu,regions:t.regions})},updateMenu:(t,n)=>{let i=isNaN(t)?"per_type":"per_document";e({menuType:i}),e("per_type"===i?(0,l.Ay)(e=>{let i=e.genericDocuments.findIndex(function(e,n){return e.page_id===t||e.type===t}),s=e.createdDocuments.findIndex(function(e,n){return e.page_id===t||e.type===t});-1!==i&&(e.genericDocuments[i].menu_id=n,-1!==s&&(e.createdDocuments[s].menu_id=-1),e.menuChanged=!0)}):(0,l.Ay)(e=>{let i=e.genericDocuments.findIndex(function(e,n){return e.page_id===t||e.type===t}),s=e.createdDocuments.findIndex(function(e,n){return e.page_id===t||e.type===t});-1!==s&&(e.createdDocuments[s].menu_id=n,-1!==i&&(e.genericDocuments[i].menu_id=-1),e.menuChanged=!0)}))},saveDocumentsMenu:async(n,i)=>{if(e({saving:!0}),t().menuChanged||n){let n={};n.genericDocuments=t().genericDocuments.filter(e=>e.can_region_redirect),n.createdDocuments=t().createdDocuments;const l=s.doAction("save_documents_menu_data",n).then(t=>(e({saving:!1}),t)).catch(e=>{console.error(e)});i&&a.toast.promise(l,{pending:(0,c.__)("Saving menu...","complianz-gdpr"),success:(0,c.__)("Menu saved","complianz-gdpr"),error:(0,c.__)("Something went wrong","complianz-gdpr")})}else i&&a.toast.info((0,c.__)("Settings have not been changed","complianz-gdpr"))}})),o=()=>s.doAction("documents_menu_data",{generate:!1}).then(e=>e).catch(e=>{console.error(e)})},20625:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var i=n(45111),s=n(27723),l=n(99418),a=n(10790);const c=e=>{let t=e.help;t.title||(t.title=t.text,t.text=!1);let n=e.noticesExpanded?"open":"",c=t.url&&-1!==t.url.indexOf("complianz.io")?"_blank":"_self";return(0,a.jsxs)(a.Fragment,{children:[t.title&&t.text&&(0,a.jsxs)("details",{className:"cmplz-wizard-help-notice cmplz-"+t.label.toLowerCase(),open:n,children:[(0,a.jsxs)("summary",{children:[t.title," ",(0,a.jsx)(i.default,{name:"chevron-down"})]}),(0,a.jsx)("div",{dangerouslySetInnerHTML:{__html:l.A.sanitize(t.text)}})," ",t.url&&(0,a.jsx)("div",{className:"cmplz-help-more-info",children:(0,a.jsx)("a",{target:c,href:t.url,children:(0,s.__)("More info","complianz-gdpr")})})]}),t.title&&!t.text&&(0,a.jsx)("div",{className:"cmplz-wizard-help-notice cmplz-"+t.label.toLowerCase(),children:(0,a.jsx)("p",{children:t.title})})]})}},35683:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var i=n(81621),s=n(9588);const l=(0,i.vt)((e,t)=>({licenseStatus:cmplz_settings.licenseStatus,processing:!1,licenseNotices:[],noticesLoaded:!1,getLicenseNotices:async()=>{const{licenseStatus:t,notices:n}=await s.doAction("license_notices",{}).then(e=>e);e(e=>({noticesLoaded:!0,licenseNotices:n,licenseStatus:t}))},activateLicense:async t=>{let n={};n.license=t,e({processing:!0});const{licenseStatus:i,notices:l}=await s.doAction("activate_license",n);e(e=>({processing:!1,licenseNotices:l,licenseStatus:i}))},deactivateLicense:async()=>{e({processing:!0});const{licenseStatus:t,notices:n}=await s.doAction("deactivate_license");e(e=>({processing:!1,licenseNotices:n,licenseStatus:t}))}}))},50273:(e,t,n)=>{n.r(t),n.d(t,{in_array:()=>i});const i=(e,t)=>{let n=t.length;for(let i=0;i<n;i++)if(t[i]==e)return!0;return!1}},54644:(e,t,n)=>{n.r(t),n.d(t,{default:()=>p});var i=n(44124),s=n(27723),l=n(52043),a=n(35683),c=n(86087),r=n(4219),o=n(88499),d=n(65170),m=n(99418),u=n(10790);const p=e=>{const{highLightField:t,getFieldValue:p}=(0,r.default)(),{licenseStatus:h}=(0,a.default)(),{bannerDataLoaded:g}=(0,o.default)();let f="https://complianz.io/pricing/";const{subMenu:_,getMenuRegions:x,selectedSubMenuItem:z}=(0,l.default)();let v=x(),b=p("regions");Array.isArray(b)||(b=[b]),v=v.filter(e=>b.includes(e));const[j,N]=(0,c.useState)(null);(0,c.useEffect)(()=>{Promise.resolve().then(n.bind(n,32636)).then(({default:e})=>{N(()=>e)})},[]);let w,y=[];for(const t of e.fields)t.group_id===e.group&&y.push(t);for(const e of _.menu_items)if(e.id===z?w=e:e.menu_items&&(w=e.menu_items.filter(e=>e.id===z)[0]),w)break;for(const t of _.menu_items)if(t.id===z&&t.hasOwnProperty("groups")){let n=t.groups.filter(t=>t.id===e.group);n.length>0&&(w=n[0])}if(!w)return null;let k=w.premium_text?w.premium_text:(0,s.__)("Learn more about %sPremium%s","complianz-gdpr");cmplz_settings.is_premium&&(k="empty"===h||"deactivated"===h?cmplz_settings.messageInactive:cmplz_settings.messageInvalid);let D=!1;w.premium&&(D=!cmplz_settings.is_premium),cmplz_settings.is_premium&&(D="valid"!==h&&"license"!==w.id),f=w.upgrade?w.upgrade:f;let L=w.helpLink_text?w.helpLink_text:(0,s.__)("Instructions","complianz-gdpr"),M=D?"cmplz-disabled":"";return y.filter(e=>e.conditionallyDisabled&&!0===e.conditionallyDisabled||e.visible&&!1===e.visible).length===y.length?null:(0,u.jsxs)("div",{className:"cmplz-grid-item cmplz-"+w.id+" "+M,children:[w.title&&(0,u.jsxs)("div",{className:"cmplz-grid-item-header",children:[(0,u.jsx)("h3",{className:"cmplz-h4",children:w.title}),v.length>0&&(0,u.jsx)("div",{className:"cmplz-grid-item-controls",children:v.map((e,t)=>(0,u.jsx)("div",{children:(0,u.jsx)("img",{className:"cmplz-settings-region",src:cmplz_settings.plugin_url+"/assets/images/"+e+".svg",alt:"region"})},t))}),0===v.length&&w.helpLink&&(0,u.jsx)("div",{className:"cmplz-grid-item-controls",children:(0,u.jsx)(i.default,{target:"_blank",rel:"noopener noreferrer",className:"cmplz-helplink",text:L,url:w.helpLink})})]}),(0,u.jsxs)("div",{className:"cmplz-grid-item-content",children:[w.intro&&(0,u.jsx)("div",{className:"cmplz-settings-block-intro",dangerouslySetInnerHTML:{__html:m.A.sanitize(w.intro)}})," ",j&&y.map((e,n)=>(0,u.jsx)(d.default,{fallback:"Could not load field "+e.id,children:(0,u.jsx)(j,{field:e,highLightField:t},e.id)},"field-"+e.id))]}),D&&(0,u.jsx)("div",{className:"cmplz-locked",children:(0,u.jsxs)("div",{className:"cmplz-locked-overlay",children:[(0,u.jsx)("span",{className:"cmplz-task-status cmplz-premium",children:(0,s.__)("Upgrade","complianz-gdpr")}),(0,u.jsxs)("span",{children:[cmplz_settings.is_premium&&(0,u.jsxs)("span",{children:[k," ",(0,u.jsx)("a",{className:"cmplz-locked-link",href:cmplz_settings.license_url,children:(0,s.__)("Check license","complianz-gdpr")})]}),!cmplz_settings.is_premium&&(0,u.jsx)(i.default,{target:"_blank",rel:"noopener noreferrer",text:k,url:f})]})]})}),"banner"===_.id&&!g&&(0,u.jsx)("div",{className:"cmplz-locked",children:(0,u.jsx)("div",{className:"cmplz-locked-overlay"})})]},w.id)}},60011:(e,t,n)=>{n.r(t),n.d(t,{ScrollProgress:()=>_,default:()=>f});var i=n(50273),s=n(54644),l=n(20625),a=n(86087),c=n(27723),r=n(4219),o=n(52043),d=n(17771),m=n(88499),u=n(32828),p=n(39864),h=n(65170),g=n(10790);const f=()=>{const[e,t]=(0,a.useState)(!0),{progressLoaded:f,notices:x,fetchProgressData:z}=(0,u.default)(),[v,b]=(0,a.useState)(!1),{saveBanner:j,setBannerDataLoaded:N}=(0,m.default)(),{saveDocumentsMenu:w}=(0,d.UseMenuData)(),[y,k]=(0,a.useState)(null),[D,L]=(0,a.useState)(null),[M,S]=(0,a.useState)(!1),{saving:C,fieldNotices:I,fieldNoticesLoaded:E,fieldsLoaded:A,saveFields:T,changedFields:F,fields:P,fetchAllFieldsCompleted:B,nextButtonDisabled:H,isNextButtonDisabled:q}=(0,r.default)(),{subMenuLoaded:$,saveButtonsRequired:U,subMenu:O,selectedSubMenuItem:R,selectedMainMenuItem:G,nextMenuItem:V,previousMenuItem:Y}=(0,o.default)();(0,a.useEffect)(()=>{"banner"!==G||y||n.e(135).then(n.bind(n,40135)).then(({default:e})=>{k(()=>e)})},[G]),(0,a.useEffect)(()=>{"finish"!==R||D||Promise.all([n.e(4989),n.e(6970)]).then(n.bind(n,46970)).then(({default:e})=>{L(()=>e)})},[R]),(0,a.useEffect)(()=>{"#banner"!==window.location.hash&&B()},[F]),(0,a.useEffect)(()=>{let e=!1;return H?e=setInterval(()=>{q(P,R)},3e3):e&&clearInterval(e),()=>clearInterval(e)},[H]);const J=async(e,t)=>{-1!==F.findIndex(e=>"regions"===e.id)&&N(!1),"document-menu"===R?(await T(R,t,!1),await w(F.length>0,t)):"banner"===G?await j(P):await T(R,t,e)},{menu_items:K}=O;if(!$||!A||0===K.length)return(0,g.jsx)(p.default,{});let Q=P.filter(e=>e.menu_id===R),W=[];for(const e of Q)(0,i.in_array)(e.group_id,W)||W.push(e.group_id);let X=[];if(E&&void 0!==I)for(const e of I)Q.filter(t=>e.field_id===t.id).length>0&&X.push(e);if(f)for(const e of x){let t=!1;if(e.show_with_options&&"warning"===e.status&&(t=Q.filter(t=>e.show_with_options.includes(t.id)).length>0),t||e.menu_id===R){let t={};t.title=!!e.title&&e.title,t.label=e.label,t.id=e.id,t.text=e.message,t.url=e.url,t.linked_field=e.show_with_option,X.push(t)}}for(const e of Q.filter(e=>e.help&&!e.conditionallyDisabled)){let t=e.help;0===X.filter(e=>e.id&&e.id===t.id).length&&X.push(e.help)}X=X.filter(e=>"completed"!==e.label.toLowerCase());let Z=P.filter(e=>"enable_cookie_banner"===e.id&&"yes"===e.value).length>0,ee=H?`#${G}/${R}`:V,te=Z?"#banner":"#dashboard";return te=H?`#${G}/${R}`:te,(0,g.jsxs)(g.Fragment,{children:[v&&D&&(0,g.jsx)("div",{className:"cmplz-confetti",children:(0,g.jsx)(D,{zIndex:999999})}),(0,g.jsxs)("div",{className:"cmplz-wizard-settings cmplz-column-2",children:[W.map((e,t)=>(0,g.jsx)(h.default,{fallback:"Could not load: Banner preview",children:(0,g.jsx)(s.default,{index:t,group:e,fields:Q},t)},"groups-"+t)),(0,g.jsxs)("div",{className:"cmplz-grid-item-footer-container",children:[(0,g.jsx)(_,{}),(0,g.jsxs)("div",{className:"cmplz-grid-item-footer",children:["wizard"!==G&&(0,g.jsx)("div",{className:"cmplz-grid-item-footer-upsell-bar",children:!cmplz_settings.is_premium&&(0,g.jsx)("a",{className:"button button-default",href:"https://complianz.io/pricing",target:"_blank",rel:"noopener noreferrer",children:(0,c.__)("Get Premium","complianz-gdpr")})}),(0,g.jsxs)("div",{className:"cmplz-grid-item-footer-buttons",children:["#"!==Y&&(0,g.jsx)("a",{href:Y,onClick:()=>{window.scrollTo({top:0,behavior:"smooth"})},children:(0,c.__)("Previous","complianz-gdpr")}),U()&&(0,g.jsx)("button",{className:"button button-default",onClick:e=>J(!1,!0),children:(0,c.__)("Save","complianz-gdpr")}),R!==K[K.length-1].id&&(0,g.jsxs)(g.Fragment,{children:[U()&&(0,g.jsx)("a",{disabled:H,className:"button button-primary",href:ee,onClick:e=>{J(!1,!1),window.scrollTo({top:0,behavior:"smooth"})},children:(0,c.__)("Save and Continue","complianz-gdpr")}),!U()&&(0,g.jsx)("a",{className:"button button-primary",href:ee,onClick:e=>J(!1,!1),children:(0,c.__)("Continue","complianz-gdpr")})]}),"wizard"===G&&R===K[K.length-1].id&&(0,g.jsx)("a",{disabled:H||C||M,className:"button button-primary",href:"#",onClick:e=>(async e=>{e.preventDefault(),H||(S(!0),b(!0),J(!0,!1),S(!1),window.location.hash=te,setTimeout(async()=>{b(!1)},2e3))})(e),children:(0,c.__)("Finish","complianz-gdpr")})]})]})]})]}),(0,g.jsxs)("div",{className:"cmplz-wizard-help",children:[(0,g.jsxs)("div",{className:"cmplz-help-header",children:[(0,g.jsx)("h3",{className:"cmplz-h4",children:(0,c.__)("Notifications","complianz-gdpr")}),(0,g.jsxs)("div",{className:"cmplz-help-control",onClick:()=>{t(!e)},children:[!e&&(0,c.__)("Expand all","complianz-gdpr"),e&&(0,c.__)("Collapse all","complianz-gdpr")]})]}),X.map((t,n)=>(0,g.jsx)(h.default,{fallback:"Could not load: Help notices",children:(0,g.jsx)(l.default,{noticesExpanded:e,help:t,fieldId:t.id},n)},"field-"+n))]}),"banner"===G&&y&&(0,g.jsx)(h.default,{fallback:"Could not load: Banner preview",children:(0,g.jsx)(y,{})})]})},_=()=>{const[e,t]=(0,a.useState)(0);return(0,a.useEffect)(()=>{window.addEventListener("scroll",()=>{let e=document.documentElement.scrollHeight-document.documentElement.clientHeight,n=Math.round(window.scrollY/e*100);n=Math.max(5,n),t(n)})},[]),document.documentElement.scrollHeight<=document.documentElement.clientHeight?null:(0,g.jsx)("span",{className:"cmplz-grid-item-footer-scroll-progress-container",children:(0,g.jsxs)("span",{className:"cmplz-grid-item-footer-scroll-progress",style:{width:e+"%"},children:[e,"%"]})})}}}]);