(()=>{"use strict";var e,t={798:()=>{const e=window.wp.blocks,t=window.wp.i18n,o=window.wp.blockEditor,n=(window.wp.hooks,window.wp.components),r=window.wp.element,i=window.wp.data,c=window.ReactJSXRuntime,s=JSON.parse('{"UU":"lcp/viewport"}');(0,e.registerBlockType)(s.UU,{edit:function({attributes:s,setAttributes:l,clientId:a}){const{hasSidecontent:p,headerContainerStickyType:d}=s,[u,h]=(0,r.useState)(!1),[w,v]=(0,r.useState)(!1),[k,f]=(0,r.useState)(!1),[b,x]=(0,r.useState)(null),y=(0,o.useBlockProps)({className:p?"has-sidecontent":""}),j=[p?["lcp/sidecontent"]:null,["lcp/header-container"],["lcp/main-area"],["lcp/footer-container"]].filter(Boolean);(0,r.useEffect)((()=>{if(p){const t=(0,e.createBlock)("lcp/sidecontent",{});wp.data.dispatch("core/block-editor").insertBlocks(t,1,a)}}),[p,a]);const m=(0,i.useSelect)((e=>e("core/block-editor").getBlocks(a)),[a]);return(0,r.useEffect)((()=>{const e=m.find((e=>"lcp/header-container"===e.name));m.find((e=>"lcp/header-sidecontent"===e.name)),e&&e.attributes&&void 0!==e.attributes.sticky&&l({headerContainerStickyType:e.attributes.sticky})}),[m,a,l]),(0,c.jsxs)("div",{...y,children:[(0,c.jsx)(o.InspectorControls,{children:(0,c.jsx)(n.ToggleControl,{label:(0,t.__)("Include Side Content","lcp-viewport"),checked:p,onChange:e=>l({hasSidecontent:e})})}),(0,c.jsx)("div",{id:"lcp-viewport-outer",children:(0,c.jsx)("div",{id:"lcp-viewport-inner",children:(0,c.jsx)(o.InnerBlocks,{renderAppender:()=>(0,c.jsx)(o.InnerBlocks.ButtonBlockAppender,{}),template:j})})}),u&&!w&&(0,c.jsxs)(n.Modal,{title:(0,t.__)("Block Outside Viewport","lcp-viewport"),onRequestClose:closePopup,className:"block-outside-popup",children:[(0,c.jsx)("p",{children:(0,t.__)("You added a block outside of the lcp/viewport container. Please make sure the block is inside the appropriate area.","lcp-viewport")}),(0,c.jsx)(n.Button,{isPrimary:!0,onClick:closePopup,children:(0,t.__)("Close","lcp-viewport")}),(0,c.jsx)(n.Button,{isSecondary:!0,onClick:ignorePopup,children:(0,t.__)("Ignore","lcp-viewport")})]})]})},save:function({attributes:e}){const{hasSidecontent:t,headerContainerStickyType:n}=e;o.useBlockProps.save();let r="";return t&&(r+="lcp-has-sidecontent "),"always"===n?r+="lcp-has-sticky-header ":"onScroll"===n&&(r+="lcp-has-sticky-on-scroll-header "),(0,c.jsx)("div",{className:r,id:"lcp-viewport-outer",children:(0,c.jsx)("div",{id:"lcp-viewport-inner",className:r,children:(0,c.jsx)(o.InnerBlocks.Content,{})})})}})}},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.m=t,e=[],n.O=(t,o,r,i)=>{if(!o){var c=1/0;for(p=0;p<e.length;p++){o=e[p][0],r=e[p][1],i=e[p][2];for(var s=!0,l=0;l<o.length;l++)(!1&i||c>=i)&&Object.keys(n.O).every((e=>n.O[e](o[l])))?o.splice(l--,1):(s=!1,i<c&&(c=i));if(s){e.splice(p--,1);var a=r();void 0!==a&&(t=a)}}return t}i=i||0;for(var p=e.length;p>0&&e[p-1][2]>i;p--)e[p]=e[p-1];e[p]=[o,r,i]},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={57:0,350:0};n.O.j=t=>0===e[t];var t=(t,o)=>{var r,i,c=o[0],s=o[1],l=o[2],a=0;if(c.some((t=>0!==e[t]))){for(r in s)n.o(s,r)&&(n.m[r]=s[r]);if(l)var p=l(n)}for(t&&t(o);a<c.length;a++)i=c[a],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return n.O(p)},o=self.webpackChunklcp_viewport=self.webpackChunklcp_viewport||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var r=n.O(void 0,[350],(()=>n(798)));r=n.O(r)})();