!function(){"use strict";var e,t={165:function(){var e=window.wp.blocks;function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l])}return e},t.apply(this,arguments)}var n=window.wp.element,l=window.wp.i18n,a=window.wp.blockEditor,r=window.wp.components;const o=["image"];var i=JSON.parse('{"u2":"btb/full-width-section"}');(0,e.registerBlockType)(i.u2,{edit:function(e){let{attributes:i,setAttributes:c}=e;const{bgImageId:u,bgImage:d,bgImageParalax:s,bgImageOverlay:g}=i,b=(0,n.createElement)("p",null,(0,l.__)("To edit the background image, you need permission to upload media.","btb-full-width-section")),m={};let f="alignfull";d&&d.url&&(m.backgroundImage=`url(${d.url})`,f+=" with-background-image"),d&&s&&(m.backgroundAttachment="fixed"),d&&g&&(f+=" with-overlay");const p=e=>{c({bgImageId:e.id,bgImage:e})};return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(a.InspectorControls,{key:"setting"},(0,n.createElement)(r.PanelBody,{title:(0,l.__)("Background Image","btb-full-width-section"),initialOpen:!0},(0,n.createElement)(r.PanelRow,{className:"wp-block-btb-full-width-section-example-image"},(0,n.createElement)(a.MediaUploadCheck,{fallback:b},(0,n.createElement)(a.MediaUpload,{title:(0,l.__)("Background image","btb-full-width-section"),onSelect:p,allowedTypes:o,value:u,render:e=>{let{open:t}=e;return(0,n.createElement)(r.Button,{className:u?"editor-post-featured-image__preview":"editor-post-featured-image__toggle",onClick:t},!u&&(0,l.__)("Set background image","btb-full-width-section"),!!u&&!d&&(0,n.createElement)(r.Spinner,null),!!u&&d&&(0,n.createElement)(r.ResponsiveWrapper,{naturalWidth:d.width,naturalHeight:d.height},(0,n.createElement)("img",{src:d.url,alt:(0,l.__)("Background image","btb-full-width-section")})))}})),!!u&&d&&(0,n.createElement)(a.MediaUploadCheck,null,(0,n.createElement)(a.MediaUpload,{title:(0,l.__)("Background image","btb-full-width-section"),onSelect:p,allowedTypes:o,value:u,render:e=>{let{open:t}=e;return(0,n.createElement)(r.Button,{onClick:t,isDefault:!0},(0,l.__)("Replace background image","btb-full-width-section"))}})),!!u&&(0,n.createElement)(a.MediaUploadCheck,null,(0,n.createElement)(r.Button,{onClick:()=>{c({bgImageId:void 0,bgImage:void 0})},isLink:!0,isDestructive:!0},(0,l.__)("Remove background image","btb-full-width-section")))),!!u&&(0,n.createElement)(r.PanelRow,null,(0,n.createElement)(r.ToggleControl,{label:(0,l.__)("Paralax","btb-full-width-section"),help:s?(0,l.__)("Has fixed background.","btb-full-width-section"):(0,l.__)("No fixed background.","btb-full-width-section"),checked:s,onChange:e=>{c({bgImageParalax:e})}})),!!u&&(0,n.createElement)(r.PanelRow,null,(0,n.createElement)(r.ToggleControl,{label:(0,l.__)("Image Overlay","btb-full-width-section"),help:g?(0,l.__)("Has overlay.","btb-full-width-section"):(0,l.__)("No overlay.","btb-full-width-section"),checked:g,onChange:e=>{c({bgImageOverlay:e})}})))),(0,n.createElement)("div",t({},(0,a.useBlockProps)({className:f}),{style:m}),(0,n.createElement)(a.InnerBlocks,null)))},save:function(e){let{attributes:l}=e;const{bgImage:r,bgImageParalax:o,bgImageOverlay:i}=l,c={};let u="alignfull";return r&&r.url&&(c.backgroundImage=`url(${r.url})`,u+=" with-background-image"),r&&o&&(c.backgroundAttachment="fixed"),r&&i&&(u+=" with-overlay"),(0,n.createElement)("div",t({},a.useBlockProps.save({className:u}),{style:c}),(0,n.createElement)(a.InnerBlocks.Content,null))}})}},n={};function l(e){var a=n[e];if(void 0!==a)return a.exports;var r=n[e]={exports:{}};return t[e](r,r.exports,l),r.exports}l.m=t,e=[],l.O=function(t,n,a,r){if(!n){var o=1/0;for(d=0;d<e.length;d++){n=e[d][0],a=e[d][1],r=e[d][2];for(var i=!0,c=0;c<n.length;c++)(!1&r||o>=r)&&Object.keys(l.O).every((function(e){return l.O[e](n[c])}))?n.splice(c--,1):(i=!1,r<o&&(o=r));if(i){e.splice(d--,1);var u=a();void 0!==u&&(t=u)}}return t}r=r||0;for(var d=e.length;d>0&&e[d-1][2]>r;d--)e[d]=e[d-1];e[d]=[n,a,r]},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={826:0,431:0};l.O.j=function(t){return 0===e[t]};var t=function(t,n){var a,r,o=n[0],i=n[1],c=n[2],u=0;if(o.some((function(t){return 0!==e[t]}))){for(a in i)l.o(i,a)&&(l.m[a]=i[a]);if(c)var d=c(l)}for(t&&t(n);u<o.length;u++)r=o[u],l.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return l.O(d)},n=self.webpackChunkbtb_full_width_section=self.webpackChunkbtb_full_width_section||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var a=l.O(void 0,[431],(function(){return l(165)}));a=l.O(a)}();