{
  "version": 3,
  "sources": ["../../../src/components/template-part-content-panel/index.js"],
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { TEMPLATE_PART_POST_TYPE } from '../../store/constants';\nimport { store as editorStore } from '../../store';\n\nconst { BlockQuickNavigation } = unlock( blockEditorPrivateApis );\n\nfunction TemplatePartContentPanelInner() {\n\tconst blockTypes = useSelect( ( select ) => {\n\t\tconst { getBlockTypes } = select( blocksStore );\n\t\treturn getBlockTypes();\n\t}, [] );\n\tconst themeBlockNames = useMemo( () => {\n\t\treturn blockTypes\n\t\t\t.filter( ( blockType ) => {\n\t\t\t\treturn blockType.category === 'theme';\n\t\t\t} )\n\t\t\t.map( ( { name } ) => name );\n\t}, [ blockTypes ] );\n\tconst themeBlocks = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlocksByName } = select( blockEditorStore );\n\t\t\treturn getBlocksByName( themeBlockNames );\n\t\t},\n\t\t[ themeBlockNames ]\n\t);\n\tif ( themeBlocks.length === 0 ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<PanelBody title={ __( 'Content' ) }>\n\t\t\t<BlockQuickNavigation clientIds={ themeBlocks } />\n\t\t</PanelBody>\n\t);\n}\n\nexport default function TemplatePartContentPanel() {\n\tconst postType = useSelect( ( select ) => {\n\t\tconst { getCurrentPostType } = select( editorStore );\n\t\treturn getCurrentPostType();\n\t}, [] );\n\tif ( postType !== TEMPLATE_PART_POST_TYPE ) {\n\t\treturn null;\n\t}\n\n\treturn <TemplatePartContentPanelInner />;\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AA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