{
  "version": 3,
  "sources": ["../../../src/components/more-menu/manage-patterns-menu-item.js"],
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { addQueryArgs } from '@wordpress/url';\n\nfunction ManagePatternsMenuItem() {\n\tconst url = useSelect( ( select ) => {\n\t\tconst { canUser } = select( coreStore );\n\t\tconst defaultUrl = addQueryArgs( 'edit.php', {\n\t\t\tpost_type: 'wp_block',\n\t\t} );\n\t\tconst patternsUrl = addQueryArgs( 'site-editor.php', {\n\t\t\tp: '/pattern',\n\t\t} );\n\n\t\t// The site editor and templates both check whether the user has\n\t\t// edit_theme_options capabilities. We can leverage that here and not\n\t\t// display the manage patterns link if the user can't access it.\n\t\treturn canUser( 'create', {\n\t\t\tkind: 'postType',\n\t\t\tname: 'wp_template',\n\t\t} )\n\t\t\t? patternsUrl\n\t\t\t: defaultUrl;\n\t}, [] );\n\n\treturn (\n\t\t<MenuItem role=\"menuitem\" href={ url }>\n\t\t\t{ __( 'Manage patterns' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default ManagePatternsMenuItem;\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAyB;AACzB,uBAAmC;AACnC,kBAA0B;AAC1B,kBAAmB;AACnB,iBAA6B;AAwB3B;AAtBF,SAAS,yBAAyB;AACjC,QAAM,UAAM,uBAAW,CAAE,WAAY;AACpC,UAAM,EAAE,QAAQ,IAAI,OAAQ,iBAAAA,KAAU;AACtC,UAAM,iBAAa,yBAAc,YAAY;AAAA,MAC5C,WAAW;AAAA,IACZ,CAAE;AACF,UAAM,kBAAc,yBAAc,mBAAmB;AAAA,MACpD,GAAG;AAAA,IACJ,CAAE;AAKF,WAAO,QAAS,UAAU;AAAA,MACzB,MAAM;AAAA,MACN,MAAM;AAAA,IACP,CAAE,IACC,cACA;AAAA,EACJ,GAAG,CAAC,CAAE;AAEN,SACC,4CAAC,8BAAS,MAAK,YAAW,MAAO,KAC9B,8BAAI,iBAAkB,GACzB;AAEF;AAEA,IAAO,oCAAQ;",
  "names": ["coreStore"]
}
