!function(){"use strict";var e,t={835:function(){var e=window.React,t=window.wp.blocks,n=window.wp.blockEditor,l=window.wp.i18n,o=window.wp.components,r=window.wp.element;const i=(e,t,n)=>{let l=[...wp.data.select("core/block-editor").getBlock(e.clientId).innerBlocks];const o=n>t,r=0===n;if(1===t&&t===n)1!==l.length&&(l=[wp.blocks.createBlock("purdue/photo-essay-column")],wp.data.dispatch("core/block-editor").replaceInnerBlocks(e.clientId,l,!1));else if(o&&!r){const o=n-t;for(let e=0;e<o;e++){const e=wp.blocks.createBlock("purdue/photo-essay-column");l.push(e)}wp.data.dispatch("core/block-editor").replaceInnerBlocks(e.clientId,l,!1)}else if(!o&&!r){const o=t-n;l=l.slice(0,l.length-o),wp.data.dispatch("core/block-editor").replaceInnerBlocks(e.clientId,l,!1)}};var a=JSON.parse('{"UU":"purdue/photo-essay"}');(0,t.registerBlockType)(a.UU,{edit:function(t,a){return(0,r.useEffect)(()=>{1===t.attributes.numColumns&&i(t,1,1)},[]),(0,r.useEffect)(()=>{t.attributes.blockId||t.setAttributes({blockId:t.clientId})},[]),(0,r.useEffect)(()=>{const{updateBlockAttributes:e}=wp.data.dispatch("core/block-editor"),{getBlockOrder:n}=wp.data.select("core/block-editor"),l=n(t.clientId);console.log("Sibling IDs:",l);const o=l[0],r=l[1];r&&o&&("left"===t.attributes.alignContent?(e(o,{alignment:"is-left"}),e(r,{alignment:"is-fullheight"})):"right"===t.attributes.alignContent&&(e(r,{alignment:"is-right"}),e(o,{alignment:"is-fullheight"})),"2by3"!==t.attributes.blockAttributes&&(e(o,{alignment:""}),e(r,{alignment:""})))},[t.attributes.alignContent,t.attributes.blockAttributes]),[(0,e.createElement)(n.InspectorControls,null,(0,e.createElement)(o.PanelBody,null,(0,e.createElement)(o.PanelRow,null,(0,e.createElement)(o.RangeControl,{className:"bulma-columns-range-control",label:"Number of Columns",value:t.attributes.numColumns||1,min:1,max:4,onChange:e=>{i(t,t.attributes.numColumns,e),t.setAttributes({numColumns:e})}}))),2===t.attributes.numColumns&&(0,e.createElement)(o.PanelBody,{title:(0,l.__)("Row Settings","photo-essay"),initialOpen:!0},(0,e.createElement)(o.PanelRow,null,(0,e.createElement)(o.CheckboxControl,{label:(0,l.__)("Add additional image to second column?","photo-essay"),checked:"2by3"===t.attributes.blockAttributes,onChange:e=>{let n=e?"2by3":"";t.setAttributes({blockAttributes:n})}})),"2by3"===t.attributes.blockAttributes&&(0,e.createElement)(o.PanelRow,null,(0,e.createElement)(o.SelectControl,{label:"Align Content",value:t.attributes.alignContent,options:[{value:"",label:"Select Alignment"},{value:"left",label:"Left"},{value:"right",label:"Right"}],onChange:e=>{t.setAttributes({alignContent:e})}}))),4===t.attributes.numColumns&&(0,e.createElement)(o.PanelBody,{title:(0,l.__)("Row Settings","photo-essay"),initialOpen:!0},(0,e.createElement)(o.PanelRow,null,(0,e.createElement)(o.CheckboxControl,{label:(0,l.__)("Make row full width?","photo-essay"),checked:"full-width"===t.attributes.blockAttributes,onChange:e=>{let n=e?"full-width":"";t.setAttributes({blockAttributes:n})}})))),(0,e.createElement)("div",{id:`key-${t.attributes.blockId}`,className:"photo-essay-blocks-editor-columns"},(0,e.createElement)(n.InnerBlocks,{templateLock:"all"}))]},save:()=>(0,e.createElement)(n.InnerBlocks.Content,null)})}},n={};function l(e){var o=n[e];if(void 0!==o)return o.exports;var r=n[e]={exports:{}};return t[e](r,r.exports,l),r.exports}l.m=t,e=[],l.O=function(t,n,o,r){if(!n){var i=1/0;for(u=0;u<e.length;u++){n=e[u][0],o=e[u][1],r=e[u][2];for(var a=!0,c=0;c<n.length;c++)(!1&r||i>=r)&&Object.keys(l.O).every(function(e){return l.O[e](n[c])})?n.splice(c--,1):(a=!1,r<i&&(i=r));if(a){e.splice(u--,1);var s=o();void 0!==s&&(t=s)}}return t}r=r||0;for(var u=e.length;u>0&&e[u-1][2]>r;u--)e[u]=e[u-1];e[u]=[n,o,r]},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={287:0,463:0};l.O.j=function(t){return 0===e[t]};var t=function(t,n){var o,r,i=n[0],a=n[1],c=n[2],s=0;if(i.some(function(t){return 0!==e[t]})){for(o in a)l.o(a,o)&&(l.m[o]=a[o]);if(c)var u=c(l)}for(t&&t(n);s<i.length;s++)r=i[s],l.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return l.O(u)},n=self.webpackChunkpurdue_home_theme_child=self.webpackChunkpurdue_home_theme_child||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var o=l.O(void 0,[463],function(){return l(835)});o=l.O(o)}();