diff --git a/build/Emails/assets/js/blocks.asset.php b/build/Emails/assets/js/blocks.asset.php index fc011d72..d2db45da 100644 --- a/build/Emails/assets/js/blocks.asset.php +++ b/build/Emails/assets/js/blocks.asset.php @@ -1 +1 @@ - array('lodash', 'react', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '8449aa647b1c17615ed6'); + array('lodash', 'react', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-dom', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => 'b4d0db18860ed170b319'); diff --git a/build/Emails/assets/js/blocks.js b/build/Emails/assets/js/blocks.js index 9d2d41a6..30957d85 100644 --- a/build/Emails/assets/js/blocks.js +++ b/build/Emails/assets/js/blocks.js @@ -1,8 +1,8 @@ (()=>{"use strict";var e={20:(e,t,n)=>{var o=n(609),r=Symbol.for("react.element"),l=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),a=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};t.jsx=function(e,t,n){var o,s={},c=null,u=null;for(o in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)l.call(t,o)&&!i.hasOwnProperty(o)&&(s[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===s[o]&&(s[o]=t[o]);return{$$typeof:r,type:e,key:c,ref:u,props:s,_owner:a.current}}},848:(e,t,n)=>{e.exports=n(20)},609:e=>{e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o](l,l.exports,n),l.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const o=window.wp.blocks,r=window.wp.i18n;var l=n(609),a=n.n(l);const i=window.wp.components,s=window.wp.blockEditor,c=(e,t)=>!0===e||(Array.isArray(e)?e.includes(t):"object"==typeof e&&!0===e[t]),u=(e,t,n,o={})=>{const r="object"==typeof o;return[e?.style?.noptin?.[n]||o,t&&(0,l.useCallback)((l=>{t({style:{...e.style||{},noptin:{...e.style?.noptin||{},[n]:r?{...e.style?.noptin?.[n]||o||{},...l}:l}}})}),[e,t,n]),t&&(0,l.useCallback)((()=>{t({style:{...e.style||{},noptin:{...e.style?.noptin||{},[n]:o}}})}),[e,t,n])]},p=["Arial, Helvetica, sans-serif","Verdana, Geneva, sans-serif","Times New Roman, Times, serif","Georgia, serif","Courier New, Courier, monospace","Tahoma, Geneva, sans-serif","Calibri, Arial, sans-serif","Trebuchet MS, sans-serif","Lucida Grande, sans-serif","Palatino, serif"],d=({value:e,onChange:t})=>{const n=p.map((n=>({title:(0,l.createElement)("span",{style:{fontFamily:n}},(0,l.createElement)(i.__experimentalTruncate,{limit:25,ellipsizeMode:"tail"},n)),onClick:()=>t(n),isActive:e===n,label:n})));return(0,l.createElement)(i.__experimentalInputControlSuffixWrapper,null,(0,l.createElement)(i.DropdownMenu,{icon:"admin-customizer",label:(0,r.__)("Font family","newsletter-optin-box"),controls:n,noIcons:!0}))},m=({value:e,onChange:t})=>(0,l.createElement)(i.__experimentalInputControl,{label:(0,r.__)("Font family","newsletter-optin-box"),value:e,onChange:t,suffix:(0,l.createElement)(d,{value:e,onChange:t})}),g={fontFamily:!1,fontSize:!0,fontAppearance:!1,lineHeight:!1,letterSpacing:!1,textTransform:!1,textDecoration:!1},h=[{name:(0,r.__)("Small"),slug:"small",size:13},{name:(0,r.__)("Normal"),slug:"normal",size:16},{name:(0,r.__)("Medium"),slug:"medium",size:20},{name:(0,r.__)("Large"),slug:"large",size:36},{name:(0,r.__)("Huge"),slug:"huge",size:42}];function b({attributes:e={style:{noptin:{typography:{}}}},setAttributes:t,settings:n,panelId:o,defaultControls:a=g}){const[p,d,b]=u(e,t,"typography"),_=c(n,"fontFamily"),f=p.fontFamily,y=e=>d({fontFamily:e}),v=c(n,"fontSize"),x=p.fontSize,k=e=>d({fontSize:e}),w=c(n,"fontStyle"),E=c(n,"fontWeight"),C=w||E,S=p.fontStyle,B=p.fontWeight,I=({fontStyle:e,fontWeight:t})=>d({fontStyle:e,fontWeight:t}),T=c(n,"lineHeight"),M=p.lineHeight,z=e=>d({lineHeight:e}),A=c(n,"letterSpacing"),N=p.letterSpacing,P=e=>d({letterSpacing:e}),H=c(n,"textTransform"),L=p.textTransform,V=e=>d({textTransform:e}),$=c(n,"textDecoration"),R=p.textDecoration,D=e=>d({textDecoration:e});return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(i.__experimentalToolsPanel,{label:(0,r.__)("Typography"),resetAll:b,panelId:o,className:"typography-block-support-panel"},_&&(0,l.createElement)(i.__experimentalToolsPanelItem,{label:(0,r.__)("Font family"),hasValue:()=>!!f,onDeselect:()=>y(void 0),isShownByDefault:a.fontFamily,panelId:o},(0,l.createElement)(m,{value:f||"",onChange:y})),v&&(0,l.createElement)(i.__experimentalToolsPanelItem,{label:(0,r.__)("Font size"),hasValue:()=>!!x,onDeselect:()=>k(void 0),isShownByDefault:a.fontSize,panelId:o},(0,l.createElement)(i.FontSizePicker,{value:x,onChange:k,fontSizes:h,disableCustomFontSizes:!1,withReset:!1,units:["px","em","rem"],withSlider:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0})),C&&(0,l.createElement)(i.__experimentalToolsPanelItem,{className:"single-column",label:(0,r.__)("Appearance"),hasValue:()=>!!S||!!B,onDeselect:()=>{I({fontStyle:void 0,fontWeight:void 0})},isShownByDefault:a.fontAppearance,panelId:o},(0,l.createElement)(s.__experimentalFontAppearanceControl,{value:{fontStyle:S,fontWeight:B},onChange:I,hasFontStyles:w,hasFontWeights:E,size:"__unstable-large",__nextHasNoMarginBottom:!0})),T&&(0,l.createElement)(i.__experimentalToolsPanelItem,{className:"single-column",label:(0,r.__)("Line height"),hasValue:()=>!!M,onDeselect:()=>z(void 0),isShownByDefault:a.lineHeight,panelId:o},(0,l.createElement)(s.LineHeightControl,{__nextHasNoMarginBottom:!0,__unstableInputWidth:"auto",value:M,onChange:z,size:"__unstable-large"})),A&&(0,l.createElement)(i.__experimentalToolsPanelItem,{className:"single-column",label:(0,r.__)("Letter spacing"),hasValue:()=>!!N,onDeselect:()=>P(void 0),isShownByDefault:a.letterSpacing,panelId:o},(0,l.createElement)(s.__experimentalLetterSpacingControl,{value:N,onChange:P,size:"__unstable-large",__unstableInputWidth:"auto"})),$&&(0,l.createElement)(i.__experimentalToolsPanelItem,{className:"single-column",label:(0,r.__)("Text decoration"),hasValue:()=>!!R,onDeselect:()=>D(void 0),isShownByDefault:a.textDecoration,panelId:o},(0,l.createElement)(s.__experimentalTextDecorationControl,{value:R,onChange:D,size:"__unstable-large",__unstableInputWidth:"auto"})),H&&(0,l.createElement)(i.__experimentalToolsPanelItem,{label:(0,r.__)("Letter case"),hasValue:()=>!!L,onDeselect:()=>V(void 0),isShownByDefault:a.textTransform,panelId:o},(0,l.createElement)(s.__experimentalTextTransformControl,{value:L,onChange:V,showNone:!0,isBlock:!0,size:"__unstable-large",__nextHasNoMarginBottom:!0}))))}const _=e=>{const[t]=u(e,null,"typography");return t},f=()=>window.noptinEmailEditorSettings.settings?.__experimentalFeatures?.color?.palette?.theme||[];function y({attributes:e={style:{noptin:{border:{}}}},setAttributes:t=(e=>e),settings:n,panelId:o}){const[a,p,d]=u(e,t,"border"),m=f();return(0,l.createElement)(i.__experimentalToolsPanel,{label:(0,r.__)("Border"),resetAll:d,panelId:o,className:"border-block-support-panel"},c(n,"border")&&(0,l.createElement)(i.__experimentalToolsPanelItem,{hasValue:()=>(0,i.__experimentalIsDefinedBorder)(a?.border),label:(0,r.__)("Border"),onDeselect:()=>p({border:void 0}),isShownByDefault:!0,panelId:o},(0,l.createElement)(i.__experimentalBorderBoxControl,{colors:m,onChange:e=>p({border:e}),popoverOffset:40,popoverPlacement:"left-start",value:a?.border,__experimentalIsRenderedInSidebar:!0,size:"__unstable-large"})),c(n,"radius")&&(0,l.createElement)(i.__experimentalToolsPanelItem,{hasValue:()=>{const e=a?.radius;return"object"==typeof e?Object.entries(e).some(Boolean):!!e},label:(0,r.__)("Radius"),onDeselect:()=>p({radius:void 0}),isShownByDefault:!0,panelId:o},(0,l.createElement)(s.__experimentalBorderRadiusControl,{values:a?.radius,onChange:e=>p({radius:e})})))}const v=e=>{const[t]=u(e,null,"border");if(!t)return{};const n=(e,t)=>{if(!e)return{};const n={};return["style","width","color"].forEach((o=>{const r=e[o],l=`${t}${o.charAt(0).toUpperCase()+o.slice(1)}`;r&&(n[l]=r)})),n[`${t}Width`]&&!n[`${t}Style`]&&(n[`${t}Style`]="solid"),n},o=e?.style?.noptin?.border;return{...(0,i.__experimentalIsDefinedBorder)(o?.border)?(e=>{if(!(0,i.__experimentalHasSplitBorders)(e))return n(e,"border");let t={};return["top","right","bottom","left"].forEach((o=>{const r=e[o],l=`border${o.charAt(0).toUpperCase()+o.slice(1)}`;t={...t,...n(r,l)}})),t})(o?.border):{},...(r=t.radius,r&&"object"==typeof r?{borderRadius:["topLeft","topRight","bottomRight","bottomLeft"].reduce(((e,t)=>{const n=r[t];return n&&(e=`${e} ${n}`),e}),"")}:{borderRadius:r})};var r};function x(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t(0,l.createElement)(i.__experimentalHStack,{justify:"flex-start"},(0,l.createElement)(i.__experimentalZStack,{isLayered:!1,offset:-8},e.map(((e,t)=>(0,l.createElement)(i.Flex,{key:t,expanded:!1},(0,l.createElement)(i.ColorIndicator,{colorValue:e}))))),(0,l.createElement)(i.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:t},t));function A({isGradient:e,inheritedValue:t,userValue:n,setValue:o,colorGradientControlSettings:r}){return(0,l.createElement)(s.__experimentalColorGradientControl,{...r,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:e?void 0:t,gradientValue:e?t:void 0,onColorChange:e?void 0:o,onGradientChange:e?o:void 0,clearable:t===n,headingLevel:3})}function N({label:e,hasValue:t,resetValue:n,isShownByDefault:o,indicators:a,tabs:s,colorGradientControlSettings:c,panelId:u,isFirst:p=!1,isLast:d=!1}){const m=s.map((({key:e,label:t})=>({name:e,title:t}))),g=k("block-editor-tools-panel-color-gradient-settings__item",{first:p,last:d});return(0,l.createElement)(i.__experimentalToolsPanelItem,{className:g,hasValue:t,label:e,onDeselect:n,isShownByDefault:o,panelId:u},(0,l.createElement)(i.Dropdown,{popoverProps:M,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:({onToggle:t,isOpen:n})=>{const o={onClick:t,className:k("block-editor-panel-color-gradient-settings__dropdown",{"is-open":n}),"aria-expanded":n,"aria-label":(0,r.sprintf)(/* translators: %s is the type of color property, e.g., "background" */ /* translators: %s is the type of color property, e.g., "background" */ -(0,r.__)("Color %s styles"),e)};return(0,l.createElement)(i.Button,{...o},(0,l.createElement)(z,{indicators:a,label:e}))},renderContent:()=>(0,l.createElement)(i.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,l.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},1===s.length&&(0,l.createElement)(A,{...s[0],colorGradientControlSettings:c}),s.length>1&&(0,l.createElement)(i.TabPanel,{tabs:m},(e=>{const t=s.find((t=>t.key===e.name));return t?(0,l.createElement)(A,{...t,colorGradientControlSettings:c}):null}))))}))}const P={text:!0,background:!0,link:!0,heading:!0,button:!0},H={text:{label:(0,r.__)("Text"),prepare:(e,t)=>{t?.text&&(e.style.color=t.text)}},background:{label:(0,r.__)("Background"),prepare:(e,t)=>{t?.background&&(e.style.backgroundColor=t.background)}},link:{label:(0,r.__)("Link"),prepare:(e,t,n)=>{t?.link&&(e.css=`${e.css} ${n} a { color: ${t.link} }`)}},heading:{label:(0,r.__)("Heading"),tabs:[{key:"heading",label:(0,r.__)("Text")},{key:"headingBackground",label:(0,r.__)("Background")}],prepare:(e,t,n)=>{t?.heading&&(e.css=`${e.css} ${n} h1,\n${n} h2,\n${n} h3,\n${n} h4,\n${n} h5,\n${n} h6 { color: ${t.heading} }`),t?.headingBackground&&(e.css=`${e.css} ${n} h1,\n${n} h2,\n${n} h3,\n${n} h4,\n${n} h5,\n${n} h6 { background-color: ${t.headingBackground} }`)}},button:{label:(0,r.__)("Button"),tabs:[{key:"buttonBackground",label:(0,r.__)("Background")},{key:"button",label:(0,r.__)("Text")}],prepare:(e,t,n)=>{t?.button&&(e.css=`${e.css} ${n} .noptin-button-link,\n${n} .noptin-button-link__wrapper { color: ${t.button} }`),t?.buttonBackground&&(e.css=`${e.css} ${n} .noptin-button-link,\n${n} .noptin-button-link__wrapper { background-color: ${t.buttonBackground} }`)}}};function L({settings:e,panelId:t,defaultControls:n=P,children:o=null,attributes:a,setAttributes:s}){const[p,d,m]=u(a,s,"color"),g=f(),h=(0,w.compact)(Object.keys(H).map((t=>{if(!c(e,t))return!1;const o=H[t].tabs||[{key:t,label:H[t].label}];return{key:t,label:H[t].label,hasValue:()=>!!p[t],resetValue:()=>d({[t]:void 0}),isShownByDefault:n[t],indicators:[p?.[t]],tabs:o.map((({key:e,label:t})=>({key:e,label:t,setValue:t=>d({[e]:t}),userValue:p?.[e]})))}}))),b=h.length;return(0,l.createElement)(i.__experimentalToolsPanel,{label:(0,r.__)("Color"),resetAll:m,panelId:t,className:"color-block-support-panel"},(0,l.createElement)("div",{className:"color-block-support-panel__inner-wrapper",style:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0px, 1fr))",gap:"calc(16px) calc(8px)",gridColumn:"1 / -1",rowGap:0}},h.map(((e,n)=>(0,l.createElement)(N,{...e,colorGradientControlSettings:{colors:g,disableCustomColors:!1},panelId:t,isFirst:0===n,isLast:n===b-1}))),o))}const V=e=>{const[t]=u(e,null,"color"),n={style:{},css:""};return t?(Object.values(H).forEach((o=>{o.prepare(n,t,`#noptin-email-content .${e.anchor}`)})),n):{style:{},css:""}},$=["none","left","center","right"],R=e=>{const[t]=u(e,null,"align","none");return"none"===t?void 0:t},D=window.noptinEmailEditorSettings||{},O={},j=Object.keys(D.objects||{}).map((e=>{const t=`noptin/${D.objects[e].name.toLowerCase().replace(/[^a-z0-9\-]/g,"-")}`;return O[t]=D.objects[e].label,t})),F=({settings:e,...t})=>(e.edit=(0,E.createHigherOrderComponent)((e=>t=>{const{closestCollection:n,closestCollectionId:o}=(0,S.useSelect)((e=>{const{getBlockParents:n,getBlockName:o}=e(s.store),r=n(t.clientId).find((e=>j.includes(o(e))));return{closestCollection:r?o(r):null,closestCollectionId:r}}),[t.clientId]),{selectBlock:a}=(0,S.useDispatch)(s.store),c=n&&O[n];return(0,l.createElement)(l.Fragment,null,c&&(0,l.createElement)(s.InspectorControls,null,(0,l.createElement)(i.PanelBody,null,(0,l.createElement)(i.Button,{variant:"secondary",onClick:()=>a(o),className:"noptin-components-button__is-block",__next40pxDefaultSize:!0},(0,l.createElement)(i.Icon,{icon:"filter"}),(0,r.sprintf)( +(0,r.__)("Color %s styles"),e)};return(0,l.createElement)(i.Button,{...o},(0,l.createElement)(z,{indicators:a,label:e}))},renderContent:()=>(0,l.createElement)(i.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,l.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},1===s.length&&(0,l.createElement)(A,{...s[0],colorGradientControlSettings:c}),s.length>1&&(0,l.createElement)(i.TabPanel,{tabs:m},(e=>{const t=s.find((t=>t.key===e.name));return t?(0,l.createElement)(A,{...t,colorGradientControlSettings:c}):null}))))}))}const P={text:!0,background:!0,link:!0,heading:!0,button:!0},H={text:{label:(0,r.__)("Text"),prepare:(e,t)=>{t?.text&&(e.style.color=t.text)}},background:{label:(0,r.__)("Background"),prepare:(e,t)=>{t?.background&&(e.style.backgroundColor=t.background)}},link:{label:(0,r.__)("Link"),prepare:(e,t,n)=>{t?.link&&(e.css=`${e.css} ${n} a { color: ${t.link} }`)}},heading:{label:(0,r.__)("Heading"),tabs:[{key:"heading",label:(0,r.__)("Text")},{key:"headingBackground",label:(0,r.__)("Background")}],prepare:(e,t,n)=>{t?.heading&&(e.css=`${e.css} ${n} h1,\n${n} h2,\n${n} h3,\n${n} h4,\n${n} h5,\n${n} h6 { color: ${t.heading} }`),t?.headingBackground&&(e.css=`${e.css} ${n} h1,\n${n} h2,\n${n} h3,\n${n} h4,\n${n} h5,\n${n} h6 { background-color: ${t.headingBackground} }`)}},button:{label:(0,r.__)("Button"),tabs:[{key:"buttonBackground",label:(0,r.__)("Background")},{key:"button",label:(0,r.__)("Text")}],prepare:(e,t,n)=>{t?.button&&(e.css=`${e.css} ${n} .noptin-button-link,\n${n} .noptin-button-link__wrapper { color: ${t.button} }`),t?.buttonBackground&&(e.css=`${e.css} ${n} .noptin-button-link,\n${n} .noptin-button-link__wrapper { background-color: ${t.buttonBackground} }`)}}};function L({settings:e,panelId:t,defaultControls:n=P,children:o=null,attributes:a,setAttributes:s}){const[p,d,m]=u(a,s,"color"),g=f(),h=(0,w.compact)(Object.keys(H).map((t=>{if(!c(e,t))return!1;const o=H[t].tabs||[{key:t,label:H[t].label}];return{key:t,label:H[t].label,hasValue:()=>!!p[t],resetValue:()=>d({[t]:void 0}),isShownByDefault:n[t],indicators:[p?.[t]],tabs:o.map((({key:e,label:t})=>({key:e,label:t,setValue:t=>d({[e]:t}),userValue:p?.[e]})))}}))),b=h.length;return(0,l.createElement)(i.__experimentalToolsPanel,{label:(0,r.__)("Color"),resetAll:m,panelId:t,className:"color-block-support-panel"},(0,l.createElement)("div",{className:"color-block-support-panel__inner-wrapper",style:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0px, 1fr))",gap:"calc(16px) calc(8px)",gridColumn:"1 / -1",rowGap:0}},h.map(((e,n)=>(0,l.createElement)(N,{...e,colorGradientControlSettings:{colors:g,disableCustomColors:!1},panelId:t,isFirst:0===n,isLast:n===b-1}))),o))}const V=(e,t)=>{const[n]=u(e,null,"color"),o={style:{},css:""};return n?(Object.values(H).forEach((r=>{r.prepare(o,n,`#noptin-email-content .${t||e.anchor}`)})),o):{style:{},css:""}},$=["none","left","center","right"],R=e=>{const[t]=u(e,null,"align","none");return"none"===t?void 0:t},D=window.noptinEmailEditorSettings||{},O={},j=Object.keys(D.objects||{}).map((e=>{const t=`noptin/${D.objects[e].name.toLowerCase().replace(/[^a-z0-9\-]/g,"-")}`;return O[t]=D.objects[e].label,t})),F=({settings:e,...t})=>(e.edit=(0,E.createHigherOrderComponent)((e=>t=>{const{closestCollection:n,closestCollectionId:o}=(0,S.useSelect)((e=>{const{getBlockParents:n,getBlockName:o}=e(s.store),r=n(t.clientId).find((e=>j.includes(o(e))));return{closestCollection:r?o(r):null,closestCollectionId:r}}),[t.clientId]),{selectBlock:a}=(0,S.useDispatch)(s.store),c=n&&O[n];return(0,l.createElement)(l.Fragment,null,c&&(0,l.createElement)(s.InspectorControls,null,(0,l.createElement)(i.PanelBody,null,(0,l.createElement)(i.Button,{variant:"secondary",onClick:()=>a(o),className:"noptin-components-button__is-block",__next40pxDefaultSize:!0},(0,l.createElement)(i.Icon,{icon:"filter"}),(0,r.sprintf)( // translators: %s: filter label. // translators: %s: filter label. -(0,r.__)("Filter %s","newsletter-optin-box"),c)))),(0,l.createElement)(e,{...t}))}),"withSelectCollection")(e.edit),{settings:e,...t}),U=["core/html","noptin/missing","noptin/shortcode"],W=[...U,"noptin/social-link","noptin/spacer","noptin/social-links","noptin/separator","core/image","noptin/button"];function G(e){if(!e)return;if(U.includes(e.name)){const t=F(e);return(0,o.registerBlockType)({name:t.name,...t.metadata},t.settings)}if(e.metadata.attributes=e.metadata.attributes||{},W.includes(e.name)||e.metadata.attributes?.anchor||(e.metadata.attributes.anchor={type:"string"}),e.metadata?.noptin&&!e.metadata.attributes?.style&&(e.metadata.attributes=e.metadata.attributes||{},e.metadata.attributes.style={type:"object",default:{}}),e.settings?.icon?.icon){let t={src:e.settings.icon.icon,foreground:e.settings.icon.fill||void 0};e.settings.icon=t}const{metadata:t,settings:n,name:r}=F((({metadata:e,settings:t,...n})=>(e?.noptin?.color&&(t.edit=(0,E.createHigherOrderComponent)((t=>n=>{const[o,r]=(()=>{const[e,t]=(0,C.useEntityProp)("postType",(0,S.useSelect)((e=>e(B.store).getCurrentPostType()),[]),"meta"),n=e||{},o=n.campaign_data?.block_css||{};return[o,(e,r)=>{const l={...o,[e]:r};Object.keys(l).forEach((e=>{l[e]||delete l[e]})),t({...n,campaign_data:{...n.campaign_data||{},block_css:l}})}]})(),a=n.attributes?.anchor,i=!W.includes(n.name);let c=a;(0,l.useEffect)((()=>{i&&((!a||I[a]&&I[a]!==n.clientId)&&(c=e.name.replace("/","-")+"-"+(1e5*Math.random()).toFixed(0)),I[c]=n.clientId,T[n.clientId]=c)}),[]);const u=o[c]||"",p=(0,l.useMemo)((()=>W.includes(n.name)?"":V(n.attributes).css),[n.attributes,n.name]);return(0,l.useEffect)((()=>{if(!c||!i)return;const e=T[n.clientId];u!==p?(r(c,p),e&&e!==a&&n.setAttributes({anchor:e})):a&&e&&e!==a&&n.setAttributes({anchor:e})}),[c,u,p,i]),(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.InspectorControls,{group:"styles"},(0,l.createElement)(L,{panelId:n.clientId,attributes:n.attributes,setAttributes:n.setAttributes,settings:e.noptin.color})),(0,l.createElement)(t,{...n}))}),"withNoptinColors")(t.edit)),{metadata:e,settings:t,...n}))((({metadata:e,settings:t,...n})=>(e?.noptin?.align&&(t.edit=(0,E.createHigherOrderComponent)((e=>t=>{const[n,o]=u(t.attributes,t.setAttributes,"align","none");return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.BlockControls,{group:"block"},(0,l.createElement)(s.BlockAlignmentControl,{value:n,onChange:o,controls:$})),(0,l.createElement)(e,{...t}))}),"withNoptinAlignmentSupport")(t.edit)),{metadata:e,settings:t,...n}))((({metadata:e,settings:t,...n})=>{if(e?.noptin?.typography){const n=t.edit;t.edit=t=>{const o=c(e.noptin.typography,"textAlign"),[r,a]=u(t.attributes,t.setAttributes,"typography");return(0,l.createElement)(l.Fragment,null,o&&(0,l.createElement)(s.BlockControls,{group:"block"},(0,l.createElement)(s.AlignmentControl,{value:r.textAlign,onChange:e=>a({textAlign:e})})),(0,l.createElement)(s.InspectorControls,{group:"styles"},(0,l.createElement)(b,{panelId:t.clientId,attributes:t.attributes,setAttributes:t.setAttributes,settings:e.noptin.typography})),n(t))}}return{metadata:e,settings:t,...n}})((({metadata:e,settings:t,...n})=>{if(e?.noptin?.border){const n=t.edit;t.edit=t=>(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.InspectorControls,{group:"styles"},(0,l.createElement)(y,{panelId:t.clientId,attributes:t.attributes,setAttributes:t.setAttributes,settings:e.noptin.border})),n(t))}return{metadata:e,settings:t,...n}})(e)))));return(0,o.registerBlockType)({name:r,...t},n)}const q=e=>{const t={margin:{},padding:{}};return e?(Object.entries(e).forEach((([e,n])=>{e.startsWith("margin")?t.margin[e]=n:e.startsWith("padding")&&(t.padding[e]=n)})),t):t},Z=(e,t=!1)=>{const n=(0,s.__experimentalGetSpacingClassesAndStyles)(e),o=n?.style||{};return t?q(o):o};Z.save=(e,t=!1)=>{const n=(0,s.__experimentalGetSpacingClassesAndStyles)(e),o=n?.style||{};return t?q(o):o};const K=window.wp.keycodes;function Y(e){const{batch:t}=(0,S.useRegistry)(),{moveBlocksToPosition:n,replaceInnerBlocks:r,duplicateBlocks:a,insertBlock:i}=(0,S.useDispatch)(s.store),{getBlockRootClientId:c,getBlockIndex:u,getBlockOrder:p,getBlockName:d,getBlock:m,getNextBlockClientId:g,canInsertBlockType:h}=(0,S.useSelect)(s.store),b=(0,l.useRef)(e);return b.current=e,(0,E.useRefEffect)((e=>{function l(e){if(e.defaultPrevented)return;if(e.keyCode!==K.ENTER)return;const{content:l,clientId:s}=b.current;if(l.length)return;const _=c(s);if(!(0,o.hasBlockSupport)(d(_),"__experimentalOnEnter",!1))return;const f=p(_),y=f.indexOf(s);if(y===f.length-1){let t=_;for(;!h(d(s),c(t));)t=c(t);return void("string"==typeof t&&(e.preventDefault(),n([s],_,c(t),u(t)+1)))}const v=(0,o.getDefaultBlockName)();if(!h(v,c(_)))return;e.preventDefault();const x=m(_);t((()=>{a([_]);const e=u(_);r(_,x.innerBlocks.slice(0,y)),r(g(_),x.innerBlocks.slice(y+1)),i((0,o.createBlock)(v),e+1,c(_),!0)}))}return e.addEventListener("keydown",l),()=>{e.removeEventListener("keydown",l)}}),[])}const X={apiVersion:3,name:"core/paragraph",title:(0,r.__)("Paragraph"),category:"content",description:(0,r.__)("Start with the basic building block of all narrative."),keywords:["text"],attributes:{content:{type:"string",source:"html",selector:"p",default:"",role:"content"},placeholder:{type:"string"}},noptin:{typography:!0,border:!0,color:{background:!0,text:!0,link:!0}},supports:{anchor:!1,className:!0,splitting:!0,spacing:{__experimentalSkipSerialization:!0,margin:!0,padding:!0,__experimentalDefaultControls:{margin:!0,padding:!1}},__experimentalSelector:"p",__unstablePasteTextInline:!0}},Q={from:[{type:"raw",priority:20,selector:"p",schema:({phrasingContentSchema:e,isPaste:t})=>({p:{children:e,attributes:t?[]:["style","id"]}}),transform(e){const t=(0,o.getBlockAttributes)("core/paragraph",e.outerHTML),{textAlign:n}=e.style||{};return"left"!==n&&"center"!==n&&"right"!==n||(t.style={...t.style||{},noptin:{...t.style?.noptin||{},typography:{...t.style?.noptin?.typography||{},textAlign:n}}}),(0,o.createBlock)("core/paragraph",t)}}]},J=Q,{name:ee}=X,te={icon:"editor-paragraph",example:{attributes:{content:(0,r.__)("In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.")}},__experimentalLabel(e,{context:t}){const n=e?.metadata?.name;if("list-view"===t&&n)return n;if("accessibility"===t){if(n)return n;const{content:t}=e;return t&&0!==t.length?t:(0,r.__)("Empty")}},transforms:J,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:function({attributes:e,mergeBlocks:t,onReplace:n,onRemove:o,setAttributes:a,clientId:i}){const{content:c,placeholder:u}=e,p=(0,s.useBlockProps)({ref:Y({clientId:i,content:c}),style:{..._(e),...v(e),...Z(e),...V(e).style}});return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.RichText,{identifier:"content",tagName:"p",...p,value:c,onChange:e=>a({content:e}),onMerge:t,onReplace:n,onRemove:o,"aria-label":c?(0,r.__)("Block: Paragraph"):(0,r.__)("Empty block; start writing or type forward slash to choose a block"),"data-empty":!c,placeholder:u||(0,r.__)("Start writing or type / to choose a block","newsletter-optin-box"),"data-custom-placeholder":!!u||void 0,__unstableAllowPrefixTransformations:!0}))},save:function({attributes:e}){const{content:t}=e,n=s.useBlockProps.save({style:{..._(e),...v(e),...Z.save(e),...V(e).style}});return(0,l.createElement)("p",{...n},(0,l.createElement)(s.RichText.Content,{value:t}))}},ne={apiVersion:3,name:"core/heading",title:(0,r.__)("Heading"),category:"content",description:(0,r.__)("Introduce new sections and organize content to help readers understand the structure of your content."),keywords:["title","subtitle"],attributes:{content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",role:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},noptin:{typography:!0,border:!0,color:{background:!0,text:!0,link:!0}},supports:{anchor:!1,className:!0,splitting:!0,spacing:{__experimentalSkipSerialization:!0,margin:!0,padding:!0,__experimentalDefaultControls:{margin:!0,padding:!1}},__unstablePasteTextInline:!0,__experimentalSlashInserter:!0}},oe={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((({content:e,className:t,style:n})=>(0,o.createBlock)("core/heading",{content:e,className:t,style:n})))},{type:"raw",selector:"h1,h2,h3,h4,h5,h6",schema:({phrasingContentSchema:e,isPaste:t})=>{const n={children:e,attributes:t?[]:["style","id"]};return{h1:n,h2:n,h3:n,h4:n,h5:n,h6:n}},transform(e){const t=(0,o.getBlockAttributes)("core/heading",e.outerHTML),{textAlign:n}=e.style||{};var r;return t.level=(r=e.nodeName,Number(r.substr(1))),"left"!==n&&"center"!==n&&"right"!==n||(t.style={...t.style||{},noptin:{...t.style?.noptin||{},typography:{...t.style?.noptin?.typography||{},textAlign:n}}}),(0,o.createBlock)("core/heading",t)}},...[1,2,3,4,5,6].map((e=>({type:"prefix",prefix:Array(e+1).join("#"),transform:t=>(0,o.createBlock)("core/heading",{level:e,content:t})}))),...[1,2,3,4,5,6].map((e=>({type:"enter",regExp:new RegExp(`^/(h|H)${e}$`),transform:()=>(0,o.createBlock)("core/heading",{level:e})})))],to:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((({content:e,className:t,style:n})=>(0,o.createBlock)("core/paragraph",{content:e,className:t,style:n})))}]},re=oe,{name:le}=ne,ae={icon:"heading",example:{attributes:{content:(0,r.__)("Code is Poetry"),level:2}},__experimentalLabel(e,{context:t}){const{content:n,level:o}=e,l=e?.metadata?.name;return"list-view"===t&&(l||n)?e?.metadata?.name||n:"accessibility"===t?n&&0!==n.length?(0,r.sprintf)(/* translators: accessibility text. 1: heading level. 2: heading content. */ /* translators: accessibility text. 1: heading level. 2: heading content. */ +(0,r.__)("Filter %s","newsletter-optin-box"),c)))),(0,l.createElement)(e,{...t}))}),"withSelectCollection")(e.edit),{settings:e,...t}),U=["core/html","noptin/missing","noptin/shortcode"],W=[...U,"noptin/social-link","noptin/spacer","noptin/social-links","noptin/separator","core/image","noptin/button"];function G(e){if(!e)return;if(U.includes(e.name)){const t=F(e);return(0,o.registerBlockType)({name:t.name,...t.metadata},t.settings)}if(e.metadata.attributes=e.metadata.attributes||{},W.includes(e.name)||e.metadata.attributes?.anchor||(e.metadata.attributes.anchor={type:"string"}),e.metadata?.noptin&&!e.metadata.attributes?.style&&(e.metadata.attributes=e.metadata.attributes||{},e.metadata.attributes.style={type:"object",default:{}}),e.settings?.icon?.icon){let t={src:e.settings.icon.icon,foreground:e.settings.icon.fill||void 0};e.settings.icon=t}const{metadata:t,settings:n,name:r}=F((({metadata:e,settings:t,...n})=>(e?.noptin?.color&&(t.edit=(0,E.createHigherOrderComponent)((t=>n=>{const[o,r]=(()=>{const[e,t]=(0,C.useEntityProp)("postType",(0,S.useSelect)((e=>e(B.store).getCurrentPostType()),[]),"meta"),n=e||{},o=n.campaign_data?.block_css||{};return[o,(e,r)=>{const l={...o,[e]:r};Object.keys(l).forEach((e=>{l[e]||delete l[e]})),t({...n,campaign_data:{...n.campaign_data||{},block_css:l}})}]})(),a=n.attributes?.anchor,i=!W.includes(n.name),c=(0,l.useMemo)((()=>{if(!i)return a;if(!a||I[a]&&I[a]!==n.clientId){const t=e.name.replace("/","-")+"-"+(1e5*Math.random()).toFixed(0);return I[t]=n.clientId,T[n.clientId]=t,t}return I[a]=n.clientId,T[n.clientId]=a,a}),[i,a,n.clientId,e.name]),u=c&&o[c]||"",p=(0,l.useMemo)((()=>i?V(n.attributes,c).css:""),[n.attributes,i,c]);return(0,l.useEffect)((()=>{if(!c||!i)return;const e=T[n.clientId];u!==p?(r(c,p),e&&e!==a&&n.setAttributes({anchor:e})):a&&e&&e!==a&&n.setAttributes({anchor:e})}),[c,u,p,i,r,n.clientId]),(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.InspectorControls,{group:"styles"},(0,l.createElement)(L,{panelId:n.clientId,attributes:n.attributes,setAttributes:n.setAttributes,settings:e.noptin.color})),(0,l.createElement)(t,{...n}))}),"withNoptinColors")(t.edit)),{metadata:e,settings:t,...n}))((({metadata:e,settings:t,...n})=>(e?.noptin?.align&&(t.edit=(0,E.createHigherOrderComponent)((e=>t=>{const[n,o]=u(t.attributes,t.setAttributes,"align","none");return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.BlockControls,{group:"block"},(0,l.createElement)(s.BlockAlignmentControl,{value:n,onChange:o,controls:$})),(0,l.createElement)(e,{...t}))}),"withNoptinAlignmentSupport")(t.edit)),{metadata:e,settings:t,...n}))((({metadata:e,settings:t,...n})=>{if(e?.noptin?.typography){const n=t.edit;t.edit=t=>{const o=c(e.noptin.typography,"textAlign"),[r,a]=u(t.attributes,t.setAttributes,"typography");return(0,l.createElement)(l.Fragment,null,o&&(0,l.createElement)(s.BlockControls,{group:"block"},(0,l.createElement)(s.AlignmentControl,{value:r.textAlign,onChange:e=>a({textAlign:e})})),(0,l.createElement)(s.InspectorControls,{group:"styles"},(0,l.createElement)(b,{panelId:t.clientId,attributes:t.attributes,setAttributes:t.setAttributes,settings:e.noptin.typography})),n(t))}}return{metadata:e,settings:t,...n}})((({metadata:e,settings:t,...n})=>{if(e?.noptin?.border){const n=t.edit;t.edit=t=>(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.InspectorControls,{group:"styles"},(0,l.createElement)(y,{panelId:t.clientId,attributes:t.attributes,setAttributes:t.setAttributes,settings:e.noptin.border})),n(t))}return{metadata:e,settings:t,...n}})(e)))));return(0,o.registerBlockType)({name:r,...t},n)}const q=e=>{const t={margin:{},padding:{}};return e?(Object.entries(e).forEach((([e,n])=>{e.startsWith("margin")?t.margin[e]=n:e.startsWith("padding")&&(t.padding[e]=n)})),t):t},Z=(e,t=!1)=>{const n=(0,s.__experimentalGetSpacingClassesAndStyles)(e),o=n?.style||{};return t?q(o):o};Z.save=(e,t=!1)=>{const n=(0,s.__experimentalGetSpacingClassesAndStyles)(e),o=n?.style||{};return t?q(o):o};const K=window.wp.keycodes;function Y(e){const{batch:t}=(0,S.useRegistry)(),{moveBlocksToPosition:n,replaceInnerBlocks:r,duplicateBlocks:a,insertBlock:i}=(0,S.useDispatch)(s.store),{getBlockRootClientId:c,getBlockIndex:u,getBlockOrder:p,getBlockName:d,getBlock:m,getNextBlockClientId:g,canInsertBlockType:h}=(0,S.useSelect)(s.store),b=(0,l.useRef)(e);return b.current=e,(0,E.useRefEffect)((e=>{function l(e){if(e.defaultPrevented)return;if(e.keyCode!==K.ENTER)return;const{content:l,clientId:s}=b.current;if(l.length)return;const _=c(s);if(!(0,o.hasBlockSupport)(d(_),"__experimentalOnEnter",!1))return;const f=p(_),y=f.indexOf(s);if(y===f.length-1){let t=_;for(;!h(d(s),c(t));)t=c(t);return void("string"==typeof t&&(e.preventDefault(),n([s],_,c(t),u(t)+1)))}const v=(0,o.getDefaultBlockName)();if(!h(v,c(_)))return;e.preventDefault();const x=m(_);t((()=>{a([_]);const e=u(_);r(_,x.innerBlocks.slice(0,y)),r(g(_),x.innerBlocks.slice(y+1)),i((0,o.createBlock)(v),e+1,c(_),!0)}))}return e.addEventListener("keydown",l),()=>{e.removeEventListener("keydown",l)}}),[])}const X={apiVersion:3,name:"core/paragraph",title:(0,r.__)("Paragraph"),category:"content",description:(0,r.__)("Start with the basic building block of all narrative."),keywords:["text"],attributes:{content:{type:"string",source:"html",selector:"p",default:"",role:"content"},placeholder:{type:"string"}},noptin:{typography:!0,border:!0,color:{background:!0,text:!0,link:!0}},supports:{anchor:!1,className:!0,splitting:!0,spacing:{__experimentalSkipSerialization:!0,margin:!0,padding:!0,__experimentalDefaultControls:{margin:!0,padding:!1}},__experimentalSelector:"p",__unstablePasteTextInline:!0}},Q={from:[{type:"raw",priority:20,selector:"p",schema:({phrasingContentSchema:e,isPaste:t})=>({p:{children:e,attributes:t?[]:["style","id"]}}),transform(e){const t=(0,o.getBlockAttributes)("core/paragraph",e.outerHTML),{textAlign:n}=e.style||{};return"left"!==n&&"center"!==n&&"right"!==n||(t.style={...t.style||{},noptin:{...t.style?.noptin||{},typography:{...t.style?.noptin?.typography||{},textAlign:n}}}),(0,o.createBlock)("core/paragraph",t)}}]},J=Q,{name:ee}=X,te={icon:"editor-paragraph",example:{attributes:{content:(0,r.__)("In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.")}},__experimentalLabel(e,{context:t}){const n=e?.metadata?.name;if("list-view"===t&&n)return n;if("accessibility"===t){if(n)return n;const{content:t}=e;return t&&0!==t.length?t:(0,r.__)("Empty")}},transforms:J,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:function({attributes:e,mergeBlocks:t,onReplace:n,onRemove:o,setAttributes:a,clientId:i}){const{content:c,placeholder:u}=e,p=(0,s.useBlockProps)({ref:Y({clientId:i,content:c}),style:{..._(e),...v(e),...Z(e),...V(e).style}});return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.RichText,{identifier:"content",tagName:"p",...p,value:c,onChange:e=>a({content:e}),onMerge:t,onReplace:n,onRemove:o,"aria-label":c?(0,r.__)("Block: Paragraph"):(0,r.__)("Empty block; start writing or type forward slash to choose a block"),"data-empty":!c,placeholder:u||(0,r.__)("Start writing or type / to choose a block","newsletter-optin-box"),"data-custom-placeholder":!!u||void 0,__unstableAllowPrefixTransformations:!0}))},save:function({attributes:e}){const{content:t}=e,n=s.useBlockProps.save({style:{..._(e),...v(e),...Z.save(e),...V(e).style}});return(0,l.createElement)("p",{...n},(0,l.createElement)(s.RichText.Content,{value:t}))}},ne={apiVersion:3,name:"core/heading",title:(0,r.__)("Heading"),category:"content",description:(0,r.__)("Introduce new sections and organize content to help readers understand the structure of your content."),keywords:["title","subtitle"],attributes:{content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",role:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},noptin:{typography:!0,border:!0,color:{background:!0,text:!0,link:!0}},supports:{anchor:!1,className:!0,splitting:!0,spacing:{__experimentalSkipSerialization:!0,margin:!0,padding:!0,__experimentalDefaultControls:{margin:!0,padding:!1}},__unstablePasteTextInline:!0,__experimentalSlashInserter:!0}},oe={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((({content:e,className:t,style:n})=>(0,o.createBlock)("core/heading",{content:e,className:t,style:n})))},{type:"raw",selector:"h1,h2,h3,h4,h5,h6",schema:({phrasingContentSchema:e,isPaste:t})=>{const n={children:e,attributes:t?[]:["style","id"]};return{h1:n,h2:n,h3:n,h4:n,h5:n,h6:n}},transform(e){const t=(0,o.getBlockAttributes)("core/heading",e.outerHTML),{textAlign:n}=e.style||{};var r;return t.level=(r=e.nodeName,Number(r.substr(1))),"left"!==n&&"center"!==n&&"right"!==n||(t.style={...t.style||{},noptin:{...t.style?.noptin||{},typography:{...t.style?.noptin?.typography||{},textAlign:n}}}),(0,o.createBlock)("core/heading",t)}},...[1,2,3,4,5,6].map((e=>({type:"prefix",prefix:Array(e+1).join("#"),transform:t=>(0,o.createBlock)("core/heading",{level:e,content:t})}))),...[1,2,3,4,5,6].map((e=>({type:"enter",regExp:new RegExp(`^/(h|H)${e}$`),transform:()=>(0,o.createBlock)("core/heading",{level:e})})))],to:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((({content:e,className:t,style:n})=>(0,o.createBlock)("core/paragraph",{content:e,className:t,style:n})))}]},re=oe,{name:le}=ne,ae={icon:"heading",example:{attributes:{content:(0,r.__)("Code is Poetry"),level:2}},__experimentalLabel(e,{context:t}){const{content:n,level:o}=e,l=e?.metadata?.name;return"list-view"===t&&(l||n)?e?.metadata?.name||n:"accessibility"===t?n&&0!==n.length?(0,r.sprintf)(/* translators: accessibility text. 1: heading level. 2: heading content. */ /* translators: accessibility text. 1: heading level. 2: heading content. */ (0,r.__)("Level %1$s. %2$s"),o,n):(0,r.sprintf)(/* translators: accessibility text. %s: heading level. */ /* translators: accessibility text. %s: heading level. */ (0,r.__)("Level %s. Empty."),o):void 0},transforms:re,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:function({attributes:e,setAttributes:t,mergeBlocks:n,onReplace:o}){const{placeholder:a,content:i,level:c}=e,u=(0,s.useBlockProps)({style:{..._(e),...v(e),...Z(e),...V(e).style}});return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.BlockControls,{group:"block"},(0,l.createElement)(s.HeadingLevelDropdown,{value:c,onChange:e=>t({level:e})})),(0,l.createElement)(s.RichText,{identifier:"content",tagName:"h"+c,value:i,onChange:e=>{t({content:e})},onMerge:n,onReplace:o,onRemove:()=>o([]),placeholder:a||(0,r.__)("Heading"),...u}))},save:function({attributes:e}){const{content:t,level:n}=e,o="h"+n,r=s.useBlockProps.save({style:{..._(e),...v(e),...Z.save(e),...V(e).style}});return(0,l.createElement)(o,{...r},(0,l.createElement)(s.RichText.Content,{value:t}))}},ie=window.wp.primitives;var se=n(848);const ce=(0,se.jsx)(ie.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,se.jsx)(ie.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})}),ue=window.wp.blob,pe=window.wp.notices,de=window.wp.url,me=(0,se.jsx)(ie.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,se.jsx)(ie.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6 5.5h12a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5ZM4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6Zm4 10h2v-1.5H8V16Zm5 0h-2v-1.5h2V16Zm1 0h2v-1.5h-2V16Z"})}),ge=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,se.jsx)(ie.Path,{d:"M18 20v-2h2v-1.5H7.75a.25.25 0 0 1-.25-.25V4H6v2H4v1.5h2v8.75c0 .966.784 1.75 1.75 1.75h8.75v2H18ZM9.273 7.5h6.977a.25.25 0 0 1 .25.25v6.977H18V7.75A1.75 1.75 0 0 0 16.25 6H9.273v1.5Z"})}),he=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,se.jsx)(ie.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})}),be="none",_e="media",fe="attachment",ye="custom",ve=["image"],xe=({href:e,children:t})=>e?(0,l.createElement)("a",{href:e,onClick:e=>e.preventDefault(),"aria-disabled":!0,style:{pointerEvents:"none",cursor:"default",display:"block",textDecoration:"none",maxWidth:"100%",lineHeight:0}},t):t;function ke({temporaryURL:e,attributes:t,setAttributes:n,isSelected:a,insertBlocksAfter:c,onSelectImage:u,onSelectURL:p,onUploadError:d,containerRef:m,clientId:g,blockEditingMode:h}){const{url:b="",alt:_,caption:f,id:y,href:v,rel:x,linkClass:k,linkDestination:w,width:B,height:I,scale:T,sizeSlug:M}=t,z=R(t),A=B?parseInt(B,10):void 0,N=I?parseInt(I,10):void 0,P=(0,l.useRef)(),H=(0,E.usePrevious)(f),[L,V]=(0,l.useState)(!!f),{image:$,multiImageSelection:D}=(0,S.useSelect)((e=>{const{getMedia:t}=e(C.store),{getMultiSelectedBlockClientIds:n,getBlockName:o}=e(s.store),r=n();return{image:y&&a?t(y,{context:"view"}):null,multiImageSelection:r.length&&r.every((e=>"core/image"===o(e)))}}),[y,a]),{imageEditing:O,imageSizes:j,mediaUpload:F}=(0,S.useSelect)((e=>{const{getSettings:t}=e(s.store),n=t();return{imageEditing:n.imageEditing,imageSizes:n.imageSizes,mediaUpload:n.mediaUpload}}),[g]),{createErrorNotice:U,createSuccessNotice:W}=(0,S.useDispatch)(pe.store),[{loadedNaturalWidth:G,loadedNaturalHeight:q},Z]=(0,l.useState)({loadedNaturalWidth:void 0,loadedNaturalHeight:void 0}),[K,Y]=(0,l.useState)(!1),[X,Q]=(0,l.useState)(),J=function(e,t){const[n,o]=(0,l.useState)();function r(){o(e.current?.clientWidth)}return(0,l.useEffect)(r,t),(0,l.useEffect)((()=>{const{defaultView:t}=e.current.ownerDocument;return t.addEventListener("resize",r),()=>{t.removeEventListener("resize",r)}}),[]),n}(m,[z]),ee="default"===h,te=j.filter((({slug:e})=>$?.media_details?.sizes?.[e]?.source_url)).map((({name:e,slug:t})=>({value:t,label:e}))),ne=!!F;(0,l.useEffect)((()=>{we(y,b)&&a&&ne?X||window.fetch(b.includes("?")?b:b+"?").then((e=>e.blob())).then((e=>Q(e))).catch((()=>{})):Q(void 0)}),[y,b,a,X,ne]),(0,l.useEffect)((()=>{f&&!H&&V(!0)}),[f,H]);const oe=(0,l.useCallback)((e=>{e&&!f&&e.focus()}),[f]),{naturalWidth:re,naturalHeight:le}=(0,l.useMemo)((()=>({naturalWidth:P.current?.naturalWidth||G||void 0,naturalHeight:P.current?.naturalHeight||q||void 0})),[G,q,P.current?.complete]);(0,l.useEffect)((()=>{a||(Y(!1),f||V(!1))}),[a,f]);const ae=y&&re&&le&&O,ie=!D&&ae&&!K,se=()=>{n({width:void 0,height:void 0,scale:void 0})},ce=(0,i.__experimentalUseCustomUnits)({availableUnits:["px"]}),be=(0,l.createElement)(l.Fragment,null,(0,l.createElement)(i.__experimentalToolsPanelItem,{label:(0,r.__)("Width"),isShownByDefault:!0,hasValue:()=>!!B,onDeselect:()=>n({width:void 0}),panelId:g,style:{gridColumn:"span 1"}},(0,l.createElement)(s.__experimentalUnitControl,{label:(0,r.__)("Width"),placeholder:(0,r.__)("Auto"),labelPosition:"top",min:0,value:B||"",onChange:e=>n({width:e?`${e}`:void 0}),size:"__unstable-large"})),(0,l.createElement)(i.__experimentalToolsPanelItem,{label:(0,r.__)("Height"),isShownByDefault:!0,hasValue:()=>!!I,onDeselect:()=>n({height:void 0}),panelId:g,style:{gridColumn:"span 1"}},(0,l.createElement)(s.__experimentalUnitControl,{label:(0,r.__)("Height"),placeholder:(0,r.__)("Auto"),labelPosition:"top",units:ce,min:0,value:I||"",onChange:e=>n({height:e}),size:"__unstable-large"}))),_e=(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.BlockControls,{group:"block"},ee&&(0,l.createElement)(i.ToolbarButton,{onClick:()=>{V(!L),L&&f&&n({caption:void 0})},icon:me,isPressed:L,label:L?(0,r.__)("Remove caption"):(0,r.__)("Add caption")}),!D&&!K&&(0,l.createElement)(s.__experimentalImageURLInputUI,{url:v||"",onChangeUrl:n,linkDestination:w,mediaUrl:$&&$.source_url||b,mediaLink:$&&$.link,linkClass:k,rel:x}),ie&&(0,l.createElement)(i.ToolbarButton,{onClick:()=>Y(!0),icon:ge,label:(0,r.__)("Crop")})),!D&&!K&&(0,l.createElement)(s.BlockControls,{group:"other"},(0,l.createElement)(s.MediaReplaceFlow,{mediaId:y,mediaURL:b,allowedTypes:ve,accept:"image/*",onSelect:u,onSelectURL:p,onError:d})),!D&&X&&(0,l.createElement)(s.BlockControls,null,(0,l.createElement)(i.ToolbarGroup,null,(0,l.createElement)(i.ToolbarButton,{onClick:function(){F({filesList:[X],onFileChange([e]){u(e),(0,ue.isBlobURL)(e.url)||(Q(void 0),W((0,r.__)("Image uploaded."),{type:"snackbar"}))},allowedTypes:ve,onError(e){U(e,{type:"snackbar"})}})},icon:he,label:(0,r.__)("Upload external image")}))),(0,l.createElement)(s.InspectorControls,null,(0,l.createElement)(i.__experimentalToolsPanel,{label:(0,r.__)("Settings"),panelId:g,resetAll:se},!D&&(0,l.createElement)(i.__experimentalToolsPanelItem,{label:(0,r.__)("Alternative text"),isShownByDefault:!0,hasValue:()=>""!==_,panelId:g,onDeselect:()=>n({alt:void 0})},(0,l.createElement)(i.TextareaControl,{label:(0,r.__)("Alternative text"),value:_,onChange:e=>n({alt:e}),help:(0,l.createElement)(l.Fragment,null,(0,l.createElement)(i.ExternalLink,{href:"https://www.w3.org/WAI/tutorials/images/decision-tree"},(0,r.__)("Describe the purpose of the image.")),(0,l.createElement)("br",null),(0,r.__)("Leave empty if decorative.")),__nextHasNoMarginBottom:!0})),ee&&(0,l.createElement)(l.Fragment,null,te.length>0?(0,l.createElement)(i.__experimentalToolsPanelItem,{label:(0,r.__)("Image size"),isShownByDefault:!0,hasValue:()=>"large"!==M,panelId:g,onDeselect:()=>n({sizeSlug:"large"})},(0,l.createElement)(i.SelectControl,{label:(0,r.__)("Image size"),value:M,options:te,onChange:function(e){const t=$?.media_details?.sizes?.[e]?.source_url;if(!t)return null;n({url:t,sizeSlug:e,height:void 0})},className:"noptin-field-control",__nextHasNoMarginBottom:!0})):null,be)))),fe=(0,de.getFilename)(b);let ye;ye=_||(fe?(0,r.sprintf)(/* translators: %s: file name */ /* translators: %s: file name */ (0,r.__)("This image has an empty alt attribute; its file name is %s"),fe):(0,r.__)("This image has an empty alt attribute"));const ke=P.current?.width||J,Ee=ae&&K,Ce=(0,l.createElement)(xe,{href:v},Ee?(0,l.createElement)(s.__experimentalImageEditor,{id:y,url:b,width:A,height:N,clientWidth:ke,naturalHeight:le,naturalWidth:re,onSaveImage:e=>n(e),onFinishEditing:()=>{Y(!1)}}):(0,l.createElement)(l.Fragment,null,(0,l.createElement)("img",{src:e||b,alt:ye,onLoad:e=>{Z({loadedNaturalWidth:e.target?.naturalWidth,loadedNaturalHeight:e.target?.naturalHeight})},ref:P,style:{width:!B&&I?"auto":B,height:I,objectFit:T,maxWidth:"100%"}}),e&&(0,l.createElement)(i.Spinner,null)));return b||e?(0,l.createElement)(l.Fragment,null,!e&&_e,Ce,L&&(!s.RichText.isEmpty(f)||a)&&(0,l.createElement)(s.RichText,{identifier:"caption",ref:oe,className:"wp-block-image__caption",tagName:"div","aria-label":(0,r.__)("Image caption text"),placeholder:(0,r.__)("Add caption"),value:f,onChange:e=>n({caption:e}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>c((0,o.createBlock)((0,o.getDefaultBlockName)())),style:{fontSize:"12px",textAlign:z,marginTop:"12px"}})):(0,l.createElement)(s.InspectorControls,null,(0,l.createElement)(i.__experimentalToolsPanel,{label:(0,r.__)("Settings"),panelId:g,resetAll:se},ee&&be))}const we=(e,t)=>t&&!e&&!(0,ue.isBlobURL)(t);function Ee(e,t){var n,o;return"url"in(null!==(n=e?.sizes?.[t])&&void 0!==n?n:{})||"source_url"in(null!==(o=e?.media_details?.sizes?.[t])&&void 0!==o?o:{})}const Ce={apiVersion:3,name:"core/image",title:(0,r.__)("Image"),category:"content",description:(0,r.__)("Insert an image to make a visual statement."),keywords:["img","picture","media","photo"],attributes:{blob:{type:"string",role:"local"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",role:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",role:"content"},caption:{type:"string",source:"html",selector:".wp-block-image__caption",role:"content"},href:{type:"string",source:"attribute",selector:"a",attribute:"href",role:"content"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"a",attribute:"class"},id:{type:"number",role:"content"},width:{type:"string"},height:{type:"string"},scale:{type:"string"},sizeSlug:{type:"string",default:"large"},linkDestination:{type:"string"},link:{type:"string"}},supports:{anchor:!1,spacing:{__experimentalSkipSerialization:!0,margin:!0,padding:!0,__experimentalDefaultControls:{margin:!0}}},noptin:{border:!0,align:!0},selectors:{border:".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder"}};function Se(e,t){const{body:n}=document.implementation.createHTMLDocument("");n.innerHTML=e;const{firstElementChild:o}=n;if(o&&"A"===o.nodeName)return o.getAttribute(t)||void 0}const Be={img:{attributes:["src","alt"],classes:["alignleft","aligncenter","alignright","alignnone",/^wp-image-\d+$/]}},Ie={from:[{type:"raw",isMatch:e=>"FIGURE"===e.nodeName&&!!e.querySelector("img"),schema:({phrasingContentSchema:e})=>({figure:{require:["img"],children:{...Be,a:{attributes:["href","rel"],children:Be},figcaption:{children:e}}}}),transform:e=>{const t=e.className+" "+e.querySelector("img").className,n=/(?:^|\s)align(left|center|right)(?:$|\s)/.exec(t),r=""===e.id?void 0:e.id,l=n?n[1]:void 0,a=/(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(t),i=a?Number(a[1]):void 0,s=e.querySelector("a"),c=s&&s.href?"custom":void 0,u=s&&s.href?s.href:void 0,p=s&&s.rel?s.rel:void 0,d=s&&s.className?s.className:void 0,m=(0,o.getBlockAttributes)("core/image",e.outerHTML,{id:i,linkDestination:c,href:u,rel:p,linkClass:d,anchor:r,style:{noptin:{align:l}}});return(0,o.createBlock)("core/image",m)}},{type:"shortcode",tag:"caption",attributes:{url:{type:"string",source:"attribute",attribute:"src",selector:"img"},alt:{type:"string",source:"attribute",attribute:"alt",selector:"img"},caption:{shortcode:function(e,{shortcode:t}){const{body:n}=document.implementation.createHTMLDocument("");n.innerHTML=t.content;let o=n.querySelector("img");for(;o&&o.parentNode&&o.parentNode!==n;)o=o.parentNode;return o&&o.parentNode.removeChild(o),n.innerHTML.trim()}},href:{shortcode:(e,{shortcode:t})=>Se(t.content,"href")},rel:{shortcode:(e,{shortcode:t})=>Se(t.content,"rel")},linkClass:{shortcode:(e,{shortcode:t})=>Se(t.content,"class")},id:{type:"number",shortcode:({named:{id:e}})=>{if(e)return parseInt(e.replace("attachment_",""),10)}}}}]},Te=Ie;window?.wp?.media?.view?.settings?.defaultProps&&Object.entries(window.wp.media.view.settings.defaultProps).forEach((([e,t])=>{Ce.attributes[e]&&(Ce.attributes[e].default=t)}));const{name:Me}=Ce,ze={icon:ce,example:{attributes:{sizeSlug:"large",url:"https://s.w.org/images/core/5.3/MtBlanc1.jpg",caption:"Mont Blanc appears—still, snowy, and serene."}},__experimentalLabel(e,{context:t}){if("accessibility"===t){const{caption:t,alt:n,url:o}=e;return o?n?n+(t?". "+t:""):t||"":(0,r.__)("Empty")}},transforms:Te,edit:function({attributes:e,setAttributes:t,isSelected:n,className:o,insertBlocksAfter:a,onReplace:c,context:u,clientId:p}){const{url:d="",alt:m,caption:g,id:h,width:b,height:_,sizeSlug:f}=e,[y,x]=(0,l.useState)(e.blob);(0,l.useEffect)((()=>{b&&/^\d+$/.test(b)&&t({width:`${b}px`})}),[b]);const w=R(e),E=(0,l.useRef)();(0,l.useEffect)((()=>{E.current=m}),[m]);const C=(0,l.useRef)();(0,l.useEffect)((()=>{C.current=g}),[g]);const B=(0,l.useRef)(),I=(0,s.useBlockEditingMode)(),{createErrorNotice:T}=(0,S.useDispatch)(pe.store);function M(e){T(e,{type:"snackbar"}),t({src:void 0,id:void 0,url:void 0,blob:void 0})}function z(n){if(!n||!n.url)return t({url:void 0,alt:void 0,id:void 0,title:void 0,caption:void 0,blob:void 0}),void x(void 0);if((0,ue.isBlobURL)(n.url))return void x(n.url);let o="full";f&&Ee(n,f)?o=f:Ee(n,"large")&&(o="large");let r,l=((e,t)=>{const n=Object.fromEntries(Object.entries(null!=e?e:{}).filter((([e])=>["alt","id","link","caption","width","url"].includes(e)))),o=["width","url"];return e?.sizes?.[t]?o.forEach((o=>{e.sizes[t][o]&&(n[o]=e.sizes[t][o])})):e?.media_details?.sizes?.[t]&&o.forEach((o=>{e.media_details.sizes[t][o]?n[o]=e.media_details.sizes[t][o]:e.media_details.sizes[t][`source_${o}`]&&(n[o]=e.media_details.sizes[t][`source_${o}`])})),n.width&&(n.width=`${n.width}`),n.height=void 0,n})(n,o);if(C.current&&!l.caption){const{caption:e,...t}=l;l=t}r=n.id&&n.id===h?{url:d}:{sizeSlug:o};let a,i=e.linkDestination;if(!i)switch(window?.wp?.media?.view?.settings?.defaultProps?.link||be){case"file":case _e:i=_e;break;case"post":case fe:i=fe;break;case ye:i=ye;break;case be:i=be}switch(i){case _e:a=n.url;break;case fe:a=n.link}l.href=a,t({blob:void 0,...l,...r,width:void 0,linkDestination:i}),x(void 0)}function A(e){e!==d&&(t({blob:void 0,url:e,id:void 0,sizeSlug:"large"}),x(void 0))}!function(e={}){const t=(0,l.useRef)(e),n=(0,l.useRef)(!1),{getSettings:o}=(0,S.useSelect)(s.store,[]);(0,l.useLayoutEffect)((()=>{t.current=e})),(0,l.useEffect)((()=>{if(n.current)return;if(!t.current.url||!(0,ue.isBlobURL)(t.current.url))return;const e=(0,ue.getBlobByURL)(t.current.url);if(!e)return;const{url:r,allowedTypes:l,onChange:a,onError:i}=t.current,{mediaUpload:s}=o();n.current=!0,s({filesList:[e],allowedTypes:l,onFileChange:([e])=>{(0,ue.isBlobURL)(e?.url)||((0,ue.revokeBlobURL)(r),a(e),n.current=!1)},onError:e=>{(0,ue.revokeBlobURL)(r),i(e),n.current=!1}})}),[o])}({url:y,allowedTypes:ve,onChange:z,onError:M});const N=we(h,d)?d:void 0,P=!!d&&(0,l.createElement)("img",{alt:(0,r.__)("Edit image"),title:(0,r.__)("Edit image"),className:"edit-image-preview",src:d}),H={className:k(o,"noptin-image-block__wrapper",{"is-transient":!!y,"is-resized":!!b||!!_,[`size-${f}`]:f}),border:0,cellPadding:"0",cellSpacing:"0",role:"presentation"};"left"!==w&&"right"!==w||(H.align=w,H.className+=" noptin-image-block__wrapper-is-aligned");const L=(0,s.useBlockProps)({ref:B,...H}),V={...v(e),...Z(e),display:e.width?"inline-block":"block",maxWidth:"100%"};return(0,l.createElement)("table",{...L},(0,l.createElement)("tbody",null,(0,l.createElement)("tr",null,(0,l.createElement)("td",{align:w},(0,l.createElement)("div",{className:k("noptin-block__margin-wrapper",{"is-selected":n}),style:V},(0,l.createElement)(ke,{temporaryURL:y,attributes:e,setAttributes:t,isSelected:n,insertBlocksAfter:a,onReplace:c,onSelectImage:z,onSelectURL:A,onUploadError:M,containerRef:B,context:u,clientId:p,blockEditingMode:I}),(0,l.createElement)(s.MediaPlaceholder,{icon:(0,l.createElement)(s.BlockIcon,{icon:ce}),onSelect:z,onSelectURL:A,onError:M,placeholder:e=>(0,l.createElement)(i.Placeholder,{className:"block-editor-media-placeholder",withIllustration:!n,icon:ce,label:(0,r.__)("Image"),instructions:(0,r.__)("Upload an image file, pick one from your media library, or add one with a URL."),style:{width:b,height:_}},e),accept:"image/*",allowedTypes:["image"],handleUpload:e=>1===e.length,value:{id:h,src:N},mediaPreview:P,disableMediaButtons:y||d}))))))},save:function({attributes:e}){const{url:t,alt:n,caption:o,href:r,rel:a,linkClass:i,width:c,height:u}=e,p=R(e),d=(0,l.createElement)("img",{src:t,alt:n,width:c&&c.endsWith("px")?c.slice(0,-2):void 0,border:"0",style:{width:!c&&u?"auto":c,height:u,maxWidth:"100%"}}),m={...v(e),...Z.save(e),display:"inline-block",maxWidth:"100%"},g=(0,l.createElement)("div",{className:"noptin-block__margin-wrapper",style:m},r?(0,l.createElement)("a",{className:i,href:r,rel:a||void 0,style:{display:"block",textDecoration:"none",maxWidth:"100%",lineHeight:0}},d):d,!s.RichText.isEmpty(o)&&(0,l.createElement)(s.RichText.Content,{className:"wp-block-image__caption",tagName:"div",value:o,style:{fontSize:"12px",textAlign:"center",marginTop:"12px"}})),h={className:"noptin-image-block__wrapper",border:0,cellPadding:"0",cellSpacing:"0",role:"presentation"};return"left"!==p&&"right"!==p||(h.align=p,h.className+=" noptin-image-block__wrapper-is-aligned"),(0,l.createElement)("table",{...s.useBlockProps.save(h)},(0,l.createElement)("tbody",null,(0,l.createElement)("tr",null,(0,l.createElement)("td",{align:p},g))))}};function Ae(e){return e.replace(/<\/?a[^>]*>/g,"")}const Ne=(e,t="")=>{const[n]=u(e,null,"color"),o={style:{},vmlOpen:"",vmlClose:""};if(!e.style?.background?.backgroundImage?.url)return o;o.style.backgroundImage=`url("${e.style.background.backgroundImage.url}")`,o.style.backgroundSize=e.style.background.backgroundSize||"contain",o.style.backgroundPosition=e.style.background.backgroundPosition||"center center",o.style.backgroundRepeat=e.style.background.backgroundRepeat||"no-repeat";const r=n?.background||"#ffffff";return o.vmlOpen=`\n\t\t\x3c!--[if gte mso 9]>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\n\t\t\t\t\n\t\t\t\n\t\tt({url:e}),__nextHasNoMarginBottom:!0}),(0,l.createElement)(i.__experimentalToggleGroupControl,{label:(0,r.__)("Button width"),className:"noptin-toggle-group-control",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,isAdaptiveWidth:!0,isBlock:!0,isDeselectable:!0,onChange:function(n){const o=e.width===n?void 0:n;t({width:o})}},[25,50,75,100].map((e=>(0,l.createElement)(i.__experimentalToggleGroupControlOption,{key:e,label:`${e}%`,value:e})))))}const He={apiVersion:3,name:"noptin/button",title:(0,r.__)("Button"),category:"content",description:(0,r.__)("Prompt readers to take action with a button-style link.","newsletter-optin-box"),keywords:["link","cta"],attributes:{url:{type:"string",source:"attribute",selector:"a",attribute:"href",role:"content"},title:{type:"string",source:"attribute",selector:"a",attribute:"title",role:"content"},text:{type:"string",source:"html",selector:"a",role:"content"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel",role:"content",default:"noopener noreferrer"},placeholder:{type:"string"},style:{type:"object",default:{noptin:{border:{radius:"5px"},typography:{textTransform:"none",textDecoration:"none",textAlign:"center"}}}},width:{type:"number"}},noptin:{typography:!0,border:!0,color:{background:!0,text:!0},align:!0},supports:{anchor:!1,reusable:!1,shadow:!1,splitting:!0,background:{__experimentalSkipSerialization:!0,backgroundImage:!0,backgroundSize:!0,backgroundRepeat:!0,__experimentalDefaultControls:{backgroundImage:!0,backgroundSize:!0,backgroundRepeat:!0}},spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],margin:!0,__experimentalDefaultControls:{padding:!0,margin:!0}}}},Le=window.wp.element,{name:Ve}=He,$e={icon:"button",example:{attributes:{text:(0,r.__)("Call to Action")}},edit:function(e){const{attributes:t,setAttributes:n,isSelected:a,onReplace:c,mergeBlocks:u,clientId:p}=e,{placeholder:d,rel:m,text:g,width:h}=t,b=R(t),f=_(t),[y,x]=(0,l.useState)(null),k=Ne(t),w=v(t),C=V(t).style,B=Z(t,!0),I=(0,l.useRef)(),T=(0,l.useRef)(),M=(0,s.useBlockProps)({ref:(0,E.useMergeRefs)([x,I]),width:"100%",border:0,cellPadding:0,cellSpacing:0,role:"presentation",className:"noptin-button-block__wrapper"}),[z,A]=(0,l.useState)(!0);(0,l.useEffect)((()=>{a&&A(!0)}),[a]);const N=function(e){const{replaceBlocks:t,selectionChange:n}=(0,S.useDispatch)(s.store),{getBlock:r,getBlockRootClientId:a,getBlockIndex:i}=(0,S.useSelect)(s.store),c=(0,l.useRef)(e);return c.current=e,(0,E.useRefEffect)((e=>{function l(e){if(e.defaultPrevented||e.keyCode!==K.ENTER)return;const{content:l,clientId:s}=c.current;if(l.length)return;e.preventDefault();const u=r(a(s)),p=i(s),d=(0,o.cloneBlock)({...u,innerBlocks:u.innerBlocks.slice(0,p)}),m=(0,o.createBlock)((0,o.getDefaultBlockName)()),g=u.innerBlocks.slice(p+1),h=g.length?[(0,o.cloneBlock)({...u,innerBlocks:g})]:[];t(u.clientId,[d,m,...h],1),n(m.clientId)}return e.addEventListener("keydown",l),()=>{e.removeEventListener("keydown",l)}}),[])}({content:g,clientId:p}),P=(0,E.useMergeRefs)([N,T]);return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("table",{...M},(0,l.createElement)("tbody",null,(0,l.createElement)("tr",null,(0,l.createElement)("td",{align:b},(0,l.createElement)("div",{className:"noptin-block__margin-wrapper",style:B.margin},(0,l.createElement)("table",{width:h?`${h}%`:void 0},(0,l.createElement)("tbody",null,(0,l.createElement)("tr",null,(0,l.createElement)("td",{bgcolor:C.backgroundColor,role:"presentation",valign:"middle",className:"noptin-button-link__wrapper",style:{backgroundColor:C.backgroundColor,...k.style,textAlign:f?.textAlign,cursor:"auto",...w}},(0,l.createElement)(s.RichText,{ref:P,tagName:"span","aria-label":(0,r.__)("Button text"),placeholder:d||(0,r.__)("Add text…"),value:g,onChange:e=>n({text:Ae(e)}),withoutInteractiveFormatting:!0,className:"noptin-button-link",style:{...B.padding,...f||{},color:C.color,margin:"0px",display:"block"},onReplace:c,onMerge:u,identifier:"text"})))))))))),a&&z&&(0,l.createElement)(i.Popover,{placement:"bottom",onClose:()=>{A(!1),T.current?.focus()},anchor:y,focusOnMount:!1,__unstableSlotName:"__unstable-block-tools-after",shift:!0},(0,l.createElement)(s.URLInput,{label:(0,r.__)("Button URL"),help:(0,r.__)("The URL to link to."),className:"block-editor-link-control__field noptin-link-control-popover__field",value:t.url||"",onChange:e=>n({url:e}),__nextHasNoMarginBottom:!0})),(0,l.createElement)(s.InspectorControls,null,(0,l.createElement)(Pe,{attributes:t,setAttributes:n})),(0,l.createElement)(s.InspectorControls,{group:"advanced"},(0,l.createElement)(i.TextControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Link rel"),value:m||"",onChange:e=>n({rel:e})})))},save:function({attributes:e}){const{rel:t,text:n,title:o,url:r,width:a}=e,i=R(e),c=v(e),u=V(e),p=Ne(e,a),d=u?.style?.backgroundColor,m=u?.style?.color,g=Z.save(e,!0),h={...g.padding,..._(e),borderRadius:c?.borderRadius,margin:"0px",display:"block",color:m,wordBreak:"break-word"},b=s.useBlockProps.save({width:"100%",border:0,cellPadding:0,cellSpacing:0,role:"presentation",className:"noptin-button-block__wrapper"});if(!n)return null;const f={...p.style};return f.backgroundImage?f.backgroundColor=d:f.background=d,(0,l.createElement)("table",{...b},(0,l.createElement)("tbody",null,(0,l.createElement)("tr",null,(0,l.createElement)("td",{align:i},(0,l.createElement)("div",{className:"noptin-block__margin-wrapper",style:g.margin},p.vmlOpen&&(0,l.createElement)(Le.RawHTML,{children:p.vmlOpen}),(0,l.createElement)("table",{width:a?`${a}%`:void 0},(0,l.createElement)("tbody",null,(0,l.createElement)("tr",null,(0,l.createElement)("td",{bgcolor:d,role:"presentation",valign:"middle",className:"noptin-button-link__wrapper",style:{...f,textAlign:h.textAlign,cursor:"auto",...c}},(0,l.createElement)(s.RichText.Content,{tagName:"a",className:"noptin-button-link",href:r,title:o,style:h,value:n,rel:t}))))),p.vmlClose&&(0,l.createElement)(Le.RawHTML,{children:p.vmlClose}))))))},merge:(e,{text:t=""})=>({...e,text:(e.text||"")+t})},Re=["noptin/social-link"],De=[{name:"facebook",color:"#3b5998",title:"Facebook"},{name:"twitter",color:"#55acee",title:"Twitter"},{name:"youtube",color:"#eb3323",title:"YouTube"}],Oe=De.map((({name:e,title:t,color:n})=>["noptin/social-link",{img:`https://www.mailjet.com/images/theme/v1/icons/ico-social/${e}.png`,url:"#",label:t,style:{noptin:{border:{radius:"50%"},color:{background:n}}}}])),je={iconSize:{label:(0,r.__)("Icon size"),options:{"20px":(0,r.__)("S"),"32px":(0,r.__)("M"),"48px":(0,r.__)("L"),"64px":(0,r.__)("XL")}},iconSpacing:{label:(0,r.__)("Icon spacing"),options:{"0px":(0,r.__)("None"),"4px":(0,r.__)("S"),"16px":(0,r.__)("M"),"24px":(0,r.__)("L")}},iconPadding:{label:(0,r.__)("Icon padding"),options:{"0px":(0,r.__)("None"),"4px":(0,r.__)("S"),"16px":(0,r.__)("M"),"24px":(0,r.__)("L")}}};function Fe({attributes:e,setAttributes:t}){return(0,l.createElement)(i.PanelBody,{title:(0,r.__)("Settings")},Object.entries(je).map((([n,o])=>(0,l.createElement)(i.__experimentalToggleGroupControl,{key:n,label:o.label,value:e[n],onChange:e=>t({[n]:e}),className:"noptin-field-control",__nextHasNoMarginBottom:!0,isAdaptiveWidth:!0,isBlock:!0,isDeselectable:!0},Object.entries(o.options).map((([e,t])=>(0,l.createElement)(i.__experimentalToggleGroupControlOption,{key:`${n}__${e}`,label:t,value:e})))))))}const Ue={apiVersion:3,name:"noptin/social-links",title:(0,r.__)("Social Icons"),category:"content",description:(0,r.__)("Display icons linking to your social media profiles or sites."),keywords:["links"],attributes:{iconSize:{type:"string",default:"20px"},iconSpacing:{type:"string",default:"4px"},iconPadding:{type:"string",default:"4px"}},providesContext:{"noptin/social-links/iconSize":"iconSize"},noptin:{border:!0,color:{background:!0},align:!0},supports:{anchor:!1,__experimentalExposeControlsToChildren:!0,spacing:{margin:!0,padding:!0,units:["px","em","rem"],__experimentalSkipSerialization:!0,__experimentalDefaultControls:{margin:!0,padding:!1}}}},{name:We}=Ue,Ge={example:{innerBlocks:De.map((({name:e,title:t,color:n})=>({name:"noptin/social-link",attributes:{img:`https://www.mailjet.com/images/theme/v1/icons/ico-social/${e}.png`,url:"#",label:t,style:{noptin:{border:{radius:"50%"},color:{background:n}}}}})))},icon:"share",edit:function({attributes:e,setAttributes:t}){const{iconSpacing:n,iconPadding:o}=e,r=R(e),a=Z(e,!0),i=v(e),c=(0,s.useBlockProps)({style:a.margin,className:"noptin-block__margin-wrapper"}),u=(0,s.useInnerBlocksProps)({},{allowedBlocks:Re,template:Oe,templateLock:!1,orientation:"horizontal",__experimentalAppenderTagName:"td"}),p={lineHeight:"100%",width:"100%",borderCollapse:"separate",...V(e).style,...i};return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.InspectorControls,null,(0,l.createElement)(Fe,{attributes:e,setAttributes:t})),(0,l.createElement)("div",{...c},(0,l.createElement)("table",{role:"presentation",cellPadding:0,cellSpacing:0,border:0,width:"100%",style:p},(0,l.createElement)("tbody",null,(0,l.createElement)("tr",null,(0,l.createElement)("td",{align:r,style:a.padding,border:"0",role:"presentation",valign:"middle"},(0,l.createElement)("table",{align:r,cellPadding:o||0,cellSpacing:n||0,style:{borderCollapse:"separate"}},(0,l.createElement)("tbody",null,(0,l.createElement)("tr",{...u})))))))))},save:({attributes:e})=>{const{iconSpacing:t,iconPadding:n}=e,o=R(e),r=Z.save(e,!0),a=v(e),i=s.useBlockProps.save({style:r.margin,className:"noptin-block__margin-wrapper"}),c={lineHeight:"100%",width:"100%",borderCollapse:"separate",...V(e).style,...a};return(0,l.createElement)("div",{...i},(0,l.createElement)("table",{role:"presentation",cellPadding:0,cellSpacing:0,border:0,width:"100%",style:c},(0,l.createElement)("tbody",null,(0,l.createElement)("tr",null,(0,l.createElement)("td",{align:o,style:r.padding,border:"0",role:"presentation",valign:"middle"},(0,l.createElement)("table",{align:o,cellPadding:n||0,cellSpacing:t||0,style:{borderCollapse:"separate"}},(0,l.createElement)("tbody",null,(0,l.createElement)("tr",null,(0,l.createElement)(s.InnerBlocks.Content,null)))))))))}},qe={apiVersion:3,name:"noptin/social-link",title:(0,r.__)("Social Icon"),category:"content",parent:["noptin/social-links"],description:(0,r.__)("Display an icon linking to a social media profile or site."),attributes:{iconSize:{type:"string",default:"20px"},url:{type:"string"},img:{type:"string"},label:{type:"string"},rel:{type:"string",default:"noopener noreferrer"}},usesContext:["noptin/social-links/iconSize"],noptin:{border:!0,color:{background:!0}},supports:{reusable:!1,anchor:!1,html:!1}},Ze=[{name:"facebook",color:"#3b5998",title:"Facebook"},{name:"twitter",color:"#55acee",title:"Twitter"},{name:"google-plus",color:"#dc4e41",title:"Google Plus",icon:"google"},{name:"pinterest",color:"#bd081c",title:"Pinterest"},{name:"linkedin",color:"#0077b5",title:"linkedIn"},{name:"instagram",color:"#3f729b",title:"Instagram"},{name:"youtube",color:"#eb3323",title:"YouTube"},{name:"tumblr",color:"#344356",title:"Tumblr",icon:()=>(0,l.createElement)(ie.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,l.createElement)(ie.Path,{d:"M17.04 21.28h-3.28c-2.84 0-4.94-1.37-4.94-5.02v-5.67H6.08V7.5c2.93-.73 4.11-3.3 4.3-5.48h3.01v4.93h3.47v3.65H13.4v4.93c0 1.47.73 2.01 1.92 2.01h1.73v3.75z"}))},{name:"github",color:"#000000",title:"GitHub",icon:()=>(0,l.createElement)(ie.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,l.createElement)(ie.Path,{d:"M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"}))},{name:"xing",color:"#296366",title:"Xing"},{name:"vimeo",color:"#53B4E7",title:"Vimeo",icon:()=>(0,l.createElement)(ie.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,l.createElement)(ie.Path,{d:"M22.396,7.164c-0.093,2.026-1.507,4.799-4.245,8.32C15.322,19.161,12.928,21,10.97,21c-1.214,0-2.24-1.119-3.079-3.359 c-0.56-2.053-1.119-4.106-1.68-6.159C5.588,9.243,4.921,8.122,4.206,8.122c-0.156,0-0.701,0.328-1.634,0.98L1.594,7.841 c1.027-0.902,2.04-1.805,3.037-2.708C6.001,3.95,7.03,3.327,7.715,3.264c1.619-0.156,2.616,0.951,2.99,3.321 c0.404,2.557,0.685,4.147,0.841,4.769c0.467,2.121,0.981,3.181,1.542,3.181c0.435,0,1.09-0.688,1.963-2.065 c0.871-1.376,1.338-2.422,1.401-3.142c0.125-1.187-0.343-1.782-1.401-1.782c-0.498,0-1.012,0.115-1.541,0.341 c1.023-3.35,2.977-4.977,5.862-4.884C21.511,3.066,22.52,4.453,22.396,7.164z"}))},{name:"medium",color:"#000000",title:"Medium",icon:()=>(0,l.createElement)(ie.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,l.createElement)(ie.Path,{d:"M20.962,7.257l-5.457,8.867l-3.923-6.375l3.126-5.08c0.112-0.182,0.319-0.286,0.527-0.286c0.05,0,0.1,0.008,0.149,0.02 c0.039,0.01,0.078,0.023,0.114,0.041l5.43,2.715l0.006,0.003c0.004,0.002,0.007,0.006,0.011,0.008 C20.971,7.191,20.98,7.227,20.962,7.257z M9.86,8.592v5.783l5.14,2.57L9.86,8.592z M15.772,17.331l4.231,2.115 C20.554,19.721,21,19.529,21,19.016V8.835L15.772,17.331z M8.968,7.178L3.665,4.527C3.569,4.479,3.478,4.456,3.395,4.456 C3.163,4.456,3,4.636,3,4.938v11.45c0,0.306,0.224,0.669,0.498,0.806l4.671,2.335c0.12,0.06,0.234,0.088,0.337,0.088 c0.29,0,0.494-0.225,0.494-0.602V7.231C9,7.208,8.988,7.188,8.968,7.178z"}))},{name:"soundcloud",color:"#EF7F31",title:"SoundCloud",icon:()=>(0,l.createElement)(ie.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,l.createElement)(ie.Path,{d:"M8.9,16.1L9,14L8.9,9.5c0-0.1,0-0.1-0.1-0.1c0,0-0.1-0.1-0.1-0.1c-0.1,0-0.1,0-0.1,0.1c0,0-0.1,0.1-0.1,0.1L8.3,14l0.1,2.1 c0,0.1,0,0.1,0.1,0.1c0,0,0.1,0.1,0.1,0.1C8.8,16.3,8.9,16.3,8.9,16.1z M11.4,15.9l0.1-1.8L11.4,9c0-0.1,0-0.2-0.1-0.2 c0,0-0.1,0-0.1,0s-0.1,0-0.1,0c-0.1,0-0.1,0.1-0.1,0.2l0,0.1l-0.1,5c0,0,0,0.7,0.1,2v0c0,0.1,0,0.1,0.1,0.1c0.1,0.1,0.1,0.1,0.2,0.1 c0.1,0,0.1,0,0.2-0.1c0.1,0,0.1-0.1,0.1-0.2L11.4,15.9z M2.4,12.9L2.5,14l-0.2,1.1c0,0.1,0,0.1-0.1,0.1c0,0-0.1,0-0.1-0.1L2.1,14 l0.1-1.1C2.2,12.9,2.3,12.9,2.4,12.9C2.3,12.9,2.4,12.9,2.4,12.9z M3.1,12.2L3.3,14l-0.2,1.8c0,0.1,0,0.1-0.1,0.1 c-0.1,0-0.1,0-0.1-0.1L2.8,14L3,12.2C3,12.2,3,12.2,3.1,12.2C3.1,12.2,3.1,12.2,3.1,12.2z M3.9,11.9L4.1,14l-0.2,2.1 c0,0.1,0,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L3.5,14l0.2-2.1c0-0.1,0-0.1,0.1-0.1C3.9,11.8,3.9,11.8,3.9,11.9z M4.7,11.9L4.9,14 l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c-0.1,0-0.1,0-0.1-0.1L4.3,14l0.2-2.2c0-0.1,0-0.1,0.1-0.1C4.7,11.7,4.7,11.8,4.7,11.9z M5.6,12 l0.2,2l-0.2,2.1c0,0.1-0.1,0.1-0.1,0.1c0,0-0.1,0-0.1,0c0,0,0-0.1,0-0.1L5.1,14l0.2-2c0,0,0-0.1,0-0.1s0.1,0,0.1,0 C5.5,11.9,5.5,11.9,5.6,12L5.6,12z M6.4,10.7L6.6,14l-0.2,2.1c0,0,0,0.1,0,0.1c0,0-0.1,0-0.1,0c-0.1,0-0.1-0.1-0.2-0.2L5.9,14 l0.2-3.3c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0C6.4,10.7,6.4,10.7,6.4,10.7z M7.2,10l0.2,4.1l-0.2,2.1c0,0,0,0.1,0,0.1 c0,0-0.1,0-0.1,0c-0.1,0-0.2-0.1-0.2-0.2l-0.1-2.1L6.8,10c0-0.1,0.1-0.2,0.2-0.2c0,0,0.1,0,0.1,0S7.2,9.9,7.2,10z M8,9.6L8.2,14 L8,16.1c0,0.1-0.1,0.2-0.2,0.2c-0.1,0-0.2-0.1-0.2-0.2L7.5,14l0.1-4.4c0-0.1,0-0.1,0.1-0.1c0,0,0.1-0.1,0.1-0.1c0.1,0,0.1,0,0.1,0.1 C8,9.6,8,9.6,8,9.6z M11.4,16.1L11.4,16.1L11.4,16.1z M9.7,9.6L9.8,14l-0.1,2.1c0,0.1,0,0.1-0.1,0.2s-0.1,0.1-0.2,0.1 c-0.1,0-0.1,0-0.1-0.1s-0.1-0.1-0.1-0.2L9.2,14l0.1-4.4c0-0.1,0-0.1,0.1-0.2s0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S9.7,9.5,9.7,9.6 L9.7,9.6z M10.6,9.8l0.1,4.3l-0.1,2c0,0.1,0,0.1-0.1,0.2c0,0-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c0,0-0.1-0.1-0.1-0.2L10,14 l0.1-4.3c0-0.1,0-0.1,0.1-0.2c0,0,0.1-0.1,0.2-0.1c0.1,0,0.1,0,0.2,0.1S10.6,9.7,10.6,9.8z M12.4,14l-0.1,2c0,0.1,0,0.1-0.1,0.2 c-0.1,0.1-0.1,0.1-0.2,0.1c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2l-0.1-1l-0.1-1l0.1-5.5v0c0-0.1,0-0.2,0.1-0.2 c0.1,0,0.1-0.1,0.2-0.1c0,0,0.1,0,0.1,0c0.1,0,0.1,0.1,0.1,0.2L12.4,14z M22.1,13.9c0,0.7-0.2,1.3-0.7,1.7c-0.5,0.5-1.1,0.7-1.7,0.7 h-6.8c-0.1,0-0.1,0-0.2-0.1c-0.1-0.1-0.1-0.1-0.1-0.2V8.2c0-0.1,0.1-0.2,0.2-0.3c0.5-0.2,1-0.3,1.6-0.3c1.1,0,2.1,0.4,2.9,1.1 c0.8,0.8,1.3,1.7,1.4,2.8c0.3-0.1,0.6-0.2,1-0.2c0.7,0,1.3,0.2,1.7,0.7C21.8,12.6,22.1,13.2,22.1,13.9L22.1,13.9z"}))},{name:"dribbble",color:"#D95988",title:"Dribbble",icon:()=>(0,l.createElement)(ie.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1"},(0,l.createElement)(ie.Path,{d:"M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z"}))}].map((({name:e,title:t,color:n,icon:o})=>{return{isDefault:"facebook"===e,name:e,title:t,attributes:(r=`https://www.mailjet.com/images/theme/v1/icons/ico-social/${e}.png`,l=t,a=n,{img:r,label:l,style:{noptin:{border:{radius:"50%"},color:{background:a}}}}),icon:o||e,isActive:(t,n)=>t.img&&t.img.includes(e)||t.label&&t.label.includes(e)||t.url&&t.url.includes(e)};var r,l,a})),{name:Ke}=qe,Ye={icon:"share",edit:({attributes:e,context:t,setAttributes:n,isSelected:o})=>{const{img:a,label:c,rel:u,iconSize:p}=e,[d,m]=(0,l.useState)(!0),[g,h]=(0,l.useState)(null),b=t["noptin/social-links/iconSize"];(0,l.useEffect)((()=>{p!==b&&n({iconSize:b})}),[b,p]),(0,l.useEffect)((()=>{o&&m(!0)}),[o]);const _=V(e),f=_?.style?.backgroundColor,y=(0,s.useBlockProps)({ref:h,style:{color:f,backgroundColor:f,boxSizing:"border-box",align:"center",borderCollapse:"separate",...v(e)}});return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.InspectorControls,null,(0,l.createElement)(i.PanelBody,{title:(0,r.__)("Settings"),initialOpen:!0},(0,l.createElement)(i.PanelRow,null,(0,l.createElement)(i.TextControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Image URL"),help:(0,r.__)("Enter the URL of the image to use as an icon."),value:a||"",onChange:e=>n({img:e})})),(0,l.createElement)(i.PanelRow,null,(0,l.createElement)(s.URLInput,{label:(0,r.__)("Social URL"),help:(0,r.__)("The URL to link to."),className:"block-editor-link-control__field noptin-link-control__field",value:e.url||"",hasBorder:!0,isFullWidth:!0,onChange:e=>n({url:e}),__nextHasNoMarginBottom:!0})),(0,l.createElement)(i.PanelRow,null,(0,l.createElement)(i.TextControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Social Network"),help:(0,r.__)("The name of the social network."),value:c||"",onChange:e=>n({label:e})})))),(0,l.createElement)(s.InspectorControls,{group:"advanced"},(0,l.createElement)(i.TextControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Link rel"),value:u||"",onChange:e=>n({rel:e})})),o&&d&&(0,l.createElement)(i.Popover,{placement:"bottom",onClose:()=>{m(!1)},anchor:g,focusOnMount:!1,__unstableSlotName:"__unstable-block-tools-after",shift:!0},(0,l.createElement)(s.URLInput,{label:(0,r.__)("Social URL"),help:(0,r.__)("The URL to link to."),className:"block-editor-link-control__field noptin-link-control-popover__field",value:e.url||"",onChange:e=>n({url:e}),__nextHasNoMarginBottom:!0})),(0,l.createElement)("td",{...y,width:p},(0,l.createElement)("img",{src:a||"https://placehold.co/30x30@2x.png",alt:c,width:p,height:p})))},save:function({attributes:e}){const{url:t,img:n,label:o,rel:r,iconSize:a}=e,i=V(e),c=i?.style?.backgroundColor,u=s.useBlockProps.save({width:a,style:{color:c,backgroundColor:c,borderCollapse:"separate",...v(e)}});return(0,l.createElement)("td",{...u,width:a},(0,l.createElement)("a",{href:t,rel:r||void 0,style:{display:"inline-block",textDecoration:"none"}},(0,l.createElement)("img",{src:n||"https://placehold.co/30x30@2x.png",alt:o,width:a,height:a})))},variations:Ze},Xe=(0,se.jsx)(ie.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,se.jsx)(ie.Path,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"})}),Qe=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,se.jsx)(ie.Path,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM15.4697 14.9697L18.4393 12L15.4697 9.03033L16.5303 7.96967L20.0303 11.4697L20.5607 12L20.0303 12.5303L16.5303 16.0303L15.4697 14.9697Z"})}),Je=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,se.jsx)(ie.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z"})}),et=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,se.jsx)(ie.Path,{d:"M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})}),tt=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,se.jsx)(ie.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),nt=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,se.jsx)(ie.Path,{d:"M3.8 15.8h8.9v-1.5H3.8v1.5zm0-7h8.9V7.2H3.8v1.6zm14.7-2.1V10h1V5.3l-2.2.7.3 1 .9-.3zm1.2 6.1c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5H20v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3 0-.8-.3-1.1z"})}),ot=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,se.jsx)(ie.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z"})}),rt=({setAttributes:e,reversed:t,start:n,type:o})=>(0,l.createElement)(s.InspectorControls,null,(0,l.createElement)(i.PanelBody,{title:(0,r.__)("Settings")},(0,l.createElement)(i.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,r.__)("List style"),options:[{label:(0,r.__)("Numbers"),value:"decimal"},{label:(0,r.__)("Uppercase letters"),value:"upper-alpha"},{label:(0,r.__)("Lowercase letters"),value:"lower-alpha"},{label:(0,r.__)("Uppercase Roman numerals"),value:"upper-roman"},{label:(0,r.__)("Lowercase Roman numerals"),value:"lower-roman"}],value:o,onChange:t=>e({type:t})}),(0,l.createElement)(i.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,r.__)("Start value"),type:"number",onChange:t=>{const n=parseInt(t,10);e({start:isNaN(n)?void 0:n})},value:Number.isInteger(n)?n.toString(10):"",step:"1"}),(0,l.createElement)(i.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Reverse order"),checked:t||!1,onChange:t=>{e({reversed:t||void 0})}}))),lt={name:"noptin/list-item"},at=[["noptin/list-item"]];function it({clientId:e}){const t=function(e){const{replaceBlocks:t,selectionChange:n}=(0,S.useDispatch)(s.store),{getBlockRootClientId:r,getBlockAttributes:a,getBlock:i}=(0,S.useSelect)(s.store);return(0,l.useCallback)((()=>{const l=r(e),s=a(l),c=(0,o.createBlock)("noptin/list-item",s),{innerBlocks:u}=i(e);t([l],[c,...u]),n(u[u.length-1].clientId)}),[e])}(e),n=(0,S.useSelect)((t=>{const{getBlockRootClientId:n,getBlockName:o}=t(s.store);return"noptin/list-item"===o(n(e))}),[e]);return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(i.ToolbarButton,{icon:(0,r.isRTL)()?Qe:Je,title:(0,r.__)("Outdent"),description:(0,r.__)("Outdent list item"),disabled:!n,onClick:t}))}const st={apiVersion:3,name:"noptin/list",title:(0,r.__)("List"),category:"content",allowedBlocks:["noptin/list-item"],description:(0,r.__)("An organized collection of items displayed in a specific order."),keywords:["bullet list","ordered list","numbered list"],attributes:{ordered:{type:"boolean",default:!1,role:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},noptin:{typography:["fontFamily","fontSize","fontStyle","fontWeight","lineHeight","letterSpacing","textTransform","textDecoration"],border:!0,color:{text:!0,background:!0,link:!0}},supports:{anchor:!1,html:!1,spacing:{__experimentalSkipSerialization:!0,margin:!0,padding:!0,__experimentalDefaultControls:{margin:!0,padding:!1}},__unstablePasteTextInline:!0,__experimentalOnMerge:!0,__experimentalSlashInserter:!0},selectors:{border:".wp-block-noptin-list:not(.wp-block-noptin-list .wp-block-noptin-list)"}},ct=window.wp.richText,ut={A:"upper-alpha",a:"lower-alpha",I:"upper-roman",i:"lower-roman"};function pt({phrasingContentSchema:e}){const t={...e,ul:{},ol:{attributes:["type","start","reversed"]}};return["ul","ol"].forEach((e=>{t[e].children={li:{children:t}}})),t}function dt(e){return e.flatMap((({name:e,attributes:t,innerBlocks:n=[]})=>"noptin/list-item"===e?[t.content,...dt(n)]:dt(n)))}const mt={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph","core/heading"],transform:e=>{let t=[];if(e.length>1)t=e.map((({content:e})=>(0,o.createBlock)("noptin/list-item",{content:e})));else if(1===e.length){const n=(0,ct.create)({html:e[0].content});t=(0,ct.split)(n,"\n").map((e=>(0,o.createBlock)("noptin/list-item",{content:(0,ct.toHTMLString)({value:e})})))}return(0,o.createBlock)("noptin/list",{anchor:e.anchor},t)}},{type:"raw",selector:"ol,ul",schema:e=>({ol:pt(e).ol,ul:pt(e).ul}),transform:function e(t){const n=t.getAttribute("type"),r={ordered:"OL"===t.tagName,anchor:""===t.id?void 0:t.id,start:t.getAttribute("start")?parseInt(t.getAttribute("start"),10):void 0,reversed:!!t.hasAttribute("reversed")||void 0,type:n&&ut[n]?ut[n]:void 0},l=Array.from(t.children).map((t=>{const n=Array.from(t.childNodes).filter((e=>e.nodeType!==e.TEXT_NODE||0!==e.textContent.trim().length));n.reverse();const[r,...l]=n;if("UL"!==r?.tagName&&"OL"!==r?.tagName)return(0,o.createBlock)("noptin/list-item",{content:t.innerHTML});const a=l.map((e=>e.nodeType===e.TEXT_NODE?e.textContent:e.outerHTML));a.reverse();const i={content:a.join("").trim()},s=[e(r)];return(0,o.createBlock)("noptin/list-item",i,s)}));return(0,o.createBlock)("noptin/list",r,l)}},...["*","-"].map((e=>({type:"prefix",prefix:e,transform:e=>(0,o.createBlock)("noptin/list",{},[(0,o.createBlock)("noptin/list-item",{content:e})])}))),...["1.","1)"].map((e=>({type:"prefix",prefix:e,transform:e=>(0,o.createBlock)("noptin/list",{ordered:!0},[(0,o.createBlock)("noptin/list-item",{content:e})])})))],to:[...["core/paragraph","core/heading"].map((e=>({type:"block",blocks:[e],transform:(t,n)=>dt(n).map((t=>(0,o.createBlock)(e,{content:t})))})))]},gt=mt,{name:ht}=st,bt={icon:Xe,example:{innerBlocks:[{name:"noptin/list-item",attributes:{content:"Alice."}},{name:"noptin/list-item",attributes:{content:"The White Rabbit."}},{name:"noptin/list-item",attributes:{content:"The Cheshire Cat."}},{name:"noptin/list-item",attributes:{content:"The Mad Hatter."}},{name:"noptin/list-item",attributes:{content:"The Queen of Hearts."}}]},transforms:gt,edit:function({attributes:e,setAttributes:t,clientId:n}){const{ordered:o,type:a,reversed:c,start:u}=e,p=V(e).style,d=_(e),m=d?.fontSize||16,g=(0,s.useBlockProps)({reversed:c,start:u,className:"noptin-block__margin-wrapper",style:{listStyleType:o&&"decimal"!==a?a:void 0,...v(e),...p,...p.backgroundColor?{padding:`${m.toString().match(/^\d+$/)?`${m}px`:m} 32px`}:{},...d,...Z(e)}}),h=(0,s.useInnerBlocksProps)(g,{defaultBlock:lt,directInsert:!0,template:at,templateLock:!1,templateInsertUpdatesSelection:!0,__experimentalCaptureToolbars:!0}),b=(0,l.createElement)(s.BlockControls,{group:"block"},(0,l.createElement)(i.ToolbarButton,{icon:(0,r.isRTL)()?et:tt,title:(0,r.__)("Unordered"),description:(0,r.__)("Convert to unordered list"),isActive:!1===o,onClick:()=>{t({ordered:!1})}}),(0,l.createElement)(i.ToolbarButton,{icon:(0,r.isRTL)()?nt:ot,title:(0,r.__)("Ordered"),description:(0,r.__)("Convert to ordered list"),isActive:!0===o,onClick:()=>{t({ordered:!0})}}),(0,l.createElement)(it,{clientId:n})),f=o?"ol":"ul";return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(f,{...h}),b,o&&(0,l.createElement)(rt,{setAttributes:t,reversed:c,start:u,type:a}))},save:function({attributes:e}){const{ordered:t,type:n,reversed:o,start:r}=e,a=t?"ol":"ul",i=V(e).style,c=_(e),u=c?.fontSize||16;return(0,l.createElement)(a,{...s.useBlockProps.save({reversed:o,start:r,className:"noptin-block__margin-wrapper",style:{listStyleType:t&&"decimal"!==n?n:void 0,...v(e),...i,...i.backgroundColor?{padding:`${u.toString().match(/^\d+$/)?`${u}px`:u} 32px`}:{},...c,...Z.save(e)}})},(0,l.createElement)(s.InnerBlocks.Content,null))}},_t=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,se.jsx)(ie.Path,{d:"M12 11v1.5h8V11h-8zm-6-1c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),ft=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,se.jsx)(ie.Path,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM20.0303 9.03033L17.0607 12L20.0303 14.9697L18.9697 16.0303L15.4697 12.5303L14.9393 12L15.4697 11.4697L18.9697 7.96967L20.0303 9.03033Z"})}),yt=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,se.jsx)(ie.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z"})});function vt(){const e=(0,S.useRegistry)(),{moveBlocksToPosition:t,removeBlock:n,insertBlock:r,updateBlockListSettings:l}=(0,S.useDispatch)(s.store),{getBlockRootClientId:a,getBlockName:i,getBlockOrder:c,getBlockIndex:u,getSelectedBlockClientIds:p,getBlock:d,getBlockListSettings:m}=(0,S.useSelect)(s.store);return(0,Le.useCallback)(((s=p())=>{if(Array.isArray(s)||(s=[s]),!s.length)return;const g=s[0];if("noptin/list-item"!==i(g))return;const h=function(e){const t=a(e),n=a(t);if(n&&"noptin/list-item"===i(n))return n}(g);if(!h)return;const b=a(g),_=s[s.length-1],f=c(b).slice(u(_)+1);return e.batch((()=>{if(f.length){let e=c(g)[0];if(!e){const t=(0,o.cloneBlock)(d(b),{},[]);e=t.clientId,r(t,0,g,!1),l(e,m(b))}t(f,b,e)}t(s,b,a(h),u(h)+1),c(b).length||n(b,!1)})),!0}),[])}function xt(e){const{replaceBlocks:t,selectionChange:n,multiSelect:r}=(0,S.useDispatch)(s.store),{getBlock:l,getPreviousBlockClientId:a,getSelectionStart:i,getSelectionEnd:c,hasMultiSelection:u,getMultiSelectedBlockClientIds:p}=(0,S.useSelect)(s.store);return(0,Le.useCallback)((()=>{const s=u(),d=s?p():[e],m=d.map((e=>(0,o.cloneBlock)(l(e)))),g=a(e),h=(0,o.cloneBlock)(l(g));h.innerBlocks?.length||(h.innerBlocks=[(0,o.createBlock)("noptin/list")]),h.innerBlocks[h.innerBlocks.length-1].innerBlocks.push(...m);const b=i(),_=c();return t([g,...d],[h]),s?r(m[0].clientId,m[m.length-1].clientId):n(m[0].clientId,_.attributeKey,_.clientId===b.clientId?b.offset:_.offset,_.offset),!0}),[e])}function kt(e,t){const n=(0,S.useRegistry)(),{getPreviousBlockClientId:o,getNextBlockClientId:r,getBlockOrder:l,getBlockRootClientId:a,getBlockName:i}=(0,S.useSelect)(s.store),{mergeBlocks:c,moveBlocksToPosition:u}=(0,S.useDispatch)(s.store),p=vt();function d(e){const t=l(e);return t.length?d(t[t.length-1]):e}function m(e){const t=a(e),n=a(t);if(n&&"noptin/list-item"===i(n))return n}function g(e){const t=r(e);if(t)return t;const n=m(e);return n?g(n):void 0}function h(e){const t=l(e);return t.length?l(t[0])[0]:g(e)}return r=>{function i(e,t){n.batch((()=>{const[n]=l(t);n&&(o(t)!==e||l(e).length?u(l(n),n,a(e)):u([n],t,e)),c(e,t)}))}if(r){const n=h(e);if(!n)return void t(r);m(n)?p(n):i(e,n)}else{const n=o(e);m(e)?p(e):n?i(d(n),e):t(r)}}}function wt({clientId:e}){const t=xt(e),n=vt(),{canIndent:o,canOutdent:a}=(0,S.useSelect)((t=>{const{getBlockIndex:n,getBlockRootClientId:o,getBlockName:r}=t(s.store);return{canIndent:n(e)>0,canOutdent:"noptin/list-item"===r(o(o(e)))}}),[e]);return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(i.ToolbarButton,{icon:(0,r.isRTL)()?Qe:Je,title:(0,r.__)("Outdent"),description:(0,r.__)("Outdent list item"),disabled:!a,onClick:()=>n()}),(0,l.createElement)(i.ToolbarButton,{icon:(0,r.isRTL)()?ft:yt,title:(0,r.__)("Indent"),description:(0,r.__)("Indent list item"),disabled:!o,onClick:()=>t()}))}const Et={apiVersion:3,name:"noptin/list-item",title:(0,r.__)("List item"),category:"content",parent:["noptin/list"],allowedBlocks:["noptin/list"],description:(0,r.__)("An individual item within a list."),attributes:{placeholder:{type:"string"},content:{type:"rich-text",source:"rich-text",selector:"li",role:"content"}},noptin:{typography:["fontFamily","fontSize","fontStyle","fontWeight","lineHeight","letterSpacing","textTransform","textDecoration"],border:!0,color:{text:!0,background:!0,link:!0}},supports:{anchor:!1,className:!1,splitting:!0,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}}},selectors:{root:".wp-block-noptin-list > li",border:".wp-block-noptin-list:not(.wp-block-noptin-list .wp-block-noptin-list) > li"}},Ct={to:[{type:"block",blocks:["core/paragraph"],transform:(e,t=[])=>[(0,o.createBlock)("core/paragraph",e),...t.map((e=>(0,o.cloneBlock)(e)))]}]},St=Ct,{name:Bt}=Et,It={icon:_t,edit:function({attributes:e,setAttributes:t,clientId:n,mergeBlocks:a}){const{placeholder:i,content:c}=e,u=(0,s.useBlockProps)({style:{...v(e),...V(e).style,..._(e),...Z(e)}}),p=(0,s.useInnerBlocksProps)(u,{renderAppender:!1,__unstableDisableDropZone:!0}),d=function(e){const{replaceBlocks:t,selectionChange:n}=(0,S.useDispatch)(s.store),{getBlock:r,getBlockRootClientId:l,getBlockIndex:a,getBlockName:i}=(0,S.useSelect)(s.store),c=(0,Le.useRef)(e);c.current=e;const u=vt();return(0,E.useRefEffect)((e=>{function s(e){if(e.defaultPrevented||e.keyCode!==K.ENTER)return;const{content:s,clientId:p}=c.current;if(s.length)return;if(e.preventDefault(),"noptin/list-item"===i(l(l(c.current.clientId))))return void u();const d=r(l(p)),m=a(p),g=(0,o.cloneBlock)({...d,innerBlocks:d.innerBlocks.slice(0,m)}),h=(0,o.createBlock)((0,o.getDefaultBlockName)()),b=[...d.innerBlocks[m].innerBlocks[0]?.innerBlocks||[],...d.innerBlocks.slice(m+1)],_=b.length?[(0,o.cloneBlock)({...d,innerBlocks:b})]:[];t(d.clientId,[g,h,..._],1),n(h.clientId)}return e.addEventListener("keydown",s),()=>{e.removeEventListener("keydown",s)}}),[])}({content:c,clientId:n}),m=function(e){const{getSelectionStart:t,getSelectionEnd:n,getBlockIndex:o}=(0,S.useSelect)(s.store),r=xt(e),l=vt();return(0,E.useRefEffect)((a=>{function i(a){const{keyCode:i,shiftKey:s,altKey:c,metaKey:u,ctrlKey:p}=a;if(a.defaultPrevented||i!==K.SPACE&&i!==K.TAB||c||u||p)return;const d=t(),m=n();0===d.offset&&0===m.offset&&(s?i===K.TAB&&l()&&a.preventDefault():0!==o(e)&&r()&&a.preventDefault())}return a.addEventListener("keydown",i),()=>{a.removeEventListener("keydown",i)}}),[e,r])}(n),g=kt(n,a);return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("li",{...p},(0,l.createElement)(s.RichText,{ref:(0,E.useMergeRefs)([d,m]),identifier:"content",tagName:"div",onChange:e=>t({content:e}),value:c,"aria-label":(0,r.__)("List text"),placeholder:i||(0,r.__)("List"),onMerge:g}),p.children),(0,l.createElement)(s.BlockControls,{group:"block"},(0,l.createElement)(wt,{clientId:n})))},save:function({attributes:e}){return(0,l.createElement)("li",{...s.useBlockProps.save({style:{...v(e),...V(e).style,..._(e),...Z.save(e)}})},(0,l.createElement)(s.RichText.Content,{value:e.content}),(0,l.createElement)(s.InnerBlocks.Content,null))},merge:(e,t)=>({...e,content:e.content+t.content}),transforms:St},Tt={apiVersion:3,name:"core/html",title:(0,r.__)("Custom HTML"),category:"content",description:(0,r.__)("Add custom HTML code and preview it as you edit."),keywords:["code","raw"],attributes:{content:{type:"string",source:"raw"}},supports:{customClassName:!1,className:!1,html:!1,anchor:!1}},{name:Mt}=Tt,zt={icon:"editor-code",example:{attributes:{content:""+(0,r.__)("Welcome to the wonderful world of blocks…")+""}},edit:function({attributes:e,setAttributes:t}){const[n,o]=(0,Le.useState)(!1),a=(0,Le.useContext)(i.Disabled.Context),c=(0,Le.useId)(),u=(0,s.useBlockProps)({className:"block-library-html__edit","aria-describedby":n?c:void 0});return(0,l.createElement)("div",{...u},(0,l.createElement)(s.BlockControls,null,(0,l.createElement)(i.ToolbarGroup,null,(0,l.createElement)(i.ToolbarButton,{className:"components-tab-button",isPressed:!n,onClick:function(){o(!1)}},"HTML"),(0,l.createElement)(i.ToolbarButton,{className:"components-tab-button",isPressed:n,onClick:function(){o(!0)}},(0,r.__)("Preview")))),n||a?(0,l.createElement)(Le.RawHTML,null,e.content):(0,l.createElement)(s.PlainText,{value:e.content,onChange:e=>t({content:e}),placeholder:(0,r.__)("Write HTML…"),"aria-label":(0,r.__)("HTML")}))},save:function({attributes:e}){return(0,l.createElement)(Le.RawHTML,null,e.content)}},At=(0,se.jsx)(ie.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,se.jsx)(ie.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"})}),Nt={apiVersion:3,name:"noptin/group",title:(0,r.__)("Section","newsletter-optin-box"),category:"design",description:(0,r.__)("Gather blocks in a layout container."),keywords:["container","wrapper","row","section"],attributes:{templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]},allowedBlocks:{type:"array"},style:{type:"object",default:{noptin:{align:"center",color:{background:"#ffffff"}}}},width:{type:"string",default:"600px"}},noptin:{typography:!0,border:!0,color:!0,align:!0},supports:{__experimentalOnEnter:!0,__experimentalOnMerge:!0,__experimentalSettings:!0,anchor:!1,html:!1,background:{__experimentalSkipSerialization:!0,backgroundImage:!0,backgroundSize:!0,backgroundRepeat:!0,__experimentalDefaultControls:{backgroundImage:!0,backgroundSize:!0,backgroundRepeat:!0}},spacing:{__experimentalSkipSerialization:!0,margin:["top","bottom"],padding:!0,__experimentalDefaultControls:{margin:!0,padding:!0}}}},Pt={from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert(e){const t=e.map((e=>(0,o.createBlock)(e.name,e.attributes,e.innerBlocks)));return(0,o.createBlock)("noptin/group",{},t)}}]},Ht=Pt,{name:Lt}=Nt,Vt={icon:At,example:{attributes:{style:{color:{text:"#000000",background:"#ffffff"}}},innerBlocks:[{name:"core/paragraph",attributes:{customTextColor:"#cf2e2e",fontSize:"large",content:(0,r.__)("One.")}},{name:"core/paragraph",attributes:{customTextColor:"#ff6900",fontSize:"large",content:(0,r.__)("Two.")}},{name:"core/paragraph",attributes:{customTextColor:"#fcb900",fontSize:"large",content:(0,r.__)("Three.")}},{name:"core/paragraph",attributes:{customTextColor:"#00d084",fontSize:"large",content:(0,r.__)("Four.")}},{name:"core/paragraph",attributes:{customTextColor:"#0693e3",fontSize:"large",content:(0,r.__)("Five.")}},{name:"core/paragraph",attributes:{customTextColor:"#9b51e0",fontSize:"large",content:(0,r.__)("Six.")}}]},transforms:Ht,edit:({attributes:e,setAttributes:t})=>{const{width:n}=e,o=R(e),a=Z(e,!0),c={width:n,maxWidth:"100%",borderCollapse:"separate",...v(e),...V(e).style,...Ne(e).style},u=(0,s.useInnerBlocksProps)({style:_(e)},{templateLock:e.templateLock,allowedBlocks:e.allowedBlocks}),p=(0,i.__experimentalUseCustomUnits)({availableUnits:["%","px","em","rem","vw"]});return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.InspectorControls,null,(0,l.createElement)(i.PanelBody,{title:(0,r.__)("Settings")},(0,l.createElement)(i.__experimentalUnitControl,{label:(0,r.__)("Width"),labelPosition:"edge",__unstableInputWidth:"80px",min:10,value:n||"",onChange:e=>t({width:e}),units:p}))),(0,l.createElement)("div",{...(0,s.useBlockProps)({style:a.margin})},(0,l.createElement)("table",{width:n,align:o,cellPadding:0,cellSpacing:0,role:"presentation",style:c},(0,l.createElement)("tbody",null,(0,l.createElement)("tr",null,(0,l.createElement)("td",{className:"noptin-block-group__inner",style:a.padding,align:o},(0,l.createElement)("table",{border:0,cellPadding:0,cellSpacing:0,width:"100%"},(0,l.createElement)("tbody",null,(0,l.createElement)("tr",null,(0,l.createElement)("td",{...u}))))))))))},save:({attributes:e})=>{const{width:t}=e,n=Z.save(e,!0),o=Ne(e,t),r=R(e),a={width:t,maxWidth:"100%",borderCollapse:"separate",...v(e),...V(e).style,...o.style},i={..._(e),...o.vmlOpen?{backgroundColor:"transparent"}:V(e).style};return(0,l.createElement)("div",{...s.useBlockProps.save({style:n.margin})},o.vmlOpen&&(0,l.createElement)(Le.RawHTML,{children:o.vmlOpen}),(0,l.createElement)("table",{width:t,align:r,cellPadding:0,cellSpacing:0,role:"presentation",style:a},(0,l.createElement)("tbody",null,(0,l.createElement)("tr",null,(0,l.createElement)("td",{className:"noptin-block-group__inner",style:n.padding,align:r},(0,l.createElement)("table",{border:"0",cellPadding:"0",cellSpacing:"0",width:"100%"},(0,l.createElement)("tbody",null,(0,l.createElement)("tr",null,(0,l.createElement)("td",{style:i},(0,l.createElement)(s.InnerBlocks.Content,null))))))))),o.vmlClose&&(0,l.createElement)(Le.RawHTML,{children:o.vmlClose}))}},$t=e=>{const t=parseFloat(e);return Number.isFinite(t)?parseFloat(t.toFixed(2)):void 0};function Rt(e,t){const{width:n=100/t}=e.attributes;return $t(n)}function Dt(e,t,n=e.length){const o=function(e,t=e.length){return e.reduce(((e,n)=>e+Rt(n,t)),0)}(e,n);return Object.fromEntries(Object.entries(function(e,t=e.length){return e.reduce(((e,n)=>{const o=Rt(n,t);return Object.assign(e,{[n.clientId]:o})}),{})}(e,n)).map((([e,n])=>[e,$t(t*n/o)])))}function Ot(e,t){return e.map((e=>({...e,attributes:{...e.attributes,width:`${t[e.clientId]}%`}})))}const jt=["noptin/column"];function Ft({attributes:e,setAttributes:t,clientId:n}){const{isStackedOnMobile:a,verticalAlignment:c,templateLock:u}=e,{replaceInnerBlocks:p}=(0,S.useDispatch)(s.store),{count:d,canInsertColumnBlock:m,minCount:g,innerBlocks:h}=(0,S.useSelect)((e=>{const{canInsertBlockType:t,canRemoveBlock:o,getBlocks:r,getBlockCount:l}=e(s.store),a=r(n),i=a.reduce(((e,t,n)=>(o(t.clientId)||e.push(n),e)),[]);return{count:l(n),canInsertColumnBlock:t("noptin/column",n),minCount:Math.max(...i)+1,innerBlocks:a}}),[n]),b=(0,s.useBlockProps)({className:k("noptin-columns noptin-columns__wrapper",{"noptin-is-stacked-on-mobile":a}),style:{..._(e),...v(e),...Z(e),...V(e).style}}),f=(0,s.useInnerBlocksProps)(b,{allowedBlocks:jt,orientation:"horizontal",renderAppender:!1,templateLock:u});return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.BlockControls,null,(0,l.createElement)(s.BlockVerticalAlignmentToolbar,{onChange:e=>t({verticalAlignment:e}),value:c})),(0,l.createElement)(s.InspectorControls,null,(0,l.createElement)(i.PanelBody,null,m&&(0,l.createElement)(l.Fragment,null,(0,l.createElement)(i.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,r.__)("Columns"),value:d,onChange:e=>((e,t)=>{let r=[...h];const l=h.every((e=>{const t=e.attributes.width;return Number.isFinite(t?.endsWith?.("%")?parseFloat(t):t)})),a=t>e;if(a&&l){const n=$t(100/t),l=Dt(h,100-n);r=[...Ot(h,l),...Array.from({length:t-e}).map((()=>(0,o.createBlock)("noptin/column",{width:`${n}%`})))]}else if(a)r=[...h,...Array.from({length:t-e}).map((()=>(0,o.createBlock)("noptin/column")))];else if(tt({isStackedOnMobile:!a})}))),(0,l.createElement)("div",{...f}))}function Ut({clientId:e,name:t,setAttributes:n}){const{blockType:a,defaultVariation:i,variations:c}=(0,S.useSelect)((e=>{const{getBlockVariations:n,getBlockType:r,getDefaultBlockVariation:l}=e(o.store);return{blockType:r(t),defaultVariation:l(t,"block"),variations:n(t,"block")}}),[t]),{replaceInnerBlocks:u}=(0,S.useDispatch)(s.store),p=(0,s.useBlockProps)();return(0,l.createElement)("div",{...p},(0,l.createElement)(s.__experimentalBlockVariationPicker,{icon:a?.icon?.src,label:a?.title,variations:c,instructions:(0,r.__)("Divide into columns. Select a layout:"),onSelect:(t=i)=>{t.attributes&&n(t.attributes),t.innerBlocks&&u(e,(0,o.createBlocksFromInnerBlocksTemplate)(t.innerBlocks),!0)},allowSkip:!0}))}const Wt={apiVersion:3,name:"noptin/columns",title:(0,r.__)("Columns"),category:"design",description:(0,r.__)("Display content in multiple columns, with blocks added to each column."),attributes:{verticalAlignment:{type:"string",default:"top"},isStackedOnMobile:{type:"boolean",default:!0},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},providesContext:{"noptin/columns/verticalAlignment":"verticalAlignment","noptin/columns/isStackedOnMobile":"isStackedOnMobile"},noptin:{typography:!0,border:!0,color:!0},supports:{anchor:!1,html:!1,__experimentalExposeControlsToChildren:!0,spacing:{__experimentalSkipSerialization:!0,margin:!0,__experimentalDefaultControls:{margin:!0}}}};function Gt(e,t=!1){return`\n ${t?"\x3c!--[if !true]>\x3c!--\x3e":"\x3c!--[if true]>"}\n ${e}\n ${t?"\x3c!--{const t=+(100/e.length).toFixed(2),n=e.map((({name:e,attributes:n,innerBlocks:o})=>["noptin/column",{width:`${t}%`},[[e,{...n},o]]]));return(0,o.createBlock)("noptin/columns",{},(0,o.createBlocksFromInnerBlocksTemplate)(n))},isMatch:({length:e},t)=>(1!==t.length||"noptin/columns"!==t[0].name)&&e&&e<=6}],ungroup:(e,t)=>t.flatMap((e=>e.innerBlocks))},{name:Kt}=Wt,Yt={icon:"columns",variations:qt,edit:e=>{const{clientId:t}=e,n=(0,S.useSelect)((e=>e(s.store).getBlocks(t).length>0),[t])?Ft:Ut;return(0,l.createElement)(n,{...e})},save:function({attributes:e}){const{isStackedOnMobile:t}=e,n={..._(e),...v(e),...Z.save(e),...V(e).style},o=s.useBlockProps.save({className:k("noptin-columns noptin-columns__wrapper",{"noptin-is-stacked-on-mobile":t}),style:n}),r=Gt(``),a=Gt("
");return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(Le.RawHTML,{children:`${r}\x3c!--[if !true]>\x3c!--\x3e`}),(0,l.createElement)("div",{...o},(0,l.createElement)(Le.RawHTML,{children:"\x3c!--\x3c!--\x3e"})),(0,l.createElement)(Le.RawHTML,{children:`\x3c!--"center"===e?"middle":e||void 0,Jt={apiVersion:3,name:"noptin/column",title:(0,r.__)("Column"),category:"design",parent:["noptin/columns"],description:(0,r.__)("A single column within a columns block."),attributes:{verticalAlignment:{type:"string",default:"top"},isStackedOnMobile:{type:"boolean",default:!0},width:{type:"string"},allowedBlocks:{type:"array"},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},usesContext:["noptin/columns/verticalAlignment","noptin/columns/isStackedOnMobile"],noptin:{typography:!0,border:!0,color:!0},supports:{__experimentalOnEnter:!0,anchor:!1,reusable:!1,html:!1,background:{__experimentalSkipSerialization:!0,backgroundImage:!0,backgroundSize:!0,backgroundRepeat:!0,__experimentalDefaultControls:{backgroundImage:!0,backgroundSize:!0,backgroundRepeat:!0}},spacing:{__experimentalSkipSerialization:!0,padding:!0,margin:!0,__experimentalDefaultControls:{padding:!0,margin:!0}}}},{name:en}=Jt,tn={icon:Xt,edit:function({attributes:{width:e,templateLock:t,verticalAlignment:n,isStackedOnMobile:o,allowedBlocks:a,...c},setAttributes:u,clientId:p,context:d}){const m=d["noptin/columns/verticalAlignment"];(0,l.useEffect)((()=>{n!==m&&u({verticalAlignment:m})}),[m,n]);const g=d["noptin/columns/isStackedOnMobile"];(0,l.useEffect)((()=>{o!==g&&u({isStackedOnMobile:g})}),[g,o]);const h=(0,i.__experimentalUseCustomUnits)({availableUnits:["%","px","em","rem","vw"]}),b=(0,S.useSelect)((e=>e(s.store).getBlockOrder(p).length>0),[p]),f={verticalAlign:Qt(n)};if(e&&/\d/.test(e)){let t=Number.isFinite(e)?e+"%":e;if(!Number.isFinite(e)&&e?.endsWith("%")){const n=1e12;t=Math.round(Number.parseFloat(e)*n)/n+"%"}f.width=t}const y=(0,s.useBlockProps)({className:k("noptin-column",{"noptin-is-stacked-on-mobile":o}),style:f}),x={..._(c),...v(c),...Z(c),...V(c).style,...Ne(c).style};return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.InspectorControls,null,(0,l.createElement)(i.PanelBody,{title:(0,r.__)("Settings")},(0,l.createElement)(i.__experimentalUnitControl,{label:(0,r.__)("Width"),labelPosition:"edge",__unstableInputWidth:"80px",value:e||"",onChange:e=>{e=0>parseFloat(e)?"0":e,u({width:e})},units:h}))),(0,l.createElement)("div",{...y},(0,l.createElement)("div",{className:"noptin-column__inner",style:x},(0,l.createElement)(s.InnerBlocks,{templateLock:t,allowedBlocks:a,renderAppender:b?void 0:s.InnerBlocks.ButtonBlockAppender}))))},save:function({attributes:e}){const{width:t,verticalAlignment:n,isStackedOnMobile:o}=e,r={verticalAlign:Qt(n)};if(t&&/\d/.test(t)){let e=Number.isFinite(t)?t+"%":t;if(!Number.isFinite(t)&&t?.endsWith("%")){const n=1e12;e=Math.round(Number.parseFloat(t)*n)/n+"%"}r.width=e}const a=Ne(e,t),i=s.useBlockProps.save({className:k("noptin-column",{"noptin-is-stacked-on-mobile":o}),style:r}),c=Gt(``),u=Gt(""),p={..._(e),...v(e),...Z.save(e),...V(e).style,...a.style};return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(Le.RawHTML,{children:`${c}\x3c!--[if !true]>\x3c!--\x3e`}),(0,l.createElement)("div",{...i},(0,l.createElement)(Le.RawHTML,{children:"\x3c!--\x3c!--\x3e"})),(0,l.createElement)(Le.RawHTML,{children:`\x3c!--(0,o.createBlock)("noptin/separator")},{type:"raw",selector:"hr",schema:{hr:{}}}]},{name:ln}=on,an={icon:nn,transforms:rn,edit:function({attributes:e,setAttributes:t}){const{width:n,height:o}=e,a=V(e),c=a?.style?.backgroundColor,u=(0,i.__experimentalUseCustomUnits)({availableUnits:["%","px","em","rem"]});return(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.InspectorControls,null,(0,l.createElement)(i.PanelBody,{title:(0,r.__)("Settings")},(0,l.createElement)(i.__experimentalUnitControl,{label:(0,r.__)("Width"),labelPosition:"edge",__unstableInputWidth:"80px",value:n||"",onChange:e=>{e=0>parseFloat(e)?"0":e,t({width:e})},units:u}),(0,l.createElement)(i.__experimentalUnitControl,{label:(0,r.__)("Height"),labelPosition:"edge",__unstableInputWidth:"80px",value:o||"",onChange:e=>{e=e?0>parseFloat(e)?"0":e:"1em",t({height:e})},units:u}))),(0,l.createElement)("hr",{...(0,s.useBlockProps)({style:{color:c,backgroundColor:c,borderWidth:0,height:o||"1em",width:n||"100%",maxWidth:"100%",...Z(e)},align:R(e)})}))},save:function({attributes:e}){const{width:t,height:n}=e,o=V(e),r=o?.style?.backgroundColor;return(0,l.createElement)("hr",{...s.useBlockProps.save({style:{color:r,backgroundColor:r,borderWidth:0,height:n||"1em",width:t||"100%",maxWidth:"100%",...Z.save(e)},align:R(e)})})}},sn=(0,se.jsx)(ie.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,se.jsx)(ie.Path,{d:"M7 18h4.5v1.5h-7v-7H6V17L17 6h-4.5V4.5h7v7H18V7L7 18Z"})}),cn={apiVersion:3,name:"noptin/spacer",title:(0,r.__)("Spacer"),category:"design",description:(0,r.__)("Add a blank space between blocks and customize its height."),attributes:{height:{type:"string",default:"100px"}},noptin:{color:{background:!0}},supports:{anchor:!1,spacing:{__experimentalSkipSerialization:!0,margin:["top","bottom"],__experimentalDefaultControls:{margin:!0}}}},{name:un}=cn,pn={icon:sn,edit:({attributes:e,isSelected:t,setAttributes:n})=>{const{height:o}=e,a=V(e),c=a?.style?.backgroundColor,u={backgroundColor:c||(t?"#95a5a6":void 0),height:o,...Z(e)},p=(0,i.__experimentalUseCustomUnits)({availableUnits:["px","em","rem"],defaultValues:{px:100,em:10,rem:10}});return(0,l.createElement)(l.Fragment,null,(0,l.createElement)("div",{...(0,s.useBlockProps)({style:u})}," "),(0,l.createElement)(s.InspectorControls,null,(0,l.createElement)(i.PanelBody,{title:(0,r.__)("Settings")},(0,l.createElement)(i.__experimentalUnitControl,{label:(0,r.__)("Height"),labelPosition:"edge",__unstableInputWidth:"80px",value:o||"",onChange:e=>{e=e?0>parseFloat(e)?"0px":e:"0px",n({height:e})},units:p,min:0}))))},save:function({attributes:e}){const{height:t}=e,n=V(e),o=n?.style?.backgroundColor;return(0,l.createElement)("div",{...s.useBlockProps.save({style:{color:o,backgroundColor:o,height:t||"100px",lineHeight:t||"100px",...Z.save(e)}})}," ")}},dn=window.wp.dom,mn=(0,S.withDispatch)(((e,{clientId:t,attributes:n})=>{const{replaceBlock:r}=e(s.store);return{convertToHTML(){r(t,(0,o.createBlock)("core/html",{content:n.originalUndelimitedContent}))}}}))((function({attributes:e,convertToHTML:t,clientId:n}){const{originalName:o,originalUndelimitedContent:a}=e,c=!!a,{hasHTMLBlock:u}=(0,S.useSelect)((e=>{const{canInsertBlockType:t,getBlockRootClientId:o}=e(s.store);return{hasHTMLBlock:t("core/html",o(n))}}),[n]),p=[];let d;const m=(0,l.createElement)(i.Button,{key:"convert",onClick:t,variant:"primary"},(0,r.__)("Keep as HTML"));return c&&u?(d=(0,r.sprintf)('Your site doesn\'t include support for the "%s" block. You can leave this block intact, convert its content to a RAW block, or remove it entirely.',o),p.push(m)):d=(0,r.sprintf)('Your site doesn’t include support for the "%s" block. You can leave this block intact or remove it entirely.',o),(0,l.createElement)("div",{...(0,s.useBlockProps)({className:"has-warning"})},(0,l.createElement)(s.Warning,{actions:p},d),(0,l.createElement)(Le.RawHTML,null,(0,dn.safeHTML)(a)))})),gn={apiVersion:3,name:"core/missing",title:(0,r.__)("Unsupported"),category:"content",description:(0,r.__)("Your site doesn’t include support for this block."),attributes:{originalName:{type:"string"},originalUndelimitedContent:{type:"string"},originalContent:{type:"string",source:"raw"}},supports:{className:!1,customClassName:!1,inserter:!1,html:!1,reusable:!1,anchor:!1}},{name:hn}=gn,bn={name:hn,edit:mn,save:function({attributes:e}){return(0,l.createElement)(Le.RawHTML,null,e.originalContent)}},fn={apiVersion:3,name:"noptin/shortcode",title:(0,r.__)("Merge Tag","newsletter-optin-box"),category:"dynamic",description:(0,r.__)("Insert additional custom elements with a WordPress shortcode or Noptin Merge tag.","newsletter-optin-box"),keywords:["merge tag","smart tag","shortcode","noptin"],attributes:{text:{type:"string",source:"raw"}},supports:{customClassName:!1,className:!1,html:!1,anchor:!1}},yn=window.wp.autop,vn={from:[{type:"shortcode",tag:"[a-z][a-z0-9_.-]*",attributes:{text:{type:"string",shortcode:(e,{content:t})=>(0,yn.removep)((0,yn.autop)(t))}},priority:20}]},{name:xn}=fn,kn={icon:"shortcode",transforms:vn,edit:function({attributes:e,setAttributes:t}){const n=`blocks-shortcode-input-${(0,l.useId)()}`;return(0,l.createElement)("div",{...(0,s.useBlockProps)({className:"components-placeholder"})},(0,l.createElement)("label",{htmlFor:n,className:"components-placeholder__label"},(0,l.createElement)(i.Icon,{icon:"shortcode"}),(0,r.__)("Merge tag / Shortcode","newsletter-optin-box")),(0,l.createElement)(s.PlainText,{className:"blocks-shortcode__textarea",id:n,value:e.text,"aria-label":(0,r.__)("Shortcode text"),placeholder:(0,r.__)("Write merge tag or shortcode here…"),onChange:e=>t({text:e})}))},save:function({attributes:e}){return(0,l.createElement)(Le.RawHTML,null,e.text)}},wn=(0,se.jsx)(ie.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,se.jsx)(ie.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z"})}),En=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,se.jsx)(ie.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"})}),Cn=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,se.jsx)(ie.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"})}),Sn=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,se.jsx)(ie.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"})}),Bn=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,se.jsx)(ie.Path,{d:"M6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84zM6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84z"})}),In=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,se.jsx)(ie.Path,{d:"M13.824 10.176h-2.88v-2.88H9.536v2.88h-2.88v1.344h2.88v2.88h1.408v-2.88h2.88zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm6.4 0H7.68v3.84h5.12V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.056H1.28v9.024H19.2V6.336z"})}),Tn=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,se.jsx)(ie.Path,{d:"M17.728 11.456L14.592 8.32l3.2-3.2-1.536-1.536-3.2 3.2L9.92 3.648 8.384 5.12l3.2 3.2-3.264 3.264 1.536 1.536 3.264-3.264 3.136 3.136 1.472-1.536zM0 17.92V0h20.48v17.92H0zm19.2-6.4h-.448l-1.28-1.28H19.2V6.4h-1.792l1.28-1.28h.512V1.28H1.28v3.84h6.208l1.28 1.28H1.28v3.84h7.424l-1.28 1.28H1.28v3.84H19.2v-3.84z"})}),Mn=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,se.jsx)(ie.Path,{d:"M6.4 3.776v3.648H2.752v1.792H6.4v3.648h1.728V9.216h3.712V7.424H8.128V3.776zM0 17.92V0h20.48v17.92H0zM12.8 1.28H1.28v14.08H12.8V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.12h-5.12v3.84h5.12V6.4zm0 5.12h-5.12v3.84h5.12v-3.84z"})}),zn=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,se.jsx)(ie.Path,{d:"M14.08 12.864V9.216h3.648V7.424H14.08V3.776h-1.728v3.648H8.64v1.792h3.712v3.648zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm0 5.12H1.28v3.84H6.4V6.4zm0 5.12H1.28v3.84H6.4v-3.84zM19.2 1.28H7.68v14.08H19.2V1.28z"})}),An=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,se.jsx)(ie.Path,{d:"M6.4 9.98L7.68 8.7v-.256L6.4 7.164V9.98zm6.4-1.532l1.28-1.28V9.92L12.8 8.64v-.192zm7.68 9.472V0H0v17.92h20.48zm-1.28-2.56h-5.12v-1.024l-.256.256-1.024-1.024v1.792H7.68v-1.792l-1.024 1.024-.256-.256v1.024H1.28V1.28H6.4v2.368l.704-.704.576.576V1.216h5.12V3.52l.96-.96.32.32V1.216h5.12V15.36zm-5.76-2.112l-3.136-3.136-3.264 3.264-1.536-1.536 3.264-3.264L5.632 5.44l1.536-1.536 3.136 3.136 3.2-3.2 1.536 1.536-3.2 3.2 3.136 3.136-1.536 1.536z"})}),Nn=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,se.jsx)(ie.Path,{d:"M4 6v11.5h16V6H4zm1.5 1.5h6V11h-6V7.5zm0 8.5v-3.5h6V16h-6zm13 0H13v-3.5h5.5V16zM13 11V7.5h5.5V11H13z"})}),Pn=["align"];function Hn(e,t,n){if(!t)return e;const o=Object.fromEntries(Object.entries(e).filter((([e])=>["head","body","foot"].includes(e)))),{sectionName:r,rowIndex:l}=t;return Object.fromEntries(Object.entries(o).map((([e,o])=>r&&r!==e?[e,o]:[e,o.map(((o,r)=>l&&l!==r?o:{cells:o.cells.map(((o,l)=>function(e,t){if(!e||!t)return!1;switch(t.type){case"column":return"column"===t.type&&e.columnIndex===t.columnIndex;case"cell":return"cell"===t.type&&e.sectionName===t.sectionName&&e.columnIndex===t.columnIndex&&e.rowIndex===t.rowIndex}}({sectionName:e,columnIndex:l,rowIndex:r},t)?n(o):o))}))])))}function Ln(e,{sectionName:t,rowIndex:n,columnCount:o}){const r=function(e){return $n(e.head)?$n(e.body)?$n(e.foot)?void 0:e.foot[0]:e.body[0]:e.head[0]}(e),l=void 0===o?r?.cells?.length:o;return l?{[t]:[...e[t].slice(0,n),{cells:Array.from({length:l}).map(((e,n)=>{var o;const l=null!==(o=r?.cells?.[n])&&void 0!==o?o:{};return{...Object.fromEntries(Object.entries(l).filter((([e])=>Pn.includes(e)))),content:"",tag:"head"===t?"th":"td"}}))},...e[t].slice(n)]}:e}function Vn(e,t){var n;return $n(e[t])?Ln(e,{sectionName:t,rowIndex:0,columnCount:null!==(n=e.body?.[0]?.cells?.length)&&void 0!==n?n:1}):{[t]:[]}}function $n(e){return!e||!e.length||e.every(Rn)}function Rn(e){return!(e.cells&&e.cells.length)}const Dn=[{icon:En,title:(0,r.__)("Align column left"),align:"left"},{icon:Cn,title:(0,r.__)("Align column center"),align:"center"},{icon:Sn,title:(0,r.__)("Align column right"),align:"right"}],On={head:(0,r.__)("Header cell text"),body:(0,r.__)("Body cell text"),foot:(0,r.__)("Footer cell text")},jn={head:(0,r.__)("Header label"),foot:(0,r.__)("Footer label")};function Fn({name:e,...t}){const n=`t${e}`;return(0,l.createElement)(n,{...t})}const Un={apiVersion:3,name:"noptin/table",title:(0,r.__)("Table"),category:"design",description:(0,r.__)("Create structured content in rows and columns to display information."),attributes:{hasFixedLayout:{type:"boolean",default:!0},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"rich-text",source:"rich-text"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"},colspan:{type:"string",source:"attribute",attribute:"colspan"},rowspan:{type:"string",source:"attribute",attribute:"rowspan"}}}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"rich-text",source:"rich-text"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"},colspan:{type:"string",source:"attribute",attribute:"colspan"},rowspan:{type:"string",source:"attribute",attribute:"rowspan"}}}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"rich-text",source:"rich-text"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"},colspan:{type:"string",source:"attribute",attribute:"colspan"},rowspan:{type:"string",source:"attribute",attribute:"rowspan"}}}}}},supports:{anchor:!1,spacing:{__experimentalSkipSerialization:!0,margin:!0,padding:!0,__experimentalDefaultControls:{margin:!0,padding:!0}},__experimentalSelector:".wp-block-noptin-table > table"},noptin:{typography:["fontFamily","fontSize","fontStyle","fontWeight","lineHeight","letterSpacing","textTransform","textDecoration"],border:!0,color:!0,align:!0}};function Wn(e){const t=parseInt(e,10);if(Number.isInteger(t))return t<0||1===t?void 0:t.toString()}const Gn=({phrasingContentSchema:e})=>({tr:{allowEmpty:!0,children:{th:{allowEmpty:!0,children:e,attributes:["scope","colspan","rowspan"]},td:{allowEmpty:!0,children:e,attributes:["colspan","rowspan"]}}}}),qn={from:[{type:"raw",selector:"table",schema:e=>({table:{children:{thead:{allowEmpty:!0,children:Gn(e)},tfoot:{allowEmpty:!0,children:Gn(e)},tbody:{allowEmpty:!0,children:Gn(e)}}}}),transform:e=>{const t=Array.from(e.children).reduce(((e,t)=>{if(!t.children.length)return e;const n=t.nodeName.toLowerCase().slice(1),o=Array.from(t.children).reduce(((e,t)=>{if(!t.children.length)return e;const n=Array.from(t.children).reduce(((e,t)=>{const n=Wn(t.getAttribute("rowspan")),o=Wn(t.getAttribute("colspan"));return e.push({tag:t.nodeName.toLowerCase(),content:t.innerHTML,rowspan:n,colspan:o}),e}),[]);return e.push({cells:n}),e}),[]);return e[n]=o,e}),{});return(0,o.createBlock)("noptin/table",t)}}]},Zn=qn,{name:Kn}=Un,Yn={icon:wn,example:{attributes:{head:[{cells:[{content:"Version",tag:"th"},{content:"Jazz Musician",tag:"th"},{content:"Release Date",tag:"th"}]}],body:[{cells:[{content:"5.2",tag:"td"},{content:"Jaco Pastorius",tag:"td"},{content:"May 7, 2019",tag:"td"}]},{cells:[{content:"5.1",tag:"td"},{content:"Betty Carter",tag:"td"},{content:"February 21, 2019",tag:"td"}]},{cells:[{content:"5.0",tag:"td"},{content:"Bebo Valdés",tag:"td"},{content:"December 6, 2018",tag:"td"}]}]},viewportWidth:450},transforms:Zn,edit:function({attributes:e,setAttributes:t,isSelected:n}){const{hasFixedLayout:o,head:a,foot:c}=e,[u,p]=(0,l.useState)(2),[d,m]=(0,l.useState)(2),[g,h]=(0,l.useState)(),b=(0,l.useRef)(null),[f,y]=(0,l.useState)(!1);function x(n){g&&t(Hn(e,g,(e=>({...e,content:n}))))}function k(n){if(!g)return;const{sectionName:o,rowIndex:r}=g,l=r+n;t(Ln(e,{sectionName:o,rowIndex:l,columnCount:void 0})),h({sectionName:o,rowIndex:l,columnIndex:0,type:"cell"})}function w(n=0){if(!g)return;const{columnIndex:o,sectionName:r}=g,l=o+n;t(function(e,{columnIndex:t}){const n=Object.fromEntries(Object.entries(e).filter((([e])=>["head","body","foot"].includes(e))));return Object.fromEntries(Object.entries(n).map((([e,n])=>$n(n)?[e,n]:[e,n.map((n=>Rn(n)||n.cells.length{n||h(void 0)}),[n]),(0,l.useEffect)((()=>{f&&(b?.current?.querySelector('td div[contentEditable="true"]')?.focus(),y(!1))}),[f]);const E=["head","body","foot"].filter((t=>!$n(e[t]))),C=[{icon:Bn,title:(0,r.__)("Insert row before"),isDisabled:!g,onClick:function(){k(0)}},{icon:In,title:(0,r.__)("Insert row after"),isDisabled:!g,onClick:function(){k(1)}},{icon:Tn,title:(0,r.__)("Delete row"),isDisabled:!g,onClick:function(){if(!g)return;const{sectionName:n,rowIndex:o}=g;h(void 0),t(function(e,{sectionName:t,rowIndex:n}){return{[t]:e[t].filter(((e,t)=>t!==n))}}(e,{sectionName:n,rowIndex:o}))}},{icon:Mn,title:(0,r.__)("Insert column before"),isDisabled:!g,onClick:function(){w(0)}},{icon:zn,title:(0,r.__)("Insert column after"),isDisabled:!g,onClick:function(){w(1)}},{icon:An,title:(0,r.__)("Delete column"),isDisabled:!g,onClick:function(){if(!g)return;const{columnIndex:n}=g;h(void 0),t(function(e,{columnIndex:t}){const n=Object.fromEntries(Object.entries(e).filter((([e])=>["head","body","foot"].includes(e))));return Object.fromEntries(Object.entries(n).map((([e,n])=>$n(n)?[e,n]:[e,n.map((e=>({cells:e.cells.length>=t?e.cells.filter(((e,n)=>n!==t)):e.cells}))).filter((e=>e.cells.length))])))}(e,{columnIndex:n}))}}],S=R(e),B=v(e),I=B.borderColor,T=V(e).style,M={borderCollapse:"collapse",...B,...T};S||(M.width="100%"),e.hasFixedLayout&&(M.tableLayout="fixed");const z=_(e),A=E.map((t=>{const n={..."head"===t?{borderBottom:`3px solid ${I||"currentcolor"}`}:void 0,..."foot"===t?{borderTop:`3px solid ${I||"currentcolor"}`}:void 0};return(0,l.createElement)(Fn,{name:t,key:t,style:n},e[t].map((({cells:n},o)=>(0,l.createElement)("tr",{key:o},n.map((({content:n,tag:r,scope:a,align:i,colspan:c,rowspan:u},p)=>(0,l.createElement)(r,{key:p,scope:"th"===r?a:void 0,colSpan:c,rowSpan:u,style:{textAlign:i,border:`1px solid ${I||"currentcolor"}`,padding:"0.5em",...e.hasFixedLayout?{wordBreak:"break-word"}:void 0,...z}},(0,l.createElement)(s.RichText,{value:n,onChange:x,onFocus:()=>{h({sectionName:t,rowIndex:o,columnIndex:p,type:"cell"})},"aria-label":On[t],placeholder:jn[t]}))))))))})),N=!E.length,P=(0,s.useBlockProps)({ref:b,className:"noptin-block__margin-wrapper",style:{...Z(e),...T,overflowX:"auto"}});return(0,l.createElement)("div",{...P},!N&&(0,l.createElement)(l.Fragment,null,(0,l.createElement)(s.BlockControls,{group:"block"},(0,l.createElement)(s.AlignmentControl,{label:(0,r.__)("Change column alignment"),alignmentControls:Dn,value:function(){if(g)return function(e,t,n){const{sectionName:o,rowIndex:r,columnIndex:l}=t;return e[o]?.[r]?.cells?.[l]?.align}(e,g)}(),onChange:n=>function(n){if(!g)return;const o={type:"column",columnIndex:g.columnIndex},r=Hn(e,o,(e=>({...e,align:n})));t(r)}(n)})),(0,l.createElement)(s.BlockControls,{group:"other"},(0,l.createElement)(i.ToolbarDropdownMenu,{hasArrowIndicator:!0,icon:Nn,label:(0,r.__)("Edit table"),controls:C}))),(0,l.createElement)(s.InspectorControls,null,(0,l.createElement)(i.PanelBody,{title:(0,r.__)("Settings"),className:"blocks-table-settings"},(0,l.createElement)(i.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Fixed width table cells"),checked:!!o,onChange:function(){t({hasFixedLayout:!o})}}),!N&&(0,l.createElement)(l.Fragment,null,(0,l.createElement)(i.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Header section"),checked:!(!a||!a.length),onChange:function(){t(Vn(e,"head"))}}),(0,l.createElement)(i.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,r.__)("Footer section"),checked:!(!c||!c.length),onChange:function(){t(Vn(e,"foot"))}})))),!N&&(0,l.createElement)("table",{align:S,style:M},A),N&&(0,l.createElement)(i.Placeholder,{label:(0,r.__)("Table"),icon:(0,l.createElement)(s.BlockIcon,{icon:wn,showColors:!0}),instructions:(0,r.__)("Insert a table for sharing data.")},(0,l.createElement)(i.__experimentalHStack,{as:"form",className:"blocks-table__placeholder-form",onSubmit:function(e){e.preventDefault(),t(function({rowCount:e,columnCount:t}){return{body:Array.from({length:e}).map((()=>({cells:Array.from({length:t}).map((()=>({content:"",tag:"td"})))})))}}({rowCount:parseInt(u,10)||2,columnCount:parseInt(d,10)||2})),y(!0)},alignment:"flex-end",style:{flexDirection:"row",alignItems:"flex-end"},spacing:4,wrap:!0},(0,l.createElement)(i.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,r.__)("Column count"),value:d,onChange:function(e){m(e)},min:1,className:"blocks-table__placeholder-input"}),(0,l.createElement)(i.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,r.__)("Row count"),value:u,onChange:function(e){p(e)},min:1,className:"blocks-table__placeholder-input"}),(0,l.createElement)(i.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit"},(0,r.__)("Create Table")))))},save:function({attributes:e}){const{head:t,body:n,foot:o}=e;if(!t.length&&!n.length&&!o.length)return null;const r=R(e),a=v(e),i=a.borderColor,c=V(e).style,u={borderCollapse:"collapse",...a,...c};r||(u.width="100%"),e.hasFixedLayout&&(u.tableLayout="fixed");const p=_(e),d=({type:t,rows:n})=>{if(!n.length)return null;const o=`t${t}`,r={..."head"===t?{borderBottom:`3px solid ${i||"currentcolor"}`}:void 0,..."foot"===t?{borderTop:`3px solid ${i||"currentcolor"}`}:void 0};return(0,l.createElement)(o,{style:r},n.map((({cells:t},n)=>(0,l.createElement)("tr",{key:n},t.map((({content:t,tag:n,scope:o,align:r,colspan:a,rowspan:c},u)=>(0,l.createElement)(s.RichText.Content,{"data-align":r,style:{textAlign:r,border:`1px solid ${i||"currentcolor"}`,padding:"0.5em",...e.hasFixedLayout?{wordBreak:"break-word"}:void 0,...p},tagName:n,value:t,key:u,scope:"th"===n?o:void 0,colSpan:a,rowSpan:c})))))))},m=s.useBlockProps.save({className:"noptin-block__margin-wrapper",style:{...Z.save(e),...c,overflowX:"auto"}});return(0,l.createElement)("div",{...m},(0,l.createElement)("table",{align:r,style:u},(0,l.createElement)(d,{type:"head",rows:t}),(0,l.createElement)(d,{type:"body",rows:n}),(0,l.createElement)(d,{type:"foot",rows:o})))}},Xn=(0,se.jsx)(ie.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,se.jsx)(ie.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z"})}),Qn=(0,se.jsx)(ie.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,se.jsx)(ie.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"})}),Jn=(0,se.jsx)(ie.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,se.jsx)(ie.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})}),eo=window.wp.date;function to(){return to=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?mo(wo,--xo):0,yo--,10===ko&&(yo=1,fo--),ko}function Bo(){return ko=xo2||zo(ko)>3?"":" "}function Lo(e,t){for(;--t&&Bo()&&!(ko<48||ko>102||ko>57&&ko<65||ko>70&&ko<97););return Mo(e,To()+(t<6&&32==Io()&&32==Bo()))}function Vo(e){for(;Bo();)switch(ko){case e:return xo;case 34:case 39:34!==e&&39!==e&&Vo(ko);break;case 40:41===e&&Vo(e);break;case 92:Bo()}return xo}function $o(e,t){for(;Bo()&&e+ko!==57&&(e+ko!==84||47!==Io()););return"/*"+Mo(t,xo-1)+"*"+io(47===e?e:Bo())}function Ro(e){for(;!zo(Io());)Bo();return Mo(e,xo)}var Do="-ms-",Oo="-moz-",jo="-webkit-",Fo="comm",Uo="rule",Wo="decl",Go="@keyframes";function qo(e,t){for(var n="",o=bo(e),r=0;r0&&ho(w)-p&&_o(m>32?Jo(w+";",o,n,p-1):Jo(uo(w," ","")+";",o,n,p-2),s);break;case 59:w+=";";default:if(_o(k=Xo(w,t,n,c,u,r,i,y,v=[],x=[],p),l),123===f)if(0===u)Yo(w,t,k,k,v,l,p,i,x);else switch(99===d&&110===mo(w,3)?100:d){case 100:case 108:case 109:case 115:Yo(e,k,k,o&&_o(Xo(e,k,k,0,0,r,i,y,r,v=[],p),x),r,x,p,i,o?v:x);break;default:Yo(w,k,k,k,[""],x,0,i,x)}}c=u=m=0,h=_=1,y=w="",p=a;break;case 58:p=1+ho(w),m=g;default:if(h<1)if(123==f)--h;else if(125==f&&0==h++&&125==So())continue;switch(w+=io(f),f*h){case 38:_=u>0?1:(w+="\f",-1);break;case 44:i[c++]=(ho(w)-1)*_,_=1;break;case 64:45===Io()&&(w+=Po(Bo())),d=Io(),u=p=ho(y=w+=Ro(To())),f++;break;case 45:45===g&&2==ho(w)&&(h=0)}}return l}function Xo(e,t,n,o,r,l,a,i,s,c,u){for(var p=r-1,d=0===r?l:[""],m=bo(d),g=0,h=0,b=0;g0?d[_]+" "+f:uo(f,/&\f/g,d[_])))&&(s[b++]=y);return Eo(e,t,n,0===r?Uo:i,s,c,u)}function Qo(e,t,n){return Eo(e,t,n,Fo,io(ko),go(e,2,-2),0)}function Jo(e,t,n,o){return Eo(e,t,n,Wo,go(e,0,o),go(e,o+1,-1),o)}var er=function(e,t,n){for(var o=0,r=0;o=r,r=Io(),38===o&&12===r&&(t[n]=1),!zo(r);)Bo();return Mo(e,xo)},tr=new WeakMap,nr=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,o=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||tr.get(n))&&!o){tr.set(e,!0);for(var r=[],l=function(e,t){return No(function(e,t){var n=-1,o=44;do{switch(zo(o)){case 0:38===o&&12===Io()&&(t[n]=1),e[n]+=er(xo-1,t,n);break;case 2:e[n]+=Po(o);break;case 4:if(44===o){e[++n]=58===Io()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=io(o)}}while(o=Bo());return e}(Ao(e),t))}(t,r),a=n.props,i=0,s=0;i6)switch(mo(e,t+1)){case 109:if(45!==mo(e,t+4))break;case 102:return uo(e,/(.+:)(.+)-([^]+)/,"$1"+jo+"$2-$3$1"+Oo+(108==mo(e,t+3)?"$3":"$2-$3"))+e;case 115:return~po(e,"stretch")?rr(uo(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==mo(e,t+1))break;case 6444:switch(mo(e,ho(e)-3-(~po(e,"!important")&&10))){case 107:return uo(e,":",":"+jo)+e;case 101:return uo(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+jo+(45===mo(e,14)?"inline-":"")+"box$3$1"+jo+"$2$3$1"+Do+"$2box$3")+e}break;case 5936:switch(mo(e,t+11)){case 114:return jo+e+Do+uo(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return jo+e+Do+uo(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return jo+e+Do+uo(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return jo+e+Do+e+e}return e}var lr=[function(e,t,n,o){if(e.length>-1&&!e.return)switch(e.type){case Wo:e.return=rr(e.value,e.length);break;case Go:return qo([Co(e,{value:uo(e.value,"@","@"+jo)})],o);case Uo:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return qo([Co(e,{props:[uo(t,/:(read-\w+)/,":-moz-$1")]})],o);case"::placeholder":return qo([Co(e,{props:[uo(t,/:(plac\w+)/,":"+jo+"input-$1")]}),Co(e,{props:[uo(t,/:(plac\w+)/,":-moz-$1")]}),Co(e,{props:[uo(t,/:(plac\w+)/,Do+"input-$1")]})],o)}return""}))}}],ar=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var o,r,l=e.stylisPlugins||lr,a={},i=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n96?kr:wr},Cr=function(e,t,n){var o;if(t){var r=t.shouldForwardProp;o=e.__emotion_forwardProp&&r?function(t){return e.__emotion_forwardProp(t)&&r(t)}:r}return"function"!=typeof o&&n&&(o=e.__emotion_forwardProp),o},Sr=function(e){var t=e.cache,n=e.serialized,o=e.isStringTag;return xr(t,n,o),fr((function(){return function(e,t,n){xr(e,t,n);var o=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var r=t;do{e.insert(t===r?"."+o:"",r,e.sheet,!0),r=r.next}while(void 0!==r)}}(t,n,o)})),null},Br=function e(t,n){var o,r,a=t.__emotion_real===t,i=a&&t.__emotion_base||t;void 0!==n&&(o=n.label,r=n.target);var s=Cr(t,n,a),c=s||Er(i),u=!c("as");return function(){var p=arguments,d=a&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==o&&d.push("label:"+o+";"),null==p[0]||void 0===p[0].raw)d.push.apply(d,p);else{d.push(p[0][0]);for(var m=p.length,g=1;g=4;++o,r-=4)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(r){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(r)+s;return{name:c,styles:r,next:hr}}(d.concat(b),t.registered,_);h+=t.key+"-"+y.name,void 0!==r&&(h+=" "+r);var v=u&&void 0===s?Er(g):c,x={};for(var k in e)u&&"as"===k||v(k)&&(x[k]=e[k]);return x.className=h,x.ref=n,l.createElement(l.Fragment,null,l.createElement(Sr,{cache:t,serialized:y,isStringTag:"string"==typeof g}),l.createElement(g,x))},(0,l.forwardRef)((function(e,t){var n=(0,l.useContext)(yr);return h(e,n,t)})));return b.displayName=void 0!==o?o:"Styled("+("string"==typeof i?i:i.displayName||i.name||"Component")+")",b.defaultProps=t.defaultProps,b.__emotion_real=b,b.__emotion_base=i,b.__emotion_styles=d,b.__emotion_forwardProp=s,Object.defineProperty(b,"toString",{value:function(){return"."+r}}),b.withComponent=function(t,o){return e(t,to({},n,o,{shouldForwardProp:Cr(b,o,!0)})).apply(void 0,d)},b}}.bind();function Ir(e){return(t,n)=>{const o={...t};return"COMMIT"!==n.type&&"PRESS_UP"!==n.type&&"PRESS_DOWN"!==n.type||void 0!==o.value&&(o.value=o.value.toString().padStart(e,"0")),o}}["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){Br[e]=Br(e)}));const Tr=Br.div`