WordPress/wp-includes/js/dist/edit-site.min.js

7 lines
133 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! This file is auto-generated */
!function(){var e={4403:function(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 r={}.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 o=a.apply(null,n);o&&e.push(o)}}else if("object"===l)if(n.toString===Object.prototype.toString)for(var i in n)r.call(n,i)&&n[i]&&e.push(i);else e.push(n.toString())}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},8981:function(e,t){var n,r,a;r=[],void 0===(a="function"==typeof(n=function(){return function e(t,n,r){var a,l,o=window,i="application/octet-stream",s=r||i,c=t,u=!n&&!r&&c,m=document.createElement("a"),d=function(e){return String(e)},p=o.Blob||o.MozBlob||o.WebKitBlob||d,_=n||"download";if(p=p.call?p.bind(o):Blob,"true"===String(this)&&(s=(c=[c,s])[0],c=c[1]),u&&u.length<2048&&(_=u.split("/").pop().split("?")[0],m.href=u,-1!==m.href.indexOf(u))){var g=new XMLHttpRequest;return g.open("GET",u,!0),g.responseType="blob",g.onload=function(t){e(t.target.response,_,i)},setTimeout((function(){g.send()}),0),g}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(c)){if(!(c.length>2096103.424&&p!==d))return navigator.msSaveBlob?navigator.msSaveBlob(v(c),_):y(c);s=(c=v(c)).type||i}else if(/([\x80-\xff])/.test(c)){for(var h=0,E=new Uint8Array(c.length),f=E.length;h<f;++h)E[h]=c.charCodeAt(h);c=new p([E],{type:s})}function v(e){for(var t=e.split(/[:;,]/),n=t[1],r=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),a=r.length,l=0,o=new Uint8Array(a);l<a;++l)o[l]=r.charCodeAt(l);return new p([o],{type:n})}function y(e,t){if("download"in m)return m.href=e,m.setAttribute("download",_),m.className="download-js-link",m.innerHTML="downloading...",m.style.display="none",document.body.appendChild(m),setTimeout((function(){m.click(),document.body.removeChild(m),!0===t&&setTimeout((function(){o.URL.revokeObjectURL(m.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,i)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var n=document.createElement("iframe");document.body.appendChild(n),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,i)),n.src=e,setTimeout((function(){document.body.removeChild(n)}),333)}if(a=c instanceof p?c:new p([c],{type:s}),navigator.msSaveBlob)return navigator.msSaveBlob(a,_);if(o.URL)y(o.URL.createObjectURL(a),!0);else{if("string"==typeof a||a.constructor===d)try{return y("data:"+s+";base64,"+o.btoa(a))}catch(e){return y("data:"+s+","+encodeURIComponent(a))}(l=new FileReader).onload=function(e){y(this.result)},l.readAsDataURL(a)}return!0}})?n.apply(t,r):n)||(e.exports=a)}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var l=t[r]={exports:{}};return e[r].call(l.exports,l,l.exports,n),l.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};!function(){"use strict";n.r(r),n.d(r,{PluginMoreMenuItem:function(){return Ll},PluginSidebar:function(){return Al},PluginSidebarMoreMenuItem:function(){return Rl},__experimentalMainDashboardButton:function(){return ua},__experimentalNavigationToggle:function(){return ga},initializeEditor:function(){return Dl},reinitializeEditor:function(){return Bl}});var e={};n.r(e),n.d(e,{disableComplementaryArea:function(){return Y},enableComplementaryArea:function(){return K},pinItem:function(){return Q},setFeatureDefaults:function(){return te},setFeatureValue:function(){return ee},toggleFeature:function(){return J},unpinItem:function(){return Z}});var t={};n.r(t),n.d(t,{getActiveComplementaryArea:function(){return ne},isFeatureActive:function(){return ae},isItemPinned:function(){return re}});var a={};n.r(a),n.d(a,{__experimentalSetPreviewDeviceType:function(){return Te},addTemplate:function(){return Ne},closeGeneralSidebar:function(){return Ge},openGeneralSidebar:function(){return ze},openNavigationPanelToMenu:function(){return Le},removeTemplate:function(){return Ie},revertTemplate:function(){return Ve},setHomeTemplateId:function(){return Me},setIsInserterOpened:function(){return De},setIsListViewOpened:function(){return Fe},setIsNavigationPanelOpened:function(){return Be},setNavigationPanelActiveMenu:function(){return Re},setPage:function(){return Ae},setTemplate:function(){return Ce},setTemplatePart:function(){return Pe},toggleFeature:function(){return xe},updateSettings:function(){return Oe}});var l={};n.r(l),n.d(l,{__experimentalGetInsertionPoint:function(){return it},__experimentalGetPreviewDeviceType:function(){return Ke},getCanUserCreateMedia:function(){return Ye},getCurrentTemplateNavigationPanelSubMenu:function(){return at},getCurrentTemplateTemplateParts:function(){return ct},getEditedPostId:function(){return tt},getEditedPostType:function(){return et},getHomeTemplateId:function(){return Ze},getNavigationPanelActiveMenu:function(){return rt},getPage:function(){return nt},getReusableBlocks:function(){return Xe},getSettings:function(){return Qe},isFeatureActive:function(){return qe},isInserterOpened:function(){return ot},isListViewOpened:function(){return st},isNavigationOpened:function(){return lt}});var o=window.wp.element,i=window.wp.blocks,s=window.wp.blockLibrary,c=window.wp.data,u=window.wp.coreData,m=window.wp.editor,d=window.wp.i18n,p=window.wp.viewport,_=window.wp.url,g=window.wp.hooks,h=window.wp.mediaUtils;(0,g.addFilter)("editor.MediaUpload","core/edit-site/components/media-upload",(()=>h.MediaUpload));var E=window.wp.dataControls;const f={features:{welcomeGuide:!0,welcomeGuideStyles:!0}},v="core/edit-site",y="uncategorized",b=["index","singular","archive","single","page","home","404","search","author","category","taxonomy","date","tag","attachment","single-post","front-page"],w=["page-home"],S=["post-","author-","single-post-","tag-"],k=["page-"],x={singular:["single","page"],index:["archive","404","search","singular","home"],home:["front-page"]},T="root",C="templates",N="templates-general",I=[{area:"header",menu:"template-parts-headers",title:(0,d.__)("headers")},{area:"footer",menu:"template-parts-footers",title:(0,d.__)("footers")},{area:"sidebar",menu:"template-parts-sidebars",title:(0,d.__)("sidebars")},{area:y,menu:"template-parts-general",title:(0,d.__)("general")}],P=(0,c.combineReducers)({features(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f.features,t=arguments.length>1?arguments[1]:void 0;return"TOGGLE_FEATURE"===t.type?{...e,[t.feature]:!e[t.feature]}:e}});var M=(0,c.combineReducers)({preferences:P,deviceType:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Desktop",t=arguments.length>1?arguments[1]:void 0;return"SET_PREVIEW_DEVICE_TYPE"===t.type?t.deviceType:e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"UPDATE_SETTINGS"===t.type?{...e,...t.settings}:e},editedPost:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE":case"SET_PAGE":return{type:"wp_template",id:t.templateId,page:t.page};case"SET_TEMPLATE_PART":return{type:"wp_template_part",id:t.templatePartId}}return e},homeTemplateId:function(e,t){return"SET_HOME_TEMPLATE"===t.type?t.homeTemplateId:e},navigationPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{menu:T,isOpen:!1},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_NAVIGATION_PANEL_ACTIVE_MENU":return{...e,menu:t.menu};case"OPEN_NAVIGATION_PANEL_TO_MENU":return{...e,isOpen:!0,menu:t.menu};case"SET_IS_NAVIGATION_PANEL_OPENED":return{...e,menu:t.isOpen?e.menu:T,isOpen:t.isOpen};case"SET_IS_LIST_VIEW_OPENED":return{...e,menu:e.isOpen&&t.isOpen?T:e.menu,isOpen:!t.isOpen&&e.isOpen};case"SET_IS_INSERTER_OPENED":return{...e,menu:e.isOpen&&t.value?T:e.menu,isOpen:!t.value&&e.isOpen}}return e},blockInserterPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_NAVIGATION_PANEL_TO_MENU":return!1;case"SET_IS_NAVIGATION_PANEL_OPENED":case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},listViewPanel:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_NAVIGATION_PANEL_TO_MENU":return!1;case"SET_IS_NAVIGATION_PANEL_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e}}),A=window.wp.notices;function R(){return R=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},R.apply(this,arguments)}var L=n(4403),B=n.n(L),D=window.wp.components,O=window.wp.primitives;var F=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));var V=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.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"}));var z=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.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"}));var G=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.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"})),U=window.lodash;const H=(0,c.combineReducers)({features(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("SET_FEATURE_DEFAULTS"===t.type){const{scope:n,defaults:r}=t;return{...e,[n]:{...e[n],...r}}}return e}}),$=(0,c.combineReducers)({features(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("SET_FEATURE_VALUE"===t.type){const{scope:n,featureName:r,value:a}=t;return{...e,[n]:{...e[n],[r]:a}}}return e}}),W=(0,c.combineReducers)({singleEnableItems:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,itemType:n,scope:r,item:a}=arguments.length>1?arguments[1]:void 0;return"SET_SINGLE_ENABLE_ITEM"===t&&n&&r?{...e,[n]:{...e[n],[r]:a||null}}:e},multipleEnableItems:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,itemType:n,scope:r,item:a,isEnable:l}=arguments.length>1?arguments[1]:void 0;if("SET_MULTIPLE_ENABLE_ITEM"!==t||!n||!r||!a||(0,U.get)(e,[n,r,a])===l)return e;const o=e[n]||{},i=o[r]||{};return{...e,[n]:{...o,[r]:{...i,[a]:l||!1}}}}});var j=(0,c.combineReducers)({enableItems:W,preferenceDefaults:H,preferences:$});function q(e,t,n){return{type:"SET_SINGLE_ENABLE_ITEM",itemType:e,scope:t,item:n}}function K(e,t){return q("complementaryArea",e,t)}function Y(e){return q("complementaryArea",e,void 0)}function X(e,t,n,r){return{type:"SET_MULTIPLE_ENABLE_ITEM",itemType:e,scope:t,item:n,isEnable:r}}function Q(e,t){return X("pinnedItems",e,t,!0)}function Z(e,t){return X("pinnedItems",e,t,!1)}function J(e,t){return function(n){let{select:r,dispatch:a}=n;const l=r.isFeatureActive(e,t);a.setFeatureValue(e,t,!l)}}function ee(e,t,n){return{type:"SET_FEATURE_VALUE",scope:e,featureName:t,value:!!n}}function te(e,t){return{type:"SET_FEATURE_DEFAULTS",scope:e,defaults:t}}function ne(e,t){return function(e,t,n){return(0,U.get)(e.enableItems.singleEnableItems,[t,n])}(e,"complementaryArea",t)}function re(e,t,n){return!1!==function(e,t,n,r){return(0,U.get)(e.enableItems.multipleEnableItems,[t,n,r])}(e,"pinnedItems",t,n)}function ae(e,t,n){var r,a;const l=null===(r=e.preferences.features[t])||void 0===r?void 0:r[n];return!!(void 0!==l?l:null===(a=e.preferenceDefaults.features[t])||void 0===a?void 0:a[n])}const le="core/interface",oe=(0,c.createReduxStore)(le,{reducer:j,actions:e,selectors:t,persist:["enableItems","preferences"],__experimentalUseThunks:!0});(0,c.registerStore)(le,{reducer:j,actions:e,selectors:t,persist:["enableItems","preferences"],__experimentalUseThunks:!0});var ie=window.wp.plugins,se=(0,ie.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`})));var ce=se((function(e){let{as:t=D.Button,scope:n,identifier:r,icon:a,selectedIcon:l,...i}=e;const s=t,u=(0,c.useSelect)((e=>e(oe).getActiveComplementaryArea(n)===r),[r]),{enableComplementaryArea:m,disableComplementaryArea:d}=(0,c.useDispatch)(oe);return(0,o.createElement)(s,R({icon:l&&u?l:a,onClick:()=>{u?d(n):m(n,r)}},(0,U.omit)(i,["name"])))}));var ue=e=>{let{smallScreenTitle:t,children:n,className:r,toggleButtonProps:a}=e;const l=(0,o.createElement)(ce,R({icon:G},a));return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},t&&(0,o.createElement)("span",{className:"interface-complementary-area-header__small-title"},t),l),(0,o.createElement)("div",{className:B()("components-panel__header","interface-complementary-area-header",r),tabIndex:-1},n,l))};function me(e){let{name:t,as:n=D.Button,onClick:r,...a}=e;return(0,o.createElement)(D.Fill,{name:t},(e=>{let{onClick:t}=e;return(0,o.createElement)(n,R({onClick:r||t?function(){(r||U.noop)(...arguments),(t||U.noop)(...arguments)}:void 0},a))}))}me.Slot=function(e){let{name:t,as:n=D.ButtonGroup,fillProps:r={},bubblesVirtually:a,...l}=e;return(0,o.createElement)(D.Slot,{name:t,bubblesVirtually:a,fillProps:r},(e=>{if((0,U.isEmpty)(o.Children.toArray(e)))return null;const t=[];o.Children.forEach(e,(e=>{let{props:{__unstableExplicitMenuItem:n,__unstableTarget:r}}=e;r&&n&&t.push(r)}));const r=o.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&t.includes(e.props.__unstableTarget)?null:e));return(0,o.createElement)(n,l,r)}))};var de=me;const pe=e=>(0,o.createElement)(D.MenuItem,(0,U.omit)(e,["__unstableExplicitMenuItem","__unstableTarget"]));function _e(e){let{scope:t,target:n,__unstableExplicitMenuItem:r,...a}=e;return(0,o.createElement)(ce,R({as:e=>(0,o.createElement)(de,R({__unstableExplicitMenuItem:r,__unstableTarget:`${t}/${n}`,as:pe,name:`${t}/plugin-more-menu`},e)),role:"menuitemcheckbox",selectedIcon:F,name:n,scope:t},a))}function ge(e){let{scope:t,...n}=e;return(0,o.createElement)(D.Fill,R({name:`PinnedItems/${t}`},n))}ge.Slot=function(e){let{scope:t,className:n,...r}=e;return(0,o.createElement)(D.Slot,R({name:`PinnedItems/${t}`},r),(e=>!(0,U.isEmpty)(e)&&(0,o.createElement)("div",{className:B()(n,"interface-pinned-items")},e)))};var he=ge;function Ee(e){let{scope:t,children:n,className:r}=e;return(0,o.createElement)(D.Fill,{name:`ComplementaryArea/${t}`},(0,o.createElement)("div",{className:r},n))}const fe=se((function(e){let{children:t,className:n,closeLabel:r=(0,d.__)("Close plugin"),identifier:a,header:l,headerClassName:i,icon:s,isPinnable:u=!0,panelClassName:m,scope:_,name:g,smallScreenTitle:h,title:E,toggleShortcut:f,isActiveByDefault:v,showIconLabels:y=!1}=e;const{isActive:b,isPinned:w,activeArea:S,isSmall:k,isLarge:x}=(0,c.useSelect)((e=>{const{getActiveComplementaryArea:t,isItemPinned:n}=e(oe),r=t(_);return{isActive:r===a,isPinned:n(_,a),activeArea:r,isSmall:e(p.store).isViewportMatch("< medium"),isLarge:e(p.store).isViewportMatch("large")}}),[a,_]);!function(e,t,n,r,a){const l=(0,o.useRef)(!1),i=(0,o.useRef)(!1),{enableComplementaryArea:s,disableComplementaryArea:u}=(0,c.useDispatch)(oe);(0,o.useEffect)((()=>{r&&a&&!l.current?(u(e),i.current=!0):i.current&&!a&&l.current?(i.current=!1,s(e,t)):i.current&&n&&n!==t&&(i.current=!1),a!==l.current&&(l.current=a)}),[r,a,e,t,n])}(_,a,S,b,k);const{enableComplementaryArea:T,disableComplementaryArea:C,pinItem:N,unpinItem:I}=(0,c.useDispatch)(oe);return(0,o.useEffect)((()=>{v&&void 0===S&&!k&&T(_,a)}),[S,v,_,a,k]),(0,o.createElement)(o.Fragment,null,u&&(0,o.createElement)(he,{scope:_},w&&(0,o.createElement)(ce,{scope:_,identifier:a,isPressed:b&&(!y||x),"aria-expanded":b,label:E,icon:y?F:s,showTooltip:!y,variant:y?"tertiary":void 0})),g&&u&&(0,o.createElement)(_e,{target:g,scope:_,icon:s},E),b&&(0,o.createElement)(Ee,{className:B()("interface-complementary-area",n),scope:_},(0,o.createElement)(ue,{className:i,closeLabel:r,onClose:()=>C(_),smallScreenTitle:h,toggleButtonProps:{label:r,shortcut:f,scope:_,identifier:a}},l||(0,o.createElement)(o.Fragment,null,(0,o.createElement)("strong",null,E),u&&(0,o.createElement)(D.Button,{className:"interface-complementary-area__pin-unpin-item",icon:w?V:z,label:w?(0,d.__)("Unpin from toolbar"):(0,d.__)("Pin to toolbar"),onClick:()=>(w?I:N)(_,a),isPressed:w,"aria-expanded":w}))),(0,o.createElement)(D.Panel,{className:m},t)))}));fe.Slot=function(e){let{scope:t,...n}=e;return(0,o.createElement)(D.Slot,R({name:`ComplementaryArea/${t}`},n))};var ve=fe,ye=window.wp.compose;var be,we,Se=(0,o.forwardRef)((function(e,t){let{footer:n,header:r,sidebar:a,secondarySidebar:l,notices:i,content:s,drawer:c,actions:u,labels:m,className:p,shortcuts:_}=e;const g=(0,D.__unstableUseNavigateRegions)(_);!function(e){(0,o.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 h={...{drawer:(0,d.__)("Drawer"),header:(0,d.__)("Header"),body:(0,d.__)("Content"),secondarySidebar:(0,d.__)("Block Library"),sidebar:(0,d.__)("Settings"),actions:(0,d.__)("Publish"),footer:(0,d.__)("Footer")},...m};return(0,o.createElement)("div",R({},g,{ref:(0,ye.useMergeRefs)([t,g.ref]),className:B()(p,"interface-interface-skeleton",g.className,!!n&&"has-footer")}),!!c&&(0,o.createElement)("div",{className:"interface-interface-skeleton__drawer",role:"region","aria-label":h.drawer,tabIndex:"-1"},c),(0,o.createElement)("div",{className:"interface-interface-skeleton__editor"},!!r&&(0,o.createElement)("div",{className:"interface-interface-skeleton__header",role:"region","aria-label":h.header,tabIndex:"-1"},r),(0,o.createElement)("div",{className:"interface-interface-skeleton__body"},!!l&&(0,o.createElement)("div",{className:"interface-interface-skeleton__secondary-sidebar",role:"region","aria-label":h.secondarySidebar,tabIndex:"-1"},l),!!i&&(0,o.createElement)("div",{className:"interface-interface-skeleton__notices"},i),(0,o.createElement)("div",{className:"interface-interface-skeleton__content",role:"region","aria-label":h.body,tabIndex:"-1"},s),!!a&&(0,o.createElement)("div",{className:"interface-interface-skeleton__sidebar",role:"region","aria-label":h.sidebar,tabIndex:"-1"},a),!!u&&(0,o.createElement)("div",{className:"interface-interface-skeleton__actions",role:"region","aria-label":h.actions,tabIndex:"-1"},u))),!!n&&(0,o.createElement)("div",{className:"interface-interface-skeleton__footer",role:"region","aria-label":h.footer,tabIndex:"-1"},n))}));function ke(e){return!!e&&("custom"===(null==e?void 0:e.source)&&(null==e?void 0:e.has_theme_file))}function xe(e){return{type:"TOGGLE_FEATURE",feature:e}}function Te(e){return{type:"SET_PREVIEW_DEVICE_TYPE",deviceType:e}}function*Ce(e,t){const n={templateSlug:t};if(!t){const t=yield c.controls.resolveSelect(u.store,"getEntityRecord","postType","wp_template",e);n.templateSlug=null==t?void 0:t.slug}return{type:"SET_TEMPLATE",templateId:e,page:{context:n}}}function*Ne(e){const t=yield c.controls.dispatch(u.store,"saveEntityRecord","postType","wp_template",e);return e.content&&(yield c.controls.dispatch(u.store,"editEntityRecord","postType","wp_template",t.id,{blocks:(0,i.parse)(e.content)},{undoIgnore:!0})),{type:"SET_TEMPLATE",templateId:t.id,page:{context:{templateSlug:t.slug}}}}function*Ie(e){try{yield c.controls.dispatch(u.store,"deleteEntityRecord","postType",e.type,e.id,{force:!0});const t=yield c.controls.select(u.store,"getLastEntityDeleteError","postType",e.type,e.id);if(t)throw t;yield c.controls.dispatch(A.store,"createSuccessNotice",(0,d.sprintf)((0,d.__)('"%s" removed.'),e.title.rendered),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,d.__)("An error occurred while deleting the template.");yield c.controls.dispatch(A.store,"createErrorNotice",t,{type:"snackbar"})}}function Pe(e){return{type:"SET_TEMPLATE_PART",templatePartId:e}}function Me(e){return{type:"SET_HOME_TEMPLATE",homeTemplateId:e}}function*Ae(e){var t;if(!e.path&&null!==(t=e.context)&&void 0!==t&&t.postId){const t=yield c.controls.resolveSelect(u.store,"getEntityRecord","postType",e.context.postType||"post",e.context.postId);e.path=(0,_.getPathAndQueryString)(t.link)}const n=yield c.controls.resolveSelect(u.store,"__experimentalGetTemplateForLink",e.path);if(!n)return;const{id:r,slug:a}=n;return yield{type:"SET_PAGE",page:a?{...e,context:{...e.context,templateSlug:a}}:e,templateId:r},r}function Re(e){return{type:"SET_NAVIGATION_PANEL_ACTIVE_MENU",menu:e}}function Le(e){return{type:"OPEN_NAVIGATION_PANEL_TO_MENU",menu:e}}function Be(e){return{type:"SET_IS_NAVIGATION_PANEL_OPENED",isOpen:e}}function De(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function Oe(e){return{type:"UPDATE_SETTINGS",settings:e}}function Fe(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}function*Ve(e){let{allowUndo:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(ke(e))try{var n;const r=yield c.controls.select(u.store,"getEntity","postType",e.type);if(!r)return void(yield c.controls.dispatch(A.store,"createErrorNotice",(0,d.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"}));const a=(0,_.addQueryArgs)(`${r.baseURL}/${e.id}`,{context:"edit",source:"theme"}),l=yield(0,E.apiFetch)({path:a});if(!l)return void(yield c.controls.dispatch(A.store,"createErrorNotice",(0,d.__)("The editor has encountered an unexpected error. Please reload."),{type:"snackbar"}));const o=e=>{let{blocks:t=[]}=e;return(0,i.__unstableSerializeAndClean)(t)},s=yield c.controls.select(u.store,"getEditedEntityRecord","postType",e.type,e.id);yield c.controls.dispatch(u.store,"editEntityRecord","postType",e.type,e.id,{content:o,blocks:s.blocks,source:"custom"},{undoIgnore:!0});const m=(0,i.parse)(null==l||null===(n=l.content)||void 0===n?void 0:n.raw);if(yield c.controls.dispatch(u.store,"editEntityRecord","postType",e.type,l.id,{content:o,blocks:m,source:"theme"}),t){const t=async()=>{await(0,c.dispatch)(u.store).editEntityRecord("postType",e.type,s.id,{content:o,blocks:s.blocks,source:"custom"})};yield c.controls.dispatch(A.store,"createSuccessNotice",(0,d.__)("Template reverted."),{type:"snackbar",actions:[{label:(0,d.__)("Undo"),onClick:t}]})}else yield c.controls.dispatch(A.store,"createSuccessNotice",(0,d.__)("Template reverted."))}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,d.__)("Template revert failed. Please reload.");yield c.controls.dispatch(A.store,"createErrorNotice",t,{type:"snackbar"})}else yield c.controls.dispatch(A.store,"createErrorNotice",(0,d.__)("This template is not revertable."),{type:"snackbar"})}function*ze(e){yield c.controls.dispatch(oe,"enableComplementaryArea",v,e)}function*Ge(){yield c.controls.dispatch(oe,"disableComplementaryArea",v)}function Ue(e){return[e]}function He(){var e={clear:function(){e.head=null}};return e}function $e(e,t,n){var r;if(e.length!==t.length)return!1;for(r=n;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function We(e,t,n){return!!x[e]&&("home"===e&&"posts"!==n||x[e].every((e=>t.includes(e)||We(e,t,n))))}function je(e){if(b.includes(e))return C;if(w.includes(e))return N;if(S.some((t=>e.startsWith(t))))return"templates-posts";return k.some((t=>e.startsWith(t)))?"templates-pages":N}function qe(e,t){return(0,U.get)(e.preferences.features,[t],!1)}function Ke(e){return e.deviceType}be={},we="undefined"!=typeof WeakMap;const Ye=(0,c.createRegistrySelector)((e=>()=>e(u.store).canUser("create","media"))),Xe=(0,c.createRegistrySelector)((e=>()=>"web"===o.Platform.OS?e(u.store).getEntityRecords("postType","wp_block",{per_page:-1}):[])),Qe=function(e,t){var n,r;function a(){n=we?new WeakMap:He()}function l(){var n,a,l,o,i,s=arguments.length;for(o=new Array(s),l=0;l<s;l++)o[l]=arguments[l];for(i=t.apply(null,o),(n=r(i)).isUniqueByDependants||(n.lastDependants&&!$e(i,n.lastDependants,0)&&n.clear(),n.lastDependants=i),a=n.head;a;){if($e(a.args,o,1))return a!==n.head&&(a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=n.head,a.prev=null,n.head.prev=a,n.head=a),a.val;a=a.next}return a={val:e.apply(null,o)},o[0]=null,a.args=o,n.head&&(n.head.prev=a,a.next=n.head),n.head=a,a.val}return t||(t=Ue),r=we?function(e){var t,r,a,l,o,i=n,s=!0;for(t=0;t<e.length;t++){if(r=e[t],!(o=r)||"object"!=typeof o){s=!1;break}i.has(r)?i=i.get(r):(a=new WeakMap,i.set(r,a),i=a)}return i.has(be)||((l=He()).isUniqueByDependants=s,i.set(be,l)),i.get(be)}:function(){return n},l.getDependants=t,l.clear=a,a(),l}(((e,t)=>{const n={...e.settings,outlineMode:!0,focusMode:qe(e,"focusMode"),hasFixedToolbar:qe(e,"fixedToolbar"),__experimentalSetIsInserterOpened:t,__experimentalReusableBlocks:Xe(e)};return Ye(e)?(n.mediaUpload=t=>{let{onError:n,...r}=t;(0,h.uploadMedia)({wpAllowedMimeTypes:e.settings.allowedMimeTypes,onError:e=>{let{message:t}=e;return n(t)},...r})},n):n}),(e=>[Ye(e),e.settings,qe(e,"focusMode"),qe(e,"fixedToolbar"),Xe(e)]));function Ze(e){return e.homeTemplateId}function Je(e){return e.editedPost}function et(e){return Je(e).type}function tt(e){return Je(e).id}function nt(e){return Je(e).page}function rt(e){return e.navigationPanel.menu}const at=(0,c.createRegistrySelector)((e=>t=>{const n=et(t),r=tt(t),a=r?e(u.store).getEntityRecord("postType",n,r):null;if(!a)return T;var l;if("wp_template_part"===n)return(null===(l=I.find((e=>e.area===(null==a?void 0:a.area))))||void 0===l?void 0:l.menu)||"template-parts";const o=e(u.store).getEntityRecords("postType","wp_template"),i=e(u.store).getEditedEntityRecord("root","site").show_on_front;return We(a.slug,(0,U.map)(o,"slug"),i)?"templates-unused":je(a.slug)}));function lt(e){return e.navigationPanel.isOpen}function ot(e){return!!e.blockInserterPanel}function it(e){const{rootClientId:t,insertionIndex:n,filterValue:r}=e.blockInserterPanel;return{rootClientId:t,insertionIndex:n,filterValue:r}}function st(e){return e.listViewPanel}const ct=(0,c.createRegistrySelector)((e=>t=>{var n;const r=et(t),a=tt(t),l=e(u.store).getEditedEntityRecord("postType",r,a),o=e(u.store).getEntityRecords("postType","wp_template_part",{per_page:-1}),s=(0,U.keyBy)(o,(e=>e.id));return(null!==(n=l.blocks)&&void 0!==n?n:[]).filter((e=>(0,i.isTemplatePart)(e))).map((e=>{const{attributes:{theme:t,slug:n}}=e;return{templatePart:s[`${t}//${n}`],block:e}})).filter((e=>{let{templatePart:t}=e;return!!t}))})),ut={reducer:M,actions:a,selectors:l,controls:E.controls,persist:["preferences"]},mt=(0,c.createReduxStore)(v,ut);(0,c.registerStore)(v,ut);var dt,pt=dt||(dt={});pt.Pop="POP",pt.Push="PUSH",pt.Replace="REPLACE";var _t=function(e){return e};function gt(e){e.preventDefault(),e.returnValue=""}function ht(){var e=[];return{get length(){return e.length},push:function(t){return e.push(t),function(){e=e.filter((function(e){return e!==t}))}},call:function(t){e.forEach((function(e){return e&&e(t)}))}}}function Et(){return Math.random().toString(36).substr(2,8)}function ft(e){var t=e.pathname;t=void 0===t?"/":t;var n=e.search;return n=void 0===n?"":n,e=void 0===(e=e.hash)?"":e,n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),e&&"#"!==e&&(t+="#"===e.charAt(0)?e:"#"+e),t}function vt(e){var t={};if(e){var n=e.indexOf("#");0<=n&&(t.hash=e.substr(n),e=e.substr(0,n)),0<=(n=e.indexOf("?"))&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}const yt=function(e){function t(){var e=o.location,t=i.state||{};return[t.idx,_t({pathname:e.pathname,search:e.search,hash:e.hash,state:t.usr||null,key:t.key||"default"})]}function n(e){return"string"==typeof e?e:ft(e)}function r(e,t){return void 0===t&&(t=null),_t(R({pathname:m.pathname,hash:"",search:""},"string"==typeof e?vt(e):e,{state:t,key:Et()}))}function a(e){c=e,e=t(),u=e[0],m=e[1],d.call({action:c,location:m})}function l(e){i.go(e)}void 0===e&&(e={});var o=void 0===(e=e.window)?document.defaultView:e,i=o.history,s=null;o.addEventListener("popstate",(function(){if(s)p.call(s),s=null;else{var e=dt.Pop,n=t(),r=n[0];if(n=n[1],p.length){if(null!=r){var o=u-r;o&&(s={action:e,location:n,retry:function(){l(-1*o)}},l(o))}}else a(e)}}));var c=dt.Pop,u=(e=t())[0],m=e[1],d=ht(),p=ht();return null==u&&(u=0,i.replaceState(R({},i.state,{idx:u}),"")),{get action(){return c},get location(){return m},createHref:n,push:function e(t,l){var s=dt.Push,c=r(t,l);if(!p.length||(p.call({action:s,location:c,retry:function(){e(t,l)}}),0)){var m=[{usr:c.state,key:c.key,idx:u+1},n(c)];c=m[0],m=m[1];try{i.pushState(c,"",m)}catch(e){o.location.assign(m)}a(s)}},replace:function e(t,l){var o=dt.Replace,s=r(t,l);p.length&&(p.call({action:o,location:s,retry:function(){e(t,l)}}),1)||(s=[{usr:s.state,key:s.key,idx:u},n(s)],i.replaceState(s[0],"",s[1]),a(o))},go:l,back:function(){l(-1)},forward:function(){l(1)},listen:function(e){return d.push(e)},block:function(e){var t=p.push(e);return 1===p.length&&o.addEventListener("beforeunload",gt),function(){t(),p.length||o.removeEventListener("beforeunload",gt)}}}}(),bt=yt.push,wt=yt.replace;yt.push=function(e,t){return bt.call(yt,(0,_.addQueryArgs)(window.location.href,e),t)},yt.replace=function(e,t){return wt.call(yt,(0,_.addQueryArgs)(window.location.href,e),t)};var St=yt;const kt=(0,o.createContext)(),xt=(0,o.createContext)();function Tt(){return(0,o.useContext)(kt)}function Ct(){return(0,o.useContext)(xt)}function Nt(e){const t=new URLSearchParams(e.search);return{...e,params:Object.fromEntries(t.entries())}}function It(e){let{children:t}=e;const[n,r]=(0,o.useState)((()=>Nt(St.location)));return(0,o.useEffect)((()=>St.listen((e=>{let{location:t}=e;r(Nt(t))}))),[]),(0,o.createElement)(xt.Provider,{value:St},(0,o.createElement)(kt.Provider,{value:n},t(n)))}var Pt=window.wp.blockEditor,Mt=window.wp.keyboardShortcuts;var At=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));var Rt=(0,o.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(O.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"})),Lt=window.wp.keycodes;var Bt=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));var Dt=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"}));const Ot=[{keyCombination:{modifier:"primary",character:"b"},description:(0,d.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,d.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,d.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,d.__)("Remove a link.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,d.__)("Underline the selected text.")}];function Ft(e){let{keyCombination:t,forceAriaLabel:n}=e;const r=t.modifier?Lt.displayShortcutList[t.modifier](t.character):t.character,a=t.modifier?Lt.shortcutAriaLabel[t.modifier](t.character):t.character;return(0,o.createElement)("kbd",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":n||a},(0,U.castArray)(r).map(((e,t)=>"+"===e?(0,o.createElement)(o.Fragment,{key:t},e):(0,o.createElement)("kbd",{key:t,className:"edit-site-keyboard-shortcut-help-modal__shortcut-key"},e))))}function Vt(e){let{description:t,keyCombination:n,aliases:r=[],ariaLabel:a}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-description"},t),(0,o.createElement)("div",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-term"},(0,o.createElement)(Ft,{keyCombination:n,forceAriaLabel:a}),r.map(((e,t)=>(0,o.createElement)(Ft,{keyCombination:e,forceAriaLabel:a,key:t})))))}function zt(e){let{name:t}=e;const{keyCombination:n,description:r,aliases:a}=(0,c.useSelect)((e=>{const{getShortcutKeyCombination:n,getShortcutDescription:r,getShortcutAliases:a}=e(Mt.store);return{keyCombination:n(t),aliases:a(t),description:r(t)}}),[t]);return n?(0,o.createElement)(Vt,{keyCombination:n,description:r,aliases:a}):null}const Gt=e=>{let{shortcuts:t}=e;return(0,o.createElement)("ul",{className:"edit-site-keyboard-shortcut-help-modal__shortcut-list",role:"list"},t.map(((e,t)=>(0,o.createElement)("li",{className:"edit-site-keyboard-shortcut-help-modal__shortcut",key:t},(0,U.isString)(e)?(0,o.createElement)(zt,{name:e}):(0,o.createElement)(Vt,e)))))},Ut=e=>{let{title:t,shortcuts:n,className:r}=e;return(0,o.createElement)("section",{className:B()("edit-site-keyboard-shortcut-help-modal__section",r)},!!t&&(0,o.createElement)("h2",{className:"edit-site-keyboard-shortcut-help-modal__section-title"},t),(0,o.createElement)(Gt,{shortcuts:n}))},Ht=e=>{let{title:t,categoryName:n,additionalShortcuts:r=[]}=e;const a=(0,c.useSelect)((e=>e(Mt.store).getCategoryShortcuts(n)),[n]);return(0,o.createElement)(Ut,{title:t,shortcuts:a.concat(r)})};function $t(e){let{isModalActive:t,toggleModal:n}=e;return t?(0,o.createElement)(D.Modal,{className:"edit-site-keyboard-shortcut-help-modal",title:(0,d.__)("Keyboard shortcuts"),closeLabel:(0,d.__)("Close"),onRequestClose:n},(0,o.createElement)(Ut,{className:"edit-site-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-site/keyboard-shortcuts"]}),(0,o.createElement)(Ht,{title:(0,d.__)("Global shortcuts"),categoryName:"global"}),(0,o.createElement)(Ht,{title:(0,d.__)("Selection shortcuts"),categoryName:"selection"}),(0,o.createElement)(Ht,{title:(0,d.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,d.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,d.__)("Forward-slash")}]}),(0,o.createElement)(Ut,{title:(0,d.__)("Text formatting"),shortcuts:Ot})):null}var Wt=window.wp.a11y;function jt(e){let{feature:t,label:n,info:r,messageActivated:a,messageDeactivated:l}=e;const i=(0,c.useSelect)((e=>e(mt).isFeatureActive(t)),[]),{toggleFeature:s}=(0,c.useDispatch)(mt);return(0,o.createElement)(D.MenuItem,{icon:i&&F,isSelected:i,onClick:(0,U.flow)(s.bind(null,t),(()=>{i?(0,Wt.speak)(l||(0,d.__)("Feature deactivated")):(0,Wt.speak)(a||(0,d.__)("Feature activated"))})),role:"menuitemcheckbox",info:r},n)}const{Fill:qt,Slot:Kt}=(0,D.createSlotFill)("EditSiteToolsMoreMenuGroup");qt.Slot=e=>{let{fillProps:t}=e;return(0,o.createElement)(Kt,{fillProps:t},(e=>!(0,U.isEmpty)(e)&&e))};var Yt=qt,Xt=n(8981),Qt=n.n(Xt),Zt=window.wp.apiFetch,Jt=n.n(Zt);var en=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.Path,{d:"M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z"}));function tn(){const{createErrorNotice:e}=(0,c.useDispatch)(A.store);return(0,o.createElement)(D.MenuItem,{role:"menuitem",icon:en,onClick:async function(){try{const e=await Jt()({path:"/wp-block-editor/v1/export",parse:!1}),t=await e.blob();Qt()(t,"edit-site-export.zip","application/zip")}catch(t){let n={};try{n=await t.json()}catch(e){}const r=n.message&&"unknown_error"!==n.code?n.message:(0,d.__)("An error occurred while creating the site export.");e(r,{type:"snackbar"})}},info:(0,d.__)("Download your templates and template parts.")},(0,d._x)("Export","site exporter menu item"))}function nn(){const{toggleFeature:e}=(0,c.useDispatch)(mt);return(0,o.createElement)(D.MenuItem,{onClick:()=>e("welcomeGuide")},(0,d.__)("Welcome Guide"))}const rn={className:"edit-site-more-menu__content",position:"bottom left"},an={tooltipPosition:"bottom"};function ln(){const[e,t]=(0,o.useReducer)((e=>!e),!1);return(0,Mt.useShortcut)("core/edit-site/keyboard-shortcuts",t),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(D.DropdownMenu,{className:"edit-site-more-menu",icon:Bt,label:(0,d.__)("More tools & options"),popoverProps:rn,toggleProps:an},(e=>{let{onClose:n}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(D.MenuGroup,{label:(0,d._x)("View","noun")},(0,o.createElement)(jt,{feature:"fixedToolbar",label:(0,d.__)("Top toolbar"),info:(0,d.__)("Access all block and document tools in a single place"),messageActivated:(0,d.__)("Top toolbar activated"),messageDeactivated:(0,d.__)("Top toolbar deactivated")}),(0,o.createElement)(jt,{feature:"focusMode",label:(0,d.__)("Spotlight mode"),info:(0,d.__)("Focus on one block at a time"),messageActivated:(0,d.__)("Spotlight mode activated"),messageDeactivated:(0,d.__)("Spotlight mode deactivated")}),(0,o.createElement)(de.Slot,{name:"core/edit-site/plugin-more-menu",label:(0,d.__)("Plugins"),as:D.MenuGroup,fillProps:{onClick:n}})),(0,o.createElement)(D.MenuGroup,{label:(0,d.__)("Tools")},(0,o.createElement)(tn,null),(0,o.createElement)(D.MenuItem,{onClick:t,shortcut:Lt.displayShortcut.access("h")},(0,d.__)("Keyboard shortcuts")),(0,o.createElement)(nn,null),(0,o.createElement)(D.MenuItem,{icon:Dt,role:"menuitem",href:(0,d.__)("https://wordpress.org/support/article/site-editor/"),target:"_blank",rel:"noopener noreferrer"},(0,d.__)("Help"),(0,o.createElement)(D.VisuallyHidden,{as:"span"},(0,d.__)("(opens in a new tab)"))),(0,o.createElement)(Yt.Slot,{fillProps:{onClose:n}})))})),(0,o.createElement)($t,{isModalActive:e,toggleModal:t}))}function on(e){let{openEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n}=e;const{isDirty:r,isSaving:a}=(0,c.useSelect)((e=>{const{__experimentalGetDirtyEntityRecords:t,isSavingEntityRecord:n}=e(u.store),r=t();return{isDirty:r.length>0,isSaving:(0,U.some)(r,(e=>n(e.kind,e.name,e.key)))}}),[]),l=!r||a;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(D.Button,{variant:"primary",className:"edit-site-save-button__button","aria-disabled":l,"aria-expanded":n,disabled:l,isBusy:a,onClick:l?void 0:t},(0,d.__)("Save")))}var sn=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"}));var cn=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"}));function un(){const e=(0,c.useSelect)((e=>e(u.store).hasUndo()),[]),{undo:t}=(0,c.useDispatch)(u.store);return(0,o.createElement)(D.Button,{icon:(0,d.isRTL)()?cn:sn,label:(0,d.__)("Undo"),shortcut:Lt.displayShortcut.primary("z"),"aria-disabled":!e,onClick:e?t:void 0})}function mn(){const e=(0,c.useSelect)((e=>e(u.store).hasRedo()),[]),{redo:t}=(0,c.useDispatch)(u.store);return(0,o.createElement)(D.Button,{icon:(0,d.isRTL)()?sn:cn,label:(0,d.__)("Redo"),shortcut:Lt.displayShortcut.primaryShift("z"),"aria-disabled":!e,onClick:e?t:void 0})}var dn=(0,o.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(O.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function pn(e){if(e){const t=(0,i.getBlockType)(e.name);return t?(0,i.__experimentalGetBlockLabel)(t,e.attributes):null}return null}function _n(e){let{entityTitle:t,entityLabel:n,isLoaded:r,children:a}=e;const{label:l}=function(){const{getBlock:e}=(0,c.useSelect)(Pt.store),t=(0,c.useSelect)((e=>e(Pt.store).__experimentalGetActiveBlockIdByBlockNames(["core/template-part"])),[]);return t?{label:pn(e(t)),isActive:!0}:{}}(),i=(0,o.useRef)();return r?t?(0,o.createElement)("div",{className:B()("edit-site-document-actions",{"has-secondary-label":!!l})},(0,o.createElement)("div",{ref:i,className:"edit-site-document-actions__title-wrapper"},(0,o.createElement)(D.__experimentalText,{size:"body",className:"edit-site-document-actions__title",as:"h1"},(0,o.createElement)(D.VisuallyHidden,{as:"span"},(0,d.sprintf)((0,d.__)("Editing %s: "),n)),t),(0,o.createElement)(D.__experimentalText,{size:"body",className:"edit-site-document-actions__secondary-item"},null!=l?l:""),a&&(0,o.createElement)(D.Dropdown,{popoverProps:{anchorRef:i.current},position:"bottom center",renderToggle:e=>{let{isOpen:t,onToggle:r}=e;return(0,o.createElement)(D.Button,{className:"edit-site-document-actions__get-info",icon:dn,"aria-expanded":t,"aria-haspopup":"true",onClick:r,label:(0,d.sprintf)((0,d.__)("Show %s details"),n)})},contentClassName:"edit-site-document-actions__info-dropdown",renderContent:a}))):(0,o.createElement)("div",{className:"edit-site-document-actions"},(0,d.__)("Template not found")):(0,o.createElement)("div",{className:"edit-site-document-actions"},(0,d.__)("Loading…"))}function gn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=Ct();function a(a){a.preventDefault(),n?r.replace(e,t):r.push(e,t)}return{href:(0,_.addQueryArgs)(window.location.href,e),onClick:a}}function hn(e){let{params:t={},state:n,replace:r=!1,children:a,...l}=e;const{href:i,onClick:s}=gn(t,n,r);return(0,o.createElement)("a",R({href:i,onClick:s},l),a)}function En(e){var t;let{onClose:n,templatePart:r,closeTemplateDetailsDropdown:a}=e;const{revertTemplate:l}=(0,c.useDispatch)(mt),{params:i}=Tt(),s=gn({postId:r.id,postType:r.type},{fromTemplateId:i.postId});return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(D.MenuGroup,null,(0,o.createElement)(D.MenuItem,R({},s,{onClick:function(e){s.onClick(e),n(),a()}}),(0,d.sprintf)((0,d.__)("Edit %s"),null===(t=r.title)||void 0===t?void 0:t.rendered))),ke(r)&&(0,o.createElement)(D.MenuGroup,null,(0,o.createElement)(D.MenuItem,{info:(0,d.__)("Restore template to default state"),onClick:function(){l(r),n(),a()}},(0,d.__)("Clear customizations"))))}function fn(e){let{templatePart:t,clientId:n,closeTemplateDetailsDropdown:r}=e;const{selectBlock:a,toggleBlockHighlight:l}=(0,c.useDispatch)(Pt.store),i=(0,c.useSelect)((e=>e(m.store).__experimentalGetDefaultTemplatePartAreas().find((e=>e.area===t.area))),[t.area]),s=()=>l(n,!0),u=()=>l(n,!1);return(0,o.createElement)("div",{role:"menuitem",className:"edit-site-template-details__template-areas-item"},(0,o.createElement)(D.MenuItem,{role:"button",icon:null==i?void 0:i.icon,iconPosition:"left",onClick:()=>{a(n)},onMouseOver:s,onMouseLeave:u,onFocus:s,onBlur:u},null==i?void 0:i.label),(0,o.createElement)(D.DropdownMenu,{icon:Bt,label:(0,d.__)("More options"),className:"edit-site-template-details__template-areas-item-more"},(e=>{let{onClose:n}=e;return(0,o.createElement)(En,{onClose:n,templatePart:t,closeTemplateDetailsDropdown:r})})))}function vn(e){let{closeTemplateDetailsDropdown:t}=e;const n=(0,c.useSelect)((e=>e(mt).getCurrentTemplateTemplateParts()),[]);return n.length?(0,o.createElement)(D.MenuGroup,{label:(0,d.__)("Areas"),className:"edit-site-template-details__group edit-site-template-details__template-areas"},n.map((e=>{let{templatePart:n,block:r}=e;return(0,o.createElement)(fn,{key:n.slug,clientId:r.clientId,templatePart:n,closeTemplateDetailsDropdown:t})}))):null}function yn(e){let{template:t}=e;const[n,r]=(0,u.useEntityProp)("postType",t.type,"title",t.id);return(0,o.createElement)(D.TextControl,{label:(0,d.__)("Title"),value:n,help:(0,d.__)('Give the template a title that indicates its purpose, e.g. "Full Width".'),onChange:e=>{r(e||t.slug)}})}function bn(e){let{template:t,onClose:n}=e;const{title:r,description:a}=(0,c.useSelect)((e=>e(m.store).__experimentalGetTemplateInfo(t)),[]),{revertTemplate:l}=(0,c.useDispatch)(mt),i=(0,o.useMemo)((()=>"wp_template"===(null==t?void 0:t.type)?{title:(0,d.__)("templates"),menu:C}:I.find((e=>{let{area:n}=e;return n===(null==t?void 0:t.area)}))),[t]),s=gn({postType:t.type,postId:void 0});if(!t)return null;return(0,o.createElement)("div",{className:"edit-site-template-details"},(0,o.createElement)("div",{className:"edit-site-template-details__group"},t.is_custom?(0,o.createElement)(yn,{template:t}):(0,o.createElement)(D.__experimentalHeading,{level:4,weight:600,className:"edit-site-template-details__title"},r),a&&(0,o.createElement)(D.__experimentalText,{size:"body",className:"edit-site-template-details__description",as:"p"},a)),(0,o.createElement)(vn,{closeTemplateDetailsDropdown:n}),ke(t)&&(0,o.createElement)(D.MenuGroup,{className:"edit-site-template-details__group edit-site-template-details__revert"},(0,o.createElement)(D.MenuItem,{className:"edit-site-template-details__revert-button",info:(0,d.__)("Restore template to default state"),onClick:()=>{l(t),n()}},(0,d.__)("Clear customizations"))),(0,o.createElement)(D.Button,R({className:"edit-site-template-details__show-all-button"},s),(0,d.sprintf)((0,d.__)("Browse all %s"),i.title)))}const wn=e=>{e.preventDefault()};function Sn(e){let{openEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n}=e;const r=(0,o.useRef)(),{deviceType:a,entityTitle:l,template:i,templateType:s,isInserterOpen:p,isListViewOpen:_,listViewShortcut:g,isLoaded:h}=(0,c.useSelect)((e=>{const{__experimentalGetPreviewDeviceType:t,getEditedPostType:n,getEditedPostId:r,isInserterOpened:a,isListViewOpened:l}=e(mt),{getEditedEntityRecord:o}=e(u.store),{__experimentalGetTemplateInfo:i}=e(m.store),{getShortcutRepresentation:s}=e(Mt.store),c=n(),d=r(),p=o("postType",c,d),_=!!d;return{deviceType:t(),entityTitle:i(p).title,isLoaded:_,template:p,templateType:c,isInserterOpen:a(),isListViewOpen:l(),listViewShortcut:s("core/edit-site/toggle-list-view")}}),[]),{__experimentalSetPreviewDeviceType:E,setIsInserterOpened:f,setIsListViewOpened:v}=(0,c.useDispatch)(mt),y=(0,ye.useViewportMatch)("medium"),b=(0,o.useCallback)((()=>{p?r.current.focus():f(!0)}),[p,f]),w=(0,o.useCallback)((()=>v(!_)),[v,_]),S="wp_template_part"===s;return(0,o.createElement)("div",{className:"edit-site-header"},(0,o.createElement)("div",{className:"edit-site-header_start"},(0,o.createElement)("div",{className:"edit-site-header__toolbar"},(0,o.createElement)(D.Button,{ref:r,variant:"primary",isPressed:p,className:"edit-site-header-toolbar__inserter-toggle",onMouseDown:wn,onClick:b,icon:At,label:(0,d._x)("Toggle block inserter","Generic label for block inserter button")}),y&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Pt.ToolSelector,null),(0,o.createElement)(un,null),(0,o.createElement)(mn,null),(0,o.createElement)(D.Button,{className:"edit-site-header-toolbar__list-view-toggle",icon:Rt,isPressed:_,label:(0,d.__)("List View"),onClick:w,shortcut:g})))),(0,o.createElement)("div",{className:"edit-site-header_center"},(0,o.createElement)(_n,{entityTitle:l,entityLabel:"wp_template_part"===s?"template part":"template",isLoaded:h},(e=>{let{onClose:t}=e;return(0,o.createElement)(bn,{template:i,onClose:t})}))),(0,o.createElement)("div",{className:"edit-site-header_end"},(0,o.createElement)("div",{className:"edit-site-header__actions"},!S&&(0,o.createElement)(Pt.__experimentalPreviewOptions,{deviceType:a,setDeviceType:E}),(0,o.createElement)(on,{openEntitiesSavedStates:t,isEntitiesSavedStatesOpen:n}),(0,o.createElement)(he.Slot,{scope:"core/edit-site"}),(0,o.createElement)(ln,null))))}var kn=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.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"}));function xn(e){let{className:t,identifier:n,title:r,icon:a,children:l,closeLabel:i,header:s,headerClassName:c}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ve,{className:t,scope:"core/edit-site",identifier:n,title:r,icon:a,closeLabel:i,header:s,headerClassName:c},l),(0,o.createElement)(_e,{scope:"core/edit-site",identifier:n,icon:a},r))}var Tn=(0,o.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(O.Path,{d:"M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z"}));var Cn=function(e){let{icon:t,size:n=24,...r}=e;return(0,o.cloneElement)(t,{width:n,height:n,...r})};var Nn=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));var In=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"}));const Pn="body",Mn=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["typography","fontSizes"],valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]}],An={"color.background":"color","color.text":"color","elements.link.color.text":"color","color.gradient":"gradient","typography.fontSize":"font-size","typography.fontFamily":"font-family"};function Rn(e,t,n,r,a){const l=[(0,U.get)(e,["blocks",t,...n]),(0,U.get)(e,n)];for(const o of l)if(o){const l=["custom","theme","default"];for(const i of l){const l=o[i];if(l){const o=(0,U.find)(l,(e=>e[r]===a));if(o){if("slug"===r)return o;return Rn(e,t,n,"slug",o.slug)[r]===o[r]?o:void 0}}}}}function Ln(e,t,n,r){if(!r)return r;const a=An[n],l=(0,U.find)(Mn,["cssVarInfix",a]);if(!l)return r;const{valueKey:o,path:i}=l,s=Rn(e,t,i,o,r);return s?`var:preset|${a}|${s.slug}`:r}function Bn(e,t,n){if(!n||!(0,U.isString)(n))return n;const r="var:",a="var(--wp--";let l;if(n.startsWith(r))l=n.slice(r.length).split("|");else{if(!n.startsWith(a)||!n.endsWith(")"))return n;l=n.slice(a.length,-")".length).split("--")}const[o,...i]=l;return"preset"===o?function(e,t,n,r){let[a,l]=r;const o=(0,U.find)(Mn,["cssVarInfix",a]);if(!o)return n;const i=Rn(e,t,o.path,"slug",l);if(i){const{valueKey:n}=o;return Bn(e,t,i[n])}return n}(e,t,n,i):"custom"===o?function(e,t,n,r){var a;const l=null!==(a=(0,U.get)(e,["blocks",t,"custom",...r]))&&void 0!==a?a:(0,U.get)(e,["custom",...r]);return l?Bn(e,t,l):n}(e,t,n,i):n}const Dn=(0,o.createContext)({user:{},base:{},merged:{},setUserConfig:()=>{}}),On={isGlobalStylesUserThemeJSON:!0,version:1};function Fn(e,t){var n;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all";const{merged:a,base:l,user:s,setUserConfig:c}=(0,o.useContext)(Dn),u=t?`settings.blocks.${t}.${e}`:`settings.${e}`,m=t=>{c((n=>{const r=(0,U.cloneDeep)(n),a=i.__EXPERIMENTAL_PATHS_WITH_MERGE[e]?u+".custom":u;return(0,U.set)(r,a,t),r}))},d=t=>{const n=t?`settings.blocks.${t}.${e}`:`settings.${e}`,o=t=>{const r=(0,U.get)(t,n);var a,l;return i.__EXPERIMENTAL_PATHS_WITH_MERGE[e]?null!==(a=null!==(l=null==r?void 0:r.custom)&&void 0!==l?l:null==r?void 0:r.theme)&&void 0!==a?a:null==r?void 0:r.default:r};let c;switch(r){case"all":c=o(a);break;case"user":c=o(s);break;case"base":c=o(l);break;default:throw"Unsupported source"}return c},p=null!==(n=d(t))&&void 0!==n?n:d();return[p,m]}function Vn(e,t){var n;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"all";const{merged:a,base:l,user:i,setUserConfig:s}=(0,o.useContext)(Dn),c=t?`styles.blocks.${t}.${e}`:`styles.${e}`,u=n=>{s((r=>{const l=(0,U.cloneDeep)(r);return(0,U.set)(l,c,Ln(a.settings,t,e,n)),l}))};let m;switch(r){case"all":m=Bn(a.settings,t,null!==(n=(0,U.get)(i,c))&&void 0!==n?n:(0,U.get)(l,c));break;case"user":m=Bn(a.settings,t,(0,U.get)(i,c));break;case"base":m=Bn(l.settings,t,(0,U.get)(l,c));break;default:throw"Unsupported source"}return[m,u]}const zn=["background","backgroundColor","color","linkColor","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","textDecoration","textTransform","padding"];function Gn(e){if(!e)return zn;const t=(0,i.getBlockType)(e);if(!t)return[];const n=[];return Object.keys(i.__EXPERIMENTAL_STYLE_PROPERTY).forEach((e=>{if(i.__EXPERIMENTAL_STYLE_PROPERTY[e].support)return i.__EXPERIMENTAL_STYLE_PROPERTY[e].requiresOptOut&&(0,U.has)(t.supports,i.__EXPERIMENTAL_STYLE_PROPERTY[e].support[0])&&!1!==(0,U.get)(t.supports,i.__EXPERIMENTAL_STYLE_PROPERTY[e].support)||(0,U.get)(t.supports,i.__EXPERIMENTAL_STYLE_PROPERTY[e].support,!1)?n.push(e):void 0})),n}function Un(e){const[t]=Fn("color.palette.custom",e),[n]=Fn("color.palette.theme",e),[r]=Fn("color.palette.default",e),[a]=Fn("color.defaultPalette");return(0,o.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,d._x)("Theme","Indicates this palette comes from the theme."),colors:n}),a&&r&&r.length&&e.push({name:(0,d._x)("Default","Indicates this palette comes from WordPress."),colors:r}),t&&t.length&&e.push({name:(0,d._x)("Custom","Indicates this palette is created by the user."),colors:t}),e}),[t,n,r])}var Hn=()=>{const[e="serif"]=Vn("typography.fontFamily"),[t="black"]=Vn("color.text"),[n="blue"]=Vn("elements.link.color.text"),[r="white"]=Vn("color.background"),[a]=Vn("color.gradient");return(0,o.createElement)(D.Card,{className:"edit-site-global-styles-preview",style:{background:null!=a?a:r}},(0,o.createElement)(D.__experimentalHStack,{spacing:5},(0,o.createElement)("div",{style:{fontFamily:e,fontSize:"80px",color:t}},"Aa"),(0,o.createElement)(D.__experimentalVStack,{spacing:2},(0,o.createElement)(D.ColorIndicator,{colorValue:t}),(0,o.createElement)(D.ColorIndicator,{colorValue:n}))))};var $n=function(e){let{path:t,icon:n,children:r,isBack:a=!1,...l}=e;const i=(0,D.__experimentalUseNavigator)();return(0,o.createElement)(D.__experimentalItem,R({onClick:()=>i.push(t,{isBack:a})},l),n&&(0,o.createElement)(D.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(D.FlexItem,null,(0,o.createElement)(Cn,{icon:n,size:24})),(0,o.createElement)(D.FlexItem,null,r)),!n&&r)};var Wn=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.Path,{d:"M6.9 7L3 17.8h1.7l1-2.8h4.1l1 2.8h1.7L8.6 7H6.9zm-.7 6.6l1.5-4.3 1.5 4.3h-3zM21.6 17c-.1.1-.2.2-.3.2-.1.1-.2.1-.4.1s-.3-.1-.4-.2c-.1-.1-.1-.3-.1-.6V12c0-.5 0-1-.1-1.4-.1-.4-.3-.7-.5-1-.2-.2-.5-.4-.9-.5-.4 0-.8-.1-1.3-.1s-1 .1-1.4.2c-.4.1-.7.3-1 .4-.2.2-.4.3-.6.5-.1.2-.2.4-.2.7 0 .3.1.5.2.8.2.2.4.3.8.3.3 0 .6-.1.8-.3.2-.2.3-.4.3-.7 0-.3-.1-.5-.2-.7-.2-.2-.4-.3-.6-.4.2-.2.4-.3.7-.4.3-.1.6-.1.8-.1.3 0 .6 0 .8.1.2.1.4.3.5.5.1.2.2.5.2.9v1.1c0 .3-.1.5-.3.6-.2.2-.5.3-.9.4-.3.1-.7.3-1.1.4-.4.1-.8.3-1.1.5-.3.2-.6.4-.8.7-.2.3-.3.7-.3 1.2 0 .6.2 1.1.5 1.4.3.4.9.5 1.6.5.5 0 1-.1 1.4-.3.4-.2.8-.6 1.1-1.1 0 .4.1.7.3 1 .2.3.6.4 1.2.4.4 0 .7-.1.9-.2.2-.1.5-.3.7-.4h-.3zm-3-.9c-.2.4-.5.7-.8.8-.3.2-.6.2-.8.2-.4 0-.6-.1-.9-.3-.2-.2-.3-.6-.3-1.1 0-.5.1-.9.3-1.2s.5-.5.8-.7c.3-.2.7-.3 1-.5.3-.1.6-.3.7-.6v3.4z"}));var jn=(0,o.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,o.createElement)(O.Path,{d:"M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z"}));var qn=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.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 Kn=[];function Yn(e){return[Xn(e),Qn(e),Zn(e),Jn(e)].some(Boolean)}function Xn(e){const t=Gn(e);return Fn("border.color",e)[0]&&t.includes("borderColor")}function Qn(e){const t=Gn(e);return Fn("border.radius",e)[0]&&t.includes("borderRadius")}function Zn(e){const t=Gn(e);return Fn("border.style",e)[0]&&t.includes("borderStyle")}function Jn(e){const t=Gn(e);return Fn("border.width",e)[0]&&t.includes("borderWidth")}function er(e){let{name:t}=e;const n=(0,D.__experimentalUseCustomUnits)({availableUnits:Fn("spacing.units")[0]||["px","em","rem"]}),r=Jn(t),[a,l]=Vn("border.width",t),i=Zn(t),[s,c]=Vn("border.style",t),[u=Kn]=Fn("color.palette"),m=!Fn("color.custom")[0],p=!Fn("color.customGradient")[0],_=Xn(t),[g,h]=Vn("border.color",t),E=Qn(t),[f,v]=Vn("border.radius",t);return(0,o.createElement)(D.PanelBody,{title:(0,d.__)("Border"),initialOpen:!0},(r||i)&&(0,o.createElement)("div",{className:"edit-site-global-styles-sidebar__border-controls-row"},r&&(0,o.createElement)(D.__experimentalUnitControl,{value:a,label:(0,d.__)("Width"),min:0,onChange:e=>{l(e||void 0)},units:n}),i&&(0,o.createElement)(Pt.__experimentalBorderStyleControl,{value:s,onChange:c})),_&&(0,o.createElement)(Pt.__experimentalColorGradientControl,{label:(0,d.__)("Color"),colorValue:g,colors:u,gradients:void 0,disableCustomColors:m,disableCustomGradients:p,onColorChange:h}),E&&(0,o.createElement)(Pt.__experimentalBorderRadiusControl,{values:f,onChange:v}))}function tr(e){const t=Gn(e);return t.includes("color")||t.includes("backgroundColor")||t.includes("background")||t.includes("linkColor")}const nr=["horizontal","vertical"];function rr(e){const t=ar(e),n=lr(e),r=or(e);return t||n||r}function ar(e){const t=Gn(e),[n]=Fn("spacing.padding",e);return n&&t.includes("padding")}function lr(e){const t=Gn(e),[n]=Fn("spacing.margin",e);return n&&t.includes("margin")}function or(e){const t=Gn(e),[n]=Fn("spacing.blockGap",e);return n&&t.includes("--wp--style--block-gap")}function ir(e,t){if(!t)return e;const n={};return t.forEach((t=>{"vertical"===t&&(n.top=e.top,n.bottom=e.bottom),"horizontal"===t&&(n.left=e.left,n.right=e.right),n[t]=e[t]})),n}function sr(e){return e&&"string"==typeof e?{top:e,right:e,bottom:e,left:e}:e}function cr(e){let{name:t}=e;const n=ar(t),r=lr(t),a=or(t),l=(0,D.__experimentalUseCustomUnits)({availableUnits:Fn("spacing.units",t)[0]||["%","px","em","rem","vw"]}),[i,s]=Vn("spacing.padding",t),c=sr(i),u=(0,Pt.__experimentalUseCustomSides)(t,"padding"),m=u&&u.some((e=>nr.includes(e))),p=e=>{const t=ir(e,u);s(t)},_=()=>p({}),[g,h]=Vn("spacing.margin",t),E=sr(g),f=(0,Pt.__experimentalUseCustomSides)(t,"margin"),v=f&&f.some((e=>nr.includes(e))),y=e=>{const t=ir(e,f);h(t)},b=()=>y({}),[w,S]=Vn("spacing.blockGap",t),k=()=>S(void 0);return(0,o.createElement)(D.__experimentalToolsPanel,{label:(0,d.__)("Dimensions"),resetAll:()=>{_(),b(),k()}},n&&(0,o.createElement)(D.__experimentalToolsPanelItem,{hasValue:()=>!!c&&Object.keys(c).length,label:(0,d.__)("Padding"),onDeselect:_,isShownByDefault:!0},(0,o.createElement)(D.__experimentalBoxControl,{values:c,onChange:p,label:(0,d.__)("Padding"),sides:u,units:l,allowReset:!1,splitOnAxis:m})),r&&(0,o.createElement)(D.__experimentalToolsPanelItem,{hasValue:()=>!!E&&Object.keys(E).length,label:(0,d.__)("Margin"),onDeselect:b,isShownByDefault:!0},(0,o.createElement)(D.__experimentalBoxControl,{values:E,onChange:y,label:(0,d.__)("Margin"),sides:f,units:l,allowReset:!1,splitOnAxis:v})),a&&(0,o.createElement)(D.__experimentalToolsPanelItem,{hasValue:()=>!!w,label:(0,d.__)("Block spacing"),onDeselect:k,isShownByDefault:!0},(0,o.createElement)(D.__experimentalUnitControl,{label:(0,d.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:S,units:l,value:w})))}function ur(e){const t=mr(e),n=dr(e),r=pr(e),a=Gn(e);return t||n||r||a.includes("fontSize")}function mr(e){const t=Gn(e);return Fn("typography.lineHeight",e)[0]&&t.includes("lineHeight")}function dr(e){const t=Gn(e),n=Fn("typography.fontStyle",e)[0]&&t.includes("fontStyle"),r=Fn("typography.fontWeight",e)[0]&&t.includes("fontWeight");return n||r}function pr(e){const t=Gn(e);return Fn("typography.letterSpacing",e)[0]&&t.includes("letterSpacing")}function _r(e){let{name:t,element:n}=e;const r=Gn(t),a="text"!==n&&n?`elements.${n}.`:"",[l]=Fn("typography.fontSizes",t),i=!Fn("typography.customFontSize",t)[0],[s]=Fn("typography.fontFamilies",t),c=Fn("typography.fontStyle",t)[0]&&r.includes("fontStyle"),u=Fn("typography.fontWeight",t)[0]&&r.includes("fontWeight"),m=mr(t),d=dr(t),p=pr(t),[_,g]=Vn(a+"typography.fontFamily",t),[h,E]=Vn(a+"typography.fontSize",t),[f,v]=Vn(a+"typography.fontStyle",t),[y,b]=Vn(a+"typography.fontWeight",t),[w,S]=Vn(a+"typography.lineHeight",t),[k,x]=Vn(a+"typography.letterSpacing",t),[T]=Vn(a+"color.background",t),[C]=Vn(a+"color.gradient",t),[N]=Vn(a+"color.text",t),I="link"===n?{textDecoration:"underline"}:{};return(0,o.createElement)(D.PanelBody,{className:"edit-site-typography-panel",initialOpen:!0},(0,o.createElement)("div",{className:"edit-site-typography-panel__preview",style:{fontFamily:null!=_?_:"serif",background:null!=C?C:T,color:N,fontSize:h,fontStyle:f,fontWeight:y,letterSpacing:k,...I}},"Aa"),r.includes("fontFamily")&&(0,o.createElement)(Pt.__experimentalFontFamilyControl,{fontFamilies:s,value:_,onChange:g}),r.includes("fontSize")&&(0,o.createElement)(D.FontSizePicker,{value:h,onChange:E,fontSizes:l,disableCustomFontSizes:i}),m&&(0,o.createElement)(Pt.LineHeightControl,{value:w,onChange:S}),d&&(0,o.createElement)(Pt.__experimentalFontAppearanceControl,{value:{fontStyle:f,fontWeight:y},onChange:e=>{let{fontStyle:t,fontWeight:n}=e;v(t),b(n)},hasFontStyles:c,hasFontWeights:u}),p&&(0,o.createElement)(Pt.__experimentalLetterSpacingControl,{value:k,onChange:x}))}var gr=function(e){let{name:t,parentMenu:n=""}=e;const r=ur(t),a=tr(t),l=Yn(t),i=rr(t),s=l||i;return(0,o.createElement)(D.__experimentalItemGroup,null,r&&(0,o.createElement)($n,{icon:Wn,path:n+"/typography"},(0,d.__)("Typography")),a&&(0,o.createElement)($n,{icon:jn,path:n+"/colors"},(0,d.__)("Colors")),s&&(0,o.createElement)($n,{icon:qn,path:n+"/layout"},(0,d.__)("Layout")))};var hr=function(){return(0,o.createElement)(D.Card,{size:"small"},(0,o.createElement)(D.CardBody,null,(0,o.createElement)(Hn,null)),(0,o.createElement)(D.CardBody,null,(0,o.createElement)(gr,null)),(0,o.createElement)(D.CardDivider,null),(0,o.createElement)(D.CardBody,null,(0,o.createElement)(D.__experimentalItemGroup,null,(0,o.createElement)(D.__experimentalItem,null,(0,d.__)("Customize the appearance of specific blocks for the whole site.")),(0,o.createElement)($n,{path:"/blocks"},(0,o.createElement)(D.__experimentalHStack,{justify:"space-between"},(0,o.createElement)(D.FlexItem,null,(0,d.__)("Blocks")),(0,o.createElement)(D.FlexItem,null,(0,o.createElement)(Cn,{icon:(0,d.isRTL)()?Nn:In})))))))};var Er=function(e){let{back:t,title:n,description:r}=e;return(0,o.createElement)(D.__experimentalVStack,{spacing:2},(0,o.createElement)(D.__experimentalHStack,{spacing:2},(0,o.createElement)(D.__experimentalView,null,(0,o.createElement)($n,{path:t,icon:(0,o.createElement)(Cn,{icon:(0,d.isRTL)()?In:Nn,variant:"muted"}),size:"small",isBack:!0,"aria-label":(0,d.__)("Navigate to the previous view")})),(0,o.createElement)(D.__experimentalSpacer,null,(0,o.createElement)(D.__experimentalHeading,{level:5},n))),r&&(0,o.createElement)("p",{className:"edit-site-global-styles-header__description"},r))};function fr(e){let{block:t}=e;const n=ur(t.name),r=tr(t.name),a=Yn(t.name),l=rr(t.name);return n||r||(a||l)?(0,o.createElement)($n,{path:"/blocks/"+t.name},(0,o.createElement)(D.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(D.FlexItem,null,(0,o.createElement)(Pt.BlockIcon,{icon:t.icon})),(0,o.createElement)(D.FlexItem,null,t.title))):null}var vr=function(){return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Er,{back:"/",title:(0,d.__)("Blocks"),description:(0,d.__)("Customize the appearance of specific blocks and for the whole site.")}),(0,i.getBlockTypes)().map((e=>(0,o.createElement)(fr,{block:e,key:"menu-itemblock-"+e.name}))))};var yr=function(e){let{name:t}=e;const n=(0,i.getBlockType)(t);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Er,{back:"/blocks",title:n.title}),(0,o.createElement)(gr,{parentMenu:"/blocks/"+t,name:t}))};var br=function(e){let{children:t}=e;return(0,o.createElement)(D.__experimentalHeading,{className:"edit-site-global-styles-subtitle",level:2},t)};function wr(e){let{name:t,parentMenu:n,element:r,label:a}=e;const l=!t,i="text"!==r&&r?`elements.${r}.`:"",s="link"===r?{textDecoration:"underline"}:{},[c]=Vn(i+"typography.fontFamily",t),[u]=Vn(i+"typography.fontStyle",t),[m]=Vn(i+"typography.fontWeight",t),[p]=Vn(i+"typography.letterSpacing",t),[_]=Vn(i+"color.background",t),[g]=Vn(i+"color.gradient",t),[h]=Vn(i+"color.text",t);return l?(0,o.createElement)($n,{path:n+"/typography/"+r},(0,o.createElement)(D.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(D.FlexItem,{className:"edit-site-global-styles-screen-typography__indicator",style:{fontFamily:null!=c?c:"serif",background:null!=g?g:_,color:h,fontStyle:u,fontWeight:m,letterSpacing:p,...s}},(0,d.__)("Aa")),(0,o.createElement)(D.FlexItem,null,a))):null}var Sr=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Er,{back:n||"/",title:(0,d.__)("Typography"),description:(0,d.__)("Manage the typography settings for different elements.")}),!t&&(0,o.createElement)("div",{className:"edit-site-global-styles-screen-typography"},(0,o.createElement)(D.__experimentalVStack,{spacing:3},(0,o.createElement)(br,null,(0,d.__)("Elements")),(0,o.createElement)(D.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,o.createElement)(wr,{name:t,parentMenu:n,element:"text",label:(0,d.__)("Text")}),(0,o.createElement)(wr,{name:t,parentMenu:n,element:"link",label:(0,d.__)("Links")})))),!!t&&(0,o.createElement)(_r,{name:t,element:"text"}))};const kr={text:{description:(0,d.__)("Manage the fonts used on the site."),title:(0,d.__)("Text")},link:{description:(0,d.__)("Manage the fonts and typography used on the links."),title:(0,d.__)("Links")}};var xr=function(e){let{name:t,element:n}=e;const r=void 0===t?"/typography":"/blocks/"+t+"/typography";return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Er,{back:r,title:kr[n].title,description:kr[n].description}),(0,o.createElement)(_r,{name:t,element:n}))};const Tr=[];var Cr=function(e){let{name:t}=e;const[n]=Fn("color.palette.custom"),[r]=Fn("color.palette.theme"),[a]=Fn("color.palette.default"),[l]=Fn("color.defaultPalette",t),i=(0,o.useMemo)((()=>[...n||Tr,...r||Tr,...a&&l?a:Tr]),[n,r,a,l]),s=t?"/blocks/"+t+"/colors/palette":"/colors/palette",c=i.length>0?(0,d.sprintf)((0,d._n)("%d color","%d colors",i.length),i.length):(0,d.__)("Add custom colors");return(0,o.createElement)(D.__experimentalVStack,{spacing:3},(0,o.createElement)(br,null,(0,d.__)("Palette")),(0,o.createElement)(D.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,o.createElement)($n,{path:s},(0,o.createElement)(D.__experimentalHStack,{isReversed:0===i.length},(0,o.createElement)(D.FlexBlock,null,(0,o.createElement)(D.__experimentalZStack,{isLayered:!1,offset:-8},i.slice(0,5).map((e=>{let{color:t}=e;return(0,o.createElement)(D.ColorIndicator,{key:t,colorValue:t})})))),(0,o.createElement)(D.FlexItem,null,c)))))};function Nr(e){let{name:t,parentMenu:n}=e;const r=Gn(t),a=r.includes("backgroundColor")||r.includes("background"),[l]=Vn("color.background",t),[i]=Vn("color.gradient",t);return a?(0,o.createElement)($n,{path:n+"/colors/background"},(0,o.createElement)(D.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(D.FlexItem,null,(0,o.createElement)(D.ColorIndicator,{colorValue:null!=i?i:l})),(0,o.createElement)(D.FlexItem,null,(0,d.__)("Background")))):null}function Ir(e){let{name:t,parentMenu:n}=e;const r=Gn(t).includes("color"),[a]=Vn("color.text",t);return r?(0,o.createElement)($n,{path:n+"/colors/text"},(0,o.createElement)(D.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(D.FlexItem,null,(0,o.createElement)(D.ColorIndicator,{colorValue:a})),(0,o.createElement)(D.FlexItem,null,(0,d.__)("Text")))):null}function Pr(e){let{name:t,parentMenu:n}=e;const r=Gn(t).includes("linkColor"),[a]=Vn("elements.link.color.text",t);return r?(0,o.createElement)($n,{path:n+"/colors/link"},(0,o.createElement)(D.__experimentalHStack,{justify:"flex-start"},(0,o.createElement)(D.FlexItem,null,(0,o.createElement)(D.ColorIndicator,{colorValue:a})),(0,o.createElement)(D.FlexItem,null,(0,d.__)("Links")))):null}var Mr=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Er,{back:n||"/",title:(0,d.__)("Colors"),description:(0,d.__)("Manage palettes and the default color of different global elements on the website.")}),(0,o.createElement)("div",{className:"edit-site-global-styles-screen-colors"},(0,o.createElement)(D.__experimentalVStack,{spacing:10},(0,o.createElement)(Cr,{name:t}),(0,o.createElement)(D.__experimentalVStack,{spacing:3},(0,o.createElement)(br,null,(0,d.__)("Elements")),(0,o.createElement)(D.__experimentalItemGroup,{isBordered:!0,isSeparated:!0},(0,o.createElement)(Nr,{name:t,parentMenu:n}),(0,o.createElement)(Ir,{name:t,parentMenu:n}),(0,o.createElement)(Pr,{name:t,parentMenu:n}))))))};function Ar(e){let{name:t}=e;const[n,r]=Fn("color.palette.theme",t),[a]=Fn("color.palette.theme",t,"base"),[l,i]=Fn("color.palette.default",t),[s]=Fn("color.palette.default",t,"base"),[c,u]=Fn("color.palette.custom",t),[m]=Fn("color.defaultPalette",t);return(0,o.createElement)(D.__experimentalVStack,{className:"edit-site-global-styles-color-palette-panel",spacing:10},!!n&&!!n.length&&(0,o.createElement)(D.__experimentalPaletteEdit,{canReset:n!==a,canOnlyChangeValues:!0,colors:n,onChange:r,paletteLabel:(0,d.__)("Theme")}),!!l&&!!l.length&&!!m&&(0,o.createElement)(D.__experimentalPaletteEdit,{canReset:l!==s,canOnlyChangeValues:!0,colors:l,onChange:i,paletteLabel:(0,d.__)("Default")}),(0,o.createElement)(D.__experimentalPaletteEdit,{colors:c,onChange:u,paletteLabel:(0,d.__)("Custom"),emptyMessage:(0,d.__)("Custom colors are empty! Add some colors to create your own color palette."),slugPrefix:"custom-"}))}function Rr(e){let{name:t}=e;const[n,r]=Fn("color.gradients.theme",t),[a]=Fn("color.gradients.theme",t,"base"),[l,i]=Fn("color.gradients.default",t),[s]=Fn("color.gradients.default",t,"base"),[c,u]=Fn("color.gradients.custom",t),[m]=Fn("color.defaultGradients",t),[p]=Fn("color.duotone")||[];return(0,o.createElement)(D.__experimentalVStack,{className:"edit-site-global-styles-gradient-palette-panel",spacing:10},!!n&&!!n.length&&(0,o.createElement)(D.__experimentalPaletteEdit,{canReset:n!==a,canOnlyChangeValues:!0,gradients:n,onChange:r,paletteLabel:(0,d.__)("Theme")}),!!l&&!!l.length&&!!m&&(0,o.createElement)(D.__experimentalPaletteEdit,{canReset:l!==s,canOnlyChangeValues:!0,gradients:l,onChange:i,paletteLabel:(0,d.__)("Default")}),(0,o.createElement)(D.__experimentalPaletteEdit,{gradients:c,onChange:u,paletteLabel:(0,d.__)("Custom"),emptyMessage:(0,d.__)("Custom gradients are empty! Add some gradients to create your own palette."),slugPrefix:"custom-"}),(0,o.createElement)("div",null,(0,o.createElement)(br,null,(0,d.__)("Duotone")),(0,o.createElement)(D.__experimentalSpacer,{margin:3}),(0,o.createElement)(D.DuotonePicker,{duotonePalette:p,disableCustomDuotone:!0,disableCustomColors:!0,clearable:!1,onChange:U.noop})))}var Lr=function(e){let{name:t}=e;const[n,r]=(0,o.useState)("solid"),a=void 0===t?"":"/blocks/"+t;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Er,{back:a+"/colors",title:(0,d.__)("Palette"),description:(0,d.__)("Palettes are used to provide default color options for blocks and various design tools. Here you can edit the colors with their labels.")}),(0,o.createElement)(D.__experimentalToggleGroupControl,{className:"edit-site-screen-color-palette-toggle",value:n,onChange:r,label:(0,d.__)("Select palette type"),hideLabelFromVision:!0,isBlock:!0},(0,o.createElement)(D.__experimentalToggleGroupControlOption,{value:"solid",label:(0,d.__)("Solid")}),(0,o.createElement)(D.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,d.__)("Gradient")})),"solid"===n&&(0,o.createElement)(Ar,{name:t}),"gradient"===n&&(0,o.createElement)(Rr,{name:t}))};var Br=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t,r=Gn(t),[a]=Fn("color.palette",t),[l]=Fn("color.gradients",t),[i]=Fn("color.custom",t),[s]=Fn("color.customGradient",t),c=Un(t),u=function(e){const[t]=Fn("color.gradients.custom",e),[n]=Fn("color.gradients.theme",e),[r]=Fn("color.gradients.default",e),[a]=Fn("color.defaultGradients");return(0,o.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,d._x)("Theme","Indicates this palette comes from the theme."),gradients:n}),a&&r&&r.length&&e.push({name:(0,d._x)("Default","Indicates this palette comes from WordPress."),gradients:r}),t&&t.length&&e.push({name:(0,d._x)("Custom","Indicates this palette is created by the user."),gradients:t}),e}),[t,n,r])}(t),[m]=Fn("color.background",t),p=r.includes("backgroundColor")&&m&&(a.length>0||i),_=r.includes("background")&&(l.length>0||s),[g,h]=Vn("color.background",t),[E]=Vn("color.background",t,"user"),[f,v]=Vn("color.gradient",t),[y]=Vn("color.gradient",t,"user");if(!p&&!_)return null;let b={};p&&(b={colorValue:g,onColorChange:h},g&&(b.clearable=g===E));let w={};_&&(w={gradientValue:f,onGradientChange:v},f&&(w.clearable=f===y));const S={...b,...w};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Er,{back:n+"/colors",title:(0,d.__)("Background"),description:(0,d.__)("Set a background color or gradient for the whole website.")}),(0,o.createElement)(Pt.__experimentalColorGradientControl,R({className:"edit-site-screen-background-color__control",colors:c,gradients:u,disableCustomColors:!i,disableCustomGradients:!s,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0},S)))};var Dr=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t,r=Gn(t),[a]=Fn("color.palette",t),[l]=Fn("color.custom",t),[i]=Fn("color.text",t),s=Un(t),c=r.includes("color")&&i&&(a.length>0||l),[u,m]=Vn("color.text",t),[p]=Vn("color.text",t,"user");return c?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Er,{back:n+"/colors",title:(0,d.__)("Text"),description:(0,d.__)("Set the default color used for text across the site.")}),(0,o.createElement)(Pt.__experimentalColorGradientControl,{className:"edit-site-screen-text-color__control",colors:s,disableCustomColors:!l,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:u,onColorChange:m,clearable:u===p})):null};var Or=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t,r=Gn(t),[a]=Fn("color.palette",t),[l]=Fn("color.custom",t),i=Un(t),[s]=Fn("color.link",t),c=r.includes("linkColor")&&s&&(a.length>0||l),[u,m]=Vn("elements.link.color.text",t),[p]=Vn("elements.link.color.text",t,"user");return c?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Er,{back:n+"/colors",title:(0,d.__)("Links"),description:(0,d.__)("Set the default color used for links across the site.")}),(0,o.createElement)(Pt.__experimentalColorGradientControl,{className:"edit-site-screen-link-color__control",colors:i,disableCustomColors:!l,__experimentalHasMultipleOrigins:!0,showTitle:!1,enableAlpha:!0,__experimentalIsRenderedInSidebar:!0,colorValue:u,onColorChange:m,clearable:u===p})):null};var Fr=function(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t,r=Yn(t),a=rr(t);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Er,{back:n||"/",title:(0,d.__)("Layout")}),a&&(0,o.createElement)(cr,{name:t}),r&&(0,o.createElement)(er,{name:t}))};function Vr(e){let{name:t}=e;const n=void 0===t?"":"/blocks/"+t;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(D.__experimentalNavigatorScreen,{path:n+"/typography"},(0,o.createElement)(Sr,{name:t})),(0,o.createElement)(D.__experimentalNavigatorScreen,{path:n+"/typography/text"},(0,o.createElement)(xr,{name:t,element:"text"})),(0,o.createElement)(D.__experimentalNavigatorScreen,{path:n+"/typography/link"},(0,o.createElement)(xr,{name:t,element:"link"})),(0,o.createElement)(D.__experimentalNavigatorScreen,{path:n+"/colors"},(0,o.createElement)(Mr,{name:t})),(0,o.createElement)(D.__experimentalNavigatorScreen,{path:n+"/colors/palette"},(0,o.createElement)(Lr,{name:t})),(0,o.createElement)(D.__experimentalNavigatorScreen,{path:n+"/colors/background"},(0,o.createElement)(Br,{name:t})),(0,o.createElement)(D.__experimentalNavigatorScreen,{path:n+"/colors/text"},(0,o.createElement)(Dr,{name:t})),(0,o.createElement)(D.__experimentalNavigatorScreen,{path:n+"/colors/link"},(0,o.createElement)(Or,{name:t})),(0,o.createElement)(D.__experimentalNavigatorScreen,{path:n+"/layout"},(0,o.createElement)(Fr,{name:t})))}var zr=function(){const e=(0,i.getBlockTypes)();return(0,o.createElement)(D.__experimentalNavigatorProvider,{initialPath:"/"},(0,o.createElement)(D.__experimentalNavigatorScreen,{path:"/"},(0,o.createElement)(hr,null)),(0,o.createElement)(D.__experimentalNavigatorScreen,{path:"/blocks"},(0,o.createElement)(vr,null)),e.map((e=>(0,o.createElement)(D.__experimentalNavigatorScreen,{key:"menu-block-"+e.name,path:"/blocks/"+e.name},(0,o.createElement)(yr,{name:e.name})))),(0,o.createElement)(Vr,null),e.map((e=>(0,o.createElement)(Vr,{key:"screens-block-"+e.name,name:e.name}))))};function Gr(e){const t="var:";if((0,U.startsWith)(e,t)){return`var(--wp--${e.slice(t.length).split("|").join("--")})`}return e}function Ur(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=[];return Object.keys(e).forEach((a=>{const l=t+(0,U.kebabCase)(a.replace("/","-")),o=e[a];if(o instanceof Object){const e=l+n;r=[...r,...Ur(o,e,n)]}else r.push(`${l}: ${o}`)})),r}const Hr=(e,t)=>{var n,r;const a=[];if(null==e||!e.settings)return a;const l=e=>{const t={};return Mn.forEach((n=>{let{path:r}=n;const a=(0,U.get)(e,r,!1);!1!==a&&(0,U.set)(t,r,a)})),t},o=l(e.settings),i=null===(n=e.settings)||void 0===n?void 0:n.custom;return(0,U.isEmpty)(o)&&!i||a.push({presets:o,custom:i,selector:Pn}),(0,U.forEach)(null===(r=e.settings)||void 0===r?void 0:r.blocks,((e,n)=>{const r=l(e),o=e.custom;(0,U.isEmpty)(r)&&!o||a.push({presets:r,custom:o,selector:t[n].selector})})),a},$r=(e,t)=>{const n=Hr(e,t);let r="";return n.forEach((e=>{let{presets:t,custom:n,selector:a}=e;const l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,U.reduce)(Mn,((t,n)=>{let{path:r,valueKey:a,cssVarInfix:l}=n;const o=(0,U.get)(e,r,[]);return["default","theme","custom"].forEach((e=>{o[e]&&o[e].forEach((e=>{t.push(`--wp--preset--${l}--${(0,U.kebabCase)(e.slug)}: ${e[a]}`)}))})),t}),[])}(t),o=Ur(n,"--wp--custom--","--");o.length>0&&l.push(...o),l.length>0&&(r+=`${a}{${l.join(";")};}`)})),r},Wr=(e,t)=>{const n=((e,t)=>{var n,r;const a=[];if(null==e||!e.styles)return a;const l=e=>(0,U.pickBy)(e,((e,t)=>["border","color","spacing","typography"].includes(t))),o=l(e.styles);return o&&a.push({styles:o,selector:Pn}),(0,U.forEach)(null===(n=e.styles)||void 0===n?void 0:n.elements,((e,t)=>{e&&i.__EXPERIMENTAL_ELEMENTS[t]&&a.push({styles:e,selector:i.__EXPERIMENTAL_ELEMENTS[t]})})),(0,U.forEach)(null===(r=e.styles)||void 0===r?void 0:r.blocks,((e,n)=>{var r;const o=l(e);o&&null!=t&&null!==(r=t[n])&&void 0!==r&&r.selector&&a.push({styles:o,selector:t[n].selector}),(0,U.forEach)(null==e?void 0:e.elements,((e,r)=>{e&&null!=t&&t[n]&&null!==i.__EXPERIMENTAL_ELEMENTS&&void 0!==i.__EXPERIMENTAL_ELEMENTS&&i.__EXPERIMENTAL_ELEMENTS[r]&&a.push({styles:e,selector:t[n].selector.split(",").map((e=>e+" "+i.__EXPERIMENTAL_ELEMENTS[r])).join(",")})}))})),a})(e,t),r=Hr(e,t);let a=".wp-site-blocks > * { margin-top: 0; margin-bottom: 0; }.wp-site-blocks > * + * { margin-top: var( --wp--style--block-gap ); }";return n.forEach((e=>{let{selector:t,styles:n}=e;const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,U.reduce)(i.__EXPERIMENTAL_STYLE_PROPERTY,((t,n,r)=>{let{value:a,properties:l}=n;const o=a;if("elements"===(0,U.first)(o))return t;const i=(0,U.get)(e,o);if(l&&!(0,U.isString)(i))Object.entries(l).forEach((e=>{const[n,r]=e;if(!(0,U.get)(i,[r],!1))return;const a=(0,U.kebabCase)(n);t.push(`${a}: ${Gr((0,U.get)(i,[r]))}`)}));else if((0,U.get)(e,o,!1)){const n=r.startsWith("--")?r:(0,U.kebabCase)(r);t.push(`${n}: ${Gr((0,U.get)(e,o))}`)}return t}),[])}(n);0!==r.length&&(a+=`${t}{${r.join(";")};}`)})),r.forEach((e=>{let{selector:t,presets:n}=e;Pn===t&&(t="");const r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,U.reduce)(Mn,((n,r)=>{let{path:a,cssVarInfix:l,classes:o}=r;if(!o)return n;const i=(0,U.get)(t,a,[]);return["default","theme","custom"].forEach((t=>{i[t]&&i[t].forEach((t=>{let{slug:r}=t;o.forEach((t=>{let{classSuffix:a,propertyName:o}=t;const i=`.has-${(0,U.kebabCase)(r)}-${a}`,s=e.split(",").map((e=>`${e}${i}`)).join(","),c=`var(--wp--preset--${l}--${(0,U.kebabCase)(r)})`;n+=`${s}{${o}: ${c} !important;}`}))}))})),n}),"")}(t,n);(0,U.isEmpty)(r)||(a+=r)})),a};function jr(){const[e,t]=(()=>{const{user:e,setUserConfig:t}=(0,o.useContext)(Dn);return[!!e&&!(0,U.isEqual)(e,On),(0,o.useCallback)((()=>t((()=>On))),[t])]})(),{toggleFeature:n}=(0,c.useDispatch)(mt);return(0,o.createElement)(xn,{className:"edit-site-global-styles-sidebar",identifier:"edit-site/global-styles",title:(0,d.__)("Styles"),icon:Tn,closeLabel:(0,d.__)("Close global styles sidebar"),header:(0,o.createElement)(D.Flex,null,(0,o.createElement)(D.FlexBlock,null,(0,o.createElement)("strong",null,(0,d.__)("Styles")),(0,o.createElement)("span",{className:"edit-site-global-styles-sidebar__beta"},(0,d.__)("Beta"))),(0,o.createElement)(D.FlexItem,null,(0,o.createElement)(D.DropdownMenu,{icon:Bt,label:(0,d.__)("More Global Styles Actions"),toggleProps:{disabled:!e},controls:[{title:(0,d.__)("Reset to defaults"),onClick:t},{title:(0,d.__)("Welcome Guide"),onClick:()=>n("welcomeGuideStyles")}]})))},(0,o.createElement)(zr,null))}const qr="edit-site/template",Kr="edit-site/block-inspector";var Yr=e=>{let{sidebarName:t}=e;const{enableComplementaryArea:n}=(0,c.useDispatch)(oe),[r,a]=t===qr?[(0,d.__)("Template (selected)"),"is-active"]:[(0,d.__)("Template"),""],[l,i]=t===Kr?[(0,d.__)("Block (selected)"),"is-active"]:[(0,d.__)("Block"),""];return(0,o.createElement)("ul",null,(0,o.createElement)("li",null,(0,o.createElement)(D.Button,{onClick:()=>n(v,qr),className:`edit-site-sidebar__panel-tab ${a}`,"aria-label":r,"data-label":(0,d.__)("Template")},(0,d.__)("Template"))),(0,o.createElement)("li",null,(0,o.createElement)(D.Button,{onClick:()=>n(v,Kr),className:`edit-site-sidebar__panel-tab ${i}`,"aria-label":l,"data-label":(0,d.__)("Block")},(0,d.__)("Block"))))};function Xr(e){let{area:t,clientId:n}=e;const{selectBlock:r,toggleBlockHighlight:a}=(0,c.useDispatch)(Pt.store),l=(0,c.useSelect)((e=>e(m.store).__experimentalGetDefaultTemplatePartAreas().find((e=>e.area===t))),[t]),i=()=>a(n,!0),s=()=>a(n,!1);return(0,o.createElement)(D.Button,{className:"edit-site-template-card__template-areas-item",icon:null==l?void 0:l.icon,onMouseOver:i,onMouseLeave:s,onFocus:i,onBlur:s,onClick:()=>{r(n)}},null==l?void 0:l.label)}function Qr(){const e=(0,c.useSelect)((e=>e(mt).getCurrentTemplateTemplateParts()),[]);return e.length?(0,o.createElement)("section",{className:"edit-site-template-card__template-areas"},(0,o.createElement)(D.__experimentalHeading,{level:3,className:"edit-site-template-card__template-areas-title"},(0,d.__)("Areas")),(0,o.createElement)("ul",{className:"edit-site-template-card__template-areas-list"},e.map((e=>{let{templatePart:t,block:n}=e;return(0,o.createElement)("li",{key:t.slug},(0,o.createElement)(Xr,{area:t.area,clientId:n.clientId}))})))):null}function Zr(){const{title:e,description:t,icon:n}=(0,c.useSelect)((e=>{const{getEditedPostType:t,getEditedPostId:n}=e(mt),{getEntityRecord:r}=e(u.store),{__experimentalGetTemplateInfo:a}=e(m.store),l=r("postType",t(),n());return l?a(l):{}}),[]);return e||t?(0,o.createElement)("div",{className:"edit-site-template-card"},(0,o.createElement)(D.Icon,{className:"edit-site-template-card__icon",icon:n}),(0,o.createElement)("div",{className:"edit-site-template-card__content"},(0,o.createElement)("h2",{className:"edit-site-template-card__title"},e),(0,o.createElement)("div",{className:"edit-site-template-card__description"},t),(0,o.createElement)(Qr,null))):null}const{Slot:Jr,Fill:ea}=(0,D.createSlotFill)("EditSiteSidebarInspector"),ta=ea;function na(){const{sidebar:e,isEditorSidebarOpened:t,hasBlockSelection:n}=(0,c.useSelect)((e=>{const t=e(oe).getActiveComplementaryArea(v);return{sidebar:t,isEditorSidebarOpened:[Kr,qr].includes(t),hasBlockSelection:!!e(Pt.store).getBlockSelectionStart()}}),[]),{enableComplementaryArea:r}=(0,c.useDispatch)(oe);(0,o.useEffect)((()=>{t&&r(v,n?Kr:qr)}),[n,t]);let a=e;return t||(a=n?Kr:qr),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(xn,{identifier:a,title:(0,d.__)("Settings"),icon:kn,closeLabel:(0,d.__)("Close settings sidebar"),header:(0,o.createElement)(Yr,{sidebarName:a}),headerClassName:"edit-site-sidebar__panel-tabs"},a===qr&&(0,o.createElement)(D.PanelBody,null,(0,o.createElement)(Zr,null)),a===Kr&&(0,o.createElement)(Jr,{bubblesVirtually:!0})),(0,o.createElement)(jr,null))}var ra=window.wp.htmlEntities;var aa=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"}));var la=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"}));const oa="__experimentalMainDashboardButton",{Fill:ia,Slot:sa}=(0,D.createSlotFill)(oa),ca=ia;ca.Slot=e=>{let{children:t}=e;const n=(0,D.__experimentalUseSlot)(oa);return Boolean(n.fills&&n.fills.length)?(0,o.createElement)(sa,{bubblesVirtually:!0}):t};var ua=ca;const ma="site-editor";function da(e){let{params:t,replace:n,...r}=e;const a=gn(t,n);return(0,o.createElement)(D.__experimentalNavigationItem,R({},a,r))}var pa=e=>{let{activeItem:t=ma}=e;const{isNavigationOpen:n,siteTitle:r}=(0,c.useSelect)((e=>{const{getEntityRecord:t}=e(u.store);return{siteTitle:(t("root","__unstableBase",void 0)||{}).name,isNavigationOpen:e(mt).isNavigationOpened()}}),[]),{setIsNavigationPanelOpened:a}=(0,c.useDispatch)(mt);return(0,o.createElement)("div",{className:B()("edit-site-navigation-panel",{"is-open":n}),onKeyDown:e=>{e.keyCode!==Lt.ESCAPE||e.defaultPrevented||(e.preventDefault(),a(!1))}},(0,o.createElement)("div",{className:"edit-site-navigation-panel__inner"},(0,o.createElement)("div",{className:"edit-site-navigation-panel__site-title-container"},(0,o.createElement)("div",{className:"edit-site-navigation-panel__site-title"},(0,ra.decodeEntities)(r))),(0,o.createElement)("div",{className:"edit-site-navigation-panel__scroll-container"},(0,o.createElement)(D.__experimentalNavigation,{activeItem:t},(0,o.createElement)(ua.Slot,null,(0,o.createElement)(D.__experimentalNavigationBackButton,{backButtonLabel:(0,d.__)("Dashboard"),className:"edit-site-navigation-panel__back-to-dashboard",href:"index.php"})),(0,o.createElement)(D.__experimentalNavigationMenu,null,(0,o.createElement)(D.__experimentalNavigationGroup,{title:(0,d.__)("Editor")},(0,o.createElement)(da,{icon:aa,title:(0,d.__)("Site"),item:ma,params:{postId:void 0,postType:void 0}}),(0,o.createElement)(da,{icon:qn,title:(0,d.__)("Templates"),item:"wp_template",params:{postId:void 0,postType:"wp_template"}}),(0,o.createElement)(da,{icon:la,title:(0,d.__)("Template Parts"),item:"wp_template_part",params:{postId:void 0,postType:"wp_template_part"}})))))))};var _a=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,o.createElement)(O.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"}));var ga=function(e){let{icon:t}=e;const{isNavigationOpen:n,isRequestingSiteIcon:r,siteIconUrl:a}=(0,c.useSelect)((e=>{const{getEntityRecord:t,isResolving:n}=e(u.store),r=t("root","__unstableBase",void 0)||{};return{isNavigationOpen:e(mt).isNavigationOpened(),isRequestingSiteIcon:n("core","getEntityRecord",["root","__unstableBase",void 0]),siteIconUrl:r.site_icon_url}}),[]),{setIsNavigationPanelOpened:l}=(0,c.useDispatch)(mt),i=(0,ye.useReducedMotion)(),s=(0,o.useRef)();(0,o.useEffect)((()=>{n||s.current.focus()}),[n]);let m=(0,o.createElement)(D.Icon,{size:"36px",icon:_a});const p={expand:{scale:1.7,borderRadius:0,transition:{type:"tween",duration:"0.2"}}};return a?m=(0,o.createElement)(D.__unstableMotion.img,{variants:!i&&p,alt:(0,d.__)("Site Icon"),className:"edit-site-navigation-toggle__site-icon",src:a}):r?m=null:t&&(m=(0,o.createElement)(D.Icon,{size:"36px",icon:t})),(0,o.createElement)(D.__unstableMotion.div,{className:"edit-site-navigation-toggle"+(n?" is-open":""),whileHover:"expand"},(0,o.createElement)(D.Button,{className:"edit-site-navigation-toggle__button has-icon",label:(0,d.__)("Toggle navigation"),ref:s,"aria-pressed":n,onClick:()=>l(!n),showTooltip:!0},m))};const{Fill:ha,Slot:Ea}=(0,D.createSlotFill)("EditSiteNavigationPanelPreview"),{Fill:fa,Slot:va}=(0,D.createSlotFill)("EditSiteNavigationSidebar");function ya(e){let{isDefaultOpen:t=!1,activeTemplateType:n}=e;const r=(0,ye.useViewportMatch)("medium"),{setIsNavigationPanelOpened:a}=(0,c.useDispatch)(mt);return(0,o.useEffect)((function(){a(t&&r)}),[t,r,a]),(0,o.createElement)(fa,null,(0,o.createElement)(ga,null),(0,o.createElement)(pa,{activeItem:n}),(0,o.createElement)(Ea,null))}ya.Slot=va;var ba=ya,wa=window.wp.reusableBlocks;function Sa(e){let{clientId:t}=e;const{getBlocks:n}=(0,c.useSelect)(Pt.store),{replaceBlocks:r}=(0,c.useDispatch)(Pt.store);return(0,o.createElement)(Pt.BlockSettingsMenuControls,null,(e=>{let{onClose:a}=e;return(0,o.createElement)(D.MenuItem,{onClick:()=>{r(t,n(t)),a()}},(0,d.__)("Detach blocks from template part"))}))}function ka(e){let{closeModal:t,onCreate:n}=e;const[r,a]=(0,o.useState)(""),[l,i]=(0,o.useState)(y),[s,u]=(0,o.useState)(!1),p=(0,ye.useInstanceId)(ka),_=(0,c.useSelect)((e=>e(m.store).__experimentalGetDefaultTemplatePartAreas()),[]);return(0,o.createElement)(D.Modal,{title:(0,d.__)("Create a template part"),closeLabel:(0,d.__)("Close"),onRequestClose:t,overlayClassName:"edit-site-create-template-part-modal"},(0,o.createElement)("form",{onSubmit:async e=>{e.preventDefault(),r&&(u(!0),await n({title:r,area:l}))}},(0,o.createElement)(D.TextControl,{label:(0,d.__)("Name"),value:r,onChange:a,required:!0}),(0,o.createElement)(D.BaseControl,{label:(0,d.__)("Area"),id:`edit-site-create-template-part-modal__area-selection-${p}`,className:"edit-site-create-template-part-modal__area-base-control"},(0,o.createElement)(D.__experimentalRadioGroup,{label:(0,d.__)("Area"),className:"edit-site-create-template-part-modal__area-radio-group",id:`edit-site-create-template-part-modal__area-selection-${p}`,onChange:i,checked:l},_.map((e=>{let{icon:t,label:n,area:r,description:a}=e;return(0,o.createElement)(D.__experimentalRadio,{key:n,value:r,className:"edit-site-create-template-part-modal__area-radio"},(0,o.createElement)(D.Flex,{align:"start",justify:"start"},(0,o.createElement)(D.FlexItem,null,(0,o.createElement)(D.Icon,{icon:t})),(0,o.createElement)(D.FlexBlock,{className:"edit-site-create-template-part-modal__option-label"},n,(0,o.createElement)("div",null,a)),(0,o.createElement)(D.FlexItem,{className:"edit-site-create-template-part-modal__checkbox"},l===r&&(0,o.createElement)(D.Icon,{icon:F}))))})))),(0,o.createElement)(D.Flex,{className:"edit-site-create-template-part-modal__modal-actions",justify:"flex-end"},(0,o.createElement)(D.FlexItem,null,(0,o.createElement)(D.Button,{variant:"secondary",onClick:()=>{t()}},(0,d.__)("Cancel"))),(0,o.createElement)(D.FlexItem,null,(0,o.createElement)(D.Button,{variant:"primary",type:"submit",disabled:!r,isBusy:s},(0,d.__)("Create"))))))}function xa(e){let{clientIds:t,blocks:n}=e;const[r,a]=(0,o.useState)(!1),{replaceBlocks:l}=(0,c.useDispatch)(Pt.store),{saveEntityRecord:s}=(0,c.useDispatch)(u.store),{createSuccessNotice:m}=(0,c.useDispatch)(A.store);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Pt.BlockSettingsMenuControls,null,(()=>(0,o.createElement)(D.MenuItem,{onClick:()=>{a(!0)}},(0,d.__)("Make template part")))),r&&(0,o.createElement)(ka,{closeModal:()=>{a(!1)},onCreate:async e=>{let{title:r,area:a}=e;const o=(0,U.kebabCase)(r).replace(/[^\w-]+/g,"")||"wp-custom-part",c=await s("postType","wp_template_part",{slug:o,title:r,content:(0,i.serialize)(n),area:a});l(t,(0,i.createBlock)("core/template-part",{slug:c.slug,theme:c.theme})),m((0,d.__)("Template part created."),{type:"snackbar"})}}))}function Ta(){var e;const{clientIds:t,blocks:n}=(0,c.useSelect)((e=>{const{getSelectedBlockClientIds:t,getBlocksByClientId:n}=e(Pt.store),r=t();return{clientIds:r,blocks:n(r)}}),[]);return 1===n.length&&"core/template-part"===(null===(e=n[0])||void 0===e?void 0:e.name)?(0,o.createElement)(Sa,{clientId:t[0]}):(0,o.createElement)(xa,{clientIds:t,blocks:n})}var Ca=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));function Na(e){let{type:t,id:n,activePage:r,onActivePageChange:a}=e;const l=(0,c.useSelect)((e=>t&&n&&"URL"!==t&&e(u.store).getEntityRecord("postType",t,n)),[t,n]),i=(0,o.useMemo)((()=>{if(null==l||!l.link)return null;const e=(0,_.getPathAndQueryString)(l.link);return e===(null==r?void 0:r.path)?null:()=>a({type:t,slug:l.slug,path:e,context:{postType:l.type,postId:l.id}})}),[l,null==r?void 0:r.path,a]);return i&&(0,o.createElement)(D.Button,{icon:Ca,label:(0,d.__)("Edit Page Template"),onClick:i})}function Ia(e){let{onClick:t=(()=>{})}=e;const{shortcut:n,isBlockInspectorOpen:r}=(0,c.useSelect)((e=>({shortcut:e(Mt.store).getShortcutRepresentation("core/edit-site/toggle-block-settings-sidebar"),isBlockInspectorOpen:e(oe).getActiveComplementaryArea(mt.name)===Kr})),[]),{enableComplementaryArea:a,disableComplementaryArea:l}=(0,c.useDispatch)(oe),i=r?(0,d.__)("Hide more settings"):(0,d.__)("Show more settings");return(0,o.createElement)(D.MenuItem,{onClick:()=>{r?(l(v),(0,Wt.speak)((0,d.__)("Block settings closed"))):(a(v,Kr),(0,Wt.speak)((0,d.__)("Additional settings are now available in the Editor block settings sidebar"))),t()},shortcut:n},i)}function Pa(){return(0,o.createElement)(Pt.BlockSettingsMenuControls,null,(e=>{let{selectedClientIds:t,onClose:n}=e;return(0,o.createElement)(Ma,{selectedClientId:t[0],onClose:n})}))}function Ma(e){let{selectedClientId:t,onClose:n}=e;const{params:r}=Tt(),a=(0,c.useSelect)((e=>{const n=e(Pt.store).getBlock(t);if(n&&(0,i.isTemplatePart)(n)){const{theme:t,slug:r}=n.attributes;return e(u.store).getEntityRecord("postType","wp_template_part",`${t}//${r}`)}}),[t]),l=gn({postId:null==a?void 0:a.id,postType:null==a?void 0:a.type},{fromTemplateId:r.postId});return a?(0,o.createElement)(D.MenuItem,R({},l,{onClick:e=>{l.onClick(e),n()}}),(0,d.sprintf)((0,d.__)("Edit %s"),a.slug)):null}var Aa=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));var Ra=function(){var e;const t=Tt(),n=Ct(),r="wp_template_part"===t.params.postType,a=null===(e=t.state)||void 0===e?void 0:e.fromTemplateId;return r&&a?(0,o.createElement)(D.Button,{className:"edit-site-visual-editor__back-button",icon:Aa,onClick:()=>{n.back()}},(0,d.__)("Back")):null};function La(e){let{direction:t,resizeWidthBy:n}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("button",{className:`resizable-editor__drag-handle is-${t}`,"aria-label":(0,d.__)("Drag to resize"),"aria-describedby":`resizable-editor__resize-help-${t}`,onKeyDown:function(e){const{keyCode:r}=e;"left"===t&&r===Lt.LEFT||"right"===t&&r===Lt.RIGHT?n(20):("left"===t&&r===Lt.RIGHT||"right"===t&&r===Lt.LEFT)&&n(-20)}}),(0,o.createElement)(D.VisuallyHidden,{id:`resizable-editor__resize-help-${t}`},(0,d.__)("Use left and right arrow keys to resize the canvas.")))}const Ba="100%",Da="100%",Oa={position:void 0,userSelect:void 0,cursor:void 0,width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0};var Fa=function(e){let{enableResizing:t,settings:n,...r}=e;const a=(0,c.useSelect)((e=>e(mt).__experimentalGetPreviewDeviceType()),[]),l=(0,Pt.__experimentalUseResizeCanvas)(a),[i,s]=(0,o.useState)(Ba),[u,m]=(0,o.useState)(Da),d=(0,o.useRef)(),p=(0,Pt.__unstableUseMouseMoveTypingReset)(),_=(0,ye.useMergeRefs)([d,p]);(0,o.useEffect)((function(){const e=d.current;if(!e||!t)return;let n,r=null;function a(){r||(r=e.contentWindow.requestAnimationFrame((()=>{m(e.contentDocument.documentElement.scrollHeight),r=null})))}function l(){var t;null===(t=n)||void 0===t||t.disconnect(),n=new e.contentWindow.ResizeObserver(a),n.observe(e.contentDocument.documentElement),a()}return e.addEventListener("load",l),l(),()=>{var t,a;null===(t=e.contentWindow)||void 0===t||t.cancelAnimationFrame(r),null===(a=n)||void 0===a||a.disconnect(),e.removeEventListener("load",l)}}),[t]);const g=(0,o.useCallback)((e=>{d.current&&s(d.current.offsetWidth+e)}),[]);return(0,o.createElement)(D.ResizableBox,{size:{width:i,height:u},onResizeStop:(e,t,n)=>{s(n.style.width)},minWidth:300,maxWidth:"100%",maxHeight:"100%",enable:{right:t,left:t},showHandle:t,resizeRatio:2,handleComponent:{left:(0,o.createElement)(La,{direction:"left",resizeWidthBy:g}),right:(0,o.createElement)(La,{direction:"right",resizeWidthBy:g})},handleClasses:void 0,handleStyles:{left:Oa,right:Oa}},(0,o.createElement)(Pt.__unstableIframe,R({style:t?void 0:l,head:(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Pt.__unstableEditorStyles,{styles:n.styles}),(0,o.createElement)("style",null,".is-root-container { display: flow-root; }"),t&&(0,o.createElement)("style",null,"html, body { height: -moz-fit-content !important; height: fit-content !important; min-height: 0 !important; }",".is-root-container { min-height: 0 !important; }")),ref:_,name:"editor-canvas",className:"edit-site-visual-editor__editor-canvas"},r)))};const Va={type:"default",alignments:[]};function za(e){let{setIsInserterOpen:t}=e;const{settings:n,templateType:r,templateId:a,page:l}=(0,c.useSelect)((e=>{const{getSettings:n,getEditedPostType:r,getEditedPostId:a,getPage:l}=e(mt);return{settings:n(t),templateType:r(),templateId:a(),page:l()}}),[t]),[i,s,m]=(0,u.useEntityBlockEditor)("postType",r),{setPage:d}=(0,c.useDispatch)(mt),p=(0,o.useRef)(),_=(0,ye.useMergeRefs)([p,(0,Pt.__unstableUseTypingObserver)()]),g=(0,ye.useViewportMatch)("small","<"),{clearSelectedBlock:h}=(0,c.useDispatch)(Pt.store),E="wp_template_part"===r;return(0,o.createElement)(Pt.BlockEditorProvider,{settings:n,value:i,onInput:s,onChange:m,useSubRegistry:!1},(0,o.createElement)(Pa,null),(0,o.createElement)(Ta,null),(0,o.createElement)(Pt.__experimentalLinkControl.ViewerFill,null,(0,o.useCallback)((e=>(0,o.createElement)(Na,R({},e,{activePage:l,onActivePageChange:d}))),[l])),(0,o.createElement)(ta,null,(0,o.createElement)(Pt.BlockInspector,null)),(0,o.createElement)(Pt.BlockTools,{className:B()("edit-site-visual-editor",{"is-focus-mode":E}),__unstableContentRef:p,onClick:e=>{e.target===e.currentTarget&&h()}},(0,o.createElement)(Pt.BlockEditorKeyboardShortcuts.Register,null),(0,o.createElement)(Ra,null),(0,o.createElement)(Fa,{key:a,enableResizing:E&&!g,settings:n,contentRef:_},(0,o.createElement)(Pt.BlockList,{className:"edit-site-block-editor__block-list wp-site-blocks",__experimentalLayout:Va,renderAppender:!E&&void 0})),(0,o.createElement)(Pt.__unstableBlockSettingsMenuFirstItem,null,(e=>{let{onClose:t}=e;return(0,o.createElement)(Ia,{onClick:t})}))),(0,o.createElement)(wa.ReusableBlocksMenuItems,null))}function Ga(e){let{openEntitiesSavedStates:t}=e;const{__experimentalGetDirtyEntityRecords:n,isSavingEntityRecord:r}=(0,c.useSelect)(u.store),a=(0,c.useSelect)((e=>e(mt).isListViewOpened()),[]),l=(0,c.useSelect)((e=>e(oe).getActiveComplementaryArea(mt.name)===Kr),[]),{redo:o,undo:i}=(0,c.useDispatch)(u.store),{setIsListViewOpened:s}=(0,c.useDispatch)(mt),{enableComplementaryArea:m,disableComplementaryArea:d}=(0,c.useDispatch)(oe);return(0,Mt.useShortcut)("core/edit-site/save",(e=>{e.preventDefault();const a=n(),l=!!a.length;!a.some((e=>r(e.kind,e.name,e.key)))&&l&&t()})),(0,Mt.useShortcut)("core/edit-site/undo",(e=>{i(),e.preventDefault()})),(0,Mt.useShortcut)("core/edit-site/redo",(e=>{o(),e.preventDefault()})),(0,Mt.useShortcut)("core/edit-site/toggle-list-view",(()=>{s(!a)})),(0,Mt.useShortcut)("core/edit-site/toggle-block-settings-sidebar",(e=>{e.preventDefault(),l?d(v):m(v,Kr)})),null}Ga.Register=function(){const{registerShortcut:e}=(0,c.useDispatch)(Mt.store);return(0,o.useEffect)((()=>{e({name:"core/edit-site/save",category:"global",description:(0,d.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/edit-site/undo",category:"global",description:(0,d.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/edit-site/redo",category:"global",description:(0,d.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}}),e({name:"core/edit-site/toggle-list-view",category:"global",description:(0,d.__)("Open the block list view."),keyCombination:{modifier:"access",character:"o"}}),e({name:"core/edit-site/toggle-block-settings-sidebar",category:"global",description:(0,d.__)("Show or hide the block settings sidebar."),keyCombination:{modifier:"primaryShift",character:","}}),e({name:"core/edit-site/keyboard-shortcuts",category:"main",description:(0,d.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/edit-site/next-region",category:"global",description:(0,d.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-site/previous-region",category:"global",description:(0,d.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"}]})}),[e]),null};var Ua=Ga;function Ha(){const{setTemplate:e,setTemplatePart:t,setPage:n}=(0,c.useDispatch)(mt),{params:{postId:r,postType:a}}=Tt();return(0,o.useEffect)((()=>{"page"===a||"post"===a?n({context:{postType:a,postId:r}}):"wp_template"===a?e(r):"wp_template_part"===a&&t(r)}),[r,a]),null}var $a=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.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 Wa(){const{setIsInserterOpened:e}=(0,c.useDispatch)(mt),t=(0,c.useSelect)((e=>e(mt).__experimentalGetInsertionPoint()),[]),n=(0,ye.useViewportMatch)("medium","<"),[r,a]=(0,ye.__experimentalUseDialog)({onClose:()=>e(!1)});return(0,o.createElement)("div",R({ref:r},a,{className:"edit-site-editor__inserter-panel"}),(0,o.createElement)("div",{className:"edit-site-editor__inserter-panel-header"},(0,o.createElement)(D.Button,{icon:$a,onClick:()=>e(!1)})),(0,o.createElement)("div",{className:"edit-site-editor__inserter-panel-content"},(0,o.createElement)(Pt.__experimentalLibrary,{showInserterHelpPanel:!0,shouldFocusBlock:n,rootClientId:t.rootClientId,__experimentalInsertionIndex:t.insertionIndex,__experimentalFilterValue:t.filterValue})))}function ja(){const{setIsListViewOpened:e}=(0,c.useDispatch)(mt),{clearSelectedBlock:t,selectBlock:n}=(0,c.useDispatch)(Pt.store);const r=(0,ye.useFocusOnMount)("firstElement"),a=(0,ye.useFocusReturn)();const l=`edit-site-editor__list-view-panel-label-${(0,ye.useInstanceId)(ja)}`;return(0,o.createElement)("div",{"aria-labelledby":l,className:"edit-site-editor__list-view-panel",onKeyDown:function(t){t.keyCode!==Lt.ESCAPE||t.defaultPrevented||e(!1)}},(0,o.createElement)("div",{className:"edit-site-editor__list-view-panel-header"},(0,o.createElement)("strong",{id:l},(0,d.__)("List view")),(0,o.createElement)(D.Button,{icon:G,label:(0,d.__)("Close list view sidebar"),onClick:()=>e(!1)})),(0,o.createElement)("div",{className:"edit-site-editor__list-view-panel-content",ref:(0,ye.useMergeRefs)([a,r])},(0,o.createElement)(Pt.__experimentalListView,{onSelect:async function(e){await t(),n(e,-1)},showNestedBlocks:!0,__experimentalFeatures:!0,__experimentalPersistentListViewFeatures:!0})))}function qa(e){let{text:t,children:n}=e;const r=(0,ye.useCopyToClipboard)(t);return(0,o.createElement)(D.Button,{variant:"secondary",ref:r},n)}function Ka(e){let{message:t,error:n,reboot:r,dashboardLink:a}=e;const l=[];return r&&l.push((0,o.createElement)(D.Button,{key:"recovery",onClick:r,variant:"secondary"},(0,d.__)("Attempt Recovery"))),n&&l.push((0,o.createElement)(qa,{key:"copy-error",text:n.stack},(0,d.__)("Copy Error"))),a&&l.push((0,o.createElement)(D.Button,{key:"back-to-dashboard",variant:"secondary",href:a},(0,d.__)("Back to dashboard"))),(0,o.createElement)(Pt.Warning,{className:"editor-error-boundary",actions:l},t)}class Ya extends o.Component{constructor(){super(...arguments),this.reboot=this.reboot.bind(this),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}reboot(){this.props.onError()}render(){const{error:e}=this.state;return e?(0,o.createElement)(Ka,{message:(0,d.__)("The editor has encountered an unexpected error."),error:e,reboot:this.reboot}):this.props.children}}function Xa(e){let{nonAnimatedSrc:t,animatedSrc:n}=e;return(0,o.createElement)("picture",{className:"edit-site-welcome-guide__image"},(0,o.createElement)("source",{srcSet:t,media:"(prefers-reduced-motion: reduce)"}),(0,o.createElement)("img",{src:n,width:"312",height:"240",alt:""}))}function Qa(){const{toggleFeature:e}=(0,c.useDispatch)(mt);return(0,c.useSelect)((e=>e(mt).isFeatureActive("welcomeGuide")),[])?(0,o.createElement)(D.Guide,{className:"edit-site-welcome-guide",contentLabel:(0,d.__)("Welcome to the site editor"),finishButtonText:(0,d.__)("Get Started"),onFinish:()=>e("welcomeGuide"),pages:[{image:(0,o.createElement)(Xa,{nonAnimatedSrc:"https://s.w.org/images/block-editor/edit-your-site.svg?1",animatedSrc:"https://s.w.org/images/block-editor/edit-your-site.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,d.__)("Edit your site")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,d.__)("Design everything on your site — from the header right down to the footer — using blocks.")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,o.createInterpolateElement)((0,d.__)("Click <StylesIconImage /> to start designing your blocks, and choose your typography, layout, and colors."),{StylesIconImage:(0,o.createElement)("img",{alt:(0,d.__)("styles"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 4c-4.4 0-8 3.6-8 8v.1c0 4.1 3.2 7.5 7.2 7.9h.8c4.4 0 8-3.6 8-8s-3.6-8-8-8zm0 15V5c3.9 0 7 3.1 7 7s-3.1 7-7 7z' fill='%231E1E1E'/%3E%3C/svg%3E%0A"})})))}]}):null}function Za(){const{toggleFeature:e}=(0,c.useDispatch)(mt),{isActive:t,isStylesOpen:n}=(0,c.useSelect)((e=>{const t=e(oe).getActiveComplementaryArea(mt.name);return{isActive:e(mt).isFeatureActive("welcomeGuideStyles"),isStylesOpen:"edit-site/global-styles"===t}}),[]);return t&&n?(0,o.createElement)(D.Guide,{className:"edit-site-welcome-guide",contentLabel:(0,d.__)("Welcome to styles"),finishButtonText:(0,d.__)("Get Started"),onFinish:()=>e("welcomeGuideStyles"),pages:[{image:(0,o.createElement)(Xa,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.svg?1",animatedSrc:"https://s.w.org/images/block-editor/welcome-to-styles.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,d.__)("Welcome to Styles")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,d.__)("Tweak your site, or give it a whole new look! Get creative — how about a new color palette for your buttons, or choosing a new font? Take a look at what you can do here.")))},{image:(0,o.createElement)(Xa,{nonAnimatedSrc:"https://s.w.org/images/block-editor/set-the-design.svg?1",animatedSrc:"https://s.w.org/images/block-editor/set-the-design.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,d.__)("Set the design")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,d.__)("You can customize your site as much as you like with different colors, typography, and layouts. Or if you prefer, just leave it up to your theme to handle! ")))},{image:(0,o.createElement)(Xa,{nonAnimatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.svg?1",animatedSrc:"https://s.w.org/images/block-editor/personalize-blocks.gif?1"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,d.__)("Personalize blocks")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,d.__)("You can adjust your blocks to ensure a cohesive experience across your site — add your unique colors to a branded Button block, or adjust the Heading block to your preferred size.")))},{image:(0,o.createElement)(Xa,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h1",{className:"edit-site-welcome-guide__heading"},(0,d.__)("Learn more")),(0,o.createElement)("p",{className:"edit-site-welcome-guide__text"},(0,d.__)("New to block themes and styling your site? "),(0,o.createElement)(D.ExternalLink,{href:(0,d.__)("https://wordpress.org/support/article/styles-overview/")},(0,d.__)("Heres a detailed guide to learn how to make the most of it."))))}]}):null}function Ja(){return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Qa,null),(0,o.createElement)(Za,null))}function el(){const[e,t]=function(){const[e,t]=(0,o.useState)([]),[n,r]=(0,o.useState)({}),{merged:a}=(0,o.useContext)(Dn);return(0,o.useEffect)((()=>{if(null==a||!a.styles||null==a||!a.settings)return;const e=(e=>{const t={};return e.forEach((e=>{var n,r;const a=e.name,l=null!==(n=null==e||null===(r=e.supports)||void 0===r?void 0:r.__experimentalSelector)&&void 0!==n?n:".wp-block-"+a.replace("core/","").replace("/","-");t[a]={name:a,selector:l}})),t})((0,i.getBlockTypes)()),n=$r(a,e),l=Wr(a,e);t([{css:n,isGlobalStyles:!0},{css:l,isGlobalStyles:!0}]),r(a.settings)}),[a]),[e,n]}(),{getSettings:n}=(0,c.useSelect)(mt),{updateSettings:r}=(0,c.useDispatch)(mt);(0,o.useEffect)((()=>{var a;if(!e||!t)return;const l=n(),o=null==l||null===(a=l.styles)||void 0===a?void 0:a.filter((e=>!e.isGlobalStyles));r({...l,styles:[...o,...e],__experimentalFeatures:t})}),[e,t])}function tl(){return el(),null}function nl(e,t){if(Array.isArray(t))return t}const rl=e=>{if(!(0,U.isObject)(e)||Array.isArray(e))return e;const t=(0,U.pickBy)((0,U.mapValues)(e,rl),U.identity);return(0,U.isEmpty)(t)?void 0:t};function al(){const[e,t,n]=function(){const{globalStylesId:e,settings:t,styles:n}=(0,c.useSelect)((e=>{const t=e(u.store).__experimentalGetCurrentGlobalStylesId(),n=t?e(u.store).getEditedEntityRecord("root","globalStyles",t):void 0;return{globalStylesId:t,settings:null==n?void 0:n.settings,styles:null==n?void 0:n.styles}}),[]),{getEditedEntityRecord:r}=(0,c.useSelect)(u.store),{editEntityRecord:a}=(0,c.useDispatch)(u.store),l=(0,o.useMemo)((()=>({settings:null!=t?t:{},styles:null!=n?n:{}})),[t,n]),i=(0,o.useCallback)((t=>{var n,l;const o=r("root","globalStyles",e),i=t({styles:null!==(n=null==o?void 0:o.styles)&&void 0!==n?n:{},settings:null!==(l=null==o?void 0:o.settings)&&void 0!==l?l:{}});a("root","globalStyles",e,{styles:rl(i.styles)||{},settings:rl(i.settings)||{}})}),[e]);return[!!t||!!n,l,i]}(),[r,a]=function(){const e=(0,c.useSelect)((e=>e(u.store).__experimentalGetCurrentThemeBaseGlobalStyles()),[]);return[!!e,e]}(),l=(0,o.useMemo)((()=>{return a&&t?(e=a,n=t,(0,U.mergeWith)({},e,n,nl)):{};var e,n}),[t,a]);return(0,o.useMemo)((()=>({isReady:e&&r,user:t,base:a,merged:l,setUserConfig:n})),[l,t,a,n,e,r])}function ll(e){let{children:t}=e;const n=al();return n.isReady?(0,o.createElement)(Dn.Provider,{value:n},t):null}function ol(e){const t=Tt(),n=(0,c.useSelect)((e=>{var t;return null===(t=e(u.store).getEntityRecord("root","site"))||void 0===t?void 0:t.title}),[]),r=(0,o.useRef)(!0);(0,o.useEffect)((()=>{r.current=!1}),[t]),(0,o.useEffect)((()=>{if(!r.current&&e&&n){const t=(0,d.sprintf)((0,d.__)("%1$s %2$s — WordPress"),e,n);document.title=t,(0,Wt.speak)((0,d.sprintf)((0,d.__)("Now displaying: %s"),document.title),"assertive")}}),[e,n,t])}const il={secondarySidebar:(0,d.__)("Block Library"),drawer:(0,d.__)("Navigation Sidebar")};var sl=function(e){let{onError:t}=e;const{isInserterOpen:n,isListViewOpen:r,sidebarIsOpened:a,settings:l,entityId:i,templateType:s,page:p,template:_,templateResolved:g,isNavigationOpen:h,previousShortcut:E,nextShortcut:f}=(0,c.useSelect)((e=>{const{isInserterOpened:t,isListViewOpened:n,getSettings:r,getEditedPostType:a,getEditedPostId:l,getPage:o,isNavigationOpened:i}=e(mt),{hasFinishedResolution:s,getEntityRecord:c}=e(u.store),m=a(),d=l();return{isInserterOpen:t(),isListViewOpen:n(),sidebarIsOpened:!!e(oe).getActiveComplementaryArea(mt.name),settings:r(),templateType:m,page:o(),template:d?c("postType",m,d):null,templateResolved:!!d&&s("getEntityRecord",["postType",m,d]),entityId:d,isNavigationOpen:i(),previousShortcut:e(Mt.store).getAllShortcutKeyCombinations("core/edit-site/previous-region"),nextShortcut:e(Mt.store).getAllShortcutKeyCombinations("core/edit-site/next-region")}}),[]),{setPage:v,setIsInserterOpened:y}=(0,c.useDispatch)(mt),{enableComplementaryArea:b}=(0,c.useDispatch)(oe),[w,S]=(0,o.useState)(!1),k=(0,o.useCallback)((()=>S(!0)),[]),x=(0,o.useCallback)((()=>{S(!1)}),[]),T=(0,o.useMemo)((()=>({...null==p?void 0:p.context,queryContext:[(null==p?void 0:p.context.queryContext)||{page:1},e=>v({...p,context:{...null==p?void 0:p.context,queryContext:{...null==p?void 0:p.context.queryContext,...e}}})]})),[null==p?void 0:p.context]);(0,o.useEffect)((()=>{h?document.body.classList.add("is-navigation-sidebar-open"):document.body.classList.remove("is-navigation-sidebar-open")}),[h]),(0,o.useEffect)((function(){"open"===new URLSearchParams(window.location.search).get("styles")&&b("core/edit-site","edit-site/global-styles")}),[b]);const C=(null==l?void 0:l.siteUrl)&&void 0!==s&&void 0!==i;return ol(C&&(0,d.__)("Editor (beta)")),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Ha,null),C&&(0,o.createElement)(Mt.ShortcutProvider,null,(0,o.createElement)(u.EntityProvider,{kind:"root",type:"site"},(0,o.createElement)(u.EntityProvider,{kind:"postType",type:s,id:i},(0,o.createElement)(ll,null,(0,o.createElement)(Pt.BlockContextProvider,{value:T},(0,o.createElement)(tl,null),(0,o.createElement)(Ya,{onError:t},(0,o.createElement)(Ua.Register,null),(0,o.createElement)(na,null),(0,o.createElement)(Se,{labels:il,secondarySidebar:n?(0,o.createElement)(Wa,null):r?(0,o.createElement)(ja,null):null,sidebar:a&&(0,o.createElement)(ve.Slot,{scope:"core/edit-site"}),drawer:(0,o.createElement)(ba.Slot,null),header:(0,o.createElement)(Sn,{openEntitiesSavedStates:k}),notices:(0,o.createElement)(m.EditorSnackbars,null),content:(0,o.createElement)(o.Fragment,null,(0,o.createElement)(m.EditorNotices,null),_&&(0,o.createElement)(za,{setIsInserterOpen:y}),g&&!_&&(null==l?void 0:l.siteUrl)&&i&&(0,o.createElement)(D.Notice,{status:"warning",isDismissible:!1},(0,d.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")),(0,o.createElement)(Ua,{openEntitiesSavedStates:k})),actions:(0,o.createElement)(o.Fragment,null,w?(0,o.createElement)(m.EntitiesSavedStates,{close:x}):(0,o.createElement)("div",{className:"edit-site-editor__toggle-save-panel"},(0,o.createElement)(D.Button,{variant:"secondary",className:"edit-site-editor__toggle-save-panel-button",onClick:k,"aria-expanded":!1},(0,d.__)("Open save panel")))),footer:(0,o.createElement)(Pt.BlockBreadcrumb,null),shortcuts:{previous:E,next:f}}),(0,o.createElement)(Ja,null),(0,o.createElement)(D.Popover.Slot,null),(0,o.createElement)(ie.PluginArea,null))))))))};const cl=["front-page","single-post","page","archive","search","404","index"];function ul(e){let{postType:t}=e;const n=Ct(),{templates:r,defaultTemplateTypes:a}=(0,c.useSelect)((e=>({templates:e(u.store).getEntityRecords("postType","wp_template",{per_page:-1}),defaultTemplateTypes:e(m.store).__experimentalGetDefaultTemplateTypes()})),[]),{saveEntityRecord:l}=(0,c.useDispatch)(u.store),{createErrorNotice:i}=(0,c.useDispatch)(A.store),{getLastEntitySaveError:s}=(0,c.useSelect)(u.store);const p=(0,U.map)(r,"slug"),_=(0,U.filter)(a,(e=>(0,U.includes)(cl,e.slug)&&!(0,U.includes)(p,e.slug)));return _.length?(0,o.createElement)(D.DropdownMenu,{className:"edit-site-new-template-dropdown",icon:null,text:t.labels.add_new,label:t.labels.add_new_item,popoverProps:{noArrow:!1},toggleProps:{variant:"primary"}},(()=>(0,o.createElement)(D.NavigableMenu,{className:"edit-site-new-template-dropdown__popover"},(0,o.createElement)(D.MenuGroup,{label:t.labels.add_new_item},(0,U.map)(_,(e=>{let{title:t,description:r,slug:c}=e;return(0,o.createElement)(D.MenuItem,{info:r,key:c,onClick:()=>{!async function(e){let{slug:t}=e;try{const{title:e,description:r}=(0,U.find)(a,{slug:t}),o=await l("postType","wp_template",{excerpt:r,slug:t.toString(),status:"publish",title:e}),i=s("postType","wp_template",o.id);if(i)throw i;n.push({postId:o.id,postType:o.type})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,d.__)("An error occurred while creating the template.");i(t,{type:"snackbar"})}}({slug:c})}},t)})))))):null}function ml(e){let{postType:t}=e;const n=Ct(),[r,a]=(0,o.useState)(!1),{createErrorNotice:l}=(0,c.useDispatch)(A.store),{saveEntityRecord:i}=(0,c.useDispatch)(u.store),{getLastEntitySaveError:s}=(0,c.useSelect)(u.store);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(D.Button,{variant:"primary",onClick:()=>{a(!0)}},t.labels.add_new),r&&(0,o.createElement)(ka,{closeModal:()=>a(!1),onCreate:async function(e){let{title:t,area:r}=e;if(t)try{const e=(0,U.kebabCase)(t).replace(/[^\w-]+/g,"")||"wp-custom-part",l=await i("postType","wp_template_part",{slug:e,title:t,content:"",area:r}),o=s("postType","wp_template_part",l.id);if(o)throw o;a(!1),n.push({postId:l.id,postType:l.type})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,d.__)("An error occurred while creating the template part.");l(t,{type:"snackbar"}),a(!1)}else l((0,d.__)("Title is not defined."),{type:"snackbar"})}}))}function dl(e){let{templateType:t="wp_template"}=e;const n=(0,c.useSelect)((e=>e(u.store).getPostType(t)),[t]);return n?"wp_template"===t?(0,o.createElement)(ul,{postType:n}):"wp_template_part"===t?(0,o.createElement)(ml,{postType:n}):null:null}function pl(e){var t;let{templateType:n}=e;const r=(0,c.useSelect)((e=>e(u.store).getPostType(n)),[n]);return r?(0,o.createElement)("header",{className:"edit-site-list-header"},(0,o.createElement)(D.__experimentalHeading,{level:1,className:"edit-site-list-header__title"},null===(t=r.labels)||void 0===t?void 0:t.name),(0,o.createElement)("div",{className:"edit-site-list-header__right"},(0,o.createElement)(dl,{templateType:n}))):null}function _l(e){let{template:t,onClose:n}=e;const[r,a]=(0,o.useState)((()=>t.title.rendered)),[l,i]=(0,o.useState)(!1),{getLastEntitySaveError:s}=(0,c.useSelect)(u.store),{editEntityRecord:m,saveEditedEntityRecord:p}=(0,c.useDispatch)(u.store),{createSuccessNotice:_,createErrorNotice:g}=(0,c.useDispatch)(A.store);if(!t.is_custom)return null;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(D.MenuItem,{onClick:()=>{i(!0),a(t.title.rendered)}},(0,d.__)("Rename")),l&&(0,o.createElement)(D.Modal,{title:(0,d.__)("Rename template"),closeLabel:(0,d.__)("Close"),onRequestClose:()=>{i(!1)},overlayClassName:"edit-site-list__rename-modal"},(0,o.createElement)("form",{onSubmit:async function(e){e.preventDefault();try{await m("postType",t.type,t.id,{title:r}),a(""),i(!1),n(),await p("postType",t.type,t.id);const e=s("postType",t.type,t.id);if(e)throw e;_((0,d.__)("Template has been renamed."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,d.__)("An error occurred while renaming the template.");g(t,{type:"snackbar"})}}},(0,o.createElement)(D.Flex,{align:"flex-start",gap:8},(0,o.createElement)(D.FlexItem,null,(0,o.createElement)(D.TextControl,{label:(0,d.__)("Name"),value:r,onChange:a,required:!0}))),(0,o.createElement)(D.Flex,{className:"edit-site-list__rename-modal-actions",justify:"flex-end",expanded:!1},(0,o.createElement)(D.FlexItem,null,(0,o.createElement)(D.Button,{variant:"tertiary",onClick:()=>{i(!1)}},(0,d.__)("Cancel"))),(0,o.createElement)(D.FlexItem,null,(0,o.createElement)(D.Button,{variant:"primary",type:"submit"},(0,d.__)("Save")))))))}function gl(e){let{template:t}=e;const{removeTemplate:n,revertTemplate:r}=(0,c.useDispatch)(mt),{saveEditedEntityRecord:a}=(0,c.useDispatch)(u.store),{createSuccessNotice:l,createErrorNotice:i}=(0,c.useDispatch)(A.store),s=function(e){return!!e&&"custom"===e.source&&!e.has_theme_file}(t),m=ke(t);if(!s&&!m)return null;return(0,o.createElement)(D.DropdownMenu,{icon:Bt,label:(0,d.__)("Actions"),className:"edit-site-list-table__actions"},(e=>{let{onClose:c}=e;return(0,o.createElement)(D.MenuGroup,null,s&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(_l,{template:t,onClose:c}),(0,o.createElement)(D.MenuItem,{isDestructive:!0,onClick:()=>{n(t),c()}},(0,d.__)("Delete template"))),m&&(0,o.createElement)(D.MenuItem,{info:(0,d.__)("Restore template to default state"),onClick:()=>{!async function(){try{await r(t,{allowUndo:!1}),await a("postType",t.type,t.id),l((0,d.__)("Template reverted."),{type:"snackbar"})}catch(e){const t=e.message&&"unknown_error"!==e.code?e.message:(0,d.__)("An error occurred while reverting the template.");i(t,{type:"snackbar"})}}(),c()}},(0,d.__)("Clear customizations")))}))}var hl=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"}));var El=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.Path,{d:"M7.25 16.4371C6.16445 15.2755 5.5 13.7153 5.5 12C5.5 8.41015 8.41015 5.5 12 5.5C15.5899 5.5 18.5 8.41015 18.5 12C18.5 13.7153 17.8356 15.2755 16.75 16.4371V16C16.75 14.4812 15.5188 13.25 14 13.25L10 13.25C8.48122 13.25 7.25 14.4812 7.25 16V16.4371ZM8.75 17.6304C9.70606 18.1835 10.8161 18.5 12 18.5C13.1839 18.5 14.2939 18.1835 15.25 17.6304V16C15.25 15.3096 14.6904 14.75 14 14.75L10 14.75C9.30964 14.75 8.75 15.3096 8.75 16V17.6304ZM4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12ZM14 10C14 11.1046 13.1046 12 12 12C10.8954 12 10 11.1046 10 10C10 8.89543 10.8954 8 12 8C13.1046 8 14 8.89543 14 10Z",fillRule:"evenodd",clipRule:"evenodd",fill:"black"}));var fl=(0,o.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,o.createElement)(O.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"}));const vl=["wp_template","wp_template_part"];function yl(e){let{isCustomized:t,children:n}=e;return t?(0,o.createElement)(D.Tooltip,{text:(0,d.__)("This template has been customized")},n):n}function bl(e){let{text:t,icon:n,imageUrl:r,isCustomized:a}=e;const[l,i]=(0,o.useState)(!1);return(0,o.createElement)(D.__experimentalHStack,{alignment:"left"},(0,o.createElement)(yl,{isCustomized:a},r?(0,o.createElement)("div",{className:B()("edit-site-list-added-by__avatar",{"is-loaded":l})},(0,o.createElement)("img",{onLoad:()=>i(!0),alt:"",src:r})):(0,o.createElement)("div",{className:B()("edit-site-list-added-by__icon",{"is-customized":a})},(0,o.createElement)(D.Icon,{icon:n}))),(0,o.createElement)("span",null,t))}function wl(e){var t;let{slug:n,isCustomized:r}=e;const a=(0,c.useSelect)((e=>e(u.store).getTheme(n)),[n]);return(0,o.createElement)(bl,{icon:qn,text:(null==a||null===(t=a.name)||void 0===t?void 0:t.rendered)||n,isCustomized:r})}function Sl(e){let{slug:t,isCustomized:n}=e;const r=(0,c.useSelect)((e=>e(u.store).getPlugin(t)),[t]);return(0,o.createElement)(bl,{icon:hl,text:(null==r?void 0:r.name)||t,isCustomized:n})}function kl(e){var t;let{id:n}=e;const r=(0,c.useSelect)((e=>e(u.store).getUser(n)),[n]);return(0,o.createElement)(bl,{icon:El,imageUrl:null==r||null===(t=r.avatar_urls)||void 0===t?void 0:t[48],text:null==r?void 0:r.nickname})}function xl(){const{name:e,logoURL:t}=(0,c.useSelect)((e=>{var t;const{getEntityRecord:n,getMedia:r}=e(u.store),a=n("root","__unstableBase");return{name:null==a?void 0:a.name,logoURL:null!=a&&a.site_logo?null===(t=r(a.site_logo))||void 0===t?void 0:t.source_url:void 0}}),[]);return(0,o.createElement)(bl,{icon:fl,imageUrl:t,text:e})}function Tl(e){let{templateType:t,template:n}=e;if(n){if(vl.includes(t)){if(n.has_theme_file&&("theme"===n.origin||!n.origin&&["theme","custom"].includes(n.source)))return(0,o.createElement)(wl,{slug:n.theme,isCustomized:"custom"===n.source});if(n.has_theme_file&&"plugin"===n.origin)return(0,o.createElement)(Sl,{slug:n.theme,isCustomized:"custom"===n.source});if(!n.has_theme_file&&"custom"===n.source&&!n.author)return(0,o.createElement)(xl,null)}return(0,o.createElement)(kl,{id:n.author})}}function Cl(e){let{templateType:t}=e;const{templates:n,isLoading:r,postType:a}=(0,c.useSelect)((e=>{const{getEntityRecords:n,hasFinishedResolution:r,getPostType:a}=e(u.store);return{templates:n("postType",t,{per_page:-1}),isLoading:!r("getEntityRecords",["postType",t,{per_page:-1}]),postType:a(t)}}),[t]);return!n||r?null:n.length?(0,o.createElement)("table",{className:"edit-site-list-table",role:"table"},(0,o.createElement)("thead",null,(0,o.createElement)("tr",{className:"edit-site-list-table-head",role:"row"},(0,o.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,d.__)("Template")),(0,o.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,d.__)("Added by")),(0,o.createElement)("th",{className:"edit-site-list-table-column",role:"columnheader"},(0,o.createElement)(D.VisuallyHidden,null,(0,d.__)("Actions"))))),(0,o.createElement)("tbody",null,n.map((e=>{var n;return(0,o.createElement)("tr",{key:e.id,className:"edit-site-list-table-row",role:"row"},(0,o.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,o.createElement)(D.__experimentalHeading,{level:4},(0,o.createElement)(hn,{params:{postId:e.id,postType:e.type}},(null===(n=e.title)||void 0===n?void 0:n.rendered)||e.slug)),e.description),(0,o.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,o.createElement)(Tl,{templateType:t,template:e})),(0,o.createElement)("td",{className:"edit-site-list-table-column",role:"cell"},(0,o.createElement)(gl,{template:e})))})))):(0,o.createElement)("div",null,(0,d.sprintf)((0,d.__)("No %s found."),null==a||null===(l=a.labels)||void 0===l||null===(i=l.name)||void 0===i?void 0:i.toLowerCase()));var l,i}function Nl(){var e,t;const{params:{postType:n}}=Tt();!function(){const{registerShortcut:e}=(0,c.useDispatch)(Mt.store);(0,o.useEffect)((()=>{e({name:"core/edit-site/next-region",category:"global",description:(0,d.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-site/previous-region",category:"global",description:(0,d.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"}]})}),[])}();const{previousShortcut:r,nextShortcut:a,isNavigationOpen:l}=(0,c.useSelect)((e=>({previousShortcut:e(Mt.store).getAllShortcutKeyCombinations("core/edit-site/previous-region"),nextShortcut:e(Mt.store).getAllShortcutKeyCombinations("core/edit-site/next-region"),isNavigationOpen:e(mt).isNavigationOpened()})),[]),i=(0,c.useSelect)((e=>e(u.store).getPostType(n)),[n]);ol(null==i||null===(e=i.labels)||void 0===e?void 0:e.name);const s=null==i||null===(t=i.labels)||void 0===t?void 0:t.items_list,p=i?{header:(0,d.sprintf)((0,d.__)("%s - Header"),s),body:(0,d.sprintf)((0,d.__)("%s - Content"),s)}:void 0;return(0,o.createElement)(Se,{className:B()("edit-site-list",{"is-navigation-open":l}),labels:{drawer:(0,d.__)("Navigation Sidebar"),...p},header:(0,o.createElement)(pl,{templateType:n}),drawer:(0,o.createElement)(ba.Slot,null),notices:(0,o.createElement)(m.EditorSnackbars,null),content:(0,o.createElement)(Cl,{templateType:n}),shortcuts:{previous:r,next:a}})}function Il(e){let{postId:t,postType:n}=e;return!(t||!n)}function Pl(e){let{reboot:t}=e;return(0,o.createElement)(D.SlotFillProvider,null,(0,o.createElement)(m.UnsavedChangesWarning,null),(0,o.createElement)(It,null,(e=>{let{params:n}=e;const r=Il(n);return(0,o.createElement)(o.Fragment,null,r?(0,o.createElement)(Nl,null):(0,o.createElement)(sl,{onError:t}),(0,o.createElement)(ba,{isDefaultOpen:!!r,activeTemplateType:r?n.postType:void 0}))})))}async function Ml(e){const t=new URLSearchParams(St.location.search);if(function(e){const{postType:t}=e;return!Il(e)&&!["post","page","wp_template","wp_template_part"].includes(t)}(Object.fromEntries(t.entries()))){const t=await async function(e){const t=await Jt()({path:"/wp/v2/settings"});if(!t)throw new Error("`getHomepageParams`: unable to load site settings.");const{show_on_front:n,page_on_front:r}=t;if("page"===n)return{postType:"page",postId:r};const a=await window.fetch((0,_.addQueryArgs)(e,{"_wp-find-template":!0})).then((e=>{if(!e.ok)throw new Error(`\`getHomepageParams\`: HTTP status error, ${e.status} ${e.statusText}`);return e.json()})).then((e=>{let{data:t}=e;if(t.message)throw new Error(`\`getHomepageParams\`: REST API error, ${t.message}`);return t}));if(null==a||!a.id)throw new Error("`getHomepageParams`: unable to find home template.");return{postType:"wp_template",postId:a.id}}(e);t&&St.replace(t)}}function Al(e){let{className:t,...n}=e;return(0,o.createElement)(ve,R({panelClassName:t,className:"edit-site-sidebar",scope:"core/edit-site"},n))}function Rl(e){return(0,o.createElement)(_e,R({__unstableExplicitMenuItem:!0,scope:"core/edit-site"},e))}var Ll=(0,ye.compose)((0,ie.withPluginContext)(((e,t)=>({icon:t.icon||e.icon,name:"core/edit-site/plugin-more-menu"}))))(de);async function Bl(e,t){try{await Ml(t.siteUrl)}catch(t){return void(0,o.render)((0,o.createElement)(Ka,{message:(0,d.__)("The editor is unable to find a block template for the homepage."),error:t,dashboardLink:"index.php"}),e)}(0,o.unmountComponentAtNode)(e);const n=Bl.bind(null,e,t);(0,c.dispatch)(mt).updateSettings(t),(0,c.dispatch)(m.store).updateEditorSettings({defaultTemplateTypes:t.defaultTemplateTypes,defaultTemplatePartAreas:t.defaultTemplatePartAreas});Il((0,_.getQueryArgs)(window.location.href))&&(0,c.dispatch)(mt).setIsNavigationPanelOpened((0,c.select)(p.store).isViewportMatch("medium"));(0,o.render)((0,o.createElement)(Pl,{reboot:n}),e)}function Dl(e,t){t.__experimentalFetchLinkSuggestions=(e,n)=>(0,u.__experimentalFetchLinkSuggestions)(e,n,t),t.__experimentalFetchRichUrlData=u.__experimentalFetchUrlData,t.__experimentalSpotlightEntityBlocks=["core/template-part"];const n=document.getElementById(e);(0,c.dispatch)(i.store).__experimentalReapplyBlockTypeFilters(),(0,s.registerCoreBlocks)(),Bl(n,t)}}(),(window.wp=window.wp||{}).editSite=r}();