(()=>{"use strict";const e=window.wp.blocks,o=JSON.parse('{"UU":"snow-monkey-blocks/pickup-slider","uK":{"random":{"type":"boolean","default":false},"linkType":{"type":"string","default":"button"},"postsPerPage":{"type":"number","default":0},"anchor":{"type":"string","default":""}}}'),l=window.ReactJSXRuntime,n=(0,l.jsxs)("svg",{viewBox:"0 0 24 24",children:[(0,l.jsx)("path",{d:"M5,5.78V18.22a.78.78,0,0,0,.78.78H18.22a.78.78,0,0,0,.78-.78V5.78A.78.78,0,0,0,18.22,5H5.78A.78.78,0,0,0,5,5.78m12.44,12H6.56a.38.38,0,0,1-.39-.39V6.56a.38.38,0,0,1,.39-.39H17.44a.38.38,0,0,1,.39.39V17.44a.38.38,0,0,1-.39.39"}),(0,l.jsx)("path",{d:"M6.17,14.16l3.06-2.23a.22.22,0,0,1,.22,0l2.34,1.5a.21.21,0,0,0,.24,0l3-2.83a.19.19,0,0,1,.27,0l3.09,3v1.16l-3.09-3a.18.18,0,0,0-.27,0l-3,2.82a.19.19,0,0,1-.24,0L9.45,13.11a.18.18,0,0,0-.22,0L6.17,15.33Z"}),(0,l.jsx)("path",{d:"M2.22,5H0V6.17H1.44a.38.38,0,0,1,.39.39V17.44a.38.38,0,0,1-.39.39H0V19H2.22A.78.78,0,0,0,3,18.22V5.78A.78.78,0,0,0,2.22,5Z"}),(0,l.jsx)("path",{d:"M24,17.83H22.56a.38.38,0,0,1-.39-.39V6.56a.38.38,0,0,1,.39-.39H24V5H21.78a.78.78,0,0,0-.78.78V18.22a.78.78,0,0,0,.78.78H24Z"})]}),a=window.wp.components,s=window.wp.blockEditor,t=window.wp.i18n,r=(window.lodash,window.wp.compose),i=(e,o=0,l=null)=>(e=Number(e),(isNaN(e)||e<o)&&(e=o),null!==l&&e>l&&(e=l),e),d=[{attributes:{...o.uK,myAnchor:{type:"string",default:""}},migrate:e=>(e.anchor=e.myAnchor,e),save:()=>null}];(0,e.registerBlockType)(o.UU,{icon:{foreground:"#cd162c",src:n},edit:function({attributes:e,setAttributes:n}){const{random:d,linkType:p,postsPerPage:c}=e,u=(0,r.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.InspectorControls,{children:(0,l.jsxs)(a.__experimentalToolsPanel,{label:(0,t.__)("Block settings","snow-monkey-blocks"),dropdownMenuProps:u,children:[(0,l.jsx)(a.__experimentalToolsPanelItem,{hasValue:()=>d!==o.uK.random.default,isShownByDefault:!0,label:(0,t.__)("Display in random order","snow-monkey-blocks"),onDeselect:()=>n({random:o.uK.random.default}),children:(0,l.jsx)(a.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,t.__)("Display in random order","snow-monkey-blocks"),checked:d,onChange:e=>n({random:e})})}),(0,l.jsx)(a.__experimentalToolsPanelItem,{hasValue:()=>p!==o.uK.linkType.default,isShownByDefault:!0,label:(0,t.__)("Link type","snow-monkey-blocks"),onDeselect:()=>n({linkType:o.uK.linkType.default}),children:(0,l.jsx)(a.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,t.__)("Link type","snow-monkey-blocks"),value:p,onChange:e=>n({linkType:e}),options:[{value:"button",label:(0,t.__)("Button link","snow-monkey-blocks")},{value:"overall",label:(0,t.__)("Overall link","snow-monkey-blocks")}]})}),(0,l.jsx)(a.__experimentalToolsPanelItem,{hasValue:()=>c!==o.uK.postsPerPage.default,isShownByDefault:!0,label:(0,t.__)("Maximum number of displays","snow-monkey-blocks"),onDeselect:()=>n({postsPerPage:o.uK.postsPerPage.default}),children:(0,l.jsx)(a.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,t.__)("Maximum number of displays","snow-monkey-blocks"),help:(0,t.__)('If "0", all items are displayed.',"snow-monkey-blocks"),value:c,onChange:e=>n({postsPerPage:i(e,0,10)}),min:"0",max:"10"})})]})}),(0,l.jsx)("div",{...(0,s.useBlockProps)(),children:(0,l.jsx)(a.Placeholder,{icon:"format-gallery",label:(0,t.__)("Pickup slider","snow-monkey-blocks"),children:(0,t.__)('Posts with "pickup" tag are displayed as sliders.',"snow-monkey-blocks")})})]})},save:function(){return(0,l.jsx)("div",{"data-dynamic-block":"snow-monkey-blocks/pickup-slider","data-version":"2"})},deprecated:d})})();