!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.blocks,n=window.wp.element,o=window.wp.primitives,i=(0,n.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)(o.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"})),s=window.React,c=window.wp.i18n,l=window.wp.htmlEntities,r=window.wp.blockEditor,d=window.wp.data,a=window.nisje.components,w=window.nisje.icons,m=window.nisje.fullSiteEditing;const v="dekode-event";(0,t.registerBlockType)("nisje/card-event",{icon:i,edit:function(e){let{attributes:t,setAttributes:o}=e;const{postId:i}=t,[p,u]=(0,s.useState)(!1),h=(0,r.useBlockProps)({className:"editor-event-post"}),E=(0,d.useSelect)((e=>0===i?(0,c.__)("Currently showing latest event","nisje"):e("core").getEntityRecord("postType",v,i)?.title.rendered||"..."),[i]),S=0!==i;return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(m.PostSelectorPanel,{hasSelected:S,onOpen:()=>u(!0),onRemove:()=>o({postId:0})}),(0,n.createElement)(a.BaseCard,h,(0,n.createElement)("div",null,(0,n.createElement)(w.Icon,{icon:w.calendar,size:40}),(0,n.createElement)(a.TextDeprecated,{as:"h2",variant:"title-medium"},(0,c.__)("Event","nisje")),(0,n.createElement)(a.TextDeprecated,{as:"p"},(0,l.decodeEntities)(E)))),p&&(0,n.createElement)(m.PostSelector,{onRequestClose:()=>u(!1),onSelect:e=>o({postId:e}),postType:v}))}}),(window.nisje=window.nisje||{}).pluginEventsAdmin=e}();