!function(){"use strict";var o={d:function(e,t){for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:function(o,e){return Object.prototype.hasOwnProperty.call(o,e)}};o.d({},{Y:function(){return O}});var e=window.wp.element,t=window.wp.i18n,r=window.wp.blocks,n=window.blocksyOptions,l={inputFontColor:"",customInputFontColor:"",inputFontColorFocus:"",customInputFontColorFocus:"",inputIconColor:"",customInputIconColor:"",inputIconColorFocus:"",customInputIconColorFocus:"",inputBorderColor:"",customInputBorderColor:"",inputBorderColorFocus:"",customInputBorderColorFocus:"",inputBackgroundColor:"",customInputBackgroundColor:"",inputBackgroundColorFocus:"",customInputBackgroundColorFocus:"",buttonBackgroundColor:"",customButtonBackgroundColor:"",buttonBackgroundColorHover:"",customButtonBackgroundColorHover:""},c=(0,n.getColorsDefaults)(l),u=window.wp.blockEditor,i=window.wp.components;function a(){return a=Object.assign||function(o){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(o[r]=t[r])}return o},a.apply(this,arguments)}function s(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),t.push.apply(t,r)}return t}function p(o){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?s(Object(t),!0).forEach((function(e){b(o,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(t,e))}))}return o}function b(o,e,t){return e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}var d=window.blc_newsletter_data.has_cookies_checkbox,m=!!parseInt(d),g=function(o){var t=o.attributes,r=o.buttonStyles,n=o.setAttributes,l=t.newsletter_subscribe_view_type,c=t.newsletter_subscribe_name_label,i=t.newsletter_subscribe_button_text,s=t.has_newsletter_subscribe_name,b=t.newsletter_subscribe_mail_label;return(0,e.createElement)("div",{className:"ct-newsletter-subscribe-block"},(0,e.createElement)("form",a({action:"#",method:"post",target:"_blank",className:"ct-newsletter-subscribe-form"},"inline"!==l?{}:{"data-columns":"yes"===s?3:2},{"data-provider":"convertkit"}),"yes"===s?(0,e.createElement)("input",{type:"text",name:"FNAME",title:"Name",value:c,onChange:function(o){n({newsletter_subscribe_name_label:o.target.value})}}):null,(0,e.createElement)("input",{type:"email",name:"EMAIL",title:"Email",required:"",value:b,onChange:function(o){n({newsletter_subscribe_mail_label:o.target.value})}}),(0,e.createElement)(u.RichText,{className:"wp-element-button",style:p({},r),tagName:"span",value:i,placeholder:"Search",allowedFormats:[],onChange:function(o){return n({newsletter_subscribe_button_text:o})}}),m?(0,e.createElement)("p",{className:"gdpr-confirm-policy"},(0,e.createElement)("input",{name:"ct_has_gdprconfirm",type:"hidden",value:"yes"}),(0,e.createElement)("input",{id:"gdprconfirm_newsletter-subscribe",className:"ct-checkbox",name:"gdprconfirm",type:"checkbox",required:""}),(0,e.createElement)("label",{for:"gdprconfirm_newsletter-subscribe"},"I accept the"," ",(0,e.createElement)("a",{href:"/privacy-policy"},"Privacy Policy"))):null,(0,e.createElement)("div",{className:"ct-newsletter-subscribe-message"})))};function f(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),t.push.apply(t,r)}return t}function C(o){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?f(Object(t),!0).forEach((function(e){w(o,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach((function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(t,e))}))}return o}function w(o,e,t){return e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}var h,y=(0,u.withColors)({textColor:"color"},{inputFontColor:"color"},{inputFontColorFocus:"color"},{inputIconColor:"color"},{inputIconColorFocus:"color"},{inputBorderColor:"color"},{inputBorderColorFocus:"color"},{inputBackgroundColor:"color"},{inputBackgroundColorFocus:"color"},{buttonBackgroundColor:"color"},{buttonBackgroundColorHover:"color"})((function(o){var r,c,a=o.attributes,s=o.setAttributes,p=o.clientId,b=o.inputFontColor,d=o.setInputFontColor,m=o.inputFontColorFocus,f=o.setInputFontColorFocus,h=o.inputIconColor,y=o.setInputIconColor,k=o.inputIconColorFocus,_=o.setInputIconColorFocus,v=o.inputBorderColor,B=o.setInputBorderColor,F=o.inputBorderColorFocus,I=o.setInputBorderColorFocus,j=o.inputBackgroundColor,P=o.setInputBackgroundColor,E=o.inputBackgroundColorFocus,x=o.setInputBackgroundColorFocus,A=o.buttonBackgroundColor,V=o.setButtonBackgroundColor,D=o.buttonBackgroundColorHover,N=o.setButtonBackgroundColorHover,H=null==a||null===(r=a.style)||void 0===r||null===(c=r.border)||void 0===c?void 0:c.radius,S=(0,u.useBlockProps)({style:C(C(C({"--theme-form-text-initial-color":null==b?void 0:b.color,"--theme-form-text-focus-color":null==m?void 0:m.color,"--theme-form-field-border-initial-color":null==v?void 0:v.color,"--theme-form-field-border-focus-color":null==F?void 0:F.color,"--theme-form-field-background-initial-color":null==j?void 0:j.color,"--theme-form-field-background-focus-color":null==E?void 0:E.color},null!=a&&a.newsletter_subscribe_height?{"--theme-form-field-height":"".concat(a.newsletter_subscribe_height,"px")}:{}),H?{"--theme-form-field-border-radius":"".concat("string"==typeof H?H:"".concat(H.topLeft," ").concat(H.topRight," ").concat(H.bottomLeft," ").concat(H.bottomRight))}:{}),null!=a&&a.newsletter_subscribe_gap?{"--theme-form-field-gap":"".concat(a.newsletter_subscribe_gap,"px")}:{})});return(0,e.createElement)("div",S,(0,e.createElement)(g,{attributes:a,setAttributes:s,buttonStyles:C(C(C(C({},null!=h&&h.color?{"--theme-button-text-initial-color":h.color}:{}),null!=k&&k.color?{"--theme-button-text-hover-color":k.color}:{}),null!=A&&A.color?{"--theme-button-background-initial-color":A.color}:{}),null!=D&&D.color?{"--theme-button-background-hover-color":D.color}:{})}),(0,e.createElement)(u.InspectorControls,null,(0,e.createElement)(i.PanelBody,null,(0,e.createElement)(n.OptionsPanel,{purpose:"gutenberg",onChange:function(o,e){s(w({},o,e))},options:O,value:a,hasRevertButton:!1}))),(0,e.createElement)(u.InspectorControls,{group:"styles"},(0,e.createElement)(n.ColorsPanel,{label:(0,t.__)("Input Font Color","blocksy"),resetAll:function(){d(l.inputFontColor),f(l.inputFontColorFocus)},panelId:p,settings:[{colorValue:b.color,label:(0,t.__)("Initial","blocksy"),enableAlpha:!0,onColorChange:function(o){return d(o||l.inputFontColor)}},{colorValue:m.color,label:(0,t.__)("Focus","blocksy"),enableAlpha:!0,onColorChange:function(o){return f(o||l.inputFontColorFocus)}}]}),(0,e.createElement)(n.ColorsPanel,{label:(0,t.__)("Input Border Color","blocksy"),resetAll:function(){B(l.inputBorderColor),I(l.inputBorderColorFocus)},panelId:p,settings:[{colorValue:v.color,label:(0,t.__)("Initial","blocksy"),enableAlpha:!0,onColorChange:function(o){return B(o||l.inputBorderColor)}},{colorValue:F.color,label:(0,t.__)("Focus","blocksy"),enableAlpha:!0,onColorChange:function(o){return I(o||l.inputBorderColorFocus)}}]}),(0,e.createElement)(n.ColorsPanel,{label:(0,t.__)("Input Background Color","blocksy"),resetAll:function(){P(l.inputBackgroundColor),x(l.inputBackgroundColorFocus)},panelId:p,settings:[{colorValue:j.color,label:(0,t.__)("Initial","blocksy"),enableAlpha:!0,onColorChange:function(o){return P(o||l.inputBackgroundColor)}},{colorValue:E.color,label:(0,t.__)("Focus","blocksy"),enableAlpha:!0,onColorChange:function(o){return x(o||l.inputBackgroundColorFocus)}}]}),(0,e.createElement)(n.ColorsPanel,{label:(0,t.__)("Button Text Color","blocksy"),resetAll:function(){y(l.inputIconColor),_(l.inputIconColorFocus)},panelId:p,settings:[{colorValue:h.color,label:(0,t.__)("Initial","blocksy"),enableAlpha:!0,onColorChange:function(o){return y(o||l.inputIconColor)}},{colorValue:k.color,label:(0,t.__)("Hover","blocksy"),enableAlpha:!0,onColorChange:function(o){return _(o||l.inputIconColorFocus)}}]}),(0,e.createElement)(n.ColorsPanel,{label:(0,t.__)("Button Background Color","blocksy"),resetAll:function(){V(l.buttonBackgroundColor),N(l.buttonBackgroundColorHover)},panelId:p,settings:[{colorValue:A.color,label:(0,t.__)("Initial","blocksy"),enableAlpha:!0,onColorChange:function(o){return V(o||l.buttonBackgroundColor)}},{colorValue:D.color,label:(0,t.__)("Hover","blocksy"),enableAlpha:!0,onColorChange:function(o){return N(o||l.buttonBackgroundColorHover)}}]})))}));function k(o,e){var t=Object.keys(o);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(o);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable}))),t.push.apply(t,r)}return t}function _(o){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?k(Object(t),!0).forEach((function(e){v(o,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach((function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(t,e))}))}return o}function v(o,e,t){return e in o?Object.defineProperty(o,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[e]=t,o}var O=(0,n.getOptionsForBlock)("newsletter"),B=(0,n.getAttributesFromOptions)(O);(0,r.registerBlockType)("blocksy/newsletter",{apiVersion:3,title:(0,t.__)("Newsletter Controls","blocksy-companion"),icon:{src:(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"wc-block-editor-components-block-icon"},(0,e.createElement)("path",{d:"M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zM5 6.5h14c.3 0 .5.2.5.5v.9L12 13.6 4.5 7.9V7c0-.3.2-.5.5-.5zm14 11H5c-.3 0-.5-.2-.5-.5V9.8l7.5 5.6 7.5-5.6V17c0 .3-.2.5-.5.5z"}))},category:"widgets",supports:{html:!1,multiple:!1,inserter:!1,lock:!1,__experimentalBorder:{color:!1,radius:!0,width:!1,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!1,radius:!0,width:!1}}},parent:["blocksy/widgets-wrapper"],attributes:_(_({},B),c),edit:function(o){return(0,e.createElement)(y,o)},save:function(){return(0,e.createElement)("div",null,"Blocksy: Newsletter")}}),wp.blocks.registerBlockVariation("blocksy/widgets-wrapper",{name:"blocksy-newsletter",title:(0,t.__)("Newsletter","blocksy-companion"),attributes:{heading:(0,t.__)("Newsletter","blocksy-companion"),block:"blocksy/newsletter",hasDescription:!0,description:(null==B||null===(h=B.newsletter_subscribe_text)||void 0===h?void 0:h.default)||""},isActive:function(o){return"blocksy/newsletter"===o.block},icon:{src:(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"wc-block-editor-components-block-icon"},(0,e.createElement)("path",{d:"M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zM5 6.5h14c.3 0 .5.2.5.5v.9L12 13.6 4.5 7.9V7c0-.3.2-.5.5-.5zm14 11H5c-.3 0-.5-.2-.5-.5V9.8l7.5 5.6 7.5-5.6V17c0 .3-.2.5-.5.5z"}))}})}();