mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-19 09:05:22 +01:00
69e0187d65
Includes fixes for footnotes and editor styles related crashes, as well as a cut and paste-related crash. Props ramonopoly. See #59151. Built from https://develop.svn.wordpress.org/trunk@56419 git-svn-id: http://core.svn.wordpress.org/trunk@55931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
7 lines
123 KiB
JavaScript
7 lines
123 KiB
JavaScript
/*! This file is auto-generated */
|
||
(()=>{var e={4403:(e,t)=>{var n;
|
||
/*!
|
||
Copyright (c) 2018 Jed Watson.
|
||
Licensed under the MIT License (MIT), see
|
||
http://jedwatson.github.io/classnames
|
||
*/!function(){"use strict";var o={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var s=a.apply(null,n);s&&e.push(s)}}else if("object"===l){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var r in n)o.call(n,r)&&n[r]&&e.push(r)}}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()}},t={};function n(o){var a=t[o];if(void 0!==a)return a.exports;var l=t[o]={exports:{}};return e[o](l,l.exports,n),l.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{PluginBlockSettingsMenuItem:()=>Ka,PluginDocumentSettingPanel:()=>ua,PluginMoreMenuItem:()=>Ya,PluginPostPublishPanel:()=>Sa,PluginPostStatusInfo:()=>Ao,PluginPrePublishPanel:()=>Ta,PluginSidebar:()=>ma,PluginSidebarMoreMenuItem:()=>Qa,__experimentalFullscreenModeClose:()=>Fn,__experimentalMainDashboardButton:()=>oo,initializeEditor:()=>Xa,reinitializeEditor:()=>Ja,store:()=>on});var e={};n.r(e),n.d(e,{closeModal:()=>q,disableComplementaryArea:()=>H,enableComplementaryArea:()=>F,openModal:()=>W,pinItem:()=>G,setDefaultComplementaryArea:()=>R,setFeatureDefaults:()=>$,setFeatureValue:()=>Z,toggleFeature:()=>z,unpinItem:()=>U});var t={};n.r(t),n.d(t,{getActiveComplementaryArea:()=>j,isComplementaryAreaLoading:()=>K,isFeatureActive:()=>Q,isItemPinned:()=>Y,isModalActive:()=>X});var a={};n.r(a),n.d(a,{__experimentalSetPreviewDeviceType:()=>gt,__unstableCreateTemplate:()=>ft,__unstableSwitchToTemplateMode:()=>bt,closeGeneralSidebar:()=>Ke,closeModal:()=>Qe,closePublishSidebar:()=>Je,hideBlockTypes:()=>ct,initializeMetaBoxes:()=>vt,metaBoxUpdatesFailure:()=>pt,metaBoxUpdatesSuccess:()=>mt,openGeneralSidebar:()=>je,openModal:()=>Ye,openPublishSidebar:()=>Xe,removeEditorPanel:()=>ot,requestMetaBoxUpdates:()=>ut,setAvailableMetaBoxesPerLocation:()=>dt,setIsEditingTemplate:()=>Et,setIsInserterOpened:()=>ht,setIsListViewOpened:()=>_t,showBlockTypes:()=>it,switchEditorMode:()=>lt,toggleEditorPanelEnabled:()=>tt,toggleEditorPanelOpened:()=>nt,toggleFeature:()=>at,togglePinnedPluginItem:()=>st,togglePublishSidebar:()=>et,updatePreferredStyleVariations:()=>rt});var l={};n.r(l),n.d(l,{__experimentalGetInsertionPoint:()=>Qt,__experimentalGetPreviewDeviceType:()=>Kt,areMetaBoxesInitialized:()=>en,getActiveGeneralSidebarName:()=>It,getActiveMetaBoxLocations:()=>Ut,getAllMetaBoxes:()=>Wt,getEditedPostTemplate:()=>tn,getEditorMode:()=>xt,getHiddenBlockTypes:()=>At,getMetaBoxesPerLocation:()=>$t,getPreference:()=>Nt,getPreferences:()=>Lt,hasMetaBoxes:()=>qt,isEditingTemplate:()=>Jt,isEditorPanelEnabled:()=>Ot,isEditorPanelOpened:()=>Rt,isEditorPanelRemoved:()=>Vt,isEditorSidebarOpened:()=>Mt,isFeatureActive:()=>Ht,isInserterOpened:()=>Yt,isListViewOpened:()=>Xt,isMetaBoxLocationActive:()=>Zt,isMetaBoxLocationVisible:()=>zt,isModalActive:()=>Ft,isPluginItemPinned:()=>Gt,isPluginSidebarOpened:()=>Bt,isPublishSidebarOpened:()=>Dt,isSavingMetaBoxes:()=>jt});const s=window.wp.element,r=window.wp.blocks,i=window.wp.blockLibrary,c=window.wp.deprecated;var d=n.n(c);const u=window.wp.data,m=window.wp.hooks,p=window.wp.preferences,g=window.wp.widgets,h=window.wp.mediaUtils;(0,m.addFilter)("editor.MediaUpload","core/edit-post/replace-media-upload",(()=>h.MediaUpload));const _=window.wp.components,E=window.wp.blockEditor,b=window.wp.i18n,f=window.wp.compose,y=(0,f.compose)((0,u.withSelect)(((e,t)=>{if((0,r.hasBlockSupport)(t.name,"multiple",!0))return{};const n=e(E.store).getBlocks().find((({name:e})=>t.name===e));return{originalBlockClientId:n&&n.clientId!==t.clientId&&n.clientId}})),(0,u.withDispatch)(((e,{originalBlockClientId:t})=>({selectFirst:()=>e(E.store).selectBlock(t)})))),v=(0,f.createHigherOrderComponent)((e=>y((({originalBlockClientId:t,selectFirst:n,...o})=>{if(!t)return(0,s.createElement)(e,{...o});const a=(0,r.getBlockType)(o.name),l=function(e){const t=(0,r.findTransform)((0,r.getBlockTransforms)("to",e),(({type:e,blocks:t})=>"block"===e&&1===t.length));if(!t)return null;return(0,r.getBlockType)(t.blocks[0])}(o.name);return[(0,s.createElement)("div",{key:"invalid-preview",style:{minHeight:"60px"}},(0,s.createElement)(e,{key:"block-edit",...o})),(0,s.createElement)(E.Warning,{key:"multiple-use-warning",actions:[(0,s.createElement)(_.Button,{key:"find-original",variant:"secondary",onClick:n},(0,b.__)("Find original")),(0,s.createElement)(_.Button,{key:"remove",variant:"secondary",onClick:()=>o.onReplace([])},(0,b.__)("Remove")),l&&(0,s.createElement)(_.Button,{key:"transform",variant:"secondary",onClick:()=>o.onReplace((0,r.createBlock)(l.name,o.attributes))},(0,b.__)("Transform into:")," ",l.title)]},(0,s.createElement)("strong",null,a?.title,": "),(0,b.__)("This block can only be used once."))]}))),"withMultipleValidation");(0,m.addFilter)("editor.BlockEdit","core/edit-post/validate-multiple-use/with-multiple-validation",v);const w=window.wp.coreData,S=window.wp.editor,k=window.wp.primitives,P=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.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"})),C=window.wp.plugins,T=window.wp.url,x=window.wp.notices;function M(){const{createNotice:e}=(0,u.useDispatch)(x.store),t=(0,u.useSelect)((e=>()=>e(S.store).getEditedPostAttribute("content")),[]);const n=(0,f.useCopyToClipboard)(t,(function(){e("info",(0,b.__)("All content copied."),{isDismissible:!0,type:"snackbar"})}));return(0,s.createElement)(_.MenuItem,{ref:n},(0,b.__)("Copy all blocks"))}const B=window.wp.keycodes;var I=n(4403),L=n.n(I);const N=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),A=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.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"})),D=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.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"})),V=window.wp.viewport,O=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.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"})),R=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),F=(e,t)=>({registry:n,dispatch:o})=>{if(!t)return;n.select(p.store).get(e,"isComplementaryAreaVisible")||n.dispatch(p.store).set(e,"isComplementaryAreaVisible",!0),o({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},H=e=>({registry:t})=>{t.select(p.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(p.store).set(e,"isComplementaryAreaVisible",!1)},G=(e,t)=>({registry:n})=>{if(!t)return;const o=n.select(p.store).get(e,"pinnedItems");!0!==o?.[t]&&n.dispatch(p.store).set(e,"pinnedItems",{...o,[t]:!0})},U=(e,t)=>({registry:n})=>{if(!t)return;const o=n.select(p.store).get(e,"pinnedItems");n.dispatch(p.store).set(e,"pinnedItems",{...o,[t]:!1})};function z(e,t){return function({registry:n}){d()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),n.dispatch(p.store).toggle(e,t)}}function Z(e,t,n){return function({registry:o}){d()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),o.dispatch(p.store).set(e,t,!!n)}}function $(e,t){return function({registry:n}){d()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),n.dispatch(p.store).setDefaults(e,t)}}function W(e){return{type:"OPEN_MODAL",name:e}}function q(){return{type:"CLOSE_MODAL"}}const j=(0,u.createRegistrySelector)((e=>(t,n)=>{const o=e(p.store).get(n,"isComplementaryAreaVisible");if(void 0!==o)return!1===o?null:t?.complementaryAreas?.[n]})),K=(0,u.createRegistrySelector)((e=>(t,n)=>{const o=e(p.store).get(n,"isComplementaryAreaVisible"),a=t?.complementaryAreas?.[n];return o&&void 0===a})),Y=(0,u.createRegistrySelector)((e=>(t,n,o)=>{var a;const l=e(p.store).get(n,"pinnedItems");return null===(a=l?.[o])||void 0===a||a})),Q=(0,u.createRegistrySelector)((e=>(t,n,o)=>(d()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(p.store).get(n,o))));function X(e,t){return e.activeModal===t}const J=(0,u.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:n,area:o}=t;return e[n]?e:{...e,[n]:o}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:n,area:o}=t;return{...e,[n]:o}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}}),ee=(0,u.createReduxStore)("core/interface",{reducer:J,actions:e,selectors:t});(0,u.register)(ee);const te=(0,C.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));const ne=te((function({as:e=_.Button,scope:t,identifier:n,icon:o,selectedIcon:a,name:l,...r}){const i=e,c=(0,u.useSelect)((e=>e(ee).getActiveComplementaryArea(t)===n),[n]),{enableComplementaryArea:d,disableComplementaryArea:m}=(0,u.useDispatch)(ee);return(0,s.createElement)(i,{icon:a&&c?a:o,onClick:()=>{c?m(t):d(t,n)},...r})})),oe=({smallScreenTitle:e,children:t,className:n,toggleButtonProps:o})=>{const a=(0,s.createElement)(ne,{icon:O,...o});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},e&&(0,s.createElement)("span",{className:"interface-complementary-area-header__small-title"},e),a),(0,s.createElement)("div",{className:L()("components-panel__header","interface-complementary-area-header",n),tabIndex:-1},t,a))},ae=()=>{};function le({name:e,as:t=_.Button,onClick:n,...o}){return(0,s.createElement)(_.Fill,{name:e},(({onClick:e})=>(0,s.createElement)(t,{onClick:n||e?(...t)=>{(n||ae)(...t),(e||ae)(...t)}:void 0,...o})))}le.Slot=function({name:e,as:t=_.ButtonGroup,fillProps:n={},bubblesVirtually:o,...a}){return(0,s.createElement)(_.Slot,{name:e,bubblesVirtually:o,fillProps:n},(e=>{if(!s.Children.toArray(e).length)return null;const n=[];s.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&n.push(t)}));const o=s.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&n.includes(e.props.__unstableTarget)?null:e));return(0,s.createElement)(t,{...a},o)}))};const se=le,re=({__unstableExplicitMenuItem:e,__unstableTarget:t,...n})=>(0,s.createElement)(_.MenuItem,{...n});function ie({scope:e,target:t,__unstableExplicitMenuItem:n,...o}){return(0,s.createElement)(ne,{as:o=>(0,s.createElement)(se,{__unstableExplicitMenuItem:n,__unstableTarget:`${e}/${t}`,as:re,name:`${e}/plugin-more-menu`,...o}),role:"menuitemcheckbox",selectedIcon:N,name:t,scope:e,...o})}function ce({scope:e,...t}){return(0,s.createElement)(_.Fill,{name:`PinnedItems/${e}`,...t})}ce.Slot=function({scope:e,className:t,...n}){return(0,s.createElement)(_.Slot,{name:`PinnedItems/${e}`,...n},(e=>e?.length>0&&(0,s.createElement)("div",{className:L()(t,"interface-pinned-items")},e)))};const de=ce;function ue({scope:e,children:t,className:n}){return(0,s.createElement)(_.Fill,{name:`ComplementaryArea/${e}`},(0,s.createElement)("div",{className:n},t))}const me=te((function({children:e,className:t,closeLabel:n=(0,b.__)("Close plugin"),identifier:o,header:a,headerClassName:l,icon:r,isPinnable:i=!0,panelClassName:c,scope:d,name:m,smallScreenTitle:p,title:g,toggleShortcut:h,isActiveByDefault:E,showIconLabels:f=!1}){const{isLoading:y,isActive:v,isPinned:w,activeArea:S,isSmall:k,isLarge:P}=(0,u.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:n,isItemPinned:a}=e(ee),l=t(d);return{isLoading:n(d),isActive:l===o,isPinned:a(d,o),activeArea:l,isSmall:e(V.store).isViewportMatch("< medium"),isLarge:e(V.store).isViewportMatch("large")}}),[o,d]);!function(e,t,n,o,a){const l=(0,s.useRef)(!1),r=(0,s.useRef)(!1),{enableComplementaryArea:i,disableComplementaryArea:c}=(0,u.useDispatch)(ee);(0,s.useEffect)((()=>{o&&a&&!l.current?(c(e),r.current=!0):r.current&&!a&&l.current?(r.current=!1,i(e,t)):r.current&&n&&n!==t&&(r.current=!1),a!==l.current&&(l.current=a)}),[o,a,e,t,n])}(d,o,S,v,k);const{enableComplementaryArea:C,disableComplementaryArea:T,pinItem:x,unpinItem:M}=(0,u.useDispatch)(ee);return(0,s.useEffect)((()=>{E&&void 0===S&&!k?C(d,o):void 0===S&&k&&T(d,o)}),[S,E,d,o,k]),(0,s.createElement)(s.Fragment,null,i&&(0,s.createElement)(de,{scope:d},w&&(0,s.createElement)(ne,{scope:d,identifier:o,isPressed:v&&(!f||P),"aria-expanded":v,"aria-disabled":y,label:g,icon:f?N:r,showTooltip:!f,variant:f?"tertiary":void 0})),m&&i&&(0,s.createElement)(ie,{target:m,scope:d,icon:r},g),v&&(0,s.createElement)(ue,{className:L()("interface-complementary-area",t),scope:d},(0,s.createElement)(oe,{className:l,closeLabel:n,onClose:()=>T(d),smallScreenTitle:p,toggleButtonProps:{label:n,shortcut:h,scope:d,identifier:o}},a||(0,s.createElement)(s.Fragment,null,(0,s.createElement)("strong",null,g),i&&(0,s.createElement)(_.Button,{className:"interface-complementary-area__pin-unpin-item",icon:w?A:D,label:w?(0,b.__)("Unpin from toolbar"):(0,b.__)("Pin to toolbar"),onClick:()=>(w?M:x)(d,o),isPressed:w,"aria-expanded":w}))),(0,s.createElement)(_.Panel,{className:c},e)))}));me.Slot=function({scope:e,...t}){return(0,s.createElement)(_.Slot,{name:`ComplementaryArea/${e}`,...t})};const pe=me,ge=({isActive:e})=>((0,s.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,s.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 he({children:e,className:t,ariaLabel:n,as:o="div",...a}){return(0,s.createElement)(o,{className:L()("interface-navigable-region",t),"aria-label":n,role:"region",tabIndex:"-1",...a},e)}const _e={hidden:{opacity:0},hover:{opacity:1,transition:{type:"tween",delay:.2,delayChildren:.2}},distractionFreeInactive:{opacity:1,transition:{delay:0}}};const Ee=(0,s.forwardRef)((function({isDistractionFree:e,footer:t,header:n,editorNotices:o,sidebar:a,secondarySidebar:l,notices:r,content:i,actions:c,labels:d,className:u,enableRegionNavigation:m=!0,shortcuts:p},g){const h=(0,_.__unstableUseNavigateRegions)(p);!function(e){(0,s.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,b.__)("Header"),body:(0,b.__)("Content"),secondarySidebar:(0,b.__)("Block Library"),sidebar:(0,b.__)("Settings"),actions:(0,b.__)("Publish"),footer:(0,b.__)("Footer")},...d};return(0,s.createElement)("div",{...m?h:{},ref:(0,f.useMergeRefs)([g,m?h.ref:void 0]),className:L()(u,"interface-interface-skeleton",h.className,!!t&&"has-footer")},(0,s.createElement)("div",{className:"interface-interface-skeleton__editor"},!!n&&(0,s.createElement)(he,{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},n),e&&(0,s.createElement)("div",{className:"interface-interface-skeleton__header"},o),(0,s.createElement)("div",{className:"interface-interface-skeleton__body"},!!l&&(0,s.createElement)(he,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:E.secondarySidebar},l),!!r&&(0,s.createElement)("div",{className:"interface-interface-skeleton__notices"},r),(0,s.createElement)(he,{className:"interface-interface-skeleton__content",ariaLabel:E.body},i),!!a&&(0,s.createElement)(he,{className:"interface-interface-skeleton__sidebar",ariaLabel:E.sidebar},a),!!c&&(0,s.createElement)(he,{className:"interface-interface-skeleton__actions",ariaLabel:E.actions},c))),!!t&&(0,s.createElement)(he,{className:"interface-interface-skeleton__footer",ariaLabel:E.footer},t))})),be=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));function fe({as:e=_.DropdownMenu,className:t,label:n=(0,b.__)("Options"),popoverProps:o,toggleProps:a,children:l}){return(0,s.createElement)(e,{className:L()("interface-more-menu-dropdown",t),icon:be,label:n,popoverProps:{placement:"bottom-end",...o,className:L()("interface-more-menu-dropdown__content",o?.className)},toggleProps:{tooltipPosition:"bottom",...a}},(e=>l(e)))}function ye({closeModal:e,children:t}){return(0,s.createElement)(_.Modal,{className:"interface-preferences-modal",title:(0,b.__)("Preferences"),onRequestClose:e},t)}const ve=function({icon:e,size:t=24,...n}){return(0,s.cloneElement)(e,{width:t,height:t,...n})},we=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),Se=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),ke="preferences-menu";function Pe({sections:e}){const t=(0,f.useViewportMatch)("medium"),[n,o]=(0,s.useState)(ke),{tabs:a,sectionsContentMap:l}=(0,s.useMemo)((()=>{let t={tabs:[],sectionsContentMap:{}};return e.length&&(t=e.reduce(((e,{name:t,tabLabel:n,content:o})=>(e.tabs.push({name:t,title:n}),e.sectionsContentMap[t]=o,e)),{tabs:[],sectionsContentMap:{}})),t}),[e]),r=(0,s.useCallback)((e=>l[e.name]||null),[l]);let i;return i=t?(0,s.createElement)(_.TabPanel,{className:"interface-preferences__tabs",tabs:a,initialTabName:n!==ke?n:void 0,onSelect:o,orientation:"vertical"},r):(0,s.createElement)(_.__experimentalNavigatorProvider,{initialPath:"/",className:"interface-preferences__provider"},(0,s.createElement)(_.__experimentalNavigatorScreen,{path:"/"},(0,s.createElement)(_.Card,{isBorderless:!0,size:"small"},(0,s.createElement)(_.CardBody,null,(0,s.createElement)(_.__experimentalItemGroup,null,a.map((e=>(0,s.createElement)(_.__experimentalNavigatorButton,{key:e.name,path:e.name,as:_.__experimentalItem,isAction:!0},(0,s.createElement)(_.__experimentalHStack,{justify:"space-between"},(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(_.__experimentalTruncate,null,e.title)),(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(ve,{icon:(0,b.isRTL)()?we:Se})))))))))),e.length&&e.map((e=>(0,s.createElement)(_.__experimentalNavigatorScreen,{key:`${e.name}-menu`,path:e.name},(0,s.createElement)(_.Card,{isBorderless:!0,size:"large"},(0,s.createElement)(_.CardHeader,{isBorderless:!1,justify:"left",size:"small",gap:"6"},(0,s.createElement)(_.__experimentalNavigatorBackButton,{icon:(0,b.isRTL)()?Se:we,"aria-label":(0,b.__)("Navigate to the previous view")}),(0,s.createElement)(_.__experimentalText,{size:"16"},e.tabLabel)),(0,s.createElement)(_.CardBody,null,e.content)))))),i}const Ce=({description:e,title:t,children:n})=>(0,s.createElement)("fieldset",{className:"interface-preferences-modal__section"},(0,s.createElement)("legend",{className:"interface-preferences-modal__section-legend"},(0,s.createElement)("h2",{className:"interface-preferences-modal__section-title"},t),e&&(0,s.createElement)("p",{className:"interface-preferences-modal__section-description"},e)),n);const Te=function({help:e,label:t,isChecked:n,onChange:o,children:a}){return(0,s.createElement)("div",{className:"interface-preferences-modal__option"},(0,s.createElement)(_.ToggleControl,{__nextHasNoMarginBottom:!0,help:e,label:t,checked:n,onChange:o}),a)},xe=window.wp.keyboardShortcuts,Me=[{keyCombination:{modifier:"primary",character:"b"},description:(0,b.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,b.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,b.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,b.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,b.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,b.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,b.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,b.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},description:(0,b.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,b.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")}];function Be({keyCombination:e,forceAriaLabel:t}){const n=e.modifier?B.displayShortcutList[e.modifier](e.character):e.character,o=e.modifier?B.shortcutAriaLabel[e.modifier](e.character):e.character;return(0,s.createElement)("kbd",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||o},(Array.isArray(n)?n:[n]).map(((e,t)=>"+"===e?(0,s.createElement)(s.Fragment,{key:t},e):(0,s.createElement)("kbd",{key:t,className:"edit-post-keyboard-shortcut-help-modal__shortcut-key"},e))))}const Ie=function({description:e,keyCombination:t,aliases:n=[],ariaLabel:o}){return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-description"},e),(0,s.createElement)("div",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-term"},(0,s.createElement)(Be,{keyCombination:t,forceAriaLabel:o}),n.map(((e,t)=>(0,s.createElement)(Be,{keyCombination:e,forceAriaLabel:o,key:t})))))};const Le=function({name:e}){const{keyCombination:t,description:n,aliases:o}=(0,u.useSelect)((t=>{const{getShortcutKeyCombination:n,getShortcutDescription:o,getShortcutAliases:a}=t(xe.store);return{keyCombination:n(e),aliases:a(e),description:o(e)}}),[e]);return t?(0,s.createElement)(Ie,{keyCombination:t,description:n,aliases:o}):null},Ne="edit-post/keyboard-shortcut-help",Ae=({shortcuts:e})=>(0,s.createElement)("ul",{className:"edit-post-keyboard-shortcut-help-modal__shortcut-list",role:"list"},e.map(((e,t)=>(0,s.createElement)("li",{className:"edit-post-keyboard-shortcut-help-modal__shortcut",key:t},"string"==typeof e?(0,s.createElement)(Le,{name:e}):(0,s.createElement)(Ie,{...e}))))),De=({title:e,shortcuts:t,className:n})=>(0,s.createElement)("section",{className:L()("edit-post-keyboard-shortcut-help-modal__section",n)},!!e&&(0,s.createElement)("h2",{className:"edit-post-keyboard-shortcut-help-modal__section-title"},e),(0,s.createElement)(Ae,{shortcuts:t})),Ve=({title:e,categoryName:t,additionalShortcuts:n=[]})=>{const o=(0,u.useSelect)((e=>e(xe.store).getCategoryShortcuts(t)),[t]);return(0,s.createElement)(De,{title:e,shortcuts:o.concat(n)})};const Oe=(0,f.compose)([(0,u.withSelect)((e=>({isModalActive:e(ee).isModalActive(Ne)}))),(0,u.withDispatch)(((e,{isModalActive:t})=>{const{openModal:n,closeModal:o}=e(ee);return{toggleModal:()=>t?o():n(Ne)}}))])((function({isModalActive:e,toggleModal:t}){return(0,xe.useShortcut)("core/edit-post/keyboard-shortcuts",t),e?(0,s.createElement)(_.Modal,{className:"edit-post-keyboard-shortcut-help-modal",title:(0,b.__)("Keyboard shortcuts"),closeButtonLabel:(0,b.__)("Close"),onRequestClose:t},(0,s.createElement)(De,{className:"edit-post-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-post/keyboard-shortcuts"]}),(0,s.createElement)(Ve,{title:(0,b.__)("Global shortcuts"),categoryName:"global"}),(0,s.createElement)(Ve,{title:(0,b.__)("Selection shortcuts"),categoryName:"selection"}),(0,s.createElement)(Ve,{title:(0,b.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,b.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,b.__)("Forward-slash")}]}),(0,s.createElement)(De,{title:(0,b.__)("Text formatting"),shortcuts:Me})):null}));const Re=(0,u.withDispatch)((e=>{const{openModal:t}=e(ee);return{openModal:t}}))((function({openModal:e}){return(0,s.createElement)(_.MenuItem,{onClick:()=>{e(Ne)},shortcut:B.displayShortcut.access("h")},(0,b.__)("Keyboard shortcuts"))})),{Fill:Fe,Slot:He}=(0,_.createSlotFill)("ToolsMoreMenuGroup");Fe.Slot=({fillProps:e})=>(0,s.createElement)(He,{fillProps:e},(e=>e.length>0&&(0,s.createElement)(_.MenuGroup,{label:(0,b.__)("Tools")},e)));const Ge=Fe;function Ue(e=[],t){const n=[...e];for(const e of t){const t=n.findIndex((t=>t.id===e.id));-1!==t?n[t]=e:n.push(e)}return n}const ze=(0,u.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 n={...e};for(const[e,o]of Object.entries(t.metaBoxesPerLocation))n[e]=Ue(n[e],o);return n}return e},initialized:function(e=!1,t){return"META_BOXES_INITIALIZED"===t.type||e}}),Ze=(0,u.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},removedPanels:function(e=[],t){if("REMOVE_PANEL"===t.type)if(!e.includes(t.panelName))return[...e,t.panelName];return e},deviceType:function(e="Desktop",t){return"SET_PREVIEW_DEVICE_TYPE"===t.type?t.deviceType:e},blockInserterPanel:function(e=!1,t){switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},listViewPanel:function(e=!1,t){switch(t.type){case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e},isEditingTemplate:function(e=!1,t){return"SET_IS_EDITING_TEMPLATE"===t.type?t.value:e}}),$e=window.wp.apiFetch;var We=n.n($e);const qe=window.wp.a11y,je=e=>({registry:t})=>t.dispatch(ee).enableComplementaryArea(on.name,e),Ke=()=>({registry:e})=>e.dispatch(ee).disableComplementaryArea(on.name),Ye=e=>({registry:t})=>(d()("select( 'core/edit-post' ).openModal( name )",{since:"6.3",alternative:"select( 'core/interface').openModal( name )"}),t.dispatch(ee).openModal(e)),Qe=()=>({registry:e})=>(d()("select( 'core/edit-post' ).closeModal()",{since:"6.3",alternative:"select( 'core/interface').closeModal()"}),e.dispatch(ee).closeModal());function Xe(){return{type:"OPEN_PUBLISH_SIDEBAR"}}function Je(){return{type:"CLOSE_PUBLISH_SIDEBAR"}}function et(){return{type:"TOGGLE_PUBLISH_SIDEBAR"}}const tt=e=>({registry:t})=>{var n;const o=null!==(n=t.select(p.store).get("core/edit-post","inactivePanels"))&&void 0!==n?n:[];let a;a=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(p.store).set("core/edit-post","inactivePanels",a)},nt=e=>({registry:t})=>{var n;const o=null!==(n=t.select(p.store).get("core/edit-post","openPanels"))&&void 0!==n?n:[];let a;a=!!o?.includes(e)?o.filter((t=>t!==e)):[...o,e],t.dispatch(p.store).set("core/edit-post","openPanels",a)};function ot(e){return{type:"REMOVE_PANEL",panelName:e}}const at=e=>({registry:t})=>t.dispatch(p.store).toggle("core/edit-post",e),lt=e=>({registry:t})=>{t.dispatch(p.store).set("core/edit-post","editorMode",e),"visual"!==e&&t.dispatch(E.store).clearSelectedBlock();const n="visual"===e?(0,b.__)("Visual editor selected"):(0,b.__)("Code editor selected");(0,qe.speak)(n,"assertive")},st=e=>({registry:t})=>{const n=t.select(ee).isItemPinned("core/edit-post",e);t.dispatch(ee)[n?"unpinItem":"pinItem"]("core/edit-post",e)},rt=(e,t)=>({registry:n})=>{var o;if(!e)return;const a=null!==(o=n.select(p.store).get("core/edit-post","preferredStyleVariations"))&&void 0!==o?o:{};if(t)n.dispatch(p.store).set("core/edit-post","preferredStyleVariations",{...a,[e]:t});else{const t={...a};delete t[e],n.dispatch(p.store).set("core/edit-post","preferredStyleVariations",t)}},it=e=>({registry:t})=>{var n;const o=(null!==(n=t.select(p.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==n?n:[]).filter((t=>!(Array.isArray(e)?e:[e]).includes(t)));t.dispatch(p.store).set("core/edit-post","hiddenBlockTypes",o)},ct=e=>({registry:t})=>{var n;const o=null!==(n=t.select(p.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==n?n:[],a=new Set([...o,...Array.isArray(e)?e:[e]]);t.dispatch(p.store).set("core/edit-post","hiddenBlockTypes",[...a])};function dt(e){return{type:"SET_META_BOXES_PER_LOCATIONS",metaBoxesPerLocation:e}}const ut=()=>async({registry:e,select:t,dispatch:n})=>{n({type:"REQUEST_META_BOX_UPDATES"}),window.tinyMCE&&window.tinyMCE.triggerSave();const o=e.select(S.store).getCurrentPost(),a=[!!o.comment_status&&["comment_status",o.comment_status],!!o.ping_status&&["ping_status",o.ping_status],!!o.sticky&&["sticky",o.sticky],!!o.author&&["post_author",o.author]].filter(Boolean),l=[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[n,o]of t)e.append(n,o);return e}),new window.FormData);a.forEach((([e,t])=>l.append(e,t)));try{await We()({url:window._wpMetaBoxUrl,method:"POST",body:l,parse:!1}),n.metaBoxUpdatesSuccess()}catch{n.metaBoxUpdatesFailure()}};function mt(){return{type:"META_BOX_UPDATES_SUCCESS"}}function pt(){return{type:"META_BOX_UPDATES_FAILURE"}}function gt(e){return{type:"SET_PREVIEW_DEVICE_TYPE",deviceType:e}}function ht(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function _t(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}function Et(e){return{type:"SET_IS_EDITING_TEMPLATE",value:e}}const bt=(e=!1)=>({registry:t,select:n,dispatch:o})=>{o(Et(!0));if(!n.isFeatureActive("welcomeGuideTemplate")){const n=e?(0,b.__)("Custom template created. You're in template mode now."):(0,b.__)("Editing template. Changes made here affect all posts and pages that use the template.");t.dispatch(x.store).createSuccessNotice(n,{type:"snackbar"})}},ft=e=>async({registry:t})=>{const n=await t.dispatch(w.store).saveEntityRecord("postType","wp_template",e),o=t.select(S.store).getCurrentPost();t.dispatch(w.store).editEntityRecord("postType",o.type,o.id,{template:n.slug})};let yt=!1;const vt=()=>({registry:e,select:t,dispatch:n})=>{if(!e.select(S.store).__unstableIsEditorReady())return;if(yt)return;const o=e.select(S.store).getCurrentPostType();window.postboxes.page!==o&&window.postboxes.add_postbox_toggles(o),yt=!0;let a=e.select(S.store).isSavingPost(),l=e.select(S.store).isAutosavingPost();e.subscribe((async()=>{const o=e.select(S.store).isSavingPost(),s=e.select(S.store).isAutosavingPost(),r=a&&!l&&!o&&t.hasMetaBoxes();a=o,l=s,r&&await n.requestMetaBoxUpdates()})),n({type:"META_BOXES_INITIALIZED"})};var wt={};function St(e){return[e]}function kt(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function Pt(e,t){var n,o=t||St;function a(){n=new WeakMap}function l(){var t,a,l,s,r,i=arguments.length;for(s=new Array(i),l=0;l<i;l++)s[l]=arguments[l];for(t=function(e){var t,o,a,l,s,r=n,i=!0;for(t=0;t<e.length;t++){if(!(s=o=e[t])||"object"!=typeof s){i=!1;break}r.has(o)?r=r.get(o):(a=new WeakMap,r.set(o,a),r=a)}return r.has(wt)||((l=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=i,r.set(wt,l)),r.get(wt)}(r=o.apply(null,s)),t.isUniqueByDependants||(t.lastDependants&&!kt(r,t.lastDependants,0)&&t.clear(),t.lastDependants=r),a=t.head;a;){if(kt(a.args,s,1))return a!==t.head&&(a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=t.head,a.prev=null,t.head.prev=a,t.head=a),a.val;a=a.next}return a={val:e.apply(null,s)},s[0]=null,a.args=s,t.head&&(t.head.prev=a,a.next=t.head),t.head=a,a.val}return l.getDependants=o,l.clear=a,a(),l}const Ct=[],Tt={},xt=(0,u.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(p.store).get("core/edit-post","editorMode"))&&void 0!==t?t:"visual"})),Mt=(0,u.createRegistrySelector)((e=>()=>{const t=e(ee).getActiveComplementaryArea("core/edit-post");return["edit-post/document","edit-post/block"].includes(t)})),Bt=(0,u.createRegistrySelector)((e=>()=>{const t=e(ee).getActiveComplementaryArea("core/edit-post");return!!t&&!["edit-post/document","edit-post/block"].includes(t)})),It=(0,u.createRegistrySelector)((e=>()=>e(ee).getActiveComplementaryArea("core/edit-post")));const Lt=(0,u.createRegistrySelector)((e=>()=>{d()("select( 'core/edit-post' ).getPreferences",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const t=["hiddenBlockTypes","editorMode","preferredStyleVariations"].reduce(((t,n)=>({...t,[n]:e(p.store).get("core/edit-post",n)})),{}),n=function(e,t){var n;const o=e?.reduce(((e,t)=>({...e,[t]:{enabled:!1}})),{}),a=t?.reduce(((e,t)=>{const n=e?.[t];return{...e,[t]:{...n,opened:!0}}}),null!=o?o:{});return null!==(n=null!=a?a:o)&&void 0!==n?n:Tt}(e(p.store).get("core/edit-post","inactivePanels"),e(p.store).get("core/edit-post","openPanels"));return{...t,panels:n}}));function Nt(e,t,n){d()("select( 'core/edit-post' ).getPreference",{since:"6.0",alternative:"select( 'core/preferences' ).get"});const o=Lt(e)[t];return void 0===o?n:o}const At=(0,u.createRegistrySelector)((e=>()=>{var t;return null!==(t=e(p.store).get("core/edit-post","hiddenBlockTypes"))&&void 0!==t?t:Ct}));function Dt(e){return e.publishSidebarActive}function Vt(e,t){return e.removedPanels.includes(t)}const Ot=(0,u.createRegistrySelector)((e=>(t,n)=>{const o=e(p.store).get("core/edit-post","inactivePanels");return!Vt(t,n)&&!o?.includes(n)})),Rt=(0,u.createRegistrySelector)((e=>(t,n)=>{const o=e(p.store).get("core/edit-post","openPanels");return!!o?.includes(n)})),Ft=(0,u.createRegistrySelector)((e=>(t,n)=>(d()("select( 'core/edit-post' ).isModalActive",{since:"6.3",alternative:"select( 'core/interface' ).isModalActive"}),!!e(ee).isModalActive(n)))),Ht=(0,u.createRegistrySelector)((e=>(t,n)=>!!e(p.store).get("core/edit-post",n))),Gt=(0,u.createRegistrySelector)((e=>(t,n)=>e(ee).isItemPinned("core/edit-post",n))),Ut=Pt((e=>Object.keys(e.metaBoxes.locations).filter((t=>Zt(e,t)))),(e=>[e.metaBoxes.locations]));function zt(e,t){return Zt(e,t)&&$t(e,t)?.some((({id:t})=>Ot(e,`meta-box-${t}`)))}function Zt(e,t){const n=$t(e,t);return!!n&&0!==n.length}function $t(e,t){return e.metaBoxes.locations[t]}const Wt=Pt((e=>Object.values(e.metaBoxes.locations).flat()),(e=>[e.metaBoxes.locations]));function qt(e){return Ut(e).length>0}function jt(e){return e.metaBoxes.isSaving}function Kt(e){return e.deviceType}function Yt(e){return!!e.blockInserterPanel}function Qt(e){const{rootClientId:t,insertionIndex:n,filterValue:o}=e.blockInserterPanel;return{rootClientId:t,insertionIndex:n,filterValue:o}}function Xt(e){return e.listViewPanel}function Jt(e){return e.isEditingTemplate}function en(e){return e.metaBoxes.initialized}const tn=(0,u.createRegistrySelector)((e=>()=>{const t=e(S.store).getEditedPostAttribute("template");if(t){const n=e(w.store).getEntityRecords("postType","wp_template",{per_page:-1})?.find((e=>e.slug===t));return n?e(w.store).getEditedEntityRecord("postType","wp_template",n.id):n}const n=e(S.store).getCurrentPost();return n.link?e(w.store).__experimentalGetTemplateForLink(n.link):null})),nn="core/edit-post",on=(0,u.createReduxStore)(nn,{reducer:Ze,actions:a,selectors:l});function an(){const e=(0,u.useSelect)((e=>e(on).isEditingTemplate()),[]);return(0,s.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:e?"welcomeGuideTemplate":"welcomeGuide",label:(0,b.__)("Welcome Guide")})}function ln(){const e=(0,u.useSelect)((e=>{const{canUser:t}=e(w.store),{getEditorSettings:n}=e(S.store),o=n().__unstableIsBlockBasedTheme,a=(0,T.addQueryArgs)("edit.php",{post_type:"wp_block"}),l=(0,T.addQueryArgs)("site-editor.php",{path:"/patterns"});return t("read","templates")&&o?l:a}),[]);return(0,s.createElement)(_.MenuItem,{role:"menuitem",href:e},(0,b.__)("Manage patterns"))}(0,u.register)(on),(0,C.registerPlugin)("edit-post",{render:()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ge,null,(({onClose:e})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ln,null),(0,s.createElement)(Re,{onSelect:e}),(0,s.createElement)(an,null),(0,s.createElement)(M,null),(0,s.createElement)(_.MenuItem,{role:"menuitem",icon:P,href:(0,b.__)("https://wordpress.org/documentation/article/wordpress-block-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,b.__)("Help"),(0,s.createElement)(_.VisuallyHidden,{as:"span"},(0,b.__)("(opens in a new tab)")))))))});const sn=window.wp.commands,rn=window.wp.coreCommands;function cn(){const e=(0,u.useSelect)((e=>e(S.store).getEditorSettings().richEditingEnabled),[]),{switchEditorMode:t}=(0,u.useDispatch)(on);return(0,s.createElement)("div",{className:"edit-post-text-editor"},(0,s.createElement)(S.TextEditorGlobalKeyboardShortcuts,null),e&&(0,s.createElement)("div",{className:"edit-post-text-editor__toolbar"},(0,s.createElement)("h2",null,(0,b.__)("Editing code")),(0,s.createElement)(_.Button,{variant:"tertiary",onClick:()=>t("visual"),shortcut:B.displayShortcut.secondary("m")},(0,b.__)("Exit code editor"))),(0,s.createElement)("div",{className:"edit-post-text-editor__body"},(0,s.createElement)(S.PostTitle,null),(0,s.createElement)(S.PostTextEditor,null)))}const dn=window.wp.privateApis,{lock:un,unlock:mn}=(0,dn.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.","@wordpress/edit-post"),{LayoutStyle:pn,useLayoutClasses:gn,useLayoutStyles:hn}=mn(E.privateApis),_n=!1;function En({children:e,contentRef:t,shouldIframe:n,styles:o,style:a}){const l=(0,E.__unstableUseMouseMoveTypingReset)();return n?(0,s.createElement)(E.__unstableIframe,{ref:l,contentRef:t,style:{width:"100%",height:"100%",display:"block"},name:"editor-canvas"},(0,s.createElement)(E.__unstableEditorStyles,{styles:o}),e):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(E.__unstableEditorStyles,{styles:o}),(0,s.createElement)(E.WritingFlow,{ref:t,className:"editor-styles-wrapper",style:{flex:"1",...a},tabIndex:-1},e))}function bn(e){for(let t=0;t<e.length;t++){if("core/post-content"===e[t].name)return e[t].attributes;if(e[t].innerBlocks.length){const n=bn(e[t].innerBlocks);if(n)return n}}}function fn({styles:e}){const{deviceType:t,isWelcomeGuideVisible:n,isTemplateMode:o,postContentAttributes:a,editedPostTemplate:l={},wrapperBlockName:i,wrapperUniqueId:c,isBlockBasedTheme:d,hasV3BlocksOnly:m}=(0,u.useSelect)((e=>{const{isFeatureActive:t,isEditingTemplate:n,getEditedPostTemplate:o,__experimentalGetPreviewDeviceType:a}=e(on),{getCurrentPostId:l,getCurrentPostType:s,getEditorSettings:i}=e(S.store),{getBlockTypes:c}=e(r.store),d=n();let u;"wp_block"===s()?u="core/block":d||(u="core/post-content");const m=i(),p=m.supportsTemplateMode,g=e(w.store).canUser("create","templates");return{deviceType:a(),isWelcomeGuideVisible:t("welcomeGuide"),isTemplateMode:d,postContentAttributes:i().postContentAttributes,editedPostTemplate:p&&g?o():void 0,wrapperBlockName:u,wrapperUniqueId:l(),isBlockBasedTheme:m.__unstableIsBlockBasedTheme,hasV3BlocksOnly:c().every((e=>e.apiVersion>=3))}}),[]),{isCleanNewPost:p}=(0,u.useSelect)(S.store),g=(0,u.useSelect)((e=>e(on).hasMetaBoxes()),[]),{hasRootPaddingAwareAlignments:h,isFocusMode:b,themeHasDisabledLayoutStyles:y,themeSupportsLayout:v}=(0,u.useSelect)((e=>{const t=e(E.store).getSettings();return{themeHasDisabledLayoutStyles:t.disableLayoutStyles,themeSupportsLayout:t.supportsLayout,isFocusMode:t.focusMode,hasRootPaddingAwareAlignments:t.__experimentalFeatures?.useRootPaddingAwareAlignments}}),[]),k={height:"100%",width:"100%",margin:0,display:"flex",flexFlow:"column",background:"white"},P={...k,borderRadius:"2px 2px 0 0",border:"1px solid #ddd",borderBottom:0},C=(0,E.__experimentalUseResizeCanvas)(t,o),T=(0,E.useSetting)("layout"),x="is-"+t.toLowerCase()+"-preview";let M,B=o?P:k;C&&(B=C),g||C||o||(M="40vh");const I=(0,s.useRef)(),N=(0,f.useMergeRefs)([I,(0,E.__unstableUseClipboardHandler)(),(0,E.__unstableUseTypewriter)(),(0,E.__unstableUseTypingObserver)(),(0,E.__unstableUseBlockSelectionClearer)()]),A=(0,E.__unstableUseBlockSelectionClearer)(),D=(0,s.useMemo)((()=>o?{type:"default"}:v?{...T,type:"constrained"}:{type:"default"}),[o,v,T]),V=(0,s.useMemo)((()=>{if(!l?.content&&!l?.blocks)return a;if(l?.blocks)return bn(l?.blocks);const e="string"==typeof l?.content?l?.content:"";return bn((0,r.parse)(e))||{}}),[l?.content,l?.blocks,a]),{layout:O={},align:R=""}=V||{},F=gn(V,"core/post-content"),H=L()({"is-layout-flow":!v},v&&F,R&&`align${R}`),G=hn(V,"core/post-content",".block-editor-block-list__layout.is-root-container"),U=(0,s.useMemo)((()=>O&&("constrained"===O?.type||O?.inherit||O?.contentSize||O?.wideSize)?{...T,...O,type:"constrained"}:{...T,...O,type:"default"}),[O?.type,O?.inherit,O?.contentSize,O?.wideSize,T]),z=a?U:D,Z=(0,s.useRef)();(0,s.useEffect)((()=>{!n&&p()&&Z?.current?.focus()}),[n,p]),e=(0,s.useMemo)((()=>[...e,{css:".edit-post-visual-editor__post-title-wrapper{margin-top:4rem}"+(M?`body{padding-bottom:${M}}`:"")}]),[e]);return(0,s.createElement)(E.BlockTools,{__unstableContentRef:I,className:L()("edit-post-visual-editor",{"is-template-mode":o})},(0,s.createElement)(S.VisualEditorGlobalKeyboardShortcuts,null),(0,s.createElement)(_.__unstableMotion.div,{className:"edit-post-visual-editor__content-area",animate:{padding:o?"48px 48px 0":0},ref:A},(0,s.createElement)(_.__unstableMotion.div,{animate:B,initial:k,className:x},(0,s.createElement)(En,{shouldIframe:(m||_n&&d)&&!g||o||"Tablet"===t||"Mobile"===t,contentRef:N,styles:e},v&&!y&&!o&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(pn,{selector:".edit-post-visual-editor__post-title-wrapper",layout:D}),(0,s.createElement)(pn,{selector:".block-editor-block-list__layout.is-root-container",layout:z}),R&&(0,s.createElement)(pn,{css:".is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}"}),G&&(0,s.createElement)(pn,{layout:U,css:G})),!o&&(0,s.createElement)("div",{className:L()("edit-post-visual-editor__post-title-wrapper",{"is-focus-mode":b,"has-global-padding":h}),contentEditable:!1},(0,s.createElement)(S.PostTitle,{ref:Z})),(0,s.createElement)(E.__experimentalRecursionProvider,{blockName:i,uniqueId:c},(0,s.createElement)(E.BlockList,{className:o?"wp-site-blocks":`${H} wp-block-post-content`,layout:z}))))))}const yn=function(){const{getBlockSelectionStart:e}=(0,u.useSelect)(E.store),{getEditorMode:t,isEditorSidebarOpened:n,isListViewOpened:o,isFeatureActive:a}=(0,u.useSelect)(on),l=(0,u.useSelect)((e=>{const{richEditingEnabled:t,codeEditingEnabled:n}=e(S.store).getEditorSettings();return!t||!n}),[]),{createInfoNotice:i}=(0,u.useDispatch)(x.store),{switchEditorMode:c,openGeneralSidebar:d,closeGeneralSidebar:m,toggleFeature:g,setIsListViewOpened:h,setIsInserterOpened:_}=(0,u.useDispatch)(on),{registerShortcut:f}=(0,u.useDispatch)(xe.store),{set:y}=(0,u.useDispatch)(p.store),{replaceBlocks:v}=(0,u.useDispatch)(E.store),{getBlockName:w,getSelectedBlockClientId:k,getBlockAttributes:P}=(0,u.useSelect)(E.store),C=(e,t)=>{e.preventDefault();const n=0===t?"core/paragraph":"core/heading",o=k();if(null===o)return;const a=w(o);if("core/paragraph"!==a&&"core/heading"!==a)return;const l=P(o),s="core/paragraph"===a?"align":"textAlign",i="core/paragraph"===n?"align":"textAlign";v(o,(0,r.createBlock)(n,{level:t,content:l.content,[i]:l[s]}))};return(0,s.useEffect)((()=>{f({name:"core/edit-post/toggle-mode",category:"global",description:(0,b.__)("Switch between visual editor and code editor."),keyCombination:{modifier:"secondary",character:"m"}}),f({name:"core/edit-post/toggle-distraction-free",category:"global",description:(0,b.__)("Toggle distraction free mode."),keyCombination:{modifier:"primaryShift",character:"\\"}}),f({name:"core/edit-post/toggle-fullscreen",category:"global",description:(0,b.__)("Toggle fullscreen mode."),keyCombination:{modifier:"secondary",character:"f"}}),f({name:"core/edit-post/toggle-list-view",category:"global",description:(0,b.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}}),f({name:"core/edit-post/toggle-sidebar",category:"global",description:(0,b.__)("Show or hide the Settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),f({name:"core/edit-post/next-region",category:"global",description:(0,b.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),f({name:"core/edit-post/previous-region",category:"global",description:(0,b.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]}),f({name:"core/edit-post/keyboard-shortcuts",category:"main",description:(0,b.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),f({name:"core/edit-post/transform-heading-to-paragraph",category:"block-library",description:(0,b.__)("Transform heading to paragraph."),keyCombination:{modifier:"access",character:"0"}}),[1,2,3,4,5,6].forEach((e=>{f({name:`core/edit-post/transform-paragraph-to-heading-${e}`,category:"block-library",description:(0,b.__)("Transform paragraph to heading."),keyCombination:{modifier:"access",character:`${e}`}})}))}),[]),(0,xe.useShortcut)("core/edit-post/toggle-mode",(()=>{c("visual"===t()?"text":"visual")}),{isDisabled:l}),(0,xe.useShortcut)("core/edit-post/toggle-fullscreen",(()=>{g("fullscreenMode")})),(0,xe.useShortcut)("core/edit-post/toggle-distraction-free",(()=>{y("core/edit-post","fixedToolbar",!1),_(!1),h(!1),m(),g("distractionFree"),i(a("distractionFree")?(0,b.__)("Distraction free mode turned on."):(0,b.__)("Distraction free mode turned off."),{id:"core/edit-post/distraction-free-mode/notice",type:"snackbar"})})),(0,xe.useShortcut)("core/edit-post/toggle-sidebar",(t=>{if(t.preventDefault(),n())m();else{const t=e()?"edit-post/block":"edit-post/document";d(t)}})),(0,xe.useShortcut)("core/edit-post/toggle-list-view",(()=>{o()||h(!0)})),(0,xe.useShortcut)("core/edit-post/transform-heading-to-paragraph",(e=>C(e,0))),[1,2,3,4,5,6].forEach((e=>{(0,xe.useShortcut)(`core/edit-post/transform-paragraph-to-heading-${e}`,(t=>C(t,e)))})),null};function vn({willEnable:e}){const[t,n]=(0,s.useState)(!1);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("p",{className:"edit-post-preferences-modal__custom-fields-confirmation-message"},(0,b.__)("A page reload is required for this change. Make sure your content is saved before reloading.")),(0,s.createElement)(_.Button,{className:"edit-post-preferences-modal__custom-fields-confirmation-button",variant:"secondary",isBusy:t,disabled:t,onClick:()=>{n(!0),document.getElementById("toggle-custom-fields-form").submit()}},e?(0,b.__)("Show & Reload Page"):(0,b.__)("Hide & Reload Page")))}const wn=(0,u.withSelect)((e=>({areCustomFieldsEnabled:!!e(S.store).getEditorSettings().enableCustomFields})))((function({label:e,areCustomFieldsEnabled:t}){const[n,o]=(0,s.useState)(t);return(0,s.createElement)(Te,{label:e,isChecked:n,onChange:o},n!==t&&(0,s.createElement)(vn,{willEnable:n}))})),Sn=(0,f.compose)((0,u.withSelect)(((e,{panelName:t})=>{const{isEditorPanelEnabled:n,isEditorPanelRemoved:o}=e(on);return{isRemoved:o(t),isChecked:n(t)}})),(0,f.ifCondition)((({isRemoved:e})=>!e)),(0,u.withDispatch)(((e,{panelName:t})=>({onChange:()=>e(on).toggleEditorPanelEnabled(t)}))))(Te),{Fill:kn,Slot:Pn}=(0,_.createSlotFill)("EnablePluginDocumentSettingPanelOption"),Cn=({label:e,panelName:t})=>(0,s.createElement)(kn,null,(0,s.createElement)(Sn,{label:e,panelName:t}));Cn.Slot=Pn;const Tn=Cn,xn=(0,f.compose)((0,u.withSelect)((e=>({isChecked:e(S.store).isPublishSidebarEnabled()}))),(0,u.withDispatch)((e=>{const{enablePublishSidebar:t,disablePublishSidebar:n}=e(S.store);return{onChange:e=>e?t():n()}})),(0,V.ifViewportMatches)("medium"))(Te),Mn=(0,f.compose)((0,u.withSelect)(((e,{featureName:t})=>{const{isFeatureActive:n}=e(on);return{isChecked:n(t)}})),(0,u.withDispatch)(((e,{featureName:t,onToggle:n=(()=>{})})=>({onChange:()=>{n(),e(on).toggleFeature(t)}}))))(Te);const Bn=(0,u.withSelect)((e=>{const{getEditorSettings:t}=e(S.store),{getAllMetaBoxes:n}=e(on);return{areCustomFieldsRegistered:void 0!==t().enableCustomFields,metaBoxes:n()}}))((function({areCustomFieldsRegistered:e,metaBoxes:t,...n}){const o=t.filter((({id:e})=>"postcustom"!==e));return e||0!==o.length?(0,s.createElement)(Ce,{...n},e&&(0,s.createElement)(wn,{label:(0,b.__)("Custom fields")}),o.map((({id:e,title:t})=>(0,s.createElement)(Sn,{key:e,label:t,panelName:`meta-box-${e}`})))):null}));const In=function({blockTypes:e,value:t,onItemChange:n}){return(0,s.createElement)("ul",{className:"edit-post-block-manager__checklist"},e.map((e=>(0,s.createElement)("li",{key:e.name,className:"edit-post-block-manager__checklist-item"},(0,s.createElement)(_.CheckboxControl,{__nextHasNoMarginBottom:!0,label:e.title,checked:t.includes(e.name),onChange:(...t)=>n(e.name,...t)}),(0,s.createElement)(E.BlockIcon,{icon:e.icon})))))};const Ln=function e({title:t,blockTypes:n}){const o=(0,f.useInstanceId)(e),{defaultAllowedBlockTypes:a,hiddenBlockTypes:l}=(0,u.useSelect)((e=>{const{getEditorSettings:t}=e(S.store),{getHiddenBlockTypes:n}=e(on);return{defaultAllowedBlockTypes:t().defaultAllowedBlockTypes,hiddenBlockTypes:n()}}),[]),r=(0,s.useMemo)((()=>!0===a?n:n.filter((({name:e})=>a?.includes(e)))),[a,n]),{showBlockTypes:i,hideBlockTypes:c}=(0,u.useDispatch)(on),d=(0,s.useCallback)(((e,t)=>{t?i(e):c(e)}),[]),m=(0,s.useCallback)((e=>{const t=n.map((({name:e})=>e));e?i(t):c(t)}),[n]);if(!r.length)return null;const p=r.map((({name:e})=>e)).filter((e=>!l.includes(e))),g="edit-post-block-manager__category-title-"+o,h=p.length===r.length,E=!h&&p.length>0;return(0,s.createElement)("div",{role:"group","aria-labelledby":g,className:"edit-post-block-manager__category"},(0,s.createElement)(_.CheckboxControl,{__nextHasNoMarginBottom:!0,checked:h,onChange:m,className:"edit-post-block-manager__category-title",indeterminate:E,label:(0,s.createElement)("span",{id:g},t)}),(0,s.createElement)(In,{blockTypes:r,value:p,onItemChange:d}))};const Nn=(0,f.compose)([(0,u.withSelect)((e=>{const{getBlockTypes:t,getCategories:n,hasBlockSupport:o,isMatchingSearchTerm:a}=e(r.store),{getHiddenBlockTypes:l}=e(on),s=t(),i=l().filter((e=>s.some((t=>t.name===e)))),c=Array.isArray(i)&&i.length;return{blockTypes:s,categories:n(),hasBlockSupport:o,isMatchingSearchTerm:a,numberOfHiddenBlocks:c}})),(0,u.withDispatch)((e=>{const{showBlockTypes:t}=e(on);return{enableAllBlockTypes:e=>{const n=e.map((({name:e})=>e));t(n)}}}))])((function({blockTypes:e,categories:t,hasBlockSupport:n,isMatchingSearchTerm:o,numberOfHiddenBlocks:a,enableAllBlockTypes:l}){const r=(0,f.useDebounce)(qe.speak,500),[i,c]=(0,s.useState)("");return e=e.filter((e=>n(e,"inserter",!0)&&(!i||o(e,i))&&(!e.parent||e.parent.includes("core/post-content")))),(0,s.useEffect)((()=>{if(!i)return;const t=e.length,n=(0,b.sprintf)((0,b._n)("%d result found.","%d results found.",t),t);r(n)}),[e.length,i,r]),(0,s.createElement)("div",{className:"edit-post-block-manager__content"},!!a&&(0,s.createElement)("div",{className:"edit-post-block-manager__disabled-blocks-count"},(0,b.sprintf)((0,b._n)("%d block is hidden.","%d blocks are hidden.",a),a),(0,s.createElement)(_.Button,{variant:"link",onClick:()=>l(e)},(0,b.__)("Reset"))),(0,s.createElement)(_.SearchControl,{__nextHasNoMarginBottom:!0,label:(0,b.__)("Search for a block"),placeholder:(0,b.__)("Search for a block"),value:i,onChange:e=>c(e),className:"edit-post-block-manager__search"}),(0,s.createElement)("div",{tabIndex:"0",role:"region","aria-label":(0,b.__)("Available block types"),className:"edit-post-block-manager__results"},0===e.length&&(0,s.createElement)("p",{className:"edit-post-block-manager__no-results"},(0,b.__)("No blocks found.")),t.map((t=>(0,s.createElement)(Ln,{key:t.slug,title:t.title,blockTypes:e.filter((e=>e.category===t.slug))}))),(0,s.createElement)(Ln,{title:(0,b.__)("Uncategorized"),blockTypes:e.filter((({category:e})=>!e))})))})),An="edit-post/preferences";function Dn(){const e=(0,f.useViewportMatch)("medium"),{closeModal:t}=(0,u.useDispatch)(ee),[n,o]=(0,u.useSelect)((t=>{const{getEditorSettings:n}=t(S.store),{getEditorMode:o,isFeatureActive:a}=t(on),l=t(ee).isModalActive(An),s=o(),r=n().richEditingEnabled,i=a("distractionFree");return[l,!i&&e&&r&&"visual"===s,i]}),[e]),{closeGeneralSidebar:a,setIsListViewOpened:l,setIsInserterOpened:r}=(0,u.useDispatch)(on),{set:i}=(0,u.useDispatch)(p.store),c=()=>{i("core/edit-post","fixedToolbar",!1),r(!1),l(!1),a()},d=(0,s.useMemo)((()=>[{name:"general",tabLabel:(0,b.__)("General"),content:(0,s.createElement)(s.Fragment,null,e&&(0,s.createElement)(Ce,{title:(0,b.__)("Publishing"),description:(0,b.__)("Change options related to publishing.")},(0,s.createElement)(xn,{help:(0,b.__)("Review settings, such as visibility and tags."),label:(0,b.__)("Include pre-publish checklist")})),(0,s.createElement)(Ce,{title:(0,b.__)("Appearance"),description:(0,b.__)("Customize options related to the block editor interface and editing flow.")},(0,s.createElement)(Mn,{featureName:"distractionFree",onToggle:c,help:(0,b.__)("Reduce visual distractions by hiding the toolbar and other elements to focus on writing."),label:(0,b.__)("Distraction free")}),(0,s.createElement)(Mn,{featureName:"focusMode",help:(0,b.__)("Highlights the current block and fades other content."),label:(0,b.__)("Spotlight mode")}),(0,s.createElement)(Mn,{featureName:"showIconLabels",label:(0,b.__)("Show button text labels"),help:(0,b.__)("Show text instead of icons on buttons.")}),(0,s.createElement)(Mn,{featureName:"showListViewByDefault",help:(0,b.__)("Opens the block list view sidebar by default."),label:(0,b.__)("Always open list view")}),(0,s.createElement)(Mn,{featureName:"themeStyles",help:(0,b.__)("Make the editor look like your theme."),label:(0,b.__)("Use theme styles")}),o&&(0,s.createElement)(Mn,{featureName:"showBlockBreadcrumbs",help:(0,b.__)("Shows block breadcrumbs at the bottom of the editor."),label:(0,b.__)("Display block breadcrumbs")})))},{name:"blocks",tabLabel:(0,b.__)("Blocks"),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ce,{title:(0,b.__)("Block interactions"),description:(0,b.__)("Customize how you interact with blocks in the block library and editing canvas.")},(0,s.createElement)(Mn,{featureName:"mostUsedBlocks",help:(0,b.__)("Places the most frequent blocks in the block library."),label:(0,b.__)("Show most used blocks")}),(0,s.createElement)(Mn,{featureName:"keepCaretInsideBlock",help:(0,b.__)("Aids screen readers by stopping text caret from leaving blocks."),label:(0,b.__)("Contain text cursor inside block")})),(0,s.createElement)(Ce,{title:(0,b.__)("Visible blocks"),description:(0,b.__)("Disable blocks that you don't want to appear in the inserter. They can always be toggled back on later.")},(0,s.createElement)(Nn,null)))},{name:"panels",tabLabel:(0,b.__)("Panels"),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ce,{title:(0,b.__)("Document settings"),description:(0,b.__)("Choose what displays in the panel.")},(0,s.createElement)(Tn.Slot,null),(0,s.createElement)(S.PostTaxonomies,{taxonomyWrapper:(e,t)=>(0,s.createElement)(Sn,{label:t.labels.menu_name,panelName:`taxonomy-panel-${t.slug}`})}),(0,s.createElement)(S.PostFeaturedImageCheck,null,(0,s.createElement)(Sn,{label:(0,b.__)("Featured image"),panelName:"featured-image"})),(0,s.createElement)(S.PostExcerptCheck,null,(0,s.createElement)(Sn,{label:(0,b.__)("Excerpt"),panelName:"post-excerpt"})),(0,s.createElement)(S.PostTypeSupportCheck,{supportKeys:["comments","trackbacks"]},(0,s.createElement)(Sn,{label:(0,b.__)("Discussion"),panelName:"discussion-panel"})),(0,s.createElement)(S.PageAttributesCheck,null,(0,s.createElement)(Sn,{label:(0,b.__)("Page attributes"),panelName:"page-attributes"}))),(0,s.createElement)(Bn,{title:(0,b.__)("Additional"),description:(0,b.__)("Add extra areas to the editor.")}))}]),[e,o]);return n?(0,s.createElement)(ye,{closeModal:t},(0,s.createElement)(Pe,{sections:d})):null}class Vn extends s.Component{constructor(){super(...arguments),this.state={historyId:null}}componentDidUpdate(e){const{postId:t,postStatus:n,postType:o,isSavingPost:a}=this.props,{historyId:l}=this.state;"trash"!==n||a?t===e.postId&&t===l||"auto-draft"===n||!t||this.setBrowserURL(t):this.setTrashURL(t,o)}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 On=(0,u.withSelect)((e=>{const{getCurrentPost:t,isSavingPost:n}=e(S.store),o=t();let{id:a,status:l,type:s}=o;return["wp_template","wp_template_part"].includes(s)&&(a=o.wp_id),{postId:a,postStatus:l,postType:s,isSavingPost:n()}}))(Vn),Rn=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(k.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 Fn=function({showTooltip:e,icon:t,href:n}){var o;const{isActive:a,isRequestingSiteIcon:l,postType:r,siteIconUrl:i}=(0,u.useSelect)((e=>{const{getCurrentPostType:t}=e(S.store),{isFeatureActive:n}=e(on),{getEntityRecord:o,getPostType:a,isResolving:l}=e(w.store),s=o("root","__unstableBase",void 0)||{};return{isActive:n("fullscreenMode"),isRequestingSiteIcon:l("getEntityRecord",["root","__unstableBase",void 0]),postType:a(t()),siteIconUrl:s.site_icon_url}}),[]),c=(0,f.useReducedMotion)();if(!a||!r)return null;let d=(0,s.createElement)(_.Icon,{size:"36px",icon:Rn});const m={expand:{scale:1.25,transition:{type:"tween",duration:"0.3"}}};i&&(d=(0,s.createElement)(_.__unstableMotion.img,{variants:!c&&m,alt:(0,b.__)("Site Icon"),className:"edit-post-fullscreen-mode-close_site-icon",src:i})),l&&(d=null),t&&(d=(0,s.createElement)(_.Icon,{size:"36px",icon:t}));const p=L()({"edit-post-fullscreen-mode-close":!0,"has-icon":i});return(0,s.createElement)(_.__unstableMotion.div,{whileHover:"expand"},(0,s.createElement)(_.Button,{className:p,href:null!=n?n:(0,T.addQueryArgs)("edit.php",{post_type:r.slug}),label:null!==(o=r?.labels?.view_items)&&void 0!==o?o:(0,b.__)("Back"),showTooltip:e},d))},Hn=(0,s.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(k.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})),Gn=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),{useShouldContextualToolbarShow:Un}=mn(E.privateApis),zn=e=>{e.preventDefault()};const Zn=function(){const e=(0,s.useRef)(),{setIsInserterOpened:t,setIsListViewOpened:n}=(0,u.useDispatch)(on),{get:o}=(0,u.useSelect)(p.store),a=o("core/edit-post","fixedToolbar"),{isInserterEnabled:l,isInserterOpened:r,isTextModeEnabled:i,showIconLabels:c,isListViewOpen:d,listViewShortcut:m}=(0,u.useSelect)((e=>{const{hasInserterItems:t,getBlockRootClientId:n,getBlockSelectionEnd:o}=e(E.store),{getEditorSettings:a}=e(S.store),{getEditorMode:l,isFeatureActive:s,isListViewOpened:r}=e(on),{getShortcutRepresentation:i}=e(xe.store);return{isInserterEnabled:"visual"===l()&&a().richEditingEnabled&&t(n(o())),isInserterOpened:e(on).isInserterOpened(),isTextModeEnabled:"text"===l(),showIconLabels:s("showIconLabels"),isListViewOpen:r(),listViewShortcut:i("core/edit-post/toggle-list-view")}}),[]),g=(0,f.useViewportMatch)("medium"),h=(0,f.useViewportMatch)("wide"),{shouldShowContextualToolbar:y,canFocusHiddenToolbar:v,fixedToolbarCanBeFocused:w}=Un(),k=y||v||w,P=(0,b.__)("Document tools"),C=(0,s.useCallback)((()=>n(!d)),[n,d]),T=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_.ToolbarItem,{as:_.Button,className:"edit-post-header-toolbar__document-overview-toggle",icon:Hn,disabled:i,isPressed:d,label:(0,b.__)("Document Overview"),onClick:C,shortcut:m,showTooltip:!c,variant:c?"tertiary":void 0})),x=(0,s.useCallback)((()=>{r?(e.current.focus(),t(!1)):t(!0)}),[r,t]),M=(0,b._x)("Toggle block inserter","Generic label for block inserter button"),B=r?(0,b.__)("Close"):(0,b.__)("Add");return(0,s.createElement)(E.NavigableToolbar,{className:"edit-post-header-toolbar","aria-label":P,shouldUseKeyboardFocusShortcut:!k},(0,s.createElement)("div",{className:"edit-post-header-toolbar__left"},(0,s.createElement)(_.ToolbarItem,{ref:e,as:_.Button,className:"edit-post-header-toolbar__inserter-toggle",variant:"primary",isPressed:r,onMouseDown:zn,onClick:x,disabled:!l,icon:Gn,label:c?B:M,showTooltip:!c}),(h||!c)&&(0,s.createElement)(s.Fragment,null,g&&!a&&(0,s.createElement)(_.ToolbarItem,{as:E.ToolSelector,showTooltip:!c,variant:c?"tertiary":void 0,disabled:i}),(0,s.createElement)(_.ToolbarItem,{as:S.EditorHistoryUndo,showTooltip:!c,variant:c?"tertiary":void 0}),(0,s.createElement)(_.ToolbarItem,{as:S.EditorHistoryRedo,showTooltip:!c,variant:c?"tertiary":void 0}),T)))},$n=[{value:"visual",label:(0,b.__)("Visual editor")},{value:"text",label:(0,b.__)("Code editor")}];const Wn=function(){const{shortcut:e,isRichEditingEnabled:t,isCodeEditingEnabled:n,isEditingTemplate:o,mode:a}=(0,u.useSelect)((e=>({shortcut:e(xe.store).getShortcutRepresentation("core/edit-post/toggle-mode"),isRichEditingEnabled:e(S.store).getEditorSettings().richEditingEnabled,isCodeEditingEnabled:e(S.store).getEditorSettings().codeEditingEnabled,isEditingTemplate:e(on).isEditingTemplate(),mode:e(on).getEditorMode()})),[]),{switchEditorMode:l}=(0,u.useDispatch)(on);if(o)return null;if(!t||!n)return null;const r=$n.map((t=>t.value!==a?{...t,shortcut:e}:t));return(0,s.createElement)(_.MenuGroup,{label:(0,b.__)("Editor")},(0,s.createElement)(_.MenuItemsChoice,{choices:r,value:a,onSelect:l}))};function qn(){const{openModal:e}=(0,u.useDispatch)(ee);return(0,s.createElement)(_.MenuItem,{onClick:()=>{e(An)}},(0,b.__)("Preferences"))}const jn=function(){const e=(0,u.useRegistry)(),t=(0,u.useSelect)((e=>e(E.store).getSettings().isDistractionFree),[]),{setIsInserterOpened:n,setIsListViewOpened:o,closeGeneralSidebar:a}=(0,u.useDispatch)(on),{set:l}=(0,u.useDispatch)(p.store);return(0,f.useViewportMatch)("medium")?(0,s.createElement)(_.MenuGroup,{label:(0,b._x)("View","noun")},(0,s.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",disabled:t,name:"fixedToolbar",label:(0,b.__)("Top toolbar"),info:(0,b.__)("Access all block and document tools in a single place"),messageActivated:(0,b.__)("Top toolbar activated"),messageDeactivated:(0,b.__)("Top toolbar deactivated")}),(0,s.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"focusMode",label:(0,b.__)("Spotlight mode"),info:(0,b.__)("Focus on one block at a time"),messageActivated:(0,b.__)("Spotlight mode activated"),messageDeactivated:(0,b.__)("Spotlight mode deactivated")}),(0,s.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"fullscreenMode",label:(0,b.__)("Fullscreen mode"),info:(0,b.__)("Show and hide admin UI"),messageActivated:(0,b.__)("Fullscreen mode activated"),messageDeactivated:(0,b.__)("Fullscreen mode deactivated"),shortcut:B.displayShortcut.secondary("f")}),(0,s.createElement)(p.PreferenceToggleMenuItem,{scope:"core/edit-post",name:"distractionFree",onToggle:()=>{e.batch((()=>{l("core/edit-post","fixedToolbar",!1),n(!1),o(!1),a()}))},label:(0,b.__)("Distraction free"),info:(0,b.__)("Write with calmness"),messageActivated:(0,b.__)("Distraction free mode activated"),messageDeactivated:(0,b.__)("Distraction free mode deactivated"),shortcut:B.displayShortcut.primaryShift("\\")})):null},Kn=({showIconLabels:e})=>{const t=(0,f.useViewportMatch)("large");return(0,s.createElement)(fe,{toggleProps:{showTooltip:!e,...e&&{variant:"tertiary"}}},(({onClose:n})=>(0,s.createElement)(s.Fragment,null,e&&!t&&(0,s.createElement)(de.Slot,{className:e&&"show-icon-labels",scope:"core/edit-post"}),(0,s.createElement)(jn,null),(0,s.createElement)(Wn,null),(0,s.createElement)(se.Slot,{name:"core/edit-post/plugin-more-menu",label:(0,b.__)("Plugins"),as:_.MenuGroup,fillProps:{onClick:n}}),(0,s.createElement)(Ge.Slot,{fillProps:{onClose:n}}),(0,s.createElement)(_.MenuGroup,null,(0,s.createElement)(qn,null)))))};const Yn=(0,f.compose)((0,u.withSelect)((e=>{var t;return{hasPublishAction:null!==(t=e(S.store).getCurrentPost()?._links?.["wp:action-publish"])&&void 0!==t&&t,isBeingScheduled:e(S.store).isEditedPostBeingScheduled(),isPending:e(S.store).isCurrentPostPending(),isPublished:e(S.store).isCurrentPostPublished(),isPublishSidebarEnabled:e(S.store).isPublishSidebarEnabled(),isPublishSidebarOpened:e(on).isPublishSidebarOpened(),isScheduled:e(S.store).isCurrentPostScheduled()}})),(0,u.withDispatch)((e=>{const{togglePublishSidebar:t}=e(on);return{togglePublishSidebar:t}})))((function({forceIsDirty:e,forceIsSaving:t,hasPublishAction:n,isBeingScheduled:o,isPending:a,isPublished:l,isPublishSidebarEnabled:r,isPublishSidebarOpened:i,isScheduled:c,togglePublishSidebar:d,setEntitiesSavedStatesCallback:u}){const m="toggle",p="button",g=(0,f.useViewportMatch)("medium","<");let h;return h=l||c&&o||a&&!n&&!g?p:g||r?m:p,(0,s.createElement)(S.PostPublishButton,{forceIsDirty:e,forceIsSaving:t,isOpen:i,isToggle:h===m,onToggle:d,setEntitiesSavedStatesCallback:u})}));function Qn(){const{hasActiveMetaboxes:e,isPostSaveable:t,isSaving:n,isViewable:o,deviceType:a}=(0,u.useSelect)((e=>{var t;const{getEditedPostAttribute:n}=e(S.store),{getPostType:o}=e(w.store),a=o(n("type"));return{hasActiveMetaboxes:e(on).hasMetaBoxes(),isSaving:e(on).isSavingMetaBoxes(),isPostSaveable:e(S.store).isEditedPostSaveable(),isViewable:null!==(t=a?.viewable)&&void 0!==t&&t,deviceType:e(on).__experimentalGetPreviewDeviceType()}}),[]),{__experimentalSetPreviewDeviceType:l}=(0,u.useDispatch)(on);return(0,s.createElement)(E.__experimentalPreviewOptions,{isEnabled:t,className:"edit-post-post-preview-dropdown",deviceType:a,setDeviceType:l,label:(0,b.__)("Preview")},o&&(0,s.createElement)(_.MenuGroup,null,(0,s.createElement)("div",{className:"edit-post-header-preview__grouping-external"},(0,s.createElement)(S.PostPreviewButton,{className:"edit-post-header-preview__button-external",role:"menuitem",forceIsAutosaveable:e,forcePreviewLink:n?null:void 0,textContent:(0,s.createElement)(s.Fragment,null,(0,b.__)("Preview in new tab"),(0,s.createElement)(_.Icon,{icon:P}))}))))}function Xn(){const{permalink:e,isPublished:t,label:n}=(0,u.useSelect)((e=>{const t=e(S.store).getCurrentPostType(),n=e(w.store).getPostType(t);return{permalink:e(S.store).getPermalink(),isPublished:e(S.store).isCurrentPostPublished(),label:n?.labels.view_item}}),[]);return t&&e?(0,s.createElement)(_.Button,{icon:P,label:n||(0,b.__)("View post"),href:e,target:"_blank"}):null}const Jn="__experimentalMainDashboardButton",{Fill:eo,Slot:to}=(0,_.createSlotFill)(Jn),no=eo;no.Slot=({children:e})=>{const t=(0,_.__experimentalUseSlotFills)(Jn);return Boolean(t&&t.length)?(0,s.createElement)(to,{bubblesVirtually:!0}):e};const oo=no,ao=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),lo=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})),so=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.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 ro=function(){const{template:e,isEditing:t}=(0,u.useSelect)((e=>{const{isEditingTemplate:t,getEditedPostTemplate:n}=e(on),o=t();return{template:o?n():null,isEditing:o}}),[]),{clearSelectedBlock:n}=(0,u.useDispatch)(E.store),{setIsEditingTemplate:o}=(0,u.useDispatch)(on),{open:a}=(0,u.useDispatch)(sn.store);if(!t||!e)return null;let l=(0,b.__)("Default");return e?.title?l=e.title:e&&(l=e.slug),(0,s.createElement)("div",{className:"edit-post-document-actions"},(0,s.createElement)(_.Button,{className:"edit-post-document-actions__back",onClick:()=>{n(),o(!1)},icon:(0,b.isRTL)()?ao:lo},(0,b.__)("Back")),(0,s.createElement)(_.Button,{className:"edit-post-document-actions__command",onClick:()=>a()},(0,s.createElement)(_.__experimentalHStack,{className:"edit-post-document-actions__title",spacing:1,justify:"center"},(0,s.createElement)(E.BlockIcon,{icon:so}),(0,s.createElement)(_.__experimentalText,{size:"body",as:"h1"},(0,s.createElement)(_.VisuallyHidden,{as:"span"},(0,b.__)("Editing template: ")),l)),(0,s.createElement)("span",{className:"edit-post-document-actions__shortcut"},B.displayShortcut.primary("k"))))},io={hidden:{y:"-50px"},hover:{y:0,transition:{type:"tween",delay:.2}}},co={hidden:{x:"-100%"},hover:{x:0,transition:{type:"tween",delay:.2}}};const uo=function({setEntitiesSavedStatesCallback:e}){const t=(0,f.useViewportMatch)("large"),{hasActiveMetaboxes:n,isPublishSidebarOpened:o,isSaving:a,showIconLabels:l}=(0,u.useSelect)((e=>({hasActiveMetaboxes:e(on).hasMetaBoxes(),isPublishSidebarOpened:e(on).isPublishSidebarOpened(),isSaving:e(on).isSavingMetaBoxes(),showIconLabels:e(on).isFeatureActive("showIconLabels")})),[]);return(0,s.createElement)("div",{className:"edit-post-header"},(0,s.createElement)(oo.Slot,null,(0,s.createElement)(_.__unstableMotion.div,{variants:co,transition:{type:"tween",delay:.8}},(0,s.createElement)(Fn,{showTooltip:!0}))),(0,s.createElement)(_.__unstableMotion.div,{variants:io,transition:{type:"tween",delay:.8},className:"edit-post-header__toolbar"},(0,s.createElement)(Zn,null),(0,s.createElement)("div",{className:"edit-post-header__center"},(0,s.createElement)(ro,null))),(0,s.createElement)(_.__unstableMotion.div,{variants:io,transition:{type:"tween",delay:.8},className:"edit-post-header__settings"},!o&&(0,s.createElement)(S.PostSavedState,{forceIsDirty:n,forceIsSaving:a,showIconLabels:l}),(0,s.createElement)(Qn,null),(0,s.createElement)(S.PostPreviewButton,{forceIsAutosaveable:n,forcePreviewLink:a?null:void 0}),(0,s.createElement)(Xn,null),(0,s.createElement)(Yn,{forceIsDirty:n,forceIsSaving:a,setEntitiesSavedStatesCallback:e}),(t||!l)&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(de.Slot,{scope:"core/edit-post"}),(0,s.createElement)(Kn,{showIconLabels:l})),l&&!t&&(0,s.createElement)(Kn,{showIconLabels:l})))},mo=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function po(){const{insertionPoint:e,showMostUsedBlocks:t}=(0,u.useSelect)((e=>{const{isFeatureActive:t,__experimentalGetInsertionPoint:n}=e(on);return{insertionPoint:n(),showMostUsedBlocks:t("mostUsedBlocks")}}),[]),{setIsInserterOpened:n}=(0,u.useDispatch)(on),o=(0,f.useViewportMatch)("medium","<"),a=o?"div":_.VisuallyHidden,[l,r]=(0,f.__experimentalUseDialog)({onClose:()=>n(!1),focusOnMount:null}),i=(0,s.useRef)();return(0,s.useEffect)((()=>{i.current.focusSearch()}),[]),(0,s.createElement)("div",{ref:l,...r,className:"edit-post-editor__inserter-panel"},(0,s.createElement)(a,{className:"edit-post-editor__inserter-panel-header"},(0,s.createElement)(_.Button,{icon:mo,label:(0,b.__)("Close block inserter"),onClick:()=>n(!1)})),(0,s.createElement)("div",{className:"edit-post-editor__inserter-panel-content"},(0,s.createElement)(E.__experimentalLibrary,{showMostUsedBlocks:t,showInserterHelpPanel:!0,shouldFocusBlock:o,rootClientId:e.rootClientId,__experimentalInsertionIndex:e.insertionIndex,__experimentalFilterValue:e.filterValue,ref:i})))}const go=window.wp.dom;function ho(){return(0,s.createElement)(_.SVG,{width:"138",height:"148",viewBox:"0 0 138 148",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(_.Rect,{width:"138",height:"148",rx:"4",fill:"#F0F6FC"}),(0,s.createElement)(_.Line,{x1:"44",y1:"28",x2:"24",y2:"28",stroke:"#DDDDDD"}),(0,s.createElement)(_.Rect,{x:"48",y:"16",width:"27",height:"23",rx:"4",fill:"#DDDDDD"}),(0,s.createElement)(_.Path,{d:"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z",fill:"black"}),(0,s.createElement)(_.Line,{x1:"55",y1:"59",x2:"24",y2:"59",stroke:"#DDDDDD"}),(0,s.createElement)(_.Rect,{x:"59",y:"47",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,s.createElement)(_.Path,{d:"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z",fill:"black"}),(0,s.createElement)(_.Line,{x1:"80",y1:"90",x2:"24",y2:"90",stroke:"#DDDDDD"}),(0,s.createElement)(_.Rect,{x:"84",y:"78",width:"30",height:"23",rx:"4",fill:"#F0B849"}),(0,s.createElement)(_.Path,{d:"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z",fill:"black"}),(0,s.createElement)(_.Line,{x1:"66",y1:"121",x2:"24",y2:"121",stroke:"#DDDDDD"}),(0,s.createElement)(_.Rect,{x:"70",y:"109",width:"29",height:"23",rx:"4",fill:"#DDDDDD"}),(0,s.createElement)(_.Path,{d:"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z",fill:"black"}))}function _o(){const{headingCount:e}=(0,u.useSelect)((e=>{const{getGlobalBlockCount:t}=e(E.store);return{headingCount:t("core/heading")}}),[]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"edit-post-editor__list-view-overview"},(0,s.createElement)("div",null,(0,s.createElement)(_.__experimentalText,null,(0,b.__)("Characters:")),(0,s.createElement)(_.__experimentalText,null,(0,s.createElement)(S.CharacterCount,null))),(0,s.createElement)("div",null,(0,s.createElement)(_.__experimentalText,null,(0,b.__)("Words:")),(0,s.createElement)(S.WordCount,null)),(0,s.createElement)("div",null,(0,s.createElement)(_.__experimentalText,null,(0,b.__)("Time to read:")),(0,s.createElement)(S.TimeToRead,null))),e>0?(0,s.createElement)(S.DocumentOutline,null):(0,s.createElement)("div",{className:"edit-post-editor__list-view-empty-headings"},(0,s.createElement)(ho,null),(0,s.createElement)("p",null,(0,b.__)("Navigate the structure of your document and address issues like empty or incorrect heading levels."))))}function Eo(){const{setIsListViewOpened:e}=(0,u.useDispatch)(on),t=(0,f.useFocusOnMount)("firstElement"),n=(0,f.useFocusReturn)(),o=(0,f.useFocusReturn)();const[a,l]=(0,s.useState)(null),[r,i]=(0,s.useState)("list-view"),c=(0,s.useRef)(),d=(0,s.useRef)(),m=(0,s.useRef)(),p=(0,f.useMergeRefs)([o,t,m,l]);return(0,xe.useShortcut)("core/edit-post/toggle-list-view",(()=>{c.current.contains(c.current.ownerDocument.activeElement)?e(!1):function(e){const t=go.focus.tabbable.find(d.current)[0];if("list-view"===e){const e=go.focus.tabbable.find(m.current)[0];(c.current.contains(e)?e:t).focus()}else t.focus()}(r)})),(0,s.createElement)("div",{className:"edit-post-editor__document-overview-panel",onKeyDown:function(t){t.keyCode!==B.ESCAPE||t.defaultPrevented||(t.preventDefault(),e(!1))},ref:c},(0,s.createElement)(_.Button,{className:"edit-post-editor__document-overview-panel__close-button",ref:n,icon:O,label:(0,b.__)("Close"),onClick:()=>e(!1)}),(0,s.createElement)(_.TabPanel,{className:"edit-post-editor__document-overview-panel__tab-panel",ref:d,onSelect:e=>i(e),selectOnMove:!1,tabs:[{name:"list-view",title:(0,b._x)("List View","Post overview"),className:"edit-post-sidebar__panel-tab"},{name:"outline",title:(0,b._x)("Outline","Post overview"),className:"edit-post-sidebar__panel-tab"}]},(e=>(0,s.createElement)("div",{className:"edit-post-editor__list-view-container",ref:p},"list-view"===e.name?(0,s.createElement)("div",{className:"edit-post-editor__list-view-panel-content"},(0,s.createElement)(E.__experimentalListView,{dropZoneElement:a})):(0,s.createElement)(_o,null)))))}const bo=(0,s.createElement)(k.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.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"})),fo=(0,s.createElement)(k.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.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"})),yo=({sidebarName:e})=>{const{openGeneralSidebar:t}=(0,u.useDispatch)(on),n=()=>t("edit-post/document"),{documentLabel:o,isTemplateMode:a}=(0,u.useSelect)((e=>({documentLabel:e(S.store).getPostTypeLabel()||(0,b._x)("Document","noun"),isTemplateMode:e(on).isEditingTemplate()})),[]),[l,r]="edit-post/document"===e?[(0,b.sprintf)((0,b.__)("%s (selected)"),o),"is-active"]:[o,""],[i,c]="edit-post/block"===e?[(0,b.__)("Block (selected)"),"is-active"]:[(0,b.__)("Block"),""],[d,m]="edit-post/document"===e?[(0,b.__)("Template (selected)"),"is-active"]:[(0,b.__)("Template"),""];return(0,s.createElement)("ul",null,!a&&(0,s.createElement)("li",null,(0,s.createElement)(_.Button,{onClick:n,className:`edit-post-sidebar__panel-tab ${r}`,"aria-label":l,"data-label":o},o)),a&&(0,s.createElement)("li",null,(0,s.createElement)(_.Button,{onClick:n,className:`edit-post-sidebar__panel-tab ${m}`,"aria-label":d,"data-label":(0,b.__)("Template")},(0,b.__)("Template"))),(0,s.createElement)("li",null,(0,s.createElement)(_.Button,{onClick:()=>t("edit-post/block"),className:`edit-post-sidebar__panel-tab ${c}`,"aria-label":i,"data-label":(0,b.__)("Block")},(0,b.__)("Block"))))};function vo({isOpen:e,onClick:t}){const n=(0,S.usePostVisibilityLabel)();return(0,s.createElement)(_.Button,{className:"edit-post-post-visibility__toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,b.sprintf)((0,b.__)("Select visibility: %s"),n),onClick:t},n)}const wo=function(){const[e,t]=(0,s.useState)(null),n=(0,s.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,s.createElement)(S.PostVisibilityCheck,{render:({canEdit:e})=>(0,s.createElement)(_.PanelRow,{ref:t,className:"edit-post-post-visibility"},(0,s.createElement)("span",null,(0,b.__)("Visibility")),!e&&(0,s.createElement)("span",null,(0,s.createElement)(S.PostVisibilityLabel,null)),e&&(0,s.createElement)(_.Dropdown,{contentClassName:"edit-post-post-visibility__dialog",popoverProps:n,focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,s.createElement)(vo,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,s.createElement)(S.PostVisibility,{onClose:e})}))})};function So(){return(0,s.createElement)(S.PostTrashCheck,null,(0,s.createElement)(S.PostTrash,null))}function ko(){const[e,t]=(0,s.useState)(null),n=(0,s.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,s.createElement)(S.PostScheduleCheck,null,(0,s.createElement)(_.PanelRow,{className:"edit-post-post-schedule",ref:t},(0,s.createElement)("span",null,(0,b.__)("Publish")),(0,s.createElement)(_.Dropdown,{popoverProps:n,contentClassName:"edit-post-post-schedule__dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,s.createElement)(Po,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,s.createElement)(S.PostSchedule,{onClose:e})})))}function Po({isOpen:e,onClick:t}){const n=(0,S.usePostScheduleLabel)(),o=(0,S.usePostScheduleLabel)({full:!0});return(0,s.createElement)(_.Button,{className:"edit-post-post-schedule__toggle",variant:"tertiary",label:o,showTooltip:!0,"aria-expanded":e,"aria-label":(0,b.sprintf)((0,b.__)("Change date: %s"),n),onClick:t},n)}const Co=function(){return(0,s.createElement)(S.PostStickyCheck,null,(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(S.PostSticky,null)))};const To=function(){return(0,s.createElement)(S.PostAuthorCheck,null,(0,s.createElement)(_.PanelRow,{className:"edit-post-post-author"},(0,s.createElement)(S.PostAuthor,null)))};const xo=function(){return(0,s.createElement)(S.PostSlugCheck,null,(0,s.createElement)(_.PanelRow,{className:"edit-post-post-slug"},(0,s.createElement)(S.PostSlug,null)))};const Mo=function(){return(0,s.createElement)(S.PostFormatCheck,null,(0,s.createElement)(_.PanelRow,{className:"edit-post-post-format"},(0,s.createElement)(S.PostFormat,null)))};const Bo=function(){return(0,s.createElement)(S.PostPendingStatusCheck,null,(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(S.PostPendingStatus,null)))},{Fill:Io,Slot:Lo}=(0,_.createSlotFill)("PluginPostStatusInfo"),No=({children:e,className:t})=>(0,s.createElement)(Io,null,(0,s.createElement)(_.PanelRow,{className:t},e));No.Slot=Lo;const Ao=No,Do=(0,s.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(k.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18.5 5.5V8H20V5.5H22.5V4H20V1.5H18.5V4H16V5.5H18.5ZM13.9624 4H6C4.89543 4 4 4.89543 4 6V18C4 19.1046 4.89543 20 6 20H18C19.1046 20 20 19.1046 20 18V10.0391H18.5V18C18.5 18.2761 18.2761 18.5 18 18.5H10L10 10.4917L16.4589 10.5139L16.4641 9.01389L5.5 8.97618V6C5.5 5.72386 5.72386 5.5 6 5.5H13.9624V4ZM5.5 10.4762V18C5.5 18.2761 5.72386 18.5 6 18.5H8.5L8.5 10.4865L5.5 10.4762Z"})),Vo=(0,b.__)("Custom Template");function Oo({onClose:e}){const t=(0,u.useSelect)((e=>e(S.store).getEditorSettings().defaultBlockTemplate),[]),{__unstableCreateTemplate:n,__unstableSwitchToTemplateMode:o}=(0,u.useDispatch)(on),[a,l]=(0,s.useState)(""),[i,c]=(0,s.useState)(!1),d=()=>{l(""),e()};return(0,s.createElement)(_.Modal,{title:(0,b.__)("Create custom template"),onRequestClose:d,className:"edit-post-post-template__create-modal"},(0,s.createElement)("form",{className:"edit-post-post-template__create-form",onSubmit:async e=>{if(e.preventDefault(),i)return;c(!0);const l=null!=t?t:(0,r.serialize)([(0,r.createBlock)("core/group",{tagName:"header",layout:{inherit:!0}},[(0,r.createBlock)("core/site-title"),(0,r.createBlock)("core/site-tagline")]),(0,r.createBlock)("core/separator"),(0,r.createBlock)("core/group",{tagName:"main"},[(0,r.createBlock)("core/group",{layout:{inherit:!0}},[(0,r.createBlock)("core/post-title")]),(0,r.createBlock)("core/post-content",{layout:{inherit:!0}})])]);await n({slug:(0,T.cleanForSlug)(a||Vo),content:l,title:a||Vo}),c(!1),d(),o(!0)}},(0,s.createElement)(_.__experimentalVStack,{spacing:"3"},(0,s.createElement)(_.TextControl,{__nextHasNoMarginBottom:!0,label:(0,b.__)("Name"),value:a,onChange:l,placeholder:Vo,disabled:i,help:(0,b.__)('Describe the template, e.g. "Post with sidebar". A custom template can be manually applied to any post or page.')}),(0,s.createElement)(_.__experimentalHStack,{justify:"right"},(0,s.createElement)(_.Button,{variant:"tertiary",onClick:d},(0,b.__)("Cancel")),(0,s.createElement)(_.Button,{variant:"primary",type:"submit",isBusy:i,"aria-disabled":i},(0,b.__)("Create"))))))}function Ro({onClose:e}){var t,n;const{isPostsPage:o,availableTemplates:a,fetchedTemplates:l,selectedTemplateSlug:r,canCreate:i,canEdit:c}=(0,u.useSelect)((e=>{const{canUser:t,getEntityRecord:n,getEntityRecords:o}=e(w.store),a=e(S.store).getEditorSettings(),l=t("read","settings")?n("root","site"):void 0,s=e(S.store).getCurrentPostId()===l?.page_for_posts,r=t("create","templates");return{isPostsPage:s,availableTemplates:a.availableTemplates,fetchedTemplates:r?o("postType","wp_template",{post_type:e(S.store).getCurrentPostType(),per_page:-1}):void 0,selectedTemplateSlug:e(S.store).getEditedPostAttribute("template"),canCreate:r&&!s&&a.supportsTemplateMode,canEdit:r&&a.supportsTemplateMode&&!!e(on).getEditedPostTemplate()}}),[]),d=(0,s.useMemo)((()=>Object.entries({...a,...Object.fromEntries((null!=l?l:[]).map((({slug:e,title:t})=>[e,t.rendered])))}).map((([e,t])=>({value:e,label:t})))),[a,l]),m=null!==(t=d.find((e=>e.value===r)))&&void 0!==t?t:d.find((e=>!e.value)),{editPost:p}=(0,u.useDispatch)(S.store),{__unstableSwitchToTemplateMode:g}=(0,u.useDispatch)(on),[h,f]=(0,s.useState)(!1);return(0,s.createElement)("div",{className:"edit-post-post-template__form"},(0,s.createElement)(E.__experimentalInspectorPopoverHeader,{title:(0,b.__)("Template"),help:(0,b.__)("Templates define the way content is displayed when viewing your site."),actions:i?[{icon:Do,label:(0,b.__)("Add template"),onClick:()=>f(!0)}]:[],onClose:e}),o?(0,s.createElement)(_.Notice,{className:"edit-post-post-template__notice",status:"warning",isDismissible:!1},(0,b.__)("The posts page template cannot be changed.")):(0,s.createElement)(_.SelectControl,{__nextHasNoMarginBottom:!0,hideLabelFromVision:!0,label:(0,b.__)("Template"),value:null!==(n=m?.value)&&void 0!==n?n:"",options:d,onChange:e=>p({template:e||""})}),c&&(0,s.createElement)("p",null,(0,s.createElement)(_.Button,{variant:"link",onClick:()=>g()},(0,b.__)("Edit template"))),h&&(0,s.createElement)(Oo,{onClose:()=>f(!1)}))}function Fo(){const[e,t]=(0,s.useState)(null),n=(0,s.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,u.useSelect)((e=>{var t;const n=e(S.store).getCurrentPostType(),o=e(w.store).getPostType(n);if(!o?.viewable)return!1;const a=e(S.store).getEditorSettings();if(!!a.availableTemplates&&Object.keys(a.availableTemplates).length>0)return!0;if(!a.supportsTemplateMode)return!1;return null!==(t=e(w.store).canUser("create","templates"))&&void 0!==t&&t}),[])?(0,s.createElement)(_.PanelRow,{className:"edit-post-post-template",ref:t},(0,s.createElement)("span",null,(0,b.__)("Template")),(0,s.createElement)(_.Dropdown,{popoverProps:n,className:"edit-post-post-template__dropdown",contentClassName:"edit-post-post-template__dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,s.createElement)(Ho,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,s.createElement)(Ro,{onClose:e})})):null}function Ho({isOpen:e,onClick:t}){const n=(0,u.useSelect)((e=>{const t=e(S.store).getEditedPostAttribute("template"),{supportsTemplateMode:n,availableTemplates:o}=e(S.store).getEditorSettings();if(!n&&o[t])return o[t];const a=e(w.store).canUser("create","templates")&&e(on).getEditedPostTemplate();return a?.title||a?.slug||o?.[t]}),[]);return(0,s.createElement)(_.Button,{className:"edit-post-post-template__toggle",variant:"tertiary","aria-expanded":e,"aria-label":n?(0,b.sprintf)((0,b.__)("Select template: %s"),n):(0,b.__)("Select template"),onClick:t},null!=n?n:(0,b.__)("Default template"))}function Go(){const[e,t]=(0,s.useState)(null),n=(0,s.useMemo)((()=>({anchor:e,placement:"bottom-end"})),[e]);return(0,s.createElement)(S.PostURLCheck,null,(0,s.createElement)(_.PanelRow,{className:"edit-post-post-url",ref:t},(0,s.createElement)("span",null,(0,b.__)("URL")),(0,s.createElement)(_.Dropdown,{popoverProps:n,className:"edit-post-post-url__dropdown",contentClassName:"edit-post-post-url__dialog",focusOnMount:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,s.createElement)(Uo,{isOpen:e,onClick:t}),renderContent:({onClose:e})=>(0,s.createElement)(S.PostURL,{onClose:e})})))}function Uo({isOpen:e,onClick:t}){const n=(0,S.usePostURLLabel)();return(0,s.createElement)(_.Button,{className:"edit-post-post-url__toggle",variant:"tertiary","aria-expanded":e,"aria-label":(0,b.sprintf)((0,b.__)("Change URL: %s"),n),onClick:t},n)}const zo="post-status";const Zo=(0,f.compose)([(0,u.withSelect)((e=>{const{isEditorPanelRemoved:t,isEditorPanelOpened:n}=e(on);return{isRemoved:t(zo),isOpened:n(zo)}})),(0,f.ifCondition)((({isRemoved:e})=>!e)),(0,u.withDispatch)((e=>({onTogglePanel:()=>e(on).toggleEditorPanelOpened(zo)})))])((function({isOpened:e,onTogglePanel:t}){return(0,s.createElement)(_.PanelBody,{className:"edit-post-post-status",title:(0,b.__)("Summary"),opened:e,onToggle:t},(0,s.createElement)(Ao.Slot,null,(e=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(wo,null),(0,s.createElement)(ko,null),(0,s.createElement)(Fo,null),(0,s.createElement)(Go,null),(0,s.createElement)(Co,null),(0,s.createElement)(Bo,null),(0,s.createElement)(Mo,null),(0,s.createElement)(xo,null),(0,s.createElement)(To,null),(0,s.createElement)(S.PostSyncStatus,null),e,(0,s.createElement)(_.__experimentalHStack,{style:{marginTop:"16px"},spacing:4,wrap:!0},(0,s.createElement)(S.PostSwitchToDraftButton,null),(0,s.createElement)(So,null))))))}));const $o=function(){return(0,s.createElement)(S.PostLastRevisionCheck,null,(0,s.createElement)(_.PanelBody,{className:"edit-post-last-revision__panel"},(0,s.createElement)(S.PostLastRevision,null)))};const Wo=(0,f.compose)((0,u.withSelect)(((e,t)=>{const n=t.taxonomy?.slug,o=n?`taxonomy-panel-${n}`:"";return{panelName:o,isEnabled:!!n&&e(on).isEditorPanelEnabled(o),isOpened:!!n&&e(on).isEditorPanelOpened(o)}})),(0,u.withDispatch)(((e,t)=>({onTogglePanel:()=>{e(on).toggleEditorPanelOpened(t.panelName)}}))))((function({isEnabled:e,taxonomy:t,isOpened:n,onTogglePanel:o,children:a}){if(!e)return null;const l=t?.labels?.menu_name;return l?(0,s.createElement)(_.PanelBody,{title:l,opened:n,onToggle:o},a):null}));const qo=function(){return(0,s.createElement)(S.PostTaxonomiesCheck,null,(0,s.createElement)(S.PostTaxonomies,{taxonomyWrapper:(e,t)=>(0,s.createElement)(Wo,{taxonomy:t},e)}))},jo="featured-image";const Ko=(0,u.withSelect)((e=>{const{getEditedPostAttribute:t}=e(S.store),{getPostType:n}=e(w.store),{isEditorPanelEnabled:o,isEditorPanelOpened:a}=e(on);return{postType:n(t("type")),isEnabled:o(jo),isOpened:a(jo)}})),Yo=(0,u.withDispatch)((e=>{const{toggleEditorPanelOpened:t}=e(on);return{onTogglePanel:(...e)=>t(jo,...e)}})),Qo=(0,f.compose)(Ko,Yo)((function({isEnabled:e,isOpened:t,postType:n,onTogglePanel:o}){var a;return e?(0,s.createElement)(S.PostFeaturedImageCheck,null,(0,s.createElement)(_.PanelBody,{title:null!==(a=n?.labels?.featured_image)&&void 0!==a?a:(0,b.__)("Featured image"),opened:t,onToggle:o},(0,s.createElement)(S.PostFeaturedImage,null))):null})),Xo="post-excerpt";const Jo=(0,f.compose)([(0,u.withSelect)((e=>({isEnabled:e(on).isEditorPanelEnabled(Xo),isOpened:e(on).isEditorPanelOpened(Xo)}))),(0,u.withDispatch)((e=>({onTogglePanel:()=>e(on).toggleEditorPanelOpened(Xo)})))])((function({isEnabled:e,isOpened:t,onTogglePanel:n}){return e?(0,s.createElement)(S.PostExcerptCheck,null,(0,s.createElement)(_.PanelBody,{title:(0,b.__)("Excerpt"),opened:t,onToggle:n},(0,s.createElement)(S.PostExcerpt,null))):null})),ea="discussion-panel";const ta=(0,f.compose)([(0,u.withSelect)((e=>({isEnabled:e(on).isEditorPanelEnabled(ea),isOpened:e(on).isEditorPanelOpened(ea)}))),(0,u.withDispatch)((e=>({onTogglePanel:()=>e(on).toggleEditorPanelOpened(ea)})))])((function({isEnabled:e,isOpened:t,onTogglePanel:n}){return e?(0,s.createElement)(S.PostTypeSupportCheck,{supportKeys:["comments","trackbacks"]},(0,s.createElement)(_.PanelBody,{title:(0,b.__)("Discussion"),opened:t,onToggle:n},(0,s.createElement)(S.PostTypeSupportCheck,{supportKeys:"comments"},(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(S.PostComments,null))),(0,s.createElement)(S.PostTypeSupportCheck,{supportKeys:"trackbacks"},(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(S.PostPingbacks,null))))):null})),na="page-attributes";const oa=function(){var e;const{isEnabled:t,isOpened:n,postType:o}=(0,u.useSelect)((e=>{const{getEditedPostAttribute:t}=e(S.store),{isEditorPanelEnabled:n,isEditorPanelOpened:o}=e(on),{getPostType:a}=e(w.store);return{isEnabled:n(na),isOpened:o(na),postType:a(t("type"))}}),[]),{toggleEditorPanelOpened:a}=(0,u.useDispatch)(on);return t&&o?(0,s.createElement)(S.PageAttributesCheck,null,(0,s.createElement)(_.PanelBody,{title:null!==(e=o?.labels?.attributes)&&void 0!==e?e:(0,b.__)("Page attributes"),opened:n,onToggle:(...e)=>a(na,...e)},(0,s.createElement)(S.PageAttributesParent,null),(0,s.createElement)(_.PanelRow,null,(0,s.createElement)(S.PageAttributesOrder,null)))):null};const aa=function({location:e}){const t=(0,s.useRef)(null),n=(0,s.useRef)(null);(0,s.useEffect)((()=>(n.current=document.querySelector(".metabox-location-"+e),n.current&&t.current.appendChild(n.current),()=>{n.current&&document.querySelector("#metaboxes").appendChild(n.current)})),[e]);const o=(0,u.useSelect)((e=>e(on).isSavingMetaBoxes()),[]),a=L()("edit-post-meta-boxes-area",`is-${e}`,{"is-loading":o});return(0,s.createElement)("div",{className:a},o&&(0,s.createElement)(_.Spinner,null),(0,s.createElement)("div",{className:"edit-post-meta-boxes-area__container",ref:t}),(0,s.createElement)("div",{className:"edit-post-meta-boxes-area__clear"}))};class la extends s.Component{componentDidMount(){this.updateDOM()}componentDidUpdate(e){this.props.isVisible!==e.isVisible&&this.updateDOM()}updateDOM(){const{id:e,isVisible:t}=this.props,n=document.getElementById(e);n&&(t?n.classList.remove("is-hidden"):n.classList.add("is-hidden"))}render(){return null}}const sa=(0,u.withSelect)(((e,{id:t})=>({isVisible:e(on).isEditorPanelEnabled(`meta-box-${t}`)})))(la);function ra({location:e}){const t=(0,u.useRegistry)(),{metaBoxes:n,areMetaBoxesInitialized:o,isEditorReady:a}=(0,u.useSelect)((t=>{const{__unstableIsEditorReady:n}=t(S.store),{getMetaBoxesPerLocation:o,areMetaBoxesInitialized:a}=t(on);return{metaBoxes:o(e),areMetaBoxesInitialized:a(),isEditorReady:n()}}),[e]);return(0,s.useEffect)((()=>{a&&!o&&t.dispatch(on).initializeMetaBoxes()}),[a,o]),o?(0,s.createElement)(s.Fragment,null,(null!=n?n:[]).map((({id:e})=>(0,s.createElement)(sa,{key:e,id:e}))),(0,s.createElement)(aa,{location:e})):null}window.wp.warning;const{Fill:ia,Slot:ca}=(0,_.createSlotFill)("PluginDocumentSettingPanel"),da=(0,f.compose)((0,C.withPluginContext)(((e,t)=>(void 0===t.name&&"undefined"!=typeof process&&process.env,{panelName:`${e.name}/${t.name}`}))),(0,u.withSelect)(((e,{panelName:t})=>({opened:e(on).isEditorPanelOpened(t),isEnabled:e(on).isEditorPanelEnabled(t)}))),(0,u.withDispatch)(((e,{panelName:t})=>({onToggle:()=>e(on).toggleEditorPanelOpened(t)}))))((({isEnabled:e,panelName:t,opened:n,onToggle:o,className:a,title:l,icon:r,children:i})=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Tn,{label:l,panelName:t}),(0,s.createElement)(ia,null,e&&(0,s.createElement)(_.PanelBody,{className:a,title:l,icon:r,opened:n,onToggle:o},i)))));da.Slot=ca;const ua=da;function ma({className:e,...t}){const{postTitle:n,shortcut:o,showIconLabels:a}=(0,u.useSelect)((e=>({postTitle:e(S.store).getEditedPostAttribute("title"),shortcut:e(xe.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),showIconLabels:e(on).isFeatureActive("showIconLabels")})),[]);return(0,s.createElement)(pe,{panelClassName:e,className:"edit-post-sidebar",smallScreenTitle:n||(0,b.__)("(no title)"),scope:"core/edit-post",toggleShortcut:o,showIconLabels:a,...t})}const pa=function(){const e=(0,u.useSelect)((e=>{const{getEditedPostTemplate:t}=e(on);return t()}),[]);return e?(0,s.createElement)(_.PanelBody,null,(0,s.createElement)(_.Flex,{align:"flex-start",gap:"3"},(0,s.createElement)(_.FlexItem,null,(0,s.createElement)(ve,{icon:so})),(0,s.createElement)(_.FlexBlock,null,(0,s.createElement)("h2",{className:"edit-post-template-summary__title"},e?.title||e?.slug),(0,s.createElement)("p",null,e?.description)))):null},ga=s.Platform.select({web:!0,native:!1}),ha=()=>{const{sidebarName:e,keyboardShortcut:t,isTemplateMode:n}=(0,u.useSelect)((e=>{let t=e(ee).getActiveComplementaryArea(on.name);["edit-post/document","edit-post/block"].includes(t)||(e(E.store).getBlockSelectionStart()&&(t="edit-post/block"),t="edit-post/document");return{sidebarName:t,keyboardShortcut:e(xe.store).getShortcutRepresentation("core/edit-post/toggle-sidebar"),isTemplateMode:e(on).isEditingTemplate()}}),[]);return(0,s.createElement)(ma,{identifier:e,header:(0,s.createElement)(yo,{sidebarName:e}),closeLabel:(0,b.__)("Close Settings"),headerClassName:"edit-post-sidebar__panel-tabs",title:(0,b.__)("Settings"),toggleShortcut:t,icon:(0,b.isRTL)()?bo:fo,isActiveByDefault:ga},!n&&"edit-post/document"===e&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Zo,null),(0,s.createElement)(ua.Slot,null),(0,s.createElement)($o,null),(0,s.createElement)(qo,null),(0,s.createElement)(Qo,null),(0,s.createElement)(Jo,null),(0,s.createElement)(ta,null),(0,s.createElement)(oa,null),(0,s.createElement)(ra,{location:"side"})),n&&"edit-post/document"===e&&(0,s.createElement)(pa,null),"edit-post/block"===e&&(0,s.createElement)(E.BlockInspector,null))};function _a({nonAnimatedSrc:e,animatedSrc:t}){return(0,s.createElement)("picture",{className:"edit-post-welcome-guide__image"},(0,s.createElement)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,s.createElement)("img",{src:t,width:"312",height:"240",alt:""}))}function Ea(){const{toggleFeature:e}=(0,u.useDispatch)(on);return(0,s.createElement)(_.Guide,{className:"edit-post-welcome-guide",contentLabel:(0,b.__)("Welcome to the block editor"),finishButtonText:(0,b.__)("Get started"),onFinish:()=>e("welcomeGuide"),pages:[{image:(0,s.createElement)(_a,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,b.__)("Welcome to the block editor")),(0,s.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,b.__)("In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.")))},{image:(0,s.createElement)(_a,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,b.__)("Make each block your own")),(0,s.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,b.__)("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,s.createElement)(_a,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,b.__)("Get to know the block library")),(0,s.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,s.createInterpolateElement)((0,b.__)("All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon."),{InserterIconImage:(0,s.createElement)("img",{alt:(0,b.__)("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,s.createElement)(_a,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,b.__)("Learn how to use the block editor")),(0,s.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,b.__)("New to the block editor? Want to learn more about using it? "),(0,s.createElement)(_.ExternalLink,{href:(0,b.__)("https://wordpress.org/documentation/article/wordpress-block-editor/")},(0,b.__)("Here's a detailed guide."))))}]})}function ba(){const{toggleFeature:e}=(0,u.useDispatch)(on);return(0,s.createElement)(_.Guide,{className:"edit-template-welcome-guide",contentLabel:(0,b.__)("Welcome to the template editor"),finishButtonText:(0,b.__)("Get started"),onFinish:()=>e("welcomeGuideTemplate"),pages:[{image:(0,s.createElement)(_a,{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,s.createElement)(s.Fragment,null,(0,s.createElement)("h1",{className:"edit-post-welcome-guide__heading"},(0,b.__)("Welcome to the template editor")),(0,s.createElement)("p",{className:"edit-post-welcome-guide__text"},(0,b.__)("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 fa(){const{isActive:e,isTemplateMode:t}=(0,u.useSelect)((e=>{const{isFeatureActive:t,isEditingTemplate:n}=e(on),o=n();return{isActive:t(o?"welcomeGuideTemplate":"welcomeGuide"),isTemplateMode:o}}),[]);return e?t?(0,s.createElement)(ba,null):(0,s.createElement)(Ea,null):null}const{Fill:ya,Slot:va}=(0,_.createSlotFill)("PluginPostPublishPanel"),wa=(0,f.compose)((0,C.withPluginContext)(((e,t)=>({icon:t.icon||e.icon}))))((({children:e,className:t,title:n,initialOpen:o=!1,icon:a})=>(0,s.createElement)(ya,null,(0,s.createElement)(_.PanelBody,{className:t,initialOpen:o||!n,title:n,icon:a},e))));wa.Slot=va;const Sa=wa,{Fill:ka,Slot:Pa}=(0,_.createSlotFill)("PluginPrePublishPanel"),Ca=(0,f.compose)((0,C.withPluginContext)(((e,t)=>({icon:t.icon||e.icon}))))((({children:e,className:t,title:n,initialOpen:o=!1,icon:a})=>(0,s.createElement)(ka,null,(0,s.createElement)(_.PanelBody,{className:t,initialOpen:o||!n,title:n,icon:a},e))));Ca.Slot=Pa;const Ta=Ca,{Fill:xa,Slot:Ma}=(0,_.createSlotFill)("ActionsPanel");function Ba({setEntitiesSavedStatesCallback:e,closeEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n}){const{closePublishSidebar:o,togglePublishSidebar:a}=(0,u.useDispatch)(on),{publishSidebarOpened:l,hasActiveMetaboxes:r,isSavingMetaBoxes:i,hasNonPostEntityChanges:c}=(0,u.useSelect)((e=>({publishSidebarOpened:e(on).isPublishSidebarOpened(),hasActiveMetaboxes:e(on).hasMetaBoxes(),isSavingMetaBoxes:e(on).isSavingMetaBoxes(),hasNonPostEntityChanges:e(S.store).hasNonPostEntityChanges()})),[]),d=(0,s.useCallback)((()=>e(!0)),[]);let m;return m=l?(0,s.createElement)(S.PostPublishPanel,{onClose:o,forceIsDirty:r,forceIsSaving:i,PrePublishExtension:Ta.Slot,PostPublishExtension:Sa.Slot}):c?(0,s.createElement)("div",{className:"edit-post-layout__toggle-entities-saved-states-panel"},(0,s.createElement)(_.Button,{variant:"secondary",className:"edit-post-layout__toggle-entities-saved-states-panel-button",onClick:d,"aria-expanded":!1},(0,b.__)("Open save panel"))):(0,s.createElement)("div",{className:"edit-post-layout__toggle-publish-panel"},(0,s.createElement)(_.Button,{variant:"secondary",className:"edit-post-layout__toggle-publish-panel-button",onClick:a,"aria-expanded":!1},(0,b.__)("Open publish panel"))),(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(S.EntitiesSavedStates,{close:t}),(0,s.createElement)(Ma,{bubblesVirtually:!0}),!n&&m)}function Ia(){const{blockPatternsWithPostContentBlockType:e,postType:t}=(0,u.useSelect)((e=>{const{getPatternsByBlockTypes:t}=e(E.store),{getCurrentPostType:n}=e(S.store);return{blockPatternsWithPostContentBlockType:t("core/post-content"),postType:n()}}),[]);return(0,s.useMemo)((()=>e.filter((e=>"page"===t&&!e.postTypes||Array.isArray(e.postTypes)&&e.postTypes.includes(t)))),[t,e])}function La({onChoosePattern:e}){const t=Ia(),n=(0,f.useAsyncList)(t),{resetEditorBlocks:o}=(0,u.useDispatch)(S.store);return(0,s.createElement)(E.__experimentalBlockPatternsList,{blockPatterns:t,shownPatterns:n,onClickPattern:(t,n)=>{o(n),e()}})}const Na={INITIAL:"INITIAL",PATTERN:"PATTERN",CLOSED:"CLOSED"};function Aa(){const[e,t]=(0,s.useState)(Na.INITIAL),n=Ia().length>0,o=(0,u.useSelect)((t=>{if(!n||e!==Na.INITIAL)return!1;const{getEditedPostContent:o,isEditedPostSaveable:a}=t(S.store),{isEditingTemplate:l,isFeatureActive:s}=t(on);return!a()&&""===o()&&!l()&&!s("welcomeGuide")}),[e,n]);return(0,s.useEffect)((()=>{o&&t(Na.PATTERN)}),[o]),e===Na.INITIAL||e===Na.CLOSED?null:(0,s.createElement)(_.Modal,{className:"edit-post-start-page-options__modal",title:(0,b.__)("Choose a pattern"),isFullScreen:!0,onRequestClose:()=>{t(Na.CLOSED)}},(0,s.createElement)("div",{className:"edit-post-start-page-options__modal-content"},e===Na.PATTERN&&(0,s.createElement)(La,{onChoosePattern:()=>{t(Na.CLOSED)}})))}const{getLayoutStyles:Da}=mn(E.privateApis),Va={header:(0,b.__)("Editor top bar"),body:(0,b.__)("Editor content"),sidebar:(0,b.__)("Editor settings"),actions:(0,b.__)("Editor publish"),footer:(0,b.__)("Editor footer")};const Oa=function(){const e=(0,f.useViewportMatch)("medium","<"),t=(0,f.useViewportMatch)("huge",">="),n=(0,f.useViewportMatch)("large"),{openGeneralSidebar:o,closeGeneralSidebar:a,setIsInserterOpened:l}=(0,u.useDispatch)(on),{createErrorNotice:r}=(0,u.useDispatch)(x.store),{mode:i,isFullscreenActive:c,isRichEditingEnabled:d,sidebarIsOpened:m,hasActiveMetaboxes:p,hasFixedToolbar:g,previousShortcut:h,nextShortcut:y,hasBlockSelected:v,isInserterOpened:w,isListViewOpened:k,showIconLabels:P,isDistractionFree:T,showBlockBreadcrumbs:M,isTemplateMode:B,documentLabel:I}=(0,u.useSelect)((e=>{const{getEditorSettings:t,getPostTypeLabel:n}=e(S.store),o=t(),a=n();return{isTemplateMode:e(on).isEditingTemplate(),hasFixedToolbar:e(on).isFeatureActive("fixedToolbar"),sidebarIsOpened:!(!e(ee).getActiveComplementaryArea(on.name)&&!e(on).isPublishSidebarOpened()),isFullscreenActive:e(on).isFeatureActive("fullscreenMode"),isInserterOpened:e(on).isInserterOpened(),isListViewOpened:e(on).isListViewOpened(),mode:e(on).getEditorMode(),isRichEditingEnabled:o.richEditingEnabled,hasActiveMetaboxes:e(on).hasMetaBoxes(),previousShortcut:e(xe.store).getAllShortcutKeyCombinations("core/edit-post/previous-region"),nextShortcut:e(xe.store).getAllShortcutKeyCombinations("core/edit-post/next-region"),showIconLabels:e(on).isFeatureActive("showIconLabels"),isDistractionFree:e(on).isFeatureActive("distractionFree"),showBlockBreadcrumbs:e(on).isFeatureActive("showBlockBreadcrumbs"),documentLabel:a||(0,b._x)("Document","noun")}}),[]),N=function(){const{hasThemeStyleSupport:e,editorSettings:t}=(0,u.useSelect)((e=>({hasThemeStyleSupport:e(on).isFeatureActive("themeStyles"),editorSettings:e(S.store).getEditorSettings()})),[]);return(0,s.useMemo)((()=>{var n,o;const a=null!==(n=t.styles?.filter((e=>e.__unstableType&&"theme"!==e.__unstableType)))&&void 0!==n?n:[],l=[...t.defaultEditorStyles,...a],s=e&&a.length!==(null!==(o=t.styles?.length)&&void 0!==o?o:0);return t.disableLayoutStyles||s||l.push({css:Da({style:{},selector:"body",hasBlockGapSupport:!1,hasFallbackGapSupport:!0,fallbackGapValue:"0.5em"})}),s?t.styles:l}),[t.defaultEditorStyles,t.disableLayoutStyles,t.styles,e])}();(0,s.useEffect)((()=>{m&&!t&&l(!1)}),[m,t]),(0,s.useEffect)((()=>{w&&!t&&a()}),[w,t]);const[A,D]=(0,s.useState)(!1),V=(0,s.useCallback)((e=>{"function"==typeof A&&A(e),D(!1)}),[A]),O=L()("edit-post-layout","is-mode-"+i,{"is-sidebar-opened":m,"has-fixed-toolbar":g,"has-metaboxes":p,"show-icon-labels":P,"is-distraction-free":T&&n,"is-entity-save-view-open":!!A}),R=k?(0,b.__)("Document Overview"):(0,b.__)("Block Library");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(ge,{isActive:c}),(0,s.createElement)(On,null),(0,s.createElement)(S.UnsavedChangesWarning,null),(0,s.createElement)(S.AutosaveMonitor,null),(0,s.createElement)(S.LocalAutosaveMonitor,null),(0,s.createElement)(yn,null),(0,s.createElement)(S.EditorKeyboardShortcutsRegister,null),(0,s.createElement)(ha,null),(0,s.createElement)(Ee,{isDistractionFree:T&&n,className:O,labels:{...Va,secondarySidebar:R},header:(0,s.createElement)(uo,{setEntitiesSavedStatesCallback:D}),editorNotices:(0,s.createElement)(S.EditorNotices,null),secondarySidebar:"visual"===i&&w?(0,s.createElement)(po,null):"visual"===i&&k?(0,s.createElement)(Eo,null):null,sidebar:(!e||m)&&(0,s.createElement)(s.Fragment,null,!e&&!m&&(0,s.createElement)("div",{className:"edit-post-layout__toggle-sidebar-panel"},(0,s.createElement)(_.Button,{variant:"secondary",className:"edit-post-layout__toggle-sidebar-panel-button",onClick:()=>o(v?"edit-post/block":"edit-post/document"),"aria-expanded":!1},v?(0,b.__)("Open block settings"):(0,b.__)("Open document settings"))),(0,s.createElement)(pe.Slot,{scope:"core/edit-post"})),notices:(0,s.createElement)(S.EditorSnackbars,null),content:(0,s.createElement)(s.Fragment,null,!T&&(0,s.createElement)(S.EditorNotices,null),("text"===i||!d)&&(0,s.createElement)(cn,null),d&&"visual"===i&&(0,s.createElement)(fn,{styles:N}),!T&&!B&&(0,s.createElement)("div",{className:"edit-post-layout__metaboxes"},(0,s.createElement)(ra,{location:"normal"}),(0,s.createElement)(ra,{location:"advanced"})),e&&m&&(0,s.createElement)(_.ScrollLock,null)),footer:!T&&!e&&M&&d&&"visual"===i&&(0,s.createElement)("div",{className:"edit-post-layout__footer"},(0,s.createElement)(E.BlockBreadcrumb,{rootLabelText:I})),actions:(0,s.createElement)(Ba,{closeEntitiesSavedStates:V,isEntitiesSavedStatesOpen:A,setEntitiesSavedStatesCallback:D}),shortcuts:{previous:h,next:y}}),(0,s.createElement)(Dn,null),(0,s.createElement)(Oe,null),(0,s.createElement)(fa,null),(0,s.createElement)(S.PostSyncStatusModal,null),(0,s.createElement)(Aa,null),(0,s.createElement)(_.Popover.Slot,null),(0,s.createElement)(C.PluginArea,{onError:function(e){r((0,b.sprintf)((0,b.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}))},Ra=e=>{const{hasBlockSelection:t,isEditorSidebarOpened:n}=(0,u.useSelect)((e=>({hasBlockSelection:!!e(E.store).getBlockSelectionStart(),isEditorSidebarOpened:e(nn).isEditorSidebarOpened()})),[e]),{openGeneralSidebar:o}=(0,u.useDispatch)(nn);(0,s.useEffect)((()=>{n&&o(t?"edit-post/block":"edit-post/document")}),[t,n])},Fa=e=>{const{newPermalink:t}=(0,u.useSelect)((e=>({newPermalink:e(S.store).getCurrentPost().link})),[e]),n=(0,s.useRef)();(0,s.useEffect)((()=>{n.current=document.querySelector("#wp-admin-bar-preview a")||document.querySelector("#wp-admin-bar-view a")}),[e]),(0,s.useEffect)((()=>{t&&n.current&&n.current.setAttribute("href",t)}),[t])};function Ha({postId:e}){return Ra(e),Fa(e),null}const Ga=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.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"})),Ua=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})),za=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(k.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"})),Za=(0,s.createElement)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(k.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"})),$a=(0,s.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(k.Path,{d:"M18,0 L2,0 C0.9,0 0.01,0.9 0.01,2 L0,12 C0,13.1 0.9,14 2,14 L18,14 C19.1,14 20,13.1 20,12 L20,2 C20,0.9 19.1,0 18,0 Z M18,12 L2,12 L2,2 L18,2 L18,12 Z M9,3 L11,3 L11,5 L9,5 L9,3 Z M9,6 L11,6 L11,8 L9,8 L9,6 Z M6,3 L8,3 L8,5 L6,5 L6,3 Z M6,6 L8,6 L8,8 L6,8 L6,6 Z M3,6 L5,6 L5,8 L3,8 L3,6 Z M3,3 L5,3 L5,5 L3,5 L3,3 Z M6,9 L14,9 L14,11 L6,11 L6,9 Z M12,6 L14,6 L14,8 L12,8 L12,6 Z M12,3 L14,3 L14,5 L12,5 L12,3 Z M15,6 L17,6 L17,8 L15,8 L15,6 Z M15,3 L17,3 L17,5 L15,5 L15,3 Z M10,20 L14,16 L6,16 L10,20 Z"}));const{ExperimentalEditorProvider:Wa}=mn(S.privateApis),{useCommands:qa}=mn(rn.privateApis);const ja=function({postId:e,postType:t,settings:n,initialEdits:o,...a}){qa(),function(){const{openGeneralSidebar:e,closeGeneralSidebar:t,switchEditorMode:n,setIsListViewOpened:o}=(0,u.useDispatch)(on),{openModal:a}=(0,u.useDispatch)(ee),{editorMode:l,activeSidebar:s,isListViewOpen:r}=(0,u.useSelect)((e=>{const{getEditorMode:t,isListViewOpened:n}=e(on);return{activeSidebar:e(ee).getActiveComplementaryArea(on.name),editorMode:t(),isListViewOpen:n()}}),[]),{toggle:i}=(0,u.useDispatch)(p.store);(0,sn.useCommand)({name:"core/open-settings-sidebar",label:(0,b.__)("Toggle settings sidebar"),icon:(0,b.isRTL)()?bo:fo,callback:({close:n})=>{n(),"edit-post/document"===s?t():e("edit-post/document")}}),(0,sn.useCommand)({name:"core/open-block-inspector",label:(0,b.__)("Toggle block inspector"),icon:Ga,callback:({close:n})=>{n(),"edit-post/block"===s?t():e("edit-post/block")}}),(0,sn.useCommand)({name:"core/toggle-distraction-free",label:(0,b.__)("Toggle distraction free"),icon:Ua,callback:({close:e})=>{i("core/edit-post","distractionFree"),e()}}),(0,sn.useCommand)({name:"core/toggle-spotlight-mode",label:(0,b.__)("Toggle spotlight mode"),icon:Ua,callback:({close:e})=>{i("core/edit-post","focusMode"),e()}}),(0,sn.useCommand)({name:"core/toggle-fullscreen-mode",label:(0,b.__)("Toggle fullscreen mode"),icon:za,callback:({close:e})=>{i("core/edit-post","fullscreenMode"),e()}}),(0,sn.useCommand)({name:"core/toggle-list-view",label:(0,b.__)("Toggle list view"),icon:Hn,callback:({close:e})=>{o(!r),e()}}),(0,sn.useCommand)({name:"core/toggle-top-toolbar",label:(0,b.__)("Toggle top toolbar"),icon:Ua,callback:({close:e})=>{i("core/edit-post","fixedToolbar"),e()}}),(0,sn.useCommand)({name:"core/toggle-code-editor",label:(0,b.__)("Toggle code editor"),icon:Za,callback:({close:e})=>{n("visual"===l?"text":"visual"),e()}}),(0,sn.useCommand)({name:"core/open-preferences",label:(0,b.__)("Open editor preferences"),icon:Ua,callback:()=>{a(An)}}),(0,sn.useCommand)({name:"core/open-shortcut-help",label:(0,b.__)("Open keyboard shortcuts"),icon:$a,callback:()=>{a(Ne)}})}();const{hasFixedToolbar:l,focusMode:i,isDistractionFree:c,hasInlineToolbar:d,post:m,preferredStyleVariations:g,hiddenBlockTypes:h,blockTypes:E,keepCaretInsideBlock:f,isTemplateMode:y,template:v}=(0,u.useSelect)((n=>{var o;const{isFeatureActive:a,isEditingTemplate:l,getEditedPostTemplate:s,getHiddenBlockTypes:i}=n(on),{getEntityRecord:c,getPostType:d,getEntityRecords:u,canUser:m}=n(w.store),{getEditorSettings:g}=n(S.store),{getBlockTypes:h}=n(r.store);let _;if(["wp_template","wp_template_part"].includes(t)){const n=u("postType",t,{wp_id:e});_=n?.[0]}else _=c("postType",t,e);const E=g().supportsTemplateMode,b=null!==(o=d(t)?.viewable)&&void 0!==o&&o,f=m("create","templates");return{hasFixedToolbar:a("fixedToolbar"),focusMode:a("focusMode"),isDistractionFree:a("distractionFree"),hasInlineToolbar:a("inlineToolbar"),preferredStyleVariations:n(p.store).get("core/edit-post","preferredStyleVariations"),hiddenBlockTypes:i(),blockTypes:h(),keepCaretInsideBlock:a("keepCaretInsideBlock"),isTemplateMode:l(),template:E&&b&&f?s():null,post:_}}),[t,e]),{updatePreferredStyleVariations:k,setIsInserterOpened:P}=(0,u.useDispatch)(on),C=(0,s.useMemo)((()=>{const e={...n,__experimentalPreferredStyleVariations:{value:g,onChange:k},hasFixedToolbar:l,focusMode:i,isDistractionFree:c,hasInlineToolbar:d,__experimentalSetIsInserterOpened:P,keepCaretInsideBlock:f,defaultAllowedBlockTypes:n.allowedBlockTypes};if(h.length>0){const t=!0===n.allowedBlockTypes?E.map((({name:e})=>e)):n.allowedBlockTypes||[];e.allowedBlockTypes=t.filter((e=>!h.includes(e)))}return e}),[n,l,d,i,c,h,E,g,P,k,f]);return m?(0,s.createElement)(xe.ShortcutProvider,null,(0,s.createElement)(_.SlotFillProvider,null,(0,s.createElement)(Wa,{settings:C,post:m,initialEdits:o,useSubRegistry:!1,__unstableTemplate:y?v:void 0,...a},(0,s.createElement)(S.ErrorBoundary,null,(0,s.createElement)(sn.CommandMenu,null),(0,s.createElement)(Ha,{postId:e}),(0,s.createElement)(Oa,null)),(0,s.createElement)(S.PostLockedModal,null)))):null},Ka=({allowedBlocks:e,icon:t,label:n,onClick:o,small:a,role:l})=>(0,s.createElement)(E.BlockSettingsMenuControls,null,(({selectedBlocks:r,onClose:i})=>((e,t)=>{return!Array.isArray(t)||(n=t,0===e.filter((e=>!n.includes(e))).length);var n})(r,e)?(0,s.createElement)(_.MenuItem,{onClick:(0,f.compose)(o,i),icon:t,label:a?n:void 0,role:l},!a&&n):null)),Ya=(0,f.compose)((0,C.withPluginContext)(((e,t)=>{var n;return{as:null!==(n=t.as)&&void 0!==n?n:_.MenuItem,icon:t.icon||e.icon,name:"core/edit-post/plugin-more-menu"}})))(se);function Qa(e){return(0,s.createElement)(ie,{__unstableExplicitMenuItem:!0,scope:"core/edit-post",...e})}function Xa(e,t,n,o,a){const l=document.getElementById(e),c=(0,s.createRoot)(l);(0,u.dispatch)(p.store).setDefaults("core/edit-post",{editorMode:"visual",fixedToolbar:!1,fullscreenMode:!0,hiddenBlockTypes:[],inactivePanels:[],isPublishSidebarEnabled:!0,openPanels:["post-status"],preferredStyleVariations:{},showBlockBreadcrumbs:!0,showIconLabels:!1,showListViewByDefault:!1,themeStyles:!0,welcomeGuide:!0,welcomeGuideTemplate:!0}),(0,u.dispatch)(r.store).__experimentalReapplyBlockTypeFilters(),(0,u.select)(on).isFeatureActive("showListViewByDefault")&&!(0,u.select)(on).isFeatureActive("distractionFree")&&(0,u.dispatch)(on).setIsListViewOpened(!0),(0,i.registerCoreBlocks)(),(0,g.registerLegacyWidgetBlock)({inserter:!1}),(0,g.registerWidgetGroupBlock)({inserter:!1}),(0,m.addFilter)("blockEditor.__unstableCanInsertBlockType","removeTemplatePartsFromInserter",((e,t)=>!(!(0,u.select)(on).isEditingTemplate()&&"core/template-part"===t.name)&&e)),(0,m.addFilter)("blockEditor.__unstableCanInsertBlockType","removePostContentFromInserter",((e,t,n,{getBlockParentsByBlockName:o})=>(0,u.select)(on).isEditingTemplate()||"core/post-content"!==t.name?e:o(n,"core/query").length>0));"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 <!DOCTYPE html>. 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,s.createElement)(ja,{settings:o,postId:n,postType:t,initialEdits:a})),c}function Ja(){d()("wp.editPost.reinitializeEditor",{since:"6.2",version:"6.3"})}})(),(window.wp=window.wp||{}).editPost=o})(); |