File: /www/wwwroot/www.waciwang.com/wp-content/plugins/gutenberg/build/modules/lazy-editor/index.js.map
{
"version": 3,
"sources": ["package-external:@wordpress/editor", "package-external:@wordpress/core-data", "package-external:@wordpress/data", "package-external:@wordpress/components", "package-external:@wordpress/element", "package-external:@wordpress/style-engine", "package-external:@wordpress/i18n", "package-external:@wordpress/blocks", "package-external:@wordpress/private-apis", "vendor-external:react/jsx-runtime", "package-external:@wordpress/block-editor", "../../../packages/lazy-editor/src/components/editor/index.tsx", "../../../packages/lazy-editor/src/hooks/use-styles-id.tsx", "../../../packages/global-styles-engine/src/utils/object.ts", "../../../packages/global-styles-engine/src/settings/get-setting.ts", "../../../packages/global-styles-engine/src/utils/common.ts", "../../../packages/global-styles-engine/src/utils/fluid.ts", "../../../packages/global-styles-engine/src/utils/typography.ts", "../../../packages/global-styles-engine/src/core/render.tsx", "../../../packages/global-styles-engine/src/core/selectors.ts", "../../../node_modules/colord/index.mjs", "../../../packages/global-styles-engine/src/utils/duotone.ts", "../../../packages/global-styles-engine/src/utils/string.ts", "../../../packages/global-styles-engine/src/utils/spacing.ts", "../../../packages/global-styles-engine/src/utils/gap.ts", "../../../packages/global-styles-engine/src/utils/background.ts", "../../../packages/global-styles-engine/src/utils/layout.ts", "../../../packages/lazy-editor/src/hooks/use-editor-settings.tsx", "../../../packages/lazy-editor/src/hooks/use-global-styles.tsx", "../../../packages/lazy-editor/src/lock-unlock.ts", "../../../packages/asset-loader/src/index.ts", "../../../packages/lazy-editor/src/hooks/use-editor-assets.tsx", "../../../packages/lazy-editor/src/components/preview/index.tsx", "../../../packages/lazy-editor/src/components/preview/style.scss"],
"sourcesContent": ["module.exports = window.wp.editor;", "module.exports = window.wp.coreData;", "module.exports = window.wp.data;", "module.exports = window.wp.components;", "module.exports = window.wp.element;", "module.exports = window.wp.styleEngine;", "module.exports = window.wp.i18n;", "module.exports = window.wp.blocks;", "module.exports = window.wp.privateApis;", "module.exports = window.ReactJSXRuntime;", "module.exports = window.wp.blockEditor;", "/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { Spinner } from '@wordpress/components';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useStylesId } from '../../hooks/use-styles-id';\nimport { useEditorSettings } from '../../hooks/use-editor-settings';\nimport { useEditorAssets } from '../../hooks/use-editor-assets';\nimport { unlock } from '../../lock-unlock';\n\nconst { Editor: PrivateEditor, BackButton } = unlock( editorPrivateApis );\n\ninterface EditorProps {\n\tpostType?: string;\n\tpostId?: string;\n\tsettings?: Record< string, any >;\n\tbackButton?: ReactNode;\n}\n\n/**\n * Lazy-loading editor component that handles asset loading and settings initialization.\n *\n * @param {Object} props Component props\n * @param {string} props.postType Optional post type to edit. If not provided, resolves to homepage.\n * @param {string} props.postId Optional post ID to edit. If not provided, resolves to homepage.\n * @param {Object} props.settings Optional extra settings to merge with editor settings\n * @param {ReactNode} props.backButton Optional back button to render in editor header\n * @return The editor component with loading states\n */\nexport function Editor( {\n\tpostType,\n\tpostId,\n\tsettings,\n\tbackButton,\n}: EditorProps ) {\n\t// Resolve homepage when no postType/postId provided\n\tconst homePage = useSelect(\n\t\t( select ) => {\n\t\t\t// Only resolve homepage when both postType and postId are missing\n\t\t\tif ( postType || postId ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tconst { getHomePage } = unlock( select( coreDataStore ) );\n\t\t\treturn getHomePage();\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\t// Use provided postType/postId, or fall back to homepage resolution\n\tconst resolvedPostType = postType || homePage?.postType;\n\tconst resolvedPostId = postId || homePage?.postId;\n\n\t// Resolve template ID from post type/ID\n\tconst templateId = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! resolvedPostType || ! resolvedPostId ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tif ( resolvedPostType === 'wp_template' ) {\n\t\t\t\treturn resolvedPostId;\n\t\t\t}\n\t\t\t// Use private API to get template ID for this post\n\t\t\treturn unlock( select( coreDataStore ) ).getTemplateId(\n\t\t\t\tresolvedPostType,\n\t\t\t\tresolvedPostId\n\t\t\t);\n\t\t},\n\t\t[ resolvedPostType, resolvedPostId ]\n\t);\n\n\t// Resolve styles ID from template\n\tconst stylesId = useStylesId( { templateId } );\n\n\t// Load editor settings and assets\n\tconst { isReady: settingsReady, editorSettings } = useEditorSettings( {\n\t\tstylesId,\n\t} );\n\tconst { isReady: assetsReady } = useEditorAssets();\n\tconst finalSettings = useMemo(\n\t\t() => ( {\n\t\t\t...editorSettings,\n\t\t\t...settings,\n\t\t} ),\n\t\t[ editorSettings, settings ]\n\t);\n\n\t// Show loading spinner while assets or settings are loading\n\tif ( ! settingsReady || ! assetsReady ) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tstyle={ {\n\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\talignItems: 'center',\n\t\t\t\t\theight: '100vh',\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<Spinner />\n\t\t\t</div>\n\t\t);\n\t}\n\n\t// Render the editor when ready\n\treturn (\n\t\t<PrivateEditor\n\t\t\tpostType={ resolvedPostType }\n\t\t\tpostId={ resolvedPostId }\n\t\t\ttemplateId={ templateId }\n\t\t\tsettings={ finalSettings }\n\t\t\tstyles={ finalSettings.styles }\n\t\t>\n\t\t\t{ backButton && <BackButton>{ backButton }</BackButton> }\n\t\t</PrivateEditor>\n\t);\n}\n", "/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\n// Define interface for template with optional styles_id\ninterface Template {\n\tstyles_id?: string;\n\t[ key: string ]: any;\n}\n\n/**\n * This is a React hook that provides the styles ID.\n * Styles ID can be associated with a template.\n * If a template has a styles ID, it will be used otherwise the global styles ID will be used.\n *\n * @param {Object} props - The props object.\n * @param {string} [props.templateId] - The ID of the template to use.\n * @return The styles ID.\n */\nexport function useStylesId( { templateId }: { templateId?: string } = {} ) {\n\tconst { globalStylesId, stylesId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst coreDataSelect = select( coreStore );\n\t\t\tconst template = templateId\n\t\t\t\t? ( coreDataSelect.getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'wp_template',\n\t\t\t\t\t\ttemplateId\n\t\t\t\t ) as Template | null )\n\t\t\t\t: null;\n\n\t\t\treturn {\n\t\t\t\tglobalStylesId:\n\t\t\t\t\tcoreDataSelect.__experimentalGetCurrentGlobalStylesId(),\n\t\t\t\tstylesId: template?.styles_id,\n\t\t\t};\n\t\t},\n\t\t[ templateId ]\n\t);\n\n\t// Otherwise, fall back to the global styles ID\n\treturn stylesId || globalStylesId;\n}\n", "/**\n * Immutably sets a value inside an object. Like `lodash#set`, but returning a\n * new object. Treats nullish initial values as empty objects. Clones any\n * nested objects. Supports arrays, too.\n *\n * @param object Object to set a value in.\n * @param path Path in the object to modify.\n * @param value New value to set.\n * @return Cloned object with the new value set.\n */\nexport function setImmutably(\n\tobject: Object,\n\tpath: string | number | ( string | number )[],\n\tvalue: any\n) {\n\t// Normalize path\n\tpath = Array.isArray( path ) ? [ ...path ] : [ path ];\n\n\t// Shallowly clone the base of the object\n\tobject = Array.isArray( object ) ? [ ...object ] : { ...object };\n\n\tconst leaf = path.pop();\n\n\t// Traverse object from root to leaf, shallowly cloning at each level\n\tlet prev = object;\n\tfor ( const key of path ) {\n\t\t// @ts-expect-error\n\t\tconst lvl = prev[ key ];\n\t\t// @ts-expect-error\n\t\tprev = prev[ key ] = Array.isArray( lvl ) ? [ ...lvl ] : { ...lvl };\n\t}\n\t// @ts-expect-error\n\tprev[ leaf ] = value;\n\n\treturn object;\n}\n\n/**\n * Helper util to return a value from a certain path of the object.\n *\n * Path is specified as either:\n * - a string of properties, separated by dots, for example: \"x.y\".\n * - an array of properties, for example `[ 'x', 'y' ]`.\n *\n * You can also specify a default value in case the result is nullish.\n *\n * @param object Input object.\n * @param path Path to the object property.\n * @param defaultValue Default value if the value at the specified path is nullish.\n * @return Value of the object property at the specified path.\n */\nexport const getValueFromObjectPath = (\n\tobject: Object,\n\tpath: string | string[],\n\tdefaultValue?: any\n) => {\n\tconst arrayPath = Array.isArray( path ) ? path : path.split( '.' );\n\tlet value = object;\n\tarrayPath.forEach( ( fieldName ) => {\n\t\t// @ts-expect-error\n\t\tvalue = value?.[ fieldName ];\n\t} );\n\treturn value ?? defaultValue;\n};\n", "/**\n * Internal dependencies\n */\nimport { getValueFromObjectPath, setImmutably } from '../utils/object';\nimport type { GlobalStylesConfig } from '../types';\n\nconst VALID_SETTINGS = [\n\t'appearanceTools',\n\t'useRootPaddingAwareAlignments',\n\t'background.backgroundImage',\n\t'background.backgroundRepeat',\n\t'background.backgroundSize',\n\t'background.backgroundPosition',\n\t'border.color',\n\t'border.radius',\n\t'border.radiusSizes',\n\t'border.style',\n\t'border.width',\n\t'shadow.presets',\n\t'shadow.defaultPresets',\n\t'color.background',\n\t'color.button',\n\t'color.caption',\n\t'color.custom',\n\t'color.customDuotone',\n\t'color.customGradient',\n\t'color.defaultDuotone',\n\t'color.defaultGradients',\n\t'color.defaultPalette',\n\t'color.duotone',\n\t'color.gradients',\n\t'color.heading',\n\t'color.link',\n\t'color.palette',\n\t'color.text',\n\t'custom',\n\t'dimensions.aspectRatio',\n\t'dimensions.height',\n\t'dimensions.minHeight',\n\t'dimensions.width',\n\t'dimensions.dimensionSizes',\n\t'layout.contentSize',\n\t'layout.definitions',\n\t'layout.wideSize',\n\t'lightbox.enabled',\n\t'lightbox.allowEditing',\n\t'position.fixed',\n\t'position.sticky',\n\t'spacing.customSpacingSize',\n\t'spacing.defaultSpacingSizes',\n\t'spacing.spacingSizes',\n\t'spacing.spacingScale',\n\t'spacing.blockGap',\n\t'spacing.margin',\n\t'spacing.padding',\n\t'spacing.units',\n\t'typography.fluid',\n\t'typography.customFontSize',\n\t'typography.defaultFontSizes',\n\t'typography.dropCap',\n\t'typography.fontFamilies',\n\t'typography.fontSizes',\n\t'typography.fontStyle',\n\t'typography.fontWeight',\n\t'typography.letterSpacing',\n\t'typography.lineHeight',\n\t'typography.textAlign',\n\t'typography.textColumns',\n\t'typography.textDecoration',\n\t'typography.textTransform',\n\t'typography.writingMode',\n];\n\nexport function getSetting< T = any >(\n\tglobalStyles: GlobalStylesConfig,\n\tpath: string,\n\tblockName?: string\n): T {\n\tconst appendedBlockPath = blockName ? '.blocks.' + blockName : '';\n\tconst appendedPropertyPath = path ? '.' + path : '';\n\tconst contextualPath = `settings${ appendedBlockPath }${ appendedPropertyPath }`;\n\tconst globalPath = `settings${ appendedPropertyPath }`;\n\n\tif ( path ) {\n\t\treturn ( getValueFromObjectPath( globalStyles, contextualPath ) ??\n\t\t\tgetValueFromObjectPath( globalStyles, globalPath ) ) as T;\n\t}\n\n\tlet result = {};\n\tVALID_SETTINGS.forEach( ( setting ) => {\n\t\tconst value =\n\t\t\tgetValueFromObjectPath(\n\t\t\t\tglobalStyles,\n\t\t\t\t`settings${ appendedBlockPath }.${ setting }`\n\t\t\t) ??\n\t\t\tgetValueFromObjectPath( globalStyles, `settings.${ setting }` );\n\t\tif ( value !== undefined ) {\n\t\t\tresult = setImmutably( result, setting.split( '.' ), value );\n\t\t}\n\t} );\n\treturn result as T;\n}\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 * The fluid utilities must match the backend equivalent.\n * See: gutenberg_get_typography_font_size_value() in lib/block-supports/typography.php\n * ---------------------------------------------------------------\n */\n\n// Defaults.\nconst DEFAULT_MAXIMUM_VIEWPORT_WIDTH = '1600px';\nconst DEFAULT_MINIMUM_VIEWPORT_WIDTH = '320px';\nconst DEFAULT_SCALE_FACTOR = 1;\nconst DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MIN = 0.25;\nconst DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MAX = 0.75;\nconst DEFAULT_MINIMUM_FONT_SIZE_LIMIT = '14px';\n\n/**\n * Computes a fluid font-size value that uses clamp(). A minimum and maximum\n * font size OR a single font size can be specified.\n *\n * If a single font size is specified, it is scaled up and down using a logarithmic scale.\n *\n * @example\n * ```js\n * // Calculate fluid font-size value from a minimum and maximum value.\n * const fontSize = getComputedFluidTypographyValue( {\n * minimumFontSize: '20px',\n * maximumFontSize: '45px'\n * } );\n * // Calculate fluid font-size value from a single font size.\n * const fontSize = getComputedFluidTypographyValue( {\n * fontSize: '30px',\n * } );\n * ```\n *\n * @param {Object} args\n * @param {?string} args.minimumViewportWidth Minimum viewport size from which type will have fluidity. Optional if fontSize is specified.\n * @param {?string} args.maximumViewportWidth Maximum size up to which type will have fluidity. Optional if fontSize is specified.\n * @param {string|number} [args.fontSize] Size to derive maximumFontSize and minimumFontSize from, if necessary. Optional if minimumFontSize and maximumFontSize are specified.\n * @param {?string} args.maximumFontSize Maximum font size for any clamp() calculation. Optional.\n * @param {?string} args.minimumFontSize Minimum font size for any clamp() calculation. Optional.\n * @param {?number} args.scaleFactor A scale factor to determine how fast a font scales within boundaries. Optional.\n * @param {?string} args.minimumFontSizeLimit The smallest a calculated font size may be. Optional.\n *\n * @return {string|null} A font-size value using clamp().\n */\nexport function getComputedFluidTypographyValue( {\n\tminimumFontSize,\n\tmaximumFontSize,\n\tfontSize,\n\tminimumViewportWidth = DEFAULT_MINIMUM_VIEWPORT_WIDTH,\n\tmaximumViewportWidth = DEFAULT_MAXIMUM_VIEWPORT_WIDTH,\n\tscaleFactor = DEFAULT_SCALE_FACTOR,\n\tminimumFontSizeLimit,\n}: {\n\tminimumFontSize?: string;\n\tmaximumFontSize?: string;\n\tfontSize?: string | number;\n\tminimumViewportWidth?: string;\n\tmaximumViewportWidth?: string;\n\tscaleFactor?: number;\n\tminimumFontSizeLimit?: string;\n} ) {\n\t// Validate incoming settings and set defaults.\n\tminimumFontSizeLimit = !! getTypographyValueAndUnit( minimumFontSizeLimit )\n\t\t? minimumFontSizeLimit\n\t\t: DEFAULT_MINIMUM_FONT_SIZE_LIMIT;\n\n\t/*\n\t * Calculates missing minimumFontSize and maximumFontSize from\n\t * defaultFontSize if provided.\n\t */\n\tif ( fontSize ) {\n\t\t// Parses default font size.\n\t\tconst fontSizeParsed = getTypographyValueAndUnit( fontSize );\n\n\t\t// Protect against invalid units.\n\t\tif ( ! fontSizeParsed?.unit || ! fontSizeParsed?.value ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Parses the minimum font size limit, so we can perform checks using it.\n\t\tconst minimumFontSizeLimitParsed = getTypographyValueAndUnit(\n\t\t\tminimumFontSizeLimit,\n\t\t\t{\n\t\t\t\tcoerceTo: fontSizeParsed.unit,\n\t\t\t}\n\t\t);\n\n\t\t// Don't enforce minimum font size if a font size has explicitly set a min and max value.\n\t\tif (\n\t\t\t!! minimumFontSizeLimitParsed?.value &&\n\t\t\t! minimumFontSize &&\n\t\t\t! maximumFontSize\n\t\t) {\n\t\t\t/*\n\t\t\t * If a minimum size was not passed to this function\n\t\t\t * and the user-defined font size is lower than $minimum_font_size_limit,\n\t\t\t * do not calculate a fluid value.\n\t\t\t */\n\t\t\tif ( fontSizeParsed?.value <= minimumFontSizeLimitParsed?.value ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\t// If no fluid max font size is available use the incoming value.\n\t\tif ( ! maximumFontSize ) {\n\t\t\tmaximumFontSize = `${ fontSizeParsed.value }${ fontSizeParsed.unit }`;\n\t\t}\n\n\t\t/*\n\t\t * If no minimumFontSize is provided, create one using\n\t\t * the given font size multiplied by the min font size scale factor.\n\t\t */\n\t\tif ( ! minimumFontSize ) {\n\t\t\tconst fontSizeValueInPx =\n\t\t\t\tfontSizeParsed.unit === 'px'\n\t\t\t\t\t? fontSizeParsed.value\n\t\t\t\t\t: fontSizeParsed.value * 16;\n\n\t\t\t/*\n\t\t\t * The scale factor is a multiplier that affects how quickly the curve will move towards the minimum,\n\t\t\t * that is, how quickly the size factor reaches 0 given increasing font size values.\n\t\t\t * For a - b * log2(), lower values of b will make the curve move towards the minimum faster.\n\t\t\t * The scale factor is constrained between min and max values.\n\t\t\t */\n\t\t\tconst minimumFontSizeFactor = Math.min(\n\t\t\t\tMath.max(\n\t\t\t\t\t1 - 0.075 * Math.log2( fontSizeValueInPx ),\n\t\t\t\t\tDEFAULT_MINIMUM_FONT_SIZE_FACTOR_MIN\n\t\t\t\t),\n\t\t\t\tDEFAULT_MINIMUM_FONT_SIZE_FACTOR_MAX\n\t\t\t);\n\n\t\t\t// Calculates the minimum font size.\n\t\t\tconst calculatedMinimumFontSize = roundToPrecision(\n\t\t\t\tfontSizeParsed.value * minimumFontSizeFactor,\n\t\t\t\t3\n\t\t\t) as number;\n\n\t\t\t// Only use calculated min font size if it's > $minimum_font_size_limit value.\n\t\t\tif (\n\t\t\t\t!! minimumFontSizeLimitParsed?.value &&\n\t\t\t\tcalculatedMinimumFontSize < minimumFontSizeLimitParsed?.value\n\t\t\t) {\n\t\t\t\tminimumFontSize = `${ minimumFontSizeLimitParsed.value }${ minimumFontSizeLimitParsed.unit }`;\n\t\t\t} else {\n\t\t\t\tminimumFontSize = `${ calculatedMinimumFontSize }${ fontSizeParsed.unit }`;\n\t\t\t}\n\t\t}\n\t}\n\n\t// Grab the minimum font size and normalize it in order to use the value for calculations.\n\tconst minimumFontSizeParsed = getTypographyValueAndUnit( minimumFontSize );\n\n\t// We get a 'preferred' unit to keep units consistent when calculating,\n\t// otherwise the result will not be accurate.\n\tconst fontSizeUnit = minimumFontSizeParsed?.unit || 'rem';\n\n\t// Grabs the maximum font size and normalize it in order to use the value for calculations.\n\tconst maximumFontSizeParsed = getTypographyValueAndUnit( maximumFontSize, {\n\t\tcoerceTo: fontSizeUnit,\n\t} );\n\n\t// Checks for mandatory min and max sizes, and protects against unsupported units.\n\tif ( ! minimumFontSizeParsed || ! maximumFontSizeParsed ) {\n\t\treturn null;\n\t}\n\n\t// Uses rem for accessible fluid target font scaling.\n\tconst minimumFontSizeRem = getTypographyValueAndUnit( minimumFontSize, {\n\t\tcoerceTo: 'rem',\n\t} );\n\n\t// Viewport widths defined for fluid typography. Normalize units\n\tconst maximumViewportWidthParsed = getTypographyValueAndUnit(\n\t\tmaximumViewportWidth,\n\t\t{ coerceTo: fontSizeUnit }\n\t);\n\tconst minimumViewportWidthParsed = getTypographyValueAndUnit(\n\t\tminimumViewportWidth,\n\t\t{ coerceTo: fontSizeUnit }\n\t);\n\n\t// Protect against unsupported units.\n\tif (\n\t\t! maximumViewportWidthParsed ||\n\t\t! minimumViewportWidthParsed ||\n\t\t! minimumFontSizeRem\n\t) {\n\t\treturn null;\n\t}\n\n\t// Calculates the linear factor denominator. If it's 0, we cannot calculate a fluid value.\n\tconst linearDenominator =\n\t\tmaximumViewportWidthParsed.value - minimumViewportWidthParsed.value;\n\tif ( ! linearDenominator ) {\n\t\treturn null;\n\t}\n\n\t// Build CSS rule.\n\t// Borrowed from https://websemantics.uk/tools/responsive-font-calculator/.\n\tconst minViewportWidthOffsetValue = roundToPrecision(\n\t\tminimumViewportWidthParsed.value / 100,\n\t\t3\n\t);\n\n\tconst viewportWidthOffset =\n\t\troundToPrecision( minViewportWidthOffsetValue, 3 ) + fontSizeUnit;\n\tconst linearFactor =\n\t\t100 *\n\t\t( ( maximumFontSizeParsed.value - minimumFontSizeParsed.value ) /\n\t\t\tlinearDenominator );\n\tconst linearFactorScaled = roundToPrecision(\n\t\t( linearFactor || 1 ) * scaleFactor,\n\t\t3\n\t);\n\tconst fluidTargetFontSize = `${ minimumFontSizeRem.value }${ minimumFontSizeRem.unit } + ((1vw - ${ viewportWidthOffset }) * ${ linearFactorScaled })`;\n\n\treturn `clamp(${ minimumFontSize }, ${ fluidTargetFontSize }, ${ maximumFontSize })`;\n}\n\n/**\n * Internal method that checks a string for a unit and value and returns an array consisting of `'value'` and `'unit'`, e.g., [ '42', 'rem' ].\n * A raw font size of `value + unit` is expected. If the value is an integer, it will convert to `value + 'px'`.\n *\n * @param rawValue Raw size value from theme.json.\n * @param options Calculation options.\n *\n * @return An object consisting of `'value'` and `'unit'` properties.\n */\nexport function getTypographyValueAndUnit(\n\trawValue?: string | number,\n\toptions = {}\n) {\n\tif ( typeof rawValue !== 'string' && typeof rawValue !== 'number' ) {\n\t\treturn null;\n\t}\n\n\t// Converts numeric values to pixel values by default.\n\tif ( isFinite( rawValue as number ) ) {\n\t\trawValue = `${ rawValue }px`;\n\t}\n\n\tconst { coerceTo, rootSizeValue, acceptableUnits } = {\n\t\tcoerceTo: '',\n\t\t// Default browser font size. Later we could inject some JS to compute this `getComputedStyle( document.querySelector( \"html\" ) ).fontSize`.\n\t\trootSizeValue: 16,\n\t\tacceptableUnits: [ 'rem', 'px', 'em' ],\n\t\t...options,\n\t};\n\n\tconst acceptableUnitsGroup = acceptableUnits?.join( '|' );\n\tconst regexUnits = new RegExp(\n\t\t`^(\\\\d*\\\\.?\\\\d+)(${ acceptableUnitsGroup }){1,1}$`\n\t);\n\n\tconst matches = rawValue.toString().match( regexUnits );\n\n\t// We need a number value and a unit.\n\tif ( ! matches || matches.length < 3 ) {\n\t\treturn null;\n\t}\n\n\tlet [ , value, unit ] = matches;\n\n\tlet returnValue = parseFloat( value );\n\n\tif ( 'px' === coerceTo && ( 'em' === unit || 'rem' === unit ) ) {\n\t\treturnValue = returnValue * rootSizeValue;\n\t\tunit = coerceTo;\n\t}\n\n\tif ( 'px' === unit && ( 'em' === coerceTo || 'rem' === coerceTo ) ) {\n\t\treturnValue = returnValue / rootSizeValue;\n\t\tunit = coerceTo;\n\t}\n\n\t/*\n\t * No calculation is required if swapping between em and rem yet,\n\t * since we assume a root size value. Later we might like to differentiate between\n\t * :root font size (rem) and parent element font size (em) relativity.\n\t */\n\tif (\n\t\t( 'em' === coerceTo || 'rem' === coerceTo ) &&\n\t\t( 'em' === unit || 'rem' === unit )\n\t) {\n\t\tunit = coerceTo;\n\t}\n\n\tif ( ! unit ) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\tvalue: roundToPrecision( returnValue, 3 ),\n\t\tunit,\n\t};\n}\n\n/**\n * Returns a value rounded to defined precision.\n * Returns `undefined` if the value is not a valid finite number.\n *\n * @param value Raw value.\n * @param digits The number of digits to appear after the decimal point\n *\n * @return Value rounded to standard precision.\n */\nexport function roundToPrecision( value: number, digits: number = 3 ) {\n\tconst base = Math.pow( 10, digits );\n\treturn Math.round( value * base ) / base;\n}\n", "/**\n * Internal dependencies\n */\nimport type {\n\tTypographyPreset,\n\tGlobalStylesSettings,\n\tFluidTypographySettings,\n\tTypographySettings,\n} from '../types';\nimport {\n\tgetTypographyValueAndUnit,\n\tgetComputedFluidTypographyValue,\n} from './fluid';\n\n/**\n * Checks if fluid typography is enabled in the given typography settings.\n *\n * Fluid typography is considered enabled if the fluid setting is explicitly set to true,\n * or if it's an object with properties (which would contain fluid typography configuration\n * like minViewportWidth, maxViewportWidth, etc.).\n *\n * @param typographySettings Typography settings object that may contain fluid typography configuration.\n * @param typographySettings.fluid Fluid typography configuration. Can be:\n * - `true` to enable with default settings\n * - An object with fluid settings (minViewportWidth, maxViewportWidth, etc.)\n * - `false` or `undefined` to disable\n *\n * @return True if fluid typography is enabled, false otherwise.\n */\nfunction isFluidTypographyEnabled(\n\ttypographySettings?: TypographySettings | TypographyPreset\n) {\n\tconst fluidSettings = typographySettings?.fluid;\n\treturn (\n\t\ttrue === fluidSettings ||\n\t\t( fluidSettings &&\n\t\t\ttypeof fluidSettings === 'object' &&\n\t\t\tObject.keys( fluidSettings ).length > 0 )\n\t);\n}\n\n/**\n * Returns fluid typography settings from theme.json setting object.\n *\n * @param settings Theme.json settings\n * @param settings.typography Theme.json typography settings\n * @param settings.layout Theme.json layout settings\n * @return Fluid typography settings\n */\nexport function getFluidTypographyOptionsFromSettings(\n\tsettings: GlobalStylesSettings\n): { fluid?: FluidTypographySettings | boolean | undefined } {\n\tconst typographySettings = settings?.typography ?? {};\n\tconst layoutSettings = settings?.layout;\n\tconst defaultMaxViewportWidth = getTypographyValueAndUnit(\n\t\tlayoutSettings?.wideSize\n\t)\n\t\t? layoutSettings?.wideSize\n\t\t: null;\n\treturn isFluidTypographyEnabled( typographySettings ) &&\n\t\tdefaultMaxViewportWidth\n\t\t? {\n\t\t\t\tfluid: {\n\t\t\t\t\tmaxViewportWidth: defaultMaxViewportWidth,\n\t\t\t\t\t...( typeof typographySettings.fluid === 'object'\n\t\t\t\t\t\t? typographySettings.fluid\n\t\t\t\t\t\t: {} ),\n\t\t\t\t},\n\t\t }\n\t\t: {\n\t\t\t\tfluid: typographySettings?.fluid,\n\t\t };\n}\n\n/**\n * Returns a font-size value based on a given font-size preset.\n * Takes into account fluid typography parameters and attempts to return a css formula depending on available, valid values.\n *\n * The Core PHP equivalent is wp_get_typography_font_size_value().\n *\n * @param preset A typography preset object containing size and fluid properties.\n * @param settings Global styles settings object containing typography and layout settings.\n *\n * @return A font-size value or the value of preset.size.\n */\nexport function getTypographyFontSizeValue(\n\tpreset: TypographyPreset,\n\tsettings: GlobalStylesSettings\n) {\n\tconst { size: defaultSize } = preset;\n\n\t/*\n\t * Catch falsy values and 0/'0'. Fluid calculations cannot be performed on `0`.\n\t * Also return early when a preset font size explicitly disables fluid typography with `false`.\n\t */\n\tif ( ! defaultSize || '0' === defaultSize || false === preset?.fluid ) {\n\t\treturn defaultSize;\n\t}\n\n\t/*\n\t * Return early when fluid typography is disabled in the settings, and there\n\t * are no local settings to enable it for the individual preset.\n\t *\n\t * If this condition isn't met, either the settings or individual preset settings\n\t * have enabled fluid typography.\n\t */\n\tif (\n\t\t! isFluidTypographyEnabled( settings?.typography ) &&\n\t\t! isFluidTypographyEnabled( preset )\n\t) {\n\t\treturn defaultSize;\n\t}\n\n\tconst fluidTypographySettings =\n\t\tgetFluidTypographyOptionsFromSettings( settings )?.fluid ?? {};\n\n\tconst fluidFontSizeValue = getComputedFluidTypographyValue( {\n\t\tminimumFontSize:\n\t\t\ttypeof preset?.fluid === 'boolean' ? undefined : preset?.fluid?.min,\n\t\tmaximumFontSize:\n\t\t\ttypeof preset?.fluid === 'boolean' ? undefined : preset?.fluid?.max,\n\t\tfontSize: defaultSize,\n\t\tminimumFontSizeLimit:\n\t\t\ttypeof fluidTypographySettings === 'object'\n\t\t\t\t? fluidTypographySettings?.minFontSize\n\t\t\t\t: undefined,\n\t\tmaximumViewportWidth:\n\t\t\ttypeof fluidTypographySettings === 'object'\n\t\t\t\t? fluidTypographySettings?.maxViewportWidth\n\t\t\t\t: undefined,\n\t\tminimumViewportWidth:\n\t\t\ttypeof fluidTypographySettings === 'object'\n\t\t\t\t? fluidTypographySettings?.minViewportWidth\n\t\t\t\t: undefined,\n\t} );\n\n\tif ( !! fluidFontSizeValue ) {\n\t\treturn fluidFontSizeValue;\n\t}\n\n\treturn defaultSize;\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", "/**\n * Internal dependencies\n */\nimport type { BlockType } from '../types';\nimport { scopeSelector } from '../utils/common';\nimport { getValueFromObjectPath } from '../utils/object';\n\n/**\n * Determine the CSS selector for the block type and target provided, returning\n * it if available.\n *\n * @param blockType The block's type.\n * @param target The desired selector's target e.g. `root`, delimited string, or array path.\n * @param options Options object.\n * @param options.fallback Whether or not to fallback to broader selector.\n *\n * @return The CSS selector or `null` if no selector available.\n */\nexport function getBlockSelector(\n\tblockType: BlockType,\n\ttarget: string = 'root',\n\toptions: { fallback?: boolean } = {}\n): string | null {\n\tif ( ! target ) {\n\t\treturn null;\n\t}\n\n\tconst { fallback = false } = options;\n\tconst { name, selectors, supports } = blockType;\n\n\tconst hasSelectors = selectors && Object.keys( selectors ).length > 0;\n\tconst path = Array.isArray( target ) ? target.join( '.' ) : target;\n\n\t// Root selector.\n\n\t// Calculated before returning as it can be used as a fallback for feature\n\t// selectors later on.\n\tlet rootSelector: string | null = null;\n\n\tif ( hasSelectors && selectors.root ) {\n\t\t// Use the selectors API if available.\n\t\trootSelector = selectors?.root as string;\n\t} else if ( supports?.__experimentalSelector ) {\n\t\t// Use the old experimental selector supports property if set.\n\t\trootSelector = supports.__experimentalSelector;\n\t} else {\n\t\t// If no root selector found, generate default block class selector.\n\t\trootSelector =\n\t\t\t'.wp-block-' + name.replace( 'core/', '' ).replace( '/', '-' );\n\t}\n\n\t// Return selector if it's the root target we are looking for.\n\tif ( path === 'root' ) {\n\t\treturn rootSelector;\n\t}\n\n\t// If target is not `root` or `duotone` we have a feature or subfeature\n\t// as the target. If the target is a string convert to an array.\n\tconst pathArray = Array.isArray( target ) ? target : target.split( '.' );\n\n\t// Feature selectors ( may fallback to root selector );\n\tif ( pathArray.length === 1 ) {\n\t\tconst fallbackSelector = fallback ? rootSelector : null;\n\n\t\t// Prefer the selectors API if available.\n\t\tif ( hasSelectors ) {\n\t\t\t// Get selector from either `feature.root` or shorthand path.\n\t\t\tconst featureSelector =\n\t\t\t\t( getValueFromObjectPath(\n\t\t\t\t\tselectors,\n\t\t\t\t\t`${ path }.root`,\n\t\t\t\t\tnull\n\t\t\t\t) as string ) ||\n\t\t\t\t( getValueFromObjectPath( selectors, path, null ) as string );\n\n\t\t\t// Return feature selector if found or any available fallback.\n\t\t\treturn featureSelector || fallbackSelector;\n\t\t}\n\n\t\t// Try getting old experimental supports selector value.\n\t\tconst featureSelector = supports\n\t\t\t? ( getValueFromObjectPath(\n\t\t\t\t\tsupports,\n\t\t\t\t\t`${ path }.__experimentalSelector`,\n\t\t\t\t\tnull\n\t\t\t ) as string | undefined )\n\t\t\t: undefined;\n\n\t\t// If nothing to work with, provide fallback selector if available.\n\t\tif ( ! featureSelector ) {\n\t\t\treturn fallbackSelector;\n\t\t}\n\n\t\t// Scope the feature selector by the block's root selector.\n\t\treturn scopeSelector( rootSelector, featureSelector );\n\t}\n\n\t// Subfeature selector.\n\t// This may fallback either to parent feature or root selector.\n\tlet subfeatureSelector;\n\n\t// Use selectors API if available.\n\tif ( hasSelectors ) {\n\t\tsubfeatureSelector = getValueFromObjectPath( selectors, path, null );\n\t}\n\n\t// Only return if we have a subfeature selector.\n\tif ( subfeatureSelector ) {\n\t\treturn subfeatureSelector as string;\n\t}\n\n\t// To this point we don't have a subfeature selector. If a fallback has been\n\t// requested, remove subfeature from target path and return results of a\n\t// call for the parent feature's selector.\n\tif ( fallback ) {\n\t\treturn getBlockSelector( blockType, pathArray[ 0 ], options );\n\t}\n\n\t// We tried.\n\treturn null;\n}\n", "var r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return\"string\"==typeof r?r.length>0:\"number\"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?\"0\"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\\(\\s*([+-]?\\d*\\.?\\d+)(deg|rad|grad|turn)?\\s*,\\s*([+-]?\\d*\\.?\\d+)%\\s*,\\s*([+-]?\\d*\\.?\\d+)%\\s*(?:,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,p=/^hsla?\\(\\s*([+-]?\\d*\\.?\\d+)(deg|rad|grad|turn)?\\s+([+-]?\\d*\\.?\\d+)%\\s+([+-]?\\d*\\.?\\d+)%\\s*(?:\\/\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,v=/^rgba?\\(\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*(?:,\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,m=/^rgba?\\(\\s*([+-]?\\d*\\.?\\d+)(%)?\\s+([+-]?\\d*\\.?\\d+)(%)?\\s+([+-]?\\d*\\.?\\d+)(%)?\\s*(?:\\/\\s*([+-]?\\d*\\.?\\d+)(%)?\\s*)?\\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},\"hex\"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},\"rgb\"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u=\"deg\"),Number(e)*(r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},\"hsl\"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},\"rgb\"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},\"hsl\"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},\"hsv\"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return\"string\"==typeof r?N(r.trim(),y.string):\"object\"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):\"\",\"#\"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?\"rgba(\"+t+\", \"+n+\", \"+e+\", \"+u+\")\":\"rgb(\"+t+\", \"+n+\", \"+e+\")\";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?\"hsla(\"+t+\", \"+n+\"%, \"+e+\"%, \"+u+\")\":\"hsl(\"+t+\", \"+n+\"%, \"+e+\"%)\";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return\"number\"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return\"number\"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})};export{j as Colord,w as colord,k as extend,I as getFormat,E as random};\n", "/**\n * External dependencies\n */\nimport { colord } from 'colord';\n\n/**\n * Convert a list of colors to an object of R, G, and B values.\n *\n * @param colors Array of RBG color strings.\n *\n * @return R, G, and B values.\n */\nexport function getValuesFromColors( colors: string[] = [] ) {\n\tconst values: { r: number[]; g: number[]; b: number[]; a: number[] } = {\n\t\tr: [],\n\t\tg: [],\n\t\tb: [],\n\t\ta: [],\n\t};\n\n\tcolors.forEach( ( color ) => {\n\t\tconst rgbColor = colord( color ).toRgb();\n\t\tvalues.r.push( rgbColor.r / 255 );\n\t\tvalues.g.push( rgbColor.g / 255 );\n\t\tvalues.b.push( rgbColor.b / 255 );\n\t\tvalues.a.push( rgbColor.a );\n\t} );\n\n\treturn values;\n}\n\n/**\n * Stylesheet for disabling a global styles duotone filter.\n *\n * @param selector Selector to disable the filter for.\n *\n * @return Filter none style.\n */\nexport function getDuotoneUnsetStylesheet( selector: string ) {\n\treturn `${ selector }{filter:none}`;\n}\n\n/**\n * SVG and stylesheet needed for rendering the duotone filter.\n *\n * @param {string} selector Selector to apply the filter to.\n * @param {string} id Unique id for this duotone filter.\n *\n * @return {string} Duotone filter style.\n */\nexport function getDuotoneStylesheet( selector: string, id: string ) {\n\treturn `${ selector }{filter:url(#${ id })}`;\n}\n\n/**\n * The SVG part of the duotone filter.\n *\n * @param id Unique id for this duotone filter.\n * @param colors Color strings from dark to light.\n *\n * @return Duotone SVG.\n */\nexport function getDuotoneFilter( id: string, colors: string[] ) {\n\tconst values = getValuesFromColors( colors );\n\treturn `\n<svg\n\txmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\tviewBox=\"0 0 0 0\"\n\twidth=\"0\"\n\theight=\"0\"\n\tfocusable=\"false\"\n\trole=\"none\"\n\taria-hidden=\"true\"\n\tstyle=\"visibility: hidden; position: absolute; left: -9999px; overflow: hidden;\"\n>\n\t<defs>\n\t\t<filter id=\"${ id }\">\n\t\t\t<!--\n\t\t\t\tUse sRGB instead of linearRGB so transparency looks correct.\n\t\t\t\tUse perceptual brightness to convert to grayscale.\n\t\t\t-->\n\t\t\t<feColorMatrix color-interpolation-filters=\"sRGB\" type=\"matrix\" values=\" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 \"></feColorMatrix>\n\t\t\t<!-- Use sRGB instead of linearRGB to be consistent with how CSS gradients work. -->\n\t\t\t<feComponentTransfer color-interpolation-filters=\"sRGB\">\n\t\t\t\t<feFuncR type=\"table\" tableValues=\"${ values.r.join( ' ' ) }\"></feFuncR>\n\t\t\t\t<feFuncG type=\"table\" tableValues=\"${ values.g.join( ' ' ) }\"></feFuncG>\n\t\t\t\t<feFuncB type=\"table\" tableValues=\"${ values.b.join( ' ' ) }\"></feFuncB>\n\t\t\t\t<feFuncA type=\"table\" tableValues=\"${ values.a.join( ' ' ) }\"></feFuncA>\n\t\t\t</feComponentTransfer>\n\t\t\t<!-- Re-mask the image with the original transparency since the feColorMatrix above loses that information. -->\n\t\t\t<feComposite in2=\"SourceGraphic\" operator=\"in\"></feComposite>\n\t\t</filter>\n\t</defs>\n</svg>`;\n}\n", "/**\n * Converts a string to kebab-case.\n * Matches WordPress kebabCase behavior.\n *\n * @param str The string to convert\n * @return The kebab-cased string\n */\nexport function kebabCase( str: string ): string {\n\treturn str\n\t\t.replace( /([a-z])([A-Z])/g, '$1-$2' ) // camelCase to kebab-case\n\t\t.replace( /([0-9])([a-zA-Z])/g, '$1-$2' ) // number followed by letter\n\t\t.replace( /([a-zA-Z])([0-9])/g, '$1-$2' ) // letter followed by number\n\t\t.replace( /[\\s_]+/g, '-' ) // spaces and underscores to hyphens\n\t\t.toLowerCase();\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", "/**\n * Internal dependencies\n */\nimport type { BackgroundStyle } from '../types';\n\nexport const BACKGROUND_BLOCK_DEFAULT_VALUES = {\n\tbackgroundSize: 'cover',\n\tbackgroundPosition: '50% 50%', // used only when backgroundSize is 'contain'.\n};\n\nexport function setBackgroundStyleDefaults( backgroundStyle: BackgroundStyle ) {\n\tif (\n\t\t! backgroundStyle ||\n\t\t// @ts-expect-error\n\t\t! backgroundStyle?.backgroundImage?.url\n\t) {\n\t\treturn;\n\t}\n\n\tlet backgroundStylesWithDefaults;\n\n\t// Set block background defaults.\n\tif ( ! backgroundStyle?.backgroundSize ) {\n\t\tbackgroundStylesWithDefaults = {\n\t\t\tbackgroundSize: BACKGROUND_BLOCK_DEFAULT_VALUES.backgroundSize,\n\t\t};\n\t}\n\n\tif (\n\t\t'contain' === backgroundStyle?.backgroundSize &&\n\t\t! backgroundStyle?.backgroundPosition\n\t) {\n\t\tbackgroundStylesWithDefaults = {\n\t\t\tbackgroundPosition:\n\t\t\t\tBACKGROUND_BLOCK_DEFAULT_VALUES.backgroundPosition,\n\t\t};\n\t}\n\treturn backgroundStylesWithDefaults;\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 { generateGlobalStyles } from '@wordpress/global-styles-engine';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useUserGlobalStyles } from './use-global-styles';\nimport { unlock } from '../lock-unlock';\n\n/**\n * This is a React hook that provides the editor settings from the REST API.\n *\n * @param {Object} props - The props object.\n * @param {string} [props.stylesId] - The ID of the user's global styles to use.\n * @return Editor settings.\n */\nexport function useEditorSettings( { stylesId }: { stylesId: string } ) {\n\tconst { editorSettings } = useSelect(\n\t\t( select ) => ( {\n\t\t\teditorSettings: unlock(\n\t\t\t\tselect( coreDataStore )\n\t\t\t).getEditorSettings(),\n\t\t} ),\n\t\t[]\n\t);\n\n\tconst { user: globalStyles } = useUserGlobalStyles( stylesId );\n\tconst [ globalStylesCSS ] = generateGlobalStyles( globalStyles );\n\n\tconst hasEditorSettings = !! editorSettings;\n\tconst styles = useMemo( () => {\n\t\tif ( ! hasEditorSettings ) {\n\t\t\treturn [];\n\t\t}\n\t\treturn [\n\t\t\t...( ( editorSettings?.styles as Array< any > ) ?? [] ),\n\t\t\t...globalStylesCSS,\n\t\t];\n\t}, [ hasEditorSettings, editorSettings?.styles, globalStylesCSS ] );\n\n\treturn {\n\t\tisReady: hasEditorSettings,\n\t\teditorSettings: useMemo(\n\t\t\t() => ( {\n\t\t\t\t...( editorSettings ?? {} ),\n\t\t\t\tstyles,\n\t\t\t} ),\n\t\t\t[ editorSettings, styles ]\n\t\t),\n\t};\n}\n", "/**\n * WordPress dependencies\n */\nimport type { GlobalStylesConfig } from '@wordpress/global-styles-engine';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\n\nexport function useUserGlobalStyles( id: string ) {\n\tconst { userGlobalStyles } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord, getEditedEntityRecord, canUser } =\n\t\t\t\tselect( coreStore );\n\n\t\t\t/*\n\t\t\t * Ensure that the global styles ID request is complete by testing `_globalStylesId`,\n\t\t\t * before firing off the `canUser` OPTIONS request for user capabilities, otherwise it will\n\t\t\t * fetch `/wp/v2/global-styles` instead of `/wp/v2/global-styles/{id}`.\n\t\t\t * NOTE: Please keep in sync any preload paths sent to `block_editor_rest_api_preload()`,\n\t\t\t * or set using the `block_editor_rest_api_preload_paths` filter, if this changes.\n\t\t\t */\n\t\t\tconst userCanEditGlobalStyles = canUser( 'update', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'globalStyles',\n\t\t\t\tid,\n\t\t\t} );\n\n\t\t\tlet record;\n\t\t\tif (\n\t\t\t\t/*\n\t\t\t\t * Test that the OPTIONS request for user capabilities is complete\n\t\t\t\t * before fetching the global styles entity record.\n\t\t\t\t * This is to avoid fetching the global styles entity unnecessarily.\n\t\t\t\t */\n\t\t\t\ttypeof userCanEditGlobalStyles === 'boolean'\n\t\t\t) {\n\t\t\t\t/*\n\t\t\t\t * Fetch the global styles entity record based on the user's capabilities.\n\t\t\t\t * The default context is `edit` for users who can edit global styles.\n\t\t\t\t * Otherwise, the context is `view`.\n\t\t\t\t */\n\t\t\t\tif ( userCanEditGlobalStyles ) {\n\t\t\t\t\trecord = getEditedEntityRecord(\n\t\t\t\t\t\t'root',\n\t\t\t\t\t\t'globalStyles',\n\t\t\t\t\t\tid\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\trecord = getEntityRecord( 'root', 'globalStyles', id, {\n\t\t\t\t\t\tcontext: 'view',\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tuserGlobalStyles: record,\n\t\t\t};\n\t\t},\n\t\t[ id ]\n\t);\n\n\treturn useMemo( () => {\n\t\tif ( ! userGlobalStyles ) {\n\t\t\treturn {\n\t\t\t\tuser: undefined,\n\t\t\t};\n\t\t}\n\n\t\tconst user = userGlobalStyles as GlobalStylesConfig;\n\n\t\treturn {\n\t\t\tuser,\n\t\t};\n\t}, [ userGlobalStyles ] );\n}\n", "/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\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'@wordpress/lazy-editor'\n);\n", "type Style = {\n\tsrc: string;\n\tdeps?: string[];\n\tversion?: string;\n\tmedia?: string;\n};\ntype InlineStyle = string | string[];\ntype Script = {\n\tsrc: string;\n\tdeps?: string[];\n\tversion?: string;\n\tin_footer?: boolean;\n};\ntype InlineScript = string | string[];\ntype ScriptModules = Record< string, string >;\n\n/**\n * Injects or extends the import map with new module entries.\n *\n * @param scriptModules - Object mapping module specifiers to URLs\n */\nfunction injectImportMap( scriptModules: Record< string, string > ): void {\n\tif ( ! scriptModules || Object.keys( scriptModules ).length === 0 ) {\n\t\treturn;\n\t}\n\n\t// Find the existing import map script element\n\tconst existingMapElement = document.querySelector< HTMLScriptElement >(\n\t\t'script#wp-importmap[type=importmap]'\n\t);\n\n\tif ( existingMapElement ) {\n\t\ttry {\n\t\t\t// Parse the existing import map\n\t\t\tconst existingMap = JSON.parse( existingMapElement.text );\n\n\t\t\t// Ensure the imports object exists\n\t\t\tif ( ! existingMap.imports ) {\n\t\t\t\texistingMap.imports = {};\n\t\t\t}\n\n\t\t\t// Merge new imports with existing ones (new entries take precedence)\n\t\t\texistingMap.imports = {\n\t\t\t\t...existingMap.imports,\n\t\t\t\t...scriptModules,\n\t\t\t};\n\n\t\t\t// Update the script element's content\n\t\t\texistingMapElement.text = JSON.stringify( existingMap, null, 2 );\n\t\t} catch ( error ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error( 'Failed to parse or update import map:', error );\n\t\t}\n\t} else {\n\t\t// If no import map exists, create a new one\n\t\tconst script = document.createElement( 'script' );\n\t\tscript.type = 'importmap';\n\t\tscript.id = 'wp-importmap';\n\t\tscript.text = JSON.stringify(\n\t\t\t{\n\t\t\t\timports: scriptModules,\n\t\t\t},\n\t\t\tnull,\n\t\t\t2\n\t\t);\n\t\tdocument.head.appendChild( script );\n\t}\n}\n\nfunction loadStylesheet( handle: string, styleData: Style ): Promise< void > {\n\treturn new Promise( ( resolve ) => {\n\t\tif ( ! styleData.src ) {\n\t\t\tresolve(); // No external file to load\n\t\t\treturn;\n\t\t}\n\n\t\tconst existingLink = document.getElementById( handle + '-css' );\n\t\tif ( existingLink ) {\n\t\t\tresolve(); // Already loaded\n\t\t\treturn;\n\t\t}\n\n\t\tconst link = document.createElement( 'link' );\n\t\tlink.rel = 'stylesheet';\n\t\tlink.href =\n\t\t\tstyleData.src +\n\t\t\t( styleData.version ? '?ver=' + styleData.version : '' );\n\t\tlink.id = handle + '-css';\n\t\tlink.media = styleData.media || 'all';\n\n\t\tlink.onload = () => resolve();\n\t\tlink.onerror = () => {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error( `Failed to load stylesheet: ${ handle }` );\n\t\t\tresolve();\n\t\t};\n\n\t\tdocument.head.appendChild( link );\n\t} );\n}\n\nfunction loadScript( handle: string, scriptData: Script ): HTMLScriptElement {\n\t// If no external script source, just mark as processed and resolve\n\tif ( ! scriptData.src ) {\n\t\t// Still mark as processed with an ID so we don't repeat processing\n\t\tconst marker = document.createElement( 'script' );\n\t\tmarker.id = handle + '-js';\n\t\tmarker.textContent = '// Processed: ' + handle;\n\t\treturn marker;\n\t}\n\n\tconst script = document.createElement( 'script' );\n\tscript.src =\n\t\tscriptData.src +\n\t\t( scriptData.version ? '?ver=' + scriptData.version : '' );\n\tscript.id = handle + '-js';\n\tscript.async = false;\n\n\treturn script;\n}\n\n// Function to inject inline styles\nfunction injectInlineStyle(\n\thandle: string,\n\tinlineStyle: InlineStyle,\n\tposition: 'before' | 'after'\n) {\n\t// Handle both string and array formats\n\tlet styleContent = '';\n\tif ( Array.isArray( inlineStyle ) ) {\n\t\tstyleContent = inlineStyle.join( '\\n' );\n\t} else if ( typeof inlineStyle === 'string' ) {\n\t\tstyleContent = inlineStyle;\n\t}\n\n\tif ( styleContent && styleContent.trim() ) {\n\t\tconst styleId = handle + '-' + position + '-inline-css';\n\t\tif ( ! document.getElementById( styleId ) ) {\n\t\t\tconst style = document.createElement( 'style' );\n\t\t\tstyle.id = styleId;\n\t\t\tstyle.textContent = styleContent.trim();\n\t\t\tdocument.head.appendChild( style );\n\t\t}\n\t}\n}\n\nfunction injectInlineScript(\n\thandle: string,\n\tinlineScript: InlineScript,\n\tposition: 'before' | 'after'\n): HTMLScriptElement {\n\tlet scriptContent = inlineScript;\n\tif ( Array.isArray( scriptContent ) ) {\n\t\tscriptContent = scriptContent.join( '\\n' );\n\t}\n\n\tconst script = document.createElement( 'script' );\n\tscript.id = handle + '-' + position + '-js';\n\tscript.textContent = scriptContent.trim();\n\n\treturn script;\n}\n\n// Function to create dependency-ordered list respecting WordPress dependency graph\nfunction buildDependencyOrderedList< T extends Style | Script >(\n\tassetsData: Record< string, T >\n) {\n\tconst visited = new Set();\n\tconst visiting = new Set();\n\tconst orderedList: string[] = [];\n\n\tfunction visit( handle: string ) {\n\t\tif ( visited.has( handle ) ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( visiting.has( handle ) ) {\n\t\t\t// Circular dependency detected, skip to avoid infinite loop\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn(\n\t\t\t\t`Circular dependency detected for handle: ${ handle }`\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tvisiting.add( handle );\n\n\t\tif ( assetsData[ handle ] ) {\n\t\t\t// Visit all dependencies first\n\t\t\tconst deps = assetsData[ handle ].deps || [];\n\t\t\tdeps.forEach( ( dep ) => {\n\t\t\t\tif ( assetsData[ dep ] ) {\n\t\t\t\t\tvisit( dep );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tvisiting.delete( handle );\n\t\tvisited.add( handle );\n\n\t\tif ( assetsData[ handle ] ) {\n\t\t\torderedList.push( handle );\n\t\t}\n\t}\n\n\t// Visit all handles\n\tObject.keys( assetsData ).forEach( ( handle ) => {\n\t\tvisit( handle );\n\t} );\n\n\treturn orderedList;\n}\n\nasync function performScriptLoad(\n\tscriptElements: HTMLScriptElement[],\n\tdestination: HTMLElement\n) {\n\tlet parallel = [];\n\tfor ( const scriptElement of scriptElements ) {\n\t\tif ( scriptElement.src ) {\n\t\t\t// External scripts can be loaded in parallel. They will be executed in DOM order\n\t\t\t// because the `script` tags have an `async = false` attribute. Therefore cross-script\n\t\t\t// dependencies are guaranteed to be satisfied.\n\t\t\tconst loader = Promise.withResolvers< void >();\n\t\t\tscriptElement.onload = () => loader.resolve();\n\t\t\tscriptElement.onerror = () => {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.error( `Failed to load script: ${ scriptElement.id }` );\n\t\t\t\tloader.resolve();\n\t\t\t};\n\t\t\tparallel.push( loader.promise );\n\t\t} else {\n\t\t\t// We've encountered an inline script. Inline scripts are executed immediately after\n\t\t\t// inserting them to the DOM. Therefore we need to wait for all external scripts to load.\n\t\t\tawait Promise.all( parallel );\n\t\t\tparallel = [];\n\t\t}\n\t\t// Append the `script` element (external or inline) to the DOM and trigger the load.\n\t\tdestination.appendChild( scriptElement );\n\t}\n\t// Wait for all the remainingexternal scripts to load.\n\tawait Promise.all( parallel );\n\tparallel = [];\n}\n\n// Main async function to load all assets and return editor settings\nasync function loadAssets(\n\tscriptsData: Record< string, Script >,\n\tinlineScripts: Record< 'before' | 'after', Record< string, InlineScript > >,\n\tstylesData: Record< string, Style >,\n\tinlineStyles: Record< 'before' | 'after', Record< string, InlineStyle > >,\n\thtmlTemplates?: string[],\n\tscriptModules?: ScriptModules\n): Promise< void > {\n\t// Inject import map first so script modules can be resolved\n\tif ( scriptModules ) {\n\t\tinjectImportMap( scriptModules );\n\t}\n\n\t// Build dependency-ordered lists\n\tconst orderedStyles = buildDependencyOrderedList( stylesData );\n\tconst orderedScripts = buildDependencyOrderedList( scriptsData );\n\n\tconst stylePromises: Promise< void >[] = [];\n\n\t// Load stylesheets in dependency order\n\tfor ( const handle of orderedStyles ) {\n\t\tconst beforeInline = inlineStyles.before?.[ handle ];\n\t\tif ( beforeInline ) {\n\t\t\tinjectInlineStyle( handle, beforeInline, 'before' );\n\t\t}\n\t\tstylePromises.push( loadStylesheet( handle, stylesData[ handle ] ) );\n\t\tconst afterInline = inlineStyles.after?.[ handle ];\n\t\tif ( afterInline ) {\n\t\t\tinjectInlineStyle( handle, afterInline, 'after' );\n\t\t}\n\t}\n\n\t// Load scripts in dependency order\n\tconst scriptElements: HTMLScriptElement[] = [];\n\n\tfor ( const handle of orderedScripts ) {\n\t\tconst beforeInline = inlineScripts.before?.[ handle ];\n\t\tif ( beforeInline ) {\n\t\t\tscriptElements.push(\n\t\t\t\tinjectInlineScript( handle, beforeInline, 'before' )\n\t\t\t);\n\t\t}\n\n\t\tscriptElements.push( loadScript( handle, scriptsData[ handle ] ) );\n\n\t\tconst afterInline = inlineScripts.after?.[ handle ];\n\t\tif ( afterInline ) {\n\t\t\tscriptElements.push(\n\t\t\t\tinjectInlineScript( handle, afterInline, 'after' )\n\t\t\t);\n\t\t}\n\t}\n\n\tconst scriptsPromise = performScriptLoad( scriptElements, document.body );\n\n\tawait Promise.all( [ Promise.all( stylePromises ), scriptsPromise ] );\n\n\t// Inject HTML templates (e.g., wp.media templates) into the DOM\n\t// Note: We can't use innerHTML for script tags, so we need to parse and create elements properly\n\tif ( htmlTemplates && htmlTemplates.length > 0 ) {\n\t\thtmlTemplates.forEach( ( templateHtml ) => {\n\t\t\t// Extract the script tag attributes and content\n\t\t\tconst scriptMatch = templateHtml.match(\n\t\t\t\t/<script([^>]*)>(.*?)<\\/script>/is\n\t\t\t);\n\t\t\tif ( scriptMatch ) {\n\t\t\t\tconst attributes = scriptMatch[ 1 ];\n\t\t\t\tconst content = scriptMatch[ 2 ];\n\n\t\t\t\t// Create a new script element\n\t\t\t\tconst script = document.createElement( 'script' );\n\n\t\t\t\t// Extract and set the id attribute\n\t\t\t\tconst idMatch = attributes.match( /id=[\"']([^\"']+)[\"']/ );\n\t\t\t\tif ( idMatch ) {\n\t\t\t\t\tscript.id = idMatch[ 1 ];\n\t\t\t\t}\n\n\t\t\t\t// Extract and set the type attribute\n\t\t\t\tconst typeMatch = attributes.match( /type=[\"']([^\"']+)[\"']/ );\n\t\t\t\tif ( typeMatch ) {\n\t\t\t\t\tscript.type = typeMatch[ 1 ];\n\t\t\t\t}\n\n\t\t\t\t// Set the content\n\t\t\t\tscript.textContent = content;\n\n\t\t\t\t// Append to body\n\t\t\t\tdocument.body.appendChild( script );\n\t\t\t}\n\t\t} );\n\t}\n}\n\nexport default loadAssets;\n", "/**\n * WordPress dependencies\n */\nimport loadAssets from '@wordpress/asset-loader';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { useState, useEffect } from '@wordpress/element';\nimport { resolveSelect, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\nlet loadAssetsPromise: Promise< void >;\n\nexport async function loadEditorAssets() {\n\tconst load = async () => {\n\t\tconst editorAssets = await unlock(\n\t\t\tresolveSelect( coreDataStore )\n\t\t).getEditorAssets();\n\t\tawait loadAssets(\n\t\t\teditorAssets.scripts || {},\n\t\t\teditorAssets.inline_scripts || { before: {}, after: {} },\n\t\t\teditorAssets.styles || {},\n\t\t\teditorAssets.inline_styles || { before: {}, after: {} },\n\t\t\teditorAssets.html_templates || [],\n\t\t\teditorAssets.script_modules || {}\n\t\t);\n\t};\n\n\tif ( ! loadAssetsPromise ) {\n\t\tloadAssetsPromise = load();\n\t}\n\n\treturn loadAssetsPromise;\n}\n\n/**\n * This is a React hook that handles loading editor assets from the REST API.\n *\n * @return Editor assets loading state.\n */\nexport function useEditorAssets() {\n\tconst editorAssets = useSelect( ( select ) => {\n\t\treturn unlock( select( coreDataStore ) ).getEditorAssets();\n\t}, [] );\n\n\tconst [ assetsLoaded, setAssetsLoaded ] = useState( false );\n\n\tuseEffect( () => {\n\t\tif ( editorAssets && ! assetsLoaded ) {\n\t\t\tloadEditorAssets()\n\t\t\t\t.then( () => {\n\t\t\t\t\tsetAssetsLoaded( true );\n\t\t\t\t} )\n\t\t\t\t.catch( ( error: Error ) => {\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole.error( 'Failed to load editor assets:', error );\n\t\t\t\t} );\n\t\t}\n\t}, [ editorAssets, assetsLoaded ] );\n\n\treturn {\n\t\tisReady: !! editorAssets && assetsLoaded,\n\t\tassetsLoaded,\n\t};\n}\n", "/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useId, useMemo } from '@wordpress/element';\n// @ts-expect-error Block Editor not fully typed yet.\nimport { BlockPreview, BlockEditorProvider } from '@wordpress/block-editor';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n// @ts-expect-error Blocks not fully typed yet.\nimport { parse } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport './style.scss';\nimport { unlock } from '../../lock-unlock';\nimport { useEditorAssets } from '../../hooks/use-editor-assets';\nimport { useEditorSettings } from '../../hooks/use-editor-settings';\nimport { useStylesId } from '../../hooks/use-styles-id';\n\nconst { useStyle } = unlock( editorPrivateApis );\n\nfunction PreviewContent( {\n\tblocks,\n\tcontent,\n\tdescription,\n}: {\n\tblocks?: any[];\n\tcontent?: string;\n\tdescription: string;\n} ) {\n\tconst descriptionId = useId();\n\tconst backgroundColor = useStyle( 'color.background' );\n\tconst actualBlocks = useMemo( () => {\n\t\treturn (\n\t\t\tblocks ??\n\t\t\tparse( content, {\n\t\t\t\t__unstableSkipMigrationLogs: true,\n\t\t\t} )\n\t\t);\n\t}, [ content, blocks ] );\n\tconst isEmpty = ! actualBlocks?.length;\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"lazy-editor-block-preview__container\"\n\t\t\tstyle={ { backgroundColor } }\n\t\t\taria-describedby={ !! description ? descriptionId : undefined }\n\t\t>\n\t\t\t{ isEmpty && __( 'Empty.' ) }\n\t\t\t{ ! isEmpty && (\n\t\t\t\t<BlockPreview.Async>\n\t\t\t\t\t<BlockPreview blocks={ actualBlocks } />\n\t\t\t\t</BlockPreview.Async>\n\t\t\t) }\n\t\t\t{ !! description && (\n\t\t\t\t<div hidden id={ descriptionId }>\n\t\t\t\t\t{ description }\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n\nexport function Preview( {\n\tblocks,\n\tcontent,\n\tdescription,\n}: {\n\tblocks?: any[];\n\tcontent?: string;\n\tdescription: string;\n} ) {\n\t// Resolve styles ID from template\n\tconst stylesId = useStylesId();\n\n\t// Load editor settings and assets\n\tconst { isReady: settingsReady, editorSettings } = useEditorSettings( {\n\t\tstylesId,\n\t} );\n\tconst { isReady: assetsReady } = useEditorAssets();\n\tconst finalSettings = useMemo(\n\t\t() => ( {\n\t\t\t...editorSettings,\n\t\t\tisPreviewMode: true,\n\t\t} ),\n\t\t[ editorSettings ]\n\t);\n\tif ( ! settingsReady || ! assetsReady ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<BlockEditorProvider settings={ finalSettings }>\n\t\t\t<PreviewContent\n\t\t\t\tblocks={ blocks }\n\t\t\t\tcontent={ content }\n\t\t\t\tdescription={ description }\n\t\t\t/>\n\t\t</BlockEditorProvider>\n\t);\n}\n", "const css = `/**\n * SCSS Variables.\n *\n * Please use variables from this sheet to ensure consistency across the UI.\n * Don't add to this sheet unless you're pretty sure the value will be reused in many places.\n * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.\n */\n/**\n * Colors\n */\n/**\n * Fonts & basic variables.\n */\n/**\n * Typography\n */\n/**\n * Grid System.\n * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/\n */\n/**\n * Radius scale.\n */\n/**\n * Elevation scale.\n */\n/**\n * Dimensions.\n */\n/**\n * Mobile specific styles\n */\n/**\n * Editor styles.\n */\n/**\n * Block & Editor UI.\n */\n/**\n * Block paddings.\n */\n/**\n * React Native specific.\n * These variables do not appear to be used anywhere else.\n */\n.lazy-editor-block-preview__container {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n height: 100%;\n border-radius: 4px;\n}\n.dataviews-view-grid .lazy-editor-block-preview__container .block-editor-block-preview__container {\n height: 100%;\n}\n.dataviews-view-table .lazy-editor-block-preview__container {\n width: 96px;\n flex-grow: 0;\n text-wrap: balance;\n text-wrap: pretty;\n}\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VSb290IjoiL2hvbWUvcnVubmVyL3dvcmsvZ3V0ZW5iZXJnL2d1dGVuYmVyZy9wYWNrYWdlcy9sYXp5LWVkaXRvci9zcmMvY29tcG9uZW50cy9wcmV2aWV3Iiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQHdvcmRwcmVzcy9iYXNlLXN0eWxlcy9fdmFyaWFibGVzLnNjc3MiLCIuLi8uLi8uLi8uLi8uLi9ub2RlX21vZHVsZXMvQHdvcmRwcmVzcy9iYXNlLXN0eWxlcy9fY29sb3JzLnNjc3MiLCJzdHlsZS5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FDQUE7QUFBQTtBQUFBO0FEVUE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IACjD;EACD;AAEA,MACC,cAAc,iBAAiB,kBAC/B,CAAE,iBAAiB,oBAClB;AACD,mCAA+B;MAC9B,oBACC,gCAAgC;IAClC;EACD;AACA,SAAO;AACR;;;AClCO,IAAM,qBAAqB;EACjC,SAAS;IACR,MAAM;IACN,MAAM;IACN,WAAW;IACX,YAAY;MACX;QACC,UAAU;QACV,OAAO;UACN,OAAO;UACP,uBAAuB;UACvB,qBAAqB;QACtB;MACD;MACA;QACC,UAAU;QACV,OAAO;UACN,OAAO;UACP,uBAAuB;UACvB,qBAAqB;QACtB;MACD;MACA;QACC,UAAU;QACV,OAAO;UACN,eAAe;UACf,gBAAgB;QACjB;MACD;IACD;IACA,eAAe;MACd;QACC,UAAU;QACV,OAAO;UACN,sBAAsB;QACvB;MACD;MACA;QACC,UAAU;QACV,OAAO;UACN,oBAAoB;QACrB;MACD;MACA;QACC,UAAU;QACV,OAAO;UACN,sBAAsB;UACtB,oBAAoB;QACrB;MACD;IACD;EACD;EACA,aAAa;IACZ,MAAM;IACN,MAAM;IACN,WAAW;IACX,YAAY;MACX;QACC,UAAU;QACV,OAAO;UACN,OAAO;UACP,uBAAuB;UACvB,qBAAqB;QACtB;MACD;MACA;QACC,UAAU;QACV,OAAO;UACN,OAAO;UACP,uBAAuB;UACvB,qBAAqB;QACtB;MACD;MACA;QACC,UAAU;QACV,OAAO;UACN,eAAe;UACf,gBAAgB;QACjB;MACD;MACA;QACC,UACC;QACD,OAAO;UACN,aAAa;UACb,eAAe;UACf,gBAAgB;QACjB;MACD;MACA;QACC,UAAU;QACV,OAAO;UACN,aAAa;QACd;MACD;IACD;IACA,eAAe;MACd;QACC,UAAU;QACV,OAAO;UACN,sBAAsB;QACvB;MACD;MACA;QACC,UAAU;QACV,OAAO;UACN,oBAAoB;QACrB;MACD;MACA;QACC,UAAU;QACV,OAAO;UACN,sBAAsB;UACtB,oBAAoB;QACrB;MACD;IACD;EACD;EACA,MAAM;IACL,MAAM;IACN,MAAM;IACN,WAAW;I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M,oBAAgB;IACrB,OAAQ;MACP,GAAG;MACH,eAAe;IAChB;IACA,CAAE,cAAe;EAClB;AACA,MAAK,CAAE,iBAAiB,CAAE,aAAc;AACvC,WAAO;EACR;AACA,SACC,6CAAC,yCAAA,EAAoB,UAAW,eAC/B,UAAA;IAAC;IAAA;MACA;MACA;MACA;IAAA;EACD,EAAA,CACD;AAEF;",
"names": ["import_core_data", "import_data", "import_element", "select", "coreStore", "import_style_engine", "import_data", "featureSelector", "r", "t", "n", "e", "u", "a", "o", "i", "s", "h", "r", "t", "n", "e", "u", "i", "a", "STYLE_PROPERTY", "ELEMENTS", "presets", "blocksStore", "css", "import_core_data", "import_element", "import_data", "import_core_data", "import_data", "select", "coreStore", "select", "coreDataStore", "import_core_data", "import_element", "import_data", "coreDataStore", "select", "editorPrivateApis", "select", "coreDataStore", "import_element", "import_editor", "import_blocks", "import_jsx_runtime", "editorPrivateApis"]
}