WordPress/wp-includes/js/dist/edit-widgets.min.js
noisysocks 121c824ccd Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- FSE: Add welcome guide
- Update theme styles for the code block
- Add feature flag to toggle the new site editor sidebar
- Add templates list page for site editor
- Cover Block: Fix default background dim
- E2E: Add more Cover block tests
- Cover Block: Fix regressions
- Post Comments Form: ensure typography styles are applied to child elements
- Navigation: Fix space-between
- Fix background colours in nested submenus.
- Fix duplicate custom classnames in navigation submenu block
- Fix colour rendering in Navigation overlay
- Fix: Add ability to opt out of Core color palette V2
- Change @package to WordPress in block-library
- Make the core color palette opt-in for themes with not theme.json
- Remove textdomain from calendar block
- Page List block: fix space before href attribute
- Try: Let Featured Image block inherit dimensions, look like a placeholder
- [Global Styles]: Add block icon next to blocks list
- Page List: Use core entities instead of direct apiFetch
- Site Editor: Stabilize export endpoint
- Fix mobile horizontal scrollbar.
- Multi-entity save: Only set site entity to pending if really saving
- Add page list to navigation direct insert conditions
- Implement "Add New" for templates list in Site Editor
- Post Featured Image: Remove withNotices HOC
- Fix page list missing button styles when set to open on click.
- Make appender fixed position to avoid jumps in the UI
- Color UI component: reorder palettes and update names (core by defaults, user by custom)
- Remove the Styles link in Site Editor
- GlobalStyles sidebar: do not show default palette if theme opts-out
- Only render the site editor canvas when the global styles are ready.
- Global Styles: rename core origin key to default for presets
- Clarify i18n context for PostTemplateActions's "New" label
- Revert erroneous native editor package version bumps
- Try: Hide the columns inserter in pattern previews.
- Fix site editor region navigation
- Update navigation sidebar responsiveness
- Add _wp_array_set and _wp_to_kebab_case to 5.8 compat
- Make user able to change all color palette origins
- Site Editor: Update hrefs to not specifically refer to themes.php?page=gutenberg-edit-site
- Site Editor: Validate the postType query argument
- Navigation: Scale submenu icon.
- Move the theme editor under tools for FSE themes
- Deprecate navigation areas

See #54487.

Built from https://develop.svn.wordpress.org/trunk@52232


git-svn-id: http://core.svn.wordpress.org/trunk@51824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-23 05:40:38 +00:00

7 lines
62 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 */
this.wp=this.wp||{},this.wp.editWidgets=function(e){var t={};function r(n){if(t[n])return t[n].exports;var c=t[n]={i:n,l:!1,exports:{}};return e[n].call(c.exports,c,c.exports,r),c.l=!0,c.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)r.d(n,c,function(t){return e[t]}.bind(null,c));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s="F35A")}({"//Lo":function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"}));t.a=i},"1CF3":function(e,t){e.exports=window.wp.dom},"1ZqX":function(e,t){e.exports=window.wp.data},"6aBm":function(e,t){e.exports=window.wp.mediaUtils},Cg8A:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.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"}));t.a=i},F35A:function(e,t,r){"use strict";r.r(t),r.d(t,"reinitializeEditor",(function(){return bt})),r.d(t,"initialize",(function(){return mt}));var n={};r.r(n),r.d(n,"persistStubPost",(function(){return k})),r.d(n,"saveEditedWidgetAreas",(function(){return S})),r.d(n,"saveWidgetAreas",(function(){return I})),r.d(n,"saveWidgetArea",(function(){return A})),r.d(n,"setWidgetIdForClientId",(function(){return T})),r.d(n,"setWidgetAreasOpenState",(function(){return B})),r.d(n,"setIsWidgetAreaOpen",(function(){return N})),r.d(n,"setIsInserterOpened",(function(){return C})),r.d(n,"setIsListViewOpened",(function(){return L})),r.d(n,"closeGeneralSidebar",(function(){return W})),r.d(n,"moveBlockToWidgetArea",(function(){return R}));var c={};r.r(c),r.d(c,"getWidgetAreas",(function(){return P})),r.d(c,"getWidgets",(function(){return F}));var i={};r.r(i),r.d(i,"getWidgets",(function(){return D})),r.d(i,"getWidget",(function(){return V})),r.d(i,"getWidgetAreas",(function(){return G})),r.d(i,"getWidgetAreaForWidgetId",(function(){return U})),r.d(i,"getParentWidgetAreaBlock",(function(){return z})),r.d(i,"getEditedWidgetAreas",(function(){return H})),r.d(i,"getReferenceWidgetBlocks",(function(){return q})),r.d(i,"isSavingWidgetAreas",(function(){return K})),r.d(i,"getIsWidgetAreaOpen",(function(){return Y})),r.d(i,"isInserterOpened",(function(){return Q})),r.d(i,"__experimentalGetInsertionPoint",(function(){return X})),r.d(i,"canInsertBlockInWidgetArea",(function(){return Z})),r.d(i,"isListViewOpened",(function(){return $}));var a={};r.r(a),r.d(a,"metadata",(function(){return ue})),r.d(a,"name",(function(){return be})),r.d(a,"settings",(function(){return me}));var o=r("GRId"),s=r("HSyU"),l=r("1ZqX"),d=r("QyPg"),u=r("jZUy"),b=r("GLVC"),m=r("U60i"),g=r("ywyh"),p=r.n(g);var O=Object(l.combineReducers)({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"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"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e},widgetAreasOpenState:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;const{type:r}=t;switch(r){case"SET_WIDGET_AREAS_OPEN_STATE":return t.widgetAreasOpenState;case"SET_IS_WIDGET_AREA_OPEN":{const{clientId:r,isOpen:n}=t;return{...e,[r]:n}}default:return e}}}),j=r("l3Sj"),f=r("onLe"),_=r("axFQ");function h(e){if("block"===e.id_base){const t=Object(s.parse)(e.instance.raw.content);return t.length?Object(b.addWidgetIdToBlock)(t[0],e.id):Object(b.addWidgetIdToBlock)(Object(s.createBlock)("core/paragraph",{},[]),e.id)}let t;return t=e._embedded.about[0].is_multi?{idBase:e.id_base,instance:e.instance}:{id:e.id},Object(b.addWidgetIdToBlock)(Object(s.createBlock)("core/legacy-widget",t,[]),e.id)}function w(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n="core/legacy-widget"===e.name&&(e.attributes.id||e.attributes.instance);var c,i,a;n?t={...r,id:null!==(c=e.attributes.id)&&void 0!==c?c:r.id,id_base:null!==(i=e.attributes.idBase)&&void 0!==i?i:r.id_base,instance:null!==(a=e.attributes.instance)&&void 0!==a?a:r.instance}:t={...r,id_base:"block",instance:{raw:{content:Object(s.serialize)(e)}}};return delete t.rendered,delete t.rendered_form,t}const E="root",v=e=>"widget-area-"+e;const y="core/edit-widgets",k=(e,t)=>r=>{let{registry:n}=r;const c=((e,t)=>({id:e,slug:e,status:"draft",type:"page",blocks:t,meta:{widgetAreaId:e}}))(e,t);return n.dispatch(u.store).receiveEntityRecords(E,"postType",c,{id:c.id},!1),c},S=()=>async e=>{let{select:t,dispatch:r,registry:n}=e;const c=t.getEditedWidgetAreas();if(null!=c&&c.length)try{await r.saveWidgetAreas(c),n.dispatch(f.store).createSuccessNotice(Object(j.__)("Widgets saved."),{type:"snackbar"})}catch(e){n.dispatch(f.store).createErrorNotice(Object(j.sprintf)(Object(j.__)("There was an error. %s"),e.message),{type:"snackbar"})}},I=e=>async t=>{let{dispatch:r,registry:n}=t;try{for(const t of e)await r.saveWidgetArea(t.id)}finally{await n.dispatch(u.store).finishResolution("getEntityRecord",E,"sidebar",{per_page:-1})}},A=e=>async t=>{let{dispatch:r,select:n,registry:c}=t;const i=n.getWidgets(),a=c.select(u.store).getEditedEntityRecord(E,"postType",v(e)),o=Object.values(i).filter(t=>{let{sidebar:r}=t;return r===e}),s=[],l=a.blocks.filter(e=>{const{id:t}=e.attributes;if("core/legacy-widget"===e.name&&t){if(s.includes(t))return!1;s.push(t)}return!0}),d=[];for(const e of o){n.getWidgetAreaForWidgetId(e.id)||d.push(e)}const m=[],g=[],p=[];for(let t=0;t<l.length;t++){const r=l[t],n=Object(b.getWidgetIdFromBlock)(r),a=i[n],o=w(r,a);if(p.push(n),a){c.dispatch(u.store).editEntityRecord("root","widget",n,{...o,sidebar:e},{undoIgnore:!0});if(!c.select(u.store).hasEditsForEntityRecord("root","widget",n))continue;g.push(e=>{let{saveEditedEntityRecord:t}=e;return t("root","widget",n)})}else g.push(t=>{let{saveEntityRecord:r}=t;return r("root","widget",{...o,sidebar:e})});m.push({block:r,position:t,clientId:r.clientId})}for(const e of d)g.push(t=>{let{deleteEntityRecord:r}=t;return r("root","widget",e.id,{force:!0})});const O=(await c.dispatch(u.store).__experimentalBatch(g)).filter(e=>!e.hasOwnProperty("deleted")),f=[];for(let e=0;e<O.length;e++){const t=O[e],{block:r,position:n}=m[e];a.blocks[n].attributes.__internalWidgetId=t.id;var _;if(c.select(u.store).getLastEntitySaveError("root","widget",t.id))f.push((null===(_=r.attributes)||void 0===_?void 0:_.name)||(null==r?void 0:r.name));p[n]||(p[n]=t.id)}if(f.length)throw new Error(Object(j.sprintf)(Object(j.__)("Could not save the following widgets: %s."),f.join(", ")));c.dispatch(u.store).editEntityRecord(E,"sidebar",e,{widgets:p},{undoIgnore:!0}),r(x(e)),c.dispatch(u.store).receiveEntityRecords(E,"postType",a,void 0)},x=e=>t=>{let{registry:r}=t;const n=r.select(u.store).getLastEntitySaveError(E,"sidebar",e);r.dispatch(u.store).saveEditedEntityRecord(E,"sidebar",e);const c=r.select(u.store).getLastEntitySaveError(E,"sidebar",e);if(c&&n!==c)throw new Error(c)};function T(e,t){return{type:"SET_WIDGET_ID_FOR_CLIENT_ID",clientId:e,widgetId:t}}function B(e){return{type:"SET_WIDGET_AREAS_OPEN_STATE",widgetAreasOpenState:e}}function N(e,t){return{type:"SET_IS_WIDGET_AREA_OPEN",clientId:e,isOpen:t}}function C(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function L(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const W=()=>e=>{let{registry:t}=e;t.dispatch(m.i).disableComplementaryArea(y)},R=(e,t)=>async r=>{let{dispatch:n,select:c,registry:i}=r;const a=i.select(_.store).getBlockRootClientId([e]),o=i.select(_.store).getBlocks().find(e=>{let{attributes:r}=e;return r.id===t}).clientId,s=i.select(_.store).getBlockOrder(o).length;c.getIsWidgetAreaOpen(o)||n.setIsWidgetAreaOpen(o,!0),i.dispatch(_.store).moveBlocksToPosition([e],a,o,s)},P=()=>async e=>{let{dispatch:t,registry:r}=e;const n={per_page:-1},c=[],i=(await r.resolveSelect(u.store).getEntityRecords(E,"sidebar",n)).sort((e,t)=>"wp_inactive_widgets"===e.id?1:"wp_inactive_widgets"===t.id?-1:0);for(const e of i)c.push(Object(s.createBlock)("core/widget-area",{id:e.id,name:e.name})),e.widgets.length||t(k(v(e.id),[]));const a={};c.forEach((e,t)=>{a[e.clientId]=0===t}),t(B(a)),t(k("widget-areas",c))},F=()=>async e=>{let{dispatch:t,registry:r}=e;const n={per_page:-1,_embed:"about"},c=await r.resolveSelect(u.store).getEntityRecords("root","widget",n),i={};for(const e of c){const t=h(e);i[e.sidebar]=i[e.sidebar]||[],i[e.sidebar].push(t)}for(const e in i)i.hasOwnProperty(e)&&t(k(v(e),i[e]))};var M=r("YLtl");const D=Object(l.createRegistrySelector)(e=>()=>{const t=e(u.store).getEntityRecords("root","widget",{per_page:-1,_embed:"about"});return Object(M.keyBy)(t,"id")}),V=Object(l.createRegistrySelector)(e=>(t,r)=>e(y).getWidgets()[r]),G=Object(l.createRegistrySelector)(e=>()=>{const t={per_page:-1};return e(u.store).getEntityRecords(E,"sidebar",t)}),U=Object(l.createRegistrySelector)(e=>(t,r)=>e(y).getWidgetAreas().find(t=>e(u.store).getEditedEntityRecord(E,"postType",v(t.id)).blocks.map(e=>Object(b.getWidgetIdFromBlock)(e)).includes(r))),z=Object(l.createRegistrySelector)(e=>(t,r)=>{const{getBlock:n,getBlockName:c,getBlockParents:i}=e(_.store);return n(i(r).find(e=>"core/widget-area"===c(e)))}),H=Object(l.createRegistrySelector)(e=>(t,r)=>{let n=e(y).getWidgetAreas();return n?(r&&(n=n.filter(e=>{let{id:t}=e;return r.includes(t)})),n.filter(t=>{let{id:r}=t;return e(u.store).hasEditsForEntityRecord(E,"postType",v(r))}).map(t=>{let{id:r}=t;return e(u.store).getEditedEntityRecord(E,"sidebar",r)})):[]}),q=Object(l.createRegistrySelector)(e=>function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=[],c=e(y).getWidgetAreas();for(const t of c){const c=e(u.store).getEditedEntityRecord(E,"postType",v(t.id));for(const e of c.blocks){var i;"core/legacy-widget"!==e.name||r&&(null===(i=e.attributes)||void 0===i?void 0:i.referenceWidgetName)!==r||n.push(e)}}return n}),K=Object(l.createRegistrySelector)(e=>()=>{var t;const r=null===(t=e(y).getWidgetAreas())||void 0===t?void 0:t.map(e=>{let{id:t}=e;return t});if(!r)return!1;for(const t of r){if(e(u.store).isSavingEntityRecord(E,"sidebar",t))return!0}const n=[...Object.keys(e(y).getWidgets()),void 0];for(const t of n){if(e(u.store).isSavingEntityRecord("root","widget",t))return!0}return!1}),Y=(e,t)=>{const{widgetAreasOpenState:r}=e;return!!r[t]};function Q(e){return!!e.blockInserterPanel}function X(e){const{rootClientId:t,insertionIndex:r}=e.blockInserterPanel;return{rootClientId:t,insertionIndex:r}}const Z=Object(l.createRegistrySelector)(e=>(t,r)=>{const n=e(_.store).getBlocks(),[c]=n;return e(_.store).canInsertBlockType(r,c.clientId)});function $(e){return e.listViewPanel}const J={reducer:O,selectors:i,resolvers:c,actions:n,__experimentalUseThunks:!0},ee=Object(l.createReduxStore)(y,J);Object(l.registerStore)(y,J),p.a.use((function(e,t){var r;return 0===(null===(r=e.path)||void 0===r?void 0:r.indexOf("/wp/v2/types/widget-area"))?Promise.resolve({}):t(e)}));var te=r("K9lf"),re=r("g56x");const ne=Object(te.createHigherOrderComponent)(e=>t=>{const{clientId:r,name:n}=t,{widgetAreas:c,currentWidgetAreaId:i,canInsertBlockInWidgetArea:a}=Object(l.useSelect)(e=>{var t;if("core/widget-area"===n)return{};const c=e(ee),i=c.getParentWidgetAreaBlock(r);return{widgetAreas:c.getWidgetAreas(),currentWidgetAreaId:null==i||null===(t=i.attributes)||void 0===t?void 0:t.id,canInsertBlockInWidgetArea:c.canInsertBlockInWidgetArea(n)}},[r,n]),{moveBlockToWidgetArea:s}=Object(l.useDispatch)(ee),d=(null==c?void 0:c.length)>1,u="core/widget-area"!==n&&d&&a;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(e,t),u&&Object(o.createElement)(_.BlockControls,null,Object(o.createElement)(b.MoveToWidgetArea,{widgetAreas:c,currentWidgetAreaId:i,onSelect:e=>{s(t.clientId,e)}})))},"withMoveToWidgetAreaToolbarItem");Object(re.addFilter)("editor.BlockEdit","core/edit-widgets/block-edit",ne);var ce=r("6aBm");Object(re.addFilter)("editor.MediaUpload","core/edit-widgets/replace-media-upload",()=>ce.MediaUpload);var ie=r("tI+e"),ae=r("TSYQ"),oe=r.n(ae);var se=e=>{const[t,r]=Object(o.useState)(!1);return Object(o.useEffect)(()=>{const{ownerDocument:t}=e.current;function n(e){i(e)}function c(){r(!1)}function i(t){e.current.contains(t.target)?r(!0):r(!1)}return t.addEventListener("dragstart",n),t.addEventListener("dragend",c),t.addEventListener("dragenter",i),()=>{t.removeEventListener("dragstart",n),t.removeEventListener("dragend",c),t.removeEventListener("dragenter",i)}},[]),t};function le(e){let{id:t}=e;const[r,n,c]=Object(u.useEntityBlockEditor)("root","postType"),i=Object(o.useRef)(),a=se(i),s=Object(_.useInnerBlocksProps)({ref:i},{value:r,onInput:n,onChange:c,templateLock:!1,renderAppender:_.InnerBlocks.ButtonBlockAppender});return Object(o.createElement)("div",{"data-widget-area-id":t,className:oe()("wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper",{"wp-block-widget-area__highlight-drop-zone":a})},Object(o.createElement)("div",s))}const de=e=>{const[t,r]=Object(o.useState)(!1);return Object(o.useEffect)(()=>{const{ownerDocument:t}=e.current;function n(){r(!0)}function c(){r(!1)}return t.addEventListener("dragstart",n),t.addEventListener("dragend",c),()=>{t.removeEventListener("dragstart",n),t.removeEventListener("dragend",c)}},[]),t},ue={name:"core/widget-area",category:"widgets",attributes:{id:{type:"string"},name:{type:"string"}},supports:{html:!1,inserter:!1,customClassName:!1,reusable:!1,__experimentalToolbar:!1,__experimentalParentSelector:!1},editorStyle:"wp-block-widget-area-editor",style:"wp-block-widget-area"},{name:be}=ue,me={title:Object(j.__)("Widget Area"),description:Object(j.__)("A widget area container."),__experimentalLabel:e=>{let{name:t}=e;return t},edit:function(e){let{clientId:t,className:r,attributes:{id:n,name:c}}=e;const i=Object(l.useSelect)(e=>e(ee).getIsWidgetAreaOpen(t),[t]),{setIsWidgetAreaOpen:a}=Object(l.useDispatch)(ee),s=Object(o.useRef)(),d=Object(o.useCallback)(e=>a(t,e),[t]),b=de(s),m=se(s),[g,p]=Object(o.useState)(!1);return Object(o.useEffect)(()=>{b?m&&!i?(d(!0),p(!0)):!m&&i&&g&&d(!1):p(!1)},[i,b,m,g]),Object(o.createElement)(ie.Panel,{className:r,ref:s},Object(o.createElement)(ie.PanelBody,{title:c,opened:i,onToggle:()=>{a(t,!i)},scrollAfterOpen:!b},e=>{let{opened:t}=e;return Object(o.createElement)(ie.__unstableDisclosureContent,{className:"wp-block-widget-area__panel-body-content",visible:t},Object(o.createElement)(u.EntityProvider,{kind:"root",type:"postType",id:"widget-area-"+n},Object(o.createElement)(le,{id:n})))}))}};var ge=r("TvNi");function pe(e){let{text:t,children:r}=e;const n=Object(te.useCopyToClipboard)(t);return Object(o.createElement)(ie.Button,{variant:"secondary",ref:n},r)}class Oe extends o.Component{constructor(){super(...arguments),this.reboot=this.reboot.bind(this),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}reboot(){this.props.onError()}render(){const{error:e}=this.state;return e?Object(o.createElement)(_.Warning,{className:"edit-widgets-error-boundary",actions:[Object(o.createElement)(ie.Button,{key:"recovery",onClick:this.reboot,variant:"secondary"},Object(j.__)("Attempt Recovery")),Object(o.createElement)(pe,{key:"copy-error",text:e.stack},Object(j.__)("Copy Error"))]},Object(j.__)("The editor has encountered an unexpected error.")):this.props.children}}var je=r("wx14"),fe=r("diJD"),_e=r("hF7m");function he(){const{redo:e,undo:t}=Object(l.useDispatch)(u.store),{saveEditedWidgetAreas:r}=Object(l.useDispatch)(ee);return Object(_e.useShortcut)("core/edit-widgets/undo",e=>{t(),e.preventDefault()}),Object(_e.useShortcut)("core/edit-widgets/redo",t=>{e(),t.preventDefault()}),Object(_e.useShortcut)("core/edit-widgets/save",e=>{e.preventDefault(),r()}),null}he.Register=function(){const{registerShortcut:e}=Object(l.useDispatch)(_e.store);return Object(o.useEffect)(()=>{e({name:"core/edit-widgets/undo",category:"global",description:Object(j.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/edit-widgets/redo",category:"global",description:Object(j.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}}),e({name:"core/edit-widgets/save",category:"global",description:Object(j.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/edit-widgets/keyboard-shortcuts",category:"main",description:Object(j.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/edit-widgets/next-region",category:"global",description:Object(j.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-widgets/previous-region",category:"global",description:Object(j.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"}]})},[e]),null};var we=he;var Ee=()=>Object(l.useSelect)(e=>{var t;const{getBlockSelectionEnd:r,getBlockName:n}=e(_.store),c=r();if("core/widget-area"===n(c))return c;const{getParentWidgetAreaBlock:i}=e(ee),a=i(c),o=null==a?void 0:a.clientId;if(o)return o;const{getEntityRecord:s}=e(u.store),l=s(E,"postType","widget-areas");return null==l||null===(t=l.blocks[0])||void 0===t?void 0:t.clientId},[]);function ve(e){let{blockEditorSettings:t,children:r,...n}=e;const{hasUploadPermissions:c,reusableBlocks:i,isFixedToolbarActive:a,keepCaretInsideBlock:s}=Object(l.useSelect)(e=>({hasUploadPermissions:Object(M.defaultTo)(e(u.store).canUser("create","media"),!0),widgetAreas:e(ee).getWidgetAreas(),widgets:e(ee).getWidgets(),reusableBlocks:[],isFixedToolbarActive:e(m.i).isFeatureActive("core/edit-widgets","fixedToolbar"),keepCaretInsideBlock:e(m.i).isFeatureActive("core/edit-widgets","keepCaretInsideBlock")}),[]),{setIsInserterOpened:d}=Object(l.useDispatch)(ee),b=Object(o.useMemo)(()=>{let e;return c&&(e=e=>{let{onError:r,...n}=e;Object(ce.uploadMedia)({wpAllowedMimeTypes:t.allowedMimeTypes,onError:e=>{let{message:t}=e;return r(t)},...n})}),{...t,__experimentalReusableBlocks:i,hasFixedToolbar:a,keepCaretInsideBlock:s,mediaUpload:e,templateLock:"all",__experimentalSetIsInserterOpened:d}},[t,a,s,c,i,d]),g=Ee(),[p,O,j]=Object(u.useEntityBlockEditor)(E,"postType",{id:"widget-areas"});return Object(o.createElement)(_e.ShortcutProvider,null,Object(o.createElement)(_.BlockEditorKeyboardShortcuts.Register,null),Object(o.createElement)(we.Register,null),Object(o.createElement)(ie.SlotFillProvider,null,Object(o.createElement)(_.BlockEditorProvider,Object(je.a)({value:p,onInput:O,onChange:j,settings:b,useSubRegistry:!1},n),Object(o.createElement)(_.CopyHandler,null,r),Object(o.createElement)(fe.ReusableBlocksMenuItems,{rootClientId:g}))))}var ye=r("Cg8A"),ke=r("//Lo"),Se=r("Mmq9"),Ie=r("1CF3");function Ae(e){let{selectedWidgetAreaId:t}=e;const r=Object(l.useSelect)(e=>e(ee).getWidgetAreas(),[]),n=Object(o.useMemo)(()=>t&&(null==r?void 0:r.find(e=>e.id===t)),[t,r]);let c;return c=n?"wp_inactive_widgets"===t?Object(j.__)("Blocks in this Widget Area will not be displayed in your site."):n.description:Object(j.__)("Widget Areas are global parts in your sites layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer."),Object(o.createElement)("div",{className:"edit-widgets-widget-areas"},Object(o.createElement)("div",{className:"edit-widgets-widget-areas__top-container"},Object(o.createElement)(_.BlockIcon,{icon:ke.a}),Object(o.createElement)("div",null,Object(o.createElement)("p",{dangerouslySetInnerHTML:{__html:Object(Ie.safeHTML)(c)}}),0===(null==r?void 0:r.length)&&Object(o.createElement)("p",null,Object(j.__)("Your theme does not contain any Widget Areas.")),!n&&Object(o.createElement)(ie.Button,{href:Object(Se.addQueryArgs)("customize.php",{"autofocus[panel]":"widgets",return:window.location.pathname}),variant:"tertiary"},Object(j.__)("Manage with live preview")))))}const xe=o.Platform.select({web:!0,native:!1});function Te(e){let{identifier:t,label:r,isActive:n}=e;const{enableComplementaryArea:c}=Object(l.useDispatch)(m.i);return Object(o.createElement)(ie.Button,{onClick:()=>c(ee.name,t),className:oe()("edit-widgets-sidebar__panel-tab",{"is-active":n}),"aria-label":n?Object(j.sprintf)(Object(j.__)("%s (selected)"),r):r,"data-label":r},r)}function Be(){const{enableComplementaryArea:e}=Object(l.useDispatch)(m.i),{currentArea:t,hasSelectedNonAreaBlock:r,isGeneralSidebarOpen:n,selectedWidgetAreaBlock:c}=Object(l.useSelect)(e=>{const{getSelectedBlock:t,getBlock:r,getBlockParentsByBlockName:n}=e(_.store),{getActiveComplementaryArea:c}=e(m.i),i=t(),a=c(ee.name);let o,s=a;return s||(s=i?"edit-widgets/block-inspector":"edit-widgets/block-areas"),i&&(o="core/widget-area"===i.name?i:r(n(i.clientId,"core/widget-area")[0])),{currentArea:s,hasSelectedNonAreaBlock:!(!i||"core/widget-area"===i.name),isGeneralSidebarOpen:!!a,selectedWidgetAreaBlock:o}},[]);return Object(o.useEffect)(()=>{r&&"edit-widgets/block-areas"===t&&n&&e("core/edit-widgets","edit-widgets/block-inspector"),!r&&"edit-widgets/block-inspector"===t&&n&&e("core/edit-widgets","edit-widgets/block-areas")},[r,e]),Object(o.createElement)(m.b,{className:"edit-widgets-sidebar",header:Object(o.createElement)("ul",null,Object(o.createElement)("li",null,Object(o.createElement)(Te,{identifier:"edit-widgets/block-areas",label:c?c.attributes.name:Object(j.__)("Widget Areas"),isActive:"edit-widgets/block-areas"===t})),Object(o.createElement)("li",null,Object(o.createElement)(Te,{identifier:"edit-widgets/block-inspector",label:Object(j.__)("Block"),isActive:"edit-widgets/block-inspector"===t}))),headerClassName:"edit-widgets-sidebar__panel-tabs",title:Object(j.__)("Settings"),closeLabel:Object(j.__)("Close settings"),scope:"core/edit-widgets",identifier:t,icon:ye.a,isActiveByDefault:xe},"edit-widgets/block-areas"===t&&Object(o.createElement)(Ae,{selectedWidgetAreaId:null==c?void 0:c.attributes.id}),"edit-widgets/block-inspector"===t&&(r?Object(o.createElement)(_.BlockInspector,null):Object(o.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},Object(j.__)("No block selected."))))}var Ne=r("Q4Sy"),Ce=r("OzlF");var Le=function(){const{hasEditedWidgetAreaIds:e,isSaving:t}=Object(l.useSelect)(e=>{var t;const{getEditedWidgetAreas:r,isSavingWidgetAreas:n}=e(ee);return{hasEditedWidgetAreaIds:(null===(t=r())||void 0===t?void 0:t.length)>0,isSaving:n()}},[]),{saveEditedWidgetAreas:r}=Object(l.useDispatch)(ee);return Object(o.createElement)(ie.Button,{variant:"primary",isBusy:t,"aria-disabled":t,onClick:t?void 0:r,disabled:!e},t?Object(j.__)("Saving…"):Object(j.__)("Update"))},We=r("Ntru"),Re=r("K2cm"),Pe=r("RxS6");function Fe(){const e=Object(l.useSelect)(e=>e(u.store).hasUndo(),[]),{undo:t}=Object(l.useDispatch)(u.store);return Object(o.createElement)(ie.ToolbarButton,{icon:Object(j.isRTL)()?Re.a:We.a,label:Object(j.__)("Undo"),shortcut:Pe.displayShortcut.primary("z"),"aria-disabled":!e,onClick:e?t:void 0})}function Me(){const e=Object(l.useSelect)(e=>e(u.store).hasRedo(),[]),{redo:t}=Object(l.useDispatch)(u.store);return Object(o.createElement)(ie.ToolbarButton,{icon:Object(j.isRTL)()?We.a:Re.a,label:Object(j.__)("Redo"),shortcut:Pe.displayShortcut.primaryShift("z"),"aria-disabled":!e,onClick:e?t:void 0})}var De=r("K+tz");const Ve=[{keyCombination:{modifier:"primary",character:"b"},description:Object(j.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:Object(j.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:Object(j.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:Object(j.__)("Remove a link.")},{keyCombination:{modifier:"primary",character:"u"},description:Object(j.__)("Underline the selected text.")}];function Ge(e){let{keyCombination:t,forceAriaLabel:r}=e;const n=t.modifier?Pe.displayShortcutList[t.modifier](t.character):t.character,c=t.modifier?Pe.shortcutAriaLabel[t.modifier](t.character):t.character;return Object(o.createElement)("kbd",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":r||c},Object(M.castArray)(n).map((e,t)=>"+"===e?Object(o.createElement)(o.Fragment,{key:t},e):Object(o.createElement)("kbd",{key:t,className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-key"},e)))}var Ue=function(e){let{description:t,keyCombination:r,aliases:n=[],ariaLabel:c}=e;return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-description"},t),Object(o.createElement)("div",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-term"},Object(o.createElement)(Ge,{keyCombination:r,forceAriaLabel:c}),n.map((e,t)=>Object(o.createElement)(Ge,{keyCombination:e,forceAriaLabel:c,key:t}))))};var ze=function(e){let{name:t}=e;const{keyCombination:r,description:n,aliases:c}=Object(l.useSelect)(e=>{const{getShortcutKeyCombination:r,getShortcutDescription:n,getShortcutAliases:c}=e(_e.store);return{keyCombination:r(t),aliases:c(t),description:n(t)}},[t]);return r?Object(o.createElement)(Ue,{keyCombination:r,description:n,aliases:c}):null};const He=e=>{let{shortcuts:t}=e;return Object(o.createElement)("ul",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-list",role:"list"},t.map((e,t)=>Object(o.createElement)("li",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut",key:t},Object(M.isString)(e)?Object(o.createElement)(ze,{name:e}):Object(o.createElement)(Ue,e))))},qe=e=>{let{title:t,shortcuts:r,className:n}=e;return Object(o.createElement)("section",{className:oe()("edit-widgets-keyboard-shortcut-help-modal__section",n)},!!t&&Object(o.createElement)("h2",{className:"edit-widgets-keyboard-shortcut-help-modal__section-title"},t),Object(o.createElement)(He,{shortcuts:r}))},Ke=e=>{let{title:t,categoryName:r,additionalShortcuts:n=[]}=e;const c=Object(l.useSelect)(e=>e(_e.store).getCategoryShortcuts(r),[r]);return Object(o.createElement)(qe,{title:t,shortcuts:c.concat(n)})};function Ye(e){let{isModalActive:t,toggleModal:r}=e;return Object(_e.useShortcut)("core/edit-widgets/keyboard-shortcuts",r,{bindGlobal:!0}),t?Object(o.createElement)(ie.Modal,{className:"edit-widgets-keyboard-shortcut-help-modal",title:Object(j.__)("Keyboard shortcuts"),closeLabel:Object(j.__)("Close"),onRequestClose:r},Object(o.createElement)(qe,{className:"edit-widgets-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-widgets/keyboard-shortcuts"]}),Object(o.createElement)(Ke,{title:Object(j.__)("Global shortcuts"),categoryName:"global"}),Object(o.createElement)(Ke,{title:Object(j.__)("Selection shortcuts"),categoryName:"selection"}),Object(o.createElement)(Ke,{title:Object(j.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:Object(j.__)("Change the block type after adding a new paragraph."),ariaLabel:Object(j.__)("Forward-slash")}]}),Object(o.createElement)(qe,{title:Object(j.__)("Text formatting"),shortcuts:Ve})):null}function Qe(){const[e,t]=Object(o.useState)(!1),r=()=>t(!e);Object(_e.useShortcut)("core/edit-widgets/keyboard-shortcuts",r);const n=Object(te.useViewportMatch)("medium");return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(m.f,null,()=>Object(o.createElement)(o.Fragment,null,n&&Object(o.createElement)(ie.MenuGroup,{label:Object(j._x)("View","noun")},Object(o.createElement)(m.g,{scope:"core/edit-widgets",feature:"fixedToolbar",label:Object(j.__)("Top toolbar"),info:Object(j.__)("Access all block and document tools in a single place"),messageActivated:Object(j.__)("Top toolbar activated"),messageDeactivated:Object(j.__)("Top toolbar deactivated")})),Object(o.createElement)(ie.MenuGroup,{label:Object(j.__)("Tools")},Object(o.createElement)(ie.MenuItem,{onClick:()=>{t(!0)},shortcut:Pe.displayShortcut.access("h")},Object(j.__)("Keyboard shortcuts")),Object(o.createElement)(m.g,{scope:"core/edit-widgets",feature:"welcomeGuide",label:Object(j.__)("Welcome Guide")}),Object(o.createElement)(ie.MenuItem,{role:"menuitem",icon:De.a,href:Object(j.__)("https://wordpress.org/support/article/block-based-widgets-editor/"),target:"_blank",rel:"noopener noreferrer"},Object(j.__)("Help"),Object(o.createElement)(ie.VisuallyHidden,{as:"span"},Object(j.__)("(opens in a new tab)")))),Object(o.createElement)(ie.MenuGroup,{label:Object(j.__)("Preferences")},Object(o.createElement)(m.g,{scope:"core/edit-widgets",feature:"keepCaretInsideBlock",label:Object(j.__)("Contain text cursor inside block"),info:Object(j.__)("Aids screen readers by stopping text caret from leaving blocks."),messageActivated:Object(j.__)("Contain text cursor inside block activated"),messageDeactivated:Object(j.__)("Contain text cursor inside block deactivated")}),Object(o.createElement)(m.g,{scope:"core/edit-widgets",feature:"themeStyles",info:Object(j.__)("Make the editor look like your theme."),label:Object(j.__)("Use theme styles")}),n&&Object(o.createElement)(m.g,{scope:"core/edit-widgets",feature:"showBlockBreadcrumbs",label:Object(j.__)("Display block breadcrumbs"),info:Object(j.__)("Shows block breadcrumbs at the bottom of the editor."),messageActivated:Object(j.__)("Display block breadcrumbs activated"),messageDeactivated:Object(j.__)("Display block breadcrumbs deactivated")})))),Object(o.createElement)(Ye,{isModalActive:e,toggleModal:r}))}var Xe=function(){const e=Object(te.useViewportMatch)("medium"),t=Object(o.useRef)(),r=Ee(),n=Object(l.useSelect)(e=>e(ee).getIsWidgetAreaOpen(r),[r]),{isInserterOpen:c,isListViewOpen:i}=Object(l.useSelect)(e=>{const{isInserterOpened:t,isListViewOpened:r}=e(ee);return{isInserterOpen:t(),isListViewOpen:r()}},[]),{setIsWidgetAreaOpen:a,setIsInserterOpened:s,setIsListViewOpened:d}=Object(l.useDispatch)(ee),{selectBlock:u}=Object(l.useDispatch)(_.store),b=Object(o.useCallback)(()=>d(!i),[d,i]);return Object(o.createElement)(o.Fragment,null,Object(o.createElement)("div",{className:"edit-widgets-header"},Object(o.createElement)("div",{className:"edit-widgets-header__navigable-toolbar-wrapper"},e&&Object(o.createElement)("h1",{className:"edit-widgets-header__title"},Object(j.__)("Widgets")),!e&&Object(o.createElement)(ie.VisuallyHidden,{as:"h1",className:"edit-widgets-header__title"},Object(j.__)("Widgets")),Object(o.createElement)(_.NavigableToolbar,{className:"edit-widgets-header-toolbar","aria-label":Object(j.__)("Document tools")},Object(o.createElement)(ie.ToolbarItem,{ref:t,as:ie.Button,className:"edit-widgets-header-toolbar__inserter-toggle",variant:"primary",isPressed:c,onMouseDown:e=>{e.preventDefault()},onClick:()=>{c?s(!1):(n||(u(r),a(r,!0)),window.requestAnimationFrame(()=>s(!0)))},icon:Ne.a,label:Object(j._x)("Toggle block inserter","Generic label for block inserter button")}),e&&Object(o.createElement)(o.Fragment,null,Object(o.createElement)(Fe,null),Object(o.createElement)(Me,null),Object(o.createElement)(ie.ToolbarItem,{as:ie.Button,className:"edit-widgets-header-toolbar__list-view-toggle",icon:Ce.a,isPressed:i,label:Object(j.__)("List View"),onClick:b})))),Object(o.createElement)("div",{className:"edit-widgets-header__actions"},Object(o.createElement)(Le,null),Object(o.createElement)(m.h.Slot,{scope:"core/edit-widgets"}),Object(o.createElement)(Qe,null))))};var Ze=function(){const{removeNotice:e}=Object(l.useDispatch)(f.store),{notices:t}=Object(l.useSelect)(e=>({notices:e(f.store).getNotices()}),[]),r=Object(M.filter)(t,{isDismissible:!0,type:"default"}),n=Object(M.filter)(t,{isDismissible:!1,type:"default"}),c=Object(M.filter)(t,{type:"snackbar"});return Object(o.createElement)(o.Fragment,null,Object(o.createElement)(ie.NoticeList,{notices:n,className:"edit-widgets-notices__pinned"}),Object(o.createElement)(ie.NoticeList,{notices:r,className:"edit-widgets-notices__dismissible",onRemove:e}),Object(o.createElement)(ie.SnackbarList,{notices:c,className:"edit-widgets-notices__snackbar",onRemove:e}))};function $e(e){let{blockEditorSettings:t}=e;const r=Object(l.useSelect)(e=>e(m.i).isFeatureActive("core/edit-widgets","themeStyles"),[]),n=Object(o.useMemo)(()=>r?t.styles:[],[t,r]);return Object(o.createElement)("div",{className:"edit-widgets-block-editor"},Object(o.createElement)(Ze,null),Object(o.createElement)(_.BlockTools,null,Object(o.createElement)(we,null),Object(o.createElement)(_.__unstableEditorStyles,{styles:n}),Object(o.createElement)(_.BlockSelectionClearer,null,Object(o.createElement)(_.WritingFlow,null,Object(o.createElement)(_.ObserveTyping,null,Object(o.createElement)(_.BlockList,{className:"edit-widgets-main-block-list"}))))))}var Je=r("w95h");var et=()=>{const e=Object(l.useSelect)(e=>{var t;const{getEntityRecord:r}=e(u.store),n=r(E,"postType","widget-areas");return null==n||null===(t=n.blocks[0])||void 0===t?void 0:t.clientId},[]);return Object(l.useSelect)(t=>{const{getBlockRootClientId:r,getBlockSelectionEnd:n,getBlockOrder:c,getBlockIndex:i}=t(_.store),a=t(ee).__experimentalGetInsertionPoint();if(a.rootClientId)return a;const o=n()||e,s=r(o);return o&&""===s?{rootClientId:o,insertionIndex:c(o).length}:{rootClientId:s,insertionIndex:i(o,s)+1}},[e])};function tt(){const e=Object(te.useViewportMatch)("medium","<"),{rootClientId:t,insertionIndex:r}=et(),{setIsInserterOpened:n}=Object(l.useDispatch)(ee),c=Object(o.useCallback)(()=>()=>n(!1),[n]),[i,a]=Object(te.__experimentalUseDialog)({onClose:c});return Object(o.createElement)("div",Object(je.a)({ref:i},a,{className:"edit-widgets-layout__inserter-panel"}),Object(o.createElement)("div",{className:"edit-widgets-layout__inserter-panel-header"},Object(o.createElement)(ie.Button,{icon:Je.a,onClick:c})),Object(o.createElement)("div",{className:"edit-widgets-layout__inserter-panel-content"},Object(o.createElement)(_.__experimentalLibrary,{showInserterHelpPanel:!0,shouldFocusBlock:e,rootClientId:t,__experimentalInsertionIndex:r})))}var rt=r("bWcr");function nt(){const{setIsListViewOpened:e}=Object(l.useDispatch)(ee),{clearSelectedBlock:t,selectBlock:r}=Object(l.useDispatch)(_.store);const n=Object(te.useFocusOnMount)("firstElement"),c=Object(te.useFocusReturn)();const i="edit-widgets-editor__list-view-panel-label-"+Object(te.useInstanceId)(nt);return Object(o.createElement)("div",{"aria-labelledby":i,className:"edit-widgets-editor__list-view-panel",onKeyDown:function(t){t.keyCode!==Pe.ESCAPE||t.defaultPrevented||(t.preventDefault(),e(!1))}},Object(o.createElement)("div",{className:"edit-widgets-editor__list-view-panel-header"},Object(o.createElement)("strong",{id:i},Object(j.__)("List view")),Object(o.createElement)(ie.Button,{icon:rt.a,label:Object(j.__)("Close list view sidebar"),onClick:()=>e(!1)})),Object(o.createElement)("div",{className:"edit-widgets-editor__list-view-panel-content",ref:Object(te.useMergeRefs)([c,n])},Object(o.createElement)(_.__experimentalListView,{onSelect:async function(e){await t(),r(e,-1)},showNestedBlocks:!0,__experimentalHideContainerBlockActions:!0,__experimentalFeatures:!0,__experimentalPersistentListViewFeatures:!0})))}function ct(){const{isInserterOpen:e,isListViewOpen:t}=Object(l.useSelect)(e=>{const{isInserterOpened:t,isListViewOpened:r}=e(ee);return{isInserterOpen:t(),isListViewOpen:r()}},[]);return e?Object(o.createElement)(tt,null):t?Object(o.createElement)(nt,null):null}const it={header:Object(j.__)("Widgets top bar"),body:Object(j.__)("Widgets and blocks"),sidebar:Object(j.__)("Widgets settings"),footer:Object(j.__)("Widgets footer")};var at=function(e){let{blockEditorSettings:t}=e;const r=Object(te.useViewportMatch)("medium","<"),n=Object(te.useViewportMatch)("huge",">="),{setIsInserterOpened:c,setIsListViewOpened:i,closeGeneralSidebar:a}=Object(l.useDispatch)(ee),{hasBlockBreadCrumbsEnabled:s,hasSidebarEnabled:d,isInserterOpened:u,isListViewOpened:b,previousShortcut:g,nextShortcut:p}=Object(l.useSelect)(e=>({hasSidebarEnabled:!!e(m.i).getActiveComplementaryArea(ee.name),isInserterOpened:!!e(ee).isInserterOpened(),isListViewOpened:!!e(ee).isListViewOpened(),hasBlockBreadCrumbsEnabled:e(m.i).isFeatureActive("core/edit-widgets","showBlockBreadcrumbs"),previousShortcut:e(_e.store).getAllShortcutKeyCombinations("core/edit-widgets/previous-region"),nextShortcut:e(_e.store).getAllShortcutKeyCombinations("core/edit-widgets/next-region")}),[]);return Object(o.useEffect)(()=>{d&&!n&&(c(!1),i(!1))},[d,n]),Object(o.useEffect)(()=>{!u&&!b||n||a()},[u,b,n]),Object(o.createElement)(m.e,{labels:it,header:Object(o.createElement)(Xe,null),secondarySidebar:Object(o.createElement)(ct,null),sidebar:d&&Object(o.createElement)(m.b.Slot,{scope:"core/edit-widgets"}),content:Object(o.createElement)($e,{blockEditorSettings:t}),footer:s&&!r&&Object(o.createElement)("div",{className:"edit-widgets-layout__footer"},Object(o.createElement)(_.BlockBreadcrumb,{rootLabelText:Object(j.__)("Widgets")})),shortcuts:{previous:g,next:p}})};function ot(){const e=Object(l.useSelect)(e=>{const{getEditedWidgetAreas:t}=e(ee),r=t();return(null==r?void 0:r.length)>0},[]);return Object(o.useEffect)(()=>{const t=t=>{if(e)return t.returnValue=Object(j.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}},[e]),null}function st(){var e;const t=Object(l.useSelect)(e=>e(m.i).isFeatureActive("core/edit-widgets","welcomeGuide"),[]),{toggleFeature:r}=Object(l.useDispatch)(m.i),n=Object(l.useSelect)(e=>e(ee).getWidgetAreas({per_page:-1}),[]);if(!t)return null;const c=null==n?void 0:n.every(e=>"wp_inactive_widgets"===e.id||e.widgets.every(e=>e.startsWith("block-"))),i=null!==(e=null==n?void 0:n.filter(e=>"wp_inactive_widgets"!==e.id).length)&&void 0!==e?e:0;return Object(o.createElement)(ie.Guide,{className:"edit-widgets-welcome-guide",contentLabel:Object(j.__)("Welcome to block Widgets"),finishButtonText:Object(j.__)("Get started"),onFinish:()=>r("core/edit-widgets","welcomeGuide"),pages:[{image:Object(o.createElement)(lt,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:Object(o.createElement)(o.Fragment,null,Object(o.createElement)("h1",{className:"edit-widgets-welcome-guide__heading"},Object(j.__)("Welcome to block Widgets")),c?Object(o.createElement)(o.Fragment,null,Object(o.createElement)("p",{className:"edit-widgets-welcome-guide__text"},Object(j.sprintf)(Object(j._n)("Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how theyll look on your site.","Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how theyll look on your site.",i),i))):Object(o.createElement)(o.Fragment,null,Object(o.createElement)("p",{className:"edit-widgets-welcome-guide__text"},Object(j.__)("You can now add any block to your sites widget areas. Dont worry, all of your favorite widgets still work flawlessly.")),Object(o.createElement)("p",{className:"edit-widgets-welcome-guide__text"},Object(o.createElement)("strong",null,Object(j.__)("Want to stick with the old widgets?"))," ",Object(o.createElement)(ie.ExternalLink,{href:Object(j.__)("https://wordpress.org/plugins/classic-widgets/")},Object(j.__)("Get the Classic Widgets plugin.")))))},{image:Object(o.createElement)(lt,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:Object(o.createElement)(o.Fragment,null,Object(o.createElement)("h1",{className:"edit-widgets-welcome-guide__heading"},Object(j.__)("Make each block your own")),Object(o.createElement)("p",{className:"edit-widgets-welcome-guide__text"},Object(j.__)("Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.")))},{image:Object(o.createElement)(lt,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:Object(o.createElement)(o.Fragment,null,Object(o.createElement)("h1",{className:"edit-widgets-welcome-guide__heading"},Object(j.__)("Get to know the block library")),Object(o.createElement)("p",{className:"edit-widgets-welcome-guide__text"},Object(o.createInterpolateElement)(Object(j.__)("All of the blocks available to you live in the block library. Youll find it wherever you see the <InserterIconImage /> icon."),{InserterIconImage:Object(o.createElement)("img",{className:"edit-widgets-welcome-guide__inserter-icon",alt:Object(j.__)("inserter"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"})})))},{image:Object(o.createElement)(lt,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:Object(o.createElement)(o.Fragment,null,Object(o.createElement)("h1",{className:"edit-widgets-welcome-guide__heading"},Object(j.__)("Learn how to use the block editor")),Object(o.createElement)("p",{className:"edit-widgets-welcome-guide__text"},Object(j.__)("New to the block editor? Want to learn more about using it? "),Object(o.createElement)(ie.ExternalLink,{href:Object(j.__)("https://wordpress.org/support/article/wordpress-editor/")},Object(j.__)("Here's a detailed guide."))))}]})}function lt(e){let{nonAnimatedSrc:t,animatedSrc:r}=e;return Object(o.createElement)("picture",{className:"edit-widgets-welcome-guide__image"},Object(o.createElement)("source",{srcSet:t,media:"(prefers-reduced-motion: reduce)"}),Object(o.createElement)("img",{src:r,width:"312",height:"240",alt:""}))}var dt=function(e){let{blockEditorSettings:t,onError:r}=e;return Object(o.createElement)(Oe,{onError:r},Object(o.createElement)(ve,{blockEditorSettings:t},Object(o.createElement)(at,{blockEditorSettings:t}),Object(o.createElement)(Be,null),Object(o.createElement)(ie.Popover.Slot,null),Object(o.createElement)(ge.PluginArea,null),Object(o.createElement)(ot,null),Object(o.createElement)(st,null)))};const ut=["core/more","core/freeform","core/template-part","core/block"];function bt(e,t){Object(o.unmountComponentAtNode)(e);const r=bt.bind(null,e,t);Object(o.render)(Object(o.createElement)(dt,{blockEditorSettings:t,onError:r}),e)}function mt(e,t){const r=document.getElementById(e),n=bt.bind(null,r,t),c=Object(d.__experimentalGetCoreBlocks)().filter(e=>!(ut.includes(e.name)||e.name.startsWith("core/post")||e.name.startsWith("core/query")||e.name.startsWith("core/site")||e.name.startsWith("core/navigation")));Object(l.dispatch)(m.i).setFeatureDefaults("core/edit-widgets",{fixedToolbar:!1,welcomeGuide:!0,showBlockBreadcrumbs:!0,themeStyles:!0}),Object(l.dispatch)(s.store).__experimentalReapplyBlockTypeFilters(),Object(d.registerCoreBlocks)(c),Object(b.registerLegacyWidgetBlock)(),Object(b.registerLegacyWidgetVariations)(t),gt(a),Object(b.registerWidgetGroupBlock)(),t.__experimentalFetchLinkSuggestions=(e,r)=>Object(u.__experimentalFetchLinkSuggestions)(e,r,t),Object(s.setFreeformContentHandlerName)("core/html"),Object(o.render)(Object(o.createElement)(dt,{blockEditorSettings:t,onError:n}),r)}const gt=e=>{if(!e)return;const{metadata:t,settings:r,name:n}=e;t&&Object(s.unstable__bootstrapServerSideBlockDefinitions)({[n]:t}),Object(s.registerBlockType)(n,r)}},GLVC:function(e,t){e.exports=window.wp.widgets},GRId:function(e,t){e.exports=window.wp.element},HSyU:function(e,t){e.exports=window.wp.blocks},"K+tz":function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.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"}));t.a=i},K2cm:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.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"}));t.a=i},K9lf:function(e,t){e.exports=window.wp.compose},KEfo:function(e,t){e.exports=window.wp.viewport},Mmq9:function(e,t){e.exports=window.wp.url},Ntru:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.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"}));t.a=i},OzlF:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(n.createElement)(c.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));t.a=i},Q4Sy:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));t.a=i},QyPg:function(e,t){e.exports=window.wp.blockLibrary},RMJe:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));t.a=i},RxS6:function(e,t){e.exports=window.wp.keycodes},TSYQ:function(e,t,r){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 c(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var a=c.apply(null,n);a&&e.push(a)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var o in n)r.call(n,o)&&n[o]&&e.push(o);else e.push(n.toString())}}return e.join(" ")}e.exports?(c.default=c,e.exports=c):void 0===(n=function(){return c}.apply(t,[]))||(e.exports=n)}()},Tqx9:function(e,t){e.exports=window.wp.primitives},TvNi:function(e,t){e.exports=window.wp.plugins},U60i:function(e,t,r){"use strict";r.d(t,"b",(function(){return K})),r.d(t,"c",(function(){return G})),r.d(t,"d",(function(){return Y})),r.d(t,"e",(function(){return X})),r.d(t,"h",(function(){return z})),r.d(t,"f",(function(){return $})),r.d(t,"g",(function(){return ee})),r.d(t,"a",(function(){return D})),r.d(t,"i",(function(){return L}));var n={};r.r(n),r.d(n,"enableComplementaryArea",(function(){return v})),r.d(n,"disableComplementaryArea",(function(){return y})),r.d(n,"pinItem",(function(){return S})),r.d(n,"unpinItem",(function(){return I})),r.d(n,"toggleFeature",(function(){return A})),r.d(n,"setFeatureValue",(function(){return x})),r.d(n,"setFeatureDefaults",(function(){return T}));var c={};r.r(c),r.d(c,"getActiveComplementaryArea",(function(){return B})),r.d(c,"isItemPinned",(function(){return N})),r.d(c,"isFeatureActive",(function(){return C}));var i=r("wx14"),a=r("GRId"),o=r("TSYQ"),s=r.n(o),l=r("tI+e"),d=r("1ZqX"),u=r("l3Sj"),b=r("RMJe"),m=r("URob"),g=r("Xxwi"),p=r("KEfo"),O=r("bWcr"),j=r("YLtl");const f=Object(d.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:r,defaults:n}=t;return{...e,[r]:{...e[r],...n}}}return e}}),_=Object(d.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:r,featureName:n,value:c}=t;return{...e,[r]:{...e[r],[n]:c}}}return e}}),h=Object(d.combineReducers)({singleEnableItems:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,itemType:r,scope:n,item:c}=arguments.length>1?arguments[1]:void 0;return"SET_SINGLE_ENABLE_ITEM"===t&&r&&n?{...e,[r]:{...e[r],[n]:c||null}}:e},multipleEnableItems:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,itemType:r,scope:n,item:c,isEnable:i}=arguments.length>1?arguments[1]:void 0;if("SET_MULTIPLE_ENABLE_ITEM"!==t||!r||!n||!c||Object(j.get)(e,[r,n,c])===i)return e;const a=e[r]||{},o=a[n]||{};return{...e,[r]:{...a,[n]:{...o,[c]:i||!1}}}}});var w=Object(d.combineReducers)({enableItems:h,preferenceDefaults:f,preferences:_});function E(e,t,r){return{type:"SET_SINGLE_ENABLE_ITEM",itemType:e,scope:t,item:r}}function v(e,t){return E("complementaryArea",e,t)}function y(e){return E("complementaryArea",e,void 0)}function k(e,t,r,n){return{type:"SET_MULTIPLE_ENABLE_ITEM",itemType:e,scope:t,item:r,isEnable:n}}function S(e,t){return k("pinnedItems",e,t,!0)}function I(e,t){return k("pinnedItems",e,t,!1)}function A(e,t){return function(r){let{select:n,dispatch:c}=r;const i=n.isFeatureActive(e,t);c.setFeatureValue(e,t,!i)}}function x(e,t,r){return{type:"SET_FEATURE_VALUE",scope:e,featureName:t,value:!!r}}function T(e,t){return{type:"SET_FEATURE_DEFAULTS",scope:e,defaults:t}}function B(e,t){return function(e,t,r){return Object(j.get)(e.enableItems.singleEnableItems,[t,r])}(e,"complementaryArea",t)}function N(e,t,r){return!1!==function(e,t,r,n){return Object(j.get)(e.enableItems.multipleEnableItems,[t,r,n])}(e,"pinnedItems",t,r)}function C(e,t,r){var n,c;const i=null===(n=e.preferences.features[t])||void 0===n?void 0:n[r];return!!(void 0!==i?i:null===(c=e.preferenceDefaults.features[t])||void 0===c?void 0:c[r])}const L=Object(d.createReduxStore)("core/interface",{reducer:w,actions:n,selectors:c,persist:["enableItems","preferences"],__experimentalUseThunks:!0});Object(d.registerStore)("core/interface",{reducer:w,actions:n,selectors:c,persist:["enableItems","preferences"],__experimentalUseThunks:!0});var W=r("TvNi"),R=Object(W.withPluginContext)((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`}));var P=R((function(e){let{as:t=l.Button,scope:r,identifier:n,icon:c,selectedIcon:o,...s}=e;const u=t,b=Object(d.useSelect)(e=>e(L).getActiveComplementaryArea(r)===n,[n]),{enableComplementaryArea:m,disableComplementaryArea:g}=Object(d.useDispatch)(L);return Object(a.createElement)(u,Object(i.a)({icon:o&&b?o:c,onClick:()=>{b?g(r):m(r,n)}},Object(j.omit)(s,["name"])))}));var F=e=>{let{smallScreenTitle:t,children:r,className:n,toggleButtonProps:c}=e;const o=Object(a.createElement)(P,Object(i.a)({icon:O.a},c));return Object(a.createElement)(a.Fragment,null,Object(a.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},t&&Object(a.createElement)("span",{className:"interface-complementary-area-header__small-title"},t),o),Object(a.createElement)("div",{className:s()("components-panel__header","interface-complementary-area-header",n),tabIndex:-1},r,o))};function M(e){let{name:t,as:r=l.Button,onClick:n,...c}=e;return Object(a.createElement)(l.Fill,{name:t},e=>{let{onClick:t}=e;return Object(a.createElement)(r,Object(i.a)({onClick:n||t?function(){(n||j.noop)(...arguments),(t||j.noop)(...arguments)}:void 0},c))})}M.Slot=function(e){let{name:t,as:r=l.ButtonGroup,fillProps:n={},bubblesVirtually:c,...i}=e;return Object(a.createElement)(l.Slot,{name:t,bubblesVirtually:c,fillProps:n},e=>{if(Object(j.isEmpty)(a.Children.toArray(e)))return null;const t=[];a.Children.forEach(e,e=>{let{props:{__unstableExplicitMenuItem:r,__unstableTarget:n}}=e;n&&r&&t.push(n)});const n=a.Children.map(e,e=>!e.props.__unstableExplicitMenuItem&&t.includes(e.props.__unstableTarget)?null:e);return Object(a.createElement)(r,i,n)})};var D=M;const V=e=>Object(a.createElement)(l.MenuItem,Object(j.omit)(e,["__unstableExplicitMenuItem","__unstableTarget"]));function G(e){let{scope:t,target:r,__unstableExplicitMenuItem:n,...c}=e;return Object(a.createElement)(P,Object(i.a)({as:e=>Object(a.createElement)(D,Object(i.a)({__unstableExplicitMenuItem:n,__unstableTarget:`${t}/${r}`,as:V,name:t+"/plugin-more-menu"},e)),role:"menuitemcheckbox",selectedIcon:b.a,name:r,scope:t},c))}function U(e){let{scope:t,...r}=e;return Object(a.createElement)(l.Fill,Object(i.a)({name:"PinnedItems/"+t},r))}U.Slot=function(e){let{scope:t,className:r,...n}=e;return Object(a.createElement)(l.Slot,Object(i.a)({name:"PinnedItems/"+t},n),e=>!Object(j.isEmpty)(e)&&Object(a.createElement)("div",{className:s()(r,"interface-pinned-items")},e))};var z=U;function H(e){let{scope:t,children:r,className:n}=e;return Object(a.createElement)(l.Fill,{name:"ComplementaryArea/"+t},Object(a.createElement)("div",{className:n},r))}const q=R((function(e){let{children:t,className:r,closeLabel:n=Object(u.__)("Close plugin"),identifier:c,header:i,headerClassName:o,icon:O,isPinnable:j=!0,panelClassName:f,scope:_,name:h,smallScreenTitle:w,title:E,toggleShortcut:v,isActiveByDefault:y,showIconLabels:k=!1}=e;const{isActive:S,isPinned:I,activeArea:A,isSmall:x,isLarge:T}=Object(d.useSelect)(e=>{const{getActiveComplementaryArea:t,isItemPinned:r}=e(L),n=t(_);return{isActive:n===c,isPinned:r(_,c),activeArea:n,isSmall:e(p.store).isViewportMatch("< medium"),isLarge:e(p.store).isViewportMatch("large")}},[c,_]);!function(e,t,r,n,c){const i=Object(a.useRef)(!1),o=Object(a.useRef)(!1),{enableComplementaryArea:s,disableComplementaryArea:l}=Object(d.useDispatch)(L);Object(a.useEffect)(()=>{n&&c&&!i.current?(l(e),o.current=!0):o.current&&!c&&i.current?(o.current=!1,s(e,t)):o.current&&r&&r!==t&&(o.current=!1),c!==i.current&&(i.current=c)},[n,c,e,t,r])}(_,c,A,S,x);const{enableComplementaryArea:B,disableComplementaryArea:N,pinItem:C,unpinItem:W}=Object(d.useDispatch)(L);return Object(a.useEffect)(()=>{y&&void 0===A&&!x&&B(_,c)},[A,y,_,c,x]),Object(a.createElement)(a.Fragment,null,j&&Object(a.createElement)(z,{scope:_},I&&Object(a.createElement)(P,{scope:_,identifier:c,isPressed:S&&(!k||T),"aria-expanded":S,label:E,icon:k?b.a:O,showTooltip:!k,variant:k?"tertiary":void 0})),h&&j&&Object(a.createElement)(G,{target:h,scope:_,icon:O},E),S&&Object(a.createElement)(H,{className:s()("interface-complementary-area",r),scope:_},Object(a.createElement)(F,{className:o,closeLabel:n,onClose:()=>N(_),smallScreenTitle:w,toggleButtonProps:{label:n,shortcut:v,scope:_,identifier:c}},i||Object(a.createElement)(a.Fragment,null,Object(a.createElement)("strong",null,E),j&&Object(a.createElement)(l.Button,{className:"interface-complementary-area__pin-unpin-item",icon:I?m.a:g.a,label:I?Object(u.__)("Unpin from toolbar"):Object(u.__)("Pin to toolbar"),onClick:()=>(I?W:C)(_,c),isPressed:I,"aria-expanded":I}))),Object(a.createElement)(l.Panel,{className:f},t)))}));q.Slot=function(e){let{scope:t,...r}=e;return Object(a.createElement)(l.Slot,Object(i.a)({name:"ComplementaryArea/"+t},r))};var K=q;var Y=e=>{let{isActive:t}=e;return Object(a.useEffect)(()=>{let e=!1;return document.body.classList.contains("sticky-menu")&&(e=!0,document.body.classList.remove("sticky-menu")),()=>{e&&document.body.classList.add("sticky-menu")}},[]),Object(a.useEffect)(()=>(t?document.body.classList.add("is-fullscreen-mode"):document.body.classList.remove("is-fullscreen-mode"),()=>{t&&document.body.classList.remove("is-fullscreen-mode")}),[t]),null},Q=r("K9lf");var X=Object(a.forwardRef)((function(e,t){let{footer:r,header:n,sidebar:c,secondarySidebar:o,notices:d,content:b,drawer:m,actions:g,labels:p,className:O,shortcuts:j}=e;const f=Object(l.__unstableUseNavigateRegions)(j);!function(e){Object(a.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 _={...{drawer:Object(u.__)("Drawer"),header:Object(u.__)("Header"),body:Object(u.__)("Content"),secondarySidebar:Object(u.__)("Block Library"),sidebar:Object(u.__)("Settings"),actions:Object(u.__)("Publish"),footer:Object(u.__)("Footer")},...p};return Object(a.createElement)("div",Object(i.a)({},f,{ref:Object(Q.useMergeRefs)([t,f.ref]),className:s()(O,"interface-interface-skeleton",f.className,!!r&&"has-footer")}),!!m&&Object(a.createElement)("div",{className:"interface-interface-skeleton__drawer",role:"region","aria-label":_.drawer,tabIndex:"-1"},m),Object(a.createElement)("div",{className:"interface-interface-skeleton__editor"},!!n&&Object(a.createElement)("div",{className:"interface-interface-skeleton__header",role:"region","aria-label":_.header,tabIndex:"-1"},n),Object(a.createElement)("div",{className:"interface-interface-skeleton__body"},!!o&&Object(a.createElement)("div",{className:"interface-interface-skeleton__secondary-sidebar",role:"region","aria-label":_.secondarySidebar,tabIndex:"-1"},o),!!d&&Object(a.createElement)("div",{className:"interface-interface-skeleton__notices"},d),Object(a.createElement)("div",{className:"interface-interface-skeleton__content",role:"region","aria-label":_.body,tabIndex:"-1"},b),!!c&&Object(a.createElement)("div",{className:"interface-interface-skeleton__sidebar",role:"region","aria-label":_.sidebar,tabIndex:"-1"},c),!!g&&Object(a.createElement)("div",{className:"interface-interface-skeleton__actions",role:"region","aria-label":_.actions,tabIndex:"-1"},g))),!!r&&Object(a.createElement)("div",{className:"interface-interface-skeleton__footer",role:"region","aria-label":_.footer,tabIndex:"-1"},r))})),Z=r("VKE3");function $(e){let{as:t=l.DropdownMenu,className:r,label:n=Object(u.__)("Options"),popoverProps:c,toggleProps:i,children:o}=e;return Object(a.createElement)(t,{className:s()("interface-more-menu-dropdown",r),icon:Z.a,label:n,popoverProps:{position:"bottom left",...c,className:s()("interface-more-menu-dropdown__content",null==c?void 0:c.className)},toggleProps:{tooltipPosition:"bottom",...i}},e=>o(e))}var J=r("gdqT");function ee(e){let{scope:t,label:r,info:n,messageActivated:c,messageDeactivated:i,shortcut:o,feature:s}=e;const m=Object(d.useSelect)(e=>e(L).isFeatureActive(t,s),[s]),{toggleFeature:g}=Object(d.useDispatch)(L);return Object(a.createElement)(l.MenuItem,{icon:m&&b.a,isSelected:m,onClick:()=>{g(t,s),m?Object(J.speak)(i||Object(u.__)("Feature deactivated")):Object(J.speak)(c||Object(u.__)("Feature activated"))},role:"menuitemcheckbox",info:n,shortcut:o},r)}},URob:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"}));t.a=i},VKE3:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));t.a=i},Xxwi:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"}));t.a=i},YLtl:function(e,t){e.exports=window.lodash},axFQ:function(e,t){e.exports=window.wp.blockEditor},bWcr:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=i},diJD:function(e,t){e.exports=window.wp.reusableBlocks},g56x:function(e,t){e.exports=window.wp.hooks},gdqT:function(e,t){e.exports=window.wp.a11y},hF7m:function(e,t){e.exports=window.wp.keyboardShortcuts},jZUy:function(e,t){e.exports=window.wp.coreData},l3Sj:function(e,t){e.exports=window.wp.i18n},onLe:function(e,t){e.exports=window.wp.notices},"tI+e":function(e,t){e.exports=window.wp.components},w95h:function(e,t,r){"use strict";var n=r("GRId"),c=r("Tqx9");const i=Object(n.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(n.createElement)(c.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"}));t.a=i},wx14:function(e,t,r){"use strict";function n(){return(n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,"a",(function(){return n}))},ywyh:function(e,t){e.exports=window.wp.apiFetch}});