!function(){"use strict";var e={};(function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e);var t=window.wp.i18n,n=window.wp.blocks,o=window.wp.element,i=window.wp.primitives,r=(0,o.createElement)(i.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(i.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z"})),c=window.React,s=window.wp.htmlEntities,l=window.wp.blockEditor,d=window.wp.data,a=window.nisje.components,w=window.nisje.icons,v=window.nisje.fullSiteEditing;const m="dekode-event";(0,n.registerBlockType)("nisje/card-event",{title:(0,t.__)("Event"),icon:r,edit:function({attributes:e,setAttributes:n}){const{postId:i}=e,[r,p]=(0,c.useState)(!1),u=(0,l.useBlockProps)({className:"editor-event-post"}),h=(0,d.useSelect)((e=>{if(0===i)return(0,t.__)("Currently showing latest event");const n=e("core").getEntityRecord("postType",m,i);return(null==n?void 0:n.title.rendered)||"..."}),[i]),E=0!==i;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(v.PostSelectorPanel,{hasSelected:E,onOpen:()=>p(!0),onRemove:()=>n({postId:0})}),(0,o.createElement)(a.BaseCard,u,(0,o.createElement)("div",null,(0,o.createElement)(w.Icon,{icon:w.calendar,size:40}),(0,o.createElement)(a.TextDeprecated,{as:"h2",variant:"title-medium"},(0,t.__)("Event")),(0,o.createElement)(a.TextDeprecated,{as:"p"},(0,s.decodeEntities)(h)))),r&&(0,o.createElement)(v.PostSelector,{onRequestClose:()=>p(!1),onSelect:e=>n({postId:e}),postType:m}))}}),(window.nisje=window.nisje||{}).pluginEventsAdmin=e}();