{
  "version": 3,
  "sources": ["../../src/store/actions.ts"],
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport { processBlockType } from './process-block-type';\nimport type {\n\tBlockType,\n\tBlockCategory,\n\tBlockVariation,\n\tBlockStyle,\n\tIcon,\n} from '../types';\nimport type { Action, BlocksStoreThunkArgs } from './types';\n\n/**\n * Returns an action object used in signalling that block types have been added.\n * Ignored from documentation as the recommended usage for this action through registerBlockType from @wordpress/blocks.\n *\n * @ignore\n *\n * @param blockTypes Object or array of objects representing blocks to added.\n *\n * @return Action object.\n */\nexport function addBlockTypes( blockTypes: BlockType | BlockType[] ): Action {\n\treturn {\n\t\ttype: 'ADD_BLOCK_TYPES',\n\t\tblockTypes: Array.isArray( blockTypes ) ? blockTypes : [ blockTypes ],\n\t};\n}\n\n/**\n * Signals that all block types should be computed again.\n * It uses stored unprocessed block types and all the most recent list of registered filters.\n *\n * It addresses the issue where third party block filters get registered after third party blocks. A sample sequence:\n *   1. Filter A.\n *   2. Block B.\n *   3. Block C.\n *   4. Filter D.\n *   5. Filter E.\n *   6. Block F.\n *   7. Filter G.\n * In this scenario some filters would not get applied for all blocks because they are registered too late.\n */\nexport function reapplyBlockTypeFilters() {\n\treturn ( { dispatch, select }: BlocksStoreThunkArgs ) => {\n\t\tconst processedBlockTypes: BlockType[] = [];\n\t\tfor ( const [ name, settings ] of Object.entries(\n\t\t\tselect.getUnprocessedBlockTypes()\n\t\t) ) {\n\t\t\tconst result = dispatch( processBlockType( name, settings ) );\n\t\t\tif ( result ) {\n\t\t\t\tprocessedBlockTypes.push( result );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! processedBlockTypes.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tdispatch.addBlockTypes( processedBlockTypes );\n\t};\n}\n\nexport function __experimentalReapplyBlockFilters() {\n\tdeprecated(\n\t\t'wp.data.dispatch( \"core/blocks\" ).__experimentalReapplyBlockFilters',\n\t\t{\n\t\t\tsince: '6.4',\n\t\t\talternative: 'reapplyBlockFilters',\n\t\t}\n\t);\n\n\treturn reapplyBlockTypeFilters();\n}\n\n/**\n * Returns an action object used to remove a registered block type.\n * Ignored from documentation as the recommended usage for this action through unregisterBlockType from @wordpress/blocks.\n *\n * @ignore\n *\n * @param names Block name or array of block names to be removed.\n *\n * @return Action object.\n */\nexport function removeBlockTypes( names: string | string[] ): Action {\n\treturn {\n\t\ttype: 'REMOVE_BLOCK_TYPES',\n\t\tnames: Array.isArray( names ) ? names : [ names ],\n\t};\n}\n\n/**\n * Returns an action object used in signalling that new block styles have been added.\n * Ignored from documentation as the recommended usage for this action through registerBlockStyle from @wordpress/blocks.\n *\n * @param blockNames Block names to register new styles for.\n * @param styles     Block style object or array of block style objects.\n *\n * @ignore\n *\n * @return Action object.\n */\nexport function addBlockStyles(\n\tblockNames: string | string[],\n\tstyles: BlockStyle | BlockStyle[]\n): Action {\n\treturn {\n\t\ttype: 'ADD_BLOCK_STYLES',\n\t\tstyles: Array.isArray( styles ) ? styles : [ styles ],\n\t\tblockNames: Array.isArray( blockNames ) ? blockNames : [ blockNames ],\n\t};\n}\n\n/**\n * Returns an action object used in signalling that block styles have been removed.\n * Ignored from documentation as the recommended usage for this action through unregisterBlockStyle from @wordpress/blocks.\n *\n * @ignore\n *\n * @param blockName  Block name.\n * @param styleNames Block style names or array of block style names.\n *\n * @return Action object.\n */\nexport function removeBlockStyles(\n\tblockName: string,\n\tstyleNames: string | string[]\n): Action {\n\treturn {\n\t\ttype: 'REMOVE_BLOCK_STYLES',\n\t\tstyleNames: Array.isArray( styleNames ) ? styleNames : [ styleNames ],\n\t\tblockName,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that new block variations have been added.\n * Ignored from documentation as the recommended usage for this action through registerBlockVariation from @wordpress/blocks.\n *\n * @ignore\n *\n * @param blockName  Block name.\n * @param variations Block variations.\n *\n * @return Action object.\n */\nexport function addBlockVariations(\n\tblockName: string,\n\tvariations: BlockVariation | BlockVariation[]\n): Action {\n\treturn {\n\t\ttype: 'ADD_BLOCK_VARIATIONS',\n\t\tvariations: Array.isArray( variations ) ? variations : [ variations ],\n\t\tblockName,\n\t};\n}\n\n/**\n * Returns an action object used in signalling that block variations have been removed.\n * Ignored from documentation as the recommended usage for this action through unregisterBlockVariation from @wordpress/blocks.\n *\n * @ignore\n *\n * @param blockName      Block name.\n * @param variationNames Block variation names.\n *\n * @return Action object.\n */\nexport function removeBlockVariations(\n\tblockName: string,\n\tvariationNames: string | string[]\n): Action {\n\treturn {\n\t\ttype: 'REMOVE_BLOCK_VARIATIONS',\n\t\tvariationNames: Array.isArray( variationNames )\n\t\t\t? variationNames\n\t\t\t: [ variationNames ],\n\t\tblockName,\n\t};\n}\n\n/**\n * Returns an action object used to set the default block name.\n * Ignored from documentation as the recommended usage for this action through setDefaultBlockName from @wordpress/blocks.\n *\n * @ignore\n *\n * @param name Block name.\n *\n * @return Action object.\n */\nexport function setDefaultBlockName( name: string ): Action {\n\treturn {\n\t\ttype: 'SET_DEFAULT_BLOCK_NAME',\n\t\tname,\n\t};\n}\n\n/**\n * Returns an action object used to set the name of the block used as a fallback\n * for non-block content.\n * Ignored from documentation as the recommended usage for this action through setFreeformContentHandlerName from @wordpress/blocks.\n *\n * @ignore\n *\n * @param name Block name.\n *\n * @return Action object.\n */\nexport function setFreeformFallbackBlockName( name: string ): Action {\n\treturn {\n\t\ttype: 'SET_FREEFORM_FALLBACK_BLOCK_NAME',\n\t\tname,\n\t};\n}\n\n/**\n * Returns an action object used to set the name of the block used as a fallback\n * for unregistered blocks.\n * Ignored from documentation as the recommended usage for this action through setUnregisteredTypeHandlerName from @wordpress/blocks.\n *\n * @ignore\n *\n * @param name Block name.\n *\n * @return Action object.\n */\nexport function setUnregisteredFallbackBlockName( name: string ): Action {\n\treturn {\n\t\ttype: 'SET_UNREGISTERED_FALLBACK_BLOCK_NAME',\n\t\tname,\n\t};\n}\n\n/**\n * Returns an action object used to set the name of the block used\n * when grouping other blocks\n * eg: in \"Group/Ungroup\" interactions\n * Ignored from documentation as the recommended usage for this action through setGroupingBlockName from @wordpress/blocks.\n *\n * @ignore\n *\n * @param name Block name.\n *\n * @return Action object.\n */\nexport function setGroupingBlockName( name: string ): Action {\n\treturn {\n\t\ttype: 'SET_GROUPING_BLOCK_NAME',\n\t\tname,\n\t};\n}\n\n/**\n * Returns an action object used to set block categories.\n * Ignored from documentation as the recommended usage for this action through setCategories from @wordpress/blocks.\n *\n * @ignore\n *\n * @param categories Block categories.\n *\n * @return Action object.\n */\nexport function setCategories( categories: BlockCategory[] ): Action {\n\treturn {\n\t\ttype: 'SET_CATEGORIES',\n\t\tcategories,\n\t};\n}\n\n/**\n * Returns an action object used to update a category.\n * Ignored from documentation as the recommended usage for this action through updateCategory from @wordpress/blocks.\n *\n * @ignore\n *\n * @param slug     Block category slug.\n * @param category Object containing the category properties that should be updated.\n *\n * @return Action object.\n */\nexport function updateCategory(\n\tslug: string,\n\tcategory: Partial< BlockCategory >\n): Action {\n\treturn {\n\t\ttype: 'UPDATE_CATEGORY',\n\t\tslug,\n\t\tcategory,\n\t};\n}\n\n/**\n * Returns an action object used to add block collections\n * Ignored from documentation as the recommended usage for this action through registerBlockCollection from @wordpress/blocks.\n *\n * @ignore\n *\n * @param namespace The namespace of the blocks to put in the collection\n * @param title     The title to display in the block inserter\n * @param icon      (optional) The icon to display in the block inserter\n *\n * @return Action object.\n */\nexport function addBlockCollection(\n\tnamespace: string,\n\ttitle: string,\n\ticon?: Icon\n): Action {\n\treturn {\n\t\ttype: 'ADD_BLOCK_COLLECTION',\n\t\tnamespace,\n\t\ttitle,\n\t\ticon,\n\t};\n}\n\n/**\n * Returns an action object used to remove block collections\n * Ignored from documentation as the recommended usage for this action through unregisterBlockCollection from @wordpress/blocks.\n *\n * @ignore\n *\n * @param namespace The namespace of the blocks to put in the collection\n *\n * @return Action object.\n */\nexport function removeBlockCollection( namespace: string ): Action {\n\treturn {\n\t\ttype: 'REMOVE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