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