"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[1439],{41439:(e,t,a)=>{a.r(t),a.d(t,{default:()=>d});var s=a(86087),l=a(27723),i=a(9588),n=a(45111);class o extends s.Component{constructor(){super(...arguments),this.state={data:[],buttonsDisabled:!1}}dismissModal(e){this.props.handleModal(!1,null,e)}componentDidMount(){this.setState({data:this.props.data,buttonsDisabled:!1})}handleFix(e){let t=this.props.data.action;this.setState({buttonsDisabled:!0}),i.doAction(t,"refresh",this.props.data).then((e=>{this.props.data;let{data:t}=this.state;t.description=e.msg,t.subtitle="",this.setState({data:t}),this.props.data,e.success&&this.dismissModal(this.props.data)}))}render(){const{data:e,buttonsDisabled:t}=this.state;let a=t?"disabled":"",i=e.description;return(0,s.createElement)("div",null,(0,s.createElement)("div",{className:"cmplz-modal-backdrop",onClick:e=>this.dismissModal(e)}," "),(0,s.createElement)("div",{className:"cmplz-modal",id:"{id}"},(0,s.createElement)("div",{className:"cmplz-modal-header"},(0,s.createElement)("h2",{className:"modal-title"},e.title),(0,s.createElement)("button",{type:"button",className:"cmplz-modal-close","data-dismiss":"modal","aria-label":"Close",onClick:e=>this.dismissModal(e)},(0,s.createElement)(n.default,{name:"times"}))),(0,s.createElement)("div",{className:"cmplz-modal-content"},e.subtitle&&(0,s.createElement)("div",{className:"cmplz-modal-subtitle"},e.subtitle),Array.isArray(i)&&i.map(((e,t)=>(0,s.createElement)("div",{key:t,className:"cmplz-modal-description"},e)))),(0,s.createElement)("div",{className:"cmplz-modal-footer"},e.edit&&(0,s.createElement)("a",{href:e.edit,target:"_blank",rel:"noopener noreferrer",className:"button button-secondary"},(0,l.__)("Edit","complianz-gdpr")),e.help&&(0,s.createElement)("a",{href:e.help,target:"_blank",rel:"noopener noreferrer",className:"button cmplz-button-help"},(0,l.__)("Help","complianz-gdpr")),!e.ignored&&"ignore_url"===e.action&&(0,s.createElement)("button",{disabled:a,className:"button button-primary",onClick:e=>this.handleFix(e)},(0,l.__)("Ignore","complianz-gdpr")),"ignore_url"!==e.action&&(0,s.createElement)("button",{disabled:a,className:"button button-primary",onClick:e=>this.handleFix(e)},(0,l.__)("Fix","complianz-gdpr")))))}}const d=o}}]);