!function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var r={};t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=(r.n(n),r(2)),l=(r.n(o),function(){function e(e,t){var r=[],n=!0,o=!1,l=void 0;try{for(var i,a=e[Symbol.iterator]();!(n=(i=a.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,l=e}finally{try{!n&&a.return&&a.return()}finally{if(o)throw l}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()),i=wp.i18n.__,a=wp.blocks.registerBlockType,u=wp.components,c=u.SelectControl,s=u.PanelRow,p=wp.editor.InspectorControls;a("rttpg/post-grid",{title:i("Post Grid","the-post-grid"),icon:"grid-view",category:"common",keywords:[i("Post Grid","the-post-grid"),i("post-grid","the-post-grid")],attributes:{gridId:{type:"number",default:0}},edit:function(e){var t=e.attributes.gridId,r=e.setAttributes,n="",o=[{value:0,label:i("Select one","the-post-grid")}];if(rttpgGB.short_codes){var a=!0,u=!1,d=void 0;try{for(var f,m=Object.entries(rttpgGB.short_codes)[Symbol.iterator]();!(a=(f=m.next()).done);a=!0){var g=f.value,b=l(g,2),w=b[0],v=b[1];o.push({value:w,label:v}),t&&Number(w)===t&&(n=v)}}catch(e){u=!0,d=e}finally{try{!a&&m.return&&m.return()}finally{if(u)throw d}}}return[wp.element.createElement(p,null,"This text will show when the box is selected",wp.element.createElement(s,null,wp.element.createElement(c,{label:i("Select a grid:"),options:o,value:t,onChange:function(e){return r({gridId:Number(e)})}}))),wp.element.createElement("div",{className:e.className},t?wp.element.createElement("div",null,wp.element.createElement("span",null,wp.element.createElement("img",{src:rttpgGB.icon}))," ",wp.element.createElement("span",null,i("Post Grid","the-post-grid")," ( ",n," )")):wp.element.createElement("p",null,"Please select a shortcode from block settings"))]},save:function(e){e.attributes.gridId;return null}})},function(e,t){},function(e,t){}]);