HEX
Server: nginx/1.28.1
System: Linux VM-0-12-opencloudos 6.6.117-45.oc9.x86_64 #1 SMP Thu Dec 4 10:26:39 CST 2025 x86_64
User: www (1000)
PHP: 7.4.33
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.waciwang.com/wp-content/plugins/gutenberg/build/scripts/edit-post/index.min.js.map
{
  "version": 3,
  "sources": ["package-external:@wordpress/blocks", "package-external:@wordpress/block-library", "package-external:@wordpress/deprecated", "package-external:@wordpress/element", "package-external:@wordpress/data", "package-external:@wordpress/preferences", "package-external:@wordpress/widgets", "package-external:@wordpress/editor", "package-external:@wordpress/i18n", "package-external:@wordpress/components", "vendor-external:react/jsx-runtime", "package-external:@wordpress/block-editor", "package-external:@wordpress/style-engine", "package-external:@wordpress/plugins", "package-external:@wordpress/primitives", "package-external:@wordpress/notices", "package-external:@wordpress/commands", "package-external:@wordpress/url", "package-external:@wordpress/html-entities", "package-external:@wordpress/core-data", "package-external:@wordpress/compose", "package-external:@wordpress/private-apis", "package-external:@wordpress/keyboard-shortcuts", "package-external:@wordpress/api-fetch", "package-external:@wordpress/hooks", "package-external:@wordpress/keycodes", "../../../packages/edit-post/src/index.js", "../../../node_modules/clsx/dist/clsx.mjs", "../../../packages/admin-ui/src/navigable-region/index.tsx", "../../../packages/edit-post/src/components/layout/index.js", "../../../packages/global-styles-engine/src/utils/common.ts", "../../../packages/global-styles-engine/src/core/render.tsx", "../../../packages/global-styles-engine/src/utils/spacing.ts", "../../../packages/global-styles-engine/src/utils/gap.ts", "../../../packages/global-styles-engine/src/utils/layout.ts", "../../../packages/icons/src/library/arrow-up-left.tsx", "../../../packages/icons/src/library/chevron-down.tsx", "../../../packages/icons/src/library/chevron-up.tsx", "../../../packages/icons/src/library/fullscreen.tsx", "../../../packages/icons/src/library/wordpress.tsx", "../../../packages/edit-post/src/components/back-button/index.js", "../../../packages/edit-post/src/components/back-button/fullscreen-mode-close.js", "../../../packages/edit-post/src/lock-unlock.js", "../../../packages/edit-post/src/components/editor-initialization/listener-hooks.js", "../../../packages/edit-post/src/store/constants.js", "../../../packages/edit-post/src/components/editor-initialization/index.js", "../../../packages/edit-post/src/components/keyboard-shortcuts/index.js", "../../../packages/edit-post/src/store/index.js", "../../../packages/edit-post/src/store/reducer.js", "../../../packages/edit-post/src/store/actions.js", "../../../packages/edit-post/src/utils/meta-boxes.js", "../../../packages/edit-post/src/store/selectors.js", "../../../packages/edit-post/src/components/init-pattern-modal/index.js", "../../../packages/edit-post/src/components/browser-url/index.js", "../../../packages/edit-post/src/components/meta-boxes/index.js", "../../../packages/edit-post/src/components/meta-boxes/meta-boxes-area/index.js", "../../../packages/edit-post/src/components/meta-boxes/meta-box-visibility.js", "../../../packages/edit-post/src/components/more-menu/index.js", "../../../packages/edit-post/src/components/more-menu/manage-patterns-menu-item.js", "../../../packages/edit-post/src/components/more-menu/welcome-guide-menu-item.js", "../../../packages/edit-post/src/components/preferences-modal/index.js", "../../../packages/edit-post/src/components/preferences-modal/meta-boxes-section.js", "../../../packages/edit-post/src/components/preferences-modal/enable-custom-fields.js", "../../../packages/edit-post/src/components/preferences-modal/enable-panel.js", "../../../packages/edit-post/src/components/welcome-guide/index.js", "../../../packages/edit-post/src/components/welcome-guide/default.js", "../../../packages/edit-post/src/components/welcome-guide/image.js", "../../../packages/edit-post/src/components/welcome-guide/template.js", "../../../packages/edit-post/src/commands/use-commands.js", "../../../packages/edit-post/src/components/layout/use-should-iframe.js", "../../../packages/edit-post/src/hooks/use-navigate-to-entity-record.js", "../../../packages/edit-post/src/components/meta-boxes/use-meta-box-initialization.js", "../../../packages/edit-post/src/deprecated.js"],
  "sourcesContent": ["module.exports = window.wp.blocks;", "module.exports = window.wp.blockLibrary;", "module.exports = window.wp.deprecated;", "module.exports = window.wp.element;", "module.exports = window.wp.data;", "module.exports = window.wp.preferences;", "module.exports = window.wp.widgets;", "module.exports = window.wp.editor;", "module.exports = window.wp.i18n;", "module.exports = window.wp.components;", "module.exports = window.ReactJSXRuntime;", "module.exports = window.wp.blockEditor;", "module.exports = window.wp.styleEngine;", "module.exports = window.wp.plugins;", "module.exports = window.wp.primitives;", "module.exports = window.wp.notices;", "module.exports = window.wp.commands;", "module.exports = window.wp.url;", "module.exports = window.wp.htmlEntities;", "module.exports = window.wp.coreData;", "module.exports = window.wp.compose;", "module.exports = window.wp.privateApis;", "module.exports = window.wp.keyboardShortcuts;", "module.exports = window.wp.apiFetch;", "module.exports = window.wp.hooks;", "module.exports = window.wp.keycodes;", "/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot, StrictMode } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport { unlock } from './lock-unlock';\n\nconst {\n\tBackButton: __experimentalMainDashboardButton,\n\tregisterCoreBlockBindingsSources,\n} = unlock( editorPrivateApis );\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string}  id           Unique identifier for editor instance.\n * @param {string}  postType     Post type of the post to edit.\n * @param {Object}  postId       ID of the post to edit.\n * @param {?Object} settings     Editor settings object.\n * @param {Object}  initialEdits Programmatic edits to apply initially, to be\n *                               considered as non-user-initiated (bypass for\n *                               unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst isMediumOrBigger = window.matchMedia( '(min-width: 782px)' ).matches;\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\tfullscreenMode: true,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( preferencesStore ).setDefaults( 'core', {\n\t\tallowRightClickOverrides: true,\n\t\teditorMode: 'visual',\n\t\teditorTool: 'edit',\n\t\tfixedToolbar: false,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\topenPanels: [ 'post-status' ],\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tenableChoosePatternModal: true,\n\t\tisPublishSidebarEnabled: true,\n\t} );\n\n\tif ( window.__experimentalMediaProcessing ) {\n\t\tdispatch( preferencesStore ).setDefaults( 'core/media', {\n\t\t\trequireApproval: true,\n\t\t\toptimizeOnUpload: true,\n\t\t} );\n\t}\n\n\tdispatch( blocksStore ).reapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t// This behavior is disabled for small viewports.\n\tif (\n\t\tisMediumOrBigger &&\n\t\tselect( preferencesStore ).get( 'core', 'showListViewByDefault' ) &&\n\t\t! select( preferencesStore ).get( 'core', 'distractionFree' )\n\t) {\n\t\tdispatch( editorStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterCoreBlockBindingsSources();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<StrictMode>\n\t\t\t<Layout\n\t\t\t\tsettings={ settings }\n\t\t\t\tpostId={ postId }\n\t\t\t\tpostType={ postType }\n\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t/>\n\t\t</StrictMode>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as __experimentalFullscreenModeClose } from './components/back-button/fullscreen-mode-close';\nexport { __experimentalMainDashboardButton };\nexport { store } from './store';\nexport * from './deprecated';\n", "function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;", "/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Type definitions\n */\ntype NavigableRegionProps = {\n\tchildren: React.ReactNode;\n\tclassName?: string;\n\tariaLabel: string;\n\tas?: React.ElementType;\n\t[ key: string ]: any;\n};\n\n// This is a copy of the private `NavigableRegion` component from the '@wordpress/editor' private APIs.\nconst NavigableRegion = forwardRef< HTMLElement, NavigableRegionProps >(\n\t( { children, className, ariaLabel, as: Tag = 'div', ...props }, ref ) => {\n\t\treturn (\n\t\t\t<Tag\n\t\t\t\tref={ ref }\n\t\t\t\tclassName={ clsx( 'admin-ui-navigable-region', className ) }\n\t\t\t\taria-label={ ariaLabel }\n\t\t\t\trole=\"region\"\n\t\t\t\ttabIndex=\"-1\"\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</Tag>\n\t\t);\n\t}\n);\n\nNavigableRegion.displayName = 'NavigableRegion';\n\nexport default NavigableRegion;\n", "/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { NavigableRegion } from '@wordpress/admin-ui';\nimport {\n\tAutosaveMonitor,\n\tLocalAutosaveMonitor,\n\tUnsavedChangesWarning,\n\tEditorKeyboardShortcutsRegister,\n\tEditorSnackbars,\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { getLayoutStyles } from '@wordpress/global-styles-engine';\nimport { PluginArea } from '@wordpress/plugins';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { chevronDown, chevronUp } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as commandsPrivateApis } from '@wordpress/commands';\nimport { privateApis as blockLibraryPrivateApis } from '@wordpress/block-library';\nimport { addQueryArgs } from '@wordpress/url';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tIcon,\n\tResizableBox,\n\tSlotFillProvider,\n\tTooltip,\n\tVisuallyHidden,\n\t__unstableUseNavigateRegions as useNavigateRegions,\n} from '@wordpress/components';\nimport {\n\tuseEvent,\n\tuseMediaQuery,\n\tuseRefEffect,\n\tuseViewportMatch,\n} from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BackButton from '../back-button';\nimport EditorInitialization from '../editor-initialization';\nimport EditPostKeyboardShortcuts from '../keyboard-shortcuts';\nimport InitPatternModal from '../init-pattern-modal';\nimport BrowserURL from '../browser-url';\nimport MetaBoxes from '../meta-boxes';\nimport PostEditorMoreMenu from '../more-menu';\nimport WelcomeGuide from '../welcome-guide';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport useEditPostCommands from '../../commands/use-commands';\nimport { useShouldIframe } from './use-should-iframe';\nimport useNavigateToEntityRecord from '../../hooks/use-navigate-to-entity-record';\nimport { useMetaBoxInitialization } from '../meta-boxes/use-meta-box-initialization';\n\nconst { useCommandContext } = unlock( commandsPrivateApis );\nconst { Editor, FullscreenMode } = unlock( editorPrivateApis );\nconst { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );\nconst DESIGN_POST_TYPES = [\n\t'wp_template',\n\t'wp_template_part',\n\t'wp_block',\n\t'wp_navigation',\n];\n\nfunction useEditorStyles( settings ) {\n\tconst { hasThemeStyleSupport } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\thasThemeStyleSupport:\n\t\t\t\tselect( editPostStore ).isFeatureActive( 'themeStyles' ),\n\t\t};\n\t}, [] );\n\n\t// Compute the default styles.\n\treturn useMemo( () => {\n\t\tconst presetStyles =\n\t\t\tsettings.styles?.filter(\n\t\t\t\t( style ) =>\n\t\t\t\t\tstyle.__unstableType && style.__unstableType !== 'theme'\n\t\t\t) ?? [];\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...( settings?.defaultEditorStyles ?? [] ),\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles).\n\t\tconst hasThemeStyles =\n\t\t\thasThemeStyleSupport &&\n\t\t\tpresetStyles.length !== ( settings.styles?.length ?? 0 );\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif ( ! settings.disableLayoutStyles && ! hasThemeStyles ) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\treturn hasThemeStyles ? settings.styles ?? [] : defaultEditorStyles;\n\t}, [\n\t\tsettings.defaultEditorStyles,\n\t\tsettings.disableLayoutStyles,\n\t\tsettings.styles,\n\t\thasThemeStyleSupport,\n\t] );\n}\n\n/**\n * @param {Object}  props\n * @param {boolean} props.isLegacy True when the editor canvas is not in an iframe.\n */\nfunction MetaBoxesMain( { isLegacy } ) {\n\tconst [ isOpen, openHeight, hasAnyVisible ] = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { isMetaBoxLocationVisible } = select( editPostStore );\n\t\treturn [\n\t\t\t!! get( 'core/edit-post', 'metaBoxesMainIsOpen' ),\n\t\t\tget( 'core/edit-post', 'metaBoxesMainOpenHeight' ),\n\t\t\tisMetaBoxLocationVisible( 'normal' ) ||\n\t\t\t\tisMetaBoxLocationVisible( 'advanced' ) ||\n\t\t\t\tisMetaBoxLocationVisible( 'side' ),\n\t\t];\n\t}, [] );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst metaBoxesMainRef = useRef();\n\tconst isShort = useMediaQuery( '(max-height: 549px)' );\n\n\tconst [ { min, max }, setHeightConstraints ] = useState( () => ( {} ) );\n\t// Keeps the resizable area\u2019s size constraints updated taking into account\n\t// editor notices. The constraints are also used to derive the value for the\n\t// aria-valuenow attribute on the separator.\n\tconst effectSizeConstraints = useRefEffect( ( node ) => {\n\t\tconst container = node.closest(\n\t\t\t'.interface-interface-skeleton__content'\n\t\t);\n\t\tif ( ! container ) {\n\t\t\treturn;\n\t\t}\n\t\tconst noticeLists = container.querySelectorAll(\n\t\t\t':scope > .components-notice-list'\n\t\t);\n\t\tconst resizeHandle = container.querySelector(\n\t\t\t'.edit-post-meta-boxes-main__presenter'\n\t\t);\n\t\tconst deriveConstraints = () => {\n\t\t\tconst fullHeight = container.offsetHeight;\n\t\t\tlet nextMax = fullHeight;\n\t\t\tfor ( const element of noticeLists ) {\n\t\t\t\tnextMax -= element.offsetHeight;\n\t\t\t}\n\t\t\tconst nextMin = resizeHandle.offsetHeight;\n\t\t\tsetHeightConstraints( { min: nextMin, max: nextMax } );\n\t\t};\n\t\tconst observer = new window.ResizeObserver( deriveConstraints );\n\t\tobserver.observe( container );\n\t\tfor ( const element of noticeLists ) {\n\t\t\tobserver.observe( element );\n\t\t}\n\t\treturn () => observer.disconnect();\n\t}, [] );\n\n\tconst resizeDataRef = useRef( {} );\n\tconst separatorRef = useRef();\n\tconst separatorHelpId = useId();\n\n\t/**\n\t * @param {number|'auto'} [candidateHeight] Height in pixels or 'auto'.\n\t * @param {boolean}       isPersistent      Whether to persist the height in preferences.\n\t * @param {boolean}       isInstant         Whether to update the height in the DOM.\n\t */\n\tconst applyHeight = (\n\t\tcandidateHeight = 'auto',\n\t\tisPersistent,\n\t\tisInstant\n\t) => {\n\t\tif ( candidateHeight === 'auto' ) {\n\t\t\tisPersistent = false; // Just in case \u2014 \u201Cauto\u201D should never persist.\n\t\t} else {\n\t\t\tcandidateHeight = Math.min( max, Math.max( min, candidateHeight ) );\n\t\t}\n\t\tif ( isPersistent ) {\n\t\t\tsetPreference(\n\t\t\t\t'core/edit-post',\n\t\t\t\t'metaBoxesMainOpenHeight',\n\t\t\t\tcandidateHeight\n\t\t\t);\n\t\t}\n\t\t// Updates aria-valuenow only when not persisting the value because otherwise\n\t\t// it's done by the render that persisting the value causes.\n\t\telse if ( ! isShort ) {\n\t\t\tseparatorRef.current.ariaValueNow =\n\t\t\t\tgetAriaValueNow( candidateHeight );\n\t\t}\n\t\tif ( isInstant ) {\n\t\t\tmetaBoxesMainRef.current.updateSize( {\n\t\t\t\theight: candidateHeight,\n\t\t\t\t// Oddly, when the event that triggered this was not from the mouse (e.g. keydown),\n\t\t\t\t// if `width` is left unspecified a subsequent drag gesture applies a fixed\n\t\t\t\t// width and the pane fails to widen/narrow with parent width changes from\n\t\t\t\t// sidebars opening/closing or window resizes.\n\t\t\t\twidth: 'auto',\n\t\t\t} );\n\t\t}\n\t};\n\tconst getRenderValues = useEvent( () => ( { isOpen, openHeight, min } ) );\n\t// Sets the height to 'auto' when not resizable (isShort) and to the\n\t// preferred height when resizable.\n\tuseEffect( () => {\n\t\tconst fresh = getRenderValues();\n\t\t// Tests for `min` having a value to skip the first render.\n\t\tif ( fresh.min !== undefined && metaBoxesMainRef.current ) {\n\t\t\tconst usedOpenHeight = isShort ? 'auto' : fresh.openHeight;\n\t\t\tconst usedHeight = fresh.isOpen ? usedOpenHeight : fresh.min;\n\t\t\tapplyHeight( usedHeight, false, true );\n\t\t}\n\t}, [ isShort ] );\n\n\tif ( ! hasAnyVisible ) {\n\t\treturn;\n\t}\n\n\tconst contents = (\n\t\t<div\n\t\t\t// The class name 'edit-post-layout__metaboxes' is retained because some plugins use it.\n\t\t\tclassName=\"edit-post-layout__metaboxes edit-post-meta-boxes-main__liner\"\n\t\t\thidden={ ! isLegacy && ! isOpen }\n\t\t>\n\t\t\t<MetaBoxes location=\"normal\" />\n\t\t\t<MetaBoxes location=\"advanced\" />\n\t\t</div>\n\t);\n\n\tif ( isLegacy ) {\n\t\treturn contents;\n\t}\n\n\tconst isAutoHeight = openHeight === undefined;\n\tconst getAriaValueNow = ( height ) =>\n\t\tMath.round( ( ( height - min ) / ( max - min ) ) * 100 );\n\tconst usedAriaValueNow =\n\t\tmax === undefined || isAutoHeight ? 50 : getAriaValueNow( openHeight );\n\n\tconst persistIsOpen = ( to = ! isOpen ) =>\n\t\tsetPreference( 'core/edit-post', 'metaBoxesMainIsOpen', to );\n\n\t// TODO: Support more/all keyboard interactions from the window splitter pattern:\n\t// https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/\n\tconst onSeparatorKeyDown = ( event ) => {\n\t\tconst delta = { ArrowUp: 20, ArrowDown: -20 }[ event.key ];\n\t\tif ( delta ) {\n\t\t\tconst pane = metaBoxesMainRef.current.resizable;\n\t\t\tconst fromHeight = isAutoHeight ? pane.offsetHeight : openHeight;\n\t\t\tconst nextHeight = delta + fromHeight;\n\t\t\tapplyHeight( nextHeight, true, true );\n\t\t\tpersistIsOpen( nextHeight > min );\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\tconst paneLabel = __( 'Meta Boxes' );\n\n\tconst toggle = (\n\t\t<button\n\t\t\taria-expanded={ isOpen }\n\t\t\tonClick={ ( { detail } ) => {\n\t\t\t\tconst { isToggleInferred } = resizeDataRef.current;\n\t\t\t\tif ( isShort || ! detail || isToggleInferred ) {\n\t\t\t\t\tpersistIsOpen();\n\t\t\t\t\tconst usedOpenHeight = isShort ? 'auto' : openHeight;\n\t\t\t\t\tconst usedHeight = isOpen ? min : usedOpenHeight;\n\t\t\t\t\tapplyHeight( usedHeight, false, true );\n\t\t\t\t}\n\t\t\t} }\n\t\t\t// Prevents resizing in short viewports.\n\t\t\t{ ...( isShort && {\n\t\t\t\tonMouseDown: ( event ) => event.stopPropagation(),\n\t\t\t\tonTouchStart: ( event ) => event.stopPropagation(),\n\t\t\t} ) }\n\t\t>\n\t\t\t{ paneLabel }\n\t\t\t<Icon icon={ isOpen ? chevronUp : chevronDown } />\n\t\t</button>\n\t);\n\n\tconst separator = ! isShort && (\n\t\t<>\n\t\t\t<Tooltip text={ __( 'Drag to resize' ) }>\n\t\t\t\t<button // eslint-disable-line jsx-a11y/role-supports-aria-props\n\t\t\t\t\tref={ separatorRef }\n\t\t\t\t\trole=\"separator\" // eslint-disable-line jsx-a11y/no-interactive-element-to-noninteractive-role\n\t\t\t\t\taria-valuenow={ usedAriaValueNow }\n\t\t\t\t\taria-label={ __( 'Drag to resize' ) }\n\t\t\t\t\taria-describedby={ separatorHelpId }\n\t\t\t\t\tonKeyDown={ onSeparatorKeyDown }\n\t\t\t\t/>\n\t\t\t</Tooltip>\n\t\t\t<VisuallyHidden id={ separatorHelpId }>\n\t\t\t\t{ __(\n\t\t\t\t\t'Use up and down arrow keys to resize the meta box panel.'\n\t\t\t\t) }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n\n\tconst paneProps = /** @type {Parameters<typeof ResizableBox>[0]} */ ( {\n\t\tas: NavigableRegion,\n\t\tref: metaBoxesMainRef,\n\t\tclassName: 'edit-post-meta-boxes-main',\n\t\tdefaultSize: { height: isOpen ? openHeight : 0 },\n\t\tminHeight: min,\n\t\tmaxHeight: max,\n\t\tenable: { top: true },\n\t\thandleClasses: { top: 'edit-post-meta-boxes-main__presenter' },\n\t\thandleComponent: {\n\t\t\ttop: (\n\t\t\t\t<>\n\t\t\t\t\t{ toggle }\n\t\t\t\t\t{ separator }\n\t\t\t\t</>\n\t\t\t),\n\t\t},\n\t\t// Avoids hiccups while dragging over objects like iframes and ensures that\n\t\t// the event to end the drag is captured by the target (resize handle)\n\t\t// whether or not it\u2019s under the pointer.\n\t\tonPointerDown: ( { pointerId, target } ) => {\n\t\t\tif ( separatorRef.current?.parentElement.contains( target ) ) {\n\t\t\t\ttarget.setPointerCapture( pointerId );\n\t\t\t}\n\t\t},\n\t\tonResizeStart: ( { timeStamp }, direction, elementRef ) => {\n\t\t\tif ( isAutoHeight ) {\n\t\t\t\t// Sets the starting height to avoid visual jumps in height and\n\t\t\t\t// aria-valuenow being `NaN` for the first (few) resize events.\n\t\t\t\tapplyHeight( elementRef.offsetHeight, false, true );\n\t\t\t}\n\t\t\telementRef.classList.add( 'is-resizing' );\n\t\t\tresizeDataRef.current = { timeStamp, maxDelta: 0 };\n\t\t},\n\t\tonResize: ( event, direction, elementRef, delta ) => {\n\t\t\tconst { maxDelta } = resizeDataRef.current;\n\t\t\tconst newDelta = Math.abs( delta.height );\n\t\t\tresizeDataRef.current.maxDelta = Math.max( maxDelta, newDelta );\n\t\t\tapplyHeight( metaBoxesMainRef.current.state.height );\n\t\t},\n\t\tonResizeStop: ( event, direction, elementRef ) => {\n\t\t\telementRef.classList.remove( 'is-resizing' );\n\t\t\tconst duration = event.timeStamp - resizeDataRef.current.timeStamp;\n\t\t\tconst wasSeparator = event.target === separatorRef.current;\n\t\t\tconst { maxDelta } = resizeDataRef.current;\n\t\t\tconst isToggleInferred =\n\t\t\t\tmaxDelta < 1 || ( duration < 144 && maxDelta < 5 );\n\t\t\tif ( isShort || ( ! wasSeparator && isToggleInferred ) ) {\n\t\t\t\tresizeDataRef.current.isToggleInferred = true;\n\t\t\t} else {\n\t\t\t\tconst { height } = metaBoxesMainRef.current.state;\n\t\t\t\tconst nextIsOpen = height > min;\n\t\t\t\tpersistIsOpen( nextIsOpen );\n\t\t\t\t// Persists height only if still open. This is so that when closed by a drag the\n\t\t\t\t// prior height can be restored by the toggle button instead of having to drag\n\t\t\t\t// the pane open again. Also, if already closed, a click on the separator won\u2019t\n\t\t\t\t// persist the height as the minimum.\n\t\t\t\tif ( nextIsOpen ) {\n\t\t\t\t\tapplyHeight( height, true );\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t} );\n\n\treturn (\n\t\t<ResizableBox aria-label={ paneLabel } { ...paneProps }>\n\t\t\t<meta ref={ effectSizeConstraints } />\n\t\t\t{ contents }\n\t\t</ResizableBox>\n\t);\n}\n\nfunction Layout( {\n\tpostId: initialPostId,\n\tpostType: initialPostType,\n\tsettings,\n\tinitialEdits,\n} ) {\n\tuseEditPostCommands();\n\tconst shouldIframe = useShouldIframe();\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tcurrentPost: { postId: currentPostId, postType: currentPostType },\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord,\n\t\tpreviousSelectedBlockPath,\n\t} = useNavigateToEntityRecord(\n\t\tinitialPostId,\n\t\tinitialPostType,\n\t\t'post-only'\n\t);\n\tconst isEditingTemplate = currentPostType === 'wp_template';\n\tconst {\n\t\tmode,\n\t\tisFullscreenActive,\n\t\thasResolvedMode,\n\t\thasActiveMetaboxes,\n\t\thasBlockSelected,\n\t\tshowIconLabels,\n\t\tisDistractionFree,\n\t\tshowMetaBoxes,\n\t\tisWelcomeGuideVisible,\n\t\ttemplateId,\n\t\tisDevicePreview,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { isFeatureActive, hasMetaBoxes } = select( editPostStore );\n\t\t\tconst { canUser, getPostType, getTemplateId } = unlock(\n\t\t\t\tselect( coreStore )\n\t\t\t);\n\n\t\t\tconst supportsTemplateMode = settings.supportsTemplateMode;\n\t\t\tconst isViewable =\n\t\t\t\tgetPostType( currentPostType )?.viewable ?? false;\n\t\t\tconst canViewTemplate = canUser( 'read', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\t\t\tconst { getBlockSelectionStart, isZoomOut } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\tconst { getEditorMode, getDefaultRenderingMode, getDeviceType } =\n\t\t\t\tunlock( select( editorStore ) );\n\t\t\tconst isNotDesignPostType =\n\t\t\t\t! DESIGN_POST_TYPES.includes( currentPostType );\n\t\t\tconst isDirectlyEditingPattern =\n\t\t\t\tcurrentPostType === 'wp_block' &&\n\t\t\t\t! onNavigateToPreviousEntityRecord;\n\t\t\tconst _templateId = getTemplateId( currentPostType, currentPostId );\n\t\t\tconst defaultMode = getDefaultRenderingMode( currentPostType );\n\n\t\t\treturn {\n\t\t\t\tmode: getEditorMode(),\n\t\t\t\tisFullscreenActive: isFeatureActive( 'fullscreenMode' ),\n\t\t\t\thasActiveMetaboxes: hasMetaBoxes(),\n\t\t\t\thasResolvedMode:\n\t\t\t\t\tdefaultMode === 'template-locked'\n\t\t\t\t\t\t? !! _templateId\n\t\t\t\t\t\t: defaultMode !== undefined,\n\t\t\t\thasBlockSelected: !! getBlockSelectionStart(),\n\t\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tshowMetaBoxes:\n\t\t\t\t\t( isNotDesignPostType && ! isZoomOut() ) ||\n\t\t\t\t\tisDirectlyEditingPattern,\n\t\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t\t\ttemplateId:\n\t\t\t\t\tsupportsTemplateMode &&\n\t\t\t\t\tisViewable &&\n\t\t\t\t\tcanViewTemplate &&\n\t\t\t\t\t! isEditingTemplate\n\t\t\t\t\t\t? _templateId\n\t\t\t\t\t\t: null,\n\t\t\t\tisDevicePreview: getDeviceType() !== 'Desktop',\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tcurrentPostType,\n\t\t\tcurrentPostId,\n\t\t\tisEditingTemplate,\n\t\t\tsettings.supportsTemplateMode,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t]\n\t);\n\n\tuseMetaBoxInitialization( hasActiveMetaboxes && hasResolvedMode );\n\n\t// Set the right context for the command palette\n\tconst commandContext = hasBlockSelected\n\t\t? 'block-selection-edit'\n\t\t: 'entity-edit';\n\tuseCommandContext( commandContext );\n\tconst styles = useEditorStyles( settings );\n\tconst editorSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tstyles,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t\tdefaultRenderingMode: 'post-only',\n\t\t} ),\n\t\t[\n\t\t\tsettings,\n\t\t\tstyles,\n\t\t\tonNavigateToEntityRecord,\n\t\t\tonNavigateToPreviousEntityRecord,\n\t\t]\n\t);\n\n\t// We need to add the show-icon-labels class to the body element so it is applied to modals.\n\tif ( showIconLabels ) {\n\t\tdocument.body.classList.add( 'show-icon-labels' );\n\t} else {\n\t\tdocument.body.classList.remove( 'show-icon-labels' );\n\t}\n\n\tconst navigateRegionsProps = useNavigateRegions();\n\n\tconst className = clsx( 'edit-post-layout', 'is-mode-' + mode, {\n\t\t'has-metaboxes': hasActiveMetaboxes,\n\t} );\n\n\tfunction onPluginAreaError( name ) {\n\t\tcreateErrorNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: plugin name */\n\t\t\t\t__(\n\t\t\t\t\t'The \"%s\" plugin has encountered an error and cannot be rendered.'\n\t\t\t\t),\n\t\t\t\tname\n\t\t\t)\n\t\t);\n\t}\n\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.location.href = addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\ttrashed: 1,\n\t\t\t\t\t\t\tpost_type: items[ 0 ].type,\n\t\t\t\t\t\t\tids: items[ 0 ].id,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post or template, e.g: \"Hello world\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\tdecodeEntities( title ) || __( '(no title)' )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\tconst postId = newItem.id;\n\t\t\t\t\t\t\t\t\t\t\tdocument.location.href =\n\t\t\t\t\t\t\t\t\t\t\t\taddQueryArgs( 'post.php', {\n\t\t\t\t\t\t\t\t\t\t\t\t\tpost: postId,\n\t\t\t\t\t\t\t\t\t\t\t\t\taction: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ createSuccessNotice ]\n\t);\n\n\tconst initialPost = useMemo( () => {\n\t\treturn {\n\t\t\ttype: initialPostType,\n\t\t\tid: initialPostId,\n\t\t};\n\t}, [ initialPostType, initialPostId ] );\n\n\tconst backButton =\n\t\tuseViewportMatch( 'medium' ) && isFullscreenActive ? (\n\t\t\t<BackButton initialPost={ initialPost } />\n\t\t) : null;\n\n\treturn (\n\t\t<SlotFillProvider>\n\t\t\t<ErrorBoundary canCopyContent>\n\t\t\t\t<WelcomeGuide postType={ currentPostType } />\n\t\t\t\t<div\n\t\t\t\t\tclassName={ navigateRegionsProps.className }\n\t\t\t\t\t{ ...navigateRegionsProps }\n\t\t\t\t\tref={ navigateRegionsProps.ref }\n\t\t\t\t>\n\t\t\t\t\t<Editor\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\tpostType={ currentPostType }\n\t\t\t\t\t\tpostId={ currentPostId }\n\t\t\t\t\t\ttemplateId={ templateId }\n\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\tforceIsDirty={ hasActiveMetaboxes }\n\t\t\t\t\t\tdisableIframe={ ! shouldIframe }\n\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\tinitialSelection={ previousSelectedBlockPath }\n\t\t\t\t\t\textraSidebarPanels={\n\t\t\t\t\t\t\tshowMetaBoxes && <MetaBoxes location=\"side\" />\n\t\t\t\t\t\t}\n\t\t\t\t\t\textraContent={\n\t\t\t\t\t\t\t! isDistractionFree &&\n\t\t\t\t\t\t\tshowMetaBoxes && (\n\t\t\t\t\t\t\t\t<MetaBoxesMain\n\t\t\t\t\t\t\t\t\tisLegacy={\n\t\t\t\t\t\t\t\t\t\t! shouldIframe || isDevicePreview\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostLockedModal />\n\t\t\t\t\t\t<EditorInitialization />\n\t\t\t\t\t\t<FullscreenMode isActive={ isFullscreenActive } />\n\t\t\t\t\t\t<BrowserURL />\n\t\t\t\t\t\t<UnsavedChangesWarning />\n\t\t\t\t\t\t<AutosaveMonitor />\n\t\t\t\t\t\t<LocalAutosaveMonitor />\n\t\t\t\t\t\t<EditPostKeyboardShortcuts />\n\t\t\t\t\t\t<EditorKeyboardShortcutsRegister />\n\t\t\t\t\t\t<BlockKeyboardShortcuts />\n\t\t\t\t\t\t{ currentPostType === 'wp_block' && (\n\t\t\t\t\t\t\t<InitPatternModal />\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<PluginArea onError={ onPluginAreaError } />\n\t\t\t\t\t\t<PostEditorMoreMenu />\n\t\t\t\t\t\t{ backButton }\n\t\t\t\t\t\t<EditorSnackbars />\n\t\t\t\t\t</Editor>\n\t\t\t\t</div>\n\t\t\t</ErrorBoundary>\n\t\t</SlotFillProvider>\n\t);\n}\n\nexport default Layout;\n", "/**\n * WordPress dependencies\n */\nimport { getCSSValueFromRawStyle } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tGlobalStylesSettings,\n\tThemeFileLink,\n\tTypographyPreset,\n\tUnresolvedValue,\n\tGlobalStylesConfig,\n} from '../types';\nimport { getTypographyFontSizeValue } from './typography';\nimport { getValueFromObjectPath } from './object';\n\nexport const ROOT_BLOCK_SELECTOR = 'body';\nexport const ROOT_CSS_PROPERTIES_SELECTOR = ':root';\n\nexport const PRESET_METADATA = [\n\t{\n\t\tpath: [ 'color', 'palette' ],\n\t\tvalueKey: 'color',\n\t\tcssVarInfix: 'color',\n\t\tclasses: [\n\t\t\t{ classSuffix: 'color', propertyName: 'color' },\n\t\t\t{\n\t\t\t\tclassSuffix: 'background-color',\n\t\t\t\tpropertyName: 'background-color',\n\t\t\t},\n\t\t\t{\n\t\t\t\tclassSuffix: 'border-color',\n\t\t\t\tpropertyName: 'border-color',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tpath: [ 'color', 'gradients' ],\n\t\tvalueKey: 'gradient',\n\t\tcssVarInfix: 'gradient',\n\t\tclasses: [\n\t\t\t{\n\t\t\t\tclassSuffix: 'gradient-background',\n\t\t\t\tpropertyName: 'background',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tpath: [ 'color', 'duotone' ],\n\t\tvalueKey: 'colors',\n\t\tcssVarInfix: 'duotone',\n\t\tvalueFunc: ( { slug }: { slug: string } ) =>\n\t\t\t`url( '#wp-duotone-${ slug }' )`,\n\t\tclasses: [],\n\t},\n\t{\n\t\tpath: [ 'shadow', 'presets' ],\n\t\tvalueKey: 'shadow',\n\t\tcssVarInfix: 'shadow',\n\t\tclasses: [],\n\t},\n\t{\n\t\tpath: [ 'typography', 'fontSizes' ],\n\t\tvalueFunc: (\n\t\t\tpreset: TypographyPreset,\n\t\t\tsettings: GlobalStylesSettings\n\t\t) => getTypographyFontSizeValue( preset, settings ),\n\t\tvalueKey: 'size',\n\t\tcssVarInfix: 'font-size',\n\t\tclasses: [ { classSuffix: 'font-size', propertyName: 'font-size' } ],\n\t},\n\t{\n\t\tpath: [ 'typography', 'fontFamilies' ],\n\t\tvalueKey: 'fontFamily',\n\t\tcssVarInfix: 'font-family',\n\t\tclasses: [\n\t\t\t{ classSuffix: 'font-family', propertyName: 'font-family' },\n\t\t],\n\t},\n\t{\n\t\tpath: [ 'spacing', 'spacingSizes' ],\n\t\tvalueKey: 'size',\n\t\tcssVarInfix: 'spacing',\n\t\tvalueFunc: ( { size }: { size: string } ) => size,\n\t\tclasses: [],\n\t},\n\t{\n\t\tpath: [ 'border', 'radiusSizes' ],\n\t\tvalueKey: 'size',\n\t\tcssVarInfix: 'border-radius',\n\t\tclasses: [],\n\t},\n\t{\n\t\tpath: [ 'dimensions', 'dimensionSizes' ],\n\t\tvalueKey: 'size',\n\t\tcssVarInfix: 'dimension',\n\t\tclasses: [],\n\t},\n];\n\nexport const STYLE_PATH_TO_CSS_VAR_INFIX: Record< string, string > = {\n\t'color.background': 'color',\n\t'color.text': 'color',\n\t'filter.duotone': 'duotone',\n\t'elements.link.color.text': 'color',\n\t'elements.link.:hover.color.text': 'color',\n\t'elements.link.typography.fontFamily': 'font-family',\n\t'elements.link.typography.fontSize': 'font-size',\n\t'elements.button.color.text': 'color',\n\t'elements.button.color.background': 'color',\n\t'elements.caption.color.text': 'color',\n\t'elements.button.typography.fontFamily': 'font-family',\n\t'elements.button.typography.fontSize': 'font-size',\n\t'elements.heading.color': 'color',\n\t'elements.heading.color.background': 'color',\n\t'elements.heading.typography.fontFamily': 'font-family',\n\t'elements.heading.gradient': 'gradient',\n\t'elements.heading.color.gradient': 'gradient',\n\t'elements.h1.color': 'color',\n\t'elements.h1.color.background': 'color',\n\t'elements.h1.typography.fontFamily': 'font-family',\n\t'elements.h1.color.gradient': 'gradient',\n\t'elements.h2.color': 'color',\n\t'elements.h2.color.background': 'color',\n\t'elements.h2.typography.fontFamily': 'font-family',\n\t'elements.h2.color.gradient': 'gradient',\n\t'elements.h3.color': 'color',\n\t'elements.h3.color.background': 'color',\n\t'elements.h3.typography.fontFamily': 'font-family',\n\t'elements.h3.color.gradient': 'gradient',\n\t'elements.h4.color': 'color',\n\t'elements.h4.color.background': 'color',\n\t'elements.h4.typography.fontFamily': 'font-family',\n\t'elements.h4.color.gradient': 'gradient',\n\t'elements.h5.color': 'color',\n\t'elements.h5.color.background': 'color',\n\t'elements.h5.typography.fontFamily': 'font-family',\n\t'elements.h5.color.gradient': 'gradient',\n\t'elements.h6.color': 'color',\n\t'elements.h6.color.background': 'color',\n\t'elements.h6.typography.fontFamily': 'font-family',\n\t'elements.h6.color.gradient': 'gradient',\n\t'color.gradient': 'gradient',\n\tshadow: 'shadow',\n\t'typography.fontSize': 'font-size',\n\t'typography.fontFamily': 'font-family',\n};\n\n/**\n * Function that scopes a selector with another one. This works a bit like\n * SCSS nesting except the `&` operator isn't supported.\n *\n * @example\n * ```js\n * const scope = '.a, .b .c';\n * const selector = '> .x, .y';\n * const merged = scopeSelector( scope, selector );\n * // merged is '.a > .x, .a .y, .b .c > .x, .b .c .y'\n * ```\n *\n * @param scope    Selector to scope to.\n * @param selector Original selector.\n *\n * @return Scoped selector.\n */\nexport function scopeSelector( scope: string | undefined, selector: string ) {\n\tif ( ! scope || ! selector ) {\n\t\treturn selector;\n\t}\n\n\tconst scopes = scope.split( ',' );\n\tconst selectors = selector.split( ',' );\n\n\tconst selectorsScoped: string[] = [];\n\tscopes.forEach( ( outer ) => {\n\t\tselectors.forEach( ( inner ) => {\n\t\t\tselectorsScoped.push( `${ outer.trim() } ${ inner.trim() }` );\n\t\t} );\n\t} );\n\n\treturn selectorsScoped.join( ', ' );\n}\n\n/**\n * Scopes a collection of selectors for features and subfeatures.\n *\n * @example\n * ```js\n * const scope = '.custom-scope';\n * const selectors = {\n *     color: '.wp-my-block p',\n *     typography: { fontSize: '.wp-my-block caption' },\n * };\n * const result = scopeFeatureSelector( scope, selectors );\n * // result is {\n * //     color: '.custom-scope .wp-my-block p',\n * //     typography: { fonSize: '.custom-scope .wp-my-block caption' },\n * // }\n * ```\n *\n * @param scope     Selector to scope collection of selectors with.\n * @param selectors Collection of feature selectors e.g.\n *\n * @return Scoped collection of feature selectors.\n */\nexport function scopeFeatureSelectors(\n\tscope: string | undefined,\n\tselectors: string | Record< string, string | Record< string, string > >\n) {\n\tif ( ! scope || ! selectors ) {\n\t\treturn;\n\t}\n\n\tconst featureSelectors: Record<\n\t\tstring,\n\t\tstring | Record< string, string >\n\t> = {};\n\n\tObject.entries( selectors ).forEach( ( [ feature, selector ] ) => {\n\t\tif ( typeof selector === 'string' ) {\n\t\t\tfeatureSelectors[ feature ] = scopeSelector( scope, selector );\n\t\t}\n\n\t\tif ( typeof selector === 'object' ) {\n\t\t\tfeatureSelectors[ feature ] = {};\n\n\t\t\tObject.entries( selector ).forEach(\n\t\t\t\t( [ subfeature, subfeatureSelector ] ) => {\n\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\tfeatureSelectors[ feature ][ subfeature ] = scopeSelector(\n\t\t\t\t\t\tscope,\n\t\t\t\t\t\tsubfeatureSelector as string\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t} );\n\n\treturn featureSelectors;\n}\n\n/**\n * Appends a sub-selector to an existing one.\n *\n * Given the compounded `selector` \"h1, h2, h3\"\n * and the `toAppend` selector \".some-class\" the result will be\n * \"h1.some-class, h2.some-class, h3.some-class\".\n *\n * @param selector Original selector.\n * @param toAppend Selector to append.\n *\n * @return The new selector.\n */\nexport function appendToSelector( selector: string, toAppend: string ) {\n\tif ( ! selector.includes( ',' ) ) {\n\t\treturn selector + toAppend;\n\t}\n\tconst selectors = selector.split( ',' );\n\tconst newSelectors = selectors.map( ( sel ) => sel + toAppend );\n\treturn newSelectors.join( ',' );\n}\n\n/**\n * Generates the selector for a block style variation by creating the\n * appropriate CSS class and adding it to the ancestor portion of the block's\n * selector.\n *\n * For example, take the Button block which has a compound selector:\n * `.wp-block-button .wp-block-button__link`. With a variation named 'custom',\n * the class `.is-style-custom` should be added to the `.wp-block-button`\n * ancestor only.\n *\n * This function will take into account comma separated and complex selectors.\n *\n * @param variation     Name for the variation.\n * @param blockSelector CSS selector for the block.\n *\n * @return CSS selector for the block style variation.\n */\nexport function getBlockStyleVariationSelector(\n\tvariation: string,\n\tblockSelector: string\n) {\n\tconst variationClass = `.is-style-${ variation }`;\n\n\tif ( ! blockSelector ) {\n\t\treturn variationClass;\n\t}\n\n\tconst ancestorRegex = /((?::\\([^)]+\\))?\\s*)([^\\s:]+)/;\n\tconst addVariationClass = (\n\t\t_match: string,\n\t\tgroup1: string,\n\t\tgroup2: string\n\t) => {\n\t\treturn group1 + group2 + variationClass;\n\t};\n\n\tconst result = blockSelector\n\t\t.split( ',' )\n\t\t.map( ( part ) => part.replace( ancestorRegex, addVariationClass ) );\n\n\treturn result.join( ',' );\n}\n\n/**\n * Resolves ref values in theme JSON.\n *\n * @param ruleValue A block style value that may contain a reference to a theme.json value.\n * @param tree      A theme.json object.\n * @return The resolved value or incoming ruleValue.\n */\nexport function getResolvedRefValue(\n\truleValue: UnresolvedValue,\n\ttree?: GlobalStylesConfig\n): UnresolvedValue {\n\tif ( ! ruleValue || ! tree ) {\n\t\treturn ruleValue;\n\t}\n\n\t/*\n\t * Where the rule value is an object with a 'ref' property pointing\n\t * to a path, this converts that path into the value at that path.\n\t * For example: { \"ref\": \"style.color.background\" } => \"#fff\".\n\t */\n\tif (\n\t\ttypeof ruleValue === 'object' &&\n\t\t'ref' in ruleValue &&\n\t\truleValue?.ref\n\t) {\n\t\tconst resolvedRuleValue = getCSSValueFromRawStyle(\n\t\t\tgetValueFromObjectPath( tree, ruleValue.ref )\n\t\t) as UnresolvedValue;\n\n\t\t/*\n\t\t * Presence of another ref indicates a reference to another dynamic value.\n\t\t * Pointing to another dynamic value is not supported.\n\t\t */\n\t\tif (\n\t\t\ttypeof resolvedRuleValue === 'object' &&\n\t\t\tresolvedRuleValue !== null &&\n\t\t\t'ref' in resolvedRuleValue &&\n\t\t\tresolvedRuleValue?.ref\n\t\t) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tif ( resolvedRuleValue === undefined ) {\n\t\t\treturn ruleValue;\n\t\t}\n\n\t\treturn resolvedRuleValue;\n\t}\n\treturn ruleValue;\n}\n\n/**\n * Looks up a theme file URI based on a relative path.\n *\n * @param file          A relative path.\n * @param themeFileURIs A collection of absolute theme file URIs and their corresponding file paths.\n * @return A resolved theme file URI, if one is found in the themeFileURIs collection.\n */\nexport function getResolvedThemeFilePath(\n\tfile: string,\n\tthemeFileURIs?: ThemeFileLink[]\n) {\n\tif ( ! file || ! themeFileURIs || ! Array.isArray( themeFileURIs ) ) {\n\t\treturn file;\n\t}\n\n\tconst uri = themeFileURIs.find(\n\t\t( themeFileUri ) => themeFileUri?.name === file\n\t);\n\n\tif ( ! uri?.href ) {\n\t\treturn file;\n\t}\n\n\treturn uri?.href;\n}\n\n/**\n * Resolves ref and relative path values in theme JSON.\n *\n * @param ruleValue A block style value that may contain a reference to a theme.json value.\n * @param tree      A theme.json object.\n * @return The resolved value or incoming ruleValue.\n */\nexport function getResolvedValue(\n\truleValue: UnresolvedValue,\n\ttree: GlobalStylesConfig | undefined\n) {\n\tif ( ! ruleValue || ! tree ) {\n\t\treturn ruleValue;\n\t}\n\n\t// Resolve ref values.\n\tconst resolvedValue = getResolvedRefValue( ruleValue, tree );\n\n\t// Resolve relative paths.\n\tif (\n\t\ttypeof resolvedValue === 'object' &&\n\t\tresolvedValue !== null &&\n\t\t'url' in resolvedValue &&\n\t\tresolvedValue?.url\n\t) {\n\t\tresolvedValue.url = getResolvedThemeFilePath(\n\t\t\tresolvedValue.url,\n\t\t\ttree?._links?.[ 'wp:theme-file' ]\n\t\t);\n\t}\n\n\treturn resolvedValue;\n}\n\nfunction findInPresetsBy(\n\tsettings: GlobalStylesSettings,\n\tblockName?: string,\n\tpresetPath: string[] = [],\n\tpresetProperty: string = 'slug',\n\tpresetValueValue?: string\n) {\n\t// Block presets take priority above root level presets.\n\tconst orderedPresetsByOrigin = [\n\t\tblockName\n\t\t\t? getValueFromObjectPath( settings, [\n\t\t\t\t\t'blocks',\n\t\t\t\t\tblockName,\n\t\t\t\t\t...presetPath,\n\t\t\t  ] )\n\t\t\t: undefined,\n\t\tgetValueFromObjectPath( settings, presetPath ),\n\t].filter( Boolean );\n\n\tfor ( const presetByOrigin of orderedPresetsByOrigin ) {\n\t\tif ( presetByOrigin ) {\n\t\t\t// Preset origins ordered by priority.\n\t\t\tconst origins = [ 'custom', 'theme', 'default' ];\n\t\t\tfor ( const origin of origins ) {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tconst presets = presetByOrigin[ origin ];\n\t\t\t\tif ( presets ) {\n\t\t\t\t\tconst presetObject = presets.find(\n\t\t\t\t\t\t( preset: any ) =>\n\t\t\t\t\t\t\tpreset[ presetProperty ] === presetValueValue\n\t\t\t\t\t);\n\t\t\t\t\tif ( presetObject ) {\n\t\t\t\t\t\tif ( presetProperty === 'slug' ) {\n\t\t\t\t\t\t\treturn presetObject;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If there is a highest priority preset with the same slug but different value the preset we found was overwritten and should be ignored.\n\t\t\t\t\t\tconst highestPresetObjectWithSameSlug = findInPresetsBy(\n\t\t\t\t\t\t\tsettings,\n\t\t\t\t\t\t\tblockName,\n\t\t\t\t\t\t\tpresetPath,\n\t\t\t\t\t\t\t'slug',\n\t\t\t\t\t\t\tpresetObject.slug\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\thighestPresetObjectWithSameSlug[\n\t\t\t\t\t\t\t\tpresetProperty\n\t\t\t\t\t\t\t] === presetObject[ presetProperty ]\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn presetObject;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction getValueFromPresetVariable(\n\tfeatures: GlobalStylesConfig,\n\tblockName?: string,\n\tvariable?: string,\n\t[ presetType, slug ]: string[] = []\n) {\n\tconst metadata = PRESET_METADATA.find(\n\t\t( data ) => data.cssVarInfix === presetType\n\t);\n\tif ( ! metadata || ! features.settings ) {\n\t\treturn variable;\n\t}\n\n\tconst presetObject = findInPresetsBy(\n\t\tfeatures.settings,\n\t\tblockName,\n\t\tmetadata.path,\n\t\t'slug',\n\t\tslug\n\t);\n\n\tif ( presetObject ) {\n\t\tconst { valueKey } = metadata;\n\t\tconst result = presetObject[ valueKey ];\n\t\treturn getValueFromVariable( features, blockName, result );\n\t}\n\n\treturn variable;\n}\n\nfunction getValueFromCustomVariable(\n\tfeatures: GlobalStylesConfig,\n\tblockName?: string,\n\tvariable?: string,\n\tpath: string[] = []\n): string | undefined {\n\tconst result =\n\t\t( blockName\n\t\t\t? getValueFromObjectPath( features?.settings ?? {}, [\n\t\t\t\t\t'blocks',\n\t\t\t\t\tblockName,\n\t\t\t\t\t'custom',\n\t\t\t\t\t...path,\n\t\t\t  ] )\n\t\t\t: undefined ) ??\n\t\tgetValueFromObjectPath( features?.settings ?? {}, [\n\t\t\t'custom',\n\t\t\t...path,\n\t\t] );\n\tif ( ! result ) {\n\t\treturn variable;\n\t}\n\t// A variable may reference another variable so we need recursion until we find the value.\n\treturn getValueFromVariable( features, blockName, result as string );\n}\n\n/**\n * Attempts to fetch the value of a theme.json CSS variable.\n *\n * This function resolves CSS variable references in two formats:\n * - User format: `var:preset|color|red` or `var:custom|spacing|small`\n * - Theme format: `var(--wp--preset--color--red)` or `var(--wp--custom--spacing--small)`\n *\n * It also handles ref-style variables in the format `{ ref: \"path.to.value\" }`.\n *\n * @param features  GlobalStylesContext config (user, base, or merged). Represents the theme.json tree.\n * @param blockName The name of a block as represented in the styles property. E.g., 'root' for root-level, and 'core/block-name' for blocks.\n * @param variable  An incoming style value. A CSS var value is expected, but it could be any value.\n * @return The value of the CSS var, if found. If not found, returns the original variable argument.\n */\nexport function getValueFromVariable(\n\tfeatures: GlobalStylesConfig,\n\tblockName?: string,\n\tvariable?: string | UnresolvedValue\n): any {\n\tif ( ! variable || typeof variable !== 'string' ) {\n\t\tif (\n\t\t\ttypeof variable === 'object' &&\n\t\t\tvariable !== null &&\n\t\t\t'ref' in variable &&\n\t\t\ttypeof variable.ref === 'string'\n\t\t) {\n\t\t\tconst resolvedVariable = getValueFromObjectPath(\n\t\t\t\tfeatures,\n\t\t\t\tvariable.ref\n\t\t\t);\n\t\t\t// Presence of another ref indicates a reference to another dynamic value.\n\t\t\t// Pointing to another dynamic value is not supported.\n\t\t\tif (\n\t\t\t\t! resolvedVariable ||\n\t\t\t\t( typeof resolvedVariable === 'object' &&\n\t\t\t\t\t'ref' in resolvedVariable )\n\t\t\t) {\n\t\t\t\treturn resolvedVariable;\n\t\t\t}\n\t\t\tvariable = resolvedVariable as string;\n\t\t} else {\n\t\t\treturn variable;\n\t\t}\n\t}\n\tconst USER_VALUE_PREFIX = 'var:';\n\tconst THEME_VALUE_PREFIX = 'var(--wp--';\n\tconst THEME_VALUE_SUFFIX = ')';\n\n\tlet parsedVar;\n\n\tif ( variable.startsWith( USER_VALUE_PREFIX ) ) {\n\t\tparsedVar = variable.slice( USER_VALUE_PREFIX.length ).split( '|' );\n\t} else if (\n\t\tvariable.startsWith( THEME_VALUE_PREFIX ) &&\n\t\tvariable.endsWith( THEME_VALUE_SUFFIX )\n\t) {\n\t\tparsedVar = variable\n\t\t\t.slice( THEME_VALUE_PREFIX.length, -THEME_VALUE_SUFFIX.length )\n\t\t\t.split( '--' );\n\t} else {\n\t\t// We don't know how to parse the value: either is raw of uses complex CSS such as `calc(1px * var(--wp--variable) )`\n\t\treturn variable;\n\t}\n\n\tconst [ type, ...path ] = parsedVar;\n\tif ( type === 'preset' ) {\n\t\treturn getValueFromPresetVariable(\n\t\t\tfeatures,\n\t\t\tblockName,\n\t\t\tvariable,\n\t\t\tpath\n\t\t);\n\t}\n\tif ( type === 'custom' ) {\n\t\treturn getValueFromCustomVariable(\n\t\t\tfeatures,\n\t\t\tblockName,\n\t\t\tvariable,\n\t\t\tpath\n\t\t);\n\t}\n\treturn variable;\n}\n\n/**\n * Encodes a value to a preset variable format if it matches a preset.\n * This is the inverse operation of getValueFromVariable().\n *\n * @example\n * ```js\n * const presetVar = getPresetVariableFromValue(\n *     globalStyles.settings,\n *     'core/paragraph',\n *     'color.text',\n *     '#ff0000'\n * );\n * // If #ff0000 is the 'red' preset color, returns 'var:preset|color|red'\n * // Otherwise returns '#ff0000'\n * ```\n *\n * @param features            GlobalStylesContext settings object.\n * @param blockName           The name of a block (e.g., 'core/paragraph').\n * @param variableStylePath   The style path (e.g., 'color.text', 'typography.fontSize').\n * @param presetPropertyValue The value to encode (e.g., '#ff0000').\n * @return The preset variable if found, otherwise the original value.\n */\nexport function getPresetVariableFromValue(\n\tfeatures: GlobalStylesSettings,\n\tblockName: string | undefined,\n\tvariableStylePath: string,\n\tpresetPropertyValue: any\n): any {\n\tif ( ! presetPropertyValue ) {\n\t\treturn presetPropertyValue;\n\t}\n\n\tconst cssVarInfix = STYLE_PATH_TO_CSS_VAR_INFIX[ variableStylePath ];\n\n\tconst metadata = PRESET_METADATA.find(\n\t\t( data ) => data.cssVarInfix === cssVarInfix\n\t);\n\n\tif ( ! metadata ) {\n\t\t// The property doesn't have preset data\n\t\t// so the value should be returned as it is.\n\t\treturn presetPropertyValue;\n\t}\n\tconst { valueKey, path } = metadata;\n\n\tconst presetObject = findInPresetsBy(\n\t\tfeatures,\n\t\tblockName,\n\t\tpath,\n\t\tvalueKey,\n\t\tpresetPropertyValue\n\t);\n\n\tif ( ! presetObject ) {\n\t\t// Value wasn't found in the presets,\n\t\t// so it must be a custom value.\n\t\treturn presetPropertyValue;\n\t}\n\n\treturn `var:preset|${ cssVarInfix }|${ presetObject.slug }`;\n}\n", "/**\n * WordPress dependencies\n */\nimport {\n\t__EXPERIMENTAL_STYLE_PROPERTY as STYLE_PROPERTY,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n\tgetBlockSupport,\n\tgetBlockTypes,\n\tstore as blocksStore,\n\t// @ts-expect-error - @wordpress/blocks module doesn't have TypeScript declarations\n} from '@wordpress/blocks';\nimport { getCSSRules, getCSSValueFromRawStyle } from '@wordpress/style-engine';\nimport { select } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tPRESET_METADATA,\n\tROOT_BLOCK_SELECTOR,\n\tROOT_CSS_PROPERTIES_SELECTOR,\n\tscopeSelector,\n\tscopeFeatureSelectors,\n\tappendToSelector,\n\tgetBlockStyleVariationSelector,\n\tgetResolvedValue,\n} from '../utils/common';\nimport { getBlockSelector } from './selectors';\nimport { getTypographyFontSizeValue } from '../utils/typography';\nimport { getDuotoneFilter } from '../utils/duotone';\nimport { kebabCase } from '../utils/string';\nimport { getGapCSSValue } from '../utils/gap';\nimport { setBackgroundStyleDefaults } from '../utils/background';\nimport { LAYOUT_DEFINITIONS } from '../utils/layout';\nimport { getValueFromObjectPath, setImmutably } from '../utils/object';\nimport { getSetting } from '../settings/get-setting';\nimport type {\n\tBlockStyleVariation,\n\tBlockType,\n\tGlobalStylesConfig,\n\tGlobalStylesSettings,\n\tGlobalStylesStyles,\n} from '../types';\n\n// =============================================================================\n// LOCAL TYPE DEFINITIONS\n// =============================================================================\n\n/**\n * Preset metadata for CSS variable generation\n */\ninterface PresetMetadata {\n\tpath: string[];\n\tvalueKey?: string;\n\tvalueFunc?: ( preset: any, settings: any ) => string | number | null;\n\tcssVarInfix: string;\n\tclasses?: Array< {\n\t\tclassSuffix: string;\n\t\tpropertyName: string;\n\t} >;\n}\n\n/**\n * Preset collection by origin\n */\ninterface PresetsByOrigin {\n\t[ origin: string ]: any[];\n}\n\n/**\n * CSS class configuration\n */\ninterface CSSClassConfig {\n\tclassSuffix: string;\n\tpropertyName: string;\n}\n\n/**\n * Style property configuration from WordPress\n */\ninterface StylePropertyConfig {\n\tvalue: string[];\n\tproperties?: Record< string, string >;\n\tuseEngine?: boolean;\n\trootOnly?: boolean;\n}\n\n/**\n * Layout definition structure\n */\ninterface LayoutDefinition {\n\tclassName: string;\n\tname: string;\n\tdisplayMode?: string;\n\tspacingStyles?: Array< {\n\t\tselector?: string;\n\t\trules?: Record< string, any >;\n\t} >;\n\tbaseStyles?: Array< {\n\t\tselector?: string;\n\t\trules?: Record< string, any >;\n\t} >;\n}\n\n/**\n * CSS rule from style engine\n */\ninterface CSSRule {\n\tkey: string;\n\tvalue: any;\n}\n\n/**\n * Block variation in theme.json (different from BlockStyleVariation)\n */\ninterface BlockVariation {\n\tcss?: string;\n\telements?: Record< string, any >;\n\tblocks?: Record< string, any >;\n\t[ key: string ]: any; // For additional style properties\n}\n\n/**\n * Block node in theme.json\n */\ninterface BlockNode {\n\tvariations?: Record< string, BlockVariation >;\n\telements?: Record< string, any >;\n\t[ key: string ]: any; // For additional style properties\n}\n\nexport type BlockSelectors = Record<\n\tstring,\n\t{\n\t\tduotoneSelector?: string;\n\t\tselector: string;\n\t\tfallbackGapValue?: string;\n\t\thasLayoutSupport?: boolean;\n\t\tfeatureSelectors?:\n\t\t\t| string\n\t\t\t| Record< string, string | Record< string, string > >;\n\t\tname?: string;\n\t\tstyleVariationSelectors?: Record< string, string >;\n\t}\n>;\n\n// Elements that rely on class names in their selectors.\nconst ELEMENT_CLASS_NAMES = {\n\tbutton: 'wp-element-button',\n\tcaption: 'wp-element-caption',\n};\n\n// List of block support features that can have their related styles\n// generated under their own feature level selector rather than the block's.\nconst BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS = {\n\t__experimentalBorder: 'border',\n\tcolor: 'color',\n\tdimensions: 'dimensions',\n\tspacing: 'spacing',\n\ttypography: 'typography',\n};\n\n/**\n * Transform given preset tree into a set of style declarations.\n *\n * @param blockPresets   Block presets object\n * @param mergedSettings Merged theme.json settings\n * @return An array of style declarations\n */\nfunction getPresetsDeclarations(\n\tblockPresets: Record< string, any > = {},\n\tmergedSettings: GlobalStylesSettings\n): string[] {\n\treturn PRESET_METADATA.reduce(\n\t\t(\n\t\t\tdeclarations: string[],\n\t\t\t{ path, valueKey, valueFunc, cssVarInfix }: PresetMetadata\n\t\t) => {\n\t\t\tconst presetByOrigin = getValueFromObjectPath(\n\t\t\t\tblockPresets,\n\t\t\t\tpath,\n\t\t\t\t[]\n\t\t\t) as PresetsByOrigin;\n\t\t\t[ 'default', 'theme', 'custom' ].forEach( ( origin ) => {\n\t\t\t\tif ( presetByOrigin[ origin ] ) {\n\t\t\t\t\tpresetByOrigin[ origin ].forEach( ( value: any ) => {\n\t\t\t\t\t\tif ( valueKey && ! valueFunc ) {\n\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t`--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\t\tvalue.slug\n\t\t\t\t\t\t\t\t) }: ${ value[ valueKey ] }`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tvalueFunc &&\n\t\t\t\t\t\t\ttypeof valueFunc === 'function'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t`--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\t\tvalue.slug\n\t\t\t\t\t\t\t\t) }: ${ valueFunc( value, mergedSettings ) }`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn declarations;\n\t\t},\n\t\t[] as string[]\n\t);\n}\n\n/**\n * Transform given preset tree into a set of preset class declarations.\n *\n * @param blockSelector Block selector string\n * @param blockPresets  Block presets object\n * @return CSS declarations for the preset classes\n */\nfunction getPresetsClasses(\n\tblockSelector: string = '*',\n\tblockPresets: Record< string, any > = {}\n): string {\n\treturn PRESET_METADATA.reduce(\n\t\t(\n\t\t\tdeclarations: string,\n\t\t\t{ path, cssVarInfix, classes }: PresetMetadata\n\t\t) => {\n\t\t\tif ( ! classes ) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\n\t\t\tconst presetByOrigin = getValueFromObjectPath(\n\t\t\t\tblockPresets,\n\t\t\t\tpath,\n\t\t\t\t[]\n\t\t\t) as PresetsByOrigin;\n\t\t\t[ 'default', 'theme', 'custom' ].forEach( ( origin ) => {\n\t\t\t\tif ( presetByOrigin[ origin ] ) {\n\t\t\t\t\tpresetByOrigin[ origin ].forEach(\n\t\t\t\t\t\t( { slug }: { slug: string } ) => {\n\t\t\t\t\t\t\tclasses!.forEach(\n\t\t\t\t\t\t\t\t( {\n\t\t\t\t\t\t\t\t\tclassSuffix,\n\t\t\t\t\t\t\t\t\tpropertyName,\n\t\t\t\t\t\t\t\t}: CSSClassConfig ) => {\n\t\t\t\t\t\t\t\t\tconst classSelectorToUse = `.has-${ kebabCase(\n\t\t\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t\t\t) }-${ classSuffix }`;\n\t\t\t\t\t\t\t\t\tconst selectorToUse = blockSelector\n\t\t\t\t\t\t\t\t\t\t.split( ',' ) // Selector can be \"h1, h2, h3\"\n\t\t\t\t\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t\t\t\t\t( selector ) =>\n\t\t\t\t\t\t\t\t\t\t\t\t`${ selector }${ classSelectorToUse }`\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t.join( ',' );\n\t\t\t\t\t\t\t\t\tconst value = `var(--wp--preset--${ cssVarInfix }--${ kebabCase(\n\t\t\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t\t\t) })`;\n\t\t\t\t\t\t\t\t\tdeclarations += `${ selectorToUse }{${ propertyName }: ${ value } !important;}`;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} );\n\t\t\treturn declarations;\n\t\t},\n\t\t''\n\t);\n}\n\nfunction getPresetsSvgFilters(\n\tblockPresets: Record< string, any > = {}\n): string[] {\n\treturn PRESET_METADATA.filter(\n\t\t// Duotone are the only type of filters for now.\n\t\t( metadata: PresetMetadata ) => metadata.path.at( -1 ) === 'duotone'\n\t).flatMap( ( metadata: PresetMetadata ) => {\n\t\tconst presetByOrigin = getValueFromObjectPath(\n\t\t\tblockPresets,\n\t\t\tmetadata.path,\n\t\t\t{}\n\t\t) as PresetsByOrigin;\n\t\treturn [ 'default', 'theme' ]\n\t\t\t.filter( ( origin ) => presetByOrigin[ origin ] )\n\t\t\t.flatMap( ( origin ) =>\n\t\t\t\tpresetByOrigin[ origin ].map( ( preset: any ) =>\n\t\t\t\t\tgetDuotoneFilter(\n\t\t\t\t\t\t`wp-duotone-${ preset.slug }`,\n\t\t\t\t\t\tpreset.colors\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t)\n\t\t\t.join( '' );\n\t} );\n}\n\nfunction flattenTree(\n\tinput: any = {},\n\tprefix: string,\n\ttoken: string\n): string[] {\n\tlet result: string[] = [];\n\tObject.keys( input ).forEach( ( key ) => {\n\t\tconst newKey = prefix + kebabCase( key.replace( '/', '-' ) );\n\t\tconst newLeaf = input[ key ];\n\n\t\tif ( newLeaf instanceof Object ) {\n\t\t\tconst newPrefix = newKey + token;\n\t\t\tresult = [ ...result, ...flattenTree( newLeaf, newPrefix, token ) ];\n\t\t} else {\n\t\t\tresult.push( `${ newKey }: ${ newLeaf }` );\n\t\t}\n\t} );\n\treturn result;\n}\n\n/**\n * Gets variation selector string from feature selector.\n *\n * @param featureSelector        The feature selector\n * @param styleVariationSelector The style variation selector\n * @return Combined selector string\n */\nfunction concatFeatureVariationSelectorString(\n\tfeatureSelector: string,\n\tstyleVariationSelector: string\n): string {\n\tconst featureSelectors = featureSelector.split( ',' );\n\tconst combinedSelectors: string[] = [];\n\tfeatureSelectors.forEach( ( selector ) => {\n\t\tcombinedSelectors.push(\n\t\t\t`${ styleVariationSelector.trim() }${ selector.trim() }`\n\t\t);\n\t} );\n\treturn combinedSelectors.join( ', ' );\n}\n\n/**\n * Generate style declarations for a block's custom feature and subfeature\n * selectors.\n *\n * NOTE: The passed `styles` object will be mutated by this function.\n *\n * @param selectors Custom selectors object for a block\n * @param styles    A block's styles object\n * @return Style declarations\n */\nconst getFeatureDeclarations = (\n\tselectors: Record< string, any >,\n\tstyles: Record< string, any >\n): Record< string, string[] > => {\n\tconst declarations: Record< string, string[] > = {};\n\n\tObject.entries( selectors ).forEach( ( [ feature, selector ] ) => {\n\t\t// We're only processing features/subfeatures that have styles.\n\t\tif ( feature === 'root' || ! styles?.[ feature ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isShorthand = typeof selector === 'string';\n\n\t\t// If we have a selector object instead of shorthand process it.\n\t\tif (\n\t\t\t! isShorthand &&\n\t\t\ttypeof selector === 'object' &&\n\t\t\tselector !== null\n\t\t) {\n\t\t\tObject.entries( selector as Record< string, string > ).forEach(\n\t\t\t\t( [ subfeature, subfeatureSelector ] ) => {\n\t\t\t\t\t// Don't process root feature selector yet or any\n\t\t\t\t\t// subfeature that doesn't have a style.\n\t\t\t\t\tif (\n\t\t\t\t\t\tsubfeature === 'root' ||\n\t\t\t\t\t\t! styles?.[ feature ][ subfeature ]\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Create a temporary styles object and build\n\t\t\t\t\t// declarations for subfeature.\n\t\t\t\t\tconst subfeatureStyles = {\n\t\t\t\t\t\t[ feature ]: {\n\t\t\t\t\t\t\t[ subfeature ]: styles[ feature ][ subfeature ],\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t\tconst newDeclarations =\n\t\t\t\t\t\tgetStylesDeclarations( subfeatureStyles );\n\n\t\t\t\t\t// Merge new declarations in with any others that\n\t\t\t\t\t// share the same selector.\n\t\t\t\t\tdeclarations[ subfeatureSelector ] = [\n\t\t\t\t\t\t...( declarations[ subfeatureSelector ] || [] ),\n\t\t\t\t\t\t...newDeclarations,\n\t\t\t\t\t];\n\n\t\t\t\t\t// Remove the subfeature's style now it will be\n\t\t\t\t\t// included under its own selector not the block's.\n\t\t\t\t\tdelete styles[ feature ][ subfeature ];\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t// Now subfeatures have been processed and removed, we can\n\t\t// process root, or shorthand, feature selectors.\n\t\tif (\n\t\t\tisShorthand ||\n\t\t\t( typeof selector === 'object' &&\n\t\t\t\tselector !== null &&\n\t\t\t\t'root' in selector )\n\t\t) {\n\t\t\tconst featureSelector = isShorthand\n\t\t\t\t? ( selector as string )\n\t\t\t\t: ( selector as any ).root;\n\n\t\t\t// Create temporary style object and build declarations for feature.\n\t\t\tconst featureStyles = { [ feature ]: styles[ feature ] };\n\t\t\tconst newDeclarations = getStylesDeclarations( featureStyles );\n\n\t\t\t// Merge new declarations with any others that share the selector.\n\t\t\tdeclarations[ featureSelector ] = [\n\t\t\t\t...( declarations[ featureSelector ] || [] ),\n\t\t\t\t...newDeclarations,\n\t\t\t];\n\n\t\t\t// Remove the feature from the block's styles now as it will be\n\t\t\t// included under its own selector not the block's.\n\t\t\tdelete styles[ feature ];\n\t\t}\n\t} );\n\n\treturn declarations;\n};\n\n/**\n * Transform given style tree into a set of style declarations.\n *\n * @param blockStyles         Block styles\n * @param selector            The selector these declarations should attach to\n * @param useRootPaddingAlign Whether to use CSS custom properties in root selector\n * @param tree                A theme.json tree containing layout definitions\n * @param disableRootPadding  Whether to force disable the root padding styles\n * @return An array of style declarations\n */\nexport function getStylesDeclarations(\n\tblockStyles: any = {},\n\tselector: string = '',\n\tuseRootPaddingAlign?: boolean,\n\ttree: any = {},\n\tdisableRootPadding: boolean = false\n): string[] {\n\tconst isRoot = ROOT_BLOCK_SELECTOR === selector;\n\tconst output = Object.entries(\n\t\tSTYLE_PROPERTY as Record< string, StylePropertyConfig >\n\t).reduce(\n\t\t(\n\t\t\tdeclarations: string[],\n\t\t\t[ key, { value, properties, useEngine, rootOnly } ]: [\n\t\t\t\tstring,\n\t\t\t\tStylePropertyConfig,\n\t\t\t]\n\t\t) => {\n\t\t\tif ( rootOnly && ! isRoot ) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\t\t\tconst pathToValue = value;\n\t\t\tif ( pathToValue[ 0 ] === 'elements' || useEngine ) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\n\t\t\tconst styleValue = getValueFromObjectPath(\n\t\t\t\tblockStyles,\n\t\t\t\tpathToValue\n\t\t\t);\n\n\t\t\t// Root-level padding styles don't currently support strings with CSS shorthand values.\n\t\t\t// This may change: https://github.com/WordPress/gutenberg/issues/40132.\n\t\t\tif (\n\t\t\t\tkey === '--wp--style--root--padding' &&\n\t\t\t\t( typeof styleValue === 'string' || ! useRootPaddingAlign )\n\t\t\t) {\n\t\t\t\treturn declarations;\n\t\t\t}\n\n\t\t\tif ( properties && typeof styleValue !== 'string' ) {\n\t\t\t\tObject.entries( properties ).forEach( ( entry ) => {\n\t\t\t\t\tconst [ name, prop ] = entry;\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t! getValueFromObjectPath( styleValue, [ prop ], false )\n\t\t\t\t\t) {\n\t\t\t\t\t\t// Do not create a declaration\n\t\t\t\t\t\t// for sub-properties that don't have any value.\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst cssProperty = name.startsWith( '--' )\n\t\t\t\t\t\t? name\n\t\t\t\t\t\t: kebabCase( name );\n\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t`${ cssProperty }: ${ getCSSValueFromRawStyle(\n\t\t\t\t\t\t\tgetValueFromObjectPath( styleValue, [ prop ] )\n\t\t\t\t\t\t) }`\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t} else if (\n\t\t\t\tgetValueFromObjectPath( blockStyles, pathToValue, false )\n\t\t\t) {\n\t\t\t\tconst cssProperty = key.startsWith( '--' )\n\t\t\t\t\t? key\n\t\t\t\t\t: kebabCase( key );\n\t\t\t\tdeclarations.push(\n\t\t\t\t\t`${ cssProperty }: ${ getCSSValueFromRawStyle(\n\t\t\t\t\t\tgetValueFromObjectPath( blockStyles, pathToValue )\n\t\t\t\t\t) }`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn declarations;\n\t\t},\n\t\t[] as string[]\n\t);\n\n\t/*\n\t * Preprocess background image values.\n\t *\n\t * Note: As we absorb more and more styles into the engine, we could simplify this function.\n\t * A refactor is for the style engine to handle ref resolution (and possibly defaults)\n\t * via a public util used internally and externally. Theme.json tree and defaults could be passed\n\t * as options.\n\t */\n\tif ( !! blockStyles.background ) {\n\t\t/*\n\t\t * Resolve dynamic values before they are compiled by the style engine,\n\t\t * which doesn't (yet) resolve dynamic values.\n\t\t */\n\t\tif ( blockStyles.background?.backgroundImage ) {\n\t\t\tblockStyles.background.backgroundImage = getResolvedValue(\n\t\t\t\tblockStyles.background.backgroundImage,\n\t\t\t\ttree\n\t\t\t);\n\t\t}\n\n\t\t/*\n\t\t * Set default values for block background styles.\n\t\t * Top-level styles are an exception as they are applied to the body.\n\t\t */\n\t\tif ( ! isRoot && !! blockStyles.background?.backgroundImage?.id ) {\n\t\t\tblockStyles = {\n\t\t\t\t...blockStyles,\n\t\t\t\tbackground: {\n\t\t\t\t\t...blockStyles.background,\n\t\t\t\t\t...setBackgroundStyleDefaults( blockStyles.background ),\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t}\n\n\tconst extraRules = getCSSRules( blockStyles );\n\textraRules.forEach( ( rule: CSSRule ) => {\n\t\t// Don't output padding properties if padding variables are set or if we're not editing a full template.\n\t\tif (\n\t\t\tisRoot &&\n\t\t\t( useRootPaddingAlign || disableRootPadding ) &&\n\t\t\trule.key.startsWith( 'padding' )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst cssProperty = rule.key.startsWith( '--' )\n\t\t\t? rule.key\n\t\t\t: kebabCase( rule.key );\n\n\t\tlet ruleValue = getResolvedValue( rule.value, tree );\n\n\t\t// Calculate fluid typography rules where available.\n\t\tif ( cssProperty === 'font-size' ) {\n\t\t\t/*\n\t\t\t * getTypographyFontSizeValue() will check\n\t\t\t * if fluid typography has been activated and also\n\t\t\t * whether the incoming value can be converted to a fluid value.\n\t\t\t * Values that already have a \"clamp()\" function will not pass the test,\n\t\t\t * and therefore the original $value will be returned.\n\t\t\t */\n\t\t\truleValue = getTypographyFontSizeValue(\n\t\t\t\t{ name: '', slug: '', size: ruleValue as string },\n\t\t\t\ttree?.settings\n\t\t\t);\n\t\t}\n\n\t\t// For aspect ratio to work, other dimensions rules (and Cover block defaults) must be unset.\n\t\t// This ensures that a fixed height does not override the aspect ratio.\n\t\tif ( cssProperty === 'aspect-ratio' ) {\n\t\t\toutput.push( 'min-height: unset' );\n\t\t}\n\n\t\toutput.push( `${ cssProperty }: ${ ruleValue }` );\n\t} );\n\n\treturn output;\n}\n\n/**\n * Get generated CSS for layout styles by looking up layout definitions provided\n * in theme.json, and outputting common layout styles, and specific blockGap values.\n *\n * @param props                       Layout styles configuration\n * @param props.layoutDefinitions     Layout definitions from theme.json\n * @param props.style                 Style object for the block\n * @param props.selector              Selector to apply the styles to\n * @param props.hasBlockGapSupport    Whether the block supports block gap styles\n * @param props.hasFallbackGapSupport Whether the block supports fallback gap styles\n * @param props.fallbackGapValue      Fallback gap value to use if block gap support is\n *\n * @return Generated CSS rules for the layout styles\n */\nexport function getLayoutStyles( {\n\tlayoutDefinitions = LAYOUT_DEFINITIONS,\n\tstyle,\n\tselector,\n\thasBlockGapSupport,\n\thasFallbackGapSupport,\n\tfallbackGapValue,\n}: {\n\tlayoutDefinitions?: Record< string, LayoutDefinition >;\n\tstyle?: GlobalStylesStyles;\n\tselector?: string;\n\thasBlockGapSupport?: boolean;\n\thasFallbackGapSupport?: boolean;\n\tfallbackGapValue?: string;\n} ): string {\n\tlet ruleset = '';\n\tlet gapValue = hasBlockGapSupport\n\t\t? getGapCSSValue( style?.spacing?.blockGap )\n\t\t: '';\n\n\t// Ensure a fallback gap value for the root layout definitions,\n\t// and use a fallback value if one is provided for the current block.\n\tif ( hasFallbackGapSupport ) {\n\t\tif ( selector === ROOT_BLOCK_SELECTOR ) {\n\t\t\tgapValue = ! gapValue ? '0.5em' : gapValue;\n\t\t} else if ( ! hasBlockGapSupport && fallbackGapValue ) {\n\t\t\tgapValue = fallbackGapValue;\n\t\t}\n\t}\n\n\tif ( gapValue && layoutDefinitions ) {\n\t\tObject.values( layoutDefinitions ).forEach(\n\t\t\t( { className, name, spacingStyles } ) => {\n\t\t\t\t// Allow outputting fallback gap styles for flex layout type when block gap support isn't available.\n\t\t\t\tif (\n\t\t\t\t\t! hasBlockGapSupport &&\n\t\t\t\t\t'flex' !== name &&\n\t\t\t\t\t'grid' !== name\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( spacingStyles?.length ) {\n\t\t\t\t\tspacingStyles.forEach( ( spacingStyle: any ) => {\n\t\t\t\t\t\tconst declarations: string[] = [];\n\n\t\t\t\t\t\tif ( spacingStyle.rules ) {\n\t\t\t\t\t\t\tObject.entries( spacingStyle.rules ).forEach(\n\t\t\t\t\t\t\t\t( [ cssProperty, cssValue ] ) => {\n\t\t\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t\t\t`${ cssProperty }: ${\n\t\t\t\t\t\t\t\t\t\t\tcssValue ? cssValue : gapValue\n\t\t\t\t\t\t\t\t\t\t}`\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\tlet combinedSelector = '';\n\n\t\t\t\t\t\t\tif ( ! hasBlockGapSupport ) {\n\t\t\t\t\t\t\t\t// For fallback gap styles, use lower specificity, to ensure styles do not unintentionally override theme styles.\n\t\t\t\t\t\t\t\tcombinedSelector =\n\t\t\t\t\t\t\t\t\tselector === ROOT_BLOCK_SELECTOR\n\t\t\t\t\t\t\t\t\t\t? `:where(.${ className }${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t  })`\n\t\t\t\t\t\t\t\t\t\t: `:where(${ selector }.${ className }${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t  })`;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcombinedSelector =\n\t\t\t\t\t\t\t\t\tselector === ROOT_BLOCK_SELECTOR\n\t\t\t\t\t\t\t\t\t\t? `:root :where(.${ className })${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t  }`\n\t\t\t\t\t\t\t\t\t\t: `:root :where(${ selector }-${ className })${\n\t\t\t\t\t\t\t\t\t\t\t\tspacingStyle?.selector || ''\n\t\t\t\t\t\t\t\t\t\t  }`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\truleset += `${ combinedSelector } { ${ declarations.join(\n\t\t\t\t\t\t\t\t'; '\n\t\t\t\t\t\t\t) }; }`;\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t\t// For backwards compatibility, ensure the legacy block gap CSS variable is still available.\n\t\tif ( selector === ROOT_BLOCK_SELECTOR && hasBlockGapSupport ) {\n\t\t\truleset += `${ ROOT_CSS_PROPERTIES_SELECTOR } { --wp--style--block-gap: ${ gapValue }; }`;\n\t\t}\n\t}\n\n\t// Output base styles\n\tif ( selector === ROOT_BLOCK_SELECTOR && layoutDefinitions ) {\n\t\tconst validDisplayModes = [ 'block', 'flex', 'grid' ];\n\t\tObject.values( layoutDefinitions ).forEach(\n\t\t\t( { className, displayMode, baseStyles }: LayoutDefinition ) => {\n\t\t\t\tif (\n\t\t\t\t\tdisplayMode &&\n\t\t\t\t\tvalidDisplayModes.includes( displayMode )\n\t\t\t\t) {\n\t\t\t\t\truleset += `${ selector } .${ className } { display:${ displayMode }; }`;\n\t\t\t\t}\n\n\t\t\t\tif ( baseStyles?.length ) {\n\t\t\t\t\tbaseStyles.forEach( ( baseStyle: any ) => {\n\t\t\t\t\t\tconst declarations: string[] = [];\n\n\t\t\t\t\t\tif ( baseStyle.rules ) {\n\t\t\t\t\t\t\tObject.entries( baseStyle.rules ).forEach(\n\t\t\t\t\t\t\t\t( [ cssProperty, cssValue ] ) => {\n\t\t\t\t\t\t\t\t\tdeclarations.push(\n\t\t\t\t\t\t\t\t\t\t`${ cssProperty }: ${ cssValue }`\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\tconst combinedSelector = `.${ className }${\n\t\t\t\t\t\t\t\tbaseStyle?.selector || ''\n\t\t\t\t\t\t\t}`;\n\t\t\t\t\t\t\truleset += `${ combinedSelector } { ${ declarations.join(\n\t\t\t\t\t\t\t\t'; '\n\t\t\t\t\t\t\t) }; }`;\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\treturn ruleset;\n}\n\nconst STYLE_KEYS = [\n\t'border',\n\t'color',\n\t'dimensions',\n\t'spacing',\n\t'typography',\n\t'filter',\n\t'outline',\n\t'shadow',\n\t'background',\n];\n\nfunction pickStyleKeys( treeToPickFrom: any ): any {\n\tif ( ! treeToPickFrom ) {\n\t\treturn {};\n\t}\n\tconst entries = Object.entries( treeToPickFrom );\n\tconst pickedEntries = entries.filter( ( [ key ] ) =>\n\t\tSTYLE_KEYS.includes( key )\n\t);\n\t// clone the style objects so that `getFeatureDeclarations` can remove consumed keys from it\n\tconst clonedEntries = pickedEntries.map( ( [ key, style ] ) => [\n\t\tkey,\n\t\tJSON.parse( JSON.stringify( style ) ),\n\t] );\n\treturn Object.fromEntries( clonedEntries );\n}\n\nexport const getNodesWithStyles = (\n\ttree: GlobalStylesConfig,\n\tblockSelectors: string | BlockSelectors\n): any[] => {\n\tconst nodes: {\n\t\tstyles: Partial< Omit< GlobalStylesStyles, 'elements' | 'blocks' > >;\n\t\tselector: string;\n\t\tskipSelectorWrapper?: boolean;\n\t\tduotoneSelector?: string;\n\t\tfeatureSelectors?:\n\t\t\t| string\n\t\t\t| Record< string, string | Record< string, string > >;\n\t\tfallbackGapValue?: string;\n\t\thasLayoutSupport?: boolean;\n\t\tstyleVariationSelectors?: Record< string, string >;\n\t}[] = [];\n\n\tif ( ! tree?.styles ) {\n\t\treturn nodes;\n\t}\n\n\t// Top-level.\n\tconst styles = pickStyleKeys( tree.styles );\n\tif ( styles ) {\n\t\tnodes.push( {\n\t\t\tstyles,\n\t\t\tselector: ROOT_BLOCK_SELECTOR,\n\t\t\t// Root selector (body) styles should not be wrapped in `:root where()` to keep\n\t\t\t// specificity at (0,0,1) and maintain backwards compatibility.\n\t\t\tskipSelectorWrapper: true,\n\t\t} );\n\t}\n\n\tObject.entries( ELEMENTS ).forEach( ( [ name, selector ] ) => {\n\t\tif ( tree.styles?.elements?.[ name ] ) {\n\t\t\tnodes.push( {\n\t\t\t\tstyles: tree.styles?.elements?.[ name ] ?? {},\n\t\t\t\tselector: selector as string,\n\t\t\t\t// Top level elements that don't use a class name should not receive the\n\t\t\t\t// `:root :where()` wrapper to maintain backwards compatibility.\n\t\t\t\tskipSelectorWrapper: ! (\n\t\t\t\t\tELEMENT_CLASS_NAMES as Record< string, string >\n\t\t\t\t )[ name ],\n\t\t\t} );\n\t\t}\n\t} );\n\n\t// Iterate over blocks: they can have styles & elements.\n\tObject.entries( tree.styles?.blocks ?? {} ).forEach(\n\t\t( [ blockName, node ] ) => {\n\t\t\tconst blockStyles = pickStyleKeys( node );\n\t\t\tconst typedNode = node as BlockNode;\n\n\t\t\tif ( typedNode?.variations ) {\n\t\t\t\tconst variations: Record< string, any > = {};\n\t\t\t\tObject.entries( typedNode.variations ).forEach(\n\t\t\t\t\t( [ variationName, variation ] ) => {\n\t\t\t\t\t\tconst typedVariation = variation as BlockVariation;\n\t\t\t\t\t\tvariations[ variationName ] =\n\t\t\t\t\t\t\tpickStyleKeys( typedVariation );\n\t\t\t\t\t\tif ( typedVariation?.css ) {\n\t\t\t\t\t\t\tvariations[ variationName ].css =\n\t\t\t\t\t\t\t\ttypedVariation.css;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst variationSelector =\n\t\t\t\t\t\t\ttypeof blockSelectors !== 'string'\n\t\t\t\t\t\t\t\t? blockSelectors[ blockName ]\n\t\t\t\t\t\t\t\t\t\t?.styleVariationSelectors?.[\n\t\t\t\t\t\t\t\t\t\tvariationName\n\t\t\t\t\t\t\t\t  ]\n\t\t\t\t\t\t\t\t: undefined;\n\n\t\t\t\t\t\t// Process the variation's inner element styles.\n\t\t\t\t\t\t// This comes before the inner block styles so the\n\t\t\t\t\t\t// element styles within the block type styles take\n\t\t\t\t\t\t// precedence over these.\n\t\t\t\t\t\tObject.entries(\n\t\t\t\t\t\t\ttypedVariation?.elements ?? {}\n\t\t\t\t\t\t).forEach( ( [ element, elementStyles ] ) => {\n\t\t\t\t\t\t\tif ( elementStyles && ELEMENTS[ element ] ) {\n\t\t\t\t\t\t\t\tnodes.push( {\n\t\t\t\t\t\t\t\t\tstyles: elementStyles,\n\t\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\t\tvariationSelector,\n\t\t\t\t\t\t\t\t\t\tELEMENTS[ element ]\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t// Process the variations inner block type styles.\n\t\t\t\t\t\tObject.entries( typedVariation?.blocks ?? {} ).forEach(\n\t\t\t\t\t\t\t( [\n\t\t\t\t\t\t\t\tvariationBlockName,\n\t\t\t\t\t\t\t\tvariationBlockStyles,\n\t\t\t\t\t\t\t] ) => {\n\t\t\t\t\t\t\t\tconst variationBlockSelector =\n\t\t\t\t\t\t\t\t\ttypeof blockSelectors !== 'string'\n\t\t\t\t\t\t\t\t\t\t? scopeSelector(\n\t\t\t\t\t\t\t\t\t\t\t\tvariationSelector,\n\t\t\t\t\t\t\t\t\t\t\t\tblockSelectors[\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariationBlockName\n\t\t\t\t\t\t\t\t\t\t\t\t]?.selector\n\t\t\t\t\t\t\t\t\t\t  )\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\tconst variationDuotoneSelector =\n\t\t\t\t\t\t\t\t\ttypeof blockSelectors !== 'string'\n\t\t\t\t\t\t\t\t\t\t? scopeSelector(\n\t\t\t\t\t\t\t\t\t\t\t\tvariationSelector,\n\t\t\t\t\t\t\t\t\t\t\t\tblockSelectors[\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariationBlockName\n\t\t\t\t\t\t\t\t\t\t\t\t]?.duotoneSelector as string\n\t\t\t\t\t\t\t\t\t\t  )\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\tconst variationFeatureSelectors =\n\t\t\t\t\t\t\t\t\ttypeof blockSelectors !== 'string'\n\t\t\t\t\t\t\t\t\t\t? scopeFeatureSelectors(\n\t\t\t\t\t\t\t\t\t\t\t\tvariationSelector,\n\t\t\t\t\t\t\t\t\t\t\t\tblockSelectors[\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariationBlockName\n\t\t\t\t\t\t\t\t\t\t\t\t]?.featureSelectors ?? {}\n\t\t\t\t\t\t\t\t\t\t  )\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\n\t\t\t\t\t\t\t\tconst variationBlockStyleNodes =\n\t\t\t\t\t\t\t\t\tpickStyleKeys( variationBlockStyles );\n\n\t\t\t\t\t\t\t\tif ( variationBlockStyles?.css ) {\n\t\t\t\t\t\t\t\t\tvariationBlockStyleNodes.css =\n\t\t\t\t\t\t\t\t\t\tvariationBlockStyles.css;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t! variationBlockSelector ||\n\t\t\t\t\t\t\t\t\ttypeof blockSelectors === 'string'\n\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tnodes.push( {\n\t\t\t\t\t\t\t\t\tselector: variationBlockSelector,\n\t\t\t\t\t\t\t\t\tduotoneSelector: variationDuotoneSelector,\n\t\t\t\t\t\t\t\t\tfeatureSelectors: variationFeatureSelectors,\n\t\t\t\t\t\t\t\t\tfallbackGapValue:\n\t\t\t\t\t\t\t\t\t\tblockSelectors[ variationBlockName ]\n\t\t\t\t\t\t\t\t\t\t\t?.fallbackGapValue,\n\t\t\t\t\t\t\t\t\thasLayoutSupport:\n\t\t\t\t\t\t\t\t\t\tblockSelectors[ variationBlockName ]\n\t\t\t\t\t\t\t\t\t\t\t?.hasLayoutSupport,\n\t\t\t\t\t\t\t\t\tstyles: variationBlockStyleNodes,\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t\t// Process element styles for the inner blocks\n\t\t\t\t\t\t\t\t// of the variation.\n\t\t\t\t\t\t\t\tObject.entries(\n\t\t\t\t\t\t\t\t\tvariationBlockStyles.elements ?? {}\n\t\t\t\t\t\t\t\t).forEach(\n\t\t\t\t\t\t\t\t\t( [\n\t\t\t\t\t\t\t\t\t\tvariationBlockElement,\n\t\t\t\t\t\t\t\t\t\tvariationBlockElementStyles,\n\t\t\t\t\t\t\t\t\t] ) => {\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tvariationBlockElementStyles &&\n\t\t\t\t\t\t\t\t\t\t\tELEMENTS[ variationBlockElement ]\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tnodes.push( {\n\t\t\t\t\t\t\t\t\t\t\t\tstyles: variationBlockElementStyles,\n\t\t\t\t\t\t\t\t\t\t\t\tselector: scopeSelector(\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariationBlockSelector,\n\t\t\t\t\t\t\t\t\t\t\t\t\tELEMENTS[\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariationBlockElement\n\t\t\t\t\t\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tblockStyles.variations = variations;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\ttypeof blockSelectors !== 'string' &&\n\t\t\t\tblockSelectors?.[ blockName ]?.selector\n\t\t\t) {\n\t\t\t\tnodes.push( {\n\t\t\t\t\tduotoneSelector:\n\t\t\t\t\t\tblockSelectors[ blockName ].duotoneSelector,\n\t\t\t\t\tfallbackGapValue:\n\t\t\t\t\t\tblockSelectors[ blockName ].fallbackGapValue,\n\t\t\t\t\thasLayoutSupport:\n\t\t\t\t\t\tblockSelectors[ blockName ].hasLayoutSupport,\n\t\t\t\t\tselector: blockSelectors[ blockName ].selector,\n\t\t\t\t\tstyles: blockStyles,\n\t\t\t\t\tfeatureSelectors:\n\t\t\t\t\t\tblockSelectors[ blockName ].featureSelectors,\n\t\t\t\t\tstyleVariationSelectors:\n\t\t\t\t\t\tblockSelectors[ blockName ].styleVariationSelectors,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tObject.entries( typedNode?.elements ?? {} ).forEach(\n\t\t\t\t( [ elementName, value ] ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\ttypeof blockSelectors !== 'string' &&\n\t\t\t\t\t\tvalue &&\n\t\t\t\t\t\tblockSelectors?.[ blockName ] &&\n\t\t\t\t\t\tELEMENTS[ elementName ]\n\t\t\t\t\t) {\n\t\t\t\t\t\tnodes.push( {\n\t\t\t\t\t\t\tstyles: value,\n\t\t\t\t\t\t\tselector: blockSelectors[ blockName ]?.selector\n\t\t\t\t\t\t\t\t.split( ',' )\n\t\t\t\t\t\t\t\t.map( ( sel: string ) => {\n\t\t\t\t\t\t\t\t\tconst elementSelectors =\n\t\t\t\t\t\t\t\t\t\tELEMENTS[ elementName ].split( ',' );\n\t\t\t\t\t\t\t\t\treturn elementSelectors.map(\n\t\t\t\t\t\t\t\t\t\t( elementSelector: string ) =>\n\t\t\t\t\t\t\t\t\t\t\tsel + ' ' + elementSelector\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t.join( ',' ),\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t);\n\n\treturn nodes;\n};\n\nexport const getNodesWithSettings = (\n\ttree: GlobalStylesConfig,\n\tblockSelectors: string | BlockSelectors\n): any[] => {\n\tconst nodes: {\n\t\tpresets: Record< string, any >;\n\t\tcustom?: Record< string, any >;\n\t\tselector?: string;\n\t\tduotoneSelector?: string;\n\t\tfallbackGapValue?: string;\n\t\thasLayoutSupport?: boolean;\n\t\tfeatureSelectors?: Record< string, string >;\n\t\tstyleVariationSelectors?: Record< string, string >;\n\t}[] = [];\n\n\tif ( ! tree?.settings ) {\n\t\treturn nodes;\n\t}\n\n\tconst pickPresets = ( treeToPickFrom: any ): any => {\n\t\tlet presets = {};\n\t\tPRESET_METADATA.forEach( ( { path } ) => {\n\t\t\tconst value = getValueFromObjectPath( treeToPickFrom, path, false );\n\t\t\tif ( value !== false ) {\n\t\t\t\tpresets = setImmutably( presets, path, value );\n\t\t\t}\n\t\t} );\n\t\treturn presets;\n\t};\n\n\t// Top-level.\n\tconst presets = pickPresets( tree.settings );\n\tconst custom = tree.settings?.custom;\n\tif ( Object.keys( presets ).length > 0 || custom ) {\n\t\tnodes.push( {\n\t\t\tpresets,\n\t\t\tcustom,\n\t\t\tselector: ROOT_CSS_PROPERTIES_SELECTOR,\n\t\t} );\n\t}\n\n\t// Blocks.\n\tObject.entries( tree.settings?.blocks ?? {} ).forEach(\n\t\t( [ blockName, node ] ) => {\n\t\t\tconst blockCustom = node.custom;\n\t\t\tif (\n\t\t\t\ttypeof blockSelectors === 'string' ||\n\t\t\t\t! blockSelectors[ blockName ]\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst blockPresets = pickPresets( node );\n\t\t\tif ( Object.keys( blockPresets ).length > 0 || blockCustom ) {\n\t\t\t\tnodes.push( {\n\t\t\t\t\tpresets: blockPresets,\n\t\t\t\t\tcustom: blockCustom,\n\t\t\t\t\tselector: blockSelectors[ blockName ]?.selector,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t);\n\n\treturn nodes;\n};\n\nexport const generateCustomProperties = (\n\ttree: GlobalStylesConfig,\n\tblockSelectors: BlockSelectors\n): string => {\n\tconst settings = getNodesWithSettings( tree, blockSelectors );\n\tlet ruleset = '';\n\tsettings.forEach( ( { presets, custom, selector } ) => {\n\t\tconst declarations = tree?.settings\n\t\t\t? getPresetsDeclarations( presets, tree?.settings )\n\t\t\t: [];\n\t\tconst customProps = flattenTree( custom, '--wp--custom--', '--' );\n\t\tif ( customProps.length > 0 ) {\n\t\t\tdeclarations.push( ...customProps );\n\t\t}\n\n\t\tif ( declarations.length > 0 ) {\n\t\t\truleset += `${ selector }{${ declarations.join( ';' ) };}`;\n\t\t}\n\t} );\n\n\treturn ruleset;\n};\n\nexport const transformToStyles = (\n\ttree: GlobalStylesConfig,\n\tblockSelectors: string | BlockSelectors,\n\thasBlockGapSupport?: boolean,\n\thasFallbackGapSupport?: boolean,\n\tdisableLayoutStyles: boolean = false,\n\tdisableRootPadding: boolean = false,\n\tstyleOptions: Record< string, boolean > = {}\n): string => {\n\t// These allow opting out of certain sets of styles.\n\tconst options = {\n\t\tblockGap: true,\n\t\tblockStyles: true,\n\t\tlayoutStyles: true,\n\t\tmarginReset: true,\n\t\tpresets: true,\n\t\trootPadding: true,\n\t\tvariationStyles: false,\n\t\t...styleOptions,\n\t};\n\tconst nodesWithStyles = getNodesWithStyles( tree, blockSelectors );\n\tconst nodesWithSettings = getNodesWithSettings( tree, blockSelectors );\n\tconst useRootPaddingAlign = tree?.settings?.useRootPaddingAwareAlignments;\n\tconst { contentSize, wideSize } = tree?.settings?.layout || {};\n\tconst hasBodyStyles =\n\t\toptions.marginReset || options.rootPadding || options.layoutStyles;\n\n\tlet ruleset = '';\n\n\tif ( options.presets && ( contentSize || wideSize ) ) {\n\t\truleset += `${ ROOT_CSS_PROPERTIES_SELECTOR } {`;\n\t\truleset = contentSize\n\t\t\t? ruleset + ` --wp--style--global--content-size: ${ contentSize };`\n\t\t\t: ruleset;\n\t\truleset = wideSize\n\t\t\t? ruleset + ` --wp--style--global--wide-size: ${ wideSize };`\n\t\t\t: ruleset;\n\t\truleset += '}';\n\t}\n\n\tif ( hasBodyStyles ) {\n\t\t/*\n\t\t * Reset default browser margin on the body element.\n\t\t * This is set on the body selector **before** generating the ruleset\n\t\t * from the `theme.json`. This is to ensure that if the `theme.json` declares\n\t\t * `margin` in its `spacing` declaration for the `body` element then these\n\t\t * user-generated values take precedence in the CSS cascade.\n\t\t * @link https://github.com/WordPress/gutenberg/issues/36147.\n\t\t */\n\t\truleset += ':where(body) {margin: 0;';\n\n\t\t// Root padding styles should be output for full templates, patterns and template parts.\n\t\tif ( options.rootPadding && useRootPaddingAlign ) {\n\t\t\t/*\n\t\t\t * These rules reproduce the ones from https://github.com/WordPress/gutenberg/blob/79103f124925d1f457f627e154f52a56228ed5ad/lib/class-wp-theme-json-gutenberg.php#L2508\n\t\t\t * almost exactly, but for the selectors that target block wrappers in the front end. This code only runs in the editor, so it doesn't need those selectors.\n\t\t\t */\n\t\t\truleset += `padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }\n\t\t\t\t.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }\n\t\t\t\t.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }\n\t\t\t\t.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; }\n\t\t\t\t.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0;\n\t\t\t\t`;\n\t\t}\n\n\t\truleset += '}';\n\t}\n\n\tif ( options.blockStyles ) {\n\t\tnodesWithStyles.forEach(\n\t\t\t( {\n\t\t\t\tselector,\n\t\t\t\tduotoneSelector,\n\t\t\t\tstyles,\n\t\t\t\tfallbackGapValue,\n\t\t\t\thasLayoutSupport,\n\t\t\t\tfeatureSelectors,\n\t\t\t\tstyleVariationSelectors,\n\t\t\t\tskipSelectorWrapper,\n\t\t\t} ) => {\n\t\t\t\t// Process styles for block support features with custom feature level\n\t\t\t\t// CSS selectors set.\n\t\t\t\tif ( featureSelectors ) {\n\t\t\t\t\tconst featureDeclarations = getFeatureDeclarations(\n\t\t\t\t\t\tfeatureSelectors,\n\t\t\t\t\t\tstyles\n\t\t\t\t\t);\n\n\t\t\t\t\tObject.entries( featureDeclarations ).forEach(\n\t\t\t\t\t\t( [ cssSelector, declarations ] ) => {\n\t\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\t\tconst rules = declarations.join( ';' );\n\t\t\t\t\t\t\t\truleset += `:root :where(${ cssSelector }){${ rules };}`;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Process duotone styles.\n\t\t\t\tif ( duotoneSelector ) {\n\t\t\t\t\tconst duotoneStyles: any = {};\n\t\t\t\t\tif ( styles?.filter ) {\n\t\t\t\t\t\tduotoneStyles.filter = styles.filter;\n\t\t\t\t\t\tdelete styles.filter;\n\t\t\t\t\t}\n\t\t\t\t\tconst duotoneDeclarations =\n\t\t\t\t\t\tgetStylesDeclarations( duotoneStyles );\n\t\t\t\t\tif ( duotoneDeclarations.length ) {\n\t\t\t\t\t\truleset += `${ duotoneSelector }{${ duotoneDeclarations.join(\n\t\t\t\t\t\t\t';'\n\t\t\t\t\t\t) };}`;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Process blockGap and layout styles.\n\t\t\t\tif (\n\t\t\t\t\t! disableLayoutStyles &&\n\t\t\t\t\t( ROOT_BLOCK_SELECTOR === selector || hasLayoutSupport )\n\t\t\t\t) {\n\t\t\t\t\truleset += getLayoutStyles( {\n\t\t\t\t\t\tstyle: styles,\n\t\t\t\t\t\tselector,\n\t\t\t\t\t\thasBlockGapSupport,\n\t\t\t\t\t\thasFallbackGapSupport,\n\t\t\t\t\t\tfallbackGapValue,\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\t// Process the remaining block styles (they use either normal block class or __experimentalSelector).\n\t\t\t\tconst styleDeclarations = getStylesDeclarations(\n\t\t\t\t\tstyles,\n\t\t\t\t\tselector,\n\t\t\t\t\tuseRootPaddingAlign,\n\t\t\t\t\ttree,\n\t\t\t\t\tdisableRootPadding\n\t\t\t\t);\n\t\t\t\tif ( styleDeclarations?.length ) {\n\t\t\t\t\tconst generalSelector = skipSelectorWrapper\n\t\t\t\t\t\t? selector\n\t\t\t\t\t\t: `:root :where(${ selector })`;\n\t\t\t\t\truleset += `${ generalSelector }{${ styleDeclarations.join(\n\t\t\t\t\t\t';'\n\t\t\t\t\t) };}`;\n\t\t\t\t}\n\t\t\t\tif ( styles?.css ) {\n\t\t\t\t\truleset += processCSSNesting(\n\t\t\t\t\t\tstyles.css,\n\t\t\t\t\t\t`:root :where(${ selector })`\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif ( options.variationStyles && styleVariationSelectors ) {\n\t\t\t\t\tObject.entries( styleVariationSelectors ).forEach(\n\t\t\t\t\t\t( [ styleVariationName, styleVariationSelector ] ) => {\n\t\t\t\t\t\t\tconst styleVariations =\n\t\t\t\t\t\t\t\tstyles?.variations?.[ styleVariationName ];\n\t\t\t\t\t\t\tif ( styleVariations ) {\n\t\t\t\t\t\t\t\t// If the block uses any custom selectors for block support, add those first.\n\t\t\t\t\t\t\t\tif ( featureSelectors ) {\n\t\t\t\t\t\t\t\t\tconst featureDeclarations =\n\t\t\t\t\t\t\t\t\t\tgetFeatureDeclarations(\n\t\t\t\t\t\t\t\t\t\t\tfeatureSelectors,\n\t\t\t\t\t\t\t\t\t\t\tstyleVariations\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tObject.entries(\n\t\t\t\t\t\t\t\t\t\tfeatureDeclarations\n\t\t\t\t\t\t\t\t\t).forEach(\n\t\t\t\t\t\t\t\t\t\t( [ baseSelector, declarations ]: [\n\t\t\t\t\t\t\t\t\t\t\tstring,\n\t\t\t\t\t\t\t\t\t\t\tstring[],\n\t\t\t\t\t\t\t\t\t\t] ) => {\n\t\t\t\t\t\t\t\t\t\t\tif ( declarations.length ) {\n\t\t\t\t\t\t\t\t\t\t\t\tconst cssSelector =\n\t\t\t\t\t\t\t\t\t\t\t\t\tconcatFeatureVariationSelectorString(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbaseSelector,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyleVariationSelector as string\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\tconst rules =\n\t\t\t\t\t\t\t\t\t\t\t\t\tdeclarations.join( ';' );\n\t\t\t\t\t\t\t\t\t\t\t\truleset += `:root :where(${ cssSelector }){${ rules };}`;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Otherwise add regular selectors.\n\t\t\t\t\t\t\t\tconst styleVariationDeclarations =\n\t\t\t\t\t\t\t\t\tgetStylesDeclarations(\n\t\t\t\t\t\t\t\t\t\tstyleVariations,\n\t\t\t\t\t\t\t\t\t\tstyleVariationSelector as string,\n\t\t\t\t\t\t\t\t\t\tuseRootPaddingAlign,\n\t\t\t\t\t\t\t\t\t\ttree\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tif ( styleVariationDeclarations.length ) {\n\t\t\t\t\t\t\t\t\truleset += `:root :where(${ styleVariationSelector }){${ styleVariationDeclarations.join(\n\t\t\t\t\t\t\t\t\t\t';'\n\t\t\t\t\t\t\t\t\t) };}`;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( styleVariations?.css ) {\n\t\t\t\t\t\t\t\t\truleset += processCSSNesting(\n\t\t\t\t\t\t\t\t\t\tstyleVariations.css,\n\t\t\t\t\t\t\t\t\t\t`:root :where(${ styleVariationSelector })`\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\t// Check for pseudo selector in `styles` and handle separately.\n\t\t\t\tconst pseudoSelectorStyles = Object.entries( styles ).filter(\n\t\t\t\t\t( [ key ] ) => key.startsWith( ':' )\n\t\t\t\t);\n\n\t\t\t\tif ( pseudoSelectorStyles?.length ) {\n\t\t\t\t\tpseudoSelectorStyles.forEach(\n\t\t\t\t\t\t( [ pseudoKey, pseudoStyle ] ) => {\n\t\t\t\t\t\t\tconst pseudoDeclarations =\n\t\t\t\t\t\t\t\tgetStylesDeclarations( pseudoStyle );\n\n\t\t\t\t\t\t\tif ( ! pseudoDeclarations?.length ) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// `selector` may be provided in a form\n\t\t\t\t\t\t\t// where block level selectors have sub element\n\t\t\t\t\t\t\t// selectors appended to them as a comma separated\n\t\t\t\t\t\t\t// string.\n\t\t\t\t\t\t\t// e.g. `h1 a,h2 a,h3 a,h4 a,h5 a,h6 a`;\n\t\t\t\t\t\t\t// Split and append pseudo selector to create\n\t\t\t\t\t\t\t// the proper rules to target the elements.\n\t\t\t\t\t\t\tconst _selector = selector\n\t\t\t\t\t\t\t\t.split( ',' )\n\t\t\t\t\t\t\t\t.map( ( sel: string ) => sel + pseudoKey )\n\t\t\t\t\t\t\t\t.join( ',' );\n\n\t\t\t\t\t\t\t// As pseudo classes such as :hover, :focus etc. have class-level\n\t\t\t\t\t\t\t// specificity, they must use the `:root :where()` wrapper. This.\n\t\t\t\t\t\t\t// caps the specificity at `0-1-0` to allow proper nesting of variations\n\t\t\t\t\t\t\t// and block type element styles.\n\t\t\t\t\t\t\tconst pseudoRule = `:root :where(${ _selector }){${ pseudoDeclarations.join(\n\t\t\t\t\t\t\t\t';'\n\t\t\t\t\t\t\t) };}`;\n\n\t\t\t\t\t\t\truleset += pseudoRule;\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\tif ( options.layoutStyles ) {\n\t\t/* Add alignment / layout styles */\n\t\truleset =\n\t\t\truleset +\n\t\t\t'.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }';\n\t\truleset =\n\t\t\truleset +\n\t\t\t'.wp-site-blocks > .alignright { float: right; margin-left: 2em; }';\n\t\truleset =\n\t\t\truleset +\n\t\t\t'.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }';\n\t}\n\n\tif ( options.blockGap && hasBlockGapSupport ) {\n\t\t// Use fallback of `0.5em` just in case, however if there is blockGap support, there should nearly always be a real value.\n\t\tconst gapValue =\n\t\t\tgetGapCSSValue( tree?.styles?.spacing?.blockGap ) || '0.5em';\n\t\truleset =\n\t\t\truleset +\n\t\t\t`:root :where(.wp-site-blocks) > * { margin-block-start: ${ gapValue }; margin-block-end: 0; }`;\n\t\truleset =\n\t\t\truleset +\n\t\t\t':root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }';\n\t\truleset =\n\t\t\truleset +\n\t\t\t':root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }';\n\t}\n\n\tif ( options.presets ) {\n\t\tnodesWithSettings.forEach( ( { selector, presets } ) => {\n\t\t\tif (\n\t\t\t\tROOT_BLOCK_SELECTOR === selector ||\n\t\t\t\tROOT_CSS_PROPERTIES_SELECTOR === selector\n\t\t\t) {\n\t\t\t\t// Do not add extra specificity for top-level classes.\n\t\t\t\tselector = '';\n\t\t\t}\n\n\t\t\tconst classes = getPresetsClasses( selector, presets );\n\t\t\tif ( classes.length > 0 ) {\n\t\t\t\truleset += classes;\n\t\t\t}\n\t\t} );\n\t}\n\n\treturn ruleset;\n};\n\nexport function generateSvgFilters(\n\ttree: GlobalStylesConfig,\n\tblockSelectors: BlockSelectors\n): string[] {\n\tconst nodesWithSettings = getNodesWithSettings( tree, blockSelectors );\n\treturn nodesWithSettings.flatMap( ( { presets } ) => {\n\t\treturn getPresetsSvgFilters( presets );\n\t} );\n}\n\nconst getSelectorsConfig = ( blockType: BlockType, rootSelector: string ) => {\n\tif (\n\t\tblockType?.selectors &&\n\t\tObject.keys( blockType.selectors ).length > 0\n\t) {\n\t\treturn blockType.selectors;\n\t}\n\n\tconst config: Record< string, string > = {\n\t\troot: rootSelector,\n\t};\n\tObject.entries( BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS ).forEach(\n\t\t( [ featureKey, featureName ] ) => {\n\t\t\tconst featureSelector = getBlockSelector( blockType, featureKey );\n\n\t\t\tif ( featureSelector ) {\n\t\t\t\tconfig[ featureName ] = featureSelector;\n\t\t\t}\n\t\t}\n\t);\n\n\treturn config;\n};\n\nexport const getBlockSelectors = (\n\tblockTypes: BlockType[],\n\tvariationInstanceId?: string\n) => {\n\tconst { getBlockStyles } = select( blocksStore );\n\tconst result: BlockSelectors = {};\n\tblockTypes.forEach( ( blockType ) => {\n\t\tconst name = blockType.name;\n\t\tconst selector = getBlockSelector( blockType );\n\n\t\tif ( ! selector ) {\n\t\t\treturn; // Skip blocks without valid selectors\n\t\t}\n\t\tlet duotoneSelector = getBlockSelector( blockType, 'filter.duotone' );\n\t\t// Keep backwards compatibility for support.color.__experimentalDuotone.\n\t\tif ( ! duotoneSelector ) {\n\t\t\tconst rootSelector = getBlockSelector( blockType );\n\t\t\tconst duotoneSupport = getBlockSupport(\n\t\t\t\tblockType,\n\t\t\t\t'color.__experimentalDuotone',\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tduotoneSelector =\n\t\t\t\tduotoneSupport &&\n\t\t\t\trootSelector &&\n\t\t\t\tscopeSelector( rootSelector, duotoneSupport );\n\t\t}\n\n\t\tconst hasLayoutSupport =\n\t\t\t!! blockType?.supports?.layout ||\n\t\t\t!! blockType?.supports?.__experimentalLayout;\n\t\tconst fallbackGapValue =\n\t\t\t// @ts-expect-error\n\t\t\tblockType?.supports?.spacing?.blockGap?.__experimentalDefault;\n\n\t\tconst blockStyleVariations = getBlockStyles( name );\n\t\tconst styleVariationSelectors: Record< string, string > = {};\n\t\tblockStyleVariations?.forEach( ( variation: BlockStyleVariation ) => {\n\t\t\tconst variationSuffix = variationInstanceId\n\t\t\t\t? `-${ variationInstanceId }`\n\t\t\t\t: '';\n\t\t\tconst variationName = `${ variation.name }${ variationSuffix }`;\n\t\t\tconst styleVariationSelector = getBlockStyleVariationSelector(\n\t\t\t\tvariationName,\n\t\t\t\tselector\n\t\t\t);\n\n\t\t\tstyleVariationSelectors[ variationName ] = styleVariationSelector;\n\t\t} );\n\n\t\t// For each block support feature add any custom selectors.\n\t\tconst featureSelectors = getSelectorsConfig( blockType, selector );\n\n\t\tresult[ name ] = {\n\t\t\tduotoneSelector: duotoneSelector ?? undefined,\n\t\t\tfallbackGapValue,\n\t\t\tfeatureSelectors: Object.keys( featureSelectors ).length\n\t\t\t\t? featureSelectors\n\t\t\t\t: undefined,\n\t\t\thasLayoutSupport,\n\t\t\tname,\n\t\t\tselector,\n\t\t\tstyleVariationSelectors: blockStyleVariations?.length\n\t\t\t\t? styleVariationSelectors\n\t\t\t\t: undefined,\n\t\t};\n\t} );\n\n\treturn result;\n};\n\n/**\n * If there is a separator block whose color is defined in theme.json via background,\n * update the separator color to the same value by using border color.\n *\n * @param config Theme.json configuration file object\n * @return Theme.json configuration file object updated\n */\nfunction updateConfigWithSeparator(\n\tconfig: GlobalStylesConfig\n): GlobalStylesConfig {\n\tconst blocks = config.styles?.blocks;\n\tconst separatorBlock = blocks?.[ 'core/separator' ];\n\tconst needsSeparatorStyleUpdate =\n\t\tseparatorBlock &&\n\t\tseparatorBlock.color?.background &&\n\t\t! separatorBlock.color?.text &&\n\t\t! separatorBlock.border?.color;\n\tif ( needsSeparatorStyleUpdate ) {\n\t\treturn {\n\t\t\t...config,\n\t\t\tstyles: {\n\t\t\t\t...config.styles,\n\t\t\t\tblocks: {\n\t\t\t\t\t...blocks,\n\t\t\t\t\t'core/separator': {\n\t\t\t\t\t\t...separatorBlock,\n\t\t\t\t\t\tcolor: {\n\t\t\t\t\t\t\t...separatorBlock.color,\n\t\t\t\t\t\t\ttext: separatorBlock.color?.background,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\treturn config;\n}\n\nexport function processCSSNesting( css: string, blockSelector: string ) {\n\tlet processedCSS = '';\n\n\tif ( ! css || css.trim() === '' ) {\n\t\treturn processedCSS;\n\t}\n\n\t// Split CSS nested rules.\n\tconst parts = css.split( '&' );\n\tparts.forEach( ( part: string ) => {\n\t\tif ( ! part || part.trim() === '' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isRootCss = ! part.includes( '{' );\n\t\tif ( isRootCss ) {\n\t\t\t// If the part doesn't contain braces, it applies to the root level.\n\t\t\tprocessedCSS += `:root :where(${ blockSelector }){${ part.trim() }}`;\n\t\t} else {\n\t\t\t// If the part contains braces, it's a nested CSS rule.\n\t\t\tconst splitPart = part.replace( '}', '' ).split( '{' );\n\t\t\tif ( splitPart.length !== 2 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst [ nestedSelector, cssValue ] = splitPart;\n\n\t\t\t// Handle pseudo elements such as ::before, ::after, etc. Regex will also\n\t\t\t// capture any leading combinator such as >, +, or ~, as well as spaces.\n\t\t\t// This allows pseudo elements as descendants e.g. `.parent ::before`.\n\t\t\tconst matches = nestedSelector.match( /([>+~\\s]*::[a-zA-Z-]+)/ );\n\t\t\tconst pseudoPart = matches ? matches[ 1 ] : '';\n\t\t\tconst withoutPseudoElement = matches\n\t\t\t\t? nestedSelector.replace( pseudoPart, '' ).trim()\n\t\t\t\t: nestedSelector.trim();\n\n\t\t\tlet combinedSelector;\n\t\t\tif ( withoutPseudoElement === '' ) {\n\t\t\t\t// Only contained a pseudo element to use the block selector to form\n\t\t\t\t// the final `:root :where()` selector.\n\t\t\t\tcombinedSelector = blockSelector;\n\t\t\t} else {\n\t\t\t\t// If the nested selector is a descendant of the block scope it with the\n\t\t\t\t// block selector. Otherwise append it to the block selector.\n\t\t\t\tcombinedSelector = nestedSelector.startsWith( ' ' )\n\t\t\t\t\t? scopeSelector( blockSelector, withoutPseudoElement )\n\t\t\t\t\t: appendToSelector( blockSelector, withoutPseudoElement );\n\t\t\t}\n\n\t\t\t// Build final rule, re-adding any pseudo element outside the `:where()`\n\t\t\t// to maintain valid CSS selector.\n\t\t\tprocessedCSS += `:root :where(${ combinedSelector })${ pseudoPart }{${ cssValue.trim() }}`;\n\t\t}\n\t} );\n\treturn processedCSS;\n}\n\nexport interface GlobalStylesRenderOptions {\n\thasBlockGapSupport?: boolean;\n\thasFallbackGapSupport?: boolean;\n\tdisableLayoutStyles?: boolean;\n\tdisableRootPadding?: boolean;\n\tgetBlockStyles?: ( blockName: string ) => any[];\n\tstyleOptions?: Record< string, boolean >;\n}\n\n/**\n * Returns the global styles output based on the current state of global styles config loaded in the editor context.\n *\n * @param config     Global styles configuration\n * @param blockTypes Array of block types from WordPress blocks store\n * @param options    Options for rendering global styles\n * @return Array of stylesheets and settings\n */\nexport function generateGlobalStyles(\n\tconfig: GlobalStylesConfig | undefined = {},\n\tblockTypes: any[] = [],\n\toptions: GlobalStylesRenderOptions = {}\n): [ any[], any ] {\n\tconst {\n\t\thasBlockGapSupport: hasBlockGapSupportOption,\n\t\thasFallbackGapSupport: hasFallbackGapSupportOption,\n\t\tdisableLayoutStyles = false,\n\t\tdisableRootPadding = false,\n\t\tstyleOptions = {},\n\t} = options;\n\n\t// Use provided block types or fall back to getBlockTypes()\n\tconst blocks = blockTypes.length > 0 ? blockTypes : getBlockTypes();\n\n\tconst blockGap = getSetting( config, 'spacing.blockGap' );\n\tconst hasBlockGapSupport = hasBlockGapSupportOption ?? blockGap !== null;\n\tconst hasFallbackGapSupport =\n\t\thasFallbackGapSupportOption ?? ! hasBlockGapSupport;\n\n\tif ( ! config?.styles || ! config?.settings ) {\n\t\treturn [ [], {} ];\n\t}\n\tconst updatedConfig = updateConfigWithSeparator( config );\n\tconst blockSelectors = getBlockSelectors( blocks );\n\tconst customProperties = generateCustomProperties(\n\t\tupdatedConfig,\n\t\tblockSelectors\n\t);\n\tconst globalStyles = transformToStyles(\n\t\tupdatedConfig,\n\t\tblockSelectors,\n\t\thasBlockGapSupport,\n\t\thasFallbackGapSupport,\n\t\tdisableLayoutStyles,\n\t\tdisableRootPadding,\n\t\tstyleOptions\n\t);\n\tconst svgs = generateSvgFilters( updatedConfig, blockSelectors );\n\tconst styles = [\n\t\t{\n\t\t\tcss: customProperties,\n\t\t\tisGlobalStyles: true,\n\t\t},\n\t\t{\n\t\t\tcss: globalStyles,\n\t\t\tisGlobalStyles: true,\n\t\t},\n\t\t// Load custom CSS in own stylesheet so that any invalid CSS entered in the input won't break all the global styles in the editor.\n\t\t{\n\t\t\tcss: updatedConfig?.styles?.css ?? '',\n\t\t\tisGlobalStyles: true,\n\t\t},\n\t\t{\n\t\t\tassets: svgs,\n\t\t\t__unstableType: 'svg',\n\t\t\tisGlobalStyles: true,\n\t\t},\n\t];\n\n\t// Loop through the blocks to check if there are custom CSS values.\n\t// If there are, get the block selector and push the selector together with\n\t// the CSS value to the 'stylesheets' array.\n\tblocks.forEach( ( blockType: BlockType ) => {\n\t\tconst blockStyles = updatedConfig?.styles?.blocks?.[ blockType.name ];\n\t\tif ( blockStyles?.css ) {\n\t\t\tconst selector = blockSelectors[ blockType.name ].selector;\n\t\t\tstyles.push( {\n\t\t\t\tcss: processCSSNesting( blockStyles.css, selector ),\n\t\t\t\tisGlobalStyles: true,\n\t\t\t} );\n\t\t}\n\t} );\n\n\treturn [ styles, updatedConfig.settings ];\n}\n", "export function getSpacingPresetCssVar( value?: string ) {\n\tif ( ! value ) {\n\t\treturn;\n\t}\n\n\tconst slug = value.match( /var:preset\\|spacing\\|(.+)/ );\n\n\tif ( ! slug ) {\n\t\treturn value;\n\t}\n\n\treturn `var(--wp--preset--spacing--${ slug[ 1 ] })`;\n}\n", "/**\n * Internal dependencies\n */\nimport { getSpacingPresetCssVar } from './spacing';\n\n/**\n * Returns a BoxControl object value from a given blockGap style value.\n * The string check is for backwards compatibility before Gutenberg supported\n * split gap values (row and column) and the value was a string n + unit.\n *\n * @param blockGapValue A block gap string or axial object value, e.g., '10px' or { top: '10px', left: '10px'}.\n * @return A value to pass to the BoxControl component.\n */\nexport function getGapBoxControlValueFromStyle(\n\tblockGapValue?: string | { top: string; left: string }\n) {\n\tif ( ! blockGapValue ) {\n\t\treturn null;\n\t}\n\n\tconst isValueString = typeof blockGapValue === 'string';\n\treturn {\n\t\ttop: isValueString ? blockGapValue : blockGapValue?.top,\n\t\tleft: isValueString ? blockGapValue : blockGapValue?.left,\n\t};\n}\n\n/**\n * Returns a CSS value for the `gap` property from a given blockGap style.\n *\n * @param blockGapValue A block gap string or axial object value, e.g., '10px' or { top: '10px', left: '10px'}.\n * @param defaultValue  A default gap value.\n * @return The concatenated gap value (row and column).\n */\nexport function getGapCSSValue(\n\tblockGapValue?:\n\t\t| string\n\t\t| {\n\t\t\t\ttop: string;\n\t\t\t\tleft: string;\n\t\t  },\n\tdefaultValue: string = '0'\n) {\n\tconst blockGapBoxControlValue =\n\t\tgetGapBoxControlValueFromStyle( blockGapValue );\n\tif ( ! blockGapBoxControlValue ) {\n\t\treturn null;\n\t}\n\n\tconst row =\n\t\tgetSpacingPresetCssVar( blockGapBoxControlValue?.top ) || defaultValue;\n\tconst column =\n\t\tgetSpacingPresetCssVar( blockGapBoxControlValue?.left ) || defaultValue;\n\n\treturn row === column ? row : `${ row } ${ column }`;\n}\n", "// Layout definitions keyed by layout type.\n// Provides a common definition of slugs, classnames, base styles, and spacing styles for each layout type.\n// If making changes or additions to layout definitions, be sure to update the corresponding PHP definitions in\n// `block-supports/layout.php` so that the server-side and client-side definitions match.\nexport const LAYOUT_DEFINITIONS = {\n\tdefault: {\n\t\tname: 'default',\n\t\tslug: 'flow',\n\t\tclassName: 'is-layout-flow',\n\t\tbaseStyles: [\n\t\t\t{\n\t\t\t\tselector: ' > .alignleft',\n\t\t\t\trules: {\n\t\t\t\t\tfloat: 'left',\n\t\t\t\t\t'margin-inline-start': '0',\n\t\t\t\t\t'margin-inline-end': '2em',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tselector: ' > .alignright',\n\t\t\t\trules: {\n\t\t\t\t\tfloat: 'right',\n\t\t\t\t\t'margin-inline-start': '2em',\n\t\t\t\t\t'margin-inline-end': '0',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tselector: ' > .aligncenter',\n\t\t\t\trules: {\n\t\t\t\t\t'margin-left': 'auto !important',\n\t\t\t\t\t'margin-right': 'auto !important',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tspacingStyles: [\n\t\t\t{\n\t\t\t\tselector: ' > :first-child',\n\t\t\t\trules: {\n\t\t\t\t\t'margin-block-start': '0',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tselector: ' > :last-child',\n\t\t\t\trules: {\n\t\t\t\t\t'margin-block-end': '0',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tselector: ' > *',\n\t\t\t\trules: {\n\t\t\t\t\t'margin-block-start': null,\n\t\t\t\t\t'margin-block-end': '0',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\tconstrained: {\n\t\tname: 'constrained',\n\t\tslug: 'constrained',\n\t\tclassName: 'is-layout-constrained',\n\t\tbaseStyles: [\n\t\t\t{\n\t\t\t\tselector: ' > .alignleft',\n\t\t\t\trules: {\n\t\t\t\t\tfloat: 'left',\n\t\t\t\t\t'margin-inline-start': '0',\n\t\t\t\t\t'margin-inline-end': '2em',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tselector: ' > .alignright',\n\t\t\t\trules: {\n\t\t\t\t\tfloat: 'right',\n\t\t\t\t\t'margin-inline-start': '2em',\n\t\t\t\t\t'margin-inline-end': '0',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tselector: ' > .aligncenter',\n\t\t\t\trules: {\n\t\t\t\t\t'margin-left': 'auto !important',\n\t\t\t\t\t'margin-right': 'auto !important',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tselector:\n\t\t\t\t\t' > :where(:not(.alignleft):not(.alignright):not(.alignfull))',\n\t\t\t\trules: {\n\t\t\t\t\t'max-width': 'var(--wp--style--global--content-size)',\n\t\t\t\t\t'margin-left': 'auto !important',\n\t\t\t\t\t'margin-right': 'auto !important',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tselector: ' > .alignwide',\n\t\t\t\trules: {\n\t\t\t\t\t'max-width': 'var(--wp--style--global--wide-size)',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tspacingStyles: [\n\t\t\t{\n\t\t\t\tselector: ' > :first-child',\n\t\t\t\trules: {\n\t\t\t\t\t'margin-block-start': '0',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tselector: ' > :last-child',\n\t\t\t\trules: {\n\t\t\t\t\t'margin-block-end': '0',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tselector: ' > *',\n\t\t\t\trules: {\n\t\t\t\t\t'margin-block-start': null,\n\t\t\t\t\t'margin-block-end': '0',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\tflex: {\n\t\tname: 'flex',\n\t\tslug: 'flex',\n\t\tclassName: 'is-layout-flex',\n\t\tdisplayMode: 'flex',\n\t\tbaseStyles: [\n\t\t\t{\n\t\t\t\tselector: '',\n\t\t\t\trules: {\n\t\t\t\t\t'flex-wrap': 'wrap',\n\t\t\t\t\t'align-items': 'center',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tselector: ' > :is(*, div)', // :is(*, div) instead of just * increases the specificity by 001.\n\t\t\t\trules: {\n\t\t\t\t\tmargin: '0',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tspacingStyles: [\n\t\t\t{\n\t\t\t\tselector: '',\n\t\t\t\trules: {\n\t\t\t\t\tgap: null,\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\tgrid: {\n\t\tname: 'grid',\n\t\tslug: 'grid',\n\t\tclassName: 'is-layout-grid',\n\t\tdisplayMode: 'grid',\n\t\tbaseStyles: [\n\t\t\t{\n\t\t\t\tselector: ' > :is(*, div)', // :is(*, div) instead of just * increases the specificity by 001.\n\t\t\t\trules: {\n\t\t\t\t\tmargin: '0',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tspacingStyles: [\n\t\t\t{\n\t\t\t\tselector: '',\n\t\t\t\trules: {\n\t\t\t\t\tgap: null,\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n};\n", "/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/primitives';\n\nexport default (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t<Path d=\"M14 6H6v8h1.5V8.5L17 18l1-1-9.5-9.5H14V6Z\" />\n\t</SVG>\n);\n", "/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/primitives';\n\nexport default (\n\t<SVG viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n\t<Path d=\"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z\" />\n\t</SVG>\n);\n", "/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/primitives';\n\nexport default (\n\t<SVG viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n\t<Path d=\"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z\" />\n\t</SVG>\n);\n", "/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/primitives';\n\nexport default (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t<Path d=\"M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z\" />\n\t</SVG>\n);\n", "/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/primitives';\n\nexport default (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-2 -2 24 24\">\n\t<Path d=\"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z\" />\n\t</SVG>\n);\n", "/**\n * WordPress dependencies\n */\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { __unstableMotion as motion } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport FullscreenModeClose from './fullscreen-mode-close';\nimport { unlock } from '../../lock-unlock';\n\nconst { BackButton: BackButtonFill } = unlock( editorPrivateApis );\n\nconst slideX = {\n\thidden: { x: '-100%' },\n\tdistractionFreeInactive: { x: 0 },\n\thover: { x: 0, transition: { type: 'tween', delay: 0.2 } },\n};\n\nfunction BackButton( { initialPost } ) {\n\treturn (\n\t\t<BackButtonFill>\n\t\t\t{ ( { length } ) =>\n\t\t\t\tlength <= 1 && (\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tvariants={ slideX }\n\t\t\t\t\t\ttransition={ { type: 'tween', delay: 0.8 } }\n\t\t\t\t\t>\n\t\t\t\t\t\t<FullscreenModeClose\n\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\tinitialPost={ initialPost }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</motion.div>\n\t\t\t\t)\n\t\t\t}\n\t\t</BackButtonFill>\n\t);\n}\n\nexport default BackButton;\n", "/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\nimport { wordpress, arrowUpLeft } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\nconst siteIconVariants = {\n\tedit: {\n\t\tclipPath: 'inset(0% round 0px)',\n\t},\n\thover: {\n\t\tclipPath: 'inset( 22% round 2px )',\n\t},\n\ttap: {\n\t\tclipPath: 'inset(0% round 0px)',\n\t},\n};\n\nconst toggleHomeIconVariants = {\n\tedit: {\n\t\topacity: 0,\n\t\tscale: 0.2,\n\t},\n\thover: {\n\t\topacity: 1,\n\t\tscale: 1,\n\t\tclipPath: 'inset( 22% round 2px )',\n\t},\n};\n\nfunction FullscreenModeClose( { showTooltip, icon, href, initialPost } ) {\n\tconst { isRequestingSiteIcon, postType, siteIconUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\tconst { getEntityRecord, getPostType, isResolving } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteData =\n\t\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\t\t\tconst _postType = initialPost?.type || getCurrentPostType();\n\t\t\treturn {\n\t\t\t\tisRequestingSiteIcon: isResolving( 'getEntityRecord', [\n\t\t\t\t\t'root',\n\t\t\t\t\t'__unstableBase',\n\t\t\t\t\tundefined,\n\t\t\t\t] ),\n\t\t\t\tpostType: getPostType( _postType ),\n\t\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t\t};\n\t\t},\n\t\t[ initialPost?.type ]\n\t);\n\n\tconst disableMotion = useReducedMotion();\n\tconst transition = {\n\t\tduration: disableMotion ? 0 : 0.2,\n\t};\n\n\tif ( ! postType ) {\n\t\treturn null;\n\t}\n\n\t// Create SiteIcon equivalent structure exactly like edit-site\n\tlet siteIconContent;\n\tif ( isRequestingSiteIcon && ! siteIconUrl ) {\n\t\tsiteIconContent = (\n\t\t\t<div className=\"edit-post-fullscreen-mode-close-site-icon__image\" />\n\t\t);\n\t} else if ( siteIconUrl ) {\n\t\tsiteIconContent = (\n\t\t\t<img\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close-site-icon__image\"\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t} else {\n\t\tsiteIconContent = (\n\t\t\t<Icon\n\t\t\t\tclassName=\"edit-post-fullscreen-mode-close-site-icon__icon\"\n\t\t\t\ticon={ wordpress }\n\t\t\t\tsize={ 48 }\n\t\t\t/>\n\t\t);\n\t}\n\n\t// Override default icon if custom icon is provided via props.\n\tconst buttonIcon = icon ? (\n\t\t<Icon size=\"36px\" icon={ icon } />\n\t) : (\n\t\t<div className=\"edit-post-fullscreen-mode-close-site-icon\">\n\t\t\t{ siteIconContent }\n\t\t</div>\n\t);\n\n\tconst classes = clsx( 'edit-post-fullscreen-mode-close', {\n\t\t'has-icon': siteIconUrl,\n\t} );\n\n\tconst buttonHref =\n\t\thref ??\n\t\taddQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType.slug,\n\t\t} );\n\n\tconst buttonLabel = postType?.labels?.view_items ?? __( 'Back' );\n\n\treturn (\n\t\t<motion.div\n\t\t\tclassName=\"edit-post-fullscreen-mode-close__view-mode-toggle\"\n\t\t\tanimate=\"edit\"\n\t\t\tinitial=\"edit\"\n\t\t\twhileHover=\"hover\"\n\t\t\twhileTap=\"tap\"\n\t\t\ttransition={ transition }\n\t\t>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tclassName={ classes }\n\t\t\t\thref={ buttonHref }\n\t\t\t\tlabel={ buttonLabel }\n\t\t\t\tshowTooltip={ showTooltip }\n\t\t\t\ttooltipPosition=\"middle right\"\n\t\t\t>\n\t\t\t\t<motion.div variants={ ! disableMotion && siteIconVariants }>\n\t\t\t\t\t<div className=\"edit-post-fullscreen-mode-close__view-mode-toggle-icon\">\n\t\t\t\t\t\t{ buttonIcon }\n\t\t\t\t\t</div>\n\t\t\t\t</motion.div>\n\t\t\t</Button>\n\t\t\t<motion.div\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'edit-post-fullscreen-mode-close__back-icon',\n\t\t\t\t\t{\n\t\t\t\t\t\t'has-site-icon': siteIconUrl,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\tvariants={ ! disableMotion && toggleHomeIconVariants }\n\t\t\t>\n\t\t\t\t<Icon icon={ arrowUpLeft } />\n\t\t\t</motion.div>\n\t\t</motion.div>\n\t);\n}\n\nexport default FullscreenModeClose;\n", "/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.',\n\t\t'@wordpress/edit-post'\n\t);\n", "/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tVIEW_AS_LINK_SELECTOR,\n\tVIEW_AS_PREVIEW_LINK_SELECTOR,\n} from '../../store/constants';\n\n/**\n * This listener hook monitors any change in permalink and updates the view\n * post link in the admin bar.\n */\nexport const useUpdatePostLinkListener = () => {\n\tconst { isViewable, newPermalink } = useSelect( ( select ) => {\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst { getCurrentPost, getEditedPostAttribute } =\n\t\t\tselect( editorStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\t\treturn {\n\t\t\tisViewable: postType?.viewable,\n\t\t\tnewPermalink: getCurrentPost().link,\n\t\t};\n\t}, [] );\n\n\tconst nodeToUpdateRef = useRef();\n\n\tuseEffect( () => {\n\t\tnodeToUpdateRef.current =\n\t\t\tdocument.querySelector( VIEW_AS_PREVIEW_LINK_SELECTOR ) ||\n\t\t\tdocument.querySelector( VIEW_AS_LINK_SELECTOR );\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( ! newPermalink || ! nodeToUpdateRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! isViewable ) {\n\t\t\tnodeToUpdateRef.current.style.display = 'none';\n\t\t\treturn;\n\t\t}\n\n\t\tnodeToUpdateRef.current.style.display = '';\n\t\tnodeToUpdateRef.current.setAttribute( 'href', newPermalink );\n\t}, [ newPermalink, isViewable ] );\n};\n", "/**\n * The identifier for the data store.\n *\n * @type {string}\n */\nexport const STORE_NAME = 'core/edit-post';\n\n/**\n * CSS selector string for the admin bar view post link anchor tag.\n *\n * @type {string}\n */\nexport const VIEW_AS_LINK_SELECTOR = '#wp-admin-bar-view a';\n\n/**\n * CSS selector string for the admin bar preview post link anchor tag.\n *\n * @type {string}\n */\nexport const VIEW_AS_PREVIEW_LINK_SELECTOR = '#wp-admin-bar-preview a';\n", "/**\n * Internal dependencies\n */\nimport { useUpdatePostLinkListener } from './listener-hooks';\n\n/**\n * Data component used for initializing the editor and re-initializes\n * when postId changes or on unmount.\n *\n * @return {null} This is a data component so does not render any ui.\n */\nexport default function EditorInitialization() {\n\tuseUpdatePostLinkListener();\n\treturn null;\n}\n", "/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction KeyboardShortcuts() {\n\tconst { toggleFullscreenMode } = useDispatch( editPostStore );\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-post/toggle-fullscreen',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Enable or disable fullscreen mode.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'secondary',\n\t\t\t\tcharacter: 'f',\n\t\t\t},\n\t\t} );\n\t}, [] );\n\n\tuseShortcut( 'core/edit-post/toggle-fullscreen', () => {\n\t\ttoggleFullscreenMode();\n\t} );\n\n\treturn null;\n}\n\nexport default KeyboardShortcuts;\n", "/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as actions from './actions';\nimport * as selectors from './selectors';\nimport { STORE_NAME } from './constants';\n\n/**\n * Store definition for the edit post namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\treducer,\n\tactions,\n\tselectors,\n} );\nregister( store );\n", "/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer keeping track of the meta boxes isSaving state.\n * A \"true\" value means the meta boxes saving request is in-flight.\n *\n *\n * @param {boolean} state  Previous state.\n * @param {Object}  action Action Object.\n *\n * @return {Object} Updated state.\n */\nexport function isSavingMetaBoxes( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REQUEST_META_BOX_UPDATES':\n\t\t\treturn true;\n\t\tcase 'META_BOX_UPDATES_SUCCESS':\n\t\tcase 'META_BOX_UPDATES_FAILURE':\n\t\t\treturn false;\n\t\tdefault:\n\t\t\treturn state;\n\t}\n}\n\nfunction mergeMetaboxes( metaboxes = [], newMetaboxes ) {\n\tconst mergedMetaboxes = [ ...metaboxes ];\n\tfor ( const metabox of newMetaboxes ) {\n\t\tconst existing = mergedMetaboxes.findIndex(\n\t\t\t( box ) => box.id === metabox.id\n\t\t);\n\t\tif ( existing !== -1 ) {\n\t\t\tmergedMetaboxes[ existing ] = metabox;\n\t\t} else {\n\t\t\tmergedMetaboxes.push( metabox );\n\t\t}\n\t}\n\treturn mergedMetaboxes;\n}\n\n/**\n * Reducer keeping track of the meta boxes per location.\n *\n * @param {boolean} state  Previous state.\n * @param {Object}  action Action Object.\n *\n * @return {Object} Updated state.\n */\nexport function metaBoxLocations( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_META_BOXES_PER_LOCATIONS': {\n\t\t\tconst newState = { ...state };\n\t\t\tfor ( const [ location, metaboxes ] of Object.entries(\n\t\t\t\taction.metaBoxesPerLocation\n\t\t\t) ) {\n\t\t\t\tnewState[ location ] = mergeMetaboxes(\n\t\t\t\t\tnewState[ location ],\n\t\t\t\t\tmetaboxes\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn newState;\n\t\t}\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer tracking whether meta boxes are initialized.\n *\n * @param {boolean} state\n * @param {Object}  action\n *\n * @return {boolean} Updated state.\n */\nfunction metaBoxesInitialized( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'META_BOXES_INITIALIZED':\n\t\t\treturn true;\n\t}\n\treturn state;\n}\n\nconst metaBoxes = combineReducers( {\n\tisSaving: isSavingMetaBoxes,\n\tlocations: metaBoxLocations,\n\tinitialized: metaBoxesInitialized,\n} );\n\nexport default combineReducers( {\n\tmetaBoxes,\n} );\n", "/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\nimport { addAction } from '@wordpress/hooks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getMetaBoxContainer } from '../utils/meta-boxes';\nimport { unlock } from '../lock-unlock';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\n/**\n * Returns an action object used in signalling that the user opened an editor sidebar.\n *\n * @param {?string} name Sidebar name to be opened.\n */\nexport const openGeneralSidebar =\n\t( name ) =>\n\t( { registry } ) => {\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t.enableComplementaryArea( 'core', name );\n\t};\n\n/**\n * Returns an action object signalling that the user closed the sidebar.\n */\nexport const closeGeneralSidebar =\n\t() =>\n\t( { registry } ) =>\n\t\tregistry.dispatch( interfaceStore ).disableComplementaryArea( 'core' );\n\n/**\n * Returns an action object used in signalling that the user opened a modal.\n *\n * @deprecated since WP 6.3 use `core/interface` store's action with the same name instead.\n *\n *\n * @param {string} name A string that uniquely identifies the modal.\n *\n * @return {Object} Action object.\n */\nexport const openModal =\n\t( name ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"select( 'core/edit-post' ).openModal( name )\", {\n\t\t\tsince: '6.3',\n\t\t\talternative: \"select( 'core/interface').openModal( name )\",\n\t\t} );\n\t\treturn registry.dispatch( interfaceStore ).openModal( name );\n\t};\n\n/**\n * Returns an action object signalling that the user closed a modal.\n *\n * @deprecated since WP 6.3 use `core/interface` store's action with the same name instead.\n *\n * @return {Object} Action object.\n */\nexport const closeModal =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"select( 'core/edit-post' ).closeModal()\", {\n\t\t\tsince: '6.3',\n\t\t\talternative: \"select( 'core/interface').closeModal()\",\n\t\t} );\n\t\treturn registry.dispatch( interfaceStore ).closeModal();\n\t};\n\n/**\n * Returns an action object used in signalling that the user opened the publish\n * sidebar.\n * @deprecated\n *\n * @return {Object} Action object\n */\nexport const openPublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).openPublishSidebar\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').openPublishSidebar\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).openPublishSidebar();\n\t};\n\n/**\n * Returns an action object used in signalling that the user closed the\n * publish sidebar.\n * @deprecated\n *\n * @return {Object} Action object.\n */\nexport const closePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).closePublishSidebar\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').closePublishSidebar\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).closePublishSidebar();\n\t};\n\n/**\n * Returns an action object used in signalling that the user toggles the publish sidebar.\n * @deprecated\n *\n * @return {Object} Action object\n */\nexport const togglePublishSidebar =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).togglePublishSidebar\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').togglePublishSidebar\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).togglePublishSidebar();\n\t};\n\n/**\n * Returns an action object used to enable or disable a panel in the editor.\n *\n * @deprecated\n *\n * @param {string} panelName A string that identifies the panel to enable or disable.\n *\n * @return {Object} Action object.\n */\nexport const toggleEditorPanelEnabled =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).toggleEditorPanelEnabled\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').toggleEditorPanelEnabled\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).toggleEditorPanelEnabled( panelName );\n\t};\n\n/**\n * Opens a closed panel and closes an open panel.\n *\n * @deprecated\n *\n * @param {string} panelName A string that identifies the panel to open or close.\n */\nexport const toggleEditorPanelOpened =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).toggleEditorPanelOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').toggleEditorPanelOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).toggleEditorPanelOpened( panelName );\n\t};\n\n/**\n * Returns an action object used to remove a panel from the editor.\n *\n * @deprecated\n *\n * @param {string} panelName A string that identifies the panel to remove.\n *\n * @return {Object} Action object.\n */\nexport const removeEditorPanel =\n\t( panelName ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).removeEditorPanel\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').removeEditorPanel\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).removeEditorPanel( panelName );\n\t};\n\n/**\n * Triggers an action used to toggle a feature flag.\n *\n * @param {string} feature Feature name.\n */\nexport const toggleFeature =\n\t( feature ) =>\n\t( { registry } ) =>\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-post', feature );\n\n/**\n * Triggers an action used to switch editor mode.\n *\n * @deprecated\n *\n * @param {string} mode The editor mode.\n */\nexport const switchEditorMode =\n\t( mode ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).switchEditorMode\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').switchEditorMode\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).switchEditorMode( mode );\n\t};\n\n/**\n * Triggers an action object used to toggle a plugin name flag.\n *\n * @param {string} pluginName Plugin name.\n */\nexport const togglePinnedPluginItem =\n\t( pluginName ) =>\n\t( { registry } ) => {\n\t\tconst isPinned = registry\n\t\t\t.select( interfaceStore )\n\t\t\t.isItemPinned( 'core', pluginName );\n\n\t\tregistry\n\t\t\t.dispatch( interfaceStore )\n\t\t\t[ isPinned ? 'unpinItem' : 'pinItem' ]( 'core', pluginName );\n\t};\n\n/**\n * Returns an action object used in signaling that a style should be auto-applied when a block is created.\n *\n * @deprecated\n */\nexport function updatePreferredStyleVariations() {\n\tdeprecated( \"dispatch( 'core/edit-post' ).updatePreferredStyleVariations\", {\n\t\tsince: '6.6',\n\t\thint: 'Preferred Style Variations are not supported anymore.',\n\t} );\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Update the provided block types to be visible.\n *\n * @param {string[]} blockNames Names of block types to show.\n */\nexport const showBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tunlock( registry.dispatch( editorStore ) ).showBlockTypes( blockNames );\n\t};\n\n/**\n * Update the provided block types to be hidden.\n *\n * @param {string[]} blockNames Names of block types to hide.\n */\nexport const hideBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tunlock( registry.dispatch( editorStore ) ).hideBlockTypes( blockNames );\n\t};\n\n/**\n * Stores info about which Meta boxes are available in which location.\n *\n * @param {Object} metaBoxesPerLocation Meta boxes per location.\n */\nexport function setAvailableMetaBoxesPerLocation( metaBoxesPerLocation ) {\n\treturn {\n\t\ttype: 'SET_META_BOXES_PER_LOCATIONS',\n\t\tmetaBoxesPerLocation,\n\t};\n}\n\n/**\n * Update a metabox.\n */\nexport const requestMetaBoxUpdates =\n\t() =>\n\tasync ( { registry, select, dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'REQUEST_META_BOX_UPDATES',\n\t\t} );\n\n\t\t// Saves the wp_editor fields.\n\t\tif ( window.tinyMCE ) {\n\t\t\twindow.tinyMCE.triggerSave();\n\t\t}\n\n\t\t// We gather the base form data.\n\t\tconst baseFormData = new window.FormData(\n\t\t\tdocument.querySelector( '.metabox-base-form' )\n\t\t);\n\n\t\tconst postId = baseFormData.get( 'post_ID' );\n\t\tconst postType = baseFormData.get( 'post_type' );\n\n\t\t// Additional data needed for backward compatibility.\n\t\t// If we do not provide this data, the post will be overridden with the default values.\n\t\t// We cannot rely on getCurrentPost because right now on the editor we may be editing a pattern or a template.\n\t\t// We need to retrieve the post that the base form data is referring to.\n\t\tconst post = registry\n\t\t\t.select( coreStore )\n\t\t\t.getEditedEntityRecord( 'postType', postType, postId );\n\t\tconst additionalData = [\n\t\t\tpost.comment_status\n\t\t\t\t? [ 'comment_status', post.comment_status ]\n\t\t\t\t: false,\n\t\t\tpost.ping_status ? [ 'ping_status', post.ping_status ] : false,\n\t\t\tpost.sticky ? [ 'sticky', post.sticky ] : false,\n\t\t\tpost.author ? [ 'post_author', post.author ] : false,\n\t\t].filter( Boolean );\n\n\t\t// We gather all the metaboxes locations.\n\t\tconst activeMetaBoxLocations = select.getActiveMetaBoxLocations();\n\t\tconst formDataToMerge = [\n\t\t\tbaseFormData,\n\t\t\t...activeMetaBoxLocations.map(\n\t\t\t\t( location ) =>\n\t\t\t\t\tnew window.FormData( getMetaBoxContainer( location ) )\n\t\t\t),\n\t\t];\n\n\t\t// Merge all form data objects into a single one.\n\t\tconst formData = formDataToMerge.reduce( ( memo, currentFormData ) => {\n\t\t\tfor ( const [ key, value ] of currentFormData ) {\n\t\t\t\tmemo.append( key, value );\n\t\t\t}\n\t\t\treturn memo;\n\t\t}, new window.FormData() );\n\t\tadditionalData.forEach( ( [ key, value ] ) =>\n\t\t\tformData.append( key, value )\n\t\t);\n\n\t\ttry {\n\t\t\t// Save the metaboxes.\n\t\t\tawait apiFetch( {\n\t\t\t\turl: window._wpMetaBoxUrl,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tbody: formData,\n\t\t\t\tparse: false,\n\t\t\t} );\n\t\t\tdispatch.metaBoxUpdatesSuccess();\n\t\t} catch {\n\t\t\tdispatch.metaBoxUpdatesFailure();\n\t\t}\n\t};\n\n/**\n * Returns an action object used to signal a successful meta box update.\n *\n * @return {Object} Action object.\n */\nexport function metaBoxUpdatesSuccess() {\n\treturn {\n\t\ttype: 'META_BOX_UPDATES_SUCCESS',\n\t};\n}\n\n/**\n * Returns an action object used to signal a failed meta box update.\n *\n * @return {Object} Action object.\n */\nexport function metaBoxUpdatesFailure() {\n\treturn {\n\t\ttype: 'META_BOX_UPDATES_FAILURE',\n\t};\n}\n\n/**\n * Action that changes the width of the editing canvas.\n *\n * @deprecated\n *\n * @param {string} deviceType\n */\nexport const __experimentalSetPreviewDeviceType =\n\t( deviceType ) =>\n\t( { registry } ) => {\n\t\tdeprecated(\n\t\t\t\"dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType\",\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\thint: 'registry.dispatch( editorStore ).setDeviceType',\n\t\t\t}\n\t\t);\n\t\tregistry.dispatch( editorStore ).setDeviceType( deviceType );\n\t};\n\n/**\n * Returns an action object used to open/close the inserter.\n *\n * @deprecated\n *\n * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false).\n */\nexport const setIsInserterOpened =\n\t( value ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).setIsInserterOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsInserterOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsInserterOpened( value );\n\t};\n\n/**\n * Returns an action object used to open/close the list view.\n *\n * @deprecated\n *\n * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed.\n */\nexport const setIsListViewOpened =\n\t( isOpen ) =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).setIsListViewOpened\", {\n\t\t\tsince: '6.5',\n\t\t\talternative: \"dispatch( 'core/editor').setIsListViewOpened\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).setIsListViewOpened( isOpen );\n\t};\n\n/**\n * Returns an action object used to switch to template editing.\n *\n * @deprecated\n */\nexport function setIsEditingTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-post' ).setIsEditingTemplate\", {\n\t\tsince: '6.5',\n\t\talternative: \"dispatch( 'core/editor').setRenderingMode\",\n\t} );\n\treturn { type: 'NOTHING' };\n}\n\n/**\n * Create a block based template.\n *\n * @deprecated\n */\nexport function __unstableCreateTemplate() {\n\tdeprecated( \"dispatch( 'core/edit-post' ).__unstableCreateTemplate\", {\n\t\tsince: '6.5',\n\t} );\n\treturn { type: 'NOTHING' };\n}\n\nlet metaBoxesInitialized = false;\n\n/**\n * Initializes WordPress `postboxes` script and the logic for saving meta boxes.\n */\nexport const initializeMetaBoxes =\n\t() =>\n\t( { registry, select, dispatch } ) => {\n\t\tconst isEditorReady = registry\n\t\t\t.select( editorStore )\n\t\t\t.__unstableIsEditorReady();\n\n\t\tif ( ! isEditorReady ) {\n\t\t\treturn;\n\t\t}\n\t\t// Only initialize once.\n\t\tif ( metaBoxesInitialized ) {\n\t\t\treturn;\n\t\t}\n\t\tconst postType = registry.select( editorStore ).getCurrentPostType();\n\t\tif ( window.postboxes.page !== postType ) {\n\t\t\twindow.postboxes.add_postbox_toggles( postType );\n\t\t}\n\n\t\tmetaBoxesInitialized = true;\n\n\t\t// Save metaboxes on save completion, except for autosaves.\n\t\taddAction(\n\t\t\t'editor.savePost',\n\t\t\t'core/edit-post/save-metaboxes',\n\t\t\tasync ( post, options ) => {\n\t\t\t\tif ( ! options.isAutosave && select.hasMetaBoxes() ) {\n\t\t\t\t\tawait dispatch.requestMetaBoxUpdates();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tdispatch( {\n\t\t\ttype: 'META_BOXES_INITIALIZED',\n\t\t} );\n\t};\n\n/**\n * Action that toggles Distraction free mode.\n * Distraction free mode expects there are no sidebars, as due to the\n * z-index values set, you can't close sidebars.\n *\n * @deprecated\n */\nexport const toggleDistractionFree =\n\t() =>\n\t( { registry } ) => {\n\t\tdeprecated( \"dispatch( 'core/edit-post' ).toggleDistractionFree\", {\n\t\t\tsince: '6.6',\n\t\t\talternative: \"dispatch( 'core/editor').toggleDistractionFree\",\n\t\t} );\n\t\tregistry.dispatch( editorStore ).toggleDistractionFree();\n\t};\n\n/**\n * Action that toggles the Fullscreen Mode view option.\n */\nexport const toggleFullscreenMode =\n\t() =>\n\t( { registry } ) => {\n\t\tconst isFullscreen = registry\n\t\t\t.select( preferencesStore )\n\t\t\t.get( 'core/edit-post', 'fullscreenMode' );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.toggle( 'core/edit-post', 'fullscreenMode' );\n\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createInfoNotice(\n\t\t\t\tisFullscreen\n\t\t\t\t\t? __( 'Fullscreen mode deactivated.' )\n\t\t\t\t\t: __( 'Fullscreen mode activated.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-post/toggle-fullscreen-mode/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t\t\t.dispatch( preferencesStore )\n\t\t\t\t\t\t\t\t\t.toggle(\n\t\t\t\t\t\t\t\t\t\t'core/edit-post',\n\t\t\t\t\t\t\t\t\t\t'fullscreenMode'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t};\n", "/**\n * Function returning the current Meta Boxes DOM Node in the editor\n * whether the meta box area is opened or not.\n * If the MetaBox Area is visible returns it, and returns the original container instead.\n *\n * @param {string} location Meta Box location.\n *\n * @return {string} HTML content.\n */\nexport const getMetaBoxContainer = ( location ) => {\n\tconst area = document.querySelector(\n\t\t`.edit-post-meta-boxes-area.is-${ location } .metabox-location-${ location }`\n\t);\n\tif ( area ) {\n\t\treturn area;\n\t}\n\n\treturn document.querySelector( '#metaboxes .metabox-location-' + location );\n};\n", "/**\n * WordPress dependencies\n */\nimport { createSelector, createRegistrySelector } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nconst { interfaceStore } = unlock( editorPrivateApis );\nconst EMPTY_ARRAY = [];\nconst EMPTY_OBJECT = {};\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport const getEditorMode = createRegistrySelector(\n\t( select ) => () =>\n\t\tselect( preferencesStore ).get( 'core', 'editorMode' ) ?? 'visual'\n);\n\n/**\n * Returns true if the editor sidebar is opened.\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the editor sidebar is opened.\n */\nexport const isEditorSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\treturn [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\tactiveGeneralSidebar\n\t\t);\n\t}\n);\n\n/**\n * Returns true if the plugin sidebar is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the plugin sidebar is opened.\n */\nexport const isPluginSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst activeGeneralSidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\treturn (\n\t\t\t!! activeGeneralSidebar &&\n\t\t\t! [ 'edit-post/document', 'edit-post/block' ].includes(\n\t\t\t\tactiveGeneralSidebar\n\t\t\t)\n\t\t);\n\t}\n);\n\n/**\n * Returns the current active general sidebar name, or null if there is no\n * general sidebar active. The active general sidebar is a unique name to\n * identify either an editor or plugin sidebar.\n *\n * Examples:\n *\n *  - `edit-post/document`\n *  - `my-plugin/insert-image-sidebar`\n *\n * @param {Object} state Global application state.\n *\n * @return {?string} Active general sidebar name.\n */\nexport const getActiveGeneralSidebarName = createRegistrySelector(\n\t( select ) => () => {\n\t\treturn select( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t}\n);\n\n/**\n * Converts panels from the new preferences store format to the old format\n * that the post editor previously used.\n *\n * The resultant converted data should look like this:\n * {\n *     panelName: {\n *         enabled: false,\n *         opened: true,\n *     },\n *     anotherPanelName: {\n *         opened: true\n *     },\n * }\n *\n * @param {string[] | undefined} inactivePanels An array of inactive panel names.\n * @param {string[] | undefined} openPanels     An array of open panel names.\n *\n * @return {Object} The converted panel data.\n */\nfunction convertPanelsToOldFormat( inactivePanels, openPanels ) {\n\t// First reduce the inactive panels.\n\tconst panelsWithEnabledState = inactivePanels?.reduce(\n\t\t( accumulatedPanels, panelName ) => ( {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\tenabled: false,\n\t\t\t},\n\t\t} ),\n\t\t{}\n\t);\n\n\t// Then reduce the open panels, passing in the result of the previous\n\t// reduction as the initial value so that both open and inactive\n\t// panel state is combined.\n\tconst panels = openPanels?.reduce( ( accumulatedPanels, panelName ) => {\n\t\tconst currentPanelState = accumulatedPanels?.[ panelName ];\n\t\treturn {\n\t\t\t...accumulatedPanels,\n\t\t\t[ panelName ]: {\n\t\t\t\t...currentPanelState,\n\t\t\t\topened: true,\n\t\t\t},\n\t\t};\n\t}, panelsWithEnabledState ?? {} );\n\n\t// The panels variable will only be set if openPanels wasn't `undefined`.\n\t// If it isn't set just return `panelsWithEnabledState`, and if that isn't\n\t// set return an empty object.\n\treturn panels ?? panelsWithEnabledState ?? EMPTY_OBJECT;\n}\n\n/**\n * Returns the preferences (these preferences are persisted locally).\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Preferences Object.\n */\nexport const getPreferences = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).getPreferences`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\tconst corePreferences = [ 'editorMode', 'hiddenBlockTypes' ].reduce(\n\t\t( accumulatedPrefs, preferenceKey ) => {\n\t\t\tconst value = select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\tpreferenceKey\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\t...accumulatedPrefs,\n\t\t\t\t[ preferenceKey ]: value,\n\t\t\t};\n\t\t},\n\t\t{}\n\t);\n\n\t// Panels were a preference, but the data structure changed when the state\n\t// was migrated to the preferences store. They need to be converted from\n\t// the new preferences store format to old format to ensure no breaking\n\t// changes for plugins.\n\tconst inactivePanels = select( preferencesStore ).get(\n\t\t'core',\n\t\t'inactivePanels'\n\t);\n\tconst openPanels = select( preferencesStore ).get( 'core', 'openPanels' );\n\tconst panels = convertPanelsToOldFormat( inactivePanels, openPanels );\n\n\treturn {\n\t\t...corePreferences,\n\t\tpanels,\n\t};\n} );\n\n/**\n *\n * @param {Object} state         Global application state.\n * @param {string} preferenceKey Preference Key.\n * @param {*}      defaultValue  Default Value.\n *\n * @return {*} Preference Value.\n */\nexport function getPreference( state, preferenceKey, defaultValue ) {\n\tdeprecated( `select( 'core/edit-post' ).getPreference`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\t// Avoid using the `getPreferences` registry selector where possible.\n\tconst preferences = getPreferences( state );\n\tconst value = preferences[ preferenceKey ];\n\treturn value === undefined ? defaultValue : value;\n}\n\n/**\n * Returns an array of blocks that are hidden.\n *\n * @return {Array} A list of the hidden block types\n */\nexport const getHiddenBlockTypes = createRegistrySelector( ( select ) => () => {\n\treturn (\n\t\tselect( preferencesStore ).get( 'core', 'hiddenBlockTypes' ) ??\n\t\tEMPTY_ARRAY\n\t);\n} );\n\n/**\n * Returns true if the publish sidebar is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether the publish sidebar is open.\n */\nexport const isPublishSidebarOpened = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated( `select( 'core/edit-post' ).isPublishSidebarOpened`, {\n\t\t\tsince: '6.6',\n\t\t\talternative: `select( 'core/editor' ).isPublishSidebarOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isPublishSidebarOpened();\n\t}\n);\n\n/**\n * Returns true if the given panel was programmatically removed, or false otherwise.\n * All panels are not removed by default.\n *\n * @deprecated\n *\n * @param {Object} state     Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is removed.\n */\nexport const isEditorPanelRemoved = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelRemoved`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelRemoved`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelRemoved( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is enabled, or false otherwise. Panels are\n * enabled by default.\n *\n * @deprecated\n *\n * @param {Object} state     Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is enabled.\n */\nexport const isEditorPanelEnabled = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelEnabled`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelEnabled`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelEnabled( panelName );\n\t}\n);\n\n/**\n * Returns true if the given panel is open, or false otherwise. Panels are\n * closed by default.\n *\n * @deprecated\n *\n * @param {Object} state     Global application state.\n * @param {string} panelName A string that identifies the panel.\n *\n * @return {boolean} Whether or not the panel is open.\n */\nexport const isEditorPanelOpened = createRegistrySelector(\n\t( select ) => ( state, panelName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isEditorPanelOpened`, {\n\t\t\tsince: '6.5',\n\t\t\talternative: `select( 'core/editor' ).isEditorPanelOpened`,\n\t\t} );\n\t\treturn select( editorStore ).isEditorPanelOpened( panelName );\n\t}\n);\n\n/**\n * Returns true if a modal is active, or false otherwise.\n *\n * @deprecated since WP 6.3 use `core/interface` store's selector with the same name instead.\n *\n * @param {Object} state     Global application state.\n * @param {string} modalName A string that uniquely identifies the modal.\n *\n * @return {boolean} Whether the modal is active.\n */\nexport const isModalActive = createRegistrySelector(\n\t( select ) => ( state, modalName ) => {\n\t\tdeprecated( `select( 'core/edit-post' ).isModalActive`, {\n\t\t\tsince: '6.3',\n\t\t\talternative: `select( 'core/interface' ).isModalActive`,\n\t\t} );\n\t\treturn !! select( interfaceStore ).isModalActive( modalName );\n\t}\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @param {Object} state   Global application state.\n * @param {string} feature Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( state, feature ) => {\n\t\treturn !! select( preferencesStore ).get( 'core/edit-post', feature );\n\t}\n);\n\n/**\n * Returns true if the plugin item is pinned to the header.\n * When the value is not set it defaults to true.\n *\n * @param {Object} state      Global application state.\n * @param {string} pluginName Plugin item name.\n *\n * @return {boolean} Whether the plugin item is pinned.\n */\nexport const isPluginItemPinned = createRegistrySelector(\n\t( select ) => ( state, pluginName ) => {\n\t\treturn select( interfaceStore ).isItemPinned( 'core', pluginName );\n\t}\n);\n\n/**\n * Returns an array of active meta box locations.\n *\n * @param {Object} state Post editor state.\n *\n * @return {string[]} Active meta box locations.\n */\nexport const getActiveMetaBoxLocations = createSelector(\n\t( state ) => {\n\t\treturn Object.keys( state.metaBoxes.locations ).filter( ( location ) =>\n\t\t\tisMetaBoxLocationActive( state, location )\n\t\t);\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if a metabox location is active and visible\n *\n * @param {Object} state    Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active and visible.\n */\nexport const isMetaBoxLocationVisible = createRegistrySelector(\n\t( select ) => ( state, location ) => {\n\t\treturn (\n\t\t\tisMetaBoxLocationActive( state, location ) &&\n\t\t\tgetMetaBoxesPerLocation( state, location )?.some( ( { id } ) => {\n\t\t\t\treturn select( editorStore ).isEditorPanelEnabled(\n\t\t\t\t\t`meta-box-${ id }`\n\t\t\t\t);\n\t\t\t} )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if there is an active meta box in the given location, or false\n * otherwise.\n *\n * @param {Object} state    Post editor state.\n * @param {string} location Meta box location to test.\n *\n * @return {boolean} Whether the meta box location is active.\n */\nexport function isMetaBoxLocationActive( state, location ) {\n\tconst metaBoxes = getMetaBoxesPerLocation( state, location );\n\treturn !! metaBoxes && metaBoxes.length !== 0;\n}\n\n/**\n * Returns the list of all the available meta boxes for a given location.\n *\n * @param {Object} state    Global application state.\n * @param {string} location Meta box location to test.\n *\n * @return {?Array} List of meta boxes.\n */\nexport function getMetaBoxesPerLocation( state, location ) {\n\treturn state.metaBoxes.locations[ location ];\n}\n\n/**\n * Returns the list of all the available meta boxes.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} List of meta boxes.\n */\nexport const getAllMetaBoxes = createSelector(\n\t( state ) => {\n\t\treturn Object.values( state.metaBoxes.locations ).flat();\n\t},\n\t( state ) => [ state.metaBoxes.locations ]\n);\n\n/**\n * Returns true if the post is using Meta Boxes\n *\n * @param {Object} state Global application state\n *\n * @return {boolean} Whether there are metaboxes or not.\n */\nexport function hasMetaBoxes( state ) {\n\treturn getActiveMetaBoxLocations( state ).length > 0;\n}\n\n/**\n * Returns true if the Meta Boxes are being saved.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the metaboxes are being saved.\n */\nexport function isSavingMetaBoxes( state ) {\n\treturn state.metaBoxes.isSaving;\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport const __experimentalGetPreviewDeviceType = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t\talternative: `select( 'core/editor' ).getDeviceType`,\n\t\t\t}\n\t\t);\n\t\treturn select( editorStore ).getDeviceType();\n\t}\n);\n\n/**\n * Returns true if the inserter is opened.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the inserter is opened.\n */\nexport const isInserterOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isInserterOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isInserterOpened`,\n\t} );\n\treturn select( editorStore ).isInserterOpened();\n} );\n\n/**\n * Get the insertion point for the inserter.\n *\n * @deprecated\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => () => {\n\t\tdeprecated(\n\t\t\t`select( 'core/edit-post' ).__experimentalGetInsertionPoint`,\n\t\t\t{\n\t\t\t\tsince: '6.5',\n\t\t\t\tversion: '6.7',\n\t\t\t}\n\t\t);\n\t\treturn unlock( select( editorStore ) ).getInserter();\n\t}\n);\n\n/**\n * Returns true if the list view is opened.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether the list view is opened.\n */\nexport const isListViewOpened = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isListViewOpened`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).isListViewOpened`,\n\t} );\n\treturn select( editorStore ).isListViewOpened();\n} );\n\n/**\n * Returns true if the template editing mode is enabled.\n *\n * @deprecated\n */\nexport const isEditingTemplate = createRegistrySelector( ( select ) => () => {\n\tdeprecated( `select( 'core/edit-post' ).isEditingTemplate`, {\n\t\tsince: '6.5',\n\t\talternative: `select( 'core/editor' ).getRenderingMode`,\n\t} );\n\treturn select( editorStore ).getCurrentPostType() === 'wp_template';\n} );\n\n/**\n * Returns true if meta boxes are initialized.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether meta boxes are initialized.\n */\nexport function areMetaBoxesInitialized( state ) {\n\treturn state.metaBoxes.initialized;\n}\n\n/**\n * Retrieves the template of the currently edited post.\n *\n * @return {?Object} Post Template.\n */\nexport const getEditedPostTemplate = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst { id: postId, type: postType } =\n\t\t\tselect( editorStore ).getCurrentPost();\n\t\tconst templateId = unlock( select( coreStore ) ).getTemplateId(\n\t\t\tpostType,\n\t\t\tpostId\n\t\t);\n\t\tif ( ! templateId ) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn select( coreStore ).getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_template',\n\t\t\ttemplateId\n\t\t);\n\t}\n);\n", "/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tModal,\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tToggleControl,\n\tTextControl,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function InitPatternModal() {\n\tconst { editPost } = useDispatch( editorStore );\n\tconst [ syncType, setSyncType ] = useState( undefined );\n\tconst [ title, setTitle ] = useState( '' );\n\n\tconst isNewPost = useSelect(\n\t\t( select ) => select( editorStore ).isCleanNewPost(),\n\t\t[]\n\t);\n\n\tconst [ isModalOpen, setIsModalOpen ] = useState( () => isNewPost );\n\n\tif ( ! isNewPost ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Create pattern' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t} }\n\t\t\t\t\toverlayClassName=\"reusable-blocks-menu-items__convert-modal\"\n\t\t\t\t>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={ ( event ) => {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tsetIsModalOpen( false );\n\t\t\t\t\t\t\teditPost( {\n\t\t\t\t\t\t\t\ttitle,\n\t\t\t\t\t\t\t\tmeta: {\n\t\t\t\t\t\t\t\t\twp_pattern_sync_status: syncType,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t<VStack spacing=\"5\">\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\t\t\t\tvalue={ title }\n\t\t\t\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\t\t\t\tplaceholder={ __( 'My pattern' ) }\n\t\t\t\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ _x( 'Synced', 'pattern (singular)' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Sync this pattern across multiple locations.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tchecked={ ! syncType }\n\t\t\t\t\t\t\t\tonChange={ () => {\n\t\t\t\t\t\t\t\t\tsetSyncType(\n\t\t\t\t\t\t\t\t\t\t! syncType ? 'unsynced' : undefined\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\t\t\tdisabled={ ! title }\n\t\t\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t</form>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n", "/**\n * WordPress dependencies\n */\nimport { useEffect, useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { addQueryArgs } from '@wordpress/url';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Returns the Post's Edit URL.\n *\n * @param {number} postId Post ID.\n *\n * @return {string} Post edit URL.\n */\nexport function getPostEditURL( postId ) {\n\treturn addQueryArgs( 'post.php', { post: postId, action: 'edit' } );\n}\n\nexport default function BrowserURL() {\n\tconst [ historyId, setHistoryId ] = useState( null );\n\tconst { postId, postStatus } = useSelect( ( select ) => {\n\t\tconst { getCurrentPost } = select( editorStore );\n\t\tconst post = getCurrentPost();\n\t\tlet { id, status, type } = post;\n\t\tconst isTemplate = [ 'wp_template', 'wp_template_part' ].includes(\n\t\t\ttype\n\t\t);\n\t\tif ( isTemplate ) {\n\t\t\tid = post.wp_id;\n\t\t}\n\n\t\treturn {\n\t\t\tpostId: id,\n\t\t\tpostStatus: status,\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\tif ( postId && postId !== historyId && postStatus !== 'auto-draft' ) {\n\t\t\twindow.history.replaceState(\n\t\t\t\t{ id: postId },\n\t\t\t\t'Post ' + postId,\n\t\t\t\tgetPostEditURL( postId )\n\t\t\t);\n\t\t\tsetHistoryId( postId );\n\t\t}\n\t}, [ postId, postStatus, historyId ] );\n\n\treturn null;\n}\n", "/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport MetaBoxesArea from './meta-boxes-area';\nimport MetaBoxVisibility from './meta-box-visibility';\nimport { store as editPostStore } from '../../store';\n\nexport default function MetaBoxes( { location } ) {\n\tconst metaBoxes = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editPostStore ).getMetaBoxesPerLocation( location ),\n\t\t[ location ]\n\t);\n\treturn (\n\t\t<>\n\t\t\t{ ( metaBoxes ?? [] ).map( ( { id } ) => (\n\t\t\t\t<MetaBoxVisibility key={ id } id={ id } />\n\t\t\t) ) }\n\t\t\t<MetaBoxesArea location={ location } />\n\t\t</>\n\t);\n}\n", "/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { Spinner } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\n/**\n * Render metabox area.\n *\n * @param {Object} props          Component props.\n * @param {string} props.location metabox location.\n * @return {Component} The component to be rendered.\n */\nfunction MetaBoxesArea( { location } ) {\n\tconst container = useRef( null );\n\tconst formRef = useRef( null );\n\n\tuseEffect( () => {\n\t\tformRef.current = document.querySelector(\n\t\t\t'.metabox-location-' + location\n\t\t);\n\n\t\tif ( formRef.current ) {\n\t\t\tcontainer.current.appendChild( formRef.current );\n\t\t}\n\n\t\treturn () => {\n\t\t\tif ( formRef.current ) {\n\t\t\t\tdocument\n\t\t\t\t\t.querySelector( '#metaboxes' )\n\t\t\t\t\t.appendChild( formRef.current );\n\t\t\t}\n\t\t};\n\t}, [ location ] );\n\n\tconst isSaving = useSelect( ( select ) => {\n\t\treturn select( editPostStore ).isSavingMetaBoxes();\n\t}, [] );\n\n\tconst classes = clsx( 'edit-post-meta-boxes-area', `is-${ location }`, {\n\t\t'is-loading': isSaving,\n\t} );\n\n\treturn (\n\t\t<div className={ classes }>\n\t\t\t{ isSaving && <Spinner /> }\n\t\t\t<div\n\t\t\t\tclassName=\"edit-post-meta-boxes-area__container\"\n\t\t\t\tref={ container }\n\t\t\t/>\n\t\t\t<div className=\"edit-post-meta-boxes-area__clear\" />\n\t\t</div>\n\t);\n}\n\nexport default MetaBoxesArea;\n", "/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function MetaBoxVisibility( { id } ) {\n\tconst isVisible = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( editorStore ).isEditorPanelEnabled(\n\t\t\t\t`meta-box-${ id }`\n\t\t\t);\n\t\t},\n\t\t[ id ]\n\t);\n\n\tuseEffect( () => {\n\t\tconst element = document.getElementById( id );\n\t\tif ( ! element ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isVisible ) {\n\t\t\telement.classList.remove( 'is-hidden' );\n\t\t} else {\n\t\t\telement.classList.add( 'is-hidden' );\n\t\t}\n\t}, [ id, isVisible ] );\n\n\treturn null;\n}\n", "/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport ManagePatternsMenuItem from './manage-patterns-menu-item';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\nimport EditPostPreferencesModal from '../preferences-modal';\n\nconst { ToolsMoreMenuGroup, ViewMoreMenuGroup } = unlock( editorPrivateApis );\n\nconst MoreMenu = () => {\n\tconst isLargeViewport = useViewportMatch( 'large' );\n\n\treturn (\n\t\t<>\n\t\t\t{ isLargeViewport && (\n\t\t\t\t<ViewMoreMenuGroup>\n\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\t\t\tname=\"fullscreenMode\"\n\t\t\t\t\t\tlabel={ __( 'Fullscreen mode' ) }\n\t\t\t\t\t\tinfo={ __( 'Show and hide the admin user interface' ) }\n\t\t\t\t\t\tmessageActivated={ __( 'Fullscreen mode activated.' ) }\n\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t'Fullscreen mode deactivated.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tshortcut={ displayShortcut.secondary( 'f' ) }\n\t\t\t\t\t/>\n\t\t\t\t</ViewMoreMenuGroup>\n\t\t\t) }\n\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t<ManagePatternsMenuItem />\n\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t</ToolsMoreMenuGroup>\n\t\t\t<EditPostPreferencesModal />\n\t\t</>\n\t);\n};\n\nexport default MoreMenu;\n", "/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\n\nfunction ManagePatternsMenuItem() {\n\tconst url = useSelect( ( select ) => {\n\t\tconst { canUser } = select( coreStore );\n\t\tconst defaultUrl = addQueryArgs( 'edit.php', {\n\t\t\tpost_type: 'wp_block',\n\t\t} );\n\t\tconst patternsUrl = addQueryArgs( 'site-editor.php', {\n\t\t\tp: '/pattern',\n\t\t} );\n\n\t\t// The site editor and templates both check whether the user has\n\t\t// edit_theme_options capabilities. We can leverage that here and not\n\t\t// display the manage patterns link if the user can't access it.\n\t\treturn canUser( 'create', {\n\t\t\tkind: 'postType',\n\t\t\tname: 'wp_template',\n\t\t} )\n\t\t\t? patternsUrl\n\t\t\t: defaultUrl;\n\t}, [] );\n\n\treturn (\n\t\t<MenuItem role=\"menuitem\" href={ url }>\n\t\t\t{ __( 'Manage patterns' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default ManagePatternsMenuItem;\n", "/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { PreferenceToggleMenuItem } from '@wordpress/preferences';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default function WelcomeGuideMenuItem() {\n\tconst isEditingTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t[]\n\t);\n\n\treturn (\n\t\t<PreferenceToggleMenuItem\n\t\t\tscope=\"core/edit-post\"\n\t\t\tname={ isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide' }\n\t\t\tlabel={ __( 'Welcome Guide' ) }\n\t\t/>\n\t);\n}\n", "/**\n * WordPress dependencies\n */\n\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport MetaBoxesSection from './meta-boxes-section';\n\nconst { PreferenceToggleControl } = unlock( preferencesPrivateApis );\nconst { PreferencesModal } = unlock( editorPrivateApis );\n\nexport default function EditPostPreferencesModal() {\n\tconst extraSections = {\n\t\tgeneral: <MetaBoxesSection title={ __( 'Advanced' ) } />,\n\t\tappearance: (\n\t\t\t<PreferenceToggleControl\n\t\t\t\tscope=\"core/edit-post\"\n\t\t\t\tfeatureName=\"themeStyles\"\n\t\t\t\thelp={ __( 'Make the editor look like your theme.' ) }\n\t\t\t\tlabel={ __( 'Use theme styles' ) }\n\t\t\t/>\n\t\t),\n\t};\n\n\treturn <PreferencesModal extraSections={ extraSections } />;\n}\n", "/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { withSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport EnableCustomFieldsOption from './enable-custom-fields';\nimport EnablePanelOption from './enable-panel';\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferencesModalSection } = unlock( preferencesPrivateApis );\n\nexport function MetaBoxesSection( {\n\tareCustomFieldsRegistered,\n\tmetaBoxes,\n\t...sectionProps\n} ) {\n\t// The 'Custom Fields' meta box is a special case that we handle separately.\n\tconst thirdPartyMetaBoxes = metaBoxes.filter(\n\t\t( { id } ) => id !== 'postcustom'\n\t);\n\n\tif ( ! areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferencesModalSection { ...sectionProps }>\n\t\t\t{ areCustomFieldsRegistered && (\n\t\t\t\t<EnableCustomFieldsOption label={ __( 'Custom fields' ) } />\n\t\t\t) }\n\t\t\t{ thirdPartyMetaBoxes.map( ( { id, title } ) => (\n\t\t\t\t<EnablePanelOption\n\t\t\t\t\tkey={ id }\n\t\t\t\t\tlabel={ title }\n\t\t\t\t\tpanelName={ `meta-box-${ id }` }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</PreferencesModalSection>\n\t);\n}\n\nexport default withSelect( ( select ) => {\n\tconst { getEditorSettings } = select( editorStore );\n\tconst { getAllMetaBoxes } = select( editPostStore );\n\n\treturn {\n\t\t// This setting should not live in the block editor's store.\n\t\tareCustomFieldsRegistered:\n\t\t\tgetEditorSettings().enableCustomFields !== undefined,\n\t\tmetaBoxes: getAllMetaBoxes(),\n\t};\n} )( MetaBoxesSection );\n", "/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\nimport { getPathAndQueryString } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nfunction submitCustomFieldsForm() {\n\tconst customFieldsForm = document.getElementById(\n\t\t'toggle-custom-fields-form'\n\t);\n\n\t// Ensure the referrer values is up to update with any\n\tcustomFieldsForm\n\t\t.querySelector( '[name=\"_wp_http_referer\"]' )\n\t\t.setAttribute( 'value', getPathAndQueryString( window.location.href ) );\n\n\tcustomFieldsForm.submit();\n}\n\nexport function CustomFieldsConfirmation( { willEnable } ) {\n\tconst [ isReloading, setIsReloading ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<p className=\"edit-post-preferences-modal__custom-fields-confirmation-message\">\n\t\t\t\t{ __(\n\t\t\t\t\t'A page reload is required for this change. Make sure your content is saved before reloading.'\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<Button\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tisBusy={ isReloading }\n\t\t\t\taccessibleWhenDisabled\n\t\t\t\tdisabled={ isReloading }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsReloading( true );\n\t\t\t\t\tsubmitCustomFieldsForm();\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ willEnable\n\t\t\t\t\t? __( 'Show & Reload Page' )\n\t\t\t\t\t: __( 'Hide & Reload Page' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport default function EnableCustomFieldsOption( { label } ) {\n\tconst areCustomFieldsEnabled = useSelect( ( select ) => {\n\t\treturn !! select( editorStore ).getEditorSettings().enableCustomFields;\n\t}, [] );\n\tconst [ isChecked, setIsChecked ] = useState( areCustomFieldsEnabled );\n\n\treturn (\n\t\t<PreferenceBaseOption\n\t\t\tlabel={ label }\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ setIsChecked }\n\t\t>\n\t\t\t{ isChecked !== areCustomFieldsEnabled && (\n\t\t\t\t<CustomFieldsConfirmation willEnable={ isChecked } />\n\t\t\t) }\n\t\t</PreferenceBaseOption>\n\t);\n}\n", "/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { privateApis as preferencesPrivateApis } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { PreferenceBaseOption } = unlock( preferencesPrivateApis );\n\nexport default function EnablePanelOption( props ) {\n\tconst { toggleEditorPanelEnabled } = useDispatch( editorStore );\n\tconst { isChecked, isRemoved } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isEditorPanelEnabled, isEditorPanelRemoved } =\n\t\t\t\tselect( editorStore );\n\t\t\treturn {\n\t\t\t\tisChecked: isEditorPanelEnabled( props.panelName ),\n\t\t\t\tisRemoved: isEditorPanelRemoved( props.panelName ),\n\t\t\t};\n\t\t},\n\t\t[ props.panelName ]\n\t);\n\n\tif ( isRemoved ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PreferenceBaseOption\n\t\t\tisChecked={ isChecked }\n\t\t\tonChange={ () => toggleEditorPanelEnabled( props.panelName ) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n", "/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideDefault from './default';\nimport WelcomeGuideTemplate from './template';\nimport { store as editPostStore } from '../../store';\n\nexport default function WelcomeGuide( { postType } ) {\n\tconst { isActive, isEditingTemplate } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isFeatureActive } = select( editPostStore );\n\t\t\tconst _isEditingTemplate = postType === 'wp_template';\n\t\t\tconst feature = _isEditingTemplate\n\t\t\t\t? 'welcomeGuideTemplate'\n\t\t\t\t: 'welcomeGuide';\n\n\t\t\treturn {\n\t\t\t\tisActive: isFeatureActive( feature ),\n\t\t\t\tisEditingTemplate: _isEditingTemplate,\n\t\t\t};\n\t\t},\n\t\t[ postType ]\n\t);\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\treturn isEditingTemplate ? (\n\t\t<WelcomeGuideTemplate />\n\t) : (\n\t\t<WelcomeGuideDefault />\n\t);\n}\n", "/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { ExternalLink, Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\nimport { store as editPostStore } from '../../store';\n\nexport default function WelcomeGuideDefault() {\n\tconst { toggleFeature } = useDispatch( editPostStore );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-post-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to the editor' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggleFeature( 'welcomeGuide' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Welcome to the editor' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'In the WordPress editor, each paragraph, image, or video is presented as a distinct \u201Cblock\u201D of content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Customize each block' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'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.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Explore all blocks' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'All of the blocks available to you live in the block library. You\u2019ll find it wherever you see the <InserterIconImage /> icon.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tInserterIconImage: (\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\talt={ __( 'inserter' ) }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"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\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Learn more' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\"New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>\"\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n", "export default function WelcomeGuideImage( { nonAnimatedSrc, animatedSrc } ) {\n\treturn (\n\t\t<picture className=\"edit-post-welcome-guide__image\">\n\t\t\t<source\n\t\t\t\tsrcSet={ nonAnimatedSrc }\n\t\t\t\tmedia=\"(prefers-reduced-motion: reduce)\"\n\t\t\t/>\n\t\t\t<img src={ animatedSrc } width=\"312\" height=\"240\" alt=\"\" />\n\t\t</picture>\n\t);\n}\n", "/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\nimport { store as editPostStore } from '../../store';\n\nexport default function WelcomeGuideTemplate() {\n\tconst { toggleFeature } = useDispatch( editPostStore );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-template-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to the template editor' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggleFeature( 'welcomeGuideTemplate' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-template-editor.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-template-editor.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Welcome to the template editor' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n", "/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { fullscreen } from '@wordpress/icons';\nimport { useCommand } from '@wordpress/commands';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function useCommands() {\n\tconst { isFullscreen } = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\n\t\treturn {\n\t\t\tisFullscreen: get( 'core/edit-post', 'fullscreenMode' ),\n\t\t};\n\t}, [] );\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\n\tuseCommand( {\n\t\tname: 'core/toggle-fullscreen-mode',\n\t\tlabel: isFullscreen\n\t\t\t? __( 'Exit fullscreen' )\n\t\t\t: __( 'Enter fullscreen' ),\n\t\ticon: fullscreen,\n\t\tcallback: ( { close } ) => {\n\t\t\ttoggle( 'core/edit-post', 'fullscreenMode' );\n\t\t\tclose();\n\t\t\tcreateInfoNotice(\n\t\t\t\tisFullscreen ? __( 'Fullscreen off.' ) : __( 'Fullscreen on.' ),\n\t\t\t\t{\n\t\t\t\t\tid: 'core/edit-post/toggle-fullscreen-mode/notice',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\ttoggle( 'core/edit-post', 'fullscreenMode' );\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t} );\n}\n", "/**\n * WordPress dependencies\n */\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst isGutenbergPlugin = globalThis.IS_GUTENBERG_PLUGIN ? true : false;\n\nexport function useShouldIframe() {\n\treturn useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getCurrentPostType, getDeviceType } =\n\t\t\tselect( editorStore );\n\t\treturn (\n\t\t\t// If the theme is block based and the Gutenberg plugin is active,\n\t\t\t// we ALWAYS use the iframe for consistency across the post and site\n\t\t\t// editor.\n\t\t\t( isGutenbergPlugin &&\n\t\t\t\tgetEditorSettings().__unstableIsBlockBasedTheme ) ||\n\t\t\t// We also still want to iframe all the special\n\t\t\t// editor features and modes such as device previews, zoom out, and\n\t\t\t// template/pattern editing.\n\t\t\tgetDeviceType() !== 'Desktop' ||\n\t\t\t[ 'wp_template', 'wp_block' ].includes( getCurrentPostType() ) ||\n\t\t\tunlock( select( blockEditorStore ) ).isZoomOut() ||\n\t\t\t// Finally, still iframe the editor if all blocks are v3 (which means\n\t\t\t// they are marked as iframe-compatible).\n\t\t\tselect( blocksStore )\n\t\t\t\t.getBlockTypes()\n\t\t\t\t.every( ( type ) => type.apiVersion >= 3 )\n\t\t);\n\t}, [] );\n}\n", "/**\n * WordPress dependencies\n */\nimport { useCallback, useReducer } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as editorStore, privateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nconst { useGenerateBlockPath } = unlock( privateApis );\n\n/**\n * A hook that records the 'entity' history in the post editor as a user\n * navigates between editing a post and editing the post template or patterns.\n *\n * Implemented as a stack, so a little similar to the browser history API.\n *\n * Used to control displaying UI elements like the back button.\n *\n * @param {number} initialPostId        The post id of the post when the editor loaded.\n * @param {string} initialPostType      The post type of the post when the editor loaded.\n * @param {string} defaultRenderingMode The rendering mode to switch to when navigating.\n *\n * @return {Object} An object containing the `currentPost` variable and\n *                 `onNavigateToEntityRecord` and `onNavigateToPreviousEntityRecord` functions.\n */\nexport default function useNavigateToEntityRecord(\n\tinitialPostId,\n\tinitialPostType,\n\tdefaultRenderingMode\n) {\n\tconst generateBlockPath = useGenerateBlockPath();\n\tconst [ postHistory, dispatch ] = useReducer(\n\t\t(\n\t\t\thistoryState,\n\t\t\t{ type, post, previousRenderingMode, selectedBlockPath }\n\t\t) => {\n\t\t\tif ( type === 'push' ) {\n\t\t\t\t// Update the current item with the selected block path before pushing new item\n\t\t\t\tconst updatedHistory = [ ...historyState ];\n\t\t\t\tconst currentIndex = updatedHistory.length - 1;\n\t\t\t\tupdatedHistory[ currentIndex ] = {\n\t\t\t\t\t...updatedHistory[ currentIndex ],\n\t\t\t\t\tselectedBlockPath,\n\t\t\t\t};\n\t\t\t\treturn [ ...updatedHistory, { post, previousRenderingMode } ];\n\t\t\t}\n\t\t\tif ( type === 'pop' ) {\n\t\t\t\t// Remove the current item from history\n\t\t\t\tif ( historyState.length > 1 ) {\n\t\t\t\t\treturn historyState.slice( 0, -1 );\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn historyState;\n\t\t},\n\t\t[\n\t\t\t{\n\t\t\t\tpost: { postId: initialPostId, postType: initialPostType },\n\t\t\t},\n\t\t]\n\t);\n\tconst { post, previousRenderingMode, selectedBlockPath } =\n\t\tpostHistory[ postHistory.length - 1 ];\n\n\tconst { getRenderingMode } = useSelect( editorStore );\n\tconst { setRenderingMode } = useDispatch( editorStore );\n\n\tconst onNavigateToEntityRecord = useCallback(\n\t\t( params ) => {\n\t\t\t// Generate block path from clientId if provided\n\t\t\tconst blockPath = params.selectedBlockClientId\n\t\t\t\t? generateBlockPath( params.selectedBlockClientId )\n\t\t\t\t: null;\n\n\t\t\tdispatch( {\n\t\t\t\ttype: 'push',\n\t\t\t\tpost: { postId: params.postId, postType: params.postType },\n\t\t\t\t// Save the current rendering mode so we can restore it when navigating back.\n\t\t\t\tpreviousRenderingMode: getRenderingMode(),\n\t\t\t\tselectedBlockPath: blockPath,\n\t\t\t} );\n\t\t\tsetRenderingMode( defaultRenderingMode );\n\t\t},\n\t\t[\n\t\t\tgetRenderingMode,\n\t\t\tsetRenderingMode,\n\t\t\tdefaultRenderingMode,\n\t\t\tgenerateBlockPath,\n\t\t]\n\t);\n\n\tconst onNavigateToPreviousEntityRecord = useCallback( () => {\n\t\tdispatch( {\n\t\t\ttype: 'pop',\n\t\t} );\n\t\tif ( previousRenderingMode ) {\n\t\t\tsetRenderingMode( previousRenderingMode );\n\t\t}\n\t}, [ setRenderingMode, previousRenderingMode ] );\n\n\treturn {\n\t\tcurrentPost: post,\n\t\tonNavigateToEntityRecord,\n\t\tonNavigateToPreviousEntityRecord:\n\t\t\tpostHistory.length > 1\n\t\t\t\t? onNavigateToPreviousEntityRecord\n\t\t\t\t: undefined,\n\t\t// Return the selected block path from the current history item\n\t\tpreviousSelectedBlockPath: selectedBlockPath,\n\t};\n}\n", "/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\n/**\n * Initializes WordPress `postboxes` script and the logic for saving meta boxes.\n *\n * @param { boolean } enabled\n */\nexport const useMetaBoxInitialization = ( enabled ) => {\n\tconst isEnabledAndEditorReady = useSelect(\n\t\t( select ) =>\n\t\t\tenabled && select( editorStore ).__unstableIsEditorReady(),\n\t\t[ enabled ]\n\t);\n\tconst { initializeMetaBoxes } = useDispatch( editPostStore );\n\t// The effect has to rerun when the editor is ready because initializeMetaBoxes\n\t// will noop until then.\n\tuseEffect( () => {\n\t\tif ( isEnabledAndEditorReady ) {\n\t\t\tinitializeMetaBoxes();\n\t\t}\n\t}, [ isEnabledAndEditorReady, initializeMetaBoxes ] );\n};\n", "/**\n * WordPress dependencies\n */\nimport {\n\tprivateApis as editorPrivateApis,\n\tPluginBlockSettingsMenuItem as EditorPluginBlockSettingsMenuItem,\n\tPluginDocumentSettingPanel as EditorPluginDocumentSettingPanel,\n\tPluginMoreMenuItem as EditorPluginMoreMenuItem,\n\tPluginPrePublishPanel as EditorPluginPrePublishPanel,\n\tPluginPostPublishPanel as EditorPluginPostPublishPanel,\n\tPluginPostStatusInfo as EditorPluginPostStatusInfo,\n\tPluginSidebar as EditorPluginSidebar,\n\tPluginSidebarMoreMenuItem as EditorPluginSidebarMoreMenuItem,\n} from '@wordpress/editor';\nimport { getPath } from '@wordpress/url';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from './lock-unlock';\nconst { PluginPostExcerpt } = unlock( editorPrivateApis );\n\nconst isSiteEditor = getPath( window.location.href )?.includes(\n\t'site-editor.php'\n);\n\nconst deprecateSlot = ( name ) => {\n\tdeprecated( `wp.editPost.${ name }`, {\n\t\tsince: '6.6',\n\t\talternative: `wp.editor.${ name }`,\n\t} );\n};\n\n/* eslint-disable jsdoc/require-param */\n/**\n * @see PluginBlockSettingsMenuItem in @wordpress/editor package.\n */\nexport function PluginBlockSettingsMenuItem( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginBlockSettingsMenuItem' );\n\treturn <EditorPluginBlockSettingsMenuItem { ...props } />;\n}\n\n/**\n * @see PluginDocumentSettingPanel in @wordpress/editor package.\n */\nexport function PluginDocumentSettingPanel( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginDocumentSettingPanel' );\n\treturn <EditorPluginDocumentSettingPanel { ...props } />;\n}\n\n/**\n * @see PluginMoreMenuItem in @wordpress/editor package.\n */\nexport function PluginMoreMenuItem( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginMoreMenuItem' );\n\treturn <EditorPluginMoreMenuItem { ...props } />;\n}\n\n/**\n * @see PluginPrePublishPanel in @wordpress/editor package.\n */\nexport function PluginPrePublishPanel( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginPrePublishPanel' );\n\treturn <EditorPluginPrePublishPanel { ...props } />;\n}\n\n/**\n * @see PluginPostPublishPanel in @wordpress/editor package.\n */\nexport function PluginPostPublishPanel( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginPostPublishPanel' );\n\treturn <EditorPluginPostPublishPanel { ...props } />;\n}\n\n/**\n * @see PluginPostStatusInfo in @wordpress/editor package.\n */\nexport function PluginPostStatusInfo( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginPostStatusInfo' );\n\treturn <EditorPluginPostStatusInfo { ...props } />;\n}\n\n/**\n * @see PluginSidebar in @wordpress/editor package.\n */\nexport function PluginSidebar( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginSidebar' );\n\treturn <EditorPluginSidebar { ...props } />;\n}\n\n/**\n * @see PluginSidebarMoreMenuItem in @wordpress/editor package.\n */\nexport function PluginSidebarMoreMenuItem( props ) {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecateSlot( 'PluginSidebarMoreMenuItem' );\n\treturn <EditorPluginSidebarMoreMenuItem { ...props } />;\n}\n\n/**\n * @see PluginPostExcerpt in @wordpress/editor package.\n */\nexport function __experimentalPluginPostExcerpt() {\n\tif ( isSiteEditor ) {\n\t\treturn null;\n\t}\n\tdeprecated( 'wp.editPost.__experimentalPluginPostExcerpt', {\n\t\tsince: '6.6',\n\t\thint: 'Core and custom panels can be access programmatically using their panel name.',\n\t\tlink: 'https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/#accessing-a-panel-programmatically',\n\t} );\n\treturn PluginPostExcerpt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Ae,IACtD,CACD,CASO,SAASE,GACfF,EAMAG,EAAuB,IACtB,CACD,IAAMC,EACLL,GAAgCC,CAAc,EAC/C,GAAK,CAAEI,EACN,OAAO,KAGR,IAAMC,EACLC,GAAwBF,GAAyB,GAAI,GAAKD,EACrDI,EACLD,GAAwBF,GAAyB,IAAK,GAAKD,EAE5D,OAAOE,IAAQE,EAASF,EAAM,GAAIA,CAAI,IAAKE,CAAO,EACnD,CCnDO,IAAMC,GAAqB,CACjC,QAAS,CACR,KAAM,UACN,KAAM,OACN,UAAW,iBACX,WAAY,CACX,CACC,SAAU,gBACV,MAAO,CACN,MAAO,OACP,sBAAuB,IACvB,oBAAqB,KACtB,CACD,EACA,CACC,SAAU,iBACV,MAAO,CACN,MAAO,QACP,sBAAuB,MACvB,oBAAqB,GACtB,CACD,EACA,CACC,SAAU,kBACV,MAAO,CACN,cAAe,kBACf,eAAgB,iBACjB,CACD,CACD,EACA,cAAe,CACd,CACC,SAAU,kBACV,MAAO,CACN,qBAAsB,GACvB,CACD,EACA,CACC,SAAU,iBACV,MAAO,CACN,mBAAoB,GACrB,CACD,EACA,CACC,SAAU,OACV,MAAO,CACN,qBAAsB,KACtB,mBAAoB,GACrB,CACD,CACD,CACD,EACA,YAAa,CACZ,KAAM,cACN,KAAM,cACN,UAAW,wBACX,WAAY,CACX,CACC,SAAU,gBACV,MAAO,CACN,MAAO,OACP,sBAAuB,IACvB,oBAAqB,KACtB,CACD,EACA,CACC,SAAU,iBACV,MAAO,CACN,MAAO,QACP,sBAAuB,MACvB,oBAAqB,GACtB,CACD,EACA,CACC,SAAU,kBACV,MAAO,CACN,cAAe,kBACf,eAAgB,iBACjB,CACD,EACA,CACC,SACC,+DACD,MAAO,CACN,YAAa,yCACb,cAAe,kBACf,eAAgB,iBACjB,CACD,EACA,CACC,SAAU,gBACV,MAAO,CACN,YAAa,qCACd,CACD,CACD,EACA,cAAe,CACd,CACC,SAAU,kBACV,MAAO,CACN,qBAAsB,GACvB,CACD,EACA,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AA0B,CAAE,SAAU,EAAM,CAAE,KAE7C,iDAA8C,CAC7C,gBAAiBO,EAAS,qCAC3B,CAAE,GAKF,SAAS,aAAe,aAAe,YAAc,YAChC,aAErB,QAAQ,KACP;gVACD,EAUgB,OAAO,UAAU,UAAU,QAAS,QAAS,IAAM,IAEnE,OAAO,iBAAkB,SAAYQ,GAAW,CAC/C,IAAMC,EAAwB,SAAS,uBACtC,oCACD,EAAG,CAAE,EACAD,EAAM,SAAW,WAGhB,OAAO,QAAU,MACrBC,EAAsB,UACrBA,EAAsB,UAAY,OAAO,SAI1C,SAAS,uBAAwB,gBAAiB,EAAG,CAAE,GAEvD,OAAO,SAAU,EAAG,CAAE,EAGzB,CAAE,EAIH,OAAO,iBAAkB,WAAcC,GAAOA,EAAE,eAAe,EAAG,EAAM,EACxE,OAAO,iBAAkB,OAAUA,GAAOA,EAAE,eAAe,EAAG,EAAM,EAEpEN,EAAK,UACJ,QAAC,cAAA,CACA,YAAA,QAACO,GAAA,CACA,SAAAX,EACA,OAAAD,EACA,SAAAD,EACA,aAAAG,CAAA,CACD,CAAA,CACD,CACD,EAEOG,CACR,CAKO,SAASQ,IAAqB,IACpC,GAAAC,SAAY,iCAAkC,CAC7C,MAAO,MACP,QAAS,KACV,CAAE,CACH",
  "names": ["require_blocks", "__commonJSMin", "exports", "module", "require_block_library", "__commonJSMin", "exports", "module", "require_deprecated", "__commonJSMin", "exports", "module", "require_element", "__commonJSMin", "exports", "module", "require_data", "__commonJSMin", "exports", "module", "require_preferences", "__commonJSMin", "exports", "module", "require_widgets", "__commonJSMin", "exports", "module", "require_editor", "__commonJSMin", "exports", "module", "require_i18n", "__commonJSMin", "exports", "module", "require_components", "__commonJSMin", "exports", "module", "require_jsx_runtime", "__commonJSMin", "exports", "module", "require_block_editor", "__commonJSMin", "exports", "module", "require_style_engine", "__commonJSMin", "exports", "module", "require_plugins", "__commonJSMin", "exports", "module", "require_primitives", "__commonJSMin", "exports", "module", "require_notices", "__commonJSMin", "exports", "module", "require_commands", "__commonJSMin", "exports", "module", "require_url", "__commonJSMin", "exports", "module", "require_html_entities", "__commonJSMin", "exports", "module", "require_core_data", "__commonJSMin", "exports", "module", "require_compose", "__commonJSMin", "exports", "module", "require_private_apis", "__commonJSMin", "exports", "module", "require_keyboard_shortcuts", "__commonJSMin", "exports", "module", "require_api_fetch", "__commonJSMin", "exports", "module", "require_hooks", "__commonJSMin", "exports", "module", "require_keycodes", "__commonJSMin", "exports", "module", "import_blocks", "import_block_library", "import_deprecated", "import_element", "import_data", "import_preferences", "import_widgets", "import_editor", "r", "f", "n", "o", "clsx", "clsx_default", "import_element", "import_jsx_runtime", "NavigableRegion", "children", "className", "ariaLabel", "Tag", "props", "ref", "clsx_default", "navigable_region_default", "import_editor", "import_data", "import_block_editor", "import_style_engine", "ROOT_BLOCK_SELECTOR", "ROOT_CSS_PROPERTIES_SELECTOR", "import_blocks", "import_style_engine", "import_data", "getSpacingPresetCssVar", "value", "slug", "getGapBoxControlValueFromStyle", "blockGapValue", "isValueString", "getGapCSSValue", "defaultValue", "blockGapBoxControlValue", "row", "getSpacingPresetCssVar", "column", "LAYOUT_DEFINITIONS", "getLayoutStyles", "layoutDefinitions", "LAYOUT_DEFINITIONS", "style", "selector", "hasBlockGapSupport", "hasFallbackGapSupport", "fallbackGapValue", "ruleset", "gapValue", "getGapCSSValue", "ROOT_BLOCK_SELECTOR", "className", "name", "spacingStyles", "spacingStyle", "declarations", "cssProperty", "cssValue", "combinedSelector", "ROOT_CSS_PROPERTIES_SELECTOR", "validDisplayModes", "displayMode", "baseStyles", "baseStyle", "import_plugins", "import_i18n", "import_element", "import_primitives", "import_jsx_runtime", "arrow_up_left_default", "import_primitives", "import_jsx_runtime", "chevron_down_default", "import_primitives", "import_jsx_runtime", "chevron_up_default", "import_primitives", "import_jsx_runtime", "fullscreen_default", "import_primitives", "import_jsx_runtime", "wordpress_default", "import_notices", "import_preferences", "import_commands", "import_block_library", "import_url", "import_html_entities", "import_core_data", "import_components", "import_compose", "import_editor", "import_components", "import_data", "import_components", "import_i18n", "import_url", "import_editor", "import_core_data", "import_compose", "import_jsx_runtime", "siteIconVariants", "toggleHomeIconVariants", "FullscreenModeClose", "showTooltip", "icon", "href", "initialPost", "isRequestingSiteIcon", "postType", "siteIconUrl", "select", "getCurrentPostType", "editorStore", "getEntityRecord", "getPostType", "isResolving", "coreStore", "siteData", "_postType", "disableMotion", "transition", "siteIconContent", "wordpress_default", "buttonIcon", "classes", "clsx_default", "buttonHref", "buttonLabel", "motion", "arrow_up_left_default", "fullscreen_mode_close_default", "import_private_apis", "lock", "unlock", "import_jsx_runtime", "BackButtonFill", "unlock", "editorPrivateApis", "slideX", "BackButton", "initialPost", "length", "motion", "fullscreen_mode_close_default", "back_button_default", "import_data", "import_element", "import_editor", "import_core_data", "STORE_NAME", "VIEW_AS_LINK_SELECTOR", "VIEW_AS_PREVIEW_LINK_SELECTOR", "useUpdatePostLinkListener", "isViewable", "newPermalink", "select", "getPostType", "coreStore", "getCurrentPost", "getEditedPostAttribute", "editorStore", "nodeToUpdateRef", "VIEW_AS_PREVIEW_LINK_SELECTOR", "VIEW_AS_LINK_SELECTOR", "EditorInitialization", "useUpdatePostLinkListener", "import_element", "import_data", "import_keyboard_shortcuts", "import_i18n", "import_data", "import_data", "isSavingMetaBoxes", "state", "action", "mergeMetaboxes", "metaboxes", "newMetaboxes", "mergedMetaboxes", "metabox", "existing", "box", "metaBoxLocations", "newState", "location", "metaBoxesInitialized", "metaBoxes", "reducer_default", "import_api_fetch", "import_preferences", "import_editor", "import_deprecated", "import_hooks", "import_core_data", "import_notices", "import_i18n", "getMetaBoxContainer", "location", "area", "interfaceStore", "unlock", "editorPrivateApis", "openGeneralSidebar", "name", "registry", "closeGeneralSidebar", "openModal", "deprecated", "closeModal", "openPublishSidebar", "editorStore", "closePublishSidebar", "togglePublishSidebar", "toggleEditorPanelEnabled", "panelName", "toggleEditorPanelOpened", "removeEditorPanel", "toggleFeature", "feature", "preferencesStore", "switchEditorMode", "mode", "togglePinnedPluginItem", "pluginName", "isPinned", "updatePreferredStyleVariations", "showBlockTypes", "blockNames", "hideBlockTypes", "setAvailableMetaBoxesPerLocation", "metaBoxesPerLocation", "requestMetaBoxUpdates", "select", "dispatch", "baseFormData", "postId", "postType", "post", "coreStore", "additionalData", "activeMetaBoxLocations", "formData", "location", "getMetaBoxContainer", "memo", "currentFormData", "key", "value", "apiFetch", "metaBoxUpdatesSuccess", "metaBoxUpdatesFailure", "__experimentalSetPreviewDeviceType", "deviceType", "setIsInserterOpened", "setIsListViewOpened", "isOpen", "setIsEditingTemplate", "__unstableCreateTemplate", "metaBoxesInitialized", "initializeMetaBoxes", "options", "toggleDistractionFree", "toggleFullscreenMode", "isFullscreen", "noticesStore", "import_data", "import_preferences", "import_core_data", "import_editor", "import_deprecated", "interfaceStore", "unlock", "editorPrivateApis", "EMPTY_ARRAY", "EMPTY_OBJECT", "getEditorMode", "select", "preferencesStore", "isEditorSidebarOpened", "activeGeneralSidebar", "isPluginSidebarOpened", "getActiveGeneralSidebarName", "convertPanelsToOldFormat", "inactivePanels", "openPanels", "panelsWithEnabledState", "accumulatedPanels", "panelName", "currentPanelState", "getPreferences", "deprecated", "corePreferences", "accumulatedPrefs", "preferenceKey", "value", "panels", "getPreference", "state", "defaultValue", "getHiddenBlockTypes", "isPublishSidebarOpened", "editorStore", "isEditorPanelRemoved", "isEditorPanelEnabled", "isEditorPanelOpened", "isModalActive", "modalName", "isFeatureActive", "feature", "isPluginItemPinned", "pluginName", "getActiveMetaBoxLocations", "location", "isMetaBoxLocationActive", "isMetaBoxLocationVisible", "getMetaBoxesPerLocation", "id", "metaBoxes", "getAllMetaBoxes", "hasMetaBoxes", "isSavingMetaBoxes", "__experimentalGetPreviewDeviceType", "isInserterOpened", "__experimentalGetInsertionPoint", "isListViewOpened", "isEditingTemplate", "areMetaBoxesInitialized", "getEditedPostTemplate", "postId", "postType", "templateId", "coreStore", "store", "STORE_NAME", "reducer_default", "actions_exports", "selectors_exports", "KeyboardShortcuts", "toggleFullscreenMode", "store", "registerShortcut", "keyboardShortcutsStore", "keyboard_shortcuts_default", "import_data", "import_i18n", "import_components", "import_element", "import_editor", "import_jsx_runtime", "InitPatternModal", "editPost", "editorStore", "syncType", "setSyncType", "title", "setTitle", "isNewPost", "select", "isModalOpen", "setIsModalOpen", "event", "VStack", "HStack", "import_element", "import_data", "import_url", "import_editor", "getPostEditURL", "postId", "BrowserURL", "historyId", "setHistoryId", "postStatus", "select", "getCurrentPost", "editorStore", "post", "id", "status", "type", "import_data", "import_element", "import_components", "import_data", "import_jsx_runtime", "MetaBoxesArea", "location", "container", "formRef", "isSaving", "select", "store", "classes", "clsx_default", "meta_boxes_area_default", "import_element", "import_data", "import_editor", "MetaBoxVisibility", "id", "isVisible", "select", "editorStore", "element", "import_jsx_runtime", "MetaBoxes", "location", "metaBoxes", "select", "store", "id", "MetaBoxVisibility", "meta_boxes_area_default", "import_i18n", "import_compose", "import_editor", "import_keycodes", "import_preferences", "import_components", "import_core_data", "import_data", "import_i18n", "import_url", "import_jsx_runtime", "ManagePatternsMenuItem", "url", "select", "canUser", "coreStore", "defaultUrl", "patternsUrl", "manage_patterns_menu_item_default", "import_data", "import_preferences", "import_i18n", "import_editor", "import_jsx_runtime", "WelcomeGuideMenuItem", "isEditingTemplate", "select", "editorStore", "import_i18n", "import_preferences", "import_editor", "import_i18n", "import_data", "import_editor", "import_preferences", "import_element", "import_i18n", "import_components", "import_data", "import_editor", "import_preferences", "import_url", "import_jsx_runtime", "PreferenceBaseOption", "unlock", "preferencesPrivateApis", "submitCustomFieldsForm", "customFieldsForm", "CustomFieldsConfirmation", "willEnable", "isReloading", "setIsReloading", "EnableCustomFieldsOption", "label", "areCustomFieldsEnabled", "select", "editorStore", "isChecked", "setIsChecked", "import_data", "import_editor", "import_preferences", "import_jsx_runtime", "PreferenceBaseOption", "unlock", "preferencesPrivateApis", "EnablePanelOption", "props", "toggleEditorPanelEnabled", "editorStore", "isChecked", "isRemoved", "select", "isEditorPanelEnabled", "isEditorPanelRemoved", "import_jsx_runtime", "PreferencesModalSection", "unlock", "preferencesPrivateApis", "MetaBoxesSection", "areCustomFieldsRegistered", "metaBoxes", "sectionProps", "thirdPartyMetaBoxes", "id", "EnableCustomFieldsOption", "title", "EnablePanelOption", "meta_boxes_section_default", "select", "getEditorSettings", "editorStore", "getAllMetaBoxes", "store", "import_jsx_runtime", "PreferenceToggleControl", "unlock", "preferencesPrivateApis", "PreferencesModal", "editorPrivateApis", "EditPostPreferencesModal", "extraSections", "meta_boxes_section_default", "import_jsx_runtime", "ToolsMoreMenuGroup", "ViewMoreMenuGroup", "unlock", "editorPrivateApis", "MoreMenu", "isLargeViewport", "manage_patterns_menu_item_default", "WelcomeGuideMenuItem", "EditPostPreferencesModal", "more_menu_default", "import_data", "import_data", "import_components", "import_i18n", "import_element", "import_jsx_runtime", "WelcomeGuideImage", "nonAnimatedSrc", "animatedSrc", "import_jsx_runtime", "WelcomeGuideDefault", "toggleFeature", "store", "WelcomeGuideImage", "import_data", "import_components", "import_i18n", "import_jsx_runtime", "WelcomeGuideTemplate", "toggleFeature", "store", "WelcomeGuideImage", "import_jsx_runtime", "WelcomeGuide", "postType", "isActive", "isEditingTemplate", "select", "isFeatureActive", "store", "_isEditingTemplate", "WelcomeGuideTemplate", "WelcomeGuideDefault", "import_data", "import_i18n", "import_commands", "import_preferences", "import_notices", "useCommands", "isFullscreen", "select", "get", "preferencesStore", "toggle", "createInfoNotice", "noticesStore", "fullscreen_default", "close", "import_editor", "import_data", "import_blocks", "import_block_editor", "isGutenbergPlugin", "useShouldIframe", "select", "getEditorSettings", "getCurrentPostType", "getDeviceType", "editorStore", "unlock", "blockEditorStore", "blocksStore", "type", "import_element", "import_data", "import_editor", "useGenerateBlockPath", "unlock", "useNavigateToEntityRecord", "initialPostId", "initialPostType", "defaultRenderingMode", "generateBlockPath", "postHistory", "dispatch", "historyState", "type", "post", "previousRenderingMode", "selectedBlockPath", "updatedHistory", "currentIndex", "getRenderingMode", "editorStore", "setRenderingMode", "onNavigateToEntityRecord", "params", "blockPath", "onNavigateToPreviousEntityRecord", "import_data", "import_editor", "import_element", "useMetaBoxInitialization", "enabled", "isEnabledAndEditorReady", "select", "editorStore", "initializeMetaBoxes", "store", "import_jsx_runtime", "useCommandContext", "unlock", "commandsPrivateApis", "Editor", "FullscreenMode", "editorPrivateApis", "BlockKeyboardShortcuts", "blockLibraryPrivateApis", "DESIGN_POST_TYPES", "useEditorStyles", "settings", "hasThemeStyleSupport", "select", "store", "presetStyles", "style", "defaultEditorStyles", "hasThemeStyles", "getLayoutStyles", "MetaBoxesMain", "isLegacy", "isOpen", "openHeight", "hasAnyVisible", "get", "preferencesStore", "isMetaBoxLocationVisible", "setPreference", "metaBoxesMainRef", "isShort", "min", "max", "setHeightConstraints", "effectSizeConstraints", "node", "container", "noticeLists", "resizeHandle", "deriveConstraints", "nextMax", "element", "nextMin", "observer", "resizeDataRef", "separatorRef", "separatorHelpId", "applyHeight", "candidateHeight", "isPersistent", "isInstant", "getAriaValueNow", "getRenderValues", "fresh", "usedOpenHeight", "usedHeight", "contents", "MetaBoxes", "isAutoHeight", "height", "usedAriaValueNow", "persistIsOpen", "to", "onSeparatorKeyDown", "event", "delta", "pane", "fromHeight", "nextHeight", "paneLabel", "toggle", "detail", "isToggleInferred", "chevron_up_default", "chevron_down_default", "separator", "navigable_region_default", "pointerId", "target", "timeStamp", "direction", "elementRef", "maxDelta", "newDelta", "duration", "wasSeparator", "nextIsOpen", "Layout", "initialPostId", "initialPostType", "initialEdits", "useCommands", "shouldIframe", "useShouldIframe", "createErrorNotice", "noticesStore", "currentPostId", "currentPostType", "onNavigateToEntityRecord", "onNavigateToPreviousEntityRecord", "previousSelectedBlockPath", "useNavigateToEntityRecord", "isEditingTemplate", "mode", "isFullscreenActive", "hasResolvedMode", "hasActiveMetaboxes", "hasBlockSelected", "showIconLabels", "isDistractionFree", "showMetaBoxes", "isWelcomeGuideVisible", "templateId", "isDevicePreview", "isFeatureActive", "hasMetaBoxes", "canUser", "getPostType", "getTemplateId", "coreStore", "supportsTemplateMode", "isViewable", "canViewTemplate", "getBlockSelectionStart", "isZoomOut", "blockEditorStore", "getEditorMode", "getDefaultRenderingMode", "getDeviceType", "editorStore", "isNotDesignPostType", "isDirectlyEditingPattern", "_templateId", "defaultMode", "useMetaBoxInitialization", "styles", "editorSettings", "navigateRegionsProps", "useNavigateRegions", "className", "clsx_default", "onPluginAreaError", "name", "createSuccessNotice", "onActionPerformed", "actionId", "items", "newItem", "title", "postId", "initialPost", "backButton", "back_button_default", "WelcomeGuide", "EditorInitialization", "BrowserURL", "keyboard_shortcuts_default", "InitPatternModal", "more_menu_default", "layout_default", "import_editor", "import_url", "import_deprecated", "import_jsx_runtime", "PluginPostExcerpt", "unlock", "editorPrivateApis", "isSiteEditor", "deprecateSlot", "name", "deprecated", "PluginBlockSettingsMenuItem", "props", "EditorPluginBlockSettingsMenuItem", "PluginDocumentSettingPanel", "EditorPluginDocumentSettingPanel", "PluginMoreMenuItem", "EditorPluginMoreMenuItem", "PluginPrePublishPanel", "EditorPluginPrePublishPanel", "PluginPostPublishPanel", "EditorPluginPostPublishPanel", "PluginPostStatusInfo", "EditorPluginPostStatusInfo", "PluginSidebar", "EditorPluginSidebar", "PluginSidebarMoreMenuItem", "EditorPluginSidebarMoreMenuItem", "__experimentalPluginPostExcerpt", "import_jsx_runtime", "__experimentalMainDashboardButton", "registerCoreBlockBindingsSources", "unlock", "editorPrivateApis", "initializeEditor", "id", "postType", "postId", "settings", "initialEdits", "isMediumOrBigger", "target", "root", "preferencesStore", "blocksStore", "editorStore", "event", "editorScrollContainer", "e", "layout_default", "reinitializeEditor", "deprecated"]
}