mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-27 19:47:42 +01:00
121c824ccd
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
7 lines
50 KiB
JavaScript
7 lines
50 KiB
JavaScript
/*! This file is auto-generated */
|
||
this.wp=this.wp||{},this.wp.customizeWidgets=function(e){var t={};function n(r){if(t[r])return t[r].exports;var c=t[r]={i:r,l:!1,exports:{}};return e[r].call(c.exports,c,c.exports,n),c.l=!0,c.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var c in e)n.d(r,c,function(t){return e[t]}.bind(null,c));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="9pbN")}({"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},"9pbN":function(e,t,n){"use strict";n.r(t),n.d(t,"initialize",(function(){return ke}));var r={};n.r(r),n.d(r,"isInserterOpened",(function(){return z})),n.d(r,"__experimentalGetInsertionPoint",(function(){return T}));var c={};n.r(c),n.d(c,"setIsInserterOpened",(function(){return B}));var i=n("GRId"),s=n("QyPg"),o=n("GLVC"),a=n("HSyU"),l=n("1ZqX"),d=n("U60i"),u=n("tI+e"),b=n("hF7m"),m=n("l3Sj"),p=n("axFQ"),h=n("K9lf");function g(e){let{text:t,children:n}=e;const r=Object(h.useCopyToClipboard)(t);return Object(i.createElement)(u.Button,{variant:"secondary",ref:r},n)}class f extends i.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){this.setState({error:e})}render(){const{error:e}=this.state;return e?Object(i.createElement)(p.Warning,{className:"customize-widgets-error-boundary",actions:[Object(i.createElement)(g,{key:"copy-error",text:e.stack},Object(m.__)("Copy Error"))]},Object(m.__)("The editor has encountered an unexpected error.")):this.props.children}}var O=n("YLtl"),j=n("jZUy"),_=n("6aBm"),w=n("wx14");var E=function(e){let{inspector:t,closeMenu:n,...r}=e;const c=Object(l.useSelect)(e=>e(p.store).getSelectedBlockClientId(),[]),s=Object(i.useMemo)(()=>document.getElementById("block-"+c),[c]);return Object(i.createElement)(u.MenuItem,Object(w.a)({onClick:()=>{t.open({returnFocusWhenClose:s}),n()}},r),Object(m.__)("Show more settings"))},v=n("TSYQ"),y=n.n(v),k=n("RxS6"),C=n("Ntru"),x=n("K2cm"),S=n("Q4Sy"),I=n("bWcr");function z(e){return!!e.blockInserterPanel}function T(e){const{rootClientId:t,insertionIndex:n}=e.blockInserterPanel;return{rootClientId:t,insertionIndex:n}}function B(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}const N={reducer: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_INSERTER_OPENED":return t.value}return e}}),selectors:r,actions:c},W=Object(l.createReduxStore)("core/customize-widgets",N);Object(l.registerStore)("core/customize-widgets",N);var A=function e(t){let{setIsOpened:n}=t;const r=Object(h.useInstanceId)(e,"customize-widget-layout__inserter-panel-title"),c=Object(l.useSelect)(e=>e(W).__experimentalGetInsertionPoint(),[]);return Object(i.createElement)("div",{className:"customize-widgets-layout__inserter-panel","aria-labelledby":r},Object(i.createElement)("div",{className:"customize-widgets-layout__inserter-panel-header"},Object(i.createElement)("h2",{id:r,className:"customize-widgets-layout__inserter-panel-header-title"},Object(m.__)("Add a block")),Object(i.createElement)(u.Button,{className:"customize-widgets-layout__inserter-panel-header-close-button",icon:I.a,onClick:()=>n(!1),"aria-label":Object(m.__)("Close inserter")})),Object(i.createElement)("div",{className:"customize-widgets-layout__inserter-panel-content"},Object(i.createElement)(p.__experimentalLibrary,{rootClientId:c.rootClientId,__experimentalInsertionIndex:c.insertionIndex,showInserterHelpPanel:!0,onSelect:()=>n(!1)})))},F=n("K+tz");const M=[{keyCombination:{modifier:"primary",character:"b"},description:Object(m.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:Object(m.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:Object(m.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:Object(m.__)("Remove a link.")},{keyCombination:{modifier:"primary",character:"u"},description:Object(m.__)("Underline the selected text.")}];function P(e){let{keyCombination:t,forceAriaLabel:n}=e;const r=t.modifier?k.displayShortcutList[t.modifier](t.character):t.character,c=t.modifier?k.shortcutAriaLabel[t.modifier](t.character):t.character;return Object(i.createElement)("kbd",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":n||c},Object(O.castArray)(r).map((e,t)=>"+"===e?Object(i.createElement)(i.Fragment,{key:t},e):Object(i.createElement)("kbd",{key:t,className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-key"},e)))}var L=function(e){let{description:t,keyCombination:n,aliases:r=[],ariaLabel:c}=e;return Object(i.createElement)(i.Fragment,null,Object(i.createElement)("div",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-description"},t),Object(i.createElement)("div",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-term"},Object(i.createElement)(P,{keyCombination:n,forceAriaLabel:c}),r.map((e,t)=>Object(i.createElement)(P,{keyCombination:e,forceAriaLabel:c,key:t}))))};var R=function(e){let{name:t}=e;const{keyCombination:n,description:r,aliases:c}=Object(l.useSelect)(e=>{const{getShortcutKeyCombination:n,getShortcutDescription:r,getShortcutAliases:c}=e(b.store);return{keyCombination:n(t),aliases:c(t),description:r(t)}},[t]);return n?Object(i.createElement)(L,{keyCombination:n,description:r,aliases:c}):null};const G=e=>{let{shortcuts:t}=e;return Object(i.createElement)("ul",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut-list",role:"list"},t.map((e,t)=>Object(i.createElement)("li",{className:"customize-widgets-keyboard-shortcut-help-modal__shortcut",key:t},Object(O.isString)(e)?Object(i.createElement)(R,{name:e}):Object(i.createElement)(L,e))))},D=e=>{let{title:t,shortcuts:n,className:r}=e;return Object(i.createElement)("section",{className:y()("customize-widgets-keyboard-shortcut-help-modal__section",r)},!!t&&Object(i.createElement)("h2",{className:"customize-widgets-keyboard-shortcut-help-modal__section-title"},t),Object(i.createElement)(G,{shortcuts:n}))},U=e=>{let{title:t,categoryName:n,additionalShortcuts:r=[]}=e;const c=Object(l.useSelect)(e=>e(b.store).getCategoryShortcuts(n),[n]);return Object(i.createElement)(D,{title:t,shortcuts:c.concat(r)})};function V(e){let{isModalActive:t,toggleModal:n}=e;const{registerShortcut:r}=Object(l.useDispatch)(b.store);return r({name:"core/customize-widgets/keyboard-shortcuts",category:"main",description:Object(m.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),Object(b.useShortcut)("core/customize-widgets/keyboard-shortcuts",n),t?Object(i.createElement)(u.Modal,{className:"customize-widgets-keyboard-shortcut-help-modal",title:Object(m.__)("Keyboard shortcuts"),closeLabel:Object(m.__)("Close"),onRequestClose:n},Object(i.createElement)(D,{className:"customize-widgets-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/customize-widgets/keyboard-shortcuts"]}),Object(i.createElement)(U,{title:Object(m.__)("Global shortcuts"),categoryName:"global"}),Object(i.createElement)(U,{title:Object(m.__)("Selection shortcuts"),categoryName:"selection"}),Object(i.createElement)(U,{title:Object(m.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:Object(m.__)("Change the block type after adding a new paragraph."),ariaLabel:Object(m.__)("Forward-slash")}]}),Object(i.createElement)(D,{title:Object(m.__)("Text formatting"),shortcuts:M})):null}const H={className:"customize-widgets-more-menu__content"};function q(){const[e,t]=Object(i.useState)(!1),n=()=>t(!e);return Object(b.useShortcut)("core/customize-widgets/keyboard-shortcuts",n),Object(i.createElement)(i.Fragment,null,Object(i.createElement)(d.f,{as:u.ToolbarDropdownMenu,className:"customize-widgets-more-menu",popoverProps:H},()=>Object(i.createElement)(i.Fragment,null,Object(i.createElement)(u.MenuGroup,{label:Object(m._x)("View","noun")},Object(i.createElement)(d.g,{scope:"core/customize-widgets",feature:"fixedToolbar",label:Object(m.__)("Top toolbar"),info:Object(m.__)("Access all block and document tools in a single place"),messageActivated:Object(m.__)("Top toolbar activated"),messageDeactivated:Object(m.__)("Top toolbar deactivated")})),Object(i.createElement)(u.MenuGroup,{label:Object(m.__)("Tools")},Object(i.createElement)(u.MenuItem,{onClick:()=>{t(!0)},shortcut:k.displayShortcut.access("h")},Object(m.__)("Keyboard shortcuts")),Object(i.createElement)(d.g,{scope:"core/customize-widgets",feature:"welcomeGuide",label:Object(m.__)("Welcome Guide")}),Object(i.createElement)(u.MenuItem,{role:"menuitem",icon:F.a,href:Object(m.__)("https://wordpress.org/support/article/block-based-widgets-editor/"),target:"_blank",rel:"noopener noreferrer"},Object(m.__)("Help"),Object(i.createElement)(u.VisuallyHidden,{as:"span"},Object(m.__)("(opens in a new tab)")))),Object(i.createElement)(u.MenuGroup,{label:Object(m.__)("Preferences")},Object(i.createElement)(d.g,{scope:"core/customize-widgets",feature:"keepCaretInsideBlock",label:Object(m.__)("Contain text cursor inside block"),info:Object(m.__)("Aids screen readers by stopping text caret from leaving blocks."),messageActivated:Object(m.__)("Contain text cursor inside block activated"),messageDeactivated:Object(m.__)("Contain text cursor inside block deactivated")})))),Object(i.createElement)(V,{isModalActive:e,toggleModal:n}))}var K=function(e){let{sidebar:t,inserter:n,isInserterOpened:r,setIsInserterOpened:c,isFixedToolbarActive:s}=e;const[[o,a],l]=Object(i.useState)([t.hasUndo(),t.hasRedo()]);return Object(i.useEffect)(()=>t.subscribeHistory(()=>{l([t.hasUndo(),t.hasRedo()])}),[t]),Object(i.createElement)(i.Fragment,null,Object(i.createElement)("div",{className:y()("customize-widgets-header",{"is-fixed-toolbar-active":s})},Object(i.createElement)(p.NavigableToolbar,{className:"customize-widgets-header-toolbar","aria-label":Object(m.__)("Document tools")},Object(i.createElement)(u.ToolbarButton,{icon:Object(m.isRTL)()?x.a:C.a,label:Object(m.__)("Undo"),shortcut:k.displayShortcut.primary("z"),"aria-disabled":!o,onClick:t.undo,className:"customize-widgets-editor-history-button undo-button"}),Object(i.createElement)(u.ToolbarButton,{icon:Object(m.isRTL)()?C.a:x.a,label:Object(m.__)("Redo"),shortcut:k.displayShortcut.primaryShift("z"),"aria-disabled":!a,onClick:t.redo,className:"customize-widgets-editor-history-button redo-button"}),Object(i.createElement)(u.ToolbarButton,{className:"customize-widgets-header-toolbar__inserter-toggle",isPressed:r,variant:"primary",icon:S.a,label:Object(m._x)("Add block","Generic label for block inserter button"),onClick:()=>{c(e=>!e)}}),Object(i.createElement)(q,null))),Object(i.createPortal)(Object(i.createElement)(A,{setIsOpened:c}),n.contentContainer[0]))};var $=n("rl8x"),Q=n.n($);function Y(e){const t=e.match(/^widget_(.+)(?:\[(\d+)\])$/);if(t){return`${t[1]}-${parseInt(t[2],10)}`}return e}function X(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r="core/legacy-widget"===e.name&&(e.attributes.id||e.attributes.instance);if(r)if(e.attributes.id)t={id:e.attributes.id};else{const{encoded:r,hash:c,raw:i,...s}=e.attributes.instance;t={idBase:e.attributes.idBase,instance:{...null==n?void 0:n.instance,is_widget_customizer_js_value:!0,encoded_serialized_instance:r,instance_hash_key:c,raw_instance:i,...s}}}else{t={idBase:"block",widgetClass:"WP_Widget_Block",instance:{raw_instance:{content:Object(a.serialize)(e)}}}}return{...Object(O.omit)(n,["form","rendered"]),...t}}function Z(e){let t,{id:n,idBase:r,number:c,instance:i}=e;const{encoded_serialized_instance:s,instance_hash_key:l,raw_instance:d,...u}=i;if("block"===r){const e=Object(a.parse)(d.content);t=e.length?e[0]:Object(a.createBlock)("core/paragraph",{})}else t=c?Object(a.createBlock)("core/legacy-widget",{idBase:r,instance:{encoded:s,hash:l,raw:d,...u}}):Object(a.createBlock)("core/legacy-widget",{id:n});return Object(o.addWidgetIdToBlock)(t,n)}function J(e){const[t,n]=Object(i.useState)(()=>e.getWidgets().map(e=>Z(e)));Object(i.useEffect)(()=>e.subscribe((e,t)=>{n(n=>{const r=new Map(e.map(e=>[e.id,e])),c=new Map(n.map(e=>[Object(o.getWidgetIdFromBlock)(e),e])),i=t.map(e=>{const t=r.get(e.id);return t&&t===e?c.get(e.id):Z(e)});return Q()(n,i)?n:i})}),[e]);const r=Object(i.useCallback)(t=>{n(n=>{if(Q()(n,t))return n;const r=new Map(n.map(e=>[Object(o.getWidgetIdFromBlock)(e),e])),c=t.map(t=>{const n=Object(o.getWidgetIdFromBlock)(t);if(n&&r.has(n)){const c=r.get(n),i=e.getWidget(n);return Object(O.isEqual)(t,c)&&i?i:X(t,i)}return X(t)});if(Q()(e.getWidgets(),c))return n;const i=e.setWidgets(c);return t.reduce((e,n,r)=>{const c=i[r];return null!==c&&(e===t&&(e=t.slice()),e[r]=Object(o.addWidgetIdToBlock)(n,c)),e},t)})},[e]);return[t,r,r]}const ee=Object(i.createContext)();function te(e){let{api:t,sidebarControls:n,children:r}=e;const[c,s]=Object(i.useState)({current:null}),o=Object(i.useCallback)(e=>{for(const t of n){if(t.setting.get().includes(e)){t.sectionInstance.expand({completeCallback(){s({current:e})}});break}}},[n]);Object(i.useEffect)(()=>{function e(e){const t=Y(e);o(t)}function n(){t.previewer.preview.bind("focus-control-for-setting",e)}return t.previewer.bind("ready",n),()=>{t.previewer.unbind("ready",n),t.previewer.preview.unbind("focus-control-for-setting",e)}},[t,o]);const a=Object(i.useMemo)(()=>[c,o],[c,o]);return Object(i.createElement)(ee.Provider,{value:a},r)}const ne=()=>Object(i.useContext)(ee);function re(e){let{sidebar:t,settings:n,children:r}=e;const[c,s,a]=J(t);return function(e){const{selectBlock:t}=Object(l.useDispatch)(p.store),[n]=ne(),r=Object(i.useRef)(e);Object(i.useEffect)(()=>{r.current=e},[e]),Object(i.useEffect)(()=>{if(n.current){const e=r.current.find(e=>Object(o.getWidgetIdFromBlock)(e)===n.current);if(e){t(e.clientId);const n=document.querySelector(`[data-block="${e.clientId}"]`);null==n||n.focus()}}},[n,t])}(c),Object(i.createElement)(p.BlockEditorProvider,{value:c,onInput:s,onChange:a,settings:n,useSubRegistry:!1},r)}function ce(e){let{sidebar:t}=e;const{toggleFeature:n}=Object(l.useDispatch)(d.i),r=t.getWidgets().every(e=>e.id.startsWith("block-"));return Object(i.createElement)("div",{className:"customize-widgets-welcome-guide"},Object(i.createElement)("div",{className:"customize-widgets-welcome-guide__image__wrapper"},Object(i.createElement)("picture",null,Object(i.createElement)("source",{srcSet:"https://s.w.org/images/block-editor/welcome-editor.svg",media:"(prefers-reduced-motion: reduce)"}),Object(i.createElement)("img",{className:"customize-widgets-welcome-guide__image",src:"https://s.w.org/images/block-editor/welcome-editor.gif",width:"312",height:"240",alt:""}))),Object(i.createElement)("h1",{className:"customize-widgets-welcome-guide__heading"},Object(m.__)("Welcome to block Widgets")),Object(i.createElement)("p",{className:"customize-widgets-welcome-guide__text"},r?Object(m.__)("Your theme provides 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 they’ll look on your site."):Object(m.__)("You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.")),Object(i.createElement)(u.Button,{className:"customize-widgets-welcome-guide__button",variant:"primary",onClick:()=>n("core/customize-widgets","welcomeGuide")},Object(m.__)("Got it")),Object(i.createElement)("hr",{className:"customize-widgets-welcome-guide__separator"}),!r&&Object(i.createElement)("p",{className:"customize-widgets-welcome-guide__more-info"},Object(m.__)("Want to stick with the old widgets?"),Object(i.createElement)("br",null),Object(i.createElement)(u.ExternalLink,{href:Object(m.__)("https://wordpress.org/plugins/classic-widgets/")},Object(m.__)("Get the Classic Widgets plugin."))),Object(i.createElement)("p",{className:"customize-widgets-welcome-guide__more-info"},Object(m.__)("New to the block editor?"),Object(i.createElement)("br",null),Object(i.createElement)(u.ExternalLink,{href:Object(m.__)("https://wordpress.org/support/article/wordpress-editor/")},Object(m.__)("Here's a detailed guide."))))}function ie(e){let{undo:t,redo:n,save:r}=e;return Object(b.useShortcut)("core/customize-widgets/undo",e=>{t(),e.preventDefault()}),Object(b.useShortcut)("core/customize-widgets/redo",e=>{n(),e.preventDefault()}),Object(b.useShortcut)("core/customize-widgets/save",e=>{e.preventDefault(),r()}),null}ie.Register=function(){const{registerShortcut:e,unregisterShortcut:t}=Object(l.useDispatch)(b.store);return Object(i.useEffect)(()=>(e({name:"core/customize-widgets/undo",category:"global",description:Object(m.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/customize-widgets/redo",category:"global",description:Object(m.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"}}),e({name:"core/customize-widgets/save",category:"global",description:Object(m.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),()=>{t("core/customize-widgets/undo"),t("core/customize-widgets/redo"),t("core/customize-widgets/save")}),[e]),null};var se=ie;function oe(e){const t=Object(i.useRef)(),n=Object(l.useSelect)(e=>0===e(p.store).getBlockCount());return Object(i.useEffect)(()=>{if(n&&t.current){const{ownerDocument:e}=t.current;e.activeElement&&e.activeElement!==e.body||t.current.focus()}},[n]),Object(i.createElement)(p.ButtonBlockAppender,Object(w.a)({},e,{ref:t}))}function ae(e){let{blockEditorSettings:t,sidebar:n,inserter:r,inspector:c}=e;const[s,o]=function(e){const t=Object(l.useSelect)(e=>e(W).isInserterOpened(),[]),{setIsInserterOpened:n}=Object(l.useDispatch)(W);return Object(i.useEffect)(()=>{t?e.open():e.close()},[e,t]),[t,Object(i.useCallback)(e=>{let t=e;"function"==typeof e&&(t=e(Object(l.select)(W).isInserterOpened())),n(t)},[n])]}(r),{hasUploadPermissions:a,isFixedToolbarActive:u,keepCaretInsideBlock:b,isWelcomeGuideActive:m}=Object(l.useSelect)(e=>{const{isFeatureActive:t}=e(d.i);return{hasUploadPermissions:Object(O.defaultTo)(e(j.store).canUser("create","media"),!0),isFixedToolbarActive:t("core/customize-widgets","fixedToolbar"),keepCaretInsideBlock:t("core/customize-widgets","keepCaretInsideBlock"),isWelcomeGuideActive:t("core/customize-widgets","welcomeGuide")}},[]),h=Object(i.useMemo)(()=>{let e;return a&&(e=e=>{let{onError:n,...r}=e;Object(_.uploadMedia)({wpAllowedMimeTypes:t.allowedMimeTypes,onError:e=>{let{message:t}=e;return n(t)},...r})}),{...t,__experimentalSetIsInserterOpened:o,mediaUpload:e,hasFixedToolbar:u,keepCaretInsideBlock:b,__unstableHasCustomAppender:!0}},[a,t,u,b,o]);return m?Object(i.createElement)(ce,{sidebar:n}):Object(i.createElement)(i.Fragment,null,Object(i.createElement)(p.BlockEditorKeyboardShortcuts.Register,null),Object(i.createElement)(se.Register,null),Object(i.createElement)(re,{sidebar:n,settings:h},Object(i.createElement)(se,{undo:n.undo,redo:n.redo,save:n.save}),Object(i.createElement)(K,{sidebar:n,inserter:r,isInserterOpened:s,setIsInserterOpened:o,isFixedToolbarActive:u}),Object(i.createElement)(p.CopyHandler,null,Object(i.createElement)(p.BlockTools,null,Object(i.createElement)(p.__unstableEditorStyles,{styles:h.defaultEditorStyles}),Object(i.createElement)(p.BlockSelectionClearer,null,Object(i.createElement)(p.WritingFlow,{className:"editor-styles-wrapper"},Object(i.createElement)(p.ObserveTyping,null,Object(i.createElement)(p.BlockList,{renderAppender:oe})))))),Object(i.createPortal)(Object(i.createElement)("form",{onSubmit:e=>e.preventDefault()},Object(i.createElement)(p.BlockInspector,null)),c.contentContainer[0])),Object(i.createElement)(p.__unstableBlockSettingsMenuFirstItem,null,e=>{let{onClose:t}=e;return Object(i.createElement)(E,{inspector:c,closeMenu:t})}))}const le=Object(i.createContext)();function de(e){let{sidebarControls:t,activeSidebarControl:n,children:r}=e;const c=Object(i.useMemo)(()=>({sidebarControls:t,activeSidebarControl:n}),[t,n]);return Object(i.createElement)(le.Provider,{value:c},r)}function ue(e){let{api:t,sidebarControls:n,blockEditorSettings:r}=e;const[c,s]=Object(i.useState)(null),o=document.getElementById("customize-theme-controls"),a=Object(i.useRef)();!function(e,t){const{hasSelectedBlock:n,hasMultiSelection:r}=Object(l.useSelect)(p.store),{clearSelectedBlock:c}=Object(l.useDispatch)(p.store);Object(i.useEffect)(()=>{if(t.current&&e){const a=e.inspector,l=e.container[0],d=l.ownerDocument,u=d.defaultView;function i(e){!n()&&!r()||!e||!d.contains(e)||l.contains(e)||t.current.contains(e)||e.closest('[role="dialog"]')||a.expanded()||c()}function s(e){i(e.target)}function o(){i(d.activeElement)}return d.addEventListener("mousedown",s),u.addEventListener("blur",o),()=>{d.removeEventListener("mousedown",s),u.removeEventListener("blur",o)}}},[t,e,n,r,c])}(c,a),Object(i.useEffect)(()=>{const e=n.map(e=>e.subscribe(t=>{t&&s(e)}));return()=>{e.forEach(e=>e())}},[n]);const d=c&&Object(i.createPortal)(Object(i.createElement)(f,null,Object(i.createElement)(ae,{key:c.id,blockEditorSettings:r,sidebar:c.sidebarAdapter,inserter:c.inserter,inspector:c.inspector})),c.container[0]),m=o&&Object(i.createPortal)(Object(i.createElement)("div",{className:"customize-widgets-popover",ref:a},Object(i.createElement)(u.Popover.Slot,null)),o);return Object(i.createElement)(b.ShortcutProvider,null,Object(i.createElement)(u.SlotFillProvider,null,Object(i.createElement)(de,{sidebarControls:n,activeSidebarControl:c},Object(i.createElement)(te,{api:t,sidebarControls:n},d,m))))}function be(){const{wp:{customize:e}}=window;return class extends e.Section{ready(){const t=function(){const{wp:{customize:e}}=window;return class extends e.Section{constructor(e,t){super(e,t),this.parentSection=t.parentSection,this.returnFocusWhenClose=null,this._isOpen=!1}get isOpen(){return this._isOpen}set isOpen(e){this._isOpen=e,this.triggerActiveCallbacks()}ready(){this.contentContainer[0].classList.add("customize-widgets-layout__inspector")}isContextuallyActive(){return this.isOpen}onChangeExpanded(e,t){super.onChangeExpanded(e,t),this.parentSection&&!t.unchanged&&(e?this.parentSection.collapse({manualTransition:!0}):this.parentSection.expand({manualTransition:!0,completeCallback:()=>{this.returnFocusWhenClose&&!this.contentContainer[0].contains(this.returnFocusWhenClose)&&this.returnFocusWhenClose.focus()}}))}open(){let{returnFocusWhenClose:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.isOpen=!0,this.returnFocusWhenClose=e,this.expand({allowMultiple:!0})}close(){this.collapse({allowMultiple:!0})}collapse(e){this.isOpen=!1,super.collapse(e)}triggerActiveCallbacks(){this.active.callbacks.fireWith(this.active,[!1,!0])}}}();this.inspector=new t("widgets-inspector-"+this.id,{title:Object(m.__)("Block Settings"),parentSection:this,customizeAction:[Object(m.__)("Customizing"),Object(m.__)("Widgets"),this.params.title].join(" ▸ ")}),e.section.add(this.inspector),this.contentContainer[0].classList.add("customize-widgets__sidebar-section")}hasSubSectionOpened(){return this.inspector.expanded()}onChangeExpanded(e,t){const n=this.controls(),r={...t,completeCallback(){var c;n.forEach(t=>{var n;null===(n=t.onChangeSectionExpanded)||void 0===n||n.call(t,e,r)}),null===(c=t.completeCallback)||void 0===c||c.call(t)}};r.manualTransition?e?(this.contentContainer.addClass(["busy","open"]),this.contentContainer.removeClass("is-sub-section-open"),this.contentContainer.closest(".wp-full-overlay").addClass("section-open"),this.contentContainer.one("transitionend",()=>{this.contentContainer.removeClass("busy"),r.completeCallback()})):(this.contentContainer.addClass(["busy","is-sub-section-open"]),this.contentContainer.closest(".wp-full-overlay").addClass("section-open"),this.contentContainer.removeClass("open"),this.contentContainer.one("transitionend",()=>{this.contentContainer.removeClass("busy"),r.completeCallback()})):super.onChangeExpanded(e,r)}}}const{wp:me}=window;function pe(e){const t=e.match(/^(.+)-(\d+)$/);return t?{idBase:t[1],number:parseInt(t[2],10)}:{idBase:e}}function he(e){const{idBase:t,number:n}=pe(e);return n?`widget_${t}[${n}]`:"widget_"+t}class ge{constructor(e,t){this.setting=e,this.api=t,this.locked=!1,this.widgetsCache=new WeakMap,this.subscribers=new Set,this.history=[this._getWidgetIds().map(e=>this.getWidget(e))],this.historyIndex=0,this.historySubscribers=new Set,this._debounceSetHistory=function(e,t,n){let r,c=!1;function i(){for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];const a=(c?t:e).apply(this,s);return c=!0,clearTimeout(r),r=setTimeout(()=>{c=!1},n),a}return i.cancel=()=>{c=!1,clearTimeout(r)},i}(this._pushHistory,this._replaceHistory,1e3),this.setting.bind(this._handleSettingChange.bind(this)),this.api.bind("change",this._handleAllSettingsChange.bind(this)),this.undo=this.undo.bind(this),this.redo=this.redo.bind(this),this.save=this.save.bind(this)}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}getWidgets(){return this.history[this.historyIndex]}_emit(){for(const e of this.subscribers)e(...arguments)}_getWidgetIds(){return this.setting.get()}_pushHistory(){this.history=[...this.history.slice(0,this.historyIndex+1),this._getWidgetIds().map(e=>this.getWidget(e))],this.historyIndex+=1,this.historySubscribers.forEach(e=>e())}_replaceHistory(){this.history[this.historyIndex]=this._getWidgetIds().map(e=>this.getWidget(e))}_handleSettingChange(){if(this.locked)return;const e=this.getWidgets();this._pushHistory(),this._emit(e,this.getWidgets())}_handleAllSettingsChange(e){if(this.locked)return;if(!e.id.startsWith("widget_"))return;const t=Y(e.id);if(!this.setting.get().includes(t))return;const n=this.getWidgets();this._pushHistory(),this._emit(n,this.getWidgets())}_createWidget(e){const t=me.customize.Widgets.availableWidgets.findWhere({id_base:e.idBase});let n=e.number;t.get("is_multi")&&!n&&(t.set("multi_number",t.get("multi_number")+1),n=t.get("multi_number"));const r=n?`widget_${e.idBase}[${n}]`:"widget_"+e.idBase,c={transport:me.customize.Widgets.data.selectiveRefreshableWidgets[t.get("id_base")]?"postMessage":"refresh",previewer:this.setting.previewer};this.api.create(r,r,"",c).set(e.instance);return Y(r)}_removeWidget(e){const t=he(e.id),n=this.api(t);if(n){const e=n.get();this.widgetsCache.delete(e)}this.api.remove(t)}_updateWidget(e){const t=this.getWidget(e.id);if(t===e)return e.id;if(t.idBase&&e.idBase&&t.idBase===e.idBase){const t=he(e.id);return this.api(t).set(e.instance),e.id}return this._removeWidget(e),this._createWidget(e)}getWidget(e){if(!e)return null;const{idBase:t,number:n}=pe(e),r=he(e),c=this.api(r);if(!c)return null;const i=c.get();if(this.widgetsCache.has(i))return this.widgetsCache.get(i);const s={id:e,idBase:t,number:n,instance:i};return this.widgetsCache.set(i,s),s}_updateWidgets(e){this.locked=!0;const t=[],n=e.map(e=>{if(e.id&&this.getWidget(e.id))return t.push(null),this._updateWidget(e);const n=this._createWidget(e);return t.push(n),n});return this.getWidgets().filter(e=>!n.includes(e.id)).forEach(e=>this._removeWidget(e)),this.setting.set(n),this.locked=!1,t}setWidgets(e){const t=this._updateWidgets(e);return this._debounceSetHistory(),t}hasUndo(){return this.historyIndex>0}hasRedo(){return this.historyIndex<this.history.length-1}_seek(e){const t=this.getWidgets();this.historyIndex=e;const n=this.history[this.historyIndex];this._updateWidgets(n),this._emit(t,this.getWidgets()),this.historySubscribers.forEach(e=>e()),this._debounceSetHistory.cancel()}undo(){this.hasUndo()&&this._seek(this.historyIndex-1)}redo(){this.hasRedo()&&this._seek(this.historyIndex+1)}subscribeHistory(e){return this.historySubscribers.add(e),()=>{this.historySubscribers.delete(e)}}save(){this.api.previewer.save()}}var fe=n("1CF3");function Oe(){const{wp:{customize:e}}=window;return class extends e.Control{constructor(){super(...arguments),this.subscribers=new Set}ready(){const t=function(){const{wp:{customize:e}}=window,t=e.OuterSection;return e.OuterSection=class extends t{onChangeExpanded(t,n){return t&&e.section.each(e=>{"outer"===e.params.type&&e.id!==this.id&&e.expanded()&&e.collapse()}),super.onChangeExpanded(t,n)}},e.sectionConstructor.outer=e.OuterSection,class extends e.OuterSection{constructor(){super(...arguments),this.params.type="outer",this.activeElementBeforeExpanded=null;this.contentContainer[0].ownerDocument.defaultView.addEventListener("keydown",e=>{!this.expanded()||e.keyCode!==k.ESCAPE&&"Escape"!==e.code||e.defaultPrevented||(e.preventDefault(),e.stopPropagation(),Object(l.dispatch)(W).setIsInserterOpened(!1))},!0),this.contentContainer.addClass("widgets-inserter"),this.isFromInternalAction=!1,this.expanded.bind(()=>{this.isFromInternalAction||Object(l.dispatch)(W).setIsInserterOpened(this.expanded()),this.isFromInternalAction=!1})}open(){if(!this.expanded()){const e=this.contentContainer[0];this.activeElementBeforeExpanded=e.ownerDocument.activeElement,this.isFromInternalAction=!0,this.expand({completeCallback(){const t=fe.focus.tabbable.find(e)[1];t&&t.focus()}})}}close(){if(this.expanded()){const e=this.contentContainer[0],t=e.ownerDocument.activeElement;this.isFromInternalAction=!0,this.collapse({completeCallback(){e.contains(t)&&this.activeElementBeforeExpanded&&this.activeElementBeforeExpanded.focus()}})}}}}();this.inserter=new t("widgets-inserter-"+this.id,{}),e.section.add(this.inserter),this.sectionInstance=e.section(this.section()),this.inspector=this.sectionInstance.inspector,this.sidebarAdapter=new ge(this.setting,e)}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}onChangeSectionExpanded(e,t){t.unchanged||(e||Object(l.dispatch)(W).setIsInserterOpened(!1),this.subscribers.forEach(n=>n(e,t)))}}}var je=n("g56x");const _e=Object(h.createHigherOrderComponent)(e=>t=>{let n=Object(o.getWidgetIdFromBlock)(t);const r=function(){const{sidebarControls:e}=Object(i.useContext)(le);return e}(),c=function(){const{activeSidebarControl:e}=Object(i.useContext)(le);return e}(),s=(null==r?void 0:r.length)>1,a=t.name,d=t.clientId,u=Object(l.useSelect)(e=>e(p.store).canInsertBlockType(a,""),[a]),b=Object(l.useSelect)(e=>e(p.store).getBlock(d),[d]),{removeBlock:m}=Object(l.useDispatch)(p.store),[,h]=ne();return Object(i.createElement)(i.Fragment,null,Object(i.createElement)(e,t),s&&u&&Object(i.createElement)(p.BlockControls,null,Object(i.createElement)(o.MoveToWidgetArea,{widgetAreas:r.map(e=>({id:e.id,name:e.params.label,description:e.params.description})),currentWidgetAreaId:null==c?void 0:c.id,onSelect:function(e){const t=r.find(t=>t.id===e);if(n){const e=c.setting,r=t.setting;e(Object(O.without)(e(),n)),r([...r(),n])}else{const e=t.sidebarAdapter;m(d);const r=e.setWidgets([...e.getWidgets(),X(b)]);n=r.reverse().find(e=>!!e)}h(n)}})))},"withMoveToSidebarToolbarItem");Object(je.addFilter)("editor.BlockEdit","core/customize-widgets/block-edit",_e);Object(je.addFilter)("editor.MediaUpload","core/edit-widgets/replace-media-upload",()=>_.MediaUpload);const{wp:we}=window,Ee=Object(h.createHigherOrderComponent)(e=>t=>{var n,r;const{idBase:c}=t.attributes,s=null!==(n=null===(r=we.customize.Widgets.data.availableWidgets.find(e=>e.id_base===c))||void 0===r?void 0:r.is_wide)&&void 0!==n&&n;return Object(i.createElement)(e,Object(w.a)({},t,{isWide:s}))},"withWideWidgetDisplay");Object(je.addFilter)("editor.BlockEdit","core/customize-widgets/wide-widget-display",Ee);const{wp:ve}=window,ye=["core/more","core/block","core/freeform","core/template-part"];function ke(e,t){Object(l.dispatch)(d.i).setFeatureDefaults("core/customize-widgets",{fixedToolbar:!1,welcomeGuide:!0}),Object(l.dispatch)(a.store).__experimentalReapplyBlockTypeFilters();const n=Object(s.__experimentalGetCoreBlocks)().filter(e=>!(ye.includes(e.name)||e.name.startsWith("core/post")||e.name.startsWith("core/query")||e.name.startsWith("core/site")||e.name.startsWith("core/navigation")));Object(s.registerCoreBlocks)(n),Object(o.registerLegacyWidgetBlock)(),Object(o.registerLegacyWidgetVariations)(t),Object(o.registerWidgetGroupBlock)(),Object(a.setFreeformContentHandlerName)("core/html");const r=Oe();ve.customize.sectionConstructor.sidebar=be(),ve.customize.controlConstructor.sidebar_block_editor=r;const c=document.createElement("div");document.body.appendChild(c),ve.customize.bind("ready",()=>{const e=[];ve.customize.control.each(t=>{t instanceof r&&e.push(t)}),Object(i.render)(Object(i.createElement)(ue,{api:ve.customize,sidebarControls:e,blockEditorSettings:t}),c)})}},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,n){"use strict";var r=n("GRId"),c=n("Tqx9");const i=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.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,n){"use strict";var r=n("GRId"),c=n("Tqx9");const i=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.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},Ntru:function(e,t,n){"use strict";var r=n("GRId"),c=n("Tqx9");const i=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.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},Q4Sy:function(e,t,n){"use strict";var r=n("GRId"),c=n("Tqx9");const i=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.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,n){"use strict";var r=n("GRId"),c=n("Tqx9");const i=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.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,n){var r;
|
||
/*!
|
||
Copyright (c) 2018 Jed Watson.
|
||
Licensed under the MIT License (MIT), see
|
||
http://jedwatson.github.io/classnames
|
||
*/!function(){"use strict";var n={}.hasOwnProperty;function c(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var i=typeof r;if("string"===i||"number"===i)e.push(r);else if(Array.isArray(r)){if(r.length){var s=c.apply(null,r);s&&e.push(s)}}else if("object"===i)if(r.toString===Object.prototype.toString)for(var o in r)n.call(r,o)&&r[o]&&e.push(o);else e.push(r.toString())}}return e.join(" ")}e.exports?(c.default=c,e.exports=c):void 0===(r=function(){return c}.apply(t,[]))||(e.exports=r)}()},Tqx9:function(e,t){e.exports=window.wp.primitives},TvNi:function(e,t){e.exports=window.wp.plugins},U60i:function(e,t,n){"use strict";n.d(t,"b",(function(){return K})),n.d(t,"c",(function(){return D})),n.d(t,"d",(function(){return $})),n.d(t,"e",(function(){return Y})),n.d(t,"h",(function(){return V})),n.d(t,"f",(function(){return Z})),n.d(t,"g",(function(){return ee})),n.d(t,"a",(function(){return R})),n.d(t,"i",(function(){return W}));var r={};n.r(r),n.d(r,"enableComplementaryArea",(function(){return v})),n.d(r,"disableComplementaryArea",(function(){return y})),n.d(r,"pinItem",(function(){return C})),n.d(r,"unpinItem",(function(){return x})),n.d(r,"toggleFeature",(function(){return S})),n.d(r,"setFeatureValue",(function(){return I})),n.d(r,"setFeatureDefaults",(function(){return z}));var c={};n.r(c),n.d(c,"getActiveComplementaryArea",(function(){return T})),n.d(c,"isItemPinned",(function(){return B})),n.d(c,"isFeatureActive",(function(){return N}));var i=n("wx14"),s=n("GRId"),o=n("TSYQ"),a=n.n(o),l=n("tI+e"),d=n("1ZqX"),u=n("l3Sj"),b=n("RMJe"),m=n("URob"),p=n("Xxwi"),h=n("KEfo"),g=n("bWcr"),f=n("YLtl");const O=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:n,defaults:r}=t;return{...e,[n]:{...e[n],...r}}}return e}}),j=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:n,featureName:r,value:c}=t;return{...e,[n]:{...e[n],[r]:c}}}return e}}),_=Object(d.combineReducers)({singleEnableItems:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,itemType:n,scope:r,item:c}=arguments.length>1?arguments[1]:void 0;return"SET_SINGLE_ENABLE_ITEM"===t&&n&&r?{...e,[n]:{...e[n],[r]:c||null}}:e},multipleEnableItems:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,itemType:n,scope:r,item:c,isEnable:i}=arguments.length>1?arguments[1]:void 0;if("SET_MULTIPLE_ENABLE_ITEM"!==t||!n||!r||!c||Object(f.get)(e,[n,r,c])===i)return e;const s=e[n]||{},o=s[r]||{};return{...e,[n]:{...s,[r]:{...o,[c]:i||!1}}}}});var w=Object(d.combineReducers)({enableItems:_,preferenceDefaults:O,preferences:j});function E(e,t,n){return{type:"SET_SINGLE_ENABLE_ITEM",itemType:e,scope:t,item:n}}function v(e,t){return E("complementaryArea",e,t)}function y(e){return E("complementaryArea",e,void 0)}function k(e,t,n,r){return{type:"SET_MULTIPLE_ENABLE_ITEM",itemType:e,scope:t,item:n,isEnable:r}}function C(e,t){return k("pinnedItems",e,t,!0)}function x(e,t){return k("pinnedItems",e,t,!1)}function S(e,t){return function(n){let{select:r,dispatch:c}=n;const i=r.isFeatureActive(e,t);c.setFeatureValue(e,t,!i)}}function I(e,t,n){return{type:"SET_FEATURE_VALUE",scope:e,featureName:t,value:!!n}}function z(e,t){return{type:"SET_FEATURE_DEFAULTS",scope:e,defaults:t}}function T(e,t){return function(e,t,n){return Object(f.get)(e.enableItems.singleEnableItems,[t,n])}(e,"complementaryArea",t)}function B(e,t,n){return!1!==function(e,t,n,r){return Object(f.get)(e.enableItems.multipleEnableItems,[t,n,r])}(e,"pinnedItems",t,n)}function N(e,t,n){var r,c;const i=null===(r=e.preferences.features[t])||void 0===r?void 0:r[n];return!!(void 0!==i?i:null===(c=e.preferenceDefaults.features[t])||void 0===c?void 0:c[n])}const W=Object(d.createReduxStore)("core/interface",{reducer:w,actions:r,selectors:c,persist:["enableItems","preferences"],__experimentalUseThunks:!0});Object(d.registerStore)("core/interface",{reducer:w,actions:r,selectors:c,persist:["enableItems","preferences"],__experimentalUseThunks:!0});var A=n("TvNi"),F=Object(A.withPluginContext)((e,t)=>({icon:t.icon||e.icon,identifier:t.identifier||`${e.name}/${t.name}`}));var M=F((function(e){let{as:t=l.Button,scope:n,identifier:r,icon:c,selectedIcon:o,...a}=e;const u=t,b=Object(d.useSelect)(e=>e(W).getActiveComplementaryArea(n)===r,[r]),{enableComplementaryArea:m,disableComplementaryArea:p}=Object(d.useDispatch)(W);return Object(s.createElement)(u,Object(i.a)({icon:o&&b?o:c,onClick:()=>{b?p(n):m(n,r)}},Object(f.omit)(a,["name"])))}));var P=e=>{let{smallScreenTitle:t,children:n,className:r,toggleButtonProps:c}=e;const o=Object(s.createElement)(M,Object(i.a)({icon:g.a},c));return Object(s.createElement)(s.Fragment,null,Object(s.createElement)("div",{className:"components-panel__header interface-complementary-area-header__small"},t&&Object(s.createElement)("span",{className:"interface-complementary-area-header__small-title"},t),o),Object(s.createElement)("div",{className:a()("components-panel__header","interface-complementary-area-header",r),tabIndex:-1},n,o))};function L(e){let{name:t,as:n=l.Button,onClick:r,...c}=e;return Object(s.createElement)(l.Fill,{name:t},e=>{let{onClick:t}=e;return Object(s.createElement)(n,Object(i.a)({onClick:r||t?function(){(r||f.noop)(...arguments),(t||f.noop)(...arguments)}:void 0},c))})}L.Slot=function(e){let{name:t,as:n=l.ButtonGroup,fillProps:r={},bubblesVirtually:c,...i}=e;return Object(s.createElement)(l.Slot,{name:t,bubblesVirtually:c,fillProps:r},e=>{if(Object(f.isEmpty)(s.Children.toArray(e)))return null;const t=[];s.Children.forEach(e,e=>{let{props:{__unstableExplicitMenuItem:n,__unstableTarget:r}}=e;r&&n&&t.push(r)});const r=s.Children.map(e,e=>!e.props.__unstableExplicitMenuItem&&t.includes(e.props.__unstableTarget)?null:e);return Object(s.createElement)(n,i,r)})};var R=L;const G=e=>Object(s.createElement)(l.MenuItem,Object(f.omit)(e,["__unstableExplicitMenuItem","__unstableTarget"]));function D(e){let{scope:t,target:n,__unstableExplicitMenuItem:r,...c}=e;return Object(s.createElement)(M,Object(i.a)({as:e=>Object(s.createElement)(R,Object(i.a)({__unstableExplicitMenuItem:r,__unstableTarget:`${t}/${n}`,as:G,name:t+"/plugin-more-menu"},e)),role:"menuitemcheckbox",selectedIcon:b.a,name:n,scope:t},c))}function U(e){let{scope:t,...n}=e;return Object(s.createElement)(l.Fill,Object(i.a)({name:"PinnedItems/"+t},n))}U.Slot=function(e){let{scope:t,className:n,...r}=e;return Object(s.createElement)(l.Slot,Object(i.a)({name:"PinnedItems/"+t},r),e=>!Object(f.isEmpty)(e)&&Object(s.createElement)("div",{className:a()(n,"interface-pinned-items")},e))};var V=U;function H(e){let{scope:t,children:n,className:r}=e;return Object(s.createElement)(l.Fill,{name:"ComplementaryArea/"+t},Object(s.createElement)("div",{className:r},n))}const q=F((function(e){let{children:t,className:n,closeLabel:r=Object(u.__)("Close plugin"),identifier:c,header:i,headerClassName:o,icon:g,isPinnable:f=!0,panelClassName:O,scope:j,name:_,smallScreenTitle:w,title:E,toggleShortcut:v,isActiveByDefault:y,showIconLabels:k=!1}=e;const{isActive:C,isPinned:x,activeArea:S,isSmall:I,isLarge:z}=Object(d.useSelect)(e=>{const{getActiveComplementaryArea:t,isItemPinned:n}=e(W),r=t(j);return{isActive:r===c,isPinned:n(j,c),activeArea:r,isSmall:e(h.store).isViewportMatch("< medium"),isLarge:e(h.store).isViewportMatch("large")}},[c,j]);!function(e,t,n,r,c){const i=Object(s.useRef)(!1),o=Object(s.useRef)(!1),{enableComplementaryArea:a,disableComplementaryArea:l}=Object(d.useDispatch)(W);Object(s.useEffect)(()=>{r&&c&&!i.current?(l(e),o.current=!0):o.current&&!c&&i.current?(o.current=!1,a(e,t)):o.current&&n&&n!==t&&(o.current=!1),c!==i.current&&(i.current=c)},[r,c,e,t,n])}(j,c,S,C,I);const{enableComplementaryArea:T,disableComplementaryArea:B,pinItem:N,unpinItem:A}=Object(d.useDispatch)(W);return Object(s.useEffect)(()=>{y&&void 0===S&&!I&&T(j,c)},[S,y,j,c,I]),Object(s.createElement)(s.Fragment,null,f&&Object(s.createElement)(V,{scope:j},x&&Object(s.createElement)(M,{scope:j,identifier:c,isPressed:C&&(!k||z),"aria-expanded":C,label:E,icon:k?b.a:g,showTooltip:!k,variant:k?"tertiary":void 0})),_&&f&&Object(s.createElement)(D,{target:_,scope:j,icon:g},E),C&&Object(s.createElement)(H,{className:a()("interface-complementary-area",n),scope:j},Object(s.createElement)(P,{className:o,closeLabel:r,onClose:()=>B(j),smallScreenTitle:w,toggleButtonProps:{label:r,shortcut:v,scope:j,identifier:c}},i||Object(s.createElement)(s.Fragment,null,Object(s.createElement)("strong",null,E),f&&Object(s.createElement)(l.Button,{className:"interface-complementary-area__pin-unpin-item",icon:x?m.a:p.a,label:x?Object(u.__)("Unpin from toolbar"):Object(u.__)("Pin to toolbar"),onClick:()=>(x?A:N)(j,c),isPressed:x,"aria-expanded":x}))),Object(s.createElement)(l.Panel,{className:O},t)))}));q.Slot=function(e){let{scope:t,...n}=e;return Object(s.createElement)(l.Slot,Object(i.a)({name:"ComplementaryArea/"+t},n))};var K=q;var $=e=>{let{isActive:t}=e;return Object(s.useEffect)(()=>{let e=!1;return document.body.classList.contains("sticky-menu")&&(e=!0,document.body.classList.remove("sticky-menu")),()=>{e&&document.body.classList.add("sticky-menu")}},[]),Object(s.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=n("K9lf");var Y=Object(s.forwardRef)((function(e,t){let{footer:n,header:r,sidebar:c,secondarySidebar:o,notices:d,content:b,drawer:m,actions:p,labels:h,className:g,shortcuts:f}=e;const O=Object(l.__unstableUseNavigateRegions)(f);!function(e){Object(s.useEffect)(()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}},[e])}("interface-interface-skeleton__html-container");const j={...{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")},...h};return Object(s.createElement)("div",Object(i.a)({},O,{ref:Object(Q.useMergeRefs)([t,O.ref]),className:a()(g,"interface-interface-skeleton",O.className,!!n&&"has-footer")}),!!m&&Object(s.createElement)("div",{className:"interface-interface-skeleton__drawer",role:"region","aria-label":j.drawer,tabIndex:"-1"},m),Object(s.createElement)("div",{className:"interface-interface-skeleton__editor"},!!r&&Object(s.createElement)("div",{className:"interface-interface-skeleton__header",role:"region","aria-label":j.header,tabIndex:"-1"},r),Object(s.createElement)("div",{className:"interface-interface-skeleton__body"},!!o&&Object(s.createElement)("div",{className:"interface-interface-skeleton__secondary-sidebar",role:"region","aria-label":j.secondarySidebar,tabIndex:"-1"},o),!!d&&Object(s.createElement)("div",{className:"interface-interface-skeleton__notices"},d),Object(s.createElement)("div",{className:"interface-interface-skeleton__content",role:"region","aria-label":j.body,tabIndex:"-1"},b),!!c&&Object(s.createElement)("div",{className:"interface-interface-skeleton__sidebar",role:"region","aria-label":j.sidebar,tabIndex:"-1"},c),!!p&&Object(s.createElement)("div",{className:"interface-interface-skeleton__actions",role:"region","aria-label":j.actions,tabIndex:"-1"},p))),!!n&&Object(s.createElement)("div",{className:"interface-interface-skeleton__footer",role:"region","aria-label":j.footer,tabIndex:"-1"},n))})),X=n("VKE3");function Z(e){let{as:t=l.DropdownMenu,className:n,label:r=Object(u.__)("Options"),popoverProps:c,toggleProps:i,children:o}=e;return Object(s.createElement)(t,{className:a()("interface-more-menu-dropdown",n),icon:X.a,label:r,popoverProps:{position:"bottom left",...c,className:a()("interface-more-menu-dropdown__content",null==c?void 0:c.className)},toggleProps:{tooltipPosition:"bottom",...i}},e=>o(e))}var J=n("gdqT");function ee(e){let{scope:t,label:n,info:r,messageActivated:c,messageDeactivated:i,shortcut:o,feature:a}=e;const m=Object(d.useSelect)(e=>e(W).isFeatureActive(t,a),[a]),{toggleFeature:p}=Object(d.useDispatch)(W);return Object(s.createElement)(l.MenuItem,{icon:m&&b.a,isSelected:m,onClick:()=>{p(t,a),m?Object(J.speak)(i||Object(u.__)("Feature deactivated")):Object(J.speak)(c||Object(u.__)("Feature activated"))},role:"menuitemcheckbox",info:r,shortcut:o},n)}},URob:function(e,t,n){"use strict";var r=n("GRId"),c=n("Tqx9");const i=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.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,n){"use strict";var r=n("GRId"),c=n("Tqx9");const i=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)(c.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"}));t.a=i},Xxwi:function(e,t,n){"use strict";var r=n("GRId"),c=n("Tqx9");const i=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.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,n){"use strict";var r=n("GRId"),c=n("Tqx9");const i=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.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},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},rl8x:function(e,t){e.exports=window.wp.isShallowEqual},"tI+e":function(e,t){e.exports=window.wp.components},wx14:function(e,t,n){"use strict";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}).apply(this,arguments)}n.d(t,"a",(function(){return r}))}}); |