/*! This file is auto-generated */ (()=>{var e={5755:(e,t)=>{var o; /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";o.r(n),o.d(n,{PluginBlockSettingsMenuItem:()=>Er,PluginDocumentSettingPanel:()=>Sn,PluginMoreMenuItem:()=>_r,PluginPostPublishPanel:()=>Gn,PluginPostStatusInfo:()=>mn,PluginPrePublishPanel:()=>$n,PluginSidebar:()=>Pn,PluginSidebarMoreMenuItem:()=>vr,__experimentalFullscreenModeClose:()=>Bo,__experimentalMainDashboardButton:()=>zo,__experimentalPluginPostExcerpt:()=>yr,initializeEditor:()=>fr,reinitializeEditor:()=>wr,store:()=>ro});var e={};o.r(e),o.d(e,{closeModal:()=>Y,disableComplementaryArea:()=>H,enableComplementaryArea:()=>z,openModal:()=>Q,pinItem:()=>U,setDefaultComplementaryArea:()=>G,setFeatureDefaults:()=>j,setFeatureValue:()=>q,toggleFeature:()=>W,unpinItem:()=>$});var t={};o.r(t),o.d(t,{getActiveComplementaryArea:()=>Z,isComplementaryAreaLoading:()=>X,isFeatureActive:()=>J,isItemPinned:()=>K,isModalActive:()=>ee});var r={};o.r(r),o.d(r,{__experimentalSetPreviewDeviceType:()=>ht,__unstableCreateTemplate:()=>vt,closeGeneralSidebar:()=>Ze,closeModal:()=>Ke,closePublishSidebar:()=>et,hideBlockTypes:()=>dt,initializeMetaBoxes:()=>ft,metaBoxUpdatesFailure:()=>gt,metaBoxUpdatesSuccess:()=>pt,openGeneralSidebar:()=>Ye,openModal:()=>Xe,openPublishSidebar:()=>Je,removeEditorPanel:()=>rt,requestMetaBoxUpdates:()=>mt,setAvailableMetaBoxesPerLocation:()=>ut,setIsEditingTemplate:()=>_t,setIsInserterOpened:()=>bt,setIsListViewOpened:()=>Et,showBlockTypes:()=>ct,switchEditorMode:()=>at,toggleDistractionFree:()=>wt,toggleEditorPanelEnabled:()=>ot,toggleEditorPanelOpened:()=>nt,toggleFeature:()=>st,togglePinnedPluginItem:()=>it,togglePublishSidebar:()=>tt,updatePreferredStyleVariations:()=>lt});var s={};o.r(s),o.d(s,{__experimentalGetInsertionPoint:()=>Kt,__experimentalGetPreviewDeviceType:()=>Zt,areMetaBoxesInitialized:()=>to,getActiveGeneralSidebarName:()=>It,getActiveMetaBoxLocations:()=>Ut,getAllMetaBoxes:()=>jt,getEditedPostTemplate:()=>oo,getEditorMode:()=>Tt,getHiddenBlockTypes:()=>Ft,getMetaBoxesPerLocation:()=>qt,getPreference:()=>Lt,getPreferences:()=>Nt,hasMetaBoxes:()=>Qt,isEditingTemplate:()=>eo,isEditorPanelEnabled:()=>Ot,isEditorPanelOpened:()=>Vt,isEditorPanelRemoved:()=>Rt,isEditorSidebarOpened:()=>Bt,isFeatureActive:()=>zt,isInserterOpened:()=>Xt,isListViewOpened:()=>Jt,isMetaBoxLocationActive:()=>Wt,isMetaBoxLocationVisible:()=>$t,isModalActive:()=>Gt,isPluginItemPinned:()=>Ht,isPluginSidebarOpened:()=>At,isPublishSidebarOpened:()=>Dt,isSavingMetaBoxes:()=>Yt});const a=window.React,i=window.wp.blocks,l=window.wp.blockLibrary,c=window.wp.deprecated;var d=o.n(c);const u=window.wp.element,m=window.wp.data,p=window.wp.hooks,g=window.wp.preferences,h=window.wp.widgets,b=window.wp.editor,E=window.wp.mediaUtils;(0,p.addFilter)("editor.MediaUpload","core/edit-post/replace-media-upload",(()=>E.MediaUpload));const _=window.wp.components,v=window.wp.blockEditor,y=window.wp.i18n,f=window.wp.compose;function w(e,t){if(Array.isArray(e)&&e.length)for(const o of e){if(o.name===t)return o;const e=w(o.innerBlocks,t);if(e)return e}}const S=(0,f.compose)((0,m.withSelect)(((e,t)=>{if((0,i.hasBlockSupport)(t.name,"multiple",!0))return{};const o=w(e(v.store).getBlocks(),t.name);return{originalBlockClientId:o&&o.clientId!==t.clientId&&o.clientId}})),(0,m.withDispatch)(((e,{originalBlockClientId:t})=>({selectFirst:()=>e(v.store).selectBlock(t)})))),P=(0,f.createHigherOrderComponent)((e=>S((({originalBlockClientId:t,selectFirst:o,...n})=>{if(!t)return(0,a.createElement)(e,{...n});const r=(0,i.getBlockType)(n.name),s=function(e){const t=(0,i.findTransform)((0,i.getBlockTransforms)("to",e),(({type:e,blocks:t})=>"block"===e&&1===t.length));if(!t)return null;return(0,i.getBlockType)(t.blocks[0])}(n.name);return[(0,a.createElement)("div",{key:"invalid-preview",style:{minHeight:"60px"}},(0,a.createElement)(e,{key:"block-edit",...n})),(0,a.createElement)(v.Warning,{key:"multiple-use-warning",actions:[(0,a.createElement)(_.Button,{key:"find-original",variant:"secondary",onClick:o},(0,y.__)("Find original")),(0,a.createElement)(_.Button,{key:"remove",variant:"secondary",onClick:()=>n.onReplace([])},(0,y.__)("Remove")),s&&(0,a.createElement)(_.Button,{key:"transform",variant:"secondary",onClick:()=>n.onReplace((0,i.createBlock)(s.name,n.attributes))},(0,y.__)("Transform into:")," ",s.title)]},(0,a.createElement)("strong",null,r?.title,": "),(0,y.__)("This block can only be used once."))]}))),"withMultipleValidation");(0,p.addFilter)("editor.BlockEdit","core/edit-post/validate-multiple-use/with-multiple-validation",P);const k=window.wp.coreData,C=window.wp.primitives,M=(0,a.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(C.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})),x=window.wp.plugins,T=window.wp.url,B=window.wp.notices;function A(){const{createNotice:e}=(0,m.useDispatch)(B.store),{getEditedPostAttribute:t}=(0,m.useSelect)(b.store);const o=(0,f.useCopyToClipboard)((function(){return t("content")}),(function(){e("info",(0,y.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,a.createElement)(_.MenuItem,{ref:o},(0,y.__)("Copy all blocks"))}const I=window.wp.keycodes;var N=o(5755),L=o.n(N);const F=(0,a.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(C.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),D=(0,a.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(C.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"})),R=(0,a.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(C.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})),O=window.wp.viewport,V=(0,a.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(C.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})),G=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),z=(e,t)=>({registry:o,dispatch:n})=>{if(!t)return;o.select(g.store).get(e,"isComplementaryAreaVisible")||o.dispatch(g.store).set(e,"isComplementaryAreaVisible",!0),n({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},H=e=>({registry:t})=>{t.select(g.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(g.store).set(e,"isComplementaryAreaVisible",!1)},U=(e,t)=>({registry:o})=>{if(!t)return;const n=o.select(g.store).get(e,"pinnedItems");!0!==n?.[t]&&o.dispatch(g.store).set(e,"pinnedItems",{...n,[t]:!0})},$=(e,t)=>({registry:o})=>{if(!t)return;const n=o.select(g.store).get(e,"pinnedItems");o.dispatch(g.store).set(e,"pinnedItems",{...n,[t]:!1})};function W(e,t){return function({registry:o}){d()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),o.dispatch(g.store).toggle(e,t)}}function q(e,t,o){return function({registry:n}){d()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),n.dispatch(g.store).set(e,t,!!o)}}function j(e,t){return function({registry:o}){d()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),o.dispatch(g.store).setDefaults(e,t)}}function Q(e){return{type:"OPEN_MODAL",name:e}}function Y(){return{type:"CLOSE_MODAL"}}const Z=(0,m.createRegistrySelector)((e=>(t,o)=>{const n=e(g.store).get(o,"isComplementaryAreaVisible");if(void 0!==n)return!1===n?null:t?.complementaryAreas?.[o]})),X=(0,m.createRegistrySelector)((e=>(t,o)=>{const n=e(g.store).get(o,"isComplementaryAreaVisible"),r=t?.complementaryAreas?.[o];return n&&void 0===r})),K=(0,m.createRegistrySelector)((e=>(t,o,n)=>{var r;const s=e(g.store).get(o,"pinnedItems");return null===(r=s?.[n])||void 0===r||r})),J=(0,m.createRegistrySelector)((e=>(t,o,n)=>(d()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(g.store).get(o,n))));function ee(e,t){return e.activeModal===t}const te=(0,m.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:o,area:n}=t;return e[o]?e:{...e,[o]:n}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:o,area:n}=t;return{...e,[o]:n}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}}),oe=(0,m.createReduxStore)("core/interface",{reducer:te,actions:e,selectors:t});(0,m.register)(oe);const ne=(0,x.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));const re=ne((function({as:e=_.Button,scope:t,identifier:o,icon:n,selectedIcon:r,name:s,...i}){const l=e,c=(0,m.useSelect)((e=>e(oe).getActiveComplementaryArea(t)===o),[o,t]),{enableComplementaryArea:d,disableComplementaryArea:u}=(0,m.useDispatch)(oe);return(0,a.createElement)(l,{icon:r&&c?r:n,"aria-controls":o.replace("/",":"),onClick:()=>{c?u(t):d(t,o)},...i})})),se=({smallScreenTitle:e,children:t,className:o,toggleButtonProps:n})=>{const r=(0,a.createElement)(re,{icon:V,...n});return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},e&&(0,a.createElement)("span",{className:"interface-complementary-area-header__small-title"},e),r),(0,a.createElement)("div",{className:L()("components-panel__header","interface-complementary-area-header",o),tabIndex:-1},t,r))},ae=()=>{};function ie({name:e,as:t=_.Button,onClick:o,...n}){return(0,a.createElement)(_.Fill,{name:e},(({onClick:e})=>(0,a.createElement)(t,{onClick:o||e?(...t)=>{(o||ae)(...t),(e||ae)(...t)}:void 0,...n})))}ie.Slot=function({name:e,as:t=_.ButtonGroup,fillProps:o={},bubblesVirtually:n,...r}){return(0,a.createElement)(_.Slot,{name:e,bubblesVirtually:n,fillProps:o},(e=>{if(!u.Children.toArray(e).length)return null;const o=[];u.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&o.push(t)}));const n=u.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&o.includes(e.props.__unstableTarget)?null:e));return(0,a.createElement)(t,{...r},n)}))};const le=ie,ce=({__unstableExplicitMenuItem:e,__unstableTarget:t,...o})=>(0,a.createElement)(_.MenuItem,{...o});function de({scope:e,target:t,__unstableExplicitMenuItem:o,...n}){return(0,a.createElement)(re,{as:n=>(0,a.createElement)(le,{__unstableExplicitMenuItem:o,__unstableTarget:`${e}/${t}`,as:ce,name:`${e}/plugin-more-menu`,...n}),role:"menuitemcheckbox",selectedIcon:F,name:t,scope:e,...n})}function ue({scope:e,...t}){return(0,a.createElement)(_.Fill,{name:`PinnedItems/${e}`,...t})}ue.Slot=function({scope:e,className:t,...o}){return(0,a.createElement)(_.Slot,{name:`PinnedItems/${e}`,...o},(e=>e?.length>0&&(0,a.createElement)("div",{className:L()(t,"interface-pinned-items")},e)))};const me=ue;function pe({scope:e,children:t,className:o,id:n}){return(0,a.createElement)(_.Fill,{name:`ComplementaryArea/${e}`},(0,a.createElement)("div",{id:n,className:o},t))}const ge=ne((function({children:e,className:t,closeLabel:o=(0,y.__)("Close plugin"),identifier:n,header:r,headerClassName:s,icon:i,isPinnable:l=!0,panelClassName:c,scope:d,name:p,smallScreenTitle:h,title:b,toggleShortcut:E,isActiveByDefault:v}){const{isLoading:f,isActive:w,isPinned:S,activeArea:P,isSmall:k,isLarge:C,showIconLabels:M}=(0,m.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:o,isItemPinned:r}=e(oe),{get:s}=e(g.store),a=t(d);return{isLoading:o(d),isActive:a===n,isPinned:r(d,n),activeArea:a,isSmall:e(O.store).isViewportMatch("< medium"),isLarge:e(O.store).isViewportMatch("large"),showIconLabels:s("core","showIconLabels")}}),[n,d]);!function(e,t,o,n,r){const s=(0,u.useRef)(!1),a=(0,u.useRef)(!1),{enableComplementaryArea:i,disableComplementaryArea:l}=(0,m.useDispatch)(oe);(0,u.useEffect)((()=>{n&&r&&!s.current?(l(e),a.current=!0):a.current&&!r&&s.current?(a.current=!1,i(e,t)):a.current&&o&&o!==t&&(a.current=!1),r!==s.current&&(s.current=r)}),[n,r,e,t,o,l,i])}(d,n,P,w,k);const{enableComplementaryArea:x,disableComplementaryArea:T,pinItem:B,unpinItem:A}=(0,m.useDispatch)(oe);return(0,u.useEffect)((()=>{v&&void 0===P&&!k?x(d,n):void 0===P&&k&&T(d,n)}),[P,v,d,n,k,x,T]),(0,a.createElement)(a.Fragment,null,l&&(0,a.createElement)(me,{scope:d},S&&(0,a.createElement)(re,{scope:d,identifier:n,isPressed:w&&(!M||C),"aria-expanded":w,"aria-disabled":f,label:b,icon:M?F:i,showTooltip:!M,variant:M?"tertiary":void 0,size:"compact"})),p&&l&&(0,a.createElement)(de,{target:p,scope:d,icon:i},b),w&&(0,a.createElement)(pe,{className:L()("interface-complementary-area",t),scope:d,id:n.replace("/",":")},(0,a.createElement)(se,{className:s,closeLabel:o,onClose:()=>T(d),smallScreenTitle:h,toggleButtonProps:{label:o,shortcut:E,scope:d,identifier:n}},r||(0,a.createElement)(a.Fragment,null,(0,a.createElement)("strong",null,b),l&&(0,a.createElement)(_.Button,{className:"interface-complementary-area__pin-unpin-item",icon:S?D:R,label:S?(0,y.__)("Unpin from toolbar"):(0,y.__)("Pin to toolbar"),onClick:()=>(S?A:B)(d,n),isPressed:S,"aria-expanded":S}))),(0,a.createElement)(_.Panel,{className:c},e)))}));ge.Slot=function({scope:e,...t}){return(0,a.createElement)(_.Slot,{name:`ComplementaryArea/${e}`,...t})};const he=ge,be=({isActive:e})=>((0,u.useEffect)((()=>{let e=!1;return document.body.classList.contains("sticky-menu")&&(e=!0,document.body.classList.remove("sticky-menu")),()=>{e&&document.body.classList.add("sticky-menu")}}),[]),(0,u.useEffect)((()=>(e?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{e&&document.body.classList.remove("is-fullscreen-mode")})),[e]),null);function Ee({children:e,className:t,ariaLabel:o,as:n="div",...r}){return(0,a.createElement)(n,{className:L()("interface-navigable-region",t),"aria-label":o,role:"region",tabIndex:"-1",...r},e)}const _e={hidden:{opacity:0},hover:{opacity:1,transition:{type:"tween",delay:.2,delayChildren:.2}},distractionFreeInactive:{opacity:1,transition:{delay:0}}};const ve=(0,u.forwardRef)((function({isDistractionFree:e,footer:t,header:o,editorNotices:n,sidebar:r,secondarySidebar:s,notices:i,content:l,actions:c,labels:d,className:m,enableRegionNavigation:p=!0,shortcuts:g},h){const b=(0,_.__unstableUseNavigateRegions)(g);!function(e){(0,u.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const E={...{header:(0,y._x)("Header","header landmark area"),body:(0,y.__)("Content"),secondarySidebar:(0,y.__)("Block Library"),sidebar:(0,y.__)("Settings"),actions:(0,y.__)("Publish"),footer:(0,y.__)("Footer")},...d};return(0,a.createElement)("div",{...p?b:{},ref:(0,f.useMergeRefs)([h,p?b.ref:void 0]),className:L()(m,"interface-interface-skeleton",b.className,!!t&&"has-footer")},(0,a.createElement)("div",{className:"interface-interface-skeleton__editor"},!!o&&(0,a.createElement)(Ee,{as:_.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":E.header,initial:e?"hidden":"distractionFreeInactive",whileHover:e?"hover":"distractionFreeInactive",animate:e?"hidden":"distractionFreeInactive",variants:_e,transition:e?{type:"tween",delay:.8}:void 0},o),e&&(0,a.createElement)("div",{className:"interface-interface-skeleton__header"},n),(0,a.createElement)("div",{className:"interface-interface-skeleton__body"},!!s&&(0,a.createElement)(Ee,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:E.secondarySidebar},s),!!i&&(0,a.createElement)("div",{className:"interface-interface-skeleton__notices"},i),(0,a.createElement)(Ee,{className:"interface-interface-skeleton__content",ariaLabel:E.body},l),!!r&&(0,a.createElement)(Ee,{className:"interface-interface-skeleton__sidebar",ariaLabel:E.sidebar},r),!!c&&(0,a.createElement)(Ee,{className:"interface-interface-skeleton__actions",ariaLabel:E.actions},c))),!!t&&(0,a.createElement)(Ee,{className:"interface-interface-skeleton__footer",ariaLabel:E.footer},t))})),ye=(0,a.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(C.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function fe({as:e=_.DropdownMenu,className:t,label:o=(0,y.__)("Options"),popoverProps:n,toggleProps:r,children:s}){return(0,a.createElement)(e,{className:L()("interface-more-menu-dropdown",t),icon:ye,label:o,popoverProps:{placement:"bottom-end",...n,className:L()("interface-more-menu-dropdown__content",n?.className)},toggleProps:{tooltipPosition:"bottom",...r,size:"compact"}},(e=>s(e)))}const we=window.wp.keyboardShortcuts,Se=[{keyCombination:{modifier:"primary",character:"b"},description:(0,y.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,y.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,y.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,y.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,y.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,y.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,y.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,y.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},description:(0,y.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,y.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")}];function Pe({keyCombination:e,forceAriaLabel:t}){const o=e.modifier?I.displayShortcutList[e.modifier](e.character):e.character,n=e.modifier?I.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,a.createElement)("kbd",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||n},(Array.isArray(o)?o:[o]).map(((e,t)=>"+"===e?(0,a.createElement)(u.Fragment,{key:t},e):(0,a.createElement)("kbd",{key:t,className:"edit-post-keyboard-shortcut-help-modal__shortcut-key"},e))))}const ke=function({description:e,keyCombination:t,aliases:o=[],ariaLabel:n}){return(0,a.createElement)(u.Fragment,null,(0,a.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-description"},e),(0,a.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-term"},(0,a.createElement)(Pe,{keyCombination:t,forceAriaLabel:n}),o.map(((e,t)=>(0,a.createElement)(Pe,{keyCombination:e,forceAriaLabel:n,key:t})))))};const Ce=function({name:e}){const{keyCombination:t,description:o,aliases:n}=(0,m.useSelect)((t=>{const{getShortcutKeyCombination:o,getShortcutDescription:n,getShortcutAliases:r}=t(we.store);return{keyCombination:o(e),aliases:r(e),description:n(e)}}),[e]);return t?(0,a.createElement)(ke,{keyCombination:t,description:o,aliases:n}):null},Me="edit-post/keyboard-shortcut-help",xe=({shortcuts:e})=>(0,a.createElement)("ul",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-list",role:"list"},e.map(((e,t)=>(0,a.createElement)("li",{className:"edit-post-keyboard-shortcut-help-modal__shortcut",key:t},"string"==typeof e?(0,a.createElement)(Ce,{name:e}):(0,a.createElement)(ke,{...e}))))),Te=({title:e,shortcuts:t,className:o})=>(0,a.createElement)("section",{className:L()("edit-post-keyboard-shortcut-help-modal__section",o)},!!e&&(0,a.createElement)("h2",{className:"edit-post-keyboard-shortcut-help-modal__section-title"},e),(0,a.createElement)(xe,{shortcuts:t})),Be=({title:e,categoryName:t,additionalShortcuts:o=[]})=>{const n=(0,m.useSelect)((e=>e(we.store).getCategoryShortcuts(t)),[t]);return(0,a.createElement)(Te,{title:e,shortcuts:n.concat(o)})};const Ae=(0,f.compose)([(0,m.withSelect)((e=>({isModalActive:e(oe).isModalActive(Me)}))),(0,m.withDispatch)(((e,{isModalActive:t})=>{const{openModal:o,closeModal:n}=e(oe);return{toggleModal:()=>t?n():o(Me)}}))])((function({isModalActive:e,toggleModal:t}){return(0,we.useShortcut)("core/edit-post/keyboard-shortcuts",t),e?(0,a.createElement)(_.Modal,{className:"edit-post-keyboard-shortcut-help-modal",title:(0,y.__)("Keyboard shortcuts"),closeButtonLabel:(0,y.__)("Close"),onRequestClose:t},(0,a.createElement)(Te,{className:"edit-post-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-post/keyboard-shortcuts"]}),(0,a.createElement)(Be,{title:(0,y.__)("Global shortcuts"),categoryName:"global"}),(0,a.createElement)(Be,{title:(0,y.__)("Selection shortcuts"),categoryName:"selection"}),(0,a.createElement)(Be,{title:(0,y.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,y.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,y.__)("Forward-slash")}]}),(0,a.createElement)(Te,{title:(0,y.__)("Text formatting"),shortcuts:Se})):null}));const Ie=(0,m.withDispatch)((e=>{const{openModal:t}=e(oe);return{openModal:t}}))((function({openModal:e}){return(0,a.createElement)(_.MenuItem,{onClick:()=>{e(Me)},shortcut:I.displayShortcut.access("h")},(0,y.__)("Keyboard shortcuts"))})),{Fill:Ne,Slot:Le}=(0,_.createSlotFill)("ToolsMoreMenuGroup");Ne.Slot=({fillProps:e})=>(0,a.createElement)(Le,{fillProps:e},(e=>e.length>0&&(0,a.createElement)(_.MenuGroup,{label:(0,y.__)("Tools")},e)));const Fe=Ne;function De(){const e=(0,m.useSelect)((e=>"wp_template"===e(b.store).getCurrentPostType()),[]);return(0,a.createElement)(g.PreferenceToggleMenuItem,{scope:"core/edit-post",name:e?"welcomeGuideTemplate":"welcomeGuide",label:(0,y.__)("Welcome Guide")})}function Re(){const e=(0,m.useSelect)((e=>{const{canUser:t}=e(k.store),{getEditorSettings:o}=e(b.store),n=o().__unstableIsBlockBasedTheme,r=(0,T.addQueryArgs)("edit.php",{post_type:"wp_block"}),s=(0,T.addQueryArgs)("site-editor.php",{path:"/patterns"});return t("read","templates")&&n?s:r}),[]);return(0,a.createElement)(_.MenuItem,{role:"menuitem",href:e},(0,y.__)("Manage patterns"))}(0,x.registerPlugin)("edit-post",{render:()=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Fe,null,(({onClose:e})=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(Re,null),(0,a.createElement)(Ie,{onSelect:e}),(0,a.createElement)(De,null),(0,a.createElement)(A,null),(0,a.createElement)(_.MenuItem,{role:"menuitem",icon:M,href:(0,y.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,y.__)("Help"),(0,a.createElement)(_.VisuallyHidden,{as:"span"},(0,y.__)("(opens in a new tab)")))))))});const Oe=window.wp.commands,Ve=window.wp.coreCommands;function Ge(e=[],t){const o=[...e];for(const e of t){const t=o.findIndex((t=>t.id===e.id));-1!==t?o[t]=e:o.push(e)}return o}const ze=(0,m.combineReducers)({isSaving:function(e=!1,t){switch(t.type){case"REQUEST_META_BOX_UPDATES":return!0;case"META_BOX_UPDATES_SUCCESS":case"META_BOX_UPDATES_FAILURE":return!1;default:return e}},locations:function(e={},t){if("SET_META_BOXES_PER_LOCATIONS"===t.type){const o={...e};for(const[e,n]of Object.entries(t.metaBoxesPerLocation))o[e]=Ge(o[e],n);return o}return e},initialized:function(e=!1,t){return"META_BOXES_INITIALIZED"===t.type||e}}),He=(0,m.combineReducers)({metaBoxes:ze,publishSidebarActive:function(e=!1,t){switch(t.type){case"OPEN_PUBLISH_SIDEBAR":return!0;case"CLOSE_PUBLISH_SIDEBAR":return!1;case"TOGGLE_PUBLISH_SIDEBAR":return!e}return e}}),Ue=window.wp.apiFetch;var $e=o.n(Ue);const We=window.wp.a11y,qe=window.wp.privateApis,{lock:je,unlock:Qe}=(0,qe.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.","@wordpress/edit-post"),Ye=e=>({dispatch:t,registry:o})=>{o.select(g.store).get("core","distractionFree")&&t.toggleDistractionFree(),o.dispatch(oe).enableComplementaryArea(ro.name,e)},Ze=()=>({registry:e})=>e.dispatch(oe).disableComplementaryArea(ro.name),Xe=e=>({registry:t})=>(d()("select( 'core/edit-post' ).openModal( name )",{since:"6.3",alternative:"select( 'core/interface').openModal( name )"}),t.dispatch(oe).openModal(e)),Ke=()=>({registry:e})=>(d()("select( 'core/edit-post' ).closeModal()",{since:"6.3",alternative:"select( 'core/interface').closeModal()"}),e.dispatch(oe).closeModal());function Je(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function et(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function tt(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const ot=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).toggleEditorPanelEnabled",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelEnabled"}),t.dispatch(b.store).toggleEditorPanelEnabled(e)},nt=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).toggleEditorPanelOpened",{since:"6.5",alternative:"dispatch( 'core/editor').toggleEditorPanelOpened"}),t.dispatch(b.store).toggleEditorPanelOpened(e)},rt=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).removeEditorPanel",{since:"6.5",alternative:"dispatch( 'core/editor').removeEditorPanel"}),t.dispatch(b.store).removeEditorPanel(e)},st=e=>({registry:t})=>t.dispatch(g.store).toggle("core/edit-post",e),at=e=>({dispatch:t,registry:o})=>{o.dispatch(g.store).set("core","editorMode",e),"visual"!==e&&o.dispatch(v.store).clearSelectedBlock(),"text"===e&&o.select(g.store).get("core","distractionFree")&&t.toggleDistractionFree();const n="visual"===e?(0,y.__)("Visual editor selected"):(0,y.__)("Code editor selected");(0,We.speak)(n,"assertive")},it=e=>({registry:t})=>{const o=t.select(oe).isItemPinned("core/edit-post",e);t.dispatch(oe)[o?"unpinItem":"pinItem"]("core/edit-post",e)},lt=(e,t)=>({registry:o})=>{var n;if(!e)return;const r=null!==(n=o.select(g.store).get("core/edit-post","preferredStyleVariations"))&&void 0!==n?n:{};if(t)o.dispatch(g.store).set("core/edit-post","preferredStyleVariations",{...r,[e]:t});else{const t={...r};delete t[e],o.dispatch(g.store).set("core/edit-post","preferredStyleVariations",t)}},ct=e=>({registry:t})=>{Qe(t.dispatch(b.store)).showBlockTypes(e)},dt=e=>({registry:t})=>{Qe(t.dispatch(b.store)).hideBlockTypes(e)};function ut(e){return{type:"SET_META_BOXES_PER_LOCATIONS",metaBoxesPerLocation:e}}const mt=()=>async({registry:e,select:t,dispatch:o})=>{o({type:"REQUEST_META_BOX_UPDATES"}),window.tinyMCE&&window.tinyMCE.triggerSave();const n=e.select(b.store).getCurrentPost(),r=[!!n.comment_status&&["comment_status",n.comment_status],!!n.ping_status&&["ping_status",n.ping_status],!!n.sticky&&["sticky",n.sticky],!!n.author&&["post_author",n.author]].filter(Boolean),s=[new window.FormData(document.querySelector(".metabox-base-form")),...t.getActiveMetaBoxLocations().map((e=>new window.FormData((e=>{const t=document.querySelector(`.edit-post-meta-boxes-area.is-${e} .metabox-location-${e}`);return t||document.querySelector("#metaboxes .metabox-location-"+e)})(e))))].reduce(((e,t)=>{for(const[o,n]of t)e.append(o,n);return e}),new window.FormData);r.forEach((([e,t])=>s.append(e,t)));try{await $e()({url:window._wpMetaBoxUrl,method:"POST",body:s,parse:!1}),o.metaBoxUpdatesSuccess()}catch{o.metaBoxUpdatesFailure()}};function pt(){return{type:"META_BOX_UPDATES_SUCCESS"}}function gt(){return{type:"META_BOX_UPDATES_FAILURE"}}const ht=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType",{since:"6.5",version:"6.7",hint:"registry.dispatch( editorStore ).setDeviceType"}),t.dispatch(b.store).setDeviceType(e)},bt=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).setIsInserterOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsInserterOpened"}),t.dispatch(b.store).setIsInserterOpened(e)},Et=e=>({registry:t})=>{d()("dispatch( 'core/edit-post' ).setIsListViewOpened",{since:"6.5",alternative:"dispatch( 'core/editor').setIsListViewOpened"}),t.dispatch(b.store).setIsListViewOpened(e)};function _t(){return d()("dispatch( 'core/edit-post' ).setIsEditingTemplate",{since:"6.5",alternative:"dispatch( 'core/editor').setRenderingMode"}),{type:"NOTHING"}}function vt(){return d()("dispatch( 'core/edit-post' ).__unstableCreateTemplate",{since:"6.5"}),{type:"NOTHING"}}let yt=!1;const ft=()=>({registry:e,select:t,dispatch:o})=>{if(!e.select(b.store).__unstableIsEditorReady())return;if(yt)return;const n=e.select(b.store).getCurrentPostType();window.postboxes.page!==n&&window.postboxes.add_postbox_toggles(n),yt=!0,(0,p.addFilter)("editor.__unstableSavePost","core/edit-post/save-metaboxes",((e,n)=>e.then((()=>{if(!n.isAutosave&&t.hasMetaBoxes())return o.requestMetaBoxUpdates()})))),o({type:"META_BOXES_INITIALIZED"})},wt=()=>({dispatch:e,registry:t})=>{const o=t.select(g.store).get("core","distractionFree");o&&t.dispatch(g.store).set("core","fixedToolbar",!1),o||t.batch((()=>{t.dispatch(g.store).set("core","fixedToolbar",!0),t.dispatch(b.store).setIsInserterOpened(!1),t.dispatch(b.store).setIsListViewOpened(!1),e.closeGeneralSidebar()})),t.batch((()=>{t.dispatch(g.store).set("core","distractionFree",!o),t.dispatch(B.store).createInfoNotice(o?(0,y.__)("Distraction free off."):(0,y.__)("Distraction free on."),{id:"core/edit-post/distraction-free-mode/notice",type:"snackbar",actions:[{label:(0,y.__)("Undo"),onClick:()=>{t.batch((()=>{t.dispatch(g.store).set("core","fixedToolbar",!!o),t.dispatch(g.store).toggle("core","distractionFree")}))}}]})}))};var St={};function Pt(e){return[e]}function kt(e,t,o){var n;if(e.length!==t.length)return!1;for(n=o;n()=>{var t;return null!==(t=e(g.store).get("core","editorMode"))&&void 0!==t?t:"visual"})),Bt=(0,m.createRegistrySelector)((e=>()=>{const t=e(oe).getActiveComplementaryArea("core/edit-post");return["edit-post/document","edit-post/block"].includes(t)})),At=(0,m.createRegistrySelector)((e=>()=>{const t=e(oe).getActiveComplementaryArea("core/edit-post");return!!t&&!["edit-post/document","edit-post/block"].includes(t)})),It=(0,m.createRegistrySelector)((e=>()=>e(oe).getActiveComplementaryArea("core/edit-post")));const Nt=(0,m.createRegistrySelector)((e=>()=>{d()("select( 'core/edit-post' ).getPreferences",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const t=["preferredStyleVariations"].reduce(((t,o)=>({...t,[o]:e(g.store).get("core/edit-post",o)})),{}),o=["editorMode","hiddenBlockTypes"].reduce(((t,o)=>({...t,[o]:e(g.store).get("core",o)})),{}),n=function(e,t){var o;const n=e?.reduce(((e,t)=>({...e,[t]:{enabled:!1}})),{}),r=t?.reduce(((e,t)=>{const o=e?.[t];return{...e,[t]:{...o,opened:!0}}}),null!=n?n:{});return null!==(o=null!=r?r:n)&&void 0!==o?o:xt}(e(g.store).get("core","inactivePanels"),e(g.store).get("core","openPanels"));return{...t,...o,panels:n}}));function Lt(e,t,o){d()("select( 'core/edit-post' ).getPreference",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const n=Nt(e)[t];return void 0===n?o:n}const Ft=(0,m.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(g.store).get("core","hiddenBlockTypes"))&&void 0!==t?t:Mt}));function Dt(e){return e.publishSidebarActive}const Rt=(0,m.createRegistrySelector)((e=>(t,o)=>(d()("select( 'core/edit-post' ).isEditorPanelRemoved",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelRemoved"}),e(b.store).isEditorPanelRemoved(o)))),Ot=(0,m.createRegistrySelector)((e=>(t,o)=>(d()("select( 'core/edit-post' ).isEditorPanelEnabled",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelEnabled"}),e(b.store).isEditorPanelEnabled(o)))),Vt=(0,m.createRegistrySelector)((e=>(t,o)=>(d()("select( 'core/edit-post' ).isEditorPanelOpened",{since:"6.5",alternative:"select( 'core/editor' ).isEditorPanelOpened"}),e(b.store).isEditorPanelOpened(o)))),Gt=(0,m.createRegistrySelector)((e=>(t,o)=>(d()("select( 'core/edit-post' ).isModalActive",{since:"6.3",alternative:"select( 'core/interface' ).isModalActive"}),!!e(oe).isModalActive(o)))),zt=(0,m.createRegistrySelector)((e=>(t,o)=>!!e(g.store).get("core/edit-post",o))),Ht=(0,m.createRegistrySelector)((e=>(t,o)=>e(oe).isItemPinned("core/edit-post",o))),Ut=Ct((e=>Object.keys(e.metaBoxes.locations).filter((t=>Wt(e,t)))),(e=>[e.metaBoxes.locations])),$t=(0,m.createRegistrySelector)((e=>(t,o)=>Wt(t,o)&&qt(t,o)?.some((({id:o})=>e(b.store).isEditorPanelEnabled(t,`meta-box-${o}`)))));function Wt(e,t){const o=qt(e,t);return!!o&&0!==o.length}function qt(e,t){return e.metaBoxes.locations[t]}const jt=Ct((e=>Object.values(e.metaBoxes.locations).flat()),(e=>[e.metaBoxes.locations]));function Qt(e){return Ut(e).length>0}function Yt(e){return e.metaBoxes.isSaving}const Zt=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-site' ).__experimentalGetPreviewDeviceType",{since:"6.5",version:"6.7",alternative:"select( 'core/editor' ).getDeviceType"}),e(b.store).getDeviceType()))),Xt=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-post' ).isInserterOpened",{since:"6.5",alternative:"select( 'core/editor' ).isInserterOpened"}),e(b.store).isInserterOpened()))),Kt=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-post' ).__experimentalGetInsertionPoint",{since:"6.5",version:"6.7"}),Qe(e(b.store)).getInsertionPoint()))),Jt=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-post' ).isListViewOpened",{since:"6.5",alternative:"select( 'core/editor' ).isListViewOpened"}),e(b.store).isListViewOpened()))),eo=(0,m.createRegistrySelector)((e=>()=>(d()("select( 'core/edit-post' ).isEditingTemplate",{since:"6.5",alternative:"select( 'core/editor' ).getRenderingMode"}),"post-only"!==e(b.store).getCurrentPostType())));function to(e){return e.metaBoxes.initialized}const oo=(0,m.createRegistrySelector)((e=>()=>{const t=e(b.store).getEditedPostAttribute("template");if(t){const o=e(k.store).getEntityRecords("postType","wp_template",{per_page:-1})?.find((e=>e.slug===t));return o?e(k.store).getEditedEntityRecord("postType","wp_template",o.id):o}const o=e(b.store).getCurrentPost();let n;n=o.slug?"page"===o.type?`${o.type}-${o.slug}`:`single-${o.type}-${o.slug}`:"page"===o.type?"page":`single-${o.type}`;const r=e(k.store).getDefaultTemplateId({slug:n});return e(k.store).getEditedEntityRecord("postType","wp_template",r)})),no="core/edit-post",ro=(0,m.createReduxStore)(no,{reducer:He,actions:r,selectors:s});function so(){const e=(0,m.useSelect)((e=>e(b.store).getEditorSettings().richEditingEnabled),[]),{switchEditorMode:t}=(0,m.useDispatch)(ro),{isWelcomeGuideVisible:o}=(0,m.useSelect)((e=>{const{isFeatureActive:t}=e(ro);return{isWelcomeGuideVisible:t("welcomeGuide")}}),[]),n=(0,u.useRef)();return(0,u.useEffect)((()=>{o||n?.current?.focus()}),[o]),(0,a.createElement)("div",{className:"edit-post-text-editor"},e&&(0,a.createElement)("div",{className:"edit-post-text-editor__toolbar"},(0,a.createElement)("h2",null,(0,y.__)("Editing code")),(0,a.createElement)(_.Button,{variant:"tertiary",onClick:()=>t("visual"),shortcut:I.displayShortcut.secondary("m")},(0,y.__)("Exit code editor"))),(0,a.createElement)("div",{className:"edit-post-text-editor__body"},(0,a.createElement)(b.PostTitleRaw,{ref:n}),(0,a.createElement)(b.PostTextEditor,null)))}(0,m.register)(ro);const{EditorCanvas:ao}=Qe(b.privateApis),io=!1;function lo({styles:e}){const{isWelcomeGuideVisible:t,renderingMode:o,isBlockBasedTheme:n,hasV3BlocksOnly:r,isEditingTemplate:s}=(0,m.useSelect)((e=>{const{isFeatureActive:t}=e(ro),{getEditorSettings:o,getRenderingMode:n}=e(b.store),{getBlockTypes:r}=e(i.store),s=o();return{isWelcomeGuideVisible:t("welcomeGuide"),renderingMode:n(),isBlockBasedTheme:s.__unstableIsBlockBasedTheme,hasV3BlocksOnly:r().every((e=>e.apiVersion>=3)),isEditingTemplate:"wp_template"===e(b.store).getCurrentPostType()}}),[]),l=(0,m.useSelect)((e=>e(ro).hasMetaBoxes()),[]);let c;l||"post-only"!==o||(c="40vh"),e=(0,u.useMemo)((()=>[...e,{css:c?`body{padding-bottom:${c}}`:""}]),[e,c]);const d=(r||io&&n)&&!l||s;return(0,a.createElement)("div",{className:L()("edit-post-visual-editor",{"has-inline-canvas":!d})},(0,a.createElement)(ao,{disableIframe:!d,styles:e,autoFocus:!t}))}const co=function(){const{getEditorMode:e,isEditorSidebarOpened:t}=(0,m.useSelect)(ro),o=(0,m.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:o}=e(b.store).getEditorSettings();return!t||!o}),[]),{switchEditorMode:n,openGeneralSidebar:r,closeGeneralSidebar:s,toggleFeature:a,toggleDistractionFree:l}=(0,m.useDispatch)(ro),{registerShortcut:c}=(0,m.useDispatch)(we.store),{replaceBlocks:d}=(0,m.useDispatch)(v.store),{getBlockName:p,getSelectedBlockClientId:g,getBlockAttributes:h,getBlockSelectionStart:E}=(0,m.useSelect)(v.store),_=(e,t)=>{e.preventDefault();const o=0===t?"core/paragraph":"core/heading",n=g();if(null===n)return;const r=p(n);if("core/paragraph"!==r&&"core/heading"!==r)return;const s=h(n),a="core/paragraph"===r?"align":"textAlign",l="core/paragraph"===o?"align":"textAlign";d(n,(0,i.createBlock)(o,{level:t,content:s.content,[l]:s[a]}))};return(0,u.useEffect)((()=>{c({name:"core/edit-post/toggle-mode",category:"global",description:(0,y.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),c({name:"core/edit-post/toggle-distraction-free",category:"global",description:(0,y.__)("Toggle distraction free mode."),keyCombination:{modifier:"primaryShift",character:"\\"}}),c({name:"core/edit-post/toggle-fullscreen",category:"global",description:(0,y.__)("Toggle fullscreen mode."),keyCombination:{modifier:"secondary",character:"f"}}),c({name:"core/edit-post/toggle-sidebar",category:"global",description:(0,y.__)("Show or hide the Settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),c({name:"core/edit-post/next-region",category:"global",description:(0,y.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),c({name:"core/edit-post/previous-region",category:"global",description:(0,y.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]}),c({name:"core/edit-post/keyboard-shortcuts",category:"main",description:(0,y.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),c({name:"core/edit-post/transform-heading-to-paragraph",category:"block-library",description:(0,y.__)("Transform heading to paragraph."),keyCombination:{modifier:"access",character:"0"}}),[1,2,3,4,5,6].forEach((e=>{c({name:`core/edit-post/transform-paragraph-to-heading-${e}`,category:"block-library",description:(0,y.__)("Transform paragraph to heading."),keyCombination:{modifier:"access",character:`${e}`}})}))}),[]),(0,we.useShortcut)("core/edit-post/toggle-mode",(()=>{n("visual"===e()?"text":"visual")}),{isDisabled:o}),(0,we.useShortcut)("core/edit-post/toggle-fullscreen",(()=>{a("fullscreenMode")})),(0,we.useShortcut)("core/edit-post/toggle-distraction-free",(()=>{l()})),(0,we.useShortcut)("core/edit-post/toggle-sidebar",(e=>{if(e.preventDefault(),t())s();else{const e=E()?"edit-post/block":"edit-post/document";r(e)}})),(0,we.useShortcut)("core/edit-post/transform-heading-to-paragraph",(e=>_(e,0))),[1,2,3,4,5,6].forEach((e=>{(0,we.useShortcut)(`core/edit-post/transform-paragraph-to-heading-${e}`,(t=>_(t,e)))})),null},{PreferenceBaseOption:uo}=Qe(g.privateApis);function mo({willEnable:e}){const[t,o]=(0,u.useState)(!1);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",{className:"edit-post-preferences-modal__custom-fields-confirmation-message"},(0,y.__)("A page reload is required for this change. Make sure your content is saved before reloading.")),(0,a.createElement)(_.Button,{className:"edit-post-preferences-modal__custom-fields-confirmation-button",variant:"secondary",isBusy:t,disabled:t,onClick:()=>{o(!0),function(){const e=document.getElementById("toggle-custom-fields-form");e.querySelector('[name="_wp_http_referer"]').setAttribute("value",(0,T.getPathAndQueryString)(window.location.href)),e.submit()}()}},e?(0,y.__)("Show & Reload Page"):(0,y.__)("Hide & Reload Page")))}const po=(0,m.withSelect)((e=>({areCustomFieldsEnabled:!!e(b.store).getEditorSettings().enableCustomFields})))((function({label:e,areCustomFieldsEnabled:t}){const[o,n]=(0,u.useState)(t);return(0,a.createElement)(uo,{label:e,isChecked:o,onChange:n},o!==t&&(0,a.createElement)(mo,{willEnable:o}))})),{PreferenceBaseOption:go}=Qe(g.privateApis),ho=(0,f.compose)((0,m.withSelect)(((e,{panelName:t})=>{const{isEditorPanelEnabled:o,isEditorPanelRemoved:n}=e(b.store);return{isRemoved:n(t),isChecked:o(t)}})),(0,f.ifCondition)((({isRemoved:e})=>!e)),(0,m.withDispatch)(((e,{panelName:t})=>({onChange:()=>e(b.store).toggleEditorPanelEnabled(t)}))))(go),{PreferencesModalSection:bo}=Qe(g.privateApis);const Eo=(0,m.withSelect)((e=>{const{getEditorSettings:t}=e(b.store),{getAllMetaBoxes:o}=e(ro);return{areCustomFieldsRegistered:void 0!==t().enableCustomFields,metaBoxes:o()}}))((function({areCustomFieldsRegistered:e,metaBoxes:t,...o}){const n=t.filter((({id:e})=>"postcustom"!==e));return e||0!==n.length?(0,a.createElement)(bo,{...o},e&&(0,a.createElement)(po,{label:(0,y.__)("Custom fields")}),n.map((({id:e,title:t})=>(0,a.createElement)(ho,{key:e,label:t,panelName:`meta-box-${e}`})))):null})),{PreferenceBaseOption:_o}=Qe(g.privateApis),vo=(0,f.compose)((0,m.withSelect)((e=>({isChecked:e(b.store).isPublishSidebarEnabled()}))),(0,m.withDispatch)((e=>{const{enablePublishSidebar:t,disablePublishSidebar:o}=e(b.store);return{onChange:e=>e?t():o()}})),(0,O.ifViewportMatches)("medium"))(_o),{PreferencesModalSection:yo,PreferenceToggleControl:fo}=Qe(g.privateApis),{PreferencesModal:wo}=Qe(b.privateApis),So="edit-post/preferences";function Po(){const e=(0,f.useViewportMatch)("medium"),{closeModal:t}=(0,m.useDispatch)(oe),{isModalActive:o}=(0,m.useSelect)((e=>({isModalActive:e(oe).isModalActive(So)})),[]),n={general:(0,a.createElement)(a.Fragment,null,e&&(0,a.createElement)(yo,{title:(0,y.__)("Publishing")},(0,a.createElement)(vo,{help:(0,y.__)("Review settings, such as visibility and tags."),label:(0,y.__)("Enable pre-publish checks")})),(0,a.createElement)(Eo,{title:(0,y.__)("Advanced")})),appearance:(0,a.createElement)(fo,{scope:"core/edit-post",featureName:"themeStyles",help:(0,y.__)("Make the editor look like your theme."),label:(0,y.__)("Use theme styles")})};return o?(0,a.createElement)(wo,{extraSections:n,isActive:o,onClose:t}):null}class ko extends u.Component{constructor(){super(...arguments),this.state={historyId:null}}componentDidUpdate(e){const{postId:t,postStatus:o,postType:n,isSavingPost:r,hasHistory:s}=this.props,{historyId:a}=this.state;"trash"!==o||r?t===e.postId&&t===a||"auto-draft"===o||!t||s||this.setBrowserURL(t):this.setTrashURL(t,n)}setTrashURL(e,t){window.location.href=function(e,t){return(0,T.addQueryArgs)("edit.php",{trashed:1,post_type:t,ids:e})}(e,t)}setBrowserURL(e){window.history.replaceState({id:e},"Post "+e,function(e){return(0,T.addQueryArgs)("post.php",{post:e,action:"edit"})}(e)),this.setState((()=>({historyId:e})))}render(){return null}}const Co=(0,m.withSelect)((e=>{const{getCurrentPost:t,isSavingPost:o}=e(b.store),n=t();let{id:r,status:s,type:a}=n;return["wp_template","wp_template_part"].includes(a)&&(r=n.wp_id),{postId:r,postStatus:s,postType:a,isSavingPost:o()}}))(ko),Mo=(0,a.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(C.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})),xo=(0,a.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(C.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})),To=(0,a.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,a.createElement)(C.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"}));const Bo=function({showTooltip:e,icon:t,href:o,initialPost:n}){var r;const{isActive:s,isRequestingSiteIcon:i,postType:l,siteIconUrl:c}=(0,m.useSelect)((e=>{const{getCurrentPostType:t}=e(b.store),{isFeatureActive:o}=e(ro),{getEntityRecord:r,getPostType:s,isResolving:a}=e(k.store),i=r("root","__unstableBase",void 0)||{},l=n?.type||t();return{isActive:o("fullscreenMode"),isRequestingSiteIcon:a("getEntityRecord",["root","__unstableBase",void 0]),postType:s(l),siteIconUrl:i.site_icon_url}}),[]),d=(0,f.useReducedMotion)();if(!s||!l)return null;let u=(0,a.createElement)(_.Icon,{size:"36px",icon:To});const p={expand:{scale:1.25,transition:{type:"tween",duration:"0.3"}}};c&&(u=(0,a.createElement)(_.__unstableMotion.img,{variants:!d&&p,alt:(0,y.__)("Site Icon"),className:"edit-post-fullscreen-mode-close_site-icon",src:c})),i&&(u=null),t&&(u=(0,a.createElement)(_.Icon,{size:"36px",icon:t}));const g=L()({"edit-post-fullscreen-mode-close":!0,"has-icon":c}),h=null!=o?o:(0,T.addQueryArgs)("edit.php",{post_type:l.slug}),E=null!==(r=l?.labels?.view_items)&&void 0!==r?r:(0,y.__)("Back");return(0,a.createElement)(_.__unstableMotion.div,{whileHover:"expand"},(0,a.createElement)(_.Button,{className:g,href:h,label:E,showTooltip:e},u))},Ao=[{value:"visual",label:(0,y.__)("Visual editor")},{value:"text",label:(0,y.__)("Code editor")}];const Io=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:o,mode:n}=(0,m.useSelect)((e=>({shortcut:e(we.store).getShortcutRepresentation("core/edit-post/toggle-mode"),isRichEditingEnabled:e(b.store).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(b.store).getEditorSettings().codeEditingEnabled,mode:e(ro).getEditorMode()})),[]),{switchEditorMode:r}=(0,m.useDispatch)(ro);let s=n;t||"visual"!==n||(s="text"),o||"text"!==n||(s="visual");const i=Ao.map((n=>(o||"text"!==n.value||(n={...n,disabled:!0}),t||"visual"!==n.value||(n={...n,disabled:!0,info:(0,y.__)("You can enable the visual editor in your profile settings.")}),n.value===s||n.disabled?n:{...n,shortcut:e})));return(0,a.createElement)(_.MenuGroup,{label:(0,y.__)("Editor")},(0,a.createElement)(_.MenuItemsChoice,{choices:i,value:s,onSelect:r}))};function No(){const{openModal:e}=(0,m.useDispatch)(oe);return(0,a.createElement)(_.MenuItem,{onClick:()=>{e(So)}},(0,y.__)("Preferences"))}const Lo=function(){const{set:e}=(0,m.useDispatch)(g.store),{toggleDistractionFree:t}=(0,m.useDispatch)(ro);return(0,f.useViewportMatch)("medium")?(0,a.createElement)(_.MenuGroup,{label:(0,y._x)("View","noun")},(0,a.createElement)(g.PreferenceToggleMenuItem,{scope:"core",name:"fixedToolbar",onToggle:()=>{e("core","distractionFree",!1)},label:(0,y.__)("Top toolbar"),info:(0,y.__)("Access all block and document tools in a single place"),messageActivated:(0,y.__)("Top toolbar activated"),messageDeactivated:(0,y.__)("Top toolbar deactivated")}),(0,a.createElement)(g.PreferenceToggleMenuItem,{scope:"core",name:"distractionFree",handleToggling:!1,onToggle:t,label:(0,y.__)("Distraction free"),info:(0,y.__)("Write with calmness"),messageActivated:(0,y.__)("Distraction free mode activated"),messageDeactivated:(0,y.__)("Distraction free mode deactivated"),shortcut:I.displayShortcut.primaryShift("\\")}),(0,a.createElement)(g.PreferenceToggleMenuItem,{scope:"core",name:"focusMode",label:(0,y.__)("Spotlight mode"),info:(0,y.__)("Focus on one block at a time"),messageActivated:(0,y.__)("Spotlight mode activated"),messageDeactivated:(0,y.__)("Spotlight mode deactivated")}),(0,a.createElement)(g.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fullscreenMode",label:(0,y.__)("Fullscreen mode"),info:(0,y.__)("Show and hide the admin user interface"),messageActivated:(0,y.__)("Fullscreen mode activated"),messageDeactivated:(0,y.__)("Fullscreen mode deactivated"),shortcut:I.displayShortcut.secondary("f")})):null},Fo=({showIconLabels:e})=>{const t=(0,f.useViewportMatch)("large");return(0,a.createElement)(fe,{toggleProps:{showTooltip:!e,...e&&{variant:"tertiary"},size:"compact"}},(({onClose:o})=>(0,a.createElement)(a.Fragment,null,e&&!t&&(0,a.createElement)(me.Slot,{className:e&&"show-icon-labels",scope:"core/edit-post"}),(0,a.createElement)(Lo,null),(0,a.createElement)(Io,null),(0,a.createElement)(le.Slot,{name:"core/edit-post/plugin-more-menu",label:(0,y.__)("Plugins"),as:_.MenuGroup,fillProps:{onClick:o}}),(0,a.createElement)(Fe.Slot,{fillProps:{onClose:o}}),(0,a.createElement)(_.MenuGroup,null,(0,a.createElement)(No,null)))))};const Do=(0,f.compose)((0,m.withSelect)((e=>{var t;return{hasPublishAction:null!==(t=e(b.store).getCurrentPost()?._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:e(b.store).isEditedPostBeingScheduled(),isPending:e(b.store).isCurrentPostPending(),isPublished:e(b.store).isCurrentPostPublished(),isPublishSidebarEnabled:e(b.store).isPublishSidebarEnabled(),isPublishSidebarOpened:e(ro).isPublishSidebarOpened(),isScheduled:e(b.store).isCurrentPostScheduled()}})),(0,m.withDispatch)((e=>{const{togglePublishSidebar:t}=e(ro);return{togglePublishSidebar:t}})))((function({forceIsDirty:e,hasPublishAction:t,isBeingScheduled:o,isPending:n,isPublished:r,isPublishSidebarEnabled:s,isPublishSidebarOpened:i,isScheduled:l,togglePublishSidebar:c,setEntitiesSavedStatesCallback:d}){const u="toggle",m="button",p=(0,f.useViewportMatch)("medium","<");let g;return g=r||l&&o||n&&!t&&!p?m:p||s?u:m,(0,a.createElement)(b.PostPublishButton,{forceIsDirty:e,isOpen:i,isToggle:g===u,onToggle:c,setEntitiesSavedStatesCallback:d})})),Ro="__experimentalMainDashboardButton",{Fill:Oo,Slot:Vo}=(0,_.createSlotFill)(Ro),Go=Oo;Go.Slot=({children:e})=>{const t=(0,_.__experimentalUseSlotFills)(Ro);return Boolean(t&&t.length)?(0,a.createElement)(Vo,{bubblesVirtually:!0}):e};const zo=Go,{DocumentTools:Ho,PostViewLink:Uo,PreviewDropdown:$o}=Qe(b.privateApis),Wo={hidden:{y:"-50px"},distractionFreeInactive:{y:0},hover:{y:0,transition:{type:"tween",delay:.2}}},qo={hidden:{x:"-100%"},distractionFreeInactive:{x:0},hover:{x:0,transition:{type:"tween",delay:.2}}};const jo=function({setEntitiesSavedStatesCallback:e,initialPost:t}){const o=(0,f.useViewportMatch)("large"),n=(0,f.useViewportMatch)("medium"),r=(0,u.useRef)(),{isTextEditor:s,hasBlockSelection:i,hasActiveMetaboxes:l,hasFixedToolbar:c,isPublishSidebarOpened:d,showIconLabels:p,hasHistory:h}=(0,m.useSelect)((e=>{const{get:t}=e(g.store),{getEditorMode:o}=e(ro);return{isTextEditor:"text"===o(),hasBlockSelection:!!e(v.store).getBlockSelectionStart(),hasActiveMetaboxes:e(ro).hasMetaBoxes(),hasHistory:!!e(b.store).getEditorSettings().onNavigateToPreviousEntityRecord,isPublishSidebarOpened:e(ro).isPublishSidebarOpened(),hasFixedToolbar:t("core","fixedToolbar"),showIconLabels:t("core","showIconLabels")}}),[]),[E,w]=(0,u.useState)(!0);return(0,u.useEffect)((()=>{i&&w(!1)}),[i]),(0,a.createElement)("div",{className:"edit-post-header"},(0,a.createElement)(zo.Slot,null,(0,a.createElement)(_.__unstableMotion.div,{variants:qo,transition:{type:"tween",delay:.8}},(0,a.createElement)(Bo,{showTooltip:!0,initialPost:t}))),(0,a.createElement)(_.__unstableMotion.div,{variants:Wo,transition:{type:"tween",delay:.8},className:"edit-post-header__toolbar"},(0,a.createElement)(Ho,{disableBlockTools:s}),c&&n&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:L()("selected-block-tools-wrapper",{"is-collapsed":E})},(0,a.createElement)(v.BlockToolbar,{hideDragHandle:!0})),(0,a.createElement)(_.Popover.Slot,{ref:r,name:"block-toolbar"}),i&&(0,a.createElement)(_.Button,{className:"edit-post-header__block-tools-toggle",icon:E?Mo:xo,onClick:()=>{w((e=>!e))},label:E?(0,y.__)("Show block tools"):(0,y.__)("Hide block tools")})),(0,a.createElement)("div",{className:L()("edit-post-header__center",{"is-collapsed":h&&i&&!E&&c&&n})},h&&(0,a.createElement)(b.DocumentBar,null))),(0,a.createElement)(_.__unstableMotion.div,{variants:Wo,transition:{type:"tween",delay:.8},className:"edit-post-header__settings"},!d&&(0,a.createElement)(b.PostSavedState,{forceIsDirty:l}),(0,a.createElement)($o,{forceIsAutosaveable:l}),(0,a.createElement)(b.PostPreviewButton,{className:"edit-post-header__post-preview-button",forceIsAutosaveable:l}),(0,a.createElement)(Uo,null),(0,a.createElement)(Do,{forceIsDirty:l,setEntitiesSavedStatesCallback:e}),(o||!p)&&(0,a.createElement)(me.Slot,{scope:"core/edit-post"}),(0,a.createElement)(Fo,{showIconLabels:p})))},Qo=(0,a.createElement)(C.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(C.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"})),Yo=(0,a.createElement)(C.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(C.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"})),{Tabs:Zo}=Qe(_.privateApis),Xo=(0,u.forwardRef)(((e,t)=>{const{documentLabel:o}=(0,m.useSelect)((e=>{const{getPostTypeLabel:t}=e(b.store);return{documentLabel:t()||(0,y._x)("Document","noun")}}),[]);return(0,a.createElement)(Zo.TabList,{ref:t},(0,a.createElement)(Zo.Tab,{tabId:Bn.document,"data-tab-id":Bn.document},o),(0,a.createElement)(Zo.Tab,{tabId:Bn.block,"data-tab-id":Bn.block},(0,y.__)("Block")))})),{PostPanelRow:Ko}=Qe(b.privateApis);function Jo({isOpen:e,onClick:t}){const o=(0,b.usePostVisibilityLabel)();return(0,a.createElement)(_.Button,{__next40pxDefaultSize:!0,className:"edit-post-post-visibility__toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,y.sprintf)((0,y.__)("Select visibility: %s"),o),onClick:t},o)}const en=function(){const[e,t]=(0,u.useState)(null),o=(0,u.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,a.createElement)(b.PostVisibilityCheck,{render:({canEdit:e})=>(0,a.createElement)(Ko,{label:(0,y.__)("Visibility"),ref:t},!e&&(0,a.createElement)("span",null,(0,a.createElement)(b.PostVisibilityLabel,null)),e&&(0,a.createElement)(_.Dropdown,{contentClassName:"edit-post-post-visibility__dialog",popoverProps:o,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,a.createElement)(Jo,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,a.createElement)(b.PostVisibility,{onClose:e})}))})};function tn(){return(0,a.createElement)(b.PostTrashCheck,null,(0,a.createElement)(b.PostTrash,null))}const{PostPanelRow:on}=Qe(b.privateApis);const nn=function(){return(0,a.createElement)(b.PostStickyCheck,null,(0,a.createElement)(on,null,(0,a.createElement)(b.PostSticky,null)))};const rn=function(){return(0,a.createElement)(b.PostSlugCheck,null,(0,a.createElement)(_.PanelRow,{className:"edit-post-post-slug"},(0,a.createElement)(b.PostSlug,null)))};const sn=function(){return(0,a.createElement)(b.PostFormatCheck,null,(0,a.createElement)(_.PanelRow,{className:"edit-post-post-format"},(0,a.createElement)(b.PostFormat,null)))},{PostPanelRow:an}=Qe(b.privateApis);const ln=function(){return(0,a.createElement)(b.PostPendingStatusCheck,null,(0,a.createElement)(an,null,(0,a.createElement)(b.PostPendingStatus,null)))},{Fill:cn,Slot:dn}=(0,_.createSlotFill)("PluginPostStatusInfo"),un=({children:e,className:t})=>(0,a.createElement)(cn,null,(0,a.createElement)(_.PanelRow,{className:t},e));un.Slot=dn;const mn=un,pn="post-status";function gn(){const{isOpened:e,isRemoved:t}=(0,m.useSelect)((e=>{const{isEditorPanelRemoved:t,isEditorPanelOpened:o}=e(b.store);return{isRemoved:t(pn),isOpened:o(pn)}}),[]),{toggleEditorPanelOpened:o}=(0,m.useDispatch)(b.store);return t?null:(0,a.createElement)(_.PanelBody,{className:"edit-post-post-status",title:(0,y.__)("Summary"),opened:e,onToggle:()=>o(pn)},(0,a.createElement)(mn.Slot,null,(e=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)(en,null),(0,a.createElement)(b.PostSchedulePanel,null),(0,a.createElement)(b.PostTemplatePanel,null),(0,a.createElement)(b.PostURLPanel,null),(0,a.createElement)(b.PostSyncStatus,null),(0,a.createElement)(nn,null),(0,a.createElement)(ln,null),(0,a.createElement)(sn,null),(0,a.createElement)(rn,null),(0,a.createElement)(b.PostAuthorPanel,null),e,(0,a.createElement)(_.__experimentalHStack,{style:{marginTop:"16px"},spacing:4,wrap:!0},(0,a.createElement)(b.PostSwitchToDraftButton,null),(0,a.createElement)(tn,null))))))}const hn=function({location:e}){const t=(0,u.useRef)(null),o=(0,u.useRef)(null);(0,u.useEffect)((()=>(o.current=document.querySelector(".metabox-location-"+e),o.current&&t.current.appendChild(o.current),()=>{o.current&&document.querySelector("#metaboxes").appendChild(o.current)})),[e]);const n=(0,m.useSelect)((e=>e(ro).isSavingMetaBoxes()),[]),r=L()("edit-post-meta-boxes-area",`is-${e}`,{"is-loading":n});return(0,a.createElement)("div",{className:r},n&&(0,a.createElement)(_.Spinner,null),(0,a.createElement)("div",{className:"edit-post-meta-boxes-area__container",ref:t}),(0,a.createElement)("div",{className:"edit-post-meta-boxes-area__clear"}))};class bn extends u.Component{componentDidMount(){this.updateDOM()}componentDidUpdate(e){this.props.isVisible!==e.isVisible&&this.updateDOM()}updateDOM(){const{id:e,isVisible:t}=this.props,o=document.getElementById(e);o&&(t?o.classList.remove("is-hidden"):o.classList.add("is-hidden"))}render(){return null}}const En=(0,m.withSelect)(((e,{id:t})=>({isVisible:e(b.store).isEditorPanelEnabled(`meta-box-${t}`)})))(bn);function _n({location:e}){const t=(0,m.useRegistry)(),{metaBoxes:o,areMetaBoxesInitialized:n,isEditorReady:r}=(0,m.useSelect)((t=>{const{__unstableIsEditorReady:o}=t(b.store),{getMetaBoxesPerLocation:n,areMetaBoxesInitialized:r}=t(ro);return{metaBoxes:n(e),areMetaBoxesInitialized:r(),isEditorReady:o()}}),[e]),s=!!o?.length;return(0,u.useEffect)((()=>{r&&s&&!n&&t.dispatch(ro).initializeMetaBoxes()}),[r,s,n]),n?(0,a.createElement)(a.Fragment,null,(null!=o?o:[]).map((({id:e})=>(0,a.createElement)(En,{key:e,id:e}))),(0,a.createElement)(hn,{location:e})):null}window.wp.warning;const{Fill:vn,Slot:yn}=(0,_.createSlotFill)("PluginDocumentSettingPanel"),{EnablePluginDocumentSettingPanelOption:fn}=Qe(b.privateApis),wn=({name:e,className:t,title:o,icon:n,children:r})=>{const{name:s}=(0,x.usePluginContext)(),i=`${s}/${e}`,{opened:l,isEnabled:c}=(0,m.useSelect)((e=>{const{isEditorPanelOpened:t,isEditorPanelEnabled:o}=e(b.store);return{opened:t(i),isEnabled:o(i)}}),[i]),{toggleEditorPanelOpened:d}=(0,m.useDispatch)(b.store);return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(fn,{label:o,panelName:i}),(0,a.createElement)(vn,null,c&&(0,a.createElement)(_.PanelBody,{className:t,title:o,icon:n,opened:l,onToggle:()=>d(i)},r)))};wn.Slot=yn;const Sn=wn;function Pn({className:e,...t}){const{postTitle:o,shortcut:n}=(0,m.useSelect)((e=>({postTitle:e(b.store).getEditedPostAttribute("title"),shortcut:e(we.store).getShortcutRepresentation("core/edit-post/toggle-sidebar")})),[]);return(0,a.createElement)(he,{panelClassName:e,className:"edit-post-sidebar",smallScreenTitle:o||(0,y.__)("(no title)"),scope:"core/edit-post",toggleShortcut:n,...t})}const kn=(0,u.forwardRef)((function({icon:e,size:t=24,...o},n){return(0,u.cloneElement)(e,{width:t,height:t,...o,ref:n})})),Cn=(0,a.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(C.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"}));const Mn=function(){const e=(0,m.useSelect)((e=>{const{getCurrentPost:t}=e(b.store);return t()}),[]);return e?(0,a.createElement)(_.PanelBody,null,(0,a.createElement)(_.Flex,{align:"flex-start",gap:"3"},(0,a.createElement)(_.FlexItem,null,(0,a.createElement)(kn,{icon:Cn})),(0,a.createElement)(_.FlexBlock,null,(0,a.createElement)("h2",{className:"edit-post-template-summary__title"},e?.title||e?.slug),(0,a.createElement)("p",null,e?.description)))):null},{Tabs:xn}=Qe(_.privateApis),Tn=u.Platform.select({web:!0,native:!1}),Bn={document:"edit-post/document",block:"edit-post/block"},An=({sidebarName:e,keyboardShortcut:t,isEditingTemplate:o})=>{const n=(0,u.useRef)(null),r=(0,u.useContext)(xn.Context);return(0,u.useEffect)((()=>{const t=Array.from(n.current?.querySelectorAll('[role="tab"]')||[]),o=t.find((t=>t.getAttribute("data-tab-id")===e)),r=o?.ownerDocument.activeElement;t.some((e=>r&&r.id===e.id))&&o&&o.id!==r?.id&&o?.focus()}),[e]),(0,a.createElement)(Pn,{identifier:e,header:(0,a.createElement)(xn.Context.Provider,{value:r},(0,a.createElement)(Xo,{ref:n})),closeLabel:(0,y.__)("Close Settings"),className:"edit-post-sidebar__panel",headerClassName:"edit-post-sidebar__panel-tabs",title:(0,y.__)("Settings"),toggleShortcut:t,icon:(0,y.isRTL)()?Qo:Yo,isActiveByDefault:Tn},(0,a.createElement)(xn.Context.Provider,{value:r},(0,a.createElement)(xn.TabPanel,{tabId:Bn.document,focusable:!1},!o&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(gn,null),(0,a.createElement)(Sn.Slot,null),(0,a.createElement)(b.PostLastRevisionPanel,null),(0,a.createElement)(b.PostTaxonomiesPanel,null),(0,a.createElement)(b.PostFeaturedImagePanel,null),(0,a.createElement)(b.PostExcerptPanel,null),(0,a.createElement)(b.PostDiscussionPanel,null),(0,a.createElement)(b.PageAttributesPanel,null),(0,a.createElement)(_n,{location:"side"})),o&&(0,a.createElement)(Mn,null)),(0,a.createElement)(xn.TabPanel,{tabId:Bn.block,focusable:!1},(0,a.createElement)(v.BlockInspector,null))))},In=()=>{const{sidebarName:e,isSettingsSidebarActive:t,keyboardShortcut:o,isEditingTemplate:n}=(0,m.useSelect)((e=>{let t=e(oe).getActiveComplementaryArea(ro.name),o=!0;[Bn.document,Bn.block].includes(t)||(o=!1,e(v.store).getBlockSelectionStart()&&(t=Bn.block),t=Bn.document);return{sidebarName:t,isSettingsSidebarActive:o,keyboardShortcut:e(we.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),isEditingTemplate:"wp_template"===e(b.store).getCurrentPostType()}}),[]),{openGeneralSidebar:r}=(0,m.useDispatch)(ro),s=(0,u.useCallback)((e=>{e&&r(e)}),[r]);return(0,a.createElement)(xn,{selectedTabId:t?e:null,onSelect:s,selectOnMove:!1},(0,a.createElement)(An,{sidebarName:e,keyboardShortcut:o,isEditingTemplate:n}))};function Nn({nonAnimatedSrc:e,animatedSrc:t}){return(0,a.createElement)("picture",{className:"edit-post-welcome-guide__image"},(0,a.createElement)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,a.createElement)("img",{src:t,width:"312",height:"240",alt:""}))}function Ln(){const{toggleFeature:e}=(0,m.useDispatch)(ro);return(0,a.createElement)(_.Guide,{className:"edit-post-welcome-guide",contentLabel:(0,y.__)("Welcome to the block editor"),finishButtonText:(0,y.__)("Get started"),onFinish:()=>e("welcomeGuide"),pages:[{image:(0,a.createElement)(Nn,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,y.__)("Welcome to the block editor")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,y.__)("In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.")))},{image:(0,a.createElement)(Nn,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,y.__)("Make each block your own")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,y.__)("Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.")))},{image:(0,a.createElement)(Nn,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,y.__)("Get to know the block library")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,u.createInterpolateElement)((0,y.__)("All of the blocks available to you live in the block library. You’ll find it wherever you see the icon."),{InserterIconImage:(0,a.createElement)("img",{alt:(0,y.__)("inserter"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"})})))},{image:(0,a.createElement)(Nn,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,y.__)("Learn how to use the block editor")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,y.__)("New to the block editor? Want to learn more about using it? "),(0,a.createElement)(_.ExternalLink,{href:(0,y.__)("https://wordpress.org/documentation/article/wordpress-block-editor/")},(0,y.__)("Here's a detailed guide."))))}]})}function Fn(){const{toggleFeature:e}=(0,m.useDispatch)(ro);return(0,a.createElement)(_.Guide,{className:"edit-template-welcome-guide",contentLabel:(0,y.__)("Welcome to the template editor"),finishButtonText:(0,y.__)("Get started"),onFinish:()=>e("welcomeGuideTemplate"),pages:[{image:(0,a.createElement)(Nn,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-template-editor.gif"}),content:(0,a.createElement)(a.Fragment,null,(0,a.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,y.__)("Welcome to the template editor")),(0,a.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,y.__)("Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.")))}]})}function Dn(){const{isActive:e,isEditingTemplate:t}=(0,m.useSelect)((e=>{const{isFeatureActive:t}=e(ro),{getCurrentPostType:o}=e(b.store),n="wp_template"===o();return{isActive:t(n?"welcomeGuideTemplate":"welcomeGuide"),isEditingTemplate:n}}),[]);return e?t?(0,a.createElement)(Fn,null):(0,a.createElement)(Ln,null):null}const{Fill:Rn,Slot:On}=(0,_.createSlotFill)("PluginPostPublishPanel"),Vn=({children:e,className:t,title:o,initialOpen:n=!1,icon:r})=>{const{icon:s}=(0,x.usePluginContext)();return(0,a.createElement)(Rn,null,(0,a.createElement)(_.PanelBody,{className:t,initialOpen:n||!o,title:o,icon:null!=r?r:s},e))};Vn.Slot=On;const Gn=Vn,{Fill:zn,Slot:Hn}=(0,_.createSlotFill)("PluginPrePublishPanel"),Un=({children:e,className:t,title:o,initialOpen:n=!1,icon:r})=>{const{icon:s}=(0,x.usePluginContext)();return(0,a.createElement)(zn,null,(0,a.createElement)(_.PanelBody,{className:t,initialOpen:n||!o,title:o,icon:null!=r?r:s},e))};Un.Slot=Hn;const $n=Un,{Fill:Wn,Slot:qn}=(0,_.createSlotFill)("ActionsPanel");function jn({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:o}){const{closePublishSidebar:n,togglePublishSidebar:r}=(0,m.useDispatch)(ro),{publishSidebarOpened:s,hasActiveMetaboxes:i,hasNonPostEntityChanges:l}=(0,m.useSelect)((e=>({publishSidebarOpened:e(ro).isPublishSidebarOpened(),hasActiveMetaboxes:e(ro).hasMetaBoxes(),hasNonPostEntityChanges:e(b.store).hasNonPostEntityChanges()})),[]),c=(0,u.useCallback)((()=>e(!0)),[]);let d;return d=s?(0,a.createElement)(b.PostPublishPanel,{onClose:n,forceIsDirty:i,PrePublishExtension:$n.Slot,PostPublishExtension:Gn.Slot}):l?(0,a.createElement)("div",{className:"edit-post-layout__toggle-entities-saved-states-panel"},(0,a.createElement)(_.Button,{variant:"secondary",className:"edit-post-layout__toggle-entities-saved-states-panel-button",onClick:c,"aria-expanded":!1},(0,y.__)("Open save panel"))):(0,a.createElement)("div",{className:"edit-post-layout__toggle-publish-panel"},(0,a.createElement)(_.Button,{variant:"secondary",className:"edit-post-layout__toggle-publish-panel-button",onClick:r,"aria-expanded":!1},(0,y.__)("Open publish panel"))),(0,a.createElement)(a.Fragment,null,o&&(0,a.createElement)(b.EntitiesSavedStates,{close:t}),(0,a.createElement)(qn,{bubblesVirtually:!0}),!o&&d)}function Qn({blockPatterns:e,onChoosePattern:t}){const o=(0,f.useAsyncList)(e),{resetEditorBlocks:n}=(0,m.useDispatch)(b.store);return(0,a.createElement)(v.__experimentalBlockPatternsList,{blockPatterns:e,shownPatterns:o,onClickPattern:(e,o)=>{n(o),t()}})}function Yn({onClose:e}){const t=function(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,m.useSelect)((e=>{const{getPatternsByBlockTypes:t}=e(v.store),{getCurrentPostType:o}=e(b.store);return{blockPatternsWithPostContentBlockType:t("core/post-content"),postType:o()}}),[]);return(0,u.useMemo)((()=>e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t)))),[t,e])}();return t.length>0?(0,a.createElement)(_.Modal,{className:"edit-post-start-page-options__modal",title:(0,y.__)("Choose a pattern"),isFullScreen:!0,onRequestClose:e},(0,a.createElement)("div",{className:"edit-post-start-page-options__modal-content"},(0,a.createElement)(Qn,{blockPatterns:t,onChoosePattern:e}))):null}function Zn(){const[e,t]=(0,u.useState)(!1),o=(0,m.useSelect)((e=>{const{isCleanNewPost:t,getRenderingMode:o}=e(b.store),{isFeatureActive:n}=e(ro);return"post-only"===o()&&!n("welcomeGuide")&&t()}),[]);return!o||e?null:(0,a.createElement)(Yn,{onClose:()=>t(!0)})}const Xn=(0,a.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(C.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})),Kn=(0,a.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(C.Path,{d:"M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z"})),Jn=(0,a.createElement)(C.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(C.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})),er=(0,a.createElement)(C.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,a.createElement)(C.Path,{d:"M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z"})),tr=(0,a.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(C.Path,{d:"m16 15.5h-8v-1.5h8zm-7.5-2.5h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm-9-3h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2zm3 0h-2v-2h2z"}),(0,a.createElement)(C.Path,{d:"m18.5 6.5h-13a.5.5 0 0 0 -.5.5v9.5a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9.5a.5.5 0 0 0 -.5-.5zm-13-1.5h13a2 2 0 0 1 2 2v9.5a2 2 0 0 1 -2 2h-13a2 2 0 0 1 -2-2v-9.5a2 2 0 0 1 2-2z"})),or=(0,a.createElement)(C.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,a.createElement)(C.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}));const{getLayoutStyles:nr}=Qe(v.privateApis),{useCommands:rr}=Qe(Ve.privateApis),{useCommandContext:sr}=Qe(Oe.privateApis),{InserterSidebar:ar,ListViewSidebar:ir}=Qe(b.privateApis),lr={header:(0,y.__)("Editor top bar"),body:(0,y.__)("Editor content"),sidebar:(0,y.__)("Editor settings"),actions:(0,y.__)("Editor publish"),footer:(0,y.__)("Editor footer")};const cr=function({initialPost:e}){rr(),function(){const{openGeneralSidebar:e,closeGeneralSidebar:t,switchEditorMode:o,toggleDistractionFree:n}=(0,m.useDispatch)(ro),{openModal:r}=(0,m.useDispatch)(oe),{editorMode:s,activeSidebar:a,isListViewOpen:i,isFullscreen:l,isPublishSidebarEnabled:c,showBlockBreadcrumbs:d,isDistractionFree:u,isTopToolbar:p,isFocusMode:h}=(0,m.useSelect)((e=>{const{get:t}=e(g.store),{getEditorMode:o}=e(ro),{isListViewOpened:n}=e(b.store);return{activeSidebar:e(oe).getActiveComplementaryArea(ro.name),editorMode:o(),isListViewOpen:n(),isPublishSidebarEnabled:e(b.store).isPublishSidebarEnabled(),showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),isDistractionFree:t("core","distractionFree"),isFocusMode:t("core","focusMode"),isTopToolbar:t("core","fixedToolbar"),isFullscreen:t("core/edit-post","fullscreenMode")}}),[]),{toggle:E}=(0,m.useDispatch)(g.store),{createInfoNotice:_}=(0,m.useDispatch)(B.store),{__unstableSaveForPreview:v,setIsListViewOpened:f}=(0,m.useDispatch)(b.store),{getCurrentPostId:w}=(0,m.useSelect)(b.store);(0,Oe.useCommand)({name:"core/open-settings-sidebar",label:(0,y.__)("Toggle settings sidebar"),icon:(0,y.isRTL)()?Qo:Yo,callback:({close:o})=>{o(),"edit-post/document"===a?t():e("edit-post/document")}}),(0,Oe.useCommand)({name:"core/open-block-inspector",label:(0,y.__)("Toggle block inspector"),icon:Xn,callback:({close:o})=>{o(),"edit-post/block"===a?t():e("edit-post/block")}}),(0,Oe.useCommand)({name:"core/toggle-distraction-free",label:u?(0,y.__)("Exit Distraction Free"):(0,y.__)("Enter Distraction Free "),callback:({close:e})=>{n(),e()}}),(0,Oe.useCommand)({name:"core/toggle-spotlight-mode",label:(0,y.__)("Toggle spotlight"),callback:({close:e})=>{E("core","focusMode"),e(),_(h?(0,y.__)("Spotlight off."):(0,y.__)("Spotlight on."),{id:"core/edit-post/toggle-spotlight-mode/notice",type:"snackbar",actions:[{label:(0,y.__)("Undo"),onClick:()=>{E("core","focusMode")}}]})}}),(0,Oe.useCommand)({name:"core/toggle-fullscreen-mode",label:l?(0,y.__)("Exit fullscreen"):(0,y.__)("Enter fullscreen"),icon:Kn,callback:({close:e})=>{E("core/edit-post","fullscreenMode"),e(),_(l?(0,y.__)("Fullscreen off."):(0,y.__)("Fullscreen on."),{id:"core/edit-post/toggle-fullscreen-mode/notice",type:"snackbar",actions:[{label:(0,y.__)("Undo"),onClick:()=>{E("core/edit-post","fullscreenMode")}}]})}}),(0,Oe.useCommand)({name:"core/toggle-list-view",label:i?(0,y.__)("Close List View"):(0,y.__)("Open List View"),icon:Jn,callback:({close:e})=>{f(!i),e(),_(i?(0,y.__)("List View off."):(0,y.__)("List View on."),{id:"core/edit-post/toggle-list-view/notice",type:"snackbar"})}}),(0,Oe.useCommand)({name:"core/toggle-top-toolbar",label:(0,y.__)("Toggle top toolbar"),callback:({close:e})=>{E("core","fixedToolbar"),u&&n(),e(),_(p?(0,y.__)("Top toolbar off."):(0,y.__)("Top toolbar on."),{id:"core/edit-post/toggle-top-toolbar/notice",type:"snackbar",actions:[{label:(0,y.__)("Undo"),onClick:()=>{E("core","fixedToolbar")}}]})}}),(0,Oe.useCommand)({name:"core/toggle-code-editor",label:"visual"===s?(0,y.__)("Open code editor"):(0,y.__)("Exit code editor"),icon:er,callback:({close:e})=>{o("visual"===s?"text":"visual"),e()}}),(0,Oe.useCommand)({name:"core/open-preferences",label:(0,y.__)("Editor preferences"),callback:()=>{r(So)}}),(0,Oe.useCommand)({name:"core/open-shortcut-help",label:(0,y.__)("Keyboard shortcuts"),icon:tr,callback:()=>{r(Me)}}),(0,Oe.useCommand)({name:"core/toggle-breadcrumbs",label:d?(0,y.__)("Hide block breadcrumbs"):(0,y.__)("Show block breadcrumbs"),callback:({close:e})=>{E("core","showBlockBreadcrumbs"),e(),_(d?(0,y.__)("Breadcrumbs hidden."):(0,y.__)("Breadcrumbs visible."),{id:"core/edit-post/toggle-breadcrumbs/notice",type:"snackbar"})}}),(0,Oe.useCommand)({name:"core/toggle-publish-sidebar",label:c?(0,y.__)("Disable pre-publish checks"):(0,y.__)("Enable pre-publish checks"),icon:or,callback:({close:e})=>{e(),E("core/edit-post","isPublishSidebarEnabled"),_(c?(0,y.__)("Pre-publish checks disabled."):(0,y.__)("Pre-publish checks enabled."),{id:"core/edit-post/publish-sidebar/notice",type:"snackbar"})}}),(0,Oe.useCommand)({name:"core/preview-link",label:(0,y.__)("Preview in a new tab"),icon:M,callback:async({close:e})=>{e();const t=w(),o=await v();window.open(o,`wp-preview-${t}`)}})}(),(0,v.useBlockCommands)();const t=(0,f.useViewportMatch)("medium","<"),o=(0,f.useViewportMatch)("huge",">="),n=(0,f.useViewportMatch)("large"),r=(0,f.useViewportMatch)("medium"),{openGeneralSidebar:s,closeGeneralSidebar:i}=(0,m.useDispatch)(ro),{createErrorNotice:l}=(0,m.useDispatch)(B.store),{setIsInserterOpened:c}=(0,m.useDispatch)(b.store),{mode:d,isFullscreenActive:p,isRichEditingEnabled:h,sidebarIsOpened:E,hasActiveMetaboxes:w,previousShortcut:S,nextShortcut:P,hasBlockSelected:k,isInserterOpened:C,isListViewOpened:T,showIconLabels:A,isDistractionFree:I,showBlockBreadcrumbs:N,showMetaBoxes:F,documentLabel:D,hasHistory:R}=(0,m.useSelect)((e=>{const{get:t}=e(g.store),{getEditorSettings:o,getPostTypeLabel:n}=e(b.store),r=o(),s=n();return{showMetaBoxes:"post-only"===e(b.store).getRenderingMode(),sidebarIsOpened:!(!e(oe).getActiveComplementaryArea(ro.name)&&!e(ro).isPublishSidebarOpened()),isFullscreenActive:e(ro).isFeatureActive("fullscreenMode"),isInserterOpened:e(b.store).isInserterOpened(),isListViewOpened:e(b.store).isListViewOpened(),mode:e(ro).getEditorMode(),isRichEditingEnabled:r.richEditingEnabled,hasActiveMetaboxes:e(ro).hasMetaBoxes(),previousShortcut:e(we.store).getAllShortcutKeyCombinations("core/edit-post/previous-region"),nextShortcut:e(we.store).getAllShortcutKeyCombinations("core/edit-post/next-region"),showIconLabels:t("core","showIconLabels"),isDistractionFree:t("core","distractionFree"),showBlockBreadcrumbs:t("core","showBlockBreadcrumbs"),documentLabel:s||(0,y._x)("Document","noun"),hasBlockSelected:!!e(v.store).getBlockSelectionStart(),hasHistory:!!o().onNavigateToPreviousEntityRecord}}),[]);sr(k?"block-selection-edit":"post-editor-edit");const O=function(){const{hasThemeStyleSupport:e,editorSettings:t}=(0,m.useSelect)((e=>({hasThemeStyleSupport:e(ro).isFeatureActive("themeStyles"),editorSettings:e(b.store).getEditorSettings()})),[]);return(0,u.useMemo)((()=>{var o,n;const r=null!==(o=t.styles?.filter((e=>e.__unstableType&&"theme"!==e.__unstableType)))&&void 0!==o?o:[],s=[...t.defaultEditorStyles,...r],a=e&&r.length!==(null!==(n=t.styles?.length)&&void 0!==n?n:0);return t.disableLayoutStyles||a||s.push({css:nr({style:{},selector:"body",hasBlockGapSupport:!1,hasFallbackGapSupport:!0,fallbackGapValue:"0.5em"})}),a?t.styles:s}),[t.defaultEditorStyles,t.disableLayoutStyles,t.styles,e])}();(0,u.useEffect)((()=>{E&&!o&&c(!1)}),[o,c,E]),(0,u.useEffect)((()=>{C&&!o&&i()}),[i,C,o]);const[V,G]=(0,u.useState)(!1),z=(0,u.useCallback)((e=>{"function"==typeof V&&V(e),G(!1)}),[V]);A?document.body.classList.add("show-icon-labels"):document.body.classList.remove("show-icon-labels");const H=L()("edit-post-layout","is-mode-"+d,{"is-sidebar-opened":E,"has-metaboxes":w,"is-distraction-free":I&&n,"is-entity-save-view-open":!!V}),U=T?(0,y.__)("Document Overview"):(0,y.__)("Block Library");return(0,a.createElement)(a.Fragment,null,(0,a.createElement)(be,{isActive:p}),(0,a.createElement)(Co,{hasHistory:R}),(0,a.createElement)(b.UnsavedChangesWarning,null),(0,a.createElement)(b.AutosaveMonitor,null),(0,a.createElement)(b.LocalAutosaveMonitor,null),(0,a.createElement)(co,null),(0,a.createElement)(b.EditorKeyboardShortcutsRegister,null),(0,a.createElement)(b.EditorKeyboardShortcuts,null),(0,a.createElement)(ve,{isDistractionFree:I&&n,className:H,labels:{...lr,secondarySidebar:U},header:(0,a.createElement)(jo,{setEntitiesSavedStatesCallback:G,initialPost:e}),editorNotices:(0,a.createElement)(b.EditorNotices,null),secondarySidebar:"visual"===d&&C?(0,a.createElement)(ar,null):"visual"===d&&T?(0,a.createElement)(ir,null):null,sidebar:(!t||E)&&(0,a.createElement)(a.Fragment,null,!t&&!E&&(0,a.createElement)("div",{className:"edit-post-layout__toggle-sidebar-panel"},(0,a.createElement)(_.Button,{variant:"secondary",className:"edit-post-layout__toggle-sidebar-panel-button",onClick:()=>s(k?"edit-post/block":"edit-post/document"),"aria-expanded":!1},k?(0,y.__)("Open block settings"):(0,y.__)("Open document settings"))),(0,a.createElement)(he.Slot,{scope:"core/edit-post"})),notices:(0,a.createElement)(b.EditorSnackbars,null),content:(0,a.createElement)(a.Fragment,null,!I&&(0,a.createElement)(b.EditorNotices,null),("text"===d||!h)&&(0,a.createElement)(so,null),!r&&(0,a.createElement)(v.BlockToolbar,{hideDragHandle:!0}),h&&"visual"===d&&(0,a.createElement)(lo,{styles:O}),!I&&F&&(0,a.createElement)("div",{className:"edit-post-layout__metaboxes"},(0,a.createElement)(_n,{location:"normal"}),(0,a.createElement)(_n,{location:"advanced"})),t&&E&&(0,a.createElement)(_.ScrollLock,null)),footer:!I&&!t&&N&&h&&"visual"===d&&(0,a.createElement)("div",{className:"edit-post-layout__footer"},(0,a.createElement)(v.BlockBreadcrumb,{rootLabelText:D})),actions:(0,a.createElement)(jn,{closeEntitiesSavedStates:z,isEntitiesSavedStatesOpen:V,setEntitiesSavedStatesCallback:G}),shortcuts:{previous:S,next:P}}),(0,a.createElement)(Po,null),(0,a.createElement)(Ae,null),(0,a.createElement)(Dn,null),(0,a.createElement)(b.PostSyncStatusModal,null),(0,a.createElement)(Zn,null),(0,a.createElement)(x.PluginArea,{onError:function(e){l((0,y.sprintf)((0,y.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}),(0,a.createElement)(In,null))},dr=e=>{const{hasBlockSelection:t,isEditorSidebarOpened:o}=(0,m.useSelect)((e=>({hasBlockSelection:!!e(v.store).getBlockSelectionStart(),isEditorSidebarOpened:e(no).isEditorSidebarOpened()})),[e]),{openGeneralSidebar:n}=(0,m.useDispatch)(no);(0,u.useEffect)((()=>{o&&n(t?"edit-post/block":"edit-post/document")}),[t,o])},ur=e=>{const{newPermalink:t}=(0,m.useSelect)((e=>({newPermalink:e(b.store).getCurrentPost().link})),[e]),o=(0,u.useRef)();(0,u.useEffect)((()=>{o.current=document.querySelector("#wp-admin-bar-preview a")||document.querySelector("#wp-admin-bar-view a")}),[e]),(0,u.useEffect)((()=>{t&&o.current&&o.current.setAttribute("href",t)}),[t])};function mr({postId:e}){return dr(e),ur(e),null}const{ExperimentalEditorProvider:pr}=Qe(b.privateApis),{BlockRemovalWarningModal:gr}=Qe(v.privateApis),hr={"bindings/core/pattern-overrides":(0,y.__)("Blocks from synced patterns that can have overriden content.")};const br=function({postId:e,postType:t,settings:o,initialEdits:n,...r}){const{initialPost:s,currentPost:i,onNavigateToEntityRecord:l,onNavigateToPreviousEntityRecord:c}=function(e,t){const[o,n]=(0,u.useReducer)(((e,{type:t,post:o})=>"push"===t?[...e,o]:"pop"===t&&e.length>1?e.slice(0,-1):e),[{postId:e,postType:t}]),r=(0,u.useMemo)((()=>({type:t,id:e})),[t,e]),s=(0,u.useCallback)((e=>{n({type:"push",post:{postId:e.postId,postType:e.postType}})}),[]),a=(0,u.useCallback)((()=>{n({type:"pop"})}),[]);return{currentPost:o[o.length-1],initialPost:r,onNavigateToEntityRecord:s,onNavigateToPreviousEntityRecord:o.length>1?a:void 0}}(e,t),{hasInlineToolbar:d,post:p,preferredStyleVariations:h,template:E}=(0,m.useSelect)((e=>{var t;const{isFeatureActive:o,getEditedPostTemplate:n}=e(ro),{getEntityRecord:r,getPostType:s,canUser:a}=e(k.store),{getEditorSettings:l}=e(b.store),c=r("postType",i.postType,i.postId),d=l().supportsTemplateMode,u=null!==(t=s(i.postType)?.viewable)&&void 0!==t&&t,m=a("create","templates");return{hasInlineToolbar:o("inlineToolbar"),preferredStyleVariations:e(g.store).get("core/edit-post","preferredStyleVariations"),template:d&&u&&m&&"wp_template"!==i.postType?n():null,post:c}}),[i.postType,i.postId]),{updatePreferredStyleVariations:v}=(0,m.useDispatch)(ro),y=(0,u.useMemo)((()=>({...o,onNavigateToEntityRecord:l,onNavigateToPreviousEntityRecord:c,defaultRenderingMode:"post-only",__experimentalPreferredStyleVariations:{value:h,onChange:v},hasInlineToolbar:d})),[o,d,h,v,l,c]);return p?(0,a.createElement)(_.SlotFillProvider,null,(0,a.createElement)(pr,{settings:y,post:p,initialEdits:n,useSubRegistry:!1,__unstableTemplate:E,...r},(0,a.createElement)(b.ErrorBoundary,null,(0,a.createElement)(Oe.CommandMenu,null),(0,a.createElement)(mr,{postId:i.postId}),(0,a.createElement)(cr,{initialPost:s}),(0,a.createElement)(gr,{rules:hr})),(0,a.createElement)(b.PostLockedModal,null))):null},Er=({allowedBlocks:e,icon:t,label:o,onClick:n,small:r,role:s})=>(0,a.createElement)(v.BlockSettingsMenuControls,null,(({selectedBlocks:i,onClose:l})=>((e,t)=>{return!Array.isArray(t)||(o=t,0===e.filter((e=>!o.includes(e))).length);var o})(i,e)?(0,a.createElement)(_.MenuItem,{onClick:(0,f.compose)(n,l),icon:t,label:r?o:void 0,role:s},!r&&o):null)),_r=(0,f.compose)((0,x.withPluginContext)(((e,t)=>{var o;return{as:null!==(o=t.as)&&void 0!==o?o:_.MenuItem,icon:t.icon||e.icon,name:"core/edit-post/plugin-more-menu"}})))(le);function vr(e){return(0,a.createElement)(de,{__unstableExplicitMenuItem:!0,scope:"core/edit-post",...e})}const{PluginPostExcerpt:yr}=Qe(b.privateApis);function fr(e,t,o,n,r){const s=document.getElementById(e),c=(0,u.createRoot)(s);(0,m.dispatch)(g.store).setDefaults("core/edit-post",{fullscreenMode:!0,isPublishSidebarEnabled:!0,preferredStyleVariations:{},themeStyles:!0,welcomeGuide:!0,welcomeGuideTemplate:!0}),(0,m.dispatch)(g.store).setDefaults("core",{allowRightClickOverrides:!0,editorMode:"visual",fixedToolbar:!1,hiddenBlockTypes:[],inactivePanels:[],openPanels:["post-status"],showBlockBreadcrumbs:!0,showIconLabels:!1,showListViewByDefault:!1}),(0,m.dispatch)(i.store).reapplyBlockTypeFilters(),(0,m.select)(g.store).get("core","showListViewByDefault")&&!(0,m.select)(g.store).get("core","distractionFree")&&(0,m.dispatch)(b.store).setIsListViewOpened(!0),(0,l.registerCoreBlocks)(),(0,h.registerLegacyWidgetBlock)({inserter:!1}),(0,h.registerWidgetGroupBlock)({inserter:!1}),(0,p.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((e,t)=>"core/template-part"!==t.name&&e)),(0,p.addFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",((e,t,o,{getBlockParentsByBlockName:n})=>"core/post-content"===t.name?n(o,"core/query").length>0:e));"Standards"!==("CSS1Compat"===document.compatMode?"Standards":"Quirks")&&console.warn("Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening . Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.");return-1!==window.navigator.userAgent.indexOf("iPhone")&&window.addEventListener("scroll",(e=>{const t=document.getElementsByClassName("interface-interface-skeleton__body")[0];e.target===document&&(window.scrollY>100&&(t.scrollTop=t.scrollTop+window.scrollY),document.getElementsByClassName("is-mode-visual")[0]&&window.scrollTo(0,0))})),window.addEventListener("dragover",(e=>e.preventDefault()),!1),window.addEventListener("drop",(e=>e.preventDefault()),!1),c.render((0,a.createElement)(br,{settings:n,postId:o,postType:t,initialEdits:r})),c}function wr(){d()("wp.editPost.reinitializeEditor",{since:"6.2",version:"6.3"})}})(),(window.wp=window.wp||{}).editPost=n})();