(()=>{"use strict";const e=window.wp.components,t=window.wp.data,d=window.wp.plugins,s=window.wp.editPost,a=window.wp.compose,n=window.wp.i18n,o=window.ReactJSXRuntime,i=(0,a.compose)([(0,t.withSelect)((e=>{const{getCurrentPostType:t,getEditedPostAttribute:d}=e("core/editor");return{meta:d("meta"),postType:t()}})),(0,t.withDispatch)((e=>{const{editPost:t}=e("core/editor");return{updateMetaValue:(e,d)=>t({meta:{[e]:d}})}}))])((({meta:t,postType:d,updateMetaValue:a})=>{if(!t)return null;const{newspack_hide_page_title:i,newspack_hide_updated_date:_,newspack_show_updated_date:p,newspack_show_share_buttons:h}=t,{hide_date:w=[],show_date:c=[],hide_title:l=[],show_share_buttons:r=[]}=window.newspack_post_meta_post_types,u=0<=w.indexOf(d),g=0<=c.indexOf(d),k=0<=l.indexOf(d),m=0<=r.indexOf(d);return u||g||k||m?(0,o.jsxs)(s.PluginPostStatusInfo,{className:"newspack__post-meta-toggles",children:[u&&"post"===d&&(0,o.jsxs)("div",{children:[(0,o.jsx)("label",{htmlFor:"hide_updated_date",children:(0,n.__)("Hide last updated date","newspack")}),(0,o.jsx)(e.FormToggle,{checked:_,onChange:()=>a("newspack_hide_updated_date",!_),id:"hide_updated_date"})]}),g&&"post"===d&&(0,o.jsxs)("div",{children:[(0,o.jsx)("label",{htmlFor:"show_updated_date",children:(0,n.__)("Show last updated date","newspack")}),(0,o.jsx)(e.FormToggle,{checked:p,onChange:()=>a("newspack_show_updated_date",!p),id:"show_updated_date"})]}),k&&"page"===d&&(0,o.jsxs)("div",{children:[(0,o.jsx)("label",{htmlFor:"hide_page_title",children:(0,n.__)("Hide page title","newspack")}),(0,o.jsx)(e.FormToggle,{checked:i,onChange:()=>a("newspack_hide_page_title",!i),id:"hide_page_title"})]}),m&&"page"===d&&(0,o.jsxs)("div",{children:[(0,o.jsx)("label",{htmlFor:"newspack_show_share_buttons",children:(0,n.__)("Show Jetpack share buttons","newspack")}),(0,o.jsx)(e.FormToggle,{checked:h,onChange:()=>a("newspack_show_share_buttons",!h),id:"hide_page_title"})]})]}):null}));(0,d.registerPlugin)("post-status-sidebar",{render:i})})();