!function(){"use strict";var e,t={657:function(){var e=window.wp.blocks,t=window.React,s=window.wp.i18n,i=window.wp.components,l=window.wp.blockEditor,n=window.wp.element,o=window.wp.data,r=JSON.parse('{"apiVersion":2,"name":"purdue/photo-essay-column","title":"Photo Essay - Column","category":"purdue","icon":"welcome-add-page","description":"Column block for the Photo Essay block.","parent":["purdue/photo-essay"],"attributes":{"sizeWide":{"type":"string","default":""},"sizeDesk":{"type":"string","default":""},"sizeTab":{"type":"string","default":""},"sizeMo":{"type":"string","default":""},"size":{"type":"string","default":""},"useExact":{"type":"boolean","default":false},"bgColor":{"type":"string","default":""},"blockId":{"type":"string","default":""},"columnClass":{"type":"string","default":""},"is2by3":{"type":"boolean","default":false},"alignment":{"type":"string","default":""}},"supports":{"className":true,"inserter":false},"usesContext":["purdue/numColumns","purdue/blockAttributes","purdue/alignContent"],"editorScript":"file:./index.js","editorStyle":"file:./editor.scss","style":"file:./style.scss"}');(0,e.registerBlockType)(r,{edit:function(e,r){const{context:u}=e,c=(0,l.useBlockProps)(),a=e.clientId&&wp.data.select("core/block-editor").getBlock(e.clientId).innerBlocks,d=(0,o.select)("core/block-editor").getBlock(e.clientId)?.innerBlocks||[],p=d[0];(0,n.useEffect)(()=>{let t="2by3"===u["purdue/blockAttributes"];e.setAttributes({is2by3:t})},[u]),(0,n.useEffect)(()=>{e.attributes.blockId||e.setAttributes({blockId:e.clientId})},[]),(0,n.useEffect)(()=>{let t="",s=!1;if(u["purdue/blockAttributes"]&&(s="2by3"===u["purdue/blockAttributes"],e.setAttributes({is2by3:s})),u["purdue/numColumns"]){let s=u["purdue/numColumns"];t=1===s?" is-12-desktop is-12-widescreen is-12-fullhd is-12-mobile":3===s?" is-4-desktop is-4-widescreen is-4-fullhd is-6-tablet is-6-mobile":" is-6-desktop is-6-widescreen is-6-fullhd is-6-tablet is-6-mobile",u["purdue/blockAttributes"]&&"full-width"===u["purdue/blockAttributes"]&&(t=" is-3-desktop is-3-widescreen is-3-fullhd is-6-tablet is-6-mobile"),e.setAttributes({columnClass:t})}},[u]);let b=0;return(0,n.useEffect)(()=>{if(d){const e=d.length;b=e}},[d]),(0,t.createElement)("div",{...c,id:`block-${e.attributes.blockId}`,className:`bulma-blocks-editor-column column ${e.attributes.columnClass} ${e.attributes.alignment}`},(0,t.createElement)(l.InnerBlocks,{templateLock:!1,allowedBlocks:["core/image"],template:[["core/image",{url:"https://marcom.purdue.edu/app/uploads/2021/09/cropped-cropped-DW540158-HDR.jpg"}]],renderAppender:()=>{const{alignment:s,is2by3:i}=e.attributes;return a.length<2&&!0===i&&("is-left"===s||"is-right"===s)?(0,t.createElement)(l.InnerBlocks.ButtonBlockAppender,null):null}}),p&&!1===e.attributes.is2by3&&(0,t.createElement)("div",{className:"replace-image-button",style:{marginTop:"1rem"}},(0,t.createElement)(l.MediaUpload,{onSelect:e=>{p&&(0,o.dispatch)("core/block-editor").updateBlockAttributes(p.clientId,{url:e.url,alt:e.alt,id:e.id})},allowedTypes:["image"],render:({open:e})=>(0,t.createElement)(i.Button,{onClick:e,variant:"secondary"},(0,s.__)("Replace Image","my-block"))})))},save:function(e){const{sizeWide:s,sizeDesk:i,sizeTab:n,sizeMo:o,size:r,useExact:u,bgColor:c,columnClass:a,alignment:d}=e.attributes,p=["column",u?[o,n,i,s].join(" "):r,""!==c?c:"",""!==a?a:"",""!==d?d:""].join(" ");return(0,t.createElement)("div",{className:p},(0,t.createElement)(l.InnerBlocks.Content,null))}})}},s={};function i(e){var l=s[e];if(void 0!==l)return l.exports;var n=s[e]={exports:{}};return t[e](n,n.exports,i),n.exports}i.m=t,e=[],i.O=function(t,s,l,n){if(!s){var o=1/0;for(a=0;a<e.length;a++){s=e[a][0],l=e[a][1],n=e[a][2];for(var r=!0,u=0;u<s.length;u++)(!1&n||o>=n)&&Object.keys(i.O).every(function(e){return i.O[e](s[u])})?s.splice(u--,1):(r=!1,n<o&&(o=n));if(r){e.splice(a--,1);var c=l();void 0!==c&&(t=c)}}return t}n=n||0;for(var a=e.length;a>0&&e[a-1][2]>n;a--)e[a]=e[a-1];e[a]=[s,l,n]},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={9:0,325:0};i.O.j=function(t){return 0===e[t]};var t=function(t,s){var l,n,o=s[0],r=s[1],u=s[2],c=0;if(o.some(function(t){return 0!==e[t]})){for(l in r)i.o(r,l)&&(i.m[l]=r[l]);if(u)var a=u(i)}for(t&&t(s);c<o.length;c++)n=o[c],i.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return i.O(a)},s=self.webpackChunkpurdue_home_theme_child=self.webpackChunkpurdue_home_theme_child||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))}();var l=i.O(void 0,[325],function(){return i(657)});l=i.O(l)}();