"use strict";(self.webpackChunkcomplianz_gdpr=self.webpackChunkcomplianz_gdpr||[]).push([[4161,9091,9758],{84161:(e,t,a)=>{a.r(t),a.d(t,{default:()=>c});var n=a(51609),o=a(79758),i=a(9588),s=a(4219),l=a(52043),r=a(86087),d=a(56427);const c=({label:e,field:t,disabled:a})=>{const{fetchFieldsData:c,showSavedSettingsNotice:m}=(0,s.default)(),{selectedSubMenuItem:u}=(0,l.default)(),[f,g]=(0,r.useState)(!1);let p=t.button_text?t.button_text:t.label;if(t.action){const e=async e=>{t.warn?g(!0):await r()},s=async()=>{g(!1),await r()},l=()=>{g(!1)},r=async e=>{await i.doAction(t.action,{}).then((e=>{e.success&&(c(u),m(e.message))}))};return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(o.default,{text:p,style:"secondary",disabled:a,onClick:t=>e(t)}),(0,n.createElement)(d.__experimentalConfirmDialog,{isOpen:f,onConfirm:s,onCancel:l},t.warn))}return(0,n.createElement)(o.default,{style:"secondary",label:p,disabled:a,href:t.url})}},99091:(e,t,a)=>{a.r(t),a.d(t,{UseCookieScanData:()=>i});var n=a(81621),o=a(9588);const i=(0,n.vt)(((e,t)=>({initialLoadCompleted:!1,setInitialLoadCompleted:t=>e({initialLoadCompleted:t}),iframeLoaded:!1,loading:!1,nextPage:!1,progress:0,cookies:[],lastLoadedIframe:"",setIframeLoaded:t=>e({iframeLoaded:t}),setLastLoadedIframe:t=>e((e=>({lastLoadedIframe:t}))),setProgress:t=>e({progress:t}),fetchProgress:()=>(e({loading:!0}),o.doAction("get_scan_progress",{}).then((t=>(e({initialLoadCompleted:!0,loading:!1,nextPage:t.next_page,progress:t.progress,cookies:t.cookies}),t))))})))},79758:(e,t,a)=>{a.r(t),a.d(t,{default:()=>m});var n=a(51609),o=a(86087),i=a(9588),s=a(4219),l=a(52043),r=a(56427),d=a(99091),c=a(32828);const m=(0,o.memo)((({type:e="action",style:t="tertiary",label:a,onClick:m,href:u="",target:f="",disabled:g,action:p,field:b,children:C})=>{if(!a&&!C)return null;const w=(b&&b.button_text?b.button_text:a)||C,{fetchFieldsData:_,showSavedSettingsNotice:h}=(0,s.default)(),{setInitialLoadCompleted:k,setProgress:y}=(0,d.UseCookieScanData)(),{setProgressLoaded:L}=(0,c.default)(),{selectedSubMenuItem:x}=(0,l.default)(),[v,S]=(0,o.useState)(!1),D=`button cmplz-button button--${t} button-${e}`,E=async e=>{await i.doAction(b.action,{}).then((e=>{e.success&&(_(x),"reset_settings"===e.id&&(k(!1),y(0),L(!1)),h(e.message))}))},I=b&&b.warn?b.warn:"";return"action"===e?(0,n.createElement)(n.Fragment,null,r.__experimentalConfirmDialog&&(0,n.createElement)(r.__experimentalConfirmDialog,{isOpen:v,onConfirm:async()=>{S(!1),await E()},onCancel:()=>{S(!1)}},I),(0,n.createElement)("button",{className:D,onClick:async t=>{if("action"!==e||!m)return"action"===e&&p?r.__experimentalConfirmDialog?void(b&&b.warn?S(!0):await E()):void await E():void(window.location.href=b.url);m(t)},disabled:g},w)):"link"===e?(0,n.createElement)("a",{className:D,href:u,target:f},w):void 0}))}}]);