(()=>{"use strict";const e=window.wc.blocksCheckout,t=JSON.parse('{"apiVersion":2,"name":"mailpoet/marketing-optin-block","version":"0.1.0","title":"MailPoet Marketing Opt-in","category":"mailpoet","textdomain":"mailpoet","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":false}}},"parent":["woocommerce/checkout-contact-information-block"],"editorScript":"file:./marketing-optin-block.js","editorStyle":"file:./marketing-optin-block.css"}'),o=window.wp.element,n=window.wc.wcSettings,{optinEnabled:a,defaultText:i}=(0,n.getSetting)("mailpoet_data");(0,e.registerCheckoutBlock)({metadata:t,component:function(t){let{text:n,checkoutExtensionData:l}=t;const[c,r]=(0,o.useState)(!1),{setExtensionData:s}=l||{};return(0,o.useEffect)((()=>{a&&s&&s("mailpoet","optin",c)}),[c,s]),a?(0,o.createElement)(e.CheckboxControl,{checked:c,onChange:r},(0,o.createElement)(o.RawHTML,null,n||i)):null}})})();