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