"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[7556,3404,2572],{27556:(e,t,a)=>{a.r(t),a.d(t,{default:()=>c});var n=a(51280),o=a(32572),i=a(61744),s=a(25536),l=a(38924),r=a(88496),d=a(87287);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})}},13404:(e,t,a)=>{a.r(t),a.d(t,{UseCookieScanData:()=>i});var n=a(30809),o=a(61744);const i=(0,n.Su)(((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))))})))},32572:(e,t,a)=>{a.r(t),a.d(t,{default:()=>m});var n=a(51280),o=a(88496),i=a(61744),s=a(25536),l=a(38924),r=a(87287),d=a(13404),c=a(64224);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 h=(b&&b.button_text?b.button_text:a)||C,{fetchFieldsData:w,showSavedSettingsNotice:_}=(0,s.default)(),{setInitialLoadCompleted:k,setProgress:y}=(0,d.UseCookieScanData)(),{setProgressLoaded:L}=(0,c.default)(),{selectedSubMenuItem:x}=(0,l.default)(),[S,v]=(0,o.useState)(!1),D=`button cmplz-button button--${t} button-${e}`,E=async e=>{await i.doAction(b.action,{}).then((e=>{e.success&&(w(x),"reset_settings"===e.id&&(k(!1),y(0),L(!1)),_(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:S,onConfirm:async()=>{v(!1),await E()},onCancel:()=>{v(!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?v(!0):await E()):void await E():void(window.location.href=b.url);m(t)},disabled:g},h)):"link"===e?(0,n.createElement)("a",{className:D,href:u,target:f},h):void 0}))}}]);