@techdocs/cli 1.11.5-next.1 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/commands/generate/generate.cjs.js +32 -2
  3. package/dist/commands/generate/generate.cjs.js.map +1 -1
  4. package/dist/commands/index.cjs.js +9 -1
  5. package/dist/commands/index.cjs.js.map +1 -1
  6. package/dist/commands/publish/publish.cjs.js +47 -0
  7. package/dist/commands/publish/publish.cjs.js.map +1 -1
  8. package/dist/embedded-app/.config-schema.json +51 -46
  9. package/dist/embedded-app/index.html +1 -1
  10. package/dist/embedded-app/index.html.tmpl +1 -1
  11. package/dist/embedded-app/static/123.91ba1b809deb.chunk.js +2 -0
  12. package/dist/embedded-app/static/123.91ba1b809deb.chunk.js.map +1 -0
  13. package/dist/embedded-app/static/1659.a99e4eb674e0.chunk.js +2 -0
  14. package/dist/embedded-app/static/1659.a99e4eb674e0.chunk.js.map +1 -0
  15. package/dist/embedded-app/static/1749.99ba95728e00.chunk.js +2 -0
  16. package/dist/embedded-app/static/1749.99ba95728e00.chunk.js.map +1 -0
  17. package/dist/embedded-app/static/1994.7736057c2e9f.chunk.js +2 -0
  18. package/dist/embedded-app/static/1994.7736057c2e9f.chunk.js.map +1 -0
  19. package/dist/embedded-app/static/{2055.fd3ccf91ac47.chunk.js → 2055.d938e6121e5f.chunk.js} +4 -4
  20. package/dist/embedded-app/static/2055.d938e6121e5f.chunk.js.map +1 -0
  21. package/dist/embedded-app/static/{2295.e8be8ba6c18d.chunk.js → 2295.aaedbca4c1c5.chunk.js} +2 -2
  22. package/dist/embedded-app/static/2295.aaedbca4c1c5.chunk.js.map +1 -0
  23. package/dist/embedded-app/static/2360.806f2e1ab212.chunk.js +2 -0
  24. package/dist/embedded-app/static/2360.806f2e1ab212.chunk.js.map +1 -0
  25. package/dist/embedded-app/static/3554.78dd0c182f6c.chunk.js +2 -0
  26. package/dist/embedded-app/static/3554.78dd0c182f6c.chunk.js.map +1 -0
  27. package/dist/embedded-app/static/4587.d1220800a7d6.chunk.js +2 -0
  28. package/dist/embedded-app/static/4587.d1220800a7d6.chunk.js.map +1 -0
  29. package/dist/embedded-app/static/4591.d741c025cb8a.chunk.js +2 -0
  30. package/dist/embedded-app/static/4591.d741c025cb8a.chunk.js.map +1 -0
  31. package/dist/embedded-app/static/4609.b1c67dc7cac2.chunk.js +531 -0
  32. package/dist/embedded-app/static/4609.b1c67dc7cac2.chunk.js.map +1 -0
  33. package/dist/embedded-app/static/4648.cd5b8df48435.chunk.js +2 -0
  34. package/dist/embedded-app/static/4648.cd5b8df48435.chunk.js.map +1 -0
  35. package/dist/embedded-app/static/6138.f15d6245c80d.chunk.js +2 -0
  36. package/dist/embedded-app/static/6138.f15d6245c80d.chunk.js.map +1 -0
  37. package/dist/embedded-app/static/6206.3e7f13e11c59.chunk.js +2 -0
  38. package/dist/embedded-app/static/6206.3e7f13e11c59.chunk.js.map +1 -0
  39. package/dist/embedded-app/static/6949.beeb90ede97f.chunk.js +4 -0
  40. package/dist/embedded-app/static/6949.beeb90ede97f.chunk.js.map +1 -0
  41. package/dist/embedded-app/static/7203.8b3d94b34b16.chunk.js +2 -0
  42. package/dist/embedded-app/static/7203.8b3d94b34b16.chunk.js.map +1 -0
  43. package/dist/embedded-app/static/8877.ab3d98868650.chunk.js +2 -0
  44. package/dist/embedded-app/static/8877.ab3d98868650.chunk.js.map +1 -0
  45. package/dist/embedded-app/static/9050.bd63e0a33f06.chunk.js +2 -0
  46. package/dist/embedded-app/static/9050.bd63e0a33f06.chunk.js.map +1 -0
  47. package/dist/embedded-app/static/9230.422824f655e0.chunk.js +2 -0
  48. package/dist/embedded-app/static/9230.422824f655e0.chunk.js.map +1 -0
  49. package/dist/embedded-app/static/main.9b48363c4ffa.js +2 -0
  50. package/dist/embedded-app/static/main.9b48363c4ffa.js.map +1 -0
  51. package/dist/embedded-app/static/module-remix-run.32d1d7665115.js +2 -0
  52. package/dist/embedded-app/static/module-remix-run.32d1d7665115.js.map +1 -0
  53. package/dist/embedded-app/static/{runtime.c8854f4ed6f8.js → runtime.720cb48cd7ae.js} +2 -2
  54. package/dist/embedded-app/static/{runtime.c8854f4ed6f8.js.map → runtime.720cb48cd7ae.js.map} +1 -1
  55. package/dist/embedded-app/static/vendor.470d3e8ecef1.js +2 -0
  56. package/dist/embedded-app/static/vendor.470d3e8ecef1.js.map +1 -0
  57. package/dist/lib/etag.cjs.js +40 -0
  58. package/dist/lib/etag.cjs.js.map +1 -0
  59. package/dist/package.json.cjs.js +1 -1
  60. package/package.json +8 -7
  61. package/dist/embedded-app/static/123.449f4a83fd2b.chunk.js +0 -2
  62. package/dist/embedded-app/static/123.449f4a83fd2b.chunk.js.map +0 -1
  63. package/dist/embedded-app/static/1659.41bf35e59592.chunk.js +0 -2
  64. package/dist/embedded-app/static/1659.41bf35e59592.chunk.js.map +0 -1
  65. package/dist/embedded-app/static/1749.75c83d8a41f6.chunk.js +0 -2
  66. package/dist/embedded-app/static/1749.75c83d8a41f6.chunk.js.map +0 -1
  67. package/dist/embedded-app/static/1994.78042a47b6c6.chunk.js +0 -2
  68. package/dist/embedded-app/static/1994.78042a47b6c6.chunk.js.map +0 -1
  69. package/dist/embedded-app/static/2055.fd3ccf91ac47.chunk.js.map +0 -1
  70. package/dist/embedded-app/static/2295.e8be8ba6c18d.chunk.js.map +0 -1
  71. package/dist/embedded-app/static/2360.82e9c38bff17.chunk.js +0 -2
  72. package/dist/embedded-app/static/2360.82e9c38bff17.chunk.js.map +0 -1
  73. package/dist/embedded-app/static/3554.bb882f8e4aea.chunk.js +0 -2
  74. package/dist/embedded-app/static/3554.bb882f8e4aea.chunk.js.map +0 -1
  75. package/dist/embedded-app/static/4587.96f03715ec4f.chunk.js +0 -2
  76. package/dist/embedded-app/static/4587.96f03715ec4f.chunk.js.map +0 -1
  77. package/dist/embedded-app/static/4591.5563e3a7aea4.chunk.js +0 -2
  78. package/dist/embedded-app/static/4591.5563e3a7aea4.chunk.js.map +0 -1
  79. package/dist/embedded-app/static/4609.152f14ef4904.chunk.js +0 -531
  80. package/dist/embedded-app/static/4609.152f14ef4904.chunk.js.map +0 -1
  81. package/dist/embedded-app/static/4648.c047b78345c6.chunk.js +0 -2
  82. package/dist/embedded-app/static/4648.c047b78345c6.chunk.js.map +0 -1
  83. package/dist/embedded-app/static/6138.113ed7a1d8cd.chunk.js +0 -2
  84. package/dist/embedded-app/static/6138.113ed7a1d8cd.chunk.js.map +0 -1
  85. package/dist/embedded-app/static/6206.b2713857572e.chunk.js +0 -2
  86. package/dist/embedded-app/static/6206.b2713857572e.chunk.js.map +0 -1
  87. package/dist/embedded-app/static/6949.62c7fa0aab7f.chunk.js +0 -4
  88. package/dist/embedded-app/static/6949.62c7fa0aab7f.chunk.js.map +0 -1
  89. package/dist/embedded-app/static/7203.6e3ffa800885.chunk.js +0 -2
  90. package/dist/embedded-app/static/7203.6e3ffa800885.chunk.js.map +0 -1
  91. package/dist/embedded-app/static/8877.58093d2c2ba0.chunk.js +0 -2
  92. package/dist/embedded-app/static/8877.58093d2c2ba0.chunk.js.map +0 -1
  93. package/dist/embedded-app/static/9050.0c0d51ee0fd8.chunk.js +0 -2
  94. package/dist/embedded-app/static/9050.0c0d51ee0fd8.chunk.js.map +0 -1
  95. package/dist/embedded-app/static/9230.ba752de28896.chunk.js +0 -2
  96. package/dist/embedded-app/static/9230.ba752de28896.chunk.js.map +0 -1
  97. package/dist/embedded-app/static/main.82ddbc06e504.js +0 -2
  98. package/dist/embedded-app/static/main.82ddbc06e504.js.map +0 -1
  99. package/dist/embedded-app/static/module-remix-run.0c80eb31316a.js +0 -2
  100. package/dist/embedded-app/static/module-remix-run.0c80eb31316a.js.map +0 -1
  101. package/dist/embedded-app/static/vendor.3bc2778face5.js +0 -2
  102. package/dist/embedded-app/static/vendor.3bc2778face5.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static/2360.806f2e1ab212.chunk.js","sources":["webpack://techdocs-cli-embedded-app/../catalog-model/src/model/jsonSchema/getAjv.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/createCatalogModelLayer.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/jsonSchema/util.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/jsonSchema/validateMetaSchema.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/jsonSchema/zod.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/operations/declareAnnotation.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/operations/declareKind.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/jsonSchema/reduceKindSchema.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/jsonSchema/validateKindRootSchemaSemantics.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/operations/declareKindVersion.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/modelActions/addKindVersion.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/operations/declareLabel.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/operations/declareRelation.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/operations/removeAnnotation.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/operations/removeKind.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/operations/removeLabel.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/operations/removeTag.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/operations/declareTag.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/operations/updateAnnotation.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/operations/updateKind.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/operations/updateKindVersion.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/operations/updateLabel.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/operations/updateRelation.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/operations/updateTag.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/types.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/createCatalogModelLayerBuilder.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/modelActions/addKind.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/modelActions/updateKind.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/modelActions/removeKind.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/modelActions/addRelationPair.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/modelActions/updateRelationPair.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/modelActions/addAnnotation.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/modelActions/updateAnnotation.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/modelActions/removeAnnotation.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/modelActions/addLabel.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/modelActions/updateLabel.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/modelActions/removeLabel.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/modelActions/addTag.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/modelActions/updateTag.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/model/modelActions/removeTag.ts","webpack://techdocs-cli-embedded-app/../catalog-model/src/kinds/relations.ts","webpack://techdocs-cli-embedded-app/../core-components/src/components/DependencyGraph/types.ts","webpack://techdocs-cli-embedded-app/../core-components/src/components/FavoriteToggle/FavoriteToggle.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/layout/Breadcrumbs/Breadcrumbs.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/layout/Content/Content.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/layout/Header/Header.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/layout/HeaderLabel/HeaderLabel.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/layout/Page/Page.tsx","webpack://techdocs-cli-embedded-app/../core-plugin-api/src/routing/useRouteRefParams.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/ButtonLink/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/ButtonLink/ButtonLink.module.css?c85f","webpack://techdocs-cli-embedded-app/../ui/src/components/ButtonLink/ButtonLink.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Card/Card.module.css?7524","webpack://techdocs-cli-embedded-app/../ui/src/components/Card/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Card/Card.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Container/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Container/Container.module.css?2792","webpack://techdocs-cli-embedded-app/../ui/src/components/Container/Container.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Header/HeaderNav.module.css?6c03","webpack://techdocs-cli-embedded-app/../ui/src/components/Header/HeaderNavDefinition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Header/HeaderNavIndicators.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Header/HeaderNav.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Header/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Header/Header.module.css?58b2","webpack://techdocs-cli-embedded-app/../ui/src/components/Header/Header.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityRefLink/EntityRefLinks.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/utils/getEntityRelations.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/hooks/useStarredEntity.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/FavoriteEntity/FavoriteEntity.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/DependencyGraph/DependencyGraph.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/EntityKindIcon.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/AncestryPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/common.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/ColocatedPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/util.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/JsonPage.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/TagGroup/TagGroup.module.css?dc18","webpack://techdocs-cli-embedded-app/../ui/src/components/TagGroup/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/TagGroup/TagGroup.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/OverviewPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/components/YamlPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/InspectEntityDialog/InspectEntityDialog.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityLabels/EntityLabels.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityContextMenu/EntityContextMenu.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityHeader/EntityHeader.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityTabs/EntityTabsPanel.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityTabs/EntityTabsGroup.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityTabs/EntityTabsList.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityTabs/EntityTabs.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityLayout/entityLayoutRoutes.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityLayout/EntityLayout.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Avatar/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Avatar/Avatar.module.css?1f28","webpack://techdocs-cli-embedded-app/../ui/src/components/Avatar/Avatar.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Header/HeaderMetadataUsers.module.css?4740","webpack://techdocs-cli-embedded-app/../ui/src/components/Header/HeaderMetadataUsers.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityHeader/EntityHeaderBui.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityLayout/EntityLayoutBui.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/EntityTabs/useEntityTabs.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/alpha/components/CatalogEntityPage.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/CatalogEntityPage/useEntityFromUrl.ts"],"sourcesContent":["/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Ajv from 'ajv';\nimport ajvErrors from 'ajv-errors';\n\n/**\n * Gets a singleton instance of Ajv.\n */\nexport const getAjv = (() => {\n let instance: Ajv | undefined = undefined;\n\n return () => {\n if (!instance) {\n instance = new Ajv({\n allowUnionTypes: true,\n allErrors: true,\n validateSchema: true,\n });\n ajvErrors(instance);\n }\n return instance;\n };\n})();\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CatalogModelLayerBuilder,\n createCatalogModelLayerBuilder,\n} from './createCatalogModelLayerBuilder';\nimport { CatalogModelLayer } from './types';\n\n/**\n * Creates a catalog model layer using a builder pattern.\n *\n * @alpha\n * @remarks\n *\n * Plugins can create such catalog model layers to declare various\n * contributions to the overall catalog model, and registering them with the\n * catalog which then forms a complete picture out of them.\n */\nexport function createCatalogModelLayer(options: {\n /**\n * The unique ID of the model layer.\n *\n * @remarks\n * @example `example.com/MyCustomKind`\n *\n * This identifier is used for purposes of deduplication and tracking. It is\n * expected to be stable and descriptive. Prefer prefixing the ID with a\n * matching domain name. The backstage.io domain name is reserved for use by\n * the Backstage project itself.\n */\n layerId: string;\n builder: (model: CatalogModelLayerBuilder) => void;\n}): CatalogModelLayer {\n const b = createCatalogModelLayerBuilder({\n layerId: options.layerId,\n });\n options.builder(b);\n return b.build();\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { JsonObject } from '@backstage/types';\n\n/**\n * Asserts that the value is a JSON object shallowly.\n */\nexport function isJsonObject(value?: unknown): value is JsonObject {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * Asserts that the value is a JSON object recursively containing only JSON safe\n * values and no circular references.\n */\nexport function isJsonObjectDeep(value: unknown): value is JsonObject {\n if (!isJsonObject(value)) {\n return false;\n }\n const seen = new Set<unknown>([value]);\n return Object.values(value).every(v => isJsonValueDeep(v, seen));\n}\n\nfunction isJsonValueDeep(value: unknown, seen: Set<unknown>): boolean {\n if (\n value === null ||\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean'\n ) {\n return true;\n }\n if (typeof value !== 'object') {\n return false;\n }\n if (seen.has(value)) {\n return false;\n }\n seen.add(value);\n const result = Array.isArray(value)\n ? value.every(v => isJsonValueDeep(v, seen))\n : Object.values(value).every(v => isJsonValueDeep(v, seen));\n seen.delete(value);\n return result;\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type SchemaObject } from 'ajv';\nimport { isJsonObject } from './util';\nimport { InputError } from '@backstage/errors';\nimport { getAjv } from './getAjv';\n\n/**\n * Validates that the schema is valid according to known JSON Schema meta\n * schemas - does not perform any semantic validation beyond that.\n */\nexport function validateMetaSchema(schema: unknown): schema is SchemaObject {\n if (!isJsonObject(schema) || typeof schema.then === 'function') {\n throw new InputError('Invalid JSON schema: must be an object');\n }\n\n const ajv = getAjv();\n try {\n const result = ajv.validateSchema(schema);\n if (typeof result !== 'boolean') {\n // Should not happen; the function is expected to return a promise only\n // for async schemas, but since that's not enforced at the typescript\n // level we add the extra check just to be sure\n throw new InputError('Expected synchronous validation result');\n }\n } catch (error) {\n throw new InputError(`Invalid JSON schema: ${error}`);\n }\n\n // The full set of errors is typically too complex to report; just pick the\n // first one.\n const error = ajv.errors?.[0];\n if (error) {\n let message = error.message;\n if (Array.isArray(error?.params?.allowedValues)) {\n message += `, expected one of: ${error.params.allowedValues.join(', ')}`;\n }\n throw new InputError(\n `Invalid JSON schema, error at path ${error.instancePath}: ${message}`,\n );\n }\n\n return true;\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isError } from '@backstage/errors';\nimport { JsonObject } from '@backstage/types';\nimport { z } from 'zod/v3';\nimport { isJsonObjectDeep } from './util';\nimport { validateMetaSchema } from './validateMetaSchema';\n\nexport const jsonObjectSchema = z\n .record(z.string(), z.unknown())\n .refine((x): x is JsonObject => isJsonObjectDeep(x), {\n message: 'Invalid JSON schema',\n });\n\nexport const jsonSchemaSchema = z\n .record(z.string(), z.unknown())\n .superRefine((x, ctx): x is JsonObject => {\n try {\n return validateMetaSchema(x);\n } catch (error) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: isError(error) ? error.message : 'Invalid JSON schema',\n });\n return false;\n }\n });\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod/v3';\nimport { jsonSchemaSchema } from '../jsonSchema/zod';\n\n/**\n * Declare the existence of a well-known annotation and its properties.\n */\nexport const opDeclareAnnotationV1Schema = z.strictObject({\n op: z.literal('declareAnnotation.v1'),\n /**\n * The name of the annotation, e.g. \"backstage.io/techdocs-ref\".\n */\n name: z.string(),\n\n /**\n * The properties that apply to this annotation.\n */\n properties: z.strictObject({\n /**\n * A human-readable title that can be used for display purposes instead of\n * the technical name.\n */\n title: z.string().optional(),\n /**\n * A human-readable description of the annotation.\n */\n description: z.string(),\n /**\n * The JSON schema that values of this annotation must conform to.\n *\n * @remarks\n *\n * If not provided, the annotation is assumed to be a simple string with no\n * particular schema.\n */\n schema: z\n .strictObject({\n jsonSchema: jsonSchemaSchema,\n })\n .optional(),\n }),\n});\n\n/** {@inheritDoc opDeclareAnnotationV1Schema} */\nexport type OpDeclareAnnotationV1 = z.infer<typeof opDeclareAnnotationV1Schema>;\n\n/**\n * Creates a validated {@link OpDeclareAnnotationV1} operation instance.\n *\n * @remarks\n *\n * The `op` field is filled in automatically. The input is verified against the\n * schema before returning, ensuring that the resulting op is reliably valid.\n *\n * @param input - All fields of the op except `op` itself.\n * @returns A fully validated {@link OpDeclareAnnotationV1}.\n */\nexport function createDeclareAnnotationOp(\n input: Omit<OpDeclareAnnotationV1, 'op'> & { op?: never },\n): OpDeclareAnnotationV1 {\n return opDeclareAnnotationV1Schema.parse({\n ...input,\n op: 'declareAnnotation.v1',\n });\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod/v3';\n\n/**\n * Make a declaration about the properties of a certain kind.\n */\nexport const opDeclareKindV1Schema = z.strictObject({\n op: z.literal('declareKind.v1'),\n\n /**\n * The kind to declare, e.g. \"Component\".\n */\n kind: z.string(),\n /**\n * The apiVersion group of the kind, e.g. \"backstage.io\".\n */\n group: z.string(),\n\n /**\n * Properties that apply for this kind\n */\n properties: z.strictObject({\n /**\n * The singular form of the human-readable kind, e.g. \"component\".\n */\n singular: z.string(),\n /**\n * The plural form of the human-readable kind, e.g. \"components\".\n */\n plural: z.string(),\n /**\n * Short description of the kind.\n */\n description: z.string(),\n }),\n});\n\n/** {@inheritDoc opDeclareKindV1Schema} */\nexport type OpDeclareKindV1 = z.infer<typeof opDeclareKindV1Schema>;\n\n/**\n * Creates a validated {@link OpDeclareKindV1} operation instance.\n *\n * @remarks\n *\n * The `op` field is filled in automatically. The input is verified against the\n * schema before returning, ensuring that the resulting op is reliably valid.\n *\n * @param input - All fields of the op except `op` itself.\n * @returns A fully validated {@link OpDeclareKindV1}.\n */\nexport function createDeclareKindOp(\n input: Omit<OpDeclareKindV1, 'op'> & { op?: never },\n): OpDeclareKindV1 {\n return opDeclareKindV1Schema.parse({ ...input, op: 'declareKind.v1' });\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { JsonObject } from '@backstage/types';\nimport { z } from 'zod/v3';\nimport { CatalogModelKindRootSchema } from './validateKindRootSchemaSemantics';\n\n/**\n * The expected shape of the standard full kind schemas, which use an allOf\n * with a $ref to Entity and a second element with the kind-specific schema.\n */\nconst fullKindSchema = z\n .object({\n allOf: z.tuple([\n z.object({ $ref: z.literal('Entity') }),\n z\n .object({\n type: z.literal('object'),\n properties: z\n .object({\n apiVersion: z.record(z.string(), z.unknown()).optional(),\n kind: z.record(z.string(), z.unknown()).optional(),\n })\n .passthrough(),\n })\n .passthrough(),\n ]),\n })\n .passthrough();\n\n/**\n * Reduces a full kind JSON schema to the form expected by the catalog model\n * layer system. The full schemas use an allOf with a $ref to Entity and\n * kind/apiVersion constraints that are not needed in the reduced form.\n *\n * If the schema does not match the expected shape, it is returned unchanged.\n */\nexport function reduceKindSchema(\n schema: JsonObject,\n): CatalogModelKindRootSchema {\n const parsed = fullKindSchema.safeParse(schema);\n if (!parsed.success) {\n return schema as CatalogModelKindRootSchema;\n }\n\n const { allOf, ...rest } = parsed.data;\n const { type, properties: allProperties, ...kindRest } = allOf[1];\n const { apiVersion, kind, ...properties } = allProperties;\n\n return {\n ...rest,\n type,\n ...kindRest,\n properties,\n } as CatalogModelKindRootSchema;\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InputError } from '@backstage/errors';\nimport { JsonObject, JsonValue } from '@backstage/types';\nimport { isJsonObject, isJsonObjectDeep } from './util';\n\nconst FORBIDDEN_SCHEMA_ROOT_FIELDS = [\n 'kind',\n 'apiVersion',\n 'metadata',\n '$ref',\n] as const;\nconst FORBIDDEN_SCHEMA_STRUCTURAL_FIELDS = [\n 'allOf',\n 'oneOf',\n 'anyOf',\n 'if',\n 'else',\n 'then',\n 'not',\n '$ref',\n] as const;\n\n/**\n * When declaring the JSON schema model for a kind, this is the type that you\n * should abide by.\n *\n * @alpha\n * @remarks\n *\n * It forbids some patterns that would make the schema hard or impossible to\n * inspect / merge properly.\n */\nexport interface CatalogModelKindRootSchema extends JsonObject {\n type: 'object';\n\n // NOTE: These should match the FORBIDDEN_SCHEMA_STRUCTURAL_FIELDS list above\n allOf?: never;\n anyOf?: never;\n oneOf?: never;\n if?: never;\n then?: never;\n else?: never;\n not?: never;\n $ref?: never;\n\n properties?:\n | undefined\n | {\n // NOTE: These should match the FORBIDDEN_SCHEMA_ROOT_FIELDS list above\n kind?: never;\n apiVersion?: never;\n metadata?: never;\n $ref?: never;\n\n [key: string]:\n | undefined\n | {\n // NOTE: These should match the FORBIDDEN_SCHEMA_STRUCTURAL_FIELDS list above\n allOf?: never;\n anyOf?: never;\n oneOf?: never;\n if?: never;\n then?: never;\n else?: never;\n not?: never;\n $ref?: never;\n\n [key: string]: JsonValue | undefined;\n };\n };\n\n [key: string]: JsonValue | undefined;\n}\n\n/**\n * Validates that the semantics of a schema describing a kind follows semantic\n * rules.\n *\n * @remarks\n *\n * It's expected that the input is a valid JSON Schema, as in having been\n * validated by `validateMetaSchema` already.\n *\n * The schema must not try to explicitly declare certain readonly root fields,\n * and neither the root nor the top level keys of fields may use certain\n * structural keywords that makes the schema hard or impossible to inspect /\n * merge properly.\n *\n * @param schema - The schema to validate.\n */\nexport function validateKindRootSchemaSemantics(\n schema: unknown,\n): schema is CatalogModelKindRootSchema {\n if (!isJsonObjectDeep(schema)) {\n throw new InputError('Schema must be an object');\n }\n\n if (schema.type !== undefined && schema.type !== 'object') {\n throw new InputError('Schema root type must be \"object\"');\n }\n\n for (const field of FORBIDDEN_SCHEMA_STRUCTURAL_FIELDS) {\n if (field in schema) {\n throw new InputError(\n `Schema must not use \"${field}\" keyword in the root`,\n );\n }\n }\n\n const rootProperties = schema.properties;\n if (!isJsonObject(rootProperties)) {\n throw new InputError(\n 'Schema must have a \"properties\" field that is an object',\n );\n }\n\n for (const field of FORBIDDEN_SCHEMA_ROOT_FIELDS) {\n if (field in rootProperties) {\n throw new InputError(\n `Schema must not try to declare the reserved root field \"${field}\"`,\n );\n }\n }\n\n for (const [fieldName, fieldSchema] of Object.entries(rootProperties)) {\n if (!isJsonObject(fieldSchema)) {\n throw new InputError(\n `Schema for root field \"${fieldName}\" must be an object`,\n );\n }\n for (const field of FORBIDDEN_SCHEMA_STRUCTURAL_FIELDS) {\n if (field in fieldSchema) {\n throw new InputError(\n `Schema for root field \"${fieldName}\" must not use \"${field}\" keyword`,\n );\n }\n }\n }\n\n return true;\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod/v3';\nimport { jsonSchemaSchema } from '../jsonSchema/zod';\n\nconst relationFieldSchema = z.strictObject({\n /**\n * What field that shall be used to generate relations.\n *\n * @remarks\n *\n * The field value is expected to be a string or string array at runtime.\n */\n selector: z.strictObject({\n /**\n * A dot separated path on the common catalog form, e.g. `spec.owner`.\n */\n path: z.string(),\n }),\n /**\n * The relation type that this field generates, e.g. \"ownedBy\".\n */\n relation: z.string(),\n /**\n * If the given shorthand ref did not have a kind, use this kind as the\n * default. If no default kind is specified, the ref must contain a kind.\n */\n defaultKind: z.string().optional(),\n /**\n * If the given shorthand ref did not have a namespace, either inherit the\n * namespace of the entity itself, or choose the default namespace.\n */\n defaultNamespace: z.enum(['default', 'inherit']).optional(),\n /**\n * Only allow relations to be specified to the given kinds. This list must\n * include the default kind, if any. If no allowed kinds are specified,\n * all kinds are allowed.\n */\n allowedKinds: z.array(z.string()).optional(),\n});\n\n/**\n * Make a declaration about the version of a certain kind.\n */\nexport const opDeclareKindVersionV1Schema = z.strictObject({\n op: z.literal('declareKindVersion.v1'),\n\n /**\n * The kind that this version belongs to.\n */\n kind: z.string(),\n /**\n * The specific version name, e.g. \"v1alpha1\". This and the kind group form\n * the full apiVersion.\n */\n name: z.string(),\n /**\n * The spec type that this version applies to, if any.\n *\n * @remarks\n *\n * This can be used to make kinds whose spec effectively are discriminated\n * unions. If you don't specify this, the schema will apply to a spec that has\n * no type given at all, or to those where the type is not among the set of\n * any other known declared spec types.\n */\n specType: z.string().optional(),\n\n /**\n * The properties that apply to this version.\n */\n properties: z.strictObject({\n /**\n * A short description of this particular version (and type, where applicable).\n */\n description: z.string().optional(),\n\n /**\n * The fields that shall be used to generate relations, if any.\n */\n relationFields: z.array(relationFieldSchema).optional(),\n\n /**\n * The JSON schema of the version.\n */\n schema: z.strictObject({\n jsonSchema: jsonSchemaSchema,\n }),\n }),\n});\n\n/** {@inheritDoc opDeclareKindVersionV1Schema} */\nexport type OpDeclareKindVersionV1 = z.infer<\n typeof opDeclareKindVersionV1Schema\n>;\n\n/**\n * Creates a validated {@link OpDeclareKindVersionV1} operation instance.\n *\n * @remarks\n *\n * The `op` field is filled in automatically. The input is verified against the\n * schema before returning, ensuring that the resulting op is reliably valid.\n *\n * @param input - All fields of the op except `op` itself.\n * @returns A fully validated {@link OpDeclareKindVersionV1}.\n */\nexport function createDeclareKindVersionOp(\n input: Omit<OpDeclareKindVersionV1, 'op'> & { op?: never },\n): OpDeclareKindVersionV1 {\n return opDeclareKindVersionV1Schema.parse({\n ...input,\n op: 'declareKindVersion.v1',\n });\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { reduceKindSchema } from '../jsonSchema/reduceKindSchema';\nimport { validateKindRootSchemaSemantics } from '../jsonSchema/validateKindRootSchemaSemantics';\nimport { validateMetaSchema } from '../jsonSchema/validateMetaSchema';\nimport { CatalogModelOp } from '../operations';\nimport { createDeclareKindVersionOp } from '../operations/declareKindVersion';\nimport type { CatalogModelKindVersionDefinition } from './addKind';\n\n/**\n * The definition for adding one or more versions to an already-declared kind.\n *\n * @alpha\n */\nexport interface CatalogModelAddKindVersionDefinition {\n /**\n * The kind to add versions to, e.g. \"API\".\n */\n kind: string;\n\n /**\n * The versions to add.\n */\n versions: CatalogModelKindVersionDefinition[];\n}\n\nexport function opsFromCatalogModelAddKindVersion(\n definition: CatalogModelAddKindVersionDefinition,\n): CatalogModelOp[] {\n const ops: CatalogModelOp[] = [];\n\n for (const version of definition.versions) {\n const jsonSchema = reduceKindSchema(version.schema.jsonSchema);\n validateMetaSchema(jsonSchema);\n validateKindRootSchemaSemantics(jsonSchema);\n const names = Array.isArray(version.name) ? version.name : [version.name];\n for (const name of names) {\n const specTypes = version.specType\n ? [version.specType].flat()\n : [undefined];\n for (const specType of specTypes) {\n ops.push(\n createDeclareKindVersionOp({\n kind: definition.kind,\n name,\n specType: specType,\n properties: {\n description: version.description,\n relationFields: version.relationFields,\n schema: {\n jsonSchema: jsonSchema as any,\n },\n },\n }),\n );\n }\n }\n }\n\n return ops;\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod/v3';\nimport { jsonSchemaSchema } from '../jsonSchema/zod';\n\n/**\n * Declare the existence of a well-known label and its properties.\n */\nexport const opDeclareLabelV1Schema = z.strictObject({\n op: z.literal('declareLabel.v1'),\n /**\n * The name of the label, e.g. \"backstage.io/source-location\".\n */\n name: z.string(),\n\n /**\n * The properties that apply to this label.\n */\n properties: z.strictObject({\n /**\n * A human-readable title that can be used for display purposes instead of\n * the technical name.\n */\n title: z.string().optional(),\n /**\n * A human-readable description of the label.\n */\n description: z.string(),\n /**\n * The JSON schema that values of this label must conform to.\n *\n * @remarks\n *\n * If not provided, the label is assumed to be a simple string with no\n * particular schema.\n */\n schema: z\n .strictObject({\n jsonSchema: jsonSchemaSchema,\n })\n .optional(),\n }),\n});\n\n/** {@inheritDoc opDeclareLabelV1Schema} */\nexport type OpDeclareLabelV1 = z.infer<typeof opDeclareLabelV1Schema>;\n\n/**\n * Creates a validated {@link OpDeclareLabelV1} operation instance.\n *\n * @remarks\n *\n * The `op` field is filled in automatically. The input is verified against the\n * schema before returning, ensuring that the resulting op is reliably valid.\n *\n * @param input - All fields of the op except `op` itself.\n * @returns A fully validated {@link OpDeclareLabelV1}.\n */\nexport function createDeclareLabelOp(\n input: Omit<OpDeclareLabelV1, 'op'> & { op?: never },\n): OpDeclareLabelV1 {\n return opDeclareLabelV1Schema.parse({\n ...input,\n op: 'declareLabel.v1',\n });\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod/v3';\n\n/**\n * Make a declaration about the properties of a certain relation type between a\n * given pair of kinds.\n *\n * @remarks\n *\n * Note that this is NOT the same as declaring that a certain field is a\n * relation type - it declares that IF a relation was generated between two\n * kinds for any reason, then these properties apply to it.\n */\nexport const opDeclareRelationV1Schema = z.strictObject({\n op: z.literal('declareRelation.v1'),\n /**\n * The kind that this relation originates from, e.g. \"Component\".\n */\n fromKind: z.string(),\n /**\n * The technical type of the relation, e.g. \"ownedBy\".\n */\n type: z.string(),\n /**\n * The kind that this relation points to, e.g. \"Group\".\n */\n toKind: z.string(),\n\n /**\n * The properties that apply to this relation.\n */\n properties: z.strictObject({\n /**\n * The technical type of the reverse relation, e.g. \"ownerOf\".\n */\n reverseType: z.string(),\n /**\n * A human-readable title for the relation type, e.g. \"owned by\".\n */\n title: z.string(),\n /**\n * A human-readable description of the relation.\n */\n description: z.string(),\n }),\n});\n\n/** {@inheritDoc opDeclareRelationV1Schema} */\nexport type OpDeclareRelationV1 = z.infer<typeof opDeclareRelationV1Schema>;\n\n/**\n * Creates a validated {@link OpDeclareRelationV1} operation instance.\n *\n * @remarks\n *\n * The `op` field is filled in automatically. The input is verified against the\n * schema before returning, ensuring that the resulting op is reliably valid.\n *\n * @param input - All fields of the op except `op` itself.\n * @returns A fully validated {@link OpDeclareRelationV1}.\n */\nexport function createDeclareRelationOp(\n input: Omit<OpDeclareRelationV1, 'op'> & { op?: never },\n): OpDeclareRelationV1 {\n return opDeclareRelationV1Schema.parse({\n ...input,\n op: 'declareRelation.v1',\n });\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod/v3';\n\n/**\n * Remove an annotation from the model.\n */\nexport const opRemoveAnnotationV1Schema = z.strictObject({\n op: z.literal('removeAnnotation.v1'),\n\n /**\n * The name of the annotation to remove, e.g. \"backstage.io/techdocs-ref\".\n */\n name: z.string(),\n});\n\n/** {@inheritDoc opRemoveAnnotationV1Schema} */\nexport type OpRemoveAnnotationV1 = z.infer<typeof opRemoveAnnotationV1Schema>;\n\n/**\n * Creates a validated {@link OpRemoveAnnotationV1} operation instance.\n *\n * @remarks\n *\n * The `op` field is filled in automatically. The input is verified against the\n * schema before returning, ensuring that the resulting op is reliably valid.\n *\n * @param input - All fields of the op except `op` itself.\n * @returns A fully validated {@link OpRemoveAnnotationV1}.\n */\nexport function createRemoveAnnotationOp(\n input: Omit<OpRemoveAnnotationV1, 'op'> & { op?: never },\n): OpRemoveAnnotationV1 {\n return opRemoveAnnotationV1Schema.parse({\n ...input,\n op: 'removeAnnotation.v1',\n });\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod/v3';\n\n/**\n * Remove a kind entirely from the model.\n */\nexport const opRemoveKindV1Schema = z.strictObject({\n op: z.literal('removeKind.v1'),\n\n /**\n * The kind to remove, e.g. \"Component\".\n */\n kind: z.string(),\n});\n\n/** {@inheritDoc opRemoveKindV1Schema} */\nexport type OpRemoveKindV1 = z.infer<typeof opRemoveKindV1Schema>;\n\n/**\n * Creates a validated {@link OpRemoveKindV1} operation instance.\n *\n * @remarks\n *\n * The `op` field is filled in automatically. The input is verified against the\n * schema before returning, ensuring that the resulting op is reliably valid.\n *\n * @param input - All fields of the op except `op` itself.\n * @returns A fully validated {@link OpRemoveKindV1}.\n */\nexport function createRemoveKindOp(\n input: Omit<OpRemoveKindV1, 'op'> & { op?: never },\n): OpRemoveKindV1 {\n return opRemoveKindV1Schema.parse({ ...input, op: 'removeKind.v1' });\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod/v3';\n\n/**\n * Remove a label from the model.\n */\nexport const opRemoveLabelV1Schema = z.strictObject({\n op: z.literal('removeLabel.v1'),\n\n /**\n * The name of the label to remove, e.g. \"backstage.io/source-location\".\n */\n name: z.string(),\n});\n\n/** {@inheritDoc opRemoveLabelV1Schema} */\nexport type OpRemoveLabelV1 = z.infer<typeof opRemoveLabelV1Schema>;\n\n/**\n * Creates a validated {@link OpRemoveLabelV1} operation instance.\n *\n * @remarks\n *\n * The `op` field is filled in automatically. The input is verified against the\n * schema before returning, ensuring that the resulting op is reliably valid.\n *\n * @param input - All fields of the op except `op` itself.\n * @returns A fully validated {@link OpRemoveLabelV1}.\n */\nexport function createRemoveLabelOp(\n input: Omit<OpRemoveLabelV1, 'op'> & { op?: never },\n): OpRemoveLabelV1 {\n return opRemoveLabelV1Schema.parse({ ...input, op: 'removeLabel.v1' });\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod/v3';\n\n/**\n * Remove a tag from the model.\n */\nexport const opRemoveTagV1Schema = z.strictObject({\n op: z.literal('removeTag.v1'),\n\n /**\n * The name of the tag to remove, e.g. \"java\".\n */\n name: z.string(),\n});\n\n/** {@inheritDoc opRemoveTagV1Schema} */\nexport type OpRemoveTagV1 = z.infer<typeof opRemoveTagV1Schema>;\n\n/**\n * Creates a validated {@link OpRemoveTagV1} operation instance.\n *\n * @remarks\n *\n * The `op` field is filled in automatically. The input is verified against the\n * schema before returning, ensuring that the resulting op is reliably valid.\n *\n * @param input - All fields of the op except `op` itself.\n * @returns A fully validated {@link OpRemoveTagV1}.\n */\nexport function createRemoveTagOp(\n input: Omit<OpRemoveTagV1, 'op'> & { op?: never },\n): OpRemoveTagV1 {\n return opRemoveTagV1Schema.parse({ ...input, op: 'removeTag.v1' });\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod/v3';\n\n/**\n * Declare the existence of a well-known tag and its properties.\n */\nexport const opDeclareTagV1Schema = z.strictObject({\n op: z.literal('declareTag.v1'),\n /**\n * The name of the tag, e.g. \"java\".\n */\n name: z.string(),\n\n /**\n * The properties that apply to this tag.\n */\n properties: z.strictObject({\n /**\n * A human-readable title that can be used for display purposes instead of\n * the technical name.\n */\n title: z.string().optional(),\n /**\n * A human-readable description of the tag.\n */\n description: z.string(),\n }),\n});\n\n/** {@inheritDoc opDeclareTagV1Schema} */\nexport type OpDeclareTagV1 = z.infer<typeof opDeclareTagV1Schema>;\n\n/**\n * Creates a validated {@link OpDeclareTagV1} operation instance.\n *\n * @remarks\n *\n * The `op` field is filled in automatically. The input is verified against the\n * schema before returning, ensuring that the resulting op is reliably valid.\n *\n * @param input - All fields of the op except `op` itself.\n * @returns A fully validated {@link OpDeclareTagV1}.\n */\nexport function createDeclareTagOp(\n input: Omit<OpDeclareTagV1, 'op'> & { op?: never },\n): OpDeclareTagV1 {\n return opDeclareTagV1Schema.parse({\n ...input,\n op: 'declareTag.v1',\n });\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod/v3';\nimport { jsonSchemaSchema } from '../jsonSchema/zod';\n\n/**\n * Update the properties of an existing annotation.\n */\nexport const opUpdateAnnotationV1Schema = z.strictObject({\n op: z.literal('updateAnnotation.v1'),\n\n /**\n * The name of the annotation, e.g. \"backstage.io/techdocs-ref\".\n */\n name: z.string(),\n\n /**\n * The properties that apply to this annotation.\n */\n properties: z.strictObject({\n /**\n * A human-readable title that can be used for display purposes instead of\n * the technical name.\n */\n title: z.string().optional(),\n /**\n * A human-readable description of the annotation.\n */\n description: z.string().optional(),\n /**\n * The JSON schema that values of this annotation must conform to.\n *\n * @remarks\n *\n * If not provided, the annotation is assumed to be a simple string with no\n * particular schema.\n */\n schema: z\n .strictObject({\n jsonSchema: jsonSchemaSchema,\n })\n .optional(),\n }),\n});\n\n/** {@inheritDoc opUpdateAnnotationV1Schema} */\nexport type OpUpdateAnnotationV1 = z.infer<typeof opUpdateAnnotationV1Schema>;\n\n/**\n * Creates a validated {@link OpUpdateAnnotationV1} operation instance.\n *\n * @remarks\n *\n * The `op` field is filled in automatically. The input is verified against the\n * schema before returning, ensuring that the resulting op is reliably valid.\n *\n * @param input - All fields of the op except `op` itself.\n * @returns A fully validated {@link OpUpdateAnnotationV1}.\n */\nexport function createUpdateAnnotationOp(\n input: Omit<OpUpdateAnnotationV1, 'op'> & { op?: never },\n): OpUpdateAnnotationV1 {\n return opUpdateAnnotationV1Schema.parse({\n ...input,\n op: 'updateAnnotation.v1',\n });\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod/v3';\n\n/**\n * Make a declaration about the properties of a certain kind.\n */\nexport const opUpdateKindV1Schema = z.strictObject({\n op: z.literal('updateKind.v1'),\n\n /**\n * The kind to update, e.g. \"Component\".\n */\n kind: z.string(),\n\n /**\n * Updated properties that apply for this kind\n */\n properties: z.strictObject({\n /**\n * The singular form of the human-readable kind, e.g. \"component\".\n */\n singular: z.string().optional(),\n /**\n * The plural form of the human-readable kind, e.g. \"components\".\n */\n plural: z.string().optional(),\n /**\n * Short description of the kind.\n */\n description: z.string().optional(),\n }),\n});\n\n/** {@inheritDoc opUpdateKindV1Schema} */\nexport type OpUpdateKindV1 = z.infer<typeof opUpdateKindV1Schema>;\n\n/**\n * Creates a validated {@link OpUpdateKindV1} operation instance.\n *\n * @remarks\n *\n * The `op` field is filled in automatically. The input is verified against the\n * schema before returning, ensuring that the resulting op is reliably valid.\n *\n * @param input - All fields of the op except `op` itself.\n * @returns A fully validated {@link OpUpdateKindV1}.\n */\nexport function createUpdateKindOp(\n input: Omit<OpUpdateKindV1, 'op'> & { op?: never },\n): OpUpdateKindV1 {\n return opUpdateKindV1Schema.parse({ ...input, op: 'updateKind.v1' });\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod/v3';\nimport { jsonObjectSchema } from '../jsonSchema/zod';\n\nconst relationFieldSchema = z.strictObject({\n /**\n * What field that shall be used to generate relations.\n *\n * @remarks\n *\n * The field value is expected to be a string or string array at runtime.\n */\n selector: z.strictObject({\n /**\n * A dot separated path on the common catalog form, e.g. `spec.owner`.\n */\n path: z.string(),\n }),\n /**\n * The relation type that this field generates, e.g. \"ownedBy\".\n */\n relation: z.string(),\n /**\n * If the given shorthand ref did not have a kind, use this kind as the\n * default. If no default kind is specified, the ref must contain a kind.\n */\n defaultKind: z.string().optional(),\n /**\n * If the given shorthand ref did not have a namespace, either inherit the\n * namespace of the entity itself, or choose the default namespace.\n */\n defaultNamespace: z.enum(['default', 'inherit']).optional(),\n /**\n * Only allow relations to be specified to the given kinds. This list must\n * include the default kind, if any. If no allowed kinds are specified,\n * all kinds are allowed.\n */\n allowedKinds: z.array(z.string()).optional(),\n});\n\n/**\n * Make an update to a pre-existing version of a certain kind.\n */\nexport const opUpdateKindVersionV1Schema = z.strictObject({\n op: z.literal('updateKindVersion.v1'),\n\n /**\n * The kind that this version belongs to.\n */\n kind: z.string(),\n /**\n * The specific version name, e.g. \"v1alpha1\". This and the kind group form\n * the full apiVersion.\n */\n name: z.string(),\n /**\n * The spec type that this version applies to, if any.\n *\n * @remarks\n *\n * This can be used to make kinds whose spec effectively are discriminated\n * unions. If you don't specify this, the schema will apply to a spec that has\n * no type given at all, or to those where the type is not among the set of\n * any other known declared spec types.\n */\n specType: z.string().optional(),\n\n /**\n * The properties that apply to this version update.\n */\n properties: z.strictObject({\n /**\n * A short description of this particular version (and type, where\n * applicable). Specify this if you want to override the default value.\n */\n description: z.string().optional(),\n\n /**\n * The fields that shall be used to generate relations, if any. Specify this\n * if you want to override the default value.\n */\n relationFields: z.array(relationFieldSchema).optional(),\n\n /**\n * The JSON schema of the version. Specify this if you want to override the\n * default value.\n *\n * @remarks\n *\n * This schema gets deep merged with the default one for this version. It\n * can therefore be used for both amending and changing existing fields.\n * Null-valued object fields delete inherited fields. Validation of the\n * resulting JSON schema takes place during model compilation.\n */\n schema: z\n .strictObject({\n jsonSchema: jsonObjectSchema,\n })\n .optional(),\n }),\n});\n\n/** {@inheritDoc opUpdateKindVersionV1Schema} */\nexport type OpUpdateKindVersionV1 = z.infer<typeof opUpdateKindVersionV1Schema>;\n\n/**\n * Creates a validated {@link OpUpdateKindVersionV1} operation instance.\n *\n * @remarks\n *\n * The `op` field is filled in automatically. The input is verified against the\n * schema before returning, ensuring that the resulting op is reliably valid.\n *\n * @param input - All fields of the op except `op` itself.\n * @returns A fully validated {@link OpUpdateKindVersionV1}.\n */\nexport function createUpdateKindVersionOp(\n input: Omit<OpUpdateKindVersionV1, 'op'> & { op?: never },\n): OpUpdateKindVersionV1 {\n return opUpdateKindVersionV1Schema.parse({\n ...input,\n op: 'updateKindVersion.v1',\n });\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod/v3';\nimport { jsonSchemaSchema } from '../jsonSchema/zod';\n\n/**\n * Update the properties of an existing label.\n */\nexport const opUpdateLabelV1Schema = z.strictObject({\n op: z.literal('updateLabel.v1'),\n\n /**\n * The name of the label, e.g. \"backstage.io/source-location\".\n */\n name: z.string(),\n\n /**\n * The properties that apply to this label.\n */\n properties: z.strictObject({\n /**\n * A human-readable title that can be used for display purposes instead of\n * the technical name.\n */\n title: z.string().optional(),\n /**\n * A human-readable description of the label.\n */\n description: z.string().optional(),\n /**\n * The JSON schema that values of this label must conform to.\n *\n * @remarks\n *\n * If not provided, the label is assumed to be a simple string with no\n * particular schema.\n */\n schema: z\n .strictObject({\n jsonSchema: jsonSchemaSchema,\n })\n .optional(),\n }),\n});\n\n/** {@inheritDoc opUpdateLabelV1Schema} */\nexport type OpUpdateLabelV1 = z.infer<typeof opUpdateLabelV1Schema>;\n\n/**\n * Creates a validated {@link OpUpdateLabelV1} operation instance.\n *\n * @remarks\n *\n * The `op` field is filled in automatically. The input is verified against the\n * schema before returning, ensuring that the resulting op is reliably valid.\n *\n * @param input - All fields of the op except `op` itself.\n * @returns A fully validated {@link OpUpdateLabelV1}.\n */\nexport function createUpdateLabelOp(\n input: Omit<OpUpdateLabelV1, 'op'> & { op?: never },\n): OpUpdateLabelV1 {\n return opUpdateLabelV1Schema.parse({\n ...input,\n op: 'updateLabel.v1',\n });\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod/v3';\n\n/**\n * Update the properties of a certain relation type between a given pair of\n * kinds.\n *\n * @remarks\n *\n * Note that this is NOT the same as updating the properties of a certain field\n * that is a relation type - it updates the properties of a relation that was\n * generated between two kinds for any reason.\n */\nexport const opUpdateRelationV1Schema = z.strictObject({\n op: z.literal('updateRelation.v1'),\n\n /**\n * The kind that this relation originates from, e.g. \"Component\".\n */\n fromKind: z.string(),\n /**\n * The technical type of the relation, e.g. \"ownedBy\".\n */\n type: z.string(),\n /**\n * The kind that this relation points to, e.g. \"Group\".\n */\n toKind: z.string(),\n\n /**\n * The properties that apply to this relation.\n */\n properties: z.strictObject({\n /**\n * The technical type of the reverse relation, e.g. \"ownerOf\".\n */\n reverseType: z.string().optional(),\n /**\n * A human-readable title for the currently declared reverse relation.\n */\n reverseTitle: z.string().optional(),\n /**\n * A human-readable title for the relation type, e.g. \"owned by\".\n */\n title: z.string().optional(),\n /**\n * A human-readable description of the relation.\n */\n description: z.string().optional(),\n }),\n});\n\n/** {@inheritDoc opUpdateRelationV1Schema} */\nexport type OpUpdateRelationV1 = z.infer<typeof opUpdateRelationV1Schema>;\n\n/**\n * Creates a validated {@link OpUpdateRelationV1} operation instance.\n *\n * @remarks\n *\n * The `op` field is filled in automatically. The input is verified against the\n * schema before returning, ensuring that the resulting op is reliably valid.\n *\n * @param input - All fields of the op except `op` itself.\n * @returns A fully validated {@link OpUpdateRelationV1}.\n */\nexport function createUpdateRelationOp(\n input: Omit<OpUpdateRelationV1, 'op'> & { op?: never },\n): OpUpdateRelationV1 {\n return opUpdateRelationV1Schema.parse({\n ...input,\n op: 'updateRelation.v1',\n });\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { z } from 'zod/v3';\n\n/**\n * Update the properties of an existing tag.\n */\nexport const opUpdateTagV1Schema = z.strictObject({\n op: z.literal('updateTag.v1'),\n\n /**\n * The name of the tag, e.g. \"java\".\n */\n name: z.string(),\n\n /**\n * The properties that apply to this tag.\n */\n properties: z.strictObject({\n /**\n * A human-readable title that can be used for display purposes instead of\n * the technical name.\n */\n title: z.string().optional(),\n /**\n * A human-readable description of the tag.\n */\n description: z.string().optional(),\n }),\n});\n\n/** {@inheritDoc opUpdateTagV1Schema} */\nexport type OpUpdateTagV1 = z.infer<typeof opUpdateTagV1Schema>;\n\n/**\n * Creates a validated {@link OpUpdateTagV1} operation instance.\n *\n * @remarks\n *\n * The `op` field is filled in automatically. The input is verified against the\n * schema before returning, ensuring that the resulting op is reliably valid.\n *\n * @param input - All fields of the op except `op` itself.\n * @returns A fully validated {@link OpUpdateTagV1}.\n */\nexport function createUpdateTagOp(\n input: Omit<OpUpdateTagV1, 'op'> & { op?: never },\n): OpUpdateTagV1 {\n return opUpdateTagV1Schema.parse({ ...input, op: 'updateTag.v1' });\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OpaqueType } from '@internal/opaque';\nimport { CatalogModelOp } from './operations';\nimport { JsonObject } from '@backstage/types';\n\n// #region CatalogModelLayer\n\n/**\n * An opaque type that represents a set of catalog model layers.\n *\n * @alpha\n */\nexport interface CatalogModelLayer {\n readonly $$type: '@backstage/CatalogModelLayer';\n /**\n * The unique ID of the model layer.\n *\n * @remarks\n * @example `catalog.backstage.io/kind-api`\n *\n * This identifier is used for purposes of deduplication and tracking. It is\n * expected to be stable and descriptive. Prefer prefixing the ID with a\n * matching domain name. The backstage.io domain name is reserved for use by\n * the Backstage project itself.\n */\n readonly layerId: string;\n}\n\n/**\n * The opaque type that represents a catalog model layer.\n *\n * @internal\n * @remarks\n *\n * Model layers are essentially an array of operations. Several such model\n * layers are merged together to form a final outcome.\n */\nexport const OpaqueCatalogModelLayer = OpaqueType.create<{\n public: CatalogModelLayer;\n versions: {\n readonly version: 'v1';\n readonly layerId: string;\n readonly ops: Array<CatalogModelOp>;\n };\n}>({\n type: '@backstage/CatalogModelLayer',\n versions: ['v1'],\n});\n\n// #endregion\n\n// #region CatalogModel\n\n/**\n * A compiled catalog model.\n *\n * @alpha\n */\nexport interface CatalogModel {\n /**\n * Lists all kinds in the model.\n */\n listKinds(): CatalogModelKindSummary[];\n\n /**\n * Lists all relations in the model.\n */\n listRelations(): CatalogModelRelationSummary[];\n\n /**\n * Returns summaries of the shared metadata fields in the model, including\n * all declared annotations, labels, and tags.\n */\n getMetadata(): {\n annotations: CatalogModelAnnotationSummary[];\n labels: CatalogModelLabelSummary[];\n tags: CatalogModelTagSummary[];\n };\n\n /**\n * Look up a kind in the model.\n *\n * @returns The kind if found, or `undefined` if no matching kind exists.\n * @throws TypeError if the kind exists in the model, but not for this apiVersion or type.\n */\n getKind(options: {\n kind: string;\n apiVersion: string;\n spec?: { type?: string };\n }): CatalogModelKind | undefined;\n\n /**\n * Look up all relations that originate from a given kind.\n *\n * @param kind - The kind name, e.g. \"Component\".\n * @returns The relations originating from the kind, or `undefined` if the\n * kind is not known.\n */\n getRelations(options: { kind: string }): CatalogModelRelation[] | undefined;\n}\n\n// #endregion\n\n// #region CatalogModelKind\n\n/**\n * A compiled catalog model kind.\n *\n * @alpha\n */\nexport interface CatalogModelKind {\n /**\n * A human-readable description of the kind.\n */\n description: string;\n\n /**\n * The API version(s) of the kind that this schema applies to, e.g.\n * \"backstage.io/v1alpha1\".\n */\n apiVersions: string[];\n\n /**\n * The names used for this kind.\n */\n names: {\n /**\n * The name of the kind with proper casing, e.g. \"Component\".\n */\n kind: string;\n\n /**\n * The singular form of the kind name, e.g. \"component\".\n */\n singular: string;\n\n /**\n * The plural form of the kind name, e.g. \"components\".\n */\n plural: string;\n };\n\n /**\n * The relation fields declared for this kind, with full dot-separated paths\n * into the entity (e.g. \"spec.owner\").\n */\n relationFields: Array<{\n /**\n * The full dot-separated path to the field in the entity, e.g. \"spec.owner\".\n */\n path: string;\n /**\n * The relation type that this field generates, e.g. \"ownedBy\".\n */\n relation: string;\n /**\n * The default kind for parsing shorthand entity refs.\n */\n defaultKind?: string;\n /**\n * The default namespace for parsing shorthand entity refs.\n */\n defaultNamespace?: 'inherit' | 'default';\n /**\n * The kinds that are allowed as targets for this relation field.\n */\n allowedKinds?: string[];\n }>;\n\n /**\n * The JSON schema of the kind.\n *\n * @remarks\n *\n * This can be used for validation of entities. Note that it is up to the\n * caller to ensure that the kind and apiVersion match what you are validating\n * against.\n */\n jsonSchema: JsonObject;\n}\n\n// #endregion\n\n// #region CatalogModelKindSummary\n\n/**\n * A summary of a catalog model kind, without version-specific details such as\n * schemas and relation fields.\n *\n * @alpha\n */\nexport interface CatalogModelKindSummary {\n /**\n * A human-readable description of the kind.\n */\n description: string;\n\n /**\n * The names used for this kind.\n */\n names: {\n /**\n * The name of the kind with proper casing, e.g. \"Component\".\n */\n kind: string;\n\n /**\n * The singular form of the kind name, e.g. \"component\".\n */\n singular: string;\n\n /**\n * The plural form of the kind name, e.g. \"components\".\n */\n plural: string;\n };\n\n /**\n * The available versions and spec types for this kind.\n *\n * @remarks\n *\n * Each entry represents a unique apiVersion/specType combination that can be\n * passed to {@link CatalogModel.getKind} to retrieve the full kind details.\n */\n versions: Array<{\n /**\n * The API version, e.g. \"backstage.io/v1alpha1\".\n */\n apiVersion: string;\n /**\n * The spec type, if any, e.g. \"service\". Undefined means the default\n * (untyped) version.\n */\n specType?: string;\n }>;\n}\n\n// #endregion\n\n// #region CatalogModelRelation\n\n/**\n * A compiled catalog model relation.\n *\n * @alpha\n */\nexport interface CatalogModelRelation {\n /**\n * The kinds that this relation can originate from.\n */\n fromKind: string[];\n /**\n * The kinds that this relation can point to.\n */\n toKind: string[];\n /**\n * A human-readable description of the relation.\n */\n description: string;\n /**\n * The forward direction of this relation.\n */\n forward: {\n type: string;\n title: string;\n };\n /**\n * The reverse direction of this relation.\n */\n reverse: {\n type: string;\n title: string;\n };\n}\n\n// #endregion\n\n// #region CatalogModelAnnotationSummary\n\n/**\n * A summary of a catalog model annotation.\n *\n * @alpha\n */\nexport interface CatalogModelAnnotationSummary {\n /**\n * The annotation key, e.g. \"backstage.io/managed-by-location\".\n */\n name: string;\n /**\n * A short human-readable title for the annotation.\n */\n title?: string;\n /**\n * A human-readable description of the annotation.\n */\n description: string;\n}\n\n// #endregion\n\n// #region CatalogModelLabelSummary\n\n/**\n * A summary of a catalog model label.\n *\n * @alpha\n */\nexport interface CatalogModelLabelSummary {\n /**\n * The label key, e.g. \"backstage.io/orphan\".\n */\n name: string;\n /**\n * A short human-readable title for the label.\n */\n title?: string;\n /**\n * A human-readable description of the label.\n */\n description: string;\n}\n\n// #endregion\n\n// #region CatalogModelTagSummary\n\n/**\n * A summary of a catalog model tag.\n *\n * @alpha\n */\nexport interface CatalogModelTagSummary {\n /**\n * The tag value, e.g. \"java\".\n */\n name: string;\n /**\n * A short human-readable title for the tag.\n */\n title?: string;\n /**\n * A human-readable description of the tag.\n */\n description: string;\n}\n\n// #endregion\n\n// #region CatalogModelRelationSummary\n\n/**\n * A summary of a catalog model relation.\n *\n * @alpha\n */\nexport interface CatalogModelRelationSummary {\n /**\n * The kinds that this relation can originate from.\n */\n fromKind: string[];\n /**\n * The kinds that this relation can point to.\n */\n toKind: string[];\n /**\n * A human-readable description of the relation.\n */\n description: string;\n /**\n * The forward direction of this relation.\n */\n forward: {\n type: string;\n title: string;\n };\n /**\n * The reverse direction of this relation.\n */\n reverse: {\n type: string;\n title: string;\n };\n}\n\n// #endregion\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n type CatalogModelAnnotationDefinition,\n opsFromCatalogModelAnnotation,\n} from './modelActions/addAnnotation';\nimport {\n type CatalogModelKindDefinition,\n opsFromCatalogModelKind,\n} from './modelActions/addKind';\nimport {\n type CatalogModelAddKindVersionDefinition,\n opsFromCatalogModelAddKindVersion,\n} from './modelActions/addKindVersion';\nimport {\n type CatalogModelLabelDefinition,\n opsFromCatalogModelLabel,\n} from './modelActions/addLabel';\nimport {\n type CatalogModelRelationPairDefinition,\n opsFromCatalogModelRelationPair,\n} from './modelActions/addRelationPair';\nimport {\n type CatalogModelRemoveAnnotationDefinition,\n opsFromCatalogModelRemoveAnnotation,\n} from './modelActions/removeAnnotation';\nimport {\n type CatalogModelRemoveKindDefinition,\n opsFromCatalogModelRemoveKind,\n} from './modelActions/removeKind';\nimport {\n type CatalogModelRemoveLabelDefinition,\n opsFromCatalogModelRemoveLabel,\n} from './modelActions/removeLabel';\nimport {\n type CatalogModelRemoveTagDefinition,\n opsFromCatalogModelRemoveTag,\n} from './modelActions/removeTag';\nimport {\n type CatalogModelTagDefinition,\n opsFromCatalogModelTag,\n} from './modelActions/addTag';\nimport {\n type CatalogModelUpdateAnnotationDefinition,\n opsFromCatalogModelUpdateAnnotation,\n} from './modelActions/updateAnnotation';\nimport {\n CatalogModelUpdateKindDefinition,\n opsFromCatalogModelUpdateKind,\n} from './modelActions/updateKind';\nimport {\n type CatalogModelUpdateLabelDefinition,\n opsFromCatalogModelUpdateLabel,\n} from './modelActions/updateLabel';\nimport {\n CatalogModelUpdateRelationPairDefinition,\n opsFromCatalogModelUpdateRelationPair,\n} from './modelActions/updateRelationPair';\nimport {\n type CatalogModelUpdateTagDefinition,\n opsFromCatalogModelUpdateTag,\n} from './modelActions/updateTag';\nimport { CatalogModelOp } from './operations';\nimport { CatalogModelLayer, OpaqueCatalogModelLayer } from './types';\n\n/**\n * A builder for catalog model layers.\n *\n * @alpha\n *\n * Plugins can use this builder to declare various contributions to the overall\n * catalog model, and registering the outcome with the catalog which then forms\n * a complete picture out of them.\n */\nexport interface CatalogModelLayerBuilder {\n /**\n * Adds a new kind to the model.\n */\n addKind(kind: CatalogModelKindDefinition): void;\n /**\n * Adds one or more versions to an already-declared kind.\n */\n addKindVersion(definition: CatalogModelAddKindVersionDefinition): void;\n /**\n * Updates an existing kind in the model.\n */\n updateKind(kind: CatalogModelUpdateKindDefinition): void;\n /**\n * Removes a kind entirely from the model.\n */\n removeKind(kind: CatalogModelRemoveKindDefinition): void;\n\n /**\n * Adds a new relation pair to the model.\n */\n addRelationPair(relation: CatalogModelRelationPairDefinition): void;\n /**\n * Updates an existing relation pair in the model.\n */\n updateRelationPair(relation: CatalogModelUpdateRelationPairDefinition): void;\n\n /**\n * Adds a new annotation to the model.\n */\n addAnnotation(annotation: CatalogModelAnnotationDefinition): void;\n /**\n * Updates an existing annotation in the model.\n */\n updateAnnotation(annotation: CatalogModelUpdateAnnotationDefinition): void;\n /**\n * Removes an annotation from the model.\n */\n removeAnnotation(annotation: CatalogModelRemoveAnnotationDefinition): void;\n\n /**\n * Adds a new label to the model.\n */\n addLabel(label: CatalogModelLabelDefinition): void;\n /**\n * Updates an existing label in the model.\n */\n updateLabel(label: CatalogModelUpdateLabelDefinition): void;\n /**\n * Removes a label from the model.\n */\n removeLabel(label: CatalogModelRemoveLabelDefinition): void;\n\n /**\n * Adds a new tag to the model.\n */\n addTag(tag: CatalogModelTagDefinition): void;\n /**\n * Updates an existing tag in the model.\n */\n updateTag(tag: CatalogModelUpdateTagDefinition): void;\n /**\n * Removes a tag from the model.\n */\n removeTag(tag: CatalogModelRemoveTagDefinition): void;\n\n /**\n * Imports all operations from another catalog model layer into this one.\n */\n import(layer: CatalogModelLayer): void;\n}\n\n/**\n * The default implementation of the catalog model layer builder.\n */\nexport class DefaultCatalogModelLayerBuilder\n implements CatalogModelLayerBuilder\n{\n readonly #layerId: string;\n readonly #ops: CatalogModelOp[];\n\n constructor(options: { layerId: string }) {\n this.#layerId = options.layerId;\n this.#ops = [];\n }\n\n addKind(kind: CatalogModelKindDefinition): void {\n const ops = opsFromCatalogModelKind(kind);\n this.#ops.push(...ops);\n }\n\n addKindVersion(definition: CatalogModelAddKindVersionDefinition): void {\n const ops = opsFromCatalogModelAddKindVersion(definition);\n this.#ops.push(...ops);\n }\n\n updateKind(kind: CatalogModelUpdateKindDefinition): void {\n const ops = opsFromCatalogModelUpdateKind(kind);\n this.#ops.push(...ops);\n }\n\n removeKind(kind: CatalogModelRemoveKindDefinition): void {\n const ops = opsFromCatalogModelRemoveKind(kind);\n this.#ops.push(...ops);\n }\n\n addRelationPair(relation: CatalogModelRelationPairDefinition): void {\n const ops = opsFromCatalogModelRelationPair(relation);\n this.#ops.push(...ops);\n }\n\n updateRelationPair(relation: CatalogModelUpdateRelationPairDefinition): void {\n const ops = opsFromCatalogModelUpdateRelationPair(relation);\n this.#ops.push(...ops);\n }\n\n addAnnotation(annotation: CatalogModelAnnotationDefinition): void {\n const ops = opsFromCatalogModelAnnotation(annotation);\n this.#ops.push(...ops);\n }\n\n updateAnnotation(annotation: CatalogModelUpdateAnnotationDefinition): void {\n const ops = opsFromCatalogModelUpdateAnnotation(annotation);\n this.#ops.push(...ops);\n }\n\n removeAnnotation(annotation: CatalogModelRemoveAnnotationDefinition): void {\n const ops = opsFromCatalogModelRemoveAnnotation(annotation);\n this.#ops.push(...ops);\n }\n\n addLabel(label: CatalogModelLabelDefinition): void {\n const ops = opsFromCatalogModelLabel(label);\n this.#ops.push(...ops);\n }\n\n updateLabel(label: CatalogModelUpdateLabelDefinition): void {\n const ops = opsFromCatalogModelUpdateLabel(label);\n this.#ops.push(...ops);\n }\n\n removeLabel(label: CatalogModelRemoveLabelDefinition): void {\n const ops = opsFromCatalogModelRemoveLabel(label);\n this.#ops.push(...ops);\n }\n\n addTag(tag: CatalogModelTagDefinition): void {\n const ops = opsFromCatalogModelTag(tag);\n this.#ops.push(...ops);\n }\n\n updateTag(tag: CatalogModelUpdateTagDefinition): void {\n const ops = opsFromCatalogModelUpdateTag(tag);\n this.#ops.push(...ops);\n }\n\n removeTag(tag: CatalogModelRemoveTagDefinition): void {\n const ops = opsFromCatalogModelRemoveTag(tag);\n this.#ops.push(...ops);\n }\n\n import(layer: CatalogModelLayer): void {\n const internal = OpaqueCatalogModelLayer.toInternal(layer);\n this.#ops.push(...internal.ops);\n }\n\n build(): CatalogModelLayer {\n return OpaqueCatalogModelLayer.createInstance('v1', {\n layerId: this.#layerId,\n ops: this.#ops.slice(),\n });\n }\n}\n\n/**\n * Creates a builder for a catalog model layer.\n *\n * @alpha\n * @remarks\n *\n * Plugins can use the resulting builder to declare various contributions to the\n * overall catalog model, and registering it with the catalog which then forms a\n * complete picture out of them.\n */\nexport function createCatalogModelLayerBuilder(options: {\n layerId: string;\n}): CatalogModelLayerBuilder & { build(): CatalogModelLayer } {\n return new DefaultCatalogModelLayerBuilder(options);\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { JsonObject } from '@backstage/types';\nimport { CatalogModelOp } from '../operations';\nimport { createDeclareKindOp } from '../operations/declareKind';\nimport { opsFromCatalogModelAddKindVersion } from './addKindVersion';\n\n/**\n * The definition of a catalog model kind, roughly resembling a JSON Schema.\n *\n * @alpha\n */\nexport interface CatalogModelKindDefinition {\n /**\n * The apiVersion group of the kind, e.g. \"backstage.io\".\n */\n group: string;\n\n /**\n * The names used for this kind.\n */\n names: {\n /**\n * The name of the kind with proper casing, e.g. \"Component\".\n */\n kind: string;\n\n /**\n * The singular form of the kind name, e.g. \"component\".\n */\n singular: string;\n\n /**\n * The plural form of the kind name, e.g. \"components\".\n */\n plural: string;\n };\n\n /**\n * A short description of the kind.\n *\n * @remarks\n *\n * For kinds that have wide applicability over for example several different\n * spec types, this description should be a generic one and the types\n * themselves can be more precise.\n */\n description: string;\n\n /**\n * Declare one or more versions of the kind's actual schema shape.\n */\n versions?: CatalogModelKindVersionDefinition[];\n}\n\n/**\n * The definition of one or more specific versions of a catalog model kind.\n *\n * @alpha\n */\nexport interface CatalogModelKindVersionDefinition {\n /**\n * The specific version name or names, e.g. \"v1alpha1\" or\n * [\"v1alpha1\", \"v1beta1\"]. The kind group and the version name form the\n * full apiVersion, e.g. \"backstage.io/v1alpha1\".\n */\n name: string | string[];\n\n /**\n * The spec type or types that this version applies to.\n *\n * @remarks\n *\n * This can be used to make kinds whose spec effectively are discriminated\n * unions. If you don't specify this, the schema will apply to a spec that\n * has no type given at all, or to those where the type is not among the set\n * of any other known declared spec types.\n *\n * TODO: Should this be more like `matcher: { [path: string]: string }`, or\n * even a full JSON Schema that can be used in an \"if\"?\n */\n specType?: string | string[];\n\n /**\n * A short description of this particular version (and type, where applicable).\n */\n description?: string;\n\n /**\n * The fields that shall be used to generate relations, if any.\n *\n * TODO: Should this be not an array, to be more easily mergeable? Or should\n * we just have a custom merge strategy for them\n */\n relationFields?: CatalogModelKindRelationFieldDefinition[];\n\n /**\n * The entity schema, excluding the generated kind, apiVersion, and metadata\n * fields. Its root type must be `object` or omitted; an omitted root type is\n * supplied during compilation.\n */\n schema: {\n jsonSchema: JsonObject;\n };\n}\n\n/**\n * @alpha\n */\nexport interface CatalogModelKindRelationFieldDefinition {\n /**\n * What field that shall be used to generate relations.\n *\n * @remarks\n *\n * The field value is expected to be a string or string array at runtime.\n */\n selector: { path: string };\n /**\n * The relation type that this field generates, e.g. \"ownedBy\".\n */\n relation: string;\n /**\n * If the given shorthand ref did not have a kind, use this kind as the\n * default. If no default kind is specified, the ref must contain a kind.\n */\n defaultKind?: string;\n /**\n * If the given shorthand ref did not have a namespace, either inherit the\n * namespace of the entity itself, or choose the default namespace. If no\n * default namespace is specified, the namespace of the entity itself is used.\n */\n defaultNamespace?: 'default' | 'inherit';\n /**\n * Only allow relations to be specified to the given kinds. This list must\n * include the default kind, if any. If no allowed kinds are specified, all\n * kinds are.\n */\n allowedKinds?: string[];\n}\n\nexport function opsFromCatalogModelKind(\n kind: CatalogModelKindDefinition,\n): CatalogModelOp[] {\n const ops: CatalogModelOp[] = [];\n\n ops.push(\n createDeclareKindOp({\n kind: kind.names.kind,\n group: kind.group,\n properties: {\n singular: kind.names.singular,\n plural: kind.names.plural,\n description: kind.description,\n },\n }),\n );\n\n ops.push(\n ...opsFromCatalogModelAddKindVersion({\n kind: kind.names.kind,\n versions: kind.versions ?? [],\n }),\n );\n\n return ops;\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { JsonObject } from '@backstage/types';\nimport { reduceKindSchema } from '../jsonSchema/reduceKindSchema';\nimport { CatalogModelOp } from '../operations';\nimport { createUpdateKindOp } from '../operations/updateKind';\nimport { createUpdateKindVersionOp } from '../operations/updateKindVersion';\nimport { CatalogModelKindRelationFieldDefinition } from './addKind';\n\n/**\n * The definition of updates to a catalog model kind.\n *\n * @alpha\n */\nexport interface CatalogModelUpdateKindDefinition {\n /**\n * The names used for this kind.\n */\n names: {\n /**\n * The name of the kind with proper casing, e.g. \"Component\".\n */\n kind: string;\n\n /**\n * The singular form of the kind name, e.g. \"component\". Specify this if you\n * want to override the default value.\n */\n singular?: string;\n\n /**\n * The plural form of the kind name, e.g. \"components\". Specify this if you\n * want to override the default value.\n */\n plural?: string;\n };\n\n /**\n * A short description of the kind. Specify this if you want to override the\n * default value.\n */\n description?: string;\n\n /**\n * Update one or more versions of the kind's actual schema shape.\n */\n versions?: CatalogModelUpdateKindVersionDefinition[];\n}\n\n/**\n * The definition of updates to a specific version of a catalog model kind.\n *\n * @alpha\n */\nexport interface CatalogModelUpdateKindVersionDefinition {\n /**\n * The specific version name or names to update, e.g. \"v1alpha1\" or\n * [\"v1alpha1\", \"v1beta1\"].\n */\n name: string | string[];\n\n /**\n * The spec type or types that this version update applies to.\n */\n specType?: string | string[];\n\n /**\n * A short description of this particular version (and type, where\n * applicable). Specify this if you want to override the default value.\n */\n description?: string;\n\n /**\n * The fields that shall be used to generate relations, if any. Specify this\n * if you want to override the default value.\n */\n relationFields?: CatalogModelKindRelationFieldDefinition[];\n\n /**\n * The JSON schema to deep merge with the existing schema for this version.\n * Object fields set to `null` delete the corresponding inherited field.\n * Values of `const` and `default` are literal JSON data, so `null` is\n * retained for those keywords rather than interpreted as a deletion.\n * Arrays replace the inherited array in full. The resulting schema is\n * validated when the model is compiled.\n */\n schema?: {\n jsonSchema: JsonObject;\n };\n}\n\nexport function opsFromCatalogModelUpdateKind(\n kind: CatalogModelUpdateKindDefinition,\n): CatalogModelOp[] {\n const ops: CatalogModelOp[] = [];\n\n if (\n kind.names.singular !== undefined ||\n kind.names.plural !== undefined ||\n kind.description !== undefined\n ) {\n ops.push(\n createUpdateKindOp({\n kind: kind.names.kind,\n properties: {\n singular: kind.names.singular,\n plural: kind.names.plural,\n description: kind.description,\n },\n }),\n );\n }\n\n for (const version of kind.versions ?? []) {\n const jsonSchema = version.schema\n ? reduceKindSchema(version.schema.jsonSchema)\n : undefined;\n const names = Array.isArray(version.name) ? version.name : [version.name];\n for (const name of names) {\n const specTypes = version.specType?.length\n ? [version.specType].flat()\n : [undefined];\n for (const specType of specTypes) {\n ops.push(\n createUpdateKindVersionOp({\n kind: kind.names.kind,\n name,\n specType: specType,\n properties: {\n description: version.description,\n relationFields: version.relationFields,\n schema: jsonSchema\n ? { jsonSchema: jsonSchema as any }\n : undefined,\n },\n }),\n );\n }\n }\n }\n\n return ops;\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CatalogModelOp } from '../operations';\nimport { createRemoveKindOp } from '../operations/removeKind';\n\n/**\n * The definition of a kind removal from the catalog model.\n *\n * @alpha\n */\nexport interface CatalogModelRemoveKindDefinition {\n /**\n * The kind to remove, e.g. \"Component\".\n */\n kind: string;\n}\n\nexport function opsFromCatalogModelRemoveKind(\n definition: CatalogModelRemoveKindDefinition,\n): CatalogModelOp[] {\n return [createRemoveKindOp({ kind: definition.kind })];\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CatalogModelOp } from '../operations';\nimport { createDeclareRelationOp } from '../operations/declareRelation';\n\n/**\n * The definition of a catalog model relation.\n *\n * @alpha\n */\nexport interface CatalogModelRelationPairDefinition {\n /**\n * The kind(s) that this relation originates from, e.g. \"Component\" or\n * [\"Component\", \"Resource\"].\n */\n fromKind: string | string[];\n\n /**\n * The kind(s) that this relation points to, e.g. \"Group\" or\n * [\"Group\", \"User\"].\n */\n toKind: string | string[];\n\n /**\n * A human-readable description of the relation.\n */\n description: string;\n\n /**\n * The names for the forward direction (from the current entity toward\n * the one being referenced).\n */\n forward: {\n /**\n * The technical type of the relation, e.g. \"ownedBy\"\n */\n type: string;\n /**\n * A human-readable title for the relation type, e.g. \"owned by\".\n */\n title: string;\n };\n\n /**\n * The names for the reverse direction (from the one being referenced\n * toward the current entity).\n */\n reverse: {\n /**\n * The technical type of the relation, e.g. \"ownerOf\"\n */\n type: string;\n /**\n * A human-readable title for the relation type, e.g. \"owner of\".\n */\n title: string;\n };\n}\n\nexport function opsFromCatalogModelRelationPair(\n relationPair: CatalogModelRelationPairDefinition,\n): CatalogModelOp[] {\n const ops: CatalogModelOp[] = [];\n\n // Duplicate across kinds, and both directions\n for (const firstKind of [relationPair.fromKind].flat()) {\n for (const secondKind of [relationPair.toKind].flat()) {\n ops.push(\n createDeclareRelationOp({\n fromKind: firstKind,\n type: relationPair.forward.type,\n toKind: secondKind,\n properties: {\n reverseType: relationPair.reverse.type,\n title: relationPair.forward.title,\n description: relationPair.description,\n },\n }),\n );\n ops.push(\n createDeclareRelationOp({\n fromKind: secondKind,\n type: relationPair.reverse.type,\n toKind: firstKind,\n properties: {\n reverseType: relationPair.forward.type,\n title: relationPair.reverse.title,\n description: relationPair.description,\n },\n }),\n );\n }\n }\n\n return ops;\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CatalogModelOp } from '../operations';\nimport { createUpdateRelationOp } from '../operations/updateRelation';\n\n/**\n * The definition of a catalog model relation.\n *\n * @alpha\n */\nexport interface CatalogModelUpdateRelationPairDefinition {\n /**\n * The kind(s) that this relation originates from, e.g. \"Component\" or\n * [\"Component\", \"Resource\"].\n */\n fromKind: string | string[];\n\n /**\n * The kind(s) that this relation points to, e.g. \"Group\" or\n * [\"Group\", \"User\"].\n */\n toKind: string | string[];\n\n /**\n * A human-readable description of the relation. Specify this if you want\n * to override the default value.\n */\n description?: string;\n\n /**\n * The names for the forward direction (from the current entity toward the one\n * being referenced).\n */\n forward: {\n /**\n * The technical type of the relation, e.g. \"ownedBy\"\n */\n type: string;\n /**\n * A human-readable title for the relation type, e.g. \"owned by\".\n * Specify this if you want to override the default value.\n */\n title?: string;\n };\n\n /**\n * The names for the reverse direction (from the one being referenced toward\n * the current entity).\n */\n reverse: {\n /**\n * The technical type of an existing reverse relation, e.g. \"ownerOf\".\n * If omitted, title updates apply to the currently declared reverse\n * relation.\n */\n type?: string;\n /**\n * A human-readable title for the relation type, e.g. \"owner of\".\n * Specify this if you want to override the default value.\n */\n title?: string;\n };\n}\n\nexport function opsFromCatalogModelUpdateRelationPair(\n relationPair: CatalogModelUpdateRelationPairDefinition,\n): CatalogModelOp[] {\n const ops: CatalogModelOp[] = [];\n\n // Duplicate across kinds, and both directions\n for (const firstKind of [relationPair.fromKind].flat()) {\n for (const secondKind of [relationPair.toKind].flat()) {\n ops.push(\n createUpdateRelationOp({\n fromKind: firstKind,\n type: relationPair.forward.type,\n toKind: secondKind,\n properties: {\n reverseType: relationPair.reverse.type,\n reverseTitle: relationPair.reverse.type\n ? undefined\n : relationPair.reverse.title,\n title: relationPair.forward.title,\n description: relationPair.description,\n },\n }),\n );\n if (relationPair.reverse.type) {\n ops.push(\n createUpdateRelationOp({\n fromKind: secondKind,\n type: relationPair.reverse.type,\n toKind: firstKind,\n properties: {\n reverseType: relationPair.forward.type,\n title: relationPair.reverse.title,\n description: relationPair.description,\n },\n }),\n );\n }\n }\n }\n\n return ops;\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InputError } from '@backstage/errors';\nimport { validateMetaSchema } from '../jsonSchema/validateMetaSchema';\nimport { CatalogModelOp } from '../operations';\nimport { createDeclareAnnotationOp } from '../operations/declareAnnotation';\nimport { JsonObject } from '@backstage/types';\n\n/**\n * The definition of a catalog model annotation.\n *\n * @alpha\n */\nexport interface CatalogModelAnnotationDefinition {\n /**\n * The name of the annotation, e.g. \"backstage.io/techdocs-ref\".\n */\n name: string;\n\n /**\n * A human-readable title that can be used for display purposes instead of\n * the technical name.\n */\n title?: string;\n\n /**\n * A human-readable description of the annotation.\n */\n description: string;\n\n /**\n * The JSON schema that values of this annotation must conform to.\n *\n * @remarks\n *\n * If not provided, the annotation is assumed to be a simple string with no\n * particular schema.\n */\n schema?: {\n jsonSchema: JsonObject;\n };\n}\n\nexport function opsFromCatalogModelAnnotation(\n annotation: CatalogModelAnnotationDefinition,\n): CatalogModelOp[] {\n if (annotation.schema?.jsonSchema) {\n validateMetaSchema(annotation.schema.jsonSchema);\n if (annotation.schema.jsonSchema.type !== 'string') {\n throw new InputError(\n `Annotation \"${annotation.name}\" schema must have \"type\": \"string\" at the root, only string values are supported`,\n );\n }\n }\n return [\n createDeclareAnnotationOp({\n name: annotation.name,\n properties: {\n title: annotation.title,\n description: annotation.description,\n schema: annotation.schema,\n },\n }),\n ];\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InputError } from '@backstage/errors';\nimport { validateMetaSchema } from '../jsonSchema/validateMetaSchema';\nimport { CatalogModelOp } from '../operations';\nimport { createUpdateAnnotationOp } from '../operations/updateAnnotation';\nimport { JsonObject } from '@backstage/types';\n\n/**\n * The definition of updates to a catalog model annotation.\n *\n * @alpha\n */\nexport interface CatalogModelUpdateAnnotationDefinition {\n /**\n * The name of the annotation, e.g. \"backstage.io/techdocs-ref\".\n */\n name: string;\n\n /**\n * A human-readable title that can be used for display purposes instead of\n * the technical name.\n */\n title?: string;\n\n /**\n * A human-readable description of the annotation.\n */\n description?: string;\n\n /**\n * The JSON schema that values of this annotation must conform to.\n *\n * @remarks\n *\n * If not provided, the annotation is assumed to be a simple string with no\n * particular schema.\n */\n schema?: {\n jsonSchema: JsonObject;\n };\n}\n\nexport function opsFromCatalogModelUpdateAnnotation(\n annotation: CatalogModelUpdateAnnotationDefinition,\n): CatalogModelOp[] {\n if (annotation.schema) {\n validateMetaSchema(annotation.schema.jsonSchema);\n if (annotation.schema.jsonSchema.type !== 'string') {\n throw new InputError(\n `Annotation \"${annotation.name}\" schema must have \"type\": \"string\" at the root, only string values are supported`,\n );\n }\n }\n return [\n createUpdateAnnotationOp({\n name: annotation.name,\n properties: {\n title: annotation.title,\n description: annotation.description,\n schema: annotation.schema,\n },\n }),\n ];\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CatalogModelOp } from '../operations';\nimport { createRemoveAnnotationOp } from '../operations/removeAnnotation';\n\n/**\n * The definition of an annotation removal from the catalog model.\n *\n * @alpha\n */\nexport interface CatalogModelRemoveAnnotationDefinition {\n /**\n * The name of the annotation to remove, e.g. \"backstage.io/techdocs-ref\".\n */\n name: string;\n}\n\nexport function opsFromCatalogModelRemoveAnnotation(\n definition: CatalogModelRemoveAnnotationDefinition,\n): CatalogModelOp[] {\n return [createRemoveAnnotationOp({ name: definition.name })];\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InputError } from '@backstage/errors';\nimport { validateMetaSchema } from '../jsonSchema/validateMetaSchema';\nimport { CatalogModelOp } from '../operations';\nimport { createDeclareLabelOp } from '../operations/declareLabel';\nimport { JsonObject } from '@backstage/types';\n\n/**\n * The definition of a catalog model label.\n *\n * @alpha\n */\nexport interface CatalogModelLabelDefinition {\n /**\n * The name of the label, e.g. \"backstage.io/source-location\".\n */\n name: string;\n\n /**\n * A human-readable title that can be used for display purposes instead of\n * the technical name.\n */\n title?: string;\n\n /**\n * A human-readable description of the label.\n */\n description: string;\n\n /**\n * The JSON schema that values of this label must conform to.\n *\n * @remarks\n *\n * If not provided, the label is assumed to be a simple string with no\n * particular schema.\n */\n schema?: {\n jsonSchema: JsonObject;\n };\n}\n\nexport function opsFromCatalogModelLabel(\n label: CatalogModelLabelDefinition,\n): CatalogModelOp[] {\n if (label.schema?.jsonSchema) {\n validateMetaSchema(label.schema.jsonSchema);\n if (label.schema.jsonSchema.type !== 'string') {\n throw new InputError(\n `Label \"${label.name}\" schema must have \"type\": \"string\" at the root, only string values are supported`,\n );\n }\n }\n return [\n createDeclareLabelOp({\n name: label.name,\n properties: {\n title: label.title,\n description: label.description,\n schema: label.schema,\n },\n }),\n ];\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InputError } from '@backstage/errors';\nimport { validateMetaSchema } from '../jsonSchema/validateMetaSchema';\nimport { CatalogModelOp } from '../operations';\nimport { createUpdateLabelOp } from '../operations/updateLabel';\nimport { JsonObject } from '@backstage/types';\n\n/**\n * The definition of updates to a catalog model label.\n *\n * @alpha\n */\nexport interface CatalogModelUpdateLabelDefinition {\n /**\n * The name of the label, e.g. \"backstage.io/source-location\".\n */\n name: string;\n\n /**\n * A human-readable title that can be used for display purposes instead of\n * the technical name.\n */\n title?: string;\n\n /**\n * A human-readable description of the label.\n */\n description?: string;\n\n /**\n * The JSON schema that values of this label must conform to.\n *\n * @remarks\n *\n * If not provided, the label is assumed to be a simple string with no\n * particular schema.\n */\n schema?: {\n jsonSchema: JsonObject;\n };\n}\n\nexport function opsFromCatalogModelUpdateLabel(\n label: CatalogModelUpdateLabelDefinition,\n): CatalogModelOp[] {\n if (label.schema) {\n validateMetaSchema(label.schema.jsonSchema);\n if (label.schema.jsonSchema.type !== 'string') {\n throw new InputError(\n `Label \"${label.name}\" schema must have \"type\": \"string\" at the root, only string values are supported`,\n );\n }\n }\n return [\n createUpdateLabelOp({\n name: label.name,\n properties: {\n title: label.title,\n description: label.description,\n schema: label.schema,\n },\n }),\n ];\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CatalogModelOp } from '../operations';\nimport { createRemoveLabelOp } from '../operations/removeLabel';\n\n/**\n * The definition of a label removal from the catalog model.\n *\n * @alpha\n */\nexport interface CatalogModelRemoveLabelDefinition {\n /**\n * The name of the label to remove, e.g. \"backstage.io/source-location\".\n */\n name: string;\n}\n\nexport function opsFromCatalogModelRemoveLabel(\n definition: CatalogModelRemoveLabelDefinition,\n): CatalogModelOp[] {\n return [createRemoveLabelOp({ name: definition.name })];\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CatalogModelOp } from '../operations';\nimport { createDeclareTagOp } from '../operations/declareTag';\n\n/**\n * The definition of a catalog model tag.\n *\n * @alpha\n */\nexport interface CatalogModelTagDefinition {\n /**\n * The name of the tag, e.g. \"java\".\n */\n name: string;\n\n /**\n * A human-readable title that can be used for display purposes instead of\n * the technical name.\n */\n title?: string;\n\n /**\n * A human-readable description of the tag.\n */\n description: string;\n}\n\nexport function opsFromCatalogModelTag(\n tag: CatalogModelTagDefinition,\n): CatalogModelOp[] {\n return [\n createDeclareTagOp({\n name: tag.name,\n properties: {\n title: tag.title,\n description: tag.description,\n },\n }),\n ];\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CatalogModelOp } from '../operations';\nimport { createUpdateTagOp } from '../operations/updateTag';\n\n/**\n * The definition of updates to a catalog model tag.\n *\n * @alpha\n */\nexport interface CatalogModelUpdateTagDefinition {\n /**\n * The name of the tag, e.g. \"java\".\n */\n name: string;\n\n /**\n * A human-readable title that can be used for display purposes instead of\n * the technical name.\n */\n title?: string;\n\n /**\n * A human-readable description of the tag.\n */\n description?: string;\n}\n\nexport function opsFromCatalogModelUpdateTag(\n tag: CatalogModelUpdateTagDefinition,\n): CatalogModelOp[] {\n return [\n createUpdateTagOp({\n name: tag.name,\n properties: {\n title: tag.title,\n description: tag.description,\n },\n }),\n ];\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CatalogModelOp } from '../operations';\nimport { createRemoveTagOp } from '../operations/removeTag';\n\n/**\n * The definition of a tag removal from the catalog model.\n *\n * @alpha\n */\nexport interface CatalogModelRemoveTagDefinition {\n /**\n * The name of the tag to remove, e.g. \"java\".\n */\n name: string;\n}\n\nexport function opsFromCatalogModelRemoveTag(\n definition: CatalogModelRemoveTagDefinition,\n): CatalogModelOp[] {\n return [createRemoveTagOp({ name: definition.name })];\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createCatalogModelLayer } from '../model/createCatalogModelLayer';\n\n/*\nNaming rules for relations in priority order:\n\n1. Use at most two words. One main verb and a specifier, e.g. \"ownerOf\"\n2. Reading out \"<source-kind> <type> <target-kind>\" should make sense in English.\n3. Maintain symmetry between pairs, e.g. \"ownedBy\" and \"ownerOf\" rather than \"owns\".\n*/\n\n/**\n * An ownership relation where the owner is usually an organizational\n * entity (user or group), and the other entity can be anything. Reversed\n * direction of {@link RELATION_OWNER_OF}.\n *\n * @public\n */\nexport const RELATION_OWNED_BY = 'ownedBy';\n\n/**\n * A relationship from an owner to the owned entity. Reversed direction of\n * {@link RELATION_OWNED_BY}.\n *\n * @public\n */\nexport const RELATION_OWNER_OF = 'ownerOf';\n\n/**\n * A relation with an API entity, typically from a component. Reversed direction of\n * {@link RELATION_API_CONSUMED_BY}.\n *\n * @public\n */\nexport const RELATION_CONSUMES_API = 'consumesApi';\n\n/**\n * A relation of an API being consumed, typically by a component. Reversed direction of\n * {@link RELATION_CONSUMES_API}.\n *\n * @public\n */\nexport const RELATION_API_CONSUMED_BY = 'apiConsumedBy';\n\n/**\n * A relation from an API provider entity (typically a component) to the API. Reversed direction of\n * {@link RELATION_API_PROVIDED_BY}.\n *\n * @public\n */\nexport const RELATION_PROVIDES_API = 'providesApi';\n\n/**\n * A relation from an API to its provider entity (typically a component). Reversed direction of\n * {@link RELATION_PROVIDES_API}.\n *\n * @public\n */\nexport const RELATION_API_PROVIDED_BY = 'apiProvidedBy';\n\n/**\n * A relation denoting a dependency on another entity. Reversed direction of\n * {@link RELATION_DEPENDENCY_OF}.\n *\n * @public\n */\nexport const RELATION_DEPENDS_ON = 'dependsOn';\n\n/**\n * A relation denoting a reverse dependency by another entity. Reversed direction of\n * {@link RELATION_DEPENDS_ON}.\n *\n * @public\n */\nexport const RELATION_DEPENDENCY_OF = 'dependencyOf';\n\n/**\n * A parent/child relation to build up a tree, used for example to describe\n * the organizational structure between groups. Reversed direction of\n * {@link RELATION_CHILD_OF}.\n *\n * @public\n */\nexport const RELATION_PARENT_OF = 'parentOf';\n\n/**\n * A relation from a child to a parent entity, used for example to describe\n * the organizational structure between groups. Reversed direction of\n * {@link RELATION_PARENT_OF}.\n *\n * @public\n */\nexport const RELATION_CHILD_OF = 'childOf';\n\n/**\n * A membership relation, typically for users in a group. Reversed direction of\n * {@link RELATION_HAS_MEMBER}.\n *\n * @public\n */\nexport const RELATION_MEMBER_OF = 'memberOf';\n\n/**\n * A relation from a group to its member, typically a user in a group. Reversed direction of\n * {@link RELATION_MEMBER_OF}.\n *\n * @public\n */\nexport const RELATION_HAS_MEMBER = 'hasMember';\n\n/**\n * A part/whole relation, typically for components in a system and systems\n * in a domain. Reversed direction of {@link RELATION_HAS_PART}.\n *\n * @public\n */\nexport const RELATION_PART_OF = 'partOf';\n\n/**\n * A relation from a containing entity to a contained entity. Reversed direction of\n * {@link RELATION_PART_OF}.\n *\n * @public\n */\nexport const RELATION_HAS_PART = 'hasPart';\n\n/**\n * Extends the catalog model with the well-known Backstage relation pairs.\n */\nexport const wellKnownRelationsModel = createCatalogModelLayer({\n layerId: 'catalog.backstage.io/well-known-relations',\n builder: model => {\n model.addRelationPair({\n fromKind: [\n 'API',\n 'Component',\n 'Domain',\n 'Group',\n 'Location',\n 'Resource',\n 'System',\n 'User',\n ],\n toKind: ['Group', 'User'],\n description:\n 'An ownership relation where the owner is usually an organizational entity (user or group), and the other entity can be anything.',\n forward: { type: 'ownedBy', title: 'owned by' },\n reverse: { type: 'ownerOf', title: 'owner of' },\n });\n\n model.addRelationPair({\n fromKind: 'Component',\n toKind: 'API',\n description:\n 'A relation from a component to an API it provides for consumption by others.',\n forward: { type: 'providesApi', title: 'provides API' },\n reverse: { type: 'apiProvidedBy', title: 'API provided by' },\n });\n\n model.addRelationPair({\n fromKind: 'Component',\n toKind: 'API',\n description: 'A relation from a component to an API it consumes.',\n forward: { type: 'consumesApi', title: 'consumes API' },\n reverse: { type: 'apiConsumedBy', title: 'API consumed by' },\n });\n\n model.addRelationPair({\n fromKind: ['Component', 'Resource'],\n toKind: ['Component', 'Resource'],\n description:\n 'A dependency relation expressing that an entity needs another entity to function.',\n forward: { type: 'dependsOn', title: 'depends on' },\n reverse: { type: 'dependencyOf', title: 'dependency of' },\n });\n\n model.addRelationPair({\n fromKind: 'Group',\n toKind: 'Group',\n description:\n 'A parent/child relation to build up a tree, used for example to describe the organizational structure between groups.',\n forward: { type: 'parentOf', title: 'parent of' },\n reverse: { type: 'childOf', title: 'child of' },\n });\n\n model.addRelationPair({\n fromKind: 'User',\n toKind: 'Group',\n description: 'A membership relation, typically for users in a group.',\n forward: { type: 'memberOf', title: 'member of' },\n reverse: { type: 'hasMember', title: 'has member' },\n });\n\n model.addRelationPair({\n fromKind: ['Component', 'API', 'Resource'],\n toKind: ['Component', 'System'],\n description:\n 'A part/whole relation where a component, API, or resource belongs to a system or a component is a subcomponent of another.',\n forward: { type: 'partOf', title: 'part of' },\n reverse: { type: 'hasPart', title: 'has part' },\n });\n\n model.addRelationPair({\n fromKind: 'System',\n toKind: 'Domain',\n description: 'A part/whole relation where a system belongs to a domain.',\n forward: { type: 'partOf', title: 'part of' },\n reverse: { type: 'hasPart', title: 'has part' },\n });\n\n model.addRelationPair({\n fromKind: 'Domain',\n toKind: 'Domain',\n description:\n 'A part/whole relation where a domain is a subdomain of another domain.',\n forward: { type: 'partOf', title: 'part of' },\n reverse: { type: 'hasPart', title: 'has part' },\n });\n },\n});\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* We want to maintain the same information as an enum, so we disable the redeclaration warning */\n/* eslint-disable @typescript-eslint/no-redeclare */\n\n/**\n * Types used to customize and provide data to {@link DependencyGraph}\n *\n * @packageDocumentation\n */\n\nimport { ReactNode } from 'react';\n\n/**\n * Types for the {@link DependencyGraph} component.\n *\n * @public\n */\nexport namespace DependencyGraphTypes {\n /**\n * Edge of {@link DependencyGraph}\n *\n * @public\n */\n export type DependencyEdge<T = {}> = T & {\n /**\n * ID of {@link DependencyNode} from where the Edge start\n */\n from: string;\n /**\n * ID of {@link DependencyNode} to where the Edge goes to\n */\n to: string;\n /**\n * Label assigned and rendered with the Edge\n */\n label?: string;\n /**\n * Distance to a root entity\n */\n distance?: number;\n };\n\n /**\n * Properties of {@link DependencyGraphTypes.RenderLabelFunction} for {@link DependencyGraphTypes.DependencyEdge}\n *\n * @public\n */\n export type RenderLabelProps<T = unknown> = { edge: DependencyEdge<T> };\n\n /**\n * Custom React component for edge labels\n *\n * @public\n */\n export type RenderLabelFunction<T = {}> = (\n props: RenderLabelProps<T>,\n ) => ReactNode;\n\n /**\n * Node of {@link DependencyGraph}\n *\n * @public\n */\n export type DependencyNode<T = {}> = T & {\n id: string;\n };\n\n /**\n * Properties of {@link DependencyGraphTypes.RenderNodeFunction} for {@link DependencyGraphTypes.DependencyNode}\n *\n * @public\n */\n export type RenderNodeProps<T = unknown> = { node: DependencyNode<T> };\n\n /**\n * Custom React component for graph {@link DependencyGraphTypes.DependencyNode}\n *\n * @public\n */\n export type RenderNodeFunction<T = {}> = (\n props: RenderNodeProps<T>,\n ) => ReactNode;\n\n /**\n * Properties of {@link DependencyGraphTypes.RenderEdgeFunction} for {@link DependencyGraphTypes.DependencyEdge}\n *\n * @public\n */\n export type RenderEdgeProps<T = {}> = {\n edge: T & {\n points: { x: number; y: number }[];\n label?: string;\n labeloffset?: number;\n labelpos?: string;\n width?: number;\n height?: number;\n weight?: number;\n minlen?: number;\n showArrowHeads?: boolean;\n from?: string;\n to?: string;\n relations?: string[];\n };\n id: {\n v: string;\n w: string;\n name?: string | undefined;\n };\n };\n\n /**\n * Custom React component for graph {@link DependencyGraphTypes.DependencyEdge}\n *\n * @public\n */\n export type RenderEdgeFunction<T = {}> = (\n props: RenderEdgeProps<T>,\n ) => ReactNode;\n\n /**\n * Graph direction\n *\n * @public\n */\n export const Direction = {\n /**\n * Top to Bottom\n */\n TOP_BOTTOM: 'TB',\n /**\n * Bottom to Top\n */\n BOTTOM_TOP: 'BT',\n /**\n * Left to Right\n */\n LEFT_RIGHT: 'LR',\n /**\n * Right to Left\n */\n RIGHT_LEFT: 'RL',\n } as const;\n\n /**\n * @public\n */\n export type Direction = (typeof Direction)[keyof typeof Direction];\n\n /**\n * @public\n */\n export namespace Direction {\n export type TOP_BOTTOM = typeof Direction.TOP_BOTTOM;\n export type BOTTOM_TOP = typeof Direction.BOTTOM_TOP;\n export type LEFT_RIGHT = typeof Direction.LEFT_RIGHT;\n export type RIGHT_LEFT = typeof Direction.RIGHT_LEFT;\n }\n\n /**\n * Node alignment\n *\n * @public\n */\n export const Alignment = {\n /**\n * Up Left\n */\n UP_LEFT: 'UL',\n /**\n * Up Right\n */\n UP_RIGHT: 'UR',\n /**\n * Down Left\n */\n DOWN_LEFT: 'DL',\n /**\n * Down Right\n */\n DOWN_RIGHT: 'DR',\n } as const;\n\n /**\n * @public\n */\n export type Alignment = (typeof Alignment)[keyof typeof Alignment];\n\n /**\n * @public\n */\n export namespace Alignment {\n export type UP_LEFT = typeof Alignment.UP_LEFT;\n export type UP_RIGHT = typeof Alignment.UP_RIGHT;\n export type DOWN_LEFT = typeof Alignment.DOWN_LEFT;\n export type DOWN_RIGHT = typeof Alignment.DOWN_RIGHT;\n }\n\n /**\n * Algorithm used to rand nodes in graph\n *\n * @public\n */\n export const Ranker = {\n /**\n * {@link https://en.wikipedia.org/wiki/Network_simplex_algorithm | Network Simplex} algorithm\n */\n NETWORK_SIMPLEX: 'network-simplex',\n /**\n * Tight Tree algorithm\n */\n TIGHT_TREE: 'tight-tree',\n /**\n * Longest path algorithm\n *\n * @remarks\n *\n * Simplest and fastest\n */\n LONGEST_PATH: 'longest-path',\n } as const;\n\n /**\n * @public\n */\n export type Ranker = (typeof Ranker)[keyof typeof Ranker];\n\n /**\n * @public\n */\n export namespace Ranker {\n export type NETWORK_SIMPLEX = typeof Ranker.NETWORK_SIMPLEX;\n export type TIGHT_TREE = typeof Ranker.TIGHT_TREE;\n export type LONGEST_PATH = typeof Ranker.LONGEST_PATH;\n }\n\n /**\n * Position of label in relation to the edge\n *\n * @public\n */\n export const LabelPosition = {\n LEFT: 'l',\n RIGHT: 'r',\n CENTER: 'c',\n } as const;\n\n /**\n * @public\n */\n export type LabelPosition =\n (typeof LabelPosition)[keyof typeof LabelPosition];\n\n /**\n * @public\n */\n export namespace LabelPosition {\n export type LEFT = typeof LabelPosition.LEFT;\n export type RIGHT = typeof LabelPosition.RIGHT;\n export type CENTER = typeof LabelPosition.CENTER;\n }\n}\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ComponentProps } from 'react';\nimport IconButton from '@material-ui/core/IconButton';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Typography from '@material-ui/core/Typography';\nimport { Theme, makeStyles } from '@material-ui/core/styles';\nimport { StarIcon, UnstarredIcon } from '../../icons';\n\nconst useStyles = makeStyles<Theme>(\n () => ({\n icon: {\n color: '#f3ba37',\n cursor: 'pointer',\n display: 'inline-flex',\n },\n iconBorder: {\n color: 'inherit',\n cursor: 'pointer',\n display: 'inline-flex',\n },\n }),\n { name: 'BackstageFavoriteToggleIcon' },\n);\n\n/**\n * @public\n */\nexport type FavoriteToggleIconClassKey = 'icon' | 'iconBorder';\n\n/**\n * Icon used in FavoriteToggle component.\n *\n * Can be used independently, useful when used as {@link @material-table/core#MaterialTableProps.actions} in {@link @material-table/core#MaterialTable}\n *\n * @public\n */\nexport function FavoriteToggleIcon(props: { isFavorite: boolean }) {\n const { isFavorite } = props;\n const classes = useStyles();\n\n return (\n <Typography\n component=\"span\"\n className={isFavorite ? classes.icon : classes.iconBorder}\n >\n {isFavorite ? <StarIcon /> : <UnstarredIcon />}\n </Typography>\n );\n}\n\n/**\n * Props for the {@link FavoriteToggle} component.\n *\n * @public\n */\nexport type FavoriteToggleProps = ComponentProps<typeof IconButton> & {\n id: string;\n title: string;\n isFavorite: boolean;\n onToggle: (value: boolean) => void;\n};\n\n/**\n * Toggle encapsulating logic for marking something as favorite,\n * primarily used in various instances of entity lists and cards but can be used elsewhere.\n *\n * This component can only be used in as a controlled toggle and does not keep internal state.\n *\n * @public\n */\nexport function FavoriteToggle(props: FavoriteToggleProps) {\n const {\n id,\n title,\n isFavorite: value,\n onToggle: onChange,\n ...iconButtonProps\n } = props;\n return (\n <Tooltip id={id} title={title}>\n <IconButton\n aria-label={title}\n id={id}\n onClick={() => onChange(!value)}\n color=\"inherit\"\n {...iconButtonProps}\n >\n <FavoriteToggleIcon isFavorite={value} />\n </IconButton>\n </Tooltip>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Box from '@material-ui/core/Box';\nimport MaterialBreadcrumbs from '@material-ui/core/Breadcrumbs';\nimport List from '@material-ui/core/List';\nimport ListItem from '@material-ui/core/ListItem';\nimport Popover from '@material-ui/core/Popover';\nimport { withStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport {\n MouseEvent,\n useState,\n Children,\n ComponentProps,\n Fragment,\n} from 'react';\n\ntype Props = ComponentProps<typeof MaterialBreadcrumbs>;\n\n/** @public */\nexport type BreadcrumbsClickableTextClassKey = 'root';\n\nconst ClickableText = withStyles(\n {\n root: {\n textDecoration: 'underline',\n cursor: 'pointer',\n },\n },\n { name: 'BackstageBreadcrumbsClickableText' },\n)(Typography);\n\n/** @public */\nexport type BreadcrumbsStyledBoxClassKey = 'root';\n\nconst StyledBox = withStyles(\n {\n root: {\n textDecoration: 'underline',\n color: 'inherit',\n },\n },\n { name: 'BackstageBreadcrumbsStyledBox' },\n)(Box);\n\n/** @public */\nexport type BreadcrumbsCurrentPageClassKey = 'root';\n\nconst BreadcrumbsCurrentPage = withStyles(\n {\n root: {\n fontStyle: 'italic',\n },\n },\n { name: 'BreadcrumbsCurrentPage' },\n)(Box);\n\n/**\n * Breadcrumbs component to show navigation hierarchical structure\n *\n * @public\n *\n */\nexport function Breadcrumbs(props: Props) {\n const { children, ...restProps } = props;\n const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);\n\n const childrenArray = Children.toArray(children);\n\n const [firstPage, secondPage, ...expandablePages] = childrenArray;\n const currentPage = expandablePages.length\n ? expandablePages.pop()\n : childrenArray[childrenArray.length - 1];\n const hasHiddenBreadcrumbs = childrenArray.length > 3;\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleClose = () => {\n setAnchorEl(null);\n };\n\n const open = Boolean(anchorEl);\n return (\n <Fragment>\n <MaterialBreadcrumbs aria-label=\"breadcrumb\" {...restProps}>\n {childrenArray.length > 1 && <StyledBox clone>{firstPage}</StyledBox>}\n {childrenArray.length > 2 && <StyledBox clone>{secondPage}</StyledBox>}\n {hasHiddenBreadcrumbs && (\n <ClickableText onClick={handleClick}>...</ClickableText>\n )}\n <BreadcrumbsCurrentPage>{currentPage}</BreadcrumbsCurrentPage>\n </MaterialBreadcrumbs>\n <Popover\n open={open}\n anchorEl={anchorEl}\n onClose={handleClose}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'left',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'left',\n }}\n >\n <List>\n {expandablePages.map((pageLink, index) => (\n <ListItem key={index} button>\n <StyledBox clone>{pageLink}</StyledBox>\n </ListItem>\n ))}\n </List>\n </Popover>\n </Fragment>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { makeStyles, Theme } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { PropsWithChildren } from 'react';\n\n/** @public */\nexport type BackstageContentClassKey = 'root' | 'stretch' | 'noPadding';\n\nconst useStyles = makeStyles(\n (theme: Theme) => ({\n root: {\n gridArea: 'pageContent',\n minWidth: 0,\n paddingTop: theme.spacing(3),\n paddingBottom: theme.spacing(3),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n },\n stretch: {\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n },\n noPadding: {\n padding: 0,\n },\n }),\n { name: 'BackstageContent' },\n);\n\ntype Props = {\n stretch?: boolean;\n noPadding?: boolean;\n className?: string;\n};\n\n/**\n * The main content part inside a {@link Page}.\n *\n * @public\n *\n */\n\nexport function Content(props: PropsWithChildren<Props>) {\n const { className, stretch, noPadding, children, ...restProps } = props;\n\n const classes = useStyles();\n return (\n <article\n {...restProps}\n className={classNames(classes.root, className, {\n [classes.stretch]: stretch,\n [classes.noPadding]: noPadding,\n })}\n >\n {children}\n </article>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\nimport Box from '@material-ui/core/Box';\nimport Grid from '@material-ui/core/Grid';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport Typography from '@material-ui/core/Typography';\nimport { CSSProperties, PropsWithChildren, ReactNode } from 'react';\nimport { Helmet } from 'react-helmet';\nimport { Link } from '../../components/Link';\nimport { Breadcrumbs } from '../Breadcrumbs';\nimport { useContent } from '../Sidebar';\n\n/** @public */\nexport type HeaderClassKey =\n | 'header'\n | 'leftItemsBox'\n | 'rightItemsBox'\n | 'title'\n | 'subtitle'\n | 'type'\n | 'breadcrumb'\n | 'breadcrumbType'\n | 'breadcrumbTitle';\n\nconst useStyles = makeStyles(\n theme => ({\n header: {\n gridArea: 'pageHeader',\n padding: theme.spacing(3),\n width: '100%',\n boxShadow: theme.shadows[4],\n position: 'relative',\n zIndex: 100,\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n backgroundImage: theme.page.backgroundImage,\n backgroundPosition: 'center',\n backgroundSize: 'cover',\n [theme.breakpoints.down('sm')]: {\n flexWrap: 'wrap',\n },\n },\n leftItemsBox: {\n maxWidth: '100%',\n flexGrow: 1,\n },\n rightItemsBox: {\n width: 'auto',\n alignItems: 'center',\n },\n title: {\n color: theme.page.fontColor,\n wordBreak: 'break-word',\n fontSize: theme.typography.h3.fontSize,\n marginBottom: 0,\n },\n subtitle: {\n color: theme.page.fontColor,\n opacity: 0.8,\n display: 'inline-block', // prevents margin collapse of adjacent siblings\n marginTop: theme.spacing(1),\n maxWidth: '75ch',\n },\n type: {\n textTransform: 'uppercase',\n fontSize: 11,\n opacity: 0.8,\n marginBottom: theme.spacing(1),\n color: theme.page.fontColor,\n },\n breadcrumb: {\n color: theme.page.fontColor,\n },\n breadcrumbType: {\n fontSize: 'inherit',\n opacity: 0.7,\n marginRight: -theme.spacing(0.3),\n marginBottom: theme.spacing(0.3),\n },\n breadcrumbTitle: {\n fontSize: 'inherit',\n marginLeft: -theme.spacing(0.3),\n marginBottom: theme.spacing(0.3),\n },\n }),\n { name: 'BackstageHeader' },\n);\n\ntype HeaderStyles = ReturnType<typeof useStyles>;\n\ntype Props = {\n component?: ReactNode;\n pageTitleOverride?: string;\n style?: CSSProperties;\n subtitle?: ReactNode;\n title: ReactNode;\n tooltip?: string;\n type?: string;\n typeLink?: string;\n};\n\ntype TypeFragmentProps = {\n classes: HeaderStyles;\n pageTitle: string | ReactNode;\n type?: Props['type'];\n typeLink?: Props['typeLink'];\n};\n\ntype TitleFragmentProps = {\n classes: HeaderStyles;\n pageTitle: string | ReactNode;\n tooltip?: Props['tooltip'];\n};\n\ntype SubtitleFragmentProps = {\n classes: HeaderStyles;\n subtitle?: Props['subtitle'];\n};\n\nconst TypeFragment = ({\n type,\n typeLink,\n classes,\n pageTitle,\n}: TypeFragmentProps) => {\n if (!type) {\n return null;\n }\n\n if (!typeLink) {\n return <Typography className={classes.type}>{type}</Typography>;\n }\n\n return (\n <Breadcrumbs className={classes.breadcrumb}>\n <Link to={typeLink}>{type}</Link>\n <Typography>{pageTitle}</Typography>\n </Breadcrumbs>\n );\n};\n\nconst TitleFragment = ({ pageTitle, classes, tooltip }: TitleFragmentProps) => {\n const { contentRef } = useContent();\n\n const FinalTitle = (\n <Typography\n ref={contentRef}\n tabIndex={-1}\n className={classes.title}\n variant=\"h1\"\n >\n {pageTitle}\n </Typography>\n );\n\n if (!tooltip) {\n return FinalTitle;\n }\n\n return (\n <Tooltip title={tooltip} placement=\"top-start\">\n {FinalTitle}\n </Tooltip>\n );\n};\n\nconst SubtitleFragment = ({ classes, subtitle }: SubtitleFragmentProps) => {\n if (!subtitle) {\n return null;\n }\n\n if (typeof subtitle !== 'string') {\n return <>{subtitle}</>;\n }\n\n return (\n <Typography\n className={classes.subtitle}\n variant=\"subtitle2\"\n component=\"span\"\n >\n {subtitle}\n </Typography>\n );\n};\n/**\n * Backstage main header with abstract color background in multiple variants\n *\n * @public\n *\n */\nexport function Header(props: PropsWithChildren<Props>) {\n const {\n children,\n pageTitleOverride,\n style,\n subtitle,\n title,\n tooltip,\n type,\n typeLink,\n } = props;\n const classes = useStyles();\n const configApi = useApi(configApiRef);\n const appTitle = configApi.getOptionalString('app.title') || 'Backstage';\n const documentTitle = pageTitleOverride || title;\n const pageTitle = title || pageTitleOverride;\n const titleTemplate = `${documentTitle} | %s | ${appTitle}`;\n const defaultTitle = `${documentTitle} | ${appTitle}`;\n\n return (\n <>\n <Helmet titleTemplate={titleTemplate} defaultTitle={defaultTitle} />\n <header\n style={style}\n className={classes.header}\n data-backstage-core-header=\"\"\n >\n <Box className={classes.leftItemsBox}>\n <TypeFragment\n classes={classes}\n type={type}\n typeLink={typeLink}\n pageTitle={pageTitle}\n />\n <TitleFragment\n classes={classes}\n pageTitle={pageTitle}\n tooltip={tooltip}\n />\n <SubtitleFragment classes={classes} subtitle={subtitle} />\n </Box>\n <Grid container className={classes.rightItemsBox} spacing={4}>\n {children}\n </Grid>\n </header>\n </>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Grid from '@material-ui/core/Grid';\nimport { alpha, makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport { ReactNode, PropsWithChildren } from 'react';\nimport { Link } from '../../components/Link';\n\n/** @public */\nexport type HeaderLabelClassKey = 'root' | 'label' | 'value';\n\nconst useStyles = makeStyles(\n theme => ({\n root: {\n textAlign: 'left',\n },\n label: {\n color: theme.page.fontColor,\n fontWeight: theme.typography.fontWeightBold,\n letterSpacing: 0,\n fontSize: theme.typography.fontSize,\n marginBottom: theme.spacing(1) / 2,\n lineHeight: 1,\n },\n value: {\n color: alpha(theme.page.fontColor, 0.8),\n fontSize: theme.typography.fontSize,\n lineHeight: 1,\n },\n }),\n { name: 'BackstageHeaderLabel' },\n);\n\ntype HeaderLabelContentProps = PropsWithChildren<{\n value: ReactNode;\n className: string;\n typographyRootComponent?: keyof JSX.IntrinsicElements;\n}>;\n\nconst HeaderLabelContent = ({\n value,\n className,\n typographyRootComponent,\n}: HeaderLabelContentProps) => {\n return (\n <Typography\n component={\n typographyRootComponent ?? (typeof value === 'string' ? 'p' : 'span')\n }\n className={className}\n >\n {value}\n </Typography>\n );\n};\n\ntype HeaderLabelProps = {\n label: string;\n value?: HeaderLabelContentProps['value'];\n contentTypograpyRootComponent?: HeaderLabelContentProps['typographyRootComponent'];\n url?: string;\n};\n\n/**\n * Additional label to main {@link Header}\n *\n * @public\n *\n */\nexport function HeaderLabel(props: HeaderLabelProps) {\n const { label, value, url, contentTypograpyRootComponent } = props;\n const classes = useStyles();\n const content = (\n <HeaderLabelContent\n className={classes.value}\n value={value || '<Unknown>'}\n typographyRootComponent={contentTypograpyRootComponent}\n />\n );\n return (\n <Grid item>\n <Typography component=\"span\" className={classes.root}>\n <Typography className={classes.label}>{label}</Typography>\n {url ? <Link to={url}>{content}</Link> : content}\n </Typography>\n </Grid>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ReactNode } from 'react';\nimport { makeStyles, Theme, ThemeProvider } from '@material-ui/core/styles';\nimport classNames from 'classnames';\n\nexport type PageClassKey = 'root';\n\nconst useStyles = makeStyles(\n theme => ({\n root: {\n display: 'grid',\n gridTemplateAreas:\n \"'pageHeader pageHeader pageHeader' 'pageSubheader pageSubheader pageSubheader' 'pageNav pageContent pageSidebar'\",\n gridTemplateRows: 'max-content auto 1fr',\n gridTemplateColumns: 'auto 1fr auto',\n overflowY: 'auto',\n height: '100vh',\n [theme.breakpoints.down('xs')]: {\n height: '100%',\n },\n '@media print': {\n display: 'block',\n height: 'auto',\n overflowY: 'inherit',\n },\n },\n }),\n { name: 'BackstagePage' },\n);\n\ntype Props = {\n themeId: string;\n className?: string;\n children?: ReactNode;\n};\n\nexport function Page(props: Props) {\n const { themeId, className, children } = props;\n const classes = useStyles();\n return (\n <ThemeProvider\n theme={(baseTheme: Theme) => ({\n ...baseTheme,\n page: baseTheme.getPageTheme({ themeId }),\n })}\n >\n <main\n className={classNames(classes.root, className)}\n data-backstage-core-page=\"\"\n >\n {children}\n </main>\n </ThemeProvider>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useParams } from 'react-router-dom';\nimport { RouteRef, AnyParams, SubRouteRef } from './types';\n\n/**\n * React hook for retrieving dynamic params from the current URL.\n * @param _routeRef - Ref of the current route.\n * @public\n */\nexport function useRouteRefParams<Params extends AnyParams>(\n _routeRef: RouteRef<Params> | SubRouteRef<Params>,\n): Params {\n return useParams() as Params;\n}\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { ButtonLinkOwnProps } from './types';\nimport styles from './ButtonLink.module.css';\n\n/**\n * Component definition for ButtonLink\n * @public\n */\nexport const ButtonLinkDefinition = defineComponent<ButtonLinkOwnProps>()({\n styles,\n classNames: {\n root: 'bui-ButtonLink',\n content: 'bui-ButtonLinkContent',\n },\n bg: 'consumer',\n analytics: true,\n navigation: { type: 'anchor' },\n propDefs: {\n noTrack: {},\n size: { dataAttribute: true, default: 'small' },\n variant: { dataAttribute: true, default: 'primary' },\n iconStart: {},\n iconEnd: {},\n children: {},\n className: {},\n },\n});\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-ButtonLink\":\"NVumjJIcc4YzsPM1\",\"bui-ButtonLinkContent\":\"eJ5wbzSvC_Y7eHDP\"};","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, Ref } from 'react';\nimport { Link as RALink } from 'react-aria-components';\nimport type { ButtonLinkProps } from './types';\nimport {\n useDefinition,\n type UseDefinitionResult,\n} from '../../hooks/useDefinition';\nimport { ButtonLinkDefinition } from './definition';\nimport { getNodeText } from '../../analytics/getNodeText';\nimport {\n getReactAriaAnchorProps,\n type AnchorNavigation,\n} from '../../navigation/useNavigation';\n\ntype ButtonLinkViewProps = {\n definitionResult: UseDefinitionResult<\n typeof ButtonLinkDefinition,\n ButtonLinkProps\n >;\n navigation: AnchorNavigation;\n forwardedRef: Ref<HTMLAnchorElement>;\n};\n\nfunction ButtonLinkView({\n definitionResult,\n navigation,\n forwardedRef,\n}: ButtonLinkViewProps) {\n const { ownProps, restProps, dataAttributes, analytics } = definitionResult;\n const { classes, iconStart, iconEnd, children } = ownProps;\n const navigationProps = restProps.isDisabled\n ? { href: undefined, routerOptions: undefined, render: undefined }\n : getReactAriaAnchorProps(navigation, restProps);\n\n const handlePress: typeof restProps.onPress = e => {\n restProps.onPress?.(e);\n const text =\n restProps['aria-label'] ??\n getNodeText(children) ??\n String(restProps.href ?? '');\n analytics.captureEvent('click', text, {\n attributes: { to: String(restProps.href ?? '') },\n });\n };\n\n return (\n <RALink\n className={classes.root}\n ref={forwardedRef}\n {...dataAttributes}\n {...restProps}\n {...navigationProps}\n onPress={handlePress}\n >\n <span className={classes.content}>\n {iconStart}\n {children}\n {iconEnd}\n </span>\n </RALink>\n );\n}\n\n/**\n * A button-styled anchor element for navigation, supporting optional start and end icon slots and analytics event tracking.\n *\n * @public\n */\nexport const ButtonLink = forwardRef(\n (props: ButtonLinkProps, ref: Ref<HTMLAnchorElement>) => {\n const definitionResult = useDefinition(ButtonLinkDefinition, props);\n const Navigation = definitionResult.navigation;\n\n return (\n <Navigation\n props={definitionResult.restProps}\n view={ButtonLinkView}\n viewProps={{ definitionResult, forwardedRef: ref }}\n />\n );\n },\n);\n\nButtonLink.displayName = 'ButtonLink';\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-Card\":\"vwbKbDh04mMaiBi3\",\"bui-CardHeader\":\"XFUmGkj6WID_JnEz\",\"bui-CardBody\":\"bDKBEHaUGVdvGxpS\",\"bui-CardFooter\":\"htqU_uAkxL89C8of\",\"bui-CardTrigger\":\"YH9iVtgxrw5b0cYJ\",\"bui-card-body-shadow\":\"bJ7HlUi_25Q2Dxr7\"};","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type {\n CardOwnProps,\n CardHeaderOwnProps,\n CardBodyOwnProps,\n CardFooterOwnProps,\n} from './types';\nimport styles from './Card.module.css';\n\n/**\n * Component definition for Card\n * @public\n */\nexport const CardDefinition = defineComponent<CardOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Card',\n trigger: 'bui-CardTrigger',\n },\n propDefs: {\n children: {},\n className: {},\n onPress: {},\n href: {},\n label: {},\n target: {},\n rel: {},\n download: {},\n style: {},\n },\n utilityProps: ['grow', 'shrink', 'basis'],\n});\n\n/**\n * Component definition for CardHeader\n * @public\n */\nexport const CardHeaderDefinition = defineComponent<CardHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardHeader',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CardBody\n * @public\n */\nexport const CardBodyDefinition = defineComponent<CardBodyOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardBody',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CardFooter\n * @public\n */\nexport const CardFooterDefinition = defineComponent<CardFooterOwnProps>()({\n styles,\n classNames: {\n root: 'bui-CardFooter',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useCallback, useRef } from 'react';\nimport { Button as RAButton } from 'react-aria-components';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n CardDefinition,\n CardHeaderDefinition,\n CardBodyDefinition,\n CardFooterDefinition,\n} from './definition';\nimport type {\n CardProps,\n CardHeaderProps,\n CardBodyProps,\n CardFooterProps,\n} from './types';\nimport { Box } from '../Box/Box';\nimport { Link } from '../Link';\n\nconst INTERACTIVE_ELEMENT_SELECTOR =\n 'a[href],button,input,select,textarea,[role=\"button\"],[role=\"link\"],[tabindex]:not([tabindex=\"-1\"])';\n\n/**\n * Card component.\n *\n * @public\n */\nexport const Card = forwardRef<HTMLDivElement, CardProps>((props, ref) => {\n const { ownProps, restProps, dataAttributes, utilityStyle } = useDefinition(\n CardDefinition,\n props,\n );\n const {\n classes,\n children,\n onPress,\n href,\n label,\n target: linkTarget,\n rel,\n download,\n } = ownProps;\n const isInteractive = !!(onPress || href);\n\n const triggerRef = useRef<HTMLAnchorElement | HTMLButtonElement>(null);\n\n const handleClick = useCallback(\n (e: React.MouseEvent<HTMLDivElement>) => {\n if (!isInteractive || !triggerRef.current) return;\n\n // Don't delegate if the click target is the trigger itself\n if (triggerRef.current.contains(e.target as Node)) return;\n\n // Don't delegate if the user clicked a nested interactive element\n const targetNode = e.target as Node | null;\n const targetElement =\n targetNode instanceof Element ? targetNode : targetNode?.parentElement;\n if (targetElement?.closest(INTERACTIVE_ELEMENT_SELECTOR)) return;\n\n // Don't delegate if the user is selecting text\n if (window.getSelection()?.toString()) return;\n\n triggerRef.current.dispatchEvent(\n new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n ctrlKey: e.ctrlKey,\n metaKey: e.metaKey,\n shiftKey: e.shiftKey,\n altKey: e.altKey,\n }),\n );\n },\n [isInteractive],\n );\n\n return (\n <Box\n as=\"article\"\n bg=\"neutral\"\n ref={ref}\n className={classes.root}\n data-interactive={isInteractive || undefined}\n {...dataAttributes}\n {...restProps}\n onClick={isInteractive ? handleClick : undefined}\n style={{ ...utilityStyle, ...ownProps.style }}\n >\n {href && (\n <Link\n ref={triggerRef as React.Ref<HTMLAnchorElement>}\n className={classes.trigger}\n href={href}\n target={linkTarget}\n rel={rel}\n download={download}\n aria-label={label}\n />\n )}\n {onPress && !href && (\n <RAButton\n ref={triggerRef as React.Ref<HTMLButtonElement>}\n className={classes.trigger}\n onPress={onPress}\n aria-label={label}\n />\n )}\n {children}\n </Box>\n );\n});\n\nCard.displayName = 'Card';\n\n/**\n * CardHeader component.\n *\n * @public\n */\nexport const CardHeader = forwardRef<HTMLDivElement, CardHeaderProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardHeaderDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardHeader.displayName = 'CardHeader';\n\n/**\n * CardBody component.\n *\n * @public\n */\nexport const CardBody = forwardRef<HTMLDivElement, CardBodyProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardBodyDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardBody.displayName = 'CardBody';\n\n/**\n * CardFooter component.\n *\n * @public\n */\nexport const CardFooter = forwardRef<HTMLDivElement, CardFooterProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(CardFooterDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <div ref={ref} className={classes.root} {...restProps}>\n {children}\n </div>\n );\n },\n);\n\nCardFooter.displayName = 'CardFooter';\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { ContainerOwnProps } from './types';\nimport styles from './Container.module.css';\n\n/**\n * Component definition for Container\n * @public\n */\nexport const ContainerDefinition = defineComponent<ContainerOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Container',\n },\n propDefs: {\n children: {},\n className: {},\n style: {},\n },\n utilityProps: ['my', 'mt', 'mb', 'py', 'pt', 'pb', 'display'],\n});\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-Container\":\"j9YF9y0JMsI4PdI6\"};","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef } from 'react';\nimport type { ContainerProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { ContainerDefinition } from './definition';\n\n/**\n * A centered layout wrapper that constrains content to a maximum width and provides consistent page-level padding.\n *\n * @public\n */\nexport const Container = forwardRef<HTMLDivElement, ContainerProps>(\n (props, ref) => {\n const { ownProps, restProps, utilityStyle } = useDefinition(\n ContainerDefinition,\n props,\n );\n const { classes, children, style } = ownProps;\n\n return (\n <div\n ref={ref}\n className={classes.root}\n style={{ ...utilityStyle, ...style }}\n {...restProps}\n >\n {children}\n </div>\n );\n },\n);\n\nContainer.displayName = 'Container';\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-HeaderNav\":\"Se1MR2xlkoYuuKzh\",\"bui-HeaderNavList\":\"vv3j5mY2O0cI5ygv\",\"bui-HeaderNavItem\":\"c6iehTLRy0kKCOcK\",\"bui-HeaderNavGroup\":\"UXkc2kZp0RMXPoJG\",\"bui-HeaderNavActive\":\"q5ojXgJ30ggFPnjw\",\"bui-HeaderNavHovered\":\"DfuW_HHgCkAZgy8z\"};","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { HeaderNavTabItem, HeaderNavLinkProps } from './types';\nimport styles from './HeaderNav.module.css';\n\n/** @public */\nexport const HeaderNavDefinition = defineComponent<{\n tabs: HeaderNavTabItem[];\n activeTabId?: string | null;\n children?: React.ReactNode;\n className?: string;\n}>()({\n styles,\n classNames: {\n root: 'bui-HeaderNav',\n list: 'bui-HeaderNavList',\n active: 'bui-HeaderNavActive',\n hovered: 'bui-HeaderNavHovered',\n },\n propDefs: {\n tabs: {},\n activeTabId: {},\n children: {},\n className: {},\n },\n});\n\n/** @public */\nexport const HeaderNavItemDefinition = defineComponent<HeaderNavLinkProps>()({\n styles,\n classNames: {\n root: 'bui-HeaderNavItem',\n },\n analytics: true,\n navigation: { type: 'anchor' },\n propDefs: {\n noTrack: {},\n id: {},\n label: {},\n href: {},\n active: {},\n registerRef: {},\n onHighlight: {},\n className: {},\n },\n});\n\n/** @public */\nexport const HeaderNavGroupDefinition = defineComponent<{\n className?: string;\n}>()({\n styles,\n classNames: {\n root: 'bui-HeaderNavGroup',\n },\n propDefs: {\n className: {},\n },\n});\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useCallback, useEffect, useRef } from 'react';\n\ninterface HeaderNavIndicatorsProps {\n navRef: React.RefObject<HTMLElement | null>;\n itemRefs: React.MutableRefObject<Map<string, HTMLElement>>;\n activeKey: string | undefined;\n highlightedKey: string | null;\n classes: {\n active: string;\n hovered: string;\n };\n}\n\nexport function HeaderNavIndicators(props: HeaderNavIndicatorsProps) {\n const { navRef, itemRefs, activeKey, highlightedKey, classes } = props;\n const prevActiveKey = useRef<string | null>(null);\n const prevHoveredKey = useRef<string | null>(null);\n const resetTimer = useRef<number | null>(null);\n\n const updateCSSVariables = useCallback(() => {\n const container = navRef.current;\n if (!container) return;\n\n const containerRect = container.getBoundingClientRect();\n\n // Active indicator\n if (activeKey) {\n const el = itemRefs.current.get(activeKey);\n if (el) {\n const rect = el.getBoundingClientRect();\n const relativeLeft = rect.left - containerRect.left;\n const relativeTop = rect.top - containerRect.top;\n\n if (prevActiveKey.current === null) {\n container.style.setProperty('--active-transition-duration', '0s');\n requestAnimationFrame(() => {\n container.style.setProperty(\n '--active-transition-duration',\n '0.25s',\n );\n });\n } else {\n container.style.setProperty('--active-transition-duration', '0.25s');\n }\n\n container.style.setProperty('--active-tab-left', `${relativeLeft}px`);\n container.style.setProperty('--active-tab-width', `${rect.width}px`);\n container.style.setProperty('--active-tab-height', `${rect.height}px`);\n container.style.setProperty('--active-tab-top', `${relativeTop}px`);\n container.style.setProperty('--active-tab-opacity', '1');\n prevActiveKey.current = activeKey;\n }\n } else {\n container.style.setProperty('--active-tab-opacity', '0');\n prevActiveKey.current = null;\n }\n\n // Highlight indicator (follows whichever interaction happened last — hover or focus)\n if (highlightedKey) {\n if (resetTimer.current !== null) {\n cancelAnimationFrame(resetTimer.current);\n resetTimer.current = null;\n }\n const el = itemRefs.current.get(highlightedKey);\n if (el) {\n const rect = el.getBoundingClientRect();\n const relativeLeft = rect.left - containerRect.left;\n const relativeTop = rect.top - containerRect.top;\n\n if (prevHoveredKey.current === null) {\n container.style.setProperty('--hovered-transition-duration', '0s');\n requestAnimationFrame(() => {\n container.style.setProperty(\n '--hovered-transition-duration',\n '0.2s',\n );\n });\n } else {\n container.style.setProperty('--hovered-transition-duration', '0.2s');\n }\n\n container.style.setProperty('--hovered-tab-left', `${relativeLeft}px`);\n container.style.setProperty('--hovered-tab-top', `${relativeTop}px`);\n container.style.setProperty('--hovered-tab-width', `${rect.width}px`);\n container.style.setProperty('--hovered-tab-height', `${rect.height}px`);\n container.style.setProperty('--hovered-tab-opacity', '1');\n prevHoveredKey.current = highlightedKey;\n }\n } else {\n container.style.setProperty('--hovered-tab-opacity', '0');\n resetTimer.current = requestAnimationFrame(() => {\n prevHoveredKey.current = null;\n resetTimer.current = null;\n });\n }\n }, [activeKey, highlightedKey, navRef, itemRefs]);\n\n useEffect(() => {\n updateCSSVariables();\n }, [updateCSSVariables]);\n\n useEffect(() => {\n const handleResize = () => updateCSSVariables();\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }, [updateCSSVariables]);\n\n return (\n <>\n <div className={classes.active} />\n <div className={classes.hovered} />\n </>\n );\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useCallback, useMemo, useRef, useState } from 'react';\nimport { mergeProps, useFocusVisible, useHover, useLink } from 'react-aria';\nimport {\n matchRoutes,\n resolvePath,\n type NavigateOptions,\n} from 'react-router-dom';\nimport { Button as RAButton } from 'react-aria-components';\nimport { RiArrowDownSLine } from '@remixicon/react';\nimport {\n useDefinition,\n type UseDefinitionResult,\n} from '../../hooks/useDefinition';\nimport {\n HeaderNavDefinition,\n HeaderNavItemDefinition,\n HeaderNavGroupDefinition,\n} from './HeaderNavDefinition';\nimport { HeaderNavIndicators } from './HeaderNavIndicators';\nimport { MenuTrigger, Menu, MenuItem } from '../Menu';\nimport type {\n HeaderNavLinkProps,\n HeaderNavTabGroup,\n HeaderNavTabItem,\n} from './types';\nimport { useRoutingIntegration } from '../../navigation/useRouting';\nimport type { AnchorNavigation } from '../../navigation/useNavigation';\n\nfunction isTabGroup(tab: HeaderNavTabItem): tab is HeaderNavTabGroup {\n return 'items' in tab;\n}\n\ntype HeaderNavLinkViewProps = {\n definitionResult: UseDefinitionResult<\n typeof HeaderNavItemDefinition,\n HeaderNavLinkProps\n >;\n navigation: AnchorNavigation;\n};\n\nfunction HeaderNavLinkView({\n definitionResult,\n navigation,\n}: HeaderNavLinkViewProps) {\n const { ownProps, analytics } = definitionResult;\n const { id, label, active, registerRef, onHighlight } = ownProps;\n const { href } = ownProps;\n\n const linkRef = useRef<HTMLAnchorElement>(null);\n let ariaHref = href;\n let routerOptions: NavigateOptions | undefined;\n if (navigation.type === 'router') {\n ariaHref = navigation.ariaHref;\n routerOptions = navigation.routerOptions;\n } else if (navigation.type === 'native') {\n ariaHref = navigation.ariaHref;\n }\n const { linkProps } = useLink(\n {\n href: ariaHref,\n routerOptions,\n },\n linkRef,\n );\n const { hoverProps } = useHover({\n onHoverStart: () => onHighlight(id),\n onHoverEnd: () => onHighlight(null),\n });\n\n const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n linkProps.onClick?.(e);\n analytics.captureEvent('click', label, {\n attributes: { to: href },\n });\n };\n const { href: _href, ...anchorProps } = mergeProps(\n linkProps,\n hoverProps,\n ) as React.AnchorHTMLAttributes<HTMLAnchorElement>;\n const ref = (el: HTMLAnchorElement | null) => {\n (linkRef as React.MutableRefObject<HTMLAnchorElement | null>).current = el;\n registerRef(id, el);\n };\n const commonProps = {\n ...anchorProps,\n ref,\n className: ownProps.classes.root,\n 'aria-current': active ? ('page' as const) : undefined,\n onClick: handleClick,\n onFocus: () => onHighlight(id),\n onBlur: () => onHighlight(null),\n children: label,\n };\n const browserHref =\n navigation.type === 'native' ? navigation.browserHref : href;\n\n return (\n <li>\n {navigation.type === 'router' ? (\n <navigation.Link\n {...commonProps}\n {...navigation.routerLinkOptions}\n to={navigation.to}\n />\n ) : (\n <a {...commonProps} href={browserHref} />\n )}\n </li>\n );\n}\n\nfunction HeaderNavLink(props: HeaderNavLinkProps) {\n const definitionResult = useDefinition(HeaderNavItemDefinition, props);\n const Navigation = definitionResult.navigation;\n\n return (\n <Navigation\n props={{ href: definitionResult.ownProps.href }}\n view={HeaderNavLinkView}\n viewProps={{ definitionResult }}\n />\n );\n}\n\ninterface HeaderNavGroupItemProps {\n group: HeaderNavTabGroup;\n active: boolean;\n activeChildId?: string;\n registerRef: (key: string, el: HTMLElement | null) => void;\n onHighlight: (key: string | null) => void;\n}\n\nfunction HeaderNavGroupItem(props: HeaderNavGroupItemProps) {\n const { group, active, activeChildId, registerRef, onHighlight } = props;\n const { ownProps } = useDefinition(HeaderNavGroupDefinition, {});\n const { hoverProps } = useHover({\n onHoverStart: () => onHighlight(group.id),\n onHoverEnd: () => onHighlight(null),\n });\n\n return (\n <li>\n <MenuTrigger>\n <RAButton\n ref={el => {\n registerRef(group.id, el);\n }}\n className={ownProps.classes.root}\n aria-current={active ? 'page' : undefined}\n {...hoverProps}\n onFocus={() => onHighlight(group.id)}\n onBlur={() => onHighlight(null)}\n >\n {group.label}\n <RiArrowDownSLine size={16} />\n </RAButton>\n <Menu\n selectionMode=\"single\"\n selectedKeys={new Set(activeChildId ? [activeChildId] : [])}\n >\n {group.items.map(item => (\n <MenuItem key={item.id} id={item.id} href={item.href}>\n {item.label}\n </MenuItem>\n ))}\n </Menu>\n </MenuTrigger>\n </li>\n );\n}\n\ninterface HeaderNavProps {\n tabs: HeaderNavTabItem[];\n activeTabId?: string | null;\n}\n\nfunction useAutoActiveTabId(tabs: HeaderNavTabItem[]): string | undefined {\n const routing = useRoutingIntegration({ fallback: true });\n const basePath = routing.useResolvedPath('.').pathname;\n const { pathname } = routing.useLocation();\n\n return useMemo(() => {\n const allTabs = tabs.flatMap(tab => (isTabGroup(tab) ? tab.items : [tab]));\n const routeObjects = allTabs.map(tab => ({\n path: `${resolvePath(tab.href, basePath).pathname}/*`,\n id: tab.id,\n }));\n const matches = matchRoutes(routeObjects, pathname);\n return matches?.[0]?.route.id;\n }, [tabs, basePath, pathname]);\n}\n\nfunction HeaderNavAutoDetect(props: { tabs: HeaderNavTabItem[] }) {\n const activeTabId = useAutoActiveTabId(props.tabs);\n return <HeaderNavInner tabs={props.tabs} activeTabId={activeTabId} />;\n}\n\nfunction HeaderNavInner(props: HeaderNavProps) {\n const { tabs, activeTabId } = props;\n const { ownProps } = useDefinition(HeaderNavDefinition, {\n tabs,\n activeTabId,\n });\n const { classes } = ownProps;\n\n const { isFocusVisible } = useFocusVisible();\n const navRef = useRef<HTMLElement>(null);\n const itemRefs = useRef<Map<string, HTMLElement>>(new Map());\n\n const [highlightedKey, setHighlightedKey] = useState<string | null>(null);\n\n // Resolve activeTabId to a top-level key (groups own their children's active state)\n const { activeKey, activeChildId } = useMemo(() => {\n if (!activeTabId) return { activeKey: undefined, activeChildId: undefined };\n for (const item of tabs) {\n if (isTabGroup(item)) {\n const child = item.items.find(c => c.id === activeTabId);\n if (child) {\n return { activeKey: item.id, activeChildId: child.id };\n }\n } else if (item.id === activeTabId) {\n return { activeKey: item.id, activeChildId: undefined };\n }\n }\n return { activeKey: undefined, activeChildId: undefined };\n }, [activeTabId, tabs]);\n\n const registerRef = useCallback((key: string, el: HTMLElement | null) => {\n if (el) {\n itemRefs.current.set(key, el);\n } else {\n itemRefs.current.delete(key);\n }\n }, []);\n\n return (\n <nav\n ref={navRef}\n aria-label=\"Content navigation\"\n className={classes.root}\n data-focus-visible={isFocusVisible || undefined}\n >\n <ul role=\"list\" className={classes.list}>\n {tabs.map(item =>\n isTabGroup(item) ? (\n <HeaderNavGroupItem\n key={item.id}\n group={item}\n active={activeKey === item.id}\n activeChildId={activeChildId}\n registerRef={registerRef}\n onHighlight={setHighlightedKey}\n />\n ) : (\n <HeaderNavLink\n key={item.id}\n id={item.id}\n label={item.label}\n href={item.href}\n active={activeKey === item.id}\n registerRef={registerRef}\n onHighlight={setHighlightedKey}\n />\n ),\n )}\n </ul>\n <HeaderNavIndicators\n navRef={navRef}\n itemRefs={itemRefs}\n activeKey={activeKey}\n highlightedKey={highlightedKey}\n classes={{ active: classes.active, hovered: classes.hovered }}\n />\n </nav>\n );\n}\n\n/** @internal */\nexport function HeaderNav(props: HeaderNavProps) {\n const routing = useRoutingIntegration({ fallback: true });\n const inRouter = routing.useInRouterContext();\n\n if (props.activeTabId === undefined && inRouter) {\n return <HeaderNavAutoDetect tabs={props.tabs} />;\n }\n\n return <HeaderNavInner tabs={props.tabs} activeTabId={props.activeTabId} />;\n}\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { HeaderOwnProps } from './types';\nimport styles from './Header.module.css';\n\n/**\n * Component definition for Header\n * @public\n */\nexport const HeaderDefinition = defineComponent<HeaderOwnProps>()({\n styles,\n bg: 'consumer',\n classNames: {\n headerTop: 'bui-HeaderTop',\n stickySentinel: 'bui-HeaderStickySentinel',\n content: 'bui-HeaderContent',\n headerBottom: 'bui-HeaderBottom',\n breadcrumbs: 'bui-HeaderBreadcrumbs',\n breadcrumbsSmall: 'bui-HeaderBreadcrumbsSmall',\n breadcrumbLink: 'bui-HeaderBreadcrumbLink',\n breadcrumbLinkSmall: 'bui-HeaderBreadcrumbLinkSmall',\n breadcrumbSeparator: 'bui-HeaderBreadcrumbSeparator',\n titleStack: 'bui-HeaderTitleStack',\n title: 'bui-HeaderTitle',\n titleSmall: 'bui-HeaderTitleSmall',\n tabsWrapper: 'bui-HeaderTabsWrapper',\n controls: 'bui-HeaderControls',\n tags: 'bui-HeaderTags',\n tag: 'bui-HeaderTag',\n description: 'bui-HeaderDescription',\n metaRow: 'bui-HeaderMetaRow',\n metaItem: 'bui-HeaderMetaItem',\n },\n propDefs: {\n title: {},\n customActions: {},\n tabs: {},\n activeTabId: {},\n breadcrumbs: {},\n description: {},\n tags: {},\n metadata: {},\n className: {},\n sticky: {},\n },\n});\n\n/**\n * @public\n * @deprecated Use {@link HeaderDefinition} instead.\n */\nexport const HeaderPageDefinition = HeaderDefinition;\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-HeaderTop\":\"d6yO0l4zz3McSdPg\",\"bui-HeaderContent\":\"hxIvk7f5W8T4u0_x\",\"bui-HeaderBottom\":\"sBCid7jAqHsYIqrc\",\"bui-HeaderStickySentinel\":\"kgD85NRPA0_J5Iqx\",\"bui-HeaderTabsWrapper\":\"bmVIsoUAhPwZBrh_\",\"bui-HeaderControls\":\"UuTgL1HrLw8aKiHC\",\"bui-HeaderTitleStack\":\"w9_h0inOJpAMDApB\",\"bui-HeaderBreadcrumbs\":\"JmA59TJW3k6oKPSn\",\"bui-HeaderBreadcrumbsSmall\":\"QSVW3yKFsQP6ay8p\",\"bui-HeaderBreadcrumbLink\":\"SPZSvNw8pXooRGZu\",\"bui-HeaderBreadcrumbLinkSmall\":\"bRhhaD21XwcEowH6\",\"bui-HeaderBreadcrumbSeparator\":\"q6r_2qtCYEk5f5C9\",\"bui-HeaderTitle\":\"CyePbw1pK5EaaY97\",\"bui-HeaderTitleSmall\":\"lICQaeQ7nwoibiTw\",\"bui-HeaderTags\":\"R9Lx7hYf6AHO68V8\",\"bui-HeaderTag\":\"rEvQyPKFaVAQxtKb\",\"bui-HeaderMetaRow\":\"EQFjSGwLsNsPXHwU\",\"bui-HeaderMetaItem\":\"NlFYkGgXGOEb2VXg\"};","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { HeaderProps } from './types';\nimport { Text } from '../Text';\nimport { RiArrowRightSLine } from '@remixicon/react';\nimport { HeaderNav } from './HeaderNav';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { HeaderDefinition } from './definition';\nimport { sanitizeUrl } from '@braintree/sanitize-url';\nimport { Lexer } from 'marked';\nimport { Link } from '../Link';\nimport { Fragment, useEffect, useMemo, useRef, useState } from 'react';\nimport { Container } from '../Container';\n\nconst getScrollParent = (element: HTMLElement | null): Element | null => {\n let parent = element?.parentElement;\n\n while (parent) {\n const { overflow, overflowX, overflowY } = window.getComputedStyle(parent);\n\n if (\n /(auto|scroll|overlay|hidden)/.test(`${overflow}${overflowX}${overflowY}`)\n ) {\n return parent;\n }\n\n parent = parent.parentElement;\n }\n\n return null;\n};\n\nconst isStickySentinelOutOfView = (\n sentinel: HTMLElement,\n root: Element | null,\n) => {\n const sentinelRect = sentinel.getBoundingClientRect();\n const rootTop = root ? root.getBoundingClientRect().top : 0;\n\n return sentinelRect.bottom <= rootTop;\n};\n\n/**\n * Parses inline Markdown links in a string and returns an array of React nodes.\n * URLs are sanitized via `@braintree/sanitize-url`; unsafe URLs are rendered as\n * plain text. Uses `marked` instead of `react-markdown` to avoid ESM issues.\n */\nfunction renderInlineMarkdown(text: string): React.ReactNode[] {\n return Lexer.lexInline(text).map((token, i) => {\n if (token.type === 'link') {\n const href = sanitizeUrl(token.href);\n if (href === 'about:blank') return token.text;\n return (\n <Link key={i} href={href} standalone>\n {token.text}\n </Link>\n );\n }\n return token.raw;\n });\n}\n\n/**\n * A secondary header with title, breadcrumbs, tabs, and actions.\n *\n * @public\n */\nexport const Header = (props: HeaderProps) => {\n const { ownProps, dataAttributes } = useDefinition(HeaderDefinition, props, {\n classNameTarget: 'content',\n });\n const {\n classes,\n title,\n tabs,\n activeTabId,\n customActions,\n breadcrumbs,\n description,\n tags,\n metadata,\n sticky,\n } = ownProps;\n\n const descriptionNodes = useMemo(\n () => (description ? renderInlineMarkdown(description) : null),\n [description],\n );\n\n // The sentinel sits directly before the sticky content and leaves the\n // viewport when the content becomes stuck, letting us toggle stuck styling.\n const stickySentinelRef = useRef<HTMLDivElement>(null);\n const [isStuck, setIsStuck] = useState(false);\n\n useEffect(() => {\n if (!sticky) {\n setIsStuck(false);\n return;\n }\n\n const sentinel = stickySentinelRef.current;\n if (!sentinel) {\n return;\n }\n\n const root = getScrollParent(sentinel);\n\n if (typeof IntersectionObserver === 'undefined') {\n const updateStuckState = () => {\n setIsStuck(isStickySentinelOutOfView(sentinel, root));\n };\n const scrollTarget = root ?? window;\n\n updateStuckState();\n scrollTarget.addEventListener('scroll', updateStuckState, {\n passive: true,\n });\n window.addEventListener('resize', updateStuckState);\n\n return () => {\n scrollTarget.removeEventListener('scroll', updateStuckState);\n window.removeEventListener('resize', updateStuckState);\n };\n }\n\n const observer = new IntersectionObserver(\n ([entry]) => {\n setIsStuck(!entry.isIntersecting);\n },\n { root, threshold: 0 },\n );\n\n observer.observe(sentinel);\n\n return () => {\n observer.disconnect();\n };\n }, [sticky]);\n\n return (\n <>\n <Container\n className={classes.headerTop}\n data-sticky={sticky || undefined}\n >\n {tags && tags.length > 0 && (\n <ul className={classes.tags}>\n {tags.map((tag, i) => (\n <li\n key={`${i}:${tag.label}:${tag.href ?? ''}`}\n className={classes.tag}\n >\n {tag.href ? (\n <Link\n href={tag.href}\n variant=\"body-medium\"\n color=\"secondary\"\n standalone\n >\n {tag.label}\n </Link>\n ) : (\n <Text variant=\"body-medium\" color=\"secondary\">\n {tag.label}\n </Text>\n )}\n </li>\n ))}\n </ul>\n )}\n </Container>\n {sticky && (\n <div\n ref={stickySentinelRef}\n className={classes.stickySentinel}\n data-sticky=\"\"\n aria-hidden=\"true\"\n />\n )}\n <Container\n className={classes.content}\n data-sticky={sticky || undefined}\n data-stuck={isStuck || undefined}\n data-has-tags={tags && tags.length > 0 ? '' : undefined}\n {...dataAttributes}\n >\n <div className={classes.titleStack}>\n {isStuck ? (\n <div className={classes.breadcrumbsSmall}>\n {breadcrumbs &&\n breadcrumbs.map(breadcrumb => (\n <Fragment key={breadcrumb.label}>\n <Link\n href={breadcrumb.href}\n color=\"secondary\"\n className={classes.breadcrumbLinkSmall}\n standalone\n >\n {breadcrumb.label}\n </Link>\n <RiArrowRightSLine\n className={classes.breadcrumbSeparator}\n size={16}\n color=\"var(--bui-fg-secondary)\"\n />\n </Fragment>\n ))}\n <h2 className={classes.titleSmall}>{title}</h2>\n </div>\n ) : (\n <div className={classes.breadcrumbs}>\n {breadcrumbs &&\n breadcrumbs.map(breadcrumb => (\n <Fragment key={breadcrumb.label}>\n <Link\n href={breadcrumb.href}\n color=\"secondary\"\n className={classes.breadcrumbLink}\n standalone\n >\n {breadcrumb.label}\n </Link>\n <RiArrowRightSLine\n className={classes.breadcrumbSeparator}\n size={16}\n color=\"var(--bui-fg-secondary)\"\n />\n </Fragment>\n ))}\n <h2 className={classes.title}>{title}</h2>\n </div>\n )}\n </div>\n <div className={classes.controls}>{customActions}</div>\n </Container>\n <Container\n className={classes.headerBottom}\n data-sticky={sticky || undefined}\n >\n {description && (\n <Text\n variant=\"body-medium\"\n color=\"secondary\"\n className={classes.description}\n >\n {descriptionNodes}\n </Text>\n )}\n {metadata && metadata.length > 0 && (\n <dl className={classes.metaRow}>\n {metadata.map((item, i) => (\n <div key={`${i}:${item.label}`} className={classes.metaItem}>\n <dt>\n <Text variant=\"body-medium\" color=\"secondary\">\n {item.label}\n </Text>\n </dt>\n <dd>\n {typeof item.value === 'string' ? (\n <Text variant=\"body-medium\">{item.value}</Text>\n ) : (\n item.value\n )}\n </dd>\n </div>\n ))}\n </dl>\n )}\n {tabs && (\n <div className={classes.tabsWrapper}>\n <HeaderNav tabs={tabs} activeTabId={activeTabId} />\n </div>\n )}\n </Container>\n </>\n );\n};\n\n/**\n * @public\n * @deprecated Use {@link Header} instead.\n */\nexport const HeaderPage = Header;\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n Entity,\n CompoundEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { Fragment } from 'react';\nimport { EntityRefLink } from './EntityRefLink';\nimport { LinkProps } from '@backstage/core-components';\n\n/**\n * Props for {@link EntityRefLink}.\n *\n * @public\n */\nexport type EntityRefLinksProps<\n TRef extends string | CompoundEntityRef | Entity,\n> = {\n defaultKind?: string;\n entityRefs: TRef[];\n hideIcons?: boolean;\n /** @deprecated This option is no longer used; presentation is handled by entityPresentationApiRef instead */\n fetchEntities?: boolean;\n /** @deprecated This option is no longer used; presentation is handled by entityPresentationApiRef instead */\n getTitle?(entity: TRef): string | undefined;\n} & Omit<LinkProps, 'to'>;\n\n/**\n * Shows a list of clickable links to entities.\n *\n * @public\n */\nexport function EntityRefLinks<\n TRef extends string | CompoundEntityRef | Entity,\n>(props: EntityRefLinksProps<TRef>) {\n const { entityRefs, hideIcons, ...linkProps } = props;\n\n return (\n <>\n {entityRefs.map((r: TRef, i: number) => {\n const entityRefString =\n typeof r === 'string' ? r : stringifyEntityRef(r);\n return (\n <Fragment key={`${i}.${entityRefString}`}>\n {i > 0 && ', '}\n <EntityRefLink {...linkProps} entityRef={r} hideIcon={hideIcons} />\n </Fragment>\n );\n })}\n </>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n CompoundEntityRef,\n parseEntityRef,\n} from '@backstage/catalog-model';\n\n// TODO(freben): This should be returning entity refs instead\n/**\n * Get the related entity references.\n *\n * @public\n */\nexport function getEntityRelations(\n entity: Entity | undefined,\n relationType: string,\n filter?: { kind: string },\n): CompoundEntityRef[] {\n let entityNames =\n entity?.relations\n ?.filter(r => r.type === relationType)\n .map(r => parseEntityRef(r.targetRef)) || [];\n\n if (filter?.kind) {\n entityNames = entityNames.filter(\n e => e.kind.toLowerCase() === filter.kind.toLowerCase(),\n );\n }\n\n return entityNames;\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n CompoundEntityRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { useCallback, useEffect, useState } from 'react';\nimport { starredEntitiesApiRef } from '../apis';\n\nfunction getEntityRef(\n entityOrRef: Entity | CompoundEntityRef | string,\n): string {\n return typeof entityOrRef === 'string'\n ? entityOrRef\n : stringifyEntityRef(entityOrRef);\n}\n\n/** @public */\nexport function useStarredEntity(\n entityOrRef: Entity | CompoundEntityRef | string,\n): {\n toggleStarredEntity: () => void;\n isStarredEntity: boolean;\n} {\n const starredEntitiesApi = useApi(starredEntitiesApiRef);\n\n const [isStarredEntity, setIsStarredEntity] = useState(false);\n\n useEffect(() => {\n const subscription = starredEntitiesApi.starredEntitie$().subscribe({\n next(starredEntities: Set<string>) {\n setIsStarredEntity(starredEntities.has(getEntityRef(entityOrRef)));\n },\n });\n\n return () => {\n subscription.unsubscribe();\n };\n }, [entityOrRef, starredEntitiesApi]);\n\n const toggleStarredEntity = useCallback(\n () => starredEntitiesApi.toggleStarred(getEntityRef(entityOrRef)).then(),\n [entityOrRef, starredEntitiesApi],\n );\n\n return {\n toggleStarredEntity,\n isStarredEntity,\n };\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport IconButton from '@material-ui/core/IconButton';\nimport { ComponentProps } from 'react';\nimport { useStarredEntity } from '../../hooks/useStarredEntity';\nimport { catalogReactTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { FavoriteToggle } from '@backstage/core-components';\n\n/** @public */\nexport type FavoriteEntityProps = ComponentProps<typeof IconButton> & {\n entity: Entity;\n};\n\n/**\n * IconButton for showing if a current entity is starred and adding/removing it from the favorite entities\n * @param props - MaterialUI IconButton props extended by required `entity` prop\n * @public\n */\nexport const FavoriteEntity = (props: FavoriteEntityProps) => {\n const { toggleStarredEntity, isStarredEntity } = useStarredEntity(\n props.entity,\n );\n const { t } = useTranslationRef(catalogReactTranslationRef);\n const title = isStarredEntity\n ? t('favoriteEntity.removeFromFavorites')\n : t('favoriteEntity.addToFavorites');\n\n const id = `favorite-${stringifyEntityRef(props.entity).replace(\n /[^a-zA-Z0-9-_]/g,\n '-',\n )}`;\n\n return (\n <FavoriteToggle\n title={title}\n id={id}\n isFavorite={isStarredEntity}\n onToggle={toggleStarredEntity}\n {...props}\n />\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { type ComponentType, Suspense, lazy } from 'react';\nimport type { DependencyGraphProps } from './DependencyGraphContent';\n\nexport type { DependencyGraphProps } from './DependencyGraphContent';\n\nconst LazyDependencyGraphContent = lazy(() =>\n import('./DependencyGraphContent').then(m => ({\n default: m.DependencyGraph as ComponentType<any>,\n })),\n);\n\n/**\n * Graph component used to visualize relations between entities\n *\n * @public\n */\nexport function DependencyGraph<NodeData, EdgeData>(\n props: DependencyGraphProps<NodeData, EdgeData>,\n) {\n return (\n <Suspense fallback={<div />}>\n <LazyDependencyGraphContent {...props} />\n </Suspense>\n );\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { parseEntityRef } from '@backstage/catalog-model';\nimport { useApp } from '@backstage/core-plugin-api';\nimport SvgIcon from '@material-ui/core/SvgIcon';\n\nconst DEFAULT_ICON = SvgIcon;\n\nfunction getKind(\n kind: string | undefined,\n entityRef: string | undefined,\n): string | undefined {\n if (kind) {\n return kind.toLowerCase();\n }\n\n if (entityRef) {\n try {\n return parseEntityRef(entityRef).kind.toLowerCase();\n } catch {\n return undefined;\n }\n }\n\n return undefined;\n}\n\nfunction useIcon(kind: string | undefined, entityRef: string | undefined) {\n const app = useApp();\n\n const actualKind = getKind(kind, entityRef);\n if (!actualKind) {\n return DEFAULT_ICON;\n }\n\n const icon = app.getSystemIcon(`kind:${actualKind}`);\n return icon || DEFAULT_ICON;\n}\n\nexport function EntityKindIcon(props: {\n kind?: string;\n entityRef?: string;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n className?: string;\n}) {\n const { kind, entityRef, ...otherProps } = props;\n const Icon = useIcon(kind, entityRef);\n return <Icon {...otherProps} />;\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n DEFAULT_NAMESPACE,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n DependencyGraph,\n DependencyGraphTypes,\n Link,\n Progress,\n ResponseErrorPanel,\n} from '@backstage/core-components';\nimport { useApi, useApp, useRouteRef } from '@backstage/core-plugin-api';\nimport { Text, Box } from '@backstage/ui';\nimport { makeStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { useLayoutEffect, useRef, useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogApiRef } from '../../../api';\nimport { entityRouteRef } from '../../../routes';\nimport { useEntityPresentation } from '../../../apis';\nimport { EntityKindIcon } from './EntityKindIcon';\nimport { catalogReactTranslationRef } from '../../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nconst useStyles = makeStyles(theme => ({\n node: {\n fill: theme.palette.grey[300],\n stroke: theme.palette.grey[300],\n '&.primary': {\n fill: theme.palette.primary.light,\n stroke: theme.palette.primary.light,\n },\n '&.secondary': {\n fill: theme.palette.secondary.light,\n stroke: theme.palette.secondary.light,\n },\n },\n text: {\n fill: theme.palette.getContrastText(theme.palette.grey[300]),\n '&.primary': {\n fill: theme.palette.primary.contrastText,\n },\n '&.secondary': {\n fill: theme.palette.secondary.contrastText,\n },\n '&.focused': {\n fontWeight: 'bold',\n },\n },\n clickable: {\n cursor: 'pointer',\n },\n}));\n\ntype NodeType = Entity & { root: boolean };\n\nfunction useAncestry(root: Entity): {\n loading: boolean;\n error?: Error;\n nodes: DependencyGraphTypes.DependencyNode<NodeType>[];\n edges: DependencyGraphTypes.DependencyEdge[];\n} {\n const catalogClient = useApi(catalogApiRef);\n const entityRef = stringifyEntityRef(root);\n\n const { loading, error, value } = useAsync(async () => {\n const response = await catalogClient.getEntityAncestors({ entityRef });\n const nodes = new Array<DependencyGraphTypes.DependencyNode<NodeType>>();\n const edges = new Array<DependencyGraphTypes.DependencyEdge>();\n for (const current of response.items) {\n const currentRef = stringifyEntityRef(current.entity);\n const isRootNode = currentRef === response.rootEntityRef;\n nodes.push({ id: currentRef, root: isRootNode, ...current.entity });\n for (const parentRef of current.parentEntityRefs) {\n edges.push({ from: currentRef, to: parentRef });\n }\n }\n return { nodes, edges };\n }, [entityRef]);\n\n return {\n loading,\n error,\n nodes: value?.nodes || [],\n edges: value?.edges || [],\n };\n}\n\nfunction CustomNode({ node }: DependencyGraphTypes.RenderNodeProps<NodeType>) {\n const classes = useStyles();\n const navigate = useNavigate();\n const entityRoute = useRouteRef(entityRouteRef);\n const [width, setWidth] = useState(0);\n const [height, setHeight] = useState(0);\n const app = useApp();\n const idRef = useRef<SVGTextElement | null>(null);\n\n useLayoutEffect(() => {\n // set the width to the length of the ID\n if (idRef.current) {\n let { height: renderedHeight, width: renderedWidth } =\n idRef.current.getBBox();\n renderedHeight = Math.round(renderedHeight);\n renderedWidth = Math.round(renderedWidth);\n if (renderedHeight !== height || renderedWidth !== width) {\n setWidth(renderedWidth);\n setHeight(renderedHeight);\n }\n }\n }, [width, height]);\n\n const hasKindIcon = app.getSystemIcon(`kind:${node.kind.toLowerCase()}`);\n const padding = 10;\n const iconSize = height;\n const paddedIconWidth = hasKindIcon ? iconSize + padding : 0;\n const paddedWidth = paddedIconWidth + width + padding * 2;\n const paddedHeight = height + padding * 2;\n\n const { primaryTitle: displayTitle } = useEntityPresentation(node);\n\n const onClick = () => {\n navigate(\n entityRoute({\n kind: node.kind,\n namespace: node.metadata.namespace || DEFAULT_NAMESPACE,\n name: node.metadata.name,\n }),\n );\n };\n\n return (\n <g onClick={onClick} className={classes.clickable}>\n <rect\n className={classNames(\n classes.node,\n node.root ? 'secondary' : 'primary',\n )}\n width={paddedWidth}\n height={paddedHeight}\n rx={10}\n />\n {hasKindIcon && (\n <EntityKindIcon\n kind={node.kind}\n y={padding}\n x={padding}\n width={iconSize}\n height={iconSize}\n className={classNames(\n classes.text,\n node.root ? 'secondary' : 'primary',\n )}\n />\n )}\n <text\n ref={idRef}\n className={classNames(\n classes.text,\n node.root ? 'secondary' : 'primary',\n )}\n y={paddedHeight / 2}\n x={paddedIconWidth + (width + padding * 2) / 2}\n textAnchor=\"middle\"\n alignmentBaseline=\"middle\"\n >\n {displayTitle}\n </text>\n </g>\n );\n}\n\nexport function AncestryPage(props: { entity: Entity }) {\n const { loading, error, nodes, edges } = useAncestry(props.entity);\n const { t } = useTranslationRef(catalogReactTranslationRef);\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n return (\n <>\n <Box mb=\"2\">\n <Text as=\"p\">\n {t('inspectEntityDialog.ancestryPage.description', {\n processorsLink: (\n <Link to=\"https://backstage.io/docs/features/software-catalog/life-of-an-entity\">\n {t('inspectEntityDialog.ancestryPage.processorsLink')}\n </Link>\n ),\n })}\n </Text>\n </Box>\n <Box mt=\"8\">\n <DependencyGraph\n nodes={nodes}\n edges={edges}\n renderNode={CustomNode}\n direction={DependencyGraphTypes.Direction.BOTTOM_TOP}\n zoom=\"enable-on-click\"\n />\n </Box>\n </>\n );\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { makeStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { ReactNode } from 'react';\n\nconst useStyles = makeStyles({\n list: {\n listStyle: 'none',\n margin: 0,\n padding: 0,\n },\n indented: {\n paddingLeft: 'var(--bui-space-4)',\n },\n listItem: {\n display: 'flex',\n alignItems: 'flex-start',\n marginTop: 'var(--bui-space-1)',\n paddingLeft: 'var(--bui-space-4)',\n fontFamily: 'monospace',\n fontSize: 'var(--bui-font-size-3)',\n '&:first-child': {\n marginTop: 0,\n },\n },\n});\n\nexport function ListSection(props: {\n children: ReactNode;\n indent?: boolean;\n className?: string;\n 'aria-label'?: string;\n}) {\n const classes = useStyles();\n return (\n <ul\n className={classNames(\n classes.list,\n props.indent && classes.indented,\n props.className,\n )}\n aria-label={props['aria-label']}\n >\n {props.children}\n </ul>\n );\n}\n\n/**\n * A dense monospace list item.\n */\nexport function ListItemRow(props: { children: ReactNode }) {\n const classes = useStyles();\n return <li className={classes.listItem}>{props.children}</li>;\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Native HTML elements like <p> and <header> are used intentionally for\n// semantic markup. The react/forbid-elements rule predates the BUI migration.\n/* eslint-disable react/forbid-elements */\n\nimport {\n Entity,\n ANNOTATION_LOCATION,\n ANNOTATION_ORIGIN_LOCATION,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { Progress, ResponseErrorPanel } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { Text, Alert } from '@backstage/ui';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogApiRef } from '../../../api';\nimport { EntityRefLink } from '../../EntityRefLink';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { ListSection, ListItemRow } from './common';\n\nimport { catalogReactTranslationRef } from '../../../translation';\n\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nconst useStyles = makeStyles({\n header: {\n paddingLeft: 'var(--bui-space-4)',\n marginTop: 'var(--bui-space-4)',\n marginBottom: 'var(--bui-space-4)',\n },\n headerLabel: {\n margin: 0,\n fontFamily: 'monospace',\n fontSize: 'var(--bui-font-size-3)',\n fontWeight: 'var(--bui-font-weight-regular)' as any,\n },\n entityList: {\n marginTop: 'var(--bui-space-4)',\n },\n headerValue: {\n margin: 0,\n marginTop: 'var(--bui-space-1)',\n fontFamily: 'monospace',\n fontSize: 'var(--bui-font-size-3)',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n },\n});\n\nfunction useColocated(entity: Entity): {\n loading: boolean;\n error?: Error;\n location?: string;\n originLocation?: string;\n colocatedEntities?: Entity[];\n} {\n const catalogApi = useApi(catalogApiRef);\n const currentEntityRef = stringifyEntityRef(entity);\n const location = entity.metadata.annotations?.[ANNOTATION_LOCATION];\n const origin = entity.metadata.annotations?.[ANNOTATION_ORIGIN_LOCATION];\n\n const { loading, error, value } = useAsync(async () => {\n if (!location && !origin) {\n return [];\n }\n const response = await catalogApi.getEntities({\n filter: [\n ...(location\n ? [{ [`metadata.annotations.${ANNOTATION_LOCATION}`]: location }]\n : []),\n ...(origin\n ? [\n {\n [`metadata.annotations.${ANNOTATION_ORIGIN_LOCATION}`]: origin,\n },\n ]\n : []),\n ],\n });\n return response.items;\n }, [location, origin]);\n\n return {\n loading,\n error,\n location,\n originLocation: origin,\n colocatedEntities: value?.filter(\n colocated => stringifyEntityRef(colocated) !== currentEntityRef,\n ),\n };\n}\n\nfunction EntityList(props: { entities: Entity[]; header?: [string, string] }) {\n const classes = useStyles();\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return (\n <>\n {props.header && (\n <header className={classes.header}>\n <h4 className={classes.headerLabel}>{props.header[0]}</h4>\n <p className={classes.headerValue}>{props.header[1]}</p>\n </header>\n )}\n <ListSection\n aria-label={t('inspectEntityDialog.colocatedPage.entityListAriaLabel')}\n className={classes.entityList}\n >\n {props.entities.map(entity => (\n <ListItemRow key={stringifyEntityRef(entity)}>\n <EntityRefLink entityRef={entity} />\n </ListItemRow>\n ))}\n </ListSection>\n </>\n );\n}\n\nfunction Contents(props: { entity: Entity }) {\n const { entity } = props;\n const { t } = useTranslationRef(catalogReactTranslationRef);\n\n const { loading, error, location, originLocation, colocatedEntities } =\n useColocated(entity);\n if (loading) {\n return <Progress />;\n } else if (error) {\n return <ResponseErrorPanel error={error} />;\n }\n\n if (!location && !originLocation) {\n return (\n <Alert\n status=\"warning\"\n description={t('inspectEntityDialog.colocatedPage.alertNoLocation')}\n mt=\"4\"\n />\n );\n } else if (!colocatedEntities?.length) {\n return (\n <Alert\n status=\"info\"\n description={t('inspectEntityDialog.colocatedPage.alertNoEntity')}\n mt=\"4\"\n />\n );\n }\n\n if (location === originLocation) {\n return <EntityList entities={colocatedEntities} />;\n }\n\n const atLocation = colocatedEntities.filter(\n e => e.metadata.annotations?.[ANNOTATION_LOCATION] === location,\n );\n const atOrigin = colocatedEntities.filter(\n e =>\n e.metadata.annotations?.[ANNOTATION_ORIGIN_LOCATION] === originLocation,\n );\n\n return (\n <>\n {atLocation.length > 0 && (\n <EntityList\n entities={atLocation}\n header={[\n t('inspectEntityDialog.colocatedPage.locationHeader'),\n location!,\n ]}\n />\n )}\n {atOrigin.length > 0 && (\n <EntityList\n entities={atOrigin}\n header={[\n t('inspectEntityDialog.colocatedPage.originHeader'),\n originLocation!,\n ]}\n />\n )}\n </>\n );\n}\n\nexport function ColocatedPage(props: { entity: Entity }) {\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return (\n <>\n <Text as=\"p\">{t('inspectEntityDialog.colocatedPage.description')}</Text>\n <Contents entity={props.entity} />\n </>\n );\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { JsonObject } from '@backstage/types';\n\nexport function sortKeys(data: JsonObject): JsonObject {\n // we could do something custom, but lexicographical sorting is actually a\n // good choice at least for the default set of keys\n return Object.fromEntries(\n [...Object.entries(data)].sort((a, b) => (a[0] < b[0] ? -1 : 1)),\n );\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { CodeSnippet } from '@backstage/core-components';\nimport { Text } from '@backstage/ui';\nimport { sortKeys } from './util';\nimport { catalogReactTranslationRef } from '../../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nexport function JsonPage(props: { entity: Entity }) {\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return (\n <>\n <Text as=\"p\">{t('inspectEntityDialog.jsonPage.description')}</Text>\n <div data-testid=\"code-snippet\">\n <CodeSnippet\n text={JSON.stringify(sortKeys(props.entity), undefined, 2)}\n language=\"json\"\n showCopyCodeButton\n />\n </div>\n </>\n );\n}\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-TagList\":\"RH6vZOMUe3ozH13w\",\"bui-Tag\":\"RbVv4ECvOgnU1Dwb\",\"bui-TagRemoveButton\":\"l9zJlYdsd_AvoCWG\",\"bui-TagIcon\":\"APxTgEybjsYQrIC6\"};","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { TagGroupOwnProps, TagOwnProps } from './types';\nimport styles from './TagGroup.module.css';\n\n/**\n * Component definition for TagGroup\n * @public\n */\nexport const TagGroupDefinition = defineComponent<TagGroupOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TagGroup',\n list: 'bui-TagList',\n },\n propDefs: {\n items: {},\n children: {},\n renderEmptyState: {},\n className: {},\n },\n});\n\n/** @internal */\nexport const TagDefinition = defineComponent<TagOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Tag',\n icon: 'bui-TagIcon',\n removeButton: 'bui-TagRemoveButton',\n },\n analytics: true,\n propDefs: {\n noTrack: {},\n icon: {},\n size: { dataAttribute: true, default: 'small' },\n children: {},\n className: {},\n },\n});\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { TagProps, TagGroupProps } from './types';\nimport {\n TagGroup as ReactAriaTagGroup,\n TagList as ReactAriaTagList,\n Tag as ReactAriaTag,\n Button as ReactAriaButton,\n} from 'react-aria-components';\nimport { forwardRef, type ReactNode } from 'react';\nimport { RiCloseCircleLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { TagGroupDefinition, TagDefinition } from './definition';\nimport { getNodeText } from '../../analytics/getNodeText';\nimport { BUIRoutingProvider } from '../../navigation/BUIRoutingProvider';\n\n/**\n * A component that renders a list of tags.\n *\n * @public\n */\nexport const TagGroup = <T extends object>(props: TagGroupProps<T>) => {\n const { ownProps, restProps } = useDefinition(TagGroupDefinition, props);\n const { classes, items, children, renderEmptyState } = ownProps;\n\n return (\n <BUIRoutingProvider>\n <ReactAriaTagGroup className={classes.root} {...restProps}>\n <ReactAriaTagList\n className={classes.list}\n items={items}\n renderEmptyState={renderEmptyState}\n >\n {children}\n </ReactAriaTagList>\n </ReactAriaTagGroup>\n </BUIRoutingProvider>\n );\n};\n\n/**\n * A component that renders a tag.\n *\n * @public\n */\nexport const Tag = forwardRef<HTMLDivElement, TagProps>((props, ref) => {\n const { ownProps, restProps, dataAttributes, analytics } = useDefinition(\n TagDefinition,\n props,\n );\n const { classes, children, icon } = ownProps;\n const rawHref = restProps.href;\n const textValue = typeof children === 'string' ? children : undefined;\n\n const handlePress: typeof restProps.onPress = e => {\n restProps.onPress?.(e);\n if (rawHref) {\n const text =\n (restProps as React.AriaAttributes)['aria-label'] ??\n textValue ??\n getNodeText(children) ??\n String(rawHref);\n analytics.captureEvent('click', text, {\n attributes: { to: String(rawHref) },\n });\n }\n };\n\n return (\n <ReactAriaTag\n ref={ref}\n textValue={textValue}\n className={classes.root}\n {...dataAttributes}\n {...restProps}\n onPress={handlePress}\n >\n {({ allowsRemoving }) => (\n <>\n {icon && <span className={classes.icon}>{icon}</span>}\n {children as ReactNode}\n {allowsRemoving && (\n <ReactAriaButton className={classes.removeButton} slot=\"remove\">\n <RiCloseCircleLine size={16} />\n </ReactAriaButton>\n )}\n </>\n )}\n </ReactAriaTag>\n );\n});\n\nTag.displayName = 'Tag';\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AlphaEntity } from '@backstage/catalog-model/alpha';\nimport { Link } from '@backstage/core-components';\nimport {\n Text,\n Box,\n Flex,\n Card,\n CardHeader,\n CardBody,\n TagGroup,\n Tag,\n ButtonIcon,\n ButtonLink,\n VisuallyHidden,\n} from '@backstage/ui';\nimport { makeStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { RiFileCopyLine, RiCheckLine, RiQuestionLine } from '@remixicon/react';\nimport groupBy from 'lodash/groupBy';\nimport sortBy from 'lodash/sortBy';\nimport { ReactNode, useEffect, useRef, useState } from 'react';\nimport { EntityRefLink } from '../../EntityRefLink';\nimport { ListSection, ListItemRow } from './common';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { catalogReactTranslationRef } from '../../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nconst useStyles = makeStyles({\n headingWithIcon: {\n display: 'flex',\n alignItems: 'center',\n },\n definitionList: {\n margin: 0,\n padding: 0,\n },\n definitionItem: {\n display: 'flex',\n alignItems: 'flex-start',\n marginTop: 'var(--bui-space-4)',\n paddingLeft: 'var(--bui-space-4)',\n fontFamily: 'monospace',\n fontSize: 'var(--bui-font-size-3)',\n '&:first-child': {\n marginTop: 0,\n },\n },\n definitionContent: {\n flex: 1,\n minWidth: 0,\n },\n definitionKey: {\n fontWeight: 'bold',\n },\n definitionValue: {\n margin: 0,\n marginTop: 'var(--bui-space-1)',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n },\n copyAction: {\n marginLeft: 'var(--bui-space-2)',\n flexShrink: 0,\n },\n relationGroup: {\n '& + &': {\n marginTop: 'var(--bui-space-4)',\n },\n },\n monospace: {\n fontFamily: 'monospace',\n },\n sectionHeading: {\n marginTop: 'var(--bui-space-3)',\n },\n metadataList: {\n marginTop: 'var(--bui-space-2)',\n },\n relationList: {\n marginTop: 'var(--bui-space-2)',\n },\n tagGroup: {\n marginTop: 'var(--bui-space-3)',\n paddingLeft: 'var(--bui-space-4)',\n },\n});\n\n// Extracts a link from a value, if possible\nfunction findLink(value: string): string | undefined {\n if (value.match(/^url:https?:\\/\\//)) {\n return value.slice('url:'.length);\n }\n if (value.match(/^https?:\\/\\//)) {\n return value;\n }\n return undefined;\n}\n\nfunction entriesToItems(entries: [string, string][]) {\n return entries.map(([key, value]) => {\n const link = findLink(value);\n return {\n key,\n value: link ? <Link to={link}>{value}</Link> : value,\n };\n });\n}\n\nfunction CopyButton({ text, label }: { text: string; label: string }) {\n const { t } = useTranslationRef(catalogReactTranslationRef);\n const [copied, setCopied] = useState(false);\n const timerRef = useRef<ReturnType<typeof setTimeout>>();\n\n useEffect(() => () => clearTimeout(timerRef.current), []);\n\n const handlePress = async () => {\n try {\n await window.navigator.clipboard.writeText(text);\n setCopied(true);\n timerRef.current = setTimeout(() => setCopied(false), 2000);\n } catch {\n // Clipboard access denied or unavailable\n }\n };\n\n return (\n <>\n <ButtonIcon\n icon={copied ? <RiCheckLine /> : <RiFileCopyLine />}\n aria-label={t('inspectEntityDialog.overviewPage.copyAriaLabel', {\n label,\n })}\n variant=\"tertiary\"\n size=\"small\"\n onPress={handlePress}\n />\n <VisuallyHidden role=\"status\">\n {copied ? t('inspectEntityDialog.overviewPage.copiedStatus') : ''}\n </VisuallyHidden>\n </>\n );\n}\n\nfunction HelpIcon(props: { to: string }) {\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return (\n <ButtonLink\n href={props.to}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n variant=\"tertiary\"\n size=\"small\"\n iconStart={<RiQuestionLine />}\n aria-label={t('inspectEntityDialog.overviewPage.helpLinkAriaLabel')}\n />\n );\n}\n\nfunction Container(props: {\n title: ReactNode;\n helpLink?: string;\n children: ReactNode;\n}) {\n const classes = useStyles();\n return (\n <Card>\n <CardHeader>\n <Text\n variant=\"title-x-small\"\n as=\"h3\"\n className={props.helpLink ? classes.headingWithIcon : undefined}\n >\n {props.title}\n {props.helpLink && <HelpIcon to={props.helpLink} />}\n </Text>\n </CardHeader>\n <CardBody>{props.children}</CardBody>\n </Card>\n );\n}\n\nfunction ListSubheader(props: { children: ReactNode; className?: string }) {\n const classes = useStyles();\n return (\n <Text\n variant=\"body-large\"\n as=\"h4\"\n className={classNames(classes.headingWithIcon, props.className)}\n >\n {props.children}\n </Text>\n );\n}\n\nfunction KeyValueList(props: {\n items: { key: string; value: ReactNode; copyable?: boolean }[];\n className?: string;\n 'aria-label'?: string;\n}) {\n const classes = useStyles();\n return (\n <dl\n className={classNames(classes.definitionList, props.className)}\n aria-label={props['aria-label']}\n >\n {props.items.map(item => (\n <div key={item.key} className={classes.definitionItem}>\n <div className={classes.definitionContent}>\n <dt className={classes.definitionKey}>{item.key}</dt>\n <dd className={classes.definitionValue}>{item.value}</dd>\n </div>\n {item.copyable && typeof item.value === 'string' && (\n <div className={classes.copyAction}>\n <CopyButton text={item.value} label={item.key} />\n </div>\n )}\n </div>\n ))}\n </dl>\n );\n}\n\nexport function OverviewPage(props: { entity: AlphaEntity }) {\n const classes = useStyles();\n const {\n apiVersion,\n kind,\n metadata,\n spec,\n relations = [],\n status = {},\n } = props.entity;\n\n const groupedRelations = groupBy(\n sortBy(relations, r => r.targetRef),\n 'type',\n );\n const { t } = useTranslationRef(catalogReactTranslationRef);\n\n const entityRef = stringifyEntityRef(props.entity);\n return (\n <Flex direction=\"column\" gap=\"4\">\n <Container title={t('inspectEntityDialog.overviewPage.identity.title')}>\n <KeyValueList\n aria-label={t('inspectEntityDialog.overviewPage.identity.title')}\n items={[\n { key: 'apiVersion', value: apiVersion },\n { key: 'kind', value: kind },\n ...(spec?.type\n ? [{ key: 'spec.type', value: spec.type.toString() }]\n : []),\n ...(metadata.uid\n ? [{ key: 'uid', value: metadata.uid, copyable: true }]\n : []),\n ...(metadata.etag\n ? [{ key: 'etag', value: metadata.etag, copyable: true }]\n : []),\n { key: 'entityRef', value: entityRef, copyable: true },\n ]}\n />\n </Container>\n\n <Container title={t('inspectEntityDialog.overviewPage.metadata.title')}>\n {!!Object.keys(metadata.annotations || {}).length && (\n <>\n <ListSubheader>\n {t('inspectEntityDialog.overviewPage.annotations')}\n <HelpIcon to=\"https://backstage.io/docs/features/software-catalog/well-known-annotations\" />\n </ListSubheader>\n <KeyValueList\n items={entriesToItems(Object.entries(metadata.annotations!))}\n aria-label={t('inspectEntityDialog.overviewPage.annotations')}\n className={classes.metadataList}\n />\n </>\n )}\n {!!Object.keys(metadata.labels || {}).length && (\n <>\n <ListSubheader className={classes.sectionHeading}>\n {t('inspectEntityDialog.overviewPage.labels')}\n </ListSubheader>\n <KeyValueList\n items={entriesToItems(Object.entries(metadata.labels!))}\n aria-label={t('inspectEntityDialog.overviewPage.labels')}\n className={classes.metadataList}\n />\n </>\n )}\n {!!metadata.tags?.length && (\n <>\n <ListSubheader className={classes.sectionHeading}>\n {t('inspectEntityDialog.overviewPage.tags')}\n </ListSubheader>\n <TagGroup\n aria-label={t('inspectEntityDialog.overviewPage.tags')}\n className={classes.tagGroup}\n >\n {metadata.tags.map(tag => (\n <Tag key={tag} id={tag}>\n {tag}\n </Tag>\n ))}\n </TagGroup>\n </>\n )}\n </Container>\n\n {!!relations.length && (\n <Container\n title={t('inspectEntityDialog.overviewPage.relation.title')}\n helpLink=\"https://backstage.io/docs/features/software-catalog/well-known-relations\"\n >\n {Object.entries(groupedRelations).map(([type, groupRelations]) => (\n <div key={type} className={classes.relationGroup}>\n <ListSubheader className={classes.monospace}>\n {type}\n </ListSubheader>\n <ListSection aria-label={type} className={classes.relationList}>\n {groupRelations.map(group => (\n <ListItemRow key={group.targetRef}>\n <EntityRefLink entityRef={group.targetRef} />\n </ListItemRow>\n ))}\n </ListSection>\n </div>\n ))}\n </Container>\n )}\n\n {!!status.items?.length && (\n <Container\n title={t('inspectEntityDialog.overviewPage.status.title')}\n helpLink=\"https://backstage.io/docs/features/software-catalog/well-known-statuses\"\n >\n {status.items.map((item, index) => (\n <div key={index}>\n <Text>\n {item.level}: {item.type}\n </Text>\n <Box ml=\"4\">{item.message}</Box>\n </div>\n ))}\n </Container>\n )}\n </Flex>\n );\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { CodeSnippet } from '@backstage/core-components';\nimport { Text } from '@backstage/ui';\nimport YAML from 'yaml';\nimport { sortKeys } from './util';\nimport { catalogReactTranslationRef } from '../../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nexport function YamlPage(props: { entity: Entity }) {\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return (\n <>\n <Text as=\"p\">{t('inspectEntityDialog.yamlPage.description')}</Text>\n <div data-testid=\"code-snippet\">\n <CodeSnippet\n text={YAML.stringify(sortKeys(props.entity))}\n language=\"yaml\"\n showCopyCodeButton\n />\n </div>\n </>\n );\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport {\n Dialog,\n DialogHeader,\n DialogBody,\n Tabs,\n TabList,\n Tab,\n TabPanel,\n} from '@backstage/ui';\nimport { useMemo } from 'react';\nimport { AncestryPage } from './components/AncestryPage';\nimport { ColocatedPage } from './components/ColocatedPage';\nimport { JsonPage } from './components/JsonPage';\nimport { OverviewPage } from './components/OverviewPage';\nimport { YamlPage } from './components/YamlPage';\nimport { catalogReactTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\ntype TabKey = 'overview' | 'ancestry' | 'colocated' | 'json' | 'yaml';\n\nconst TAB_KEYS: TabKey[] = [\n 'overview',\n 'ancestry',\n 'colocated',\n 'json',\n 'yaml',\n];\n\nfunction DialogContents(props: {\n entity: Entity;\n initialTab?: TabKey;\n onSelect?: (tab: string) => void;\n}) {\n const { entity, initialTab, onSelect } = props;\n const { t } = useTranslationRef(catalogReactTranslationRef);\n\n const tabNames = useMemo(\n () => ({\n overview: t('inspectEntityDialog.tabNames.overview'),\n ancestry: t('inspectEntityDialog.tabNames.ancestry'),\n colocated: t('inspectEntityDialog.tabNames.colocated'),\n json: t('inspectEntityDialog.tabNames.json'),\n yaml: t('inspectEntityDialog.tabNames.yaml'),\n }),\n [t],\n );\n\n const tabContent: Record<TabKey, JSX.Element> = {\n overview: <OverviewPage entity={entity} />,\n ancestry: <AncestryPage entity={entity} />,\n colocated: <ColocatedPage entity={entity} />,\n json: <JsonPage entity={entity} />,\n yaml: <YamlPage entity={entity} />,\n };\n\n return (\n <>\n <DialogHeader>{t('inspectEntityDialog.title')}</DialogHeader>\n <DialogBody>\n <Tabs\n defaultSelectedKey={initialTab || 'overview'}\n onSelectionChange={key => onSelect?.(key as string)}\n >\n <TabList aria-label={t('inspectEntityDialog.tabsAriaLabel')}>\n {TAB_KEYS.map(tab => (\n <Tab key={tab} id={tab}>\n {tabNames[tab]}\n </Tab>\n ))}\n </TabList>\n {TAB_KEYS.map(tab => (\n <TabPanel key={tab} id={tab}>\n {tabContent[tab]}\n </TabPanel>\n ))}\n </Tabs>\n </DialogBody>\n </>\n );\n}\n\n/**\n * A dialog that lets users inspect the low level details of their entities.\n *\n * @public\n */\nexport function InspectEntityDialog(props: {\n open: boolean;\n entity: Entity;\n initialTab?: 'overview' | 'ancestry' | 'colocated' | 'json' | 'yaml';\n onClose: () => void;\n onSelect?: (tab: string) => void;\n}) {\n const { open, entity, initialTab, onClose, onSelect } = props;\n\n if (!entity) {\n return null;\n }\n\n return (\n <Dialog\n isOpen={open}\n onOpenChange={isOpen => !isOpen && onClose()}\n width=\"940px\"\n height=\"100vh\"\n >\n {open && (\n <DialogContents\n entity={entity}\n initialTab={initialTab}\n onSelect={onSelect}\n />\n )}\n </Dialog>\n );\n}\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { HeaderLabel } from '@backstage/core-components';\nimport { Entity, RELATION_OWNED_BY } from '@backstage/catalog-model';\nimport {\n EntityRefLinks,\n getEntityRelations,\n} from '@backstage/plugin-catalog-react';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { catalogTranslationRef } from '../../translation';\n\ntype EntityLabelsProps = {\n entity: Entity;\n};\n\nexport function EntityLabels(props: EntityLabelsProps) {\n const { entity } = props;\n const ownedByRelations = getEntityRelations(entity, RELATION_OWNED_BY);\n const { t } = useTranslationRef(catalogTranslationRef);\n return (\n <>\n {ownedByRelations.length > 0 && (\n <HeaderLabel\n label={t('entityLabels.ownerLabel')}\n contentTypograpyRootComponent=\"p\"\n value={\n <EntityRefLinks\n entityRefs={ownedByRelations}\n defaultKind=\"Group\"\n color=\"inherit\"\n />\n }\n />\n )}\n {entity.spec?.lifecycle && (\n <HeaderLabel\n label={t('entityLabels.lifecycleLabel')}\n value={entity.spec.lifecycle?.toString()}\n />\n )}\n </>\n );\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n type AppNode,\n ExtensionBoundary,\n IconComponent,\n useTranslationRef,\n} from '@backstage/frontend-plugin-api';\nimport type { EntityContextMenuItemData } from '@backstage/plugin-catalog-react/alpha';\nimport {\n ButtonIcon,\n Menu,\n MenuItem,\n MenuSeparator,\n MenuTrigger,\n} from '@backstage/ui';\nimport { RiMore2Line } from '@remixicon/react';\nimport { catalogTranslationRef } from '../../translation';\n\nexport type EntityContextMenuItemDataWithNode = {\n data: EntityContextMenuItemData;\n node: AppNode;\n};\n\nfunction EntityContextMenuItemContent(props: {\n data: EntityContextMenuItemData;\n}) {\n const { icon, useProps } = props.data;\n const { title, disabled, onClick, ...menuItemProps } = useProps();\n const onAction = onClick\n ? () => {\n const result = onClick();\n if (result) {\n // Prevent rejected async actions from becoming unhandled rejections.\n void result.catch(() => {});\n }\n }\n : undefined;\n\n if ('href' in menuItemProps) {\n return (\n <MenuItem\n iconStart={icon}\n href={menuItemProps.href}\n onAction={onAction}\n isDisabled={disabled}\n >\n {title}\n </MenuItem>\n );\n }\n\n return (\n <MenuItem iconStart={icon} onAction={onAction} isDisabled={disabled}>\n {title}\n </MenuItem>\n );\n}\n\nfunction EntityContextMenuItem(props: {\n item: EntityContextMenuItemDataWithNode;\n}) {\n return (\n <ExtensionBoundary node={props.item.node} errorPresentation=\"error-api\">\n <EntityContextMenuItemContent data={props.item.data} />\n </ExtensionBoundary>\n );\n}\n\n/** @alpha */\nexport function EntityContextMenu(props: {\n UNSTABLE_extraContextMenuItems?: {\n title: string;\n Icon: IconComponent;\n onClick: () => void;\n }[];\n contextMenuItems?: EntityContextMenuItemDataWithNode[];\n}) {\n const { UNSTABLE_extraContextMenuItems, contextMenuItems } = props;\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return (\n <MenuTrigger>\n <ButtonIcon\n variant=\"secondary\"\n icon={<RiMore2Line />}\n aria-label={t('entityContextMenu.moreButtonAriaLabel')}\n />\n <Menu placement=\"bottom end\">\n {UNSTABLE_extraContextMenuItems?.map((item, index) => (\n <MenuItem\n key={`${item.title}-${index}`}\n iconStart={<item.Icon />}\n onAction={() => item.onClick()}\n >\n {item.title}\n </MenuItem>\n ))}\n {UNSTABLE_extraContextMenuItems?.length && contextMenuItems?.length ? (\n <MenuSeparator />\n ) : null}\n {contextMenuItems?.map(item => (\n <EntityContextMenuItem key={item.node.spec.id} item={item} />\n ))}\n </Menu>\n </MenuTrigger>\n );\n}\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useCallback, ComponentProps, ReactNode } from 'react';\nimport { useSearchParams } from 'react-router-dom';\nimport useAsync from 'react-use/esm/useAsync';\n\nimport { makeStyles } from '@material-ui/core/styles';\nimport Box from '@material-ui/core/Box';\n\nimport { Header, Breadcrumbs } from '@backstage/core-components';\nimport { useApi, useRouteRefParams } from '@backstage/core-plugin-api';\nimport { IconComponent } from '@backstage/frontend-plugin-api';\n\nimport {\n Entity,\n EntityRelation,\n DEFAULT_NAMESPACE,\n} from '@backstage/catalog-model';\n\nimport {\n useAsyncEntity,\n entityRouteRef,\n catalogApiRef,\n EntityRefLink,\n InspectEntityDialog,\n EntityDisplayName,\n FavoriteEntity,\n} from '@backstage/plugin-catalog-react';\n\nimport { EntityLabels } from '../EntityLabels';\nimport {\n EntityContextMenu,\n type EntityContextMenuItemDataWithNode,\n} from '../EntityContextMenu';\n\nfunction headerProps(\n paramKind: string | undefined,\n paramNamespace: string | undefined,\n paramName: string | undefined,\n entity: Entity | undefined,\n): { headerTitle: string; headerType: string } {\n const kind = paramKind ?? entity?.kind ?? '';\n const namespace = paramNamespace ?? entity?.metadata.namespace ?? '';\n const name =\n entity?.metadata.title ?? paramName ?? entity?.metadata.name ?? '';\n\n return {\n headerTitle: `${name}${\n namespace && namespace !== DEFAULT_NAMESPACE ? ` in ${namespace}` : ''\n }`,\n headerType: (() => {\n let t = kind.toLowerCase();\n if (entity && entity.spec && 'type' in entity.spec) {\n t += ' — ';\n t += (entity.spec as { type: string }).type.toLowerCase();\n }\n return t;\n })(),\n };\n}\n\nfunction findParentRelation(\n entityRelations: EntityRelation[] = [],\n relationTypes: string[] = [],\n) {\n for (const type of relationTypes) {\n const foundRelation = entityRelations.find(\n relation => relation.type === type,\n );\n if (foundRelation) {\n return foundRelation; // Return the first found relation and stop\n }\n }\n return null;\n}\n\nconst useStyles = makeStyles(theme => ({\n breadcrumbs: {\n color: theme.page.fontColor,\n fontSize: theme.typography.caption.fontSize,\n textTransform: 'uppercase',\n marginTop: theme.spacing(1),\n opacity: 0.8,\n '& span ': {\n color: theme.page.fontColor,\n textDecoration: 'underline',\n textUnderlineOffset: '3px',\n },\n },\n}));\n\nfunction EntityHeaderTitle() {\n const { entity } = useAsyncEntity();\n const { kind, namespace, name } = useRouteRefParams(entityRouteRef);\n const { headerTitle: title } = headerProps(kind, namespace, name, entity);\n return (\n <Box display=\"inline-flex\" alignItems=\"center\" height=\"1em\" maxWidth=\"100%\">\n <Box\n component=\"span\"\n textOverflow=\"ellipsis\"\n whiteSpace=\"nowrap\"\n overflow=\"hidden\"\n >\n {entity ? <EntityDisplayName entityRef={entity} hideIcon /> : title}\n </Box>\n {entity && <FavoriteEntity entity={entity} />}\n </Box>\n );\n}\n\nfunction EntityHeaderSubtitle(props: { parentEntityRelations?: string[] }) {\n const { parentEntityRelations } = props;\n const classes = useStyles();\n const { entity } = useAsyncEntity();\n const { name } = useRouteRefParams(entityRouteRef);\n const parentEntity = findParentRelation(\n entity?.relations ?? [],\n parentEntityRelations ?? [],\n );\n\n const catalogApi = useApi(catalogApiRef);\n\n const { value: ancestorEntity } = useAsync(async () => {\n if (parentEntity) {\n return findParentRelation(\n (await catalogApi.getEntityByRef(parentEntity?.targetRef))?.relations,\n parentEntityRelations,\n );\n }\n return null;\n }, [parentEntity, catalogApi]);\n\n return parentEntity ? (\n <Breadcrumbs separator=\">\" className={classes.breadcrumbs}>\n {ancestorEntity && (\n <EntityRefLink entityRef={ancestorEntity.targetRef} disableTooltip />\n )}\n <EntityRefLink entityRef={parentEntity.targetRef} disableTooltip />\n {name}\n </Breadcrumbs>\n ) : null;\n}\n\n/** @alpha */\nexport function EntityHeader(props: {\n // NOTE(freben): Intentionally not exported at this point, since it's part of\n // the unstable extra context menu items concept below\n UNSTABLE_extraContextMenuItems?: {\n title: string;\n Icon: IconComponent;\n onClick: () => void;\n }[];\n contextMenuItems?: EntityContextMenuItemDataWithNode[];\n /**\n * An array of relation types used to determine the parent entities in the hierarchy.\n * These relations are prioritized in the order provided, allowing for flexible\n * navigation through entity relationships.\n *\n * For example, use relation types like `[\"partOf\", \"memberOf\", \"ownedBy\"]` to define how the entity is related to\n * its parents in the Entity Catalog.\n *\n * It adds breadcrumbs in the Entity page to enhance user navigation and context awareness.\n */\n parentEntityRelations?: string[];\n title?: ReactNode;\n subtitle?: ReactNode;\n}) {\n const {\n UNSTABLE_extraContextMenuItems,\n contextMenuItems,\n parentEntityRelations,\n title,\n subtitle,\n } = props;\n const { entity } = useAsyncEntity();\n const { kind, namespace, name } = useRouteRefParams(entityRouteRef);\n const { headerTitle: entityFallbackText, headerType: type } = headerProps(\n kind,\n namespace,\n name,\n entity,\n );\n\n const [searchParams, setSearchParams] = useSearchParams();\n const selectedInspectEntityDialogTab = searchParams.get('inspect');\n\n const setInspectEntityDialogTab = useCallback(\n (newTab: string) => setSearchParams(`inspect=${newTab}`),\n [setSearchParams],\n );\n\n const closeInspectEntityDialog = useCallback(\n () => setSearchParams(),\n [setSearchParams],\n );\n\n const inspectDialogOpen = typeof selectedInspectEntityDialogTab === 'string';\n\n return (\n <Header\n pageTitleOverride={entityFallbackText}\n type={type}\n title={title ?? <EntityHeaderTitle />}\n subtitle={\n subtitle ?? (\n <EntityHeaderSubtitle parentEntityRelations={parentEntityRelations} />\n )\n }\n >\n {entity && (\n <>\n <EntityLabels entity={entity} />\n <EntityContextMenu\n UNSTABLE_extraContextMenuItems={UNSTABLE_extraContextMenuItems}\n contextMenuItems={contextMenuItems}\n />\n <InspectEntityDialog\n entity={entity!}\n initialTab={\n (selectedInspectEntityDialogTab as ComponentProps<\n typeof InspectEntityDialog\n >['initialTab']) || undefined\n }\n open={inspectDialogOpen}\n onClose={closeInspectEntityDialog}\n onSelect={setInspectEntityDialogTab}\n />\n </>\n )}\n </Header>\n );\n}\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport classNames from 'classnames';\nimport { PropsWithChildren } from 'react';\nimport { makeStyles, Theme } from '@material-ui/core/styles';\n\n/** @public */\nexport type EntityTabsPanelClassKey = 'root' | 'stretch' | 'noPadding';\n\nconst useStyles = makeStyles(\n (theme: Theme) => ({\n root: {\n gridArea: 'pageContent',\n minWidth: 0,\n paddingTop: theme.spacing(3),\n paddingBottom: theme.spacing(3),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3),\n },\n },\n stretch: {\n display: 'flex',\n flexDirection: 'column',\n flexGrow: 1,\n },\n noPadding: {\n padding: 0,\n },\n }),\n { name: 'EntityTabsPanel' },\n);\n\ntype EntityTabsPanelProps = PropsWithChildren<{\n stretch?: boolean;\n noPadding?: boolean;\n className?: string;\n}>;\n\nexport function EntityTabsPanel(props: EntityTabsPanelProps) {\n const { className, stretch, noPadding, children, ...restProps } = props;\n\n const classes = useStyles();\n return (\n <article\n {...restProps}\n className={classNames(classes.root, className, {\n [classes.stretch]: stretch,\n [classes.noPadding]: noPadding,\n })}\n >\n {children}\n </article>\n );\n}\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n ReactNode,\n forwardRef,\n useState,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n} from 'react';\nimport { Link } from 'react-router-dom';\nimport classnames from 'classnames';\n\nimport Typography from '@material-ui/core/Typography';\nimport Popover from '@material-ui/core/Popover';\nimport { TabProps, TabClassKey } from '@material-ui/core/Tab';\nimport { capitalize } from '@material-ui/core/utils';\nimport { createStyles, Theme, withStyles } from '@material-ui/core/styles';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\nimport Button from '@material-ui/core/Button';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport List from '@material-ui/core/List';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { IconsApi, iconsApiRef } from '@backstage/frontend-plugin-api';\n\nconst styles = (theme: Theme) =>\n createStyles({\n /* Styles applied to the root element. */\n root: {\n ...theme.typography.button,\n maxWidth: 264,\n minWidth: 72,\n position: 'relative',\n boxSizing: 'border-box',\n minHeight: 48,\n flexShrink: 0,\n padding: '6px 12px',\n [theme.breakpoints.up('sm')]: {\n padding: '6px 24px',\n },\n overflow: 'hidden',\n whiteSpace: 'normal',\n textAlign: 'center',\n [theme.breakpoints.up('sm')]: {\n minWidth: 160,\n },\n },\n defaultTab: {\n ...theme.typography.caption,\n padding: theme.spacing(3, 3),\n textTransform: 'uppercase',\n fontWeight: theme.typography.fontWeightBold,\n color: theme.palette.text.secondary,\n },\n /* Styles applied to the root element if both `icon` and `label` are provided. */\n labelIcon: {\n minHeight: 72,\n paddingTop: 9,\n '& $wrapper > *:first-child': {\n marginBottom: 6,\n },\n },\n /* Styles applied to the root element if the parent [`Tabs`](/api/tabs/) has `textColor=\"inherit\"`. */\n textColorInherit: {\n color: 'inherit',\n opacity: 0.7,\n '&$selected': {\n opacity: 1,\n },\n '&$disabled': {\n opacity: 0.5,\n },\n },\n selectedButton: {\n color: `${theme.palette.text.primary}`,\n opacity: `${1}`,\n },\n unselectedButton: {\n color: `${theme.palette.text.secondary}`,\n opacity: `${0.7}`,\n },\n /* Styles applied to the root element if the parent [`Tabs`](/api/tabs/) has `textColor=\"primary\"`. */\n textColorPrimary: {\n color: theme.palette.text.secondary,\n '&$selected': {\n color: theme.palette.primary.main,\n },\n '&$disabled': {\n color: theme.palette.text.disabled,\n },\n },\n /* Styles applied to the root element if the parent [`Tabs`](/api/tabs/) has `textColor=\"secondary\"`. */\n textColorSecondary: {\n color: theme.palette.text.secondary,\n '&$selected': {\n color: theme.palette.secondary.main,\n },\n '&$disabled': {\n color: theme.palette.text.disabled,\n },\n },\n /* Pseudo-class applied to the root element if `selected={true}` (controlled by the Tabs component). */\n selected: {},\n /* Pseudo-class applied to the root element if `disabled={true}` (controlled by the Tabs component). */\n disabled: {},\n /* Styles applied to the root element if `fullWidth={true}` (controlled by the Tabs component). */\n fullWidth: {\n flexShrink: 1,\n flexGrow: 1,\n flexBasis: 0,\n maxWidth: 'none',\n },\n /* Styles applied to the root element if `wrapped={true}`. */\n wrapped: {\n fontSize: theme.typography.pxToRem(12),\n lineHeight: 1.5,\n },\n /* Styles applied to the `icon` and `label`'s wrapper element. */\n wrapper: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '100%',\n flexDirection: 'row',\n },\n });\n\ntype EntityTabsGroupItem = {\n id: string;\n label: string;\n path: string;\n icon?: string | ReactElement;\n};\n\ntype EntityTabsGroupProps = TabProps & {\n classes?: Partial<ReturnType<typeof styles>>;\n indicator?: ReactNode;\n highlightedButton?: string;\n items: EntityTabsGroupItem[];\n onSelectTab?: MouseEventHandler<HTMLAnchorElement>;\n showIcons?: boolean;\n};\n\nfunction resolveIcon(\n icon: string | ReactElement | undefined,\n iconsApi: IconsApi,\n showIcons: boolean,\n) {\n if (!showIcons) {\n return undefined;\n }\n if (typeof icon === 'string') {\n const Icon = iconsApi.getIcon(icon);\n if (Icon) {\n return <Icon />;\n }\n return undefined;\n }\n return icon;\n}\n\nconst Tab = forwardRef(function Tab(props: EntityTabsGroupProps, ref: any) {\n const [anchorEl, setAnchorEl] = useState<HTMLButtonElement | null>(null);\n const iconsApi = useApi(iconsApiRef);\n\n const open = Boolean(anchorEl);\n const submenuId = open ? 'tabbed-submenu' : undefined;\n\n const {\n classes,\n className,\n disabled = false,\n disableFocusRipple = false,\n items,\n fullWidth,\n indicator,\n label,\n onSelectTab,\n selected,\n textColor = 'inherit',\n wrapped = false,\n highlightedButton,\n showIcons = false,\n } = props;\n\n const groupIcon = resolveIcon(props.icon, iconsApi, showIcons);\n const testId = 'data-testid' in props && props['data-testid'];\n\n const handleMenuClose = () => {\n setAnchorEl(null);\n };\n\n const handleMenuClick = (event: MouseEvent<HTMLButtonElement>) => {\n setAnchorEl(event.currentTarget);\n };\n\n const classArray = [\n classes?.root,\n classes?.[`textColor${capitalize(textColor)}` as TabClassKey],\n classes && {\n [classes.disabled!]: disabled,\n [classes.selected!]: selected,\n [classes.labelIcon!]: label && groupIcon,\n [classes.fullWidth!]: fullWidth,\n [classes.wrapped!]: wrapped,\n },\n className,\n ];\n\n if (items.length === 1) {\n return (\n <Button\n focusRipple={!disableFocusRipple}\n data-testid={testId}\n className={classnames(\n classArray,\n classes && {\n [classes.labelIcon!]: label && (items[0].icon ?? groupIcon),\n },\n )}\n ref={ref}\n role=\"tab\"\n aria-selected={selected}\n disabled={disabled}\n component={Link}\n onClick={onSelectTab}\n to={items[0]?.path}\n startIcon={resolveIcon(items[0].icon, iconsApi, showIcons)}\n >\n <Typography className={classes?.wrapper} variant=\"button\">\n {items[0].label}\n </Typography>\n {indicator}\n </Button>\n );\n }\n const hasIcons = showIcons && items.some(i => i.icon);\n return (\n <>\n <Button\n data-testid={testId}\n focusRipple={!disableFocusRipple}\n className={classnames(classArray)}\n ref={ref}\n role=\"tab\"\n aria-selected={selected}\n disabled={disabled}\n onClick={handleMenuClick}\n startIcon={groupIcon}\n >\n <Typography className={classes?.wrapper} variant=\"button\">\n {label}\n </Typography>\n <ExpandMoreIcon />\n </Button>\n <Popover\n id={submenuId}\n open={open}\n anchorEl={anchorEl}\n onClose={handleMenuClose}\n anchorOrigin={{\n vertical: 'bottom',\n horizontal: 'center',\n }}\n transformOrigin={{\n vertical: 'top',\n horizontal: 'center',\n }}\n >\n <List component=\"nav\">\n {items.map(i => {\n const itemIcon = resolveIcon(i.icon, iconsApi, showIcons);\n return (\n <ListItem\n key={`popover_item_${i.id}`}\n button\n focusRipple={!disableFocusRipple}\n classes={{\n selected: classnames(classes?.selectedButton),\n default: classnames(classes?.unselectedButton),\n disabled: classnames(classes?.disabled),\n }}\n ref={ref}\n aria-selected={selected}\n disabled={disabled}\n selected={highlightedButton === i.id}\n component={Link}\n onClick={e => {\n handleMenuClose();\n onSelectTab?.(e);\n }}\n to={i.path}\n >\n {itemIcon && <ListItemIcon>{itemIcon}</ListItemIcon>}\n <ListItemText\n inset={!itemIcon && hasIcons}\n primary={\n <>\n <Typography variant=\"button\">{i.label}</Typography>\n {indicator}\n </>\n }\n />\n </ListItem>\n );\n })}\n </List>\n </Popover>\n </>\n );\n});\n\n// @ts-ignore\nexport const EntityTabsGroup = withStyles(styles, { name: 'MuiTab' })(Tab);\n","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ReactElement, useMemo } from 'react';\nimport Box from '@material-ui/core/Box';\nimport Tabs from '@material-ui/core/Tabs';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { EntityContentGroupDefinitions } from '@backstage/plugin-catalog-react/alpha';\n\nimport { EntityTabsGroup } from './EntityTabsGroup';\nimport { catalogTranslationRef } from '../../translation';\n\n/** @public */\nexport type HeaderTabsClassKey =\n | 'tabsWrapper'\n | 'defaultTab'\n | 'selected'\n | 'tabRoot';\n\nconst useStyles = makeStyles(\n theme => ({\n tabsWrapper: {\n gridArea: 'pageSubheader',\n backgroundColor: theme.palette.background.paper,\n paddingLeft: theme.spacing(3),\n minWidth: 0,\n },\n defaultTab: {\n ...theme.typography.caption,\n padding: theme.spacing(3, 3),\n textTransform: 'uppercase',\n fontWeight: theme.typography.fontWeightBold,\n color: theme.palette.text.secondary,\n },\n selected: {\n color: theme.palette.text.primary,\n },\n tabRoot: {\n '&:hover': {\n backgroundColor: theme.palette.background.default,\n color: theme.palette.text.primary,\n },\n },\n }),\n { name: 'BackstageHeaderTabs' },\n);\n\ntype Tab = {\n id: string;\n label: string;\n path: string;\n group?: string;\n icon?: string | ReactElement;\n};\n\ntype TabGroup = {\n group?: {\n title: string;\n icon?: string | ReactElement;\n };\n items: Array<Omit<Tab, 'group'>>;\n};\n\ntype EntityTabsListProps = {\n tabs: Tab[];\n groupDefinitions: EntityContentGroupDefinitions;\n defaultContentOrder?: 'title' | 'natural';\n showIcons?: boolean;\n selectedIndex?: number;\n};\n\nfunction resolveGroupId(\n tabGroup: string | undefined,\n groupDefinitions: EntityContentGroupDefinitions,\n aliasToGroup: Record<string, string>,\n): string | undefined {\n if (!tabGroup) {\n return undefined;\n }\n if (groupDefinitions[tabGroup]) {\n return tabGroup;\n }\n return aliasToGroup[tabGroup];\n}\n\nexport function EntityTabsList(props: EntityTabsListProps) {\n const styles = useStyles();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n const {\n tabs: items,\n selectedIndex = 0,\n showIcons,\n groupDefinitions,\n defaultContentOrder = 'title',\n } = props;\n\n const aliasToGroup = useMemo(\n () =>\n Object.entries(groupDefinitions).reduce((map, [groupId, def]) => {\n for (const alias of def.aliases ?? []) {\n map[alias] = groupId;\n }\n return map;\n }, {} as Record<string, string>),\n [groupDefinitions],\n );\n\n const groups = useMemo(() => {\n const byKey = items.reduce((result, tab) => {\n const resolvedGroupId = resolveGroupId(\n tab.group,\n groupDefinitions,\n aliasToGroup,\n );\n const group = resolvedGroupId\n ? groupDefinitions[resolvedGroupId]\n : undefined;\n const groupOrId = group && resolvedGroupId ? resolvedGroupId : tab.id;\n result[groupOrId] = result[groupOrId] ?? {\n group,\n items: [],\n };\n result[groupOrId].items.push(tab);\n return result;\n }, {} as Record<string, TabGroup>);\n\n const groupOrder = Object.keys(groupDefinitions);\n const sorted = Object.entries(byKey).sort(([a], [b]) => {\n const ai = groupOrder.indexOf(a);\n const bi = groupOrder.indexOf(b);\n if (ai !== -1 && bi !== -1) {\n return ai - bi;\n }\n if (ai !== -1) {\n return -1;\n }\n if (bi !== -1) {\n return 1;\n }\n return 0;\n });\n\n for (const [id, tabGroup] of sorted) {\n const groupDef = groupDefinitions[id];\n if (groupDef) {\n const order = groupDef.contentOrder ?? defaultContentOrder;\n if (order === 'title') {\n tabGroup.items.sort((a, b) =>\n a.label.localeCompare(b.label, undefined, { sensitivity: 'base' }),\n );\n }\n }\n }\n\n return sorted;\n }, [items, groupDefinitions, aliasToGroup, defaultContentOrder]);\n\n const selectedItem = selectedIndex >= 0 ? items[selectedIndex] : undefined;\n const selectedGroup = resolveGroupId(\n selectedItem?.group,\n groupDefinitions,\n aliasToGroup,\n );\n return (\n <Box className={styles.tabsWrapper}>\n <Tabs\n selectionFollowsFocus\n indicatorColor=\"primary\"\n textColor=\"inherit\"\n variant=\"scrollable\"\n scrollButtons=\"auto\"\n aria-label={t('entityTabs.tabsAriaLabel')}\n value={selectedGroup ?? selectedItem?.id ?? false}\n >\n {groups.map(([id, tabGroup]) => (\n <EntityTabsGroup\n data-testid={`header-tab-${id}`}\n className={styles.defaultTab}\n classes={{ selected: styles.selected, root: styles.tabRoot }}\n key={id}\n label={tabGroup.group?.title}\n icon={tabGroup.group?.icon}\n value={id}\n items={tabGroup.items}\n highlightedButton={selectedItem?.id}\n showIcons={showIcons}\n />\n ))}\n </Tabs>\n </Box>\n );\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ReactElement, useMemo } from 'react';\nimport { Helmet } from 'react-helmet';\nimport { matchRoutes, useParams, useRoutes } from 'react-router-dom';\nimport { NotFoundErrorPage } from '@backstage/frontend-plugin-api';\nimport { EntityTabsPanel } from './EntityTabsPanel';\nimport { EntityTabsList } from './EntityTabsList';\nimport { EntityContentGroupDefinitions } from '@backstage/plugin-catalog-react/alpha';\n\nexport type SubRoute = {\n group?: string;\n path: string;\n title: string;\n icon?: string | ReactElement;\n children: JSX.Element;\n};\n\n// Normalize a route path so it can be matched correctly:\n// - strip leading slashes\n// - if the path already ends with a `*`, keep it as-is so explicit wildcards\n// like `/*` or `/foo/*` aren't double-suffixed into `*/*` / `foo/*/*`\n// - otherwise strip trailing slashes and append `/*` for nested matching;\n// a bare `/` collapses to the empty string so it acts as an index route\n// rather than a wildcard that would swallow every sub-path\nfunction normalizeRoutePath(path: string): string {\n const withoutLeading = path.replace(/^\\/+/, '');\n if (withoutLeading.endsWith('*')) {\n return withoutLeading;\n }\n const trimmed = withoutLeading.replace(/\\/+$/, '');\n return trimmed ? `${trimmed}/*` : '';\n}\n\nexport function useSelectedSubRoute(subRoutes: SubRoute[]): {\n index: number;\n route?: SubRoute;\n element?: JSX.Element;\n} {\n const params = useParams();\n\n const routes = useMemo(\n () =>\n subRoutes.map(({ path, children }) => ({\n caseSensitive: false,\n path: normalizeRoutePath(path),\n element: children,\n })),\n [subRoutes],\n );\n\n const element = useRoutes(routes) ?? undefined;\n\n let currentRoute = params['*'] ?? '';\n if (!currentRoute.startsWith('/')) {\n currentRoute = `/${currentRoute}`;\n }\n\n const [matchedRoute] = matchRoutes(routes, currentRoute) ?? [];\n const foundIndex = matchedRoute\n ? routes.findIndex(r => r.path === matchedRoute.route.path)\n : -1;\n\n return {\n index: foundIndex,\n element,\n route: subRoutes[foundIndex],\n };\n}\n\ntype EntityTabsProps = {\n routes: SubRoute[];\n groupDefinitions: EntityContentGroupDefinitions;\n defaultContentOrder?: 'title' | 'natural';\n showIcons?: boolean;\n};\n\nexport function EntityTabs(props: EntityTabsProps) {\n const { routes, groupDefinitions, defaultContentOrder, showIcons } = props;\n\n const { index, route, element } = useSelectedSubRoute(routes);\n\n const tabs = useMemo(\n () =>\n routes.map(r => {\n const { path, title, group, icon } = r;\n let to = path;\n // Remove trailing /*\n to = to.replace(/\\/\\*$/, '');\n // And remove leading / for relative navigation\n to = to.replace(/^\\//, '');\n return {\n group,\n id: path,\n path: to,\n label: title,\n icon,\n };\n }),\n [routes],\n );\n\n return (\n <>\n <EntityTabsList\n tabs={tabs}\n selectedIndex={index}\n showIcons={showIcons}\n groupDefinitions={groupDefinitions}\n defaultContentOrder={defaultContentOrder}\n />\n <EntityTabsPanel>\n <Helmet title={route?.title} />\n {element ?? <NotFoundErrorPage />}\n </EntityTabsPanel>\n </>\n );\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { ReactElement } from 'react';\n\nexport type EntityLayoutRoute = {\n path: string;\n title: string;\n group?: string;\n icon?: string | ReactElement;\n children: JSX.Element;\n if?: (entity: Entity) => boolean;\n};\n\nexport function filterEntityLayoutRoutes(\n routes: EntityLayoutRoute[],\n entity: Entity | undefined,\n) {\n if (!entity) {\n return [];\n }\n return routes.filter(route => !route.if || route.if(entity));\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ComponentProps, ReactNode } from 'react';\n\nimport Alert from '@material-ui/lab/Alert';\n\nimport { useRouteRefParams } from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport {\n Content,\n Link,\n Page,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\nimport {\n entityRouteRef,\n useAsyncEntity,\n} from '@backstage/plugin-catalog-react';\n\nimport { catalogTranslationRef } from '../../translation';\nimport { EntityHeader } from '../EntityHeader';\nimport { EntityTabs } from '../EntityTabs';\nimport { EntityContentGroupDefinitions } from '@backstage/plugin-catalog-react/alpha';\nimport {\n EntityLayoutRoute,\n filterEntityLayoutRoutes,\n} from './entityLayoutRoutes';\n\ninterface EntityLayoutProps {\n UNSTABLE_extraContextMenuItems?: ComponentProps<\n typeof EntityHeader\n >['UNSTABLE_extraContextMenuItems'];\n contextMenuItems?: ComponentProps<typeof EntityHeader>['contextMenuItems'];\n header?: JSX.Element;\n NotFoundComponent?: ReactNode;\n /**\n * An array of relation types used to determine the parent entities in the hierarchy.\n * These relations are prioritized in the order provided, allowing for flexible\n * navigation through entity relationships.\n *\n * For example, use relation types like `[\"partOf\", \"memberOf\", \"ownedBy\"]` to define how the entity is related to\n * its parents in the Entity Catalog.\n *\n * It adds breadcrumbs in the Entity page to enhance user navigation and context awareness.\n */\n parentEntityRelations?: string[];\n groupDefinitions: EntityContentGroupDefinitions;\n defaultContentOrder?: 'title' | 'natural';\n showNavItemIcons?: boolean;\n routes: EntityLayoutRoute[];\n}\n\nexport function EntityLayout(props: EntityLayoutProps) {\n const {\n UNSTABLE_extraContextMenuItems,\n contextMenuItems,\n header,\n NotFoundComponent,\n parentEntityRelations,\n groupDefinitions,\n defaultContentOrder,\n showNavItemIcons,\n routes,\n } = props;\n const { kind } = useRouteRefParams(entityRouteRef);\n const { entity, loading, error } = useAsyncEntity();\n\n const visibleRoutes = filterEntityLayoutRoutes(routes, entity);\n\n const { t } = useTranslationRef(catalogTranslationRef);\n\n return (\n <Page themeId={entity?.spec?.type?.toString() ?? 'home'}>\n {header ?? (\n <EntityHeader\n parentEntityRelations={parentEntityRelations}\n UNSTABLE_extraContextMenuItems={UNSTABLE_extraContextMenuItems}\n contextMenuItems={contextMenuItems}\n />\n )}\n\n {loading && <Progress />}\n\n {entity && (\n <EntityTabs\n routes={visibleRoutes}\n groupDefinitions={groupDefinitions}\n defaultContentOrder={defaultContentOrder}\n showIcons={showNavItemIcons}\n />\n )}\n\n {error && (\n <Content>\n <Alert severity=\"error\">{error.toString()}</Alert>\n </Content>\n )}\n\n {!loading && !error && !entity && (\n <Content>\n {NotFoundComponent ? (\n NotFoundComponent\n ) : (\n <WarningPanel title={t('entityLabels.warningPanelTitle')}>\n {t('entityPage.notFoundMessage', {\n kind,\n link: (\n <Link to=\"https://backstage.io/docs/features/software-catalog/references\">\n {t('entityPage.notFoundLinkText')}\n </Link>\n ),\n })}\n </WarningPanel>\n )}\n </Content>\n )}\n </Page>\n );\n}\n","/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { defineComponent } from '../../hooks/useDefinition';\nimport type { AvatarOwnProps } from './types';\nimport styles from './Avatar.module.css';\n\n/**\n * Component definition for Avatar\n * @public\n */\nexport const AvatarDefinition = defineComponent<AvatarOwnProps>()({\n styles,\n classNames: {\n root: 'bui-AvatarRoot',\n image: 'bui-AvatarImage',\n fallback: 'bui-AvatarFallback',\n },\n propDefs: {\n size: { dataAttribute: true, default: 'medium' },\n purpose: { default: 'informative' },\n src: {},\n name: {},\n className: {},\n },\n});\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-AvatarRoot\":\"gNh1vAfzsq8THFv8\",\"bui-AvatarImage\":\"UTo1RZ1yTUTQjyTy\",\"bui-AvatarFallback\":\"ZmCUJdIze6ktXtdz\"};","/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { forwardRef, useState, useEffect } from 'react';\nimport { AvatarProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { AvatarDefinition } from './definition';\n\n/**\n * Displays a user's profile image with an automatic fallback to their initials when the image fails to load.\n *\n * @public\n */\nexport const Avatar = forwardRef<HTMLDivElement, AvatarProps>((props, ref) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n AvatarDefinition,\n props,\n );\n\n const { classes, size, src, name, purpose } = ownProps;\n\n const [imageStatus, setImageStatus] = useState<\n 'loading' | 'loaded' | 'error'\n >('loading');\n\n useEffect(() => {\n setImageStatus('loading');\n const img = new Image();\n img.onload = () => setImageStatus('loaded');\n img.onerror = () => setImageStatus('error');\n img.src = src;\n\n return () => {\n img.onload = null;\n img.onerror = null;\n };\n }, [src]);\n\n const initialsCount = ['x-small', 'small'].includes(size) ? 1 : 2;\n\n const initials = name\n .split(' ')\n .map(word => word[0])\n .join('')\n .toUpperCase()\n .slice(0, initialsCount);\n\n return (\n <div\n ref={ref}\n role=\"img\"\n aria-label={purpose === 'informative' ? name : undefined}\n aria-hidden={purpose === 'decoration' ? true : undefined}\n className={classes.root}\n {...dataAttributes}\n {...restProps}\n >\n {imageStatus === 'loaded' ? (\n <img src={src} alt=\"\" className={classes.image} />\n ) : (\n <div aria-hidden=\"true\" className={classes.fallback}>\n {initials}\n </div>\n )}\n </div>\n );\n});\n\nAvatar.displayName = 'Avatar';\n","// extracted by css-extract-rspack-plugin\nexport default {\"single\":\"OVBrDVLk9cMf8eGe\",\"stack\":\"dGAkWeg0vjQStoX_\",\"avatarLink\":\"HoW5Wjzr74sm26Zo\"};","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { HeaderMetadataUser } from './types';\nimport { Avatar } from '../Avatar';\nimport { Tooltip, TooltipTrigger } from '../Tooltip';\nimport { Text } from '../Text';\nimport { Link } from '../Link';\nimport { Pressable } from 'react-aria';\nimport styles from './HeaderMetadataUsers.module.css';\n\n/**\n * Displays a list of users as avatars inside a Header metadata value.\n * A single user shows the avatar with their name beside it.\n * Multiple users show avatars in a row with the name revealed on hover via tooltip.\n * When a user has an `href`, the avatar and name become links.\n *\n * @public\n */\nexport const HeaderMetadataUsers = ({\n users,\n}: {\n users: HeaderMetadataUser[];\n}) => {\n if (users.length === 0) return null;\n\n if (users.length === 1) {\n const user = users[0];\n if (user.href) {\n return (\n <Link\n href={user.href}\n variant=\"body-medium\"\n standalone\n className={styles.single}\n >\n <Avatar\n src={user.src ?? 'data:,'}\n name={user.name}\n size=\"small\"\n purpose=\"decoration\"\n />\n {user.name}\n </Link>\n );\n }\n\n return (\n <div className={styles.single}>\n <Avatar\n src={user.src ?? 'data:,'}\n name={user.name}\n size=\"small\"\n purpose=\"decoration\"\n />\n <Text variant=\"body-medium\">{user.name}</Text>\n </div>\n );\n }\n\n return (\n <ul className={styles.stack}>\n {users.map((user, i) => (\n <li key={user.href ?? `${i}:${user.name}`}>\n <TooltipTrigger>\n {user.href ? (\n <Link\n href={user.href}\n aria-label={user.name}\n className={styles.avatarLink}\n >\n <Avatar\n src={user.src ?? 'data:,'}\n name={user.name}\n size=\"small\"\n purpose=\"decoration\"\n />\n </Link>\n ) : (\n <Pressable>\n <Avatar\n src={user.src ?? 'data:,'}\n name={user.name}\n size=\"small\"\n purpose=\"informative\"\n />\n </Pressable>\n )}\n <Tooltip>{user.name}</Tooltip>\n </TooltipTrigger>\n </li>\n ))}\n </ul>\n );\n};\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useMemo } from 'react';\nimport {\n Box,\n ButtonIcon,\n Header,\n HeaderMetadataUsers,\n Link,\n type HeaderMetadataItem,\n type HeaderMetadataUser,\n type HeaderNavTabItem,\n} from '@backstage/ui';\nimport {\n Entity,\n RELATION_OWNED_BY,\n RELATION_PART_OF,\n stringifyEntityRef,\n type CompoundEntityRef,\n} from '@backstage/catalog-model';\nimport { useApi, useRouteRefParams } from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport {\n catalogApiRef,\n catalogReactTranslationRef,\n entityRouteRef,\n getEntityRelations,\n useAsyncEntity,\n useEntityPresentation,\n useEntityRefLink,\n useStarredEntity,\n} from '@backstage/plugin-catalog-react';\nimport { RiStarFill, RiStarLine } from '@remixicon/react';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogTranslationRef } from '../../translation';\nimport {\n EntityContextMenu,\n type EntityContextMenuItemDataWithNode,\n} from '../EntityContextMenu';\n\nfunction useOwnerUsers(entity: Entity | undefined): HeaderMetadataUser[] {\n const catalogApi = useApi(catalogApiRef);\n const entityLink = useEntityRefLink();\n const ownerRefs = useMemo(\n () => getEntityRelations(entity, RELATION_OWNED_BY),\n [entity],\n );\n const ownerRefStrings = useMemo(\n () => ownerRefs.map(ref => stringifyEntityRef(ref)),\n [ownerRefs],\n );\n const { value: ownerEntities } = useAsync(async () => {\n if (ownerRefStrings.length === 0) return [];\n return (\n await catalogApi.getEntitiesByRefs({\n entityRefs: ownerRefStrings,\n fields: [\n 'kind',\n 'metadata.name',\n 'metadata.namespace',\n 'metadata.title',\n 'spec.profile',\n ],\n })\n ).items;\n }, [catalogApi, ownerRefStrings]);\n\n return ownerRefs.map((ref, index) => {\n const owner = ownerEntities?.[index];\n const profile = (owner?.spec as { profile?: { picture?: string } })\n ?.profile;\n return {\n name: owner?.metadata.title ?? owner?.metadata.name ?? ref.name,\n src: profile?.picture,\n href: entityLink(ref),\n };\n });\n}\n\nfunction HierarchyLinks(props: { refs: CompoundEntityRef[] }) {\n const entityLink = useEntityRefLink();\n return (\n <Box as=\"ul\" display=\"inline\" m=\"0\" p=\"0\" style={{ listStyle: 'none' }}>\n {props.refs.map((ref, index) => (\n <Box as=\"li\" display=\"inline\" key={stringifyEntityRef(ref)}>\n {index > 0 ? ', ' : null}\n <Link href={entityLink(ref)} standalone>\n {ref.name}\n </Link>\n </Box>\n ))}\n </Box>\n );\n}\n\nfunction hierarchyLabel(\n ref: CompoundEntityRef,\n): 'systemLabel' | 'domainLabel' | 'partOfLabel' {\n switch (ref.kind.toLowerCase()) {\n case 'system':\n return 'systemLabel';\n case 'domain':\n return 'domainLabel';\n default:\n return 'partOfLabel';\n }\n}\n\nfunction useMetadata(entity: Entity | undefined): HeaderMetadataItem[] {\n const owners = useOwnerUsers(entity);\n const { t } = useTranslationRef(catalogTranslationRef);\n return useMemo(() => {\n if (!entity) return [];\n const metadata: HeaderMetadataItem[] = [];\n const lifecycle = entity.spec?.lifecycle?.toString();\n if (lifecycle) {\n metadata.push({\n label: t('entityLabels.lifecycleLabel'),\n value: lifecycle,\n });\n }\n if (owners.length > 0) {\n metadata.push({\n label: t('entityLabels.ownerLabel'),\n value: <HeaderMetadataUsers users={owners} />,\n });\n }\n\n const hierarchy = getEntityRelations(entity, RELATION_PART_OF).reduce(\n (groups, ref) => {\n const label = hierarchyLabel(ref);\n groups[label] = [...(groups[label] ?? []), ref];\n return groups;\n },\n {} as Record<string, CompoundEntityRef[]>,\n );\n for (const [label, refs] of Object.entries(hierarchy)) {\n metadata.push({\n label: t(\n `entityLabels.${label}` as\n | 'entityLabels.systemLabel'\n | 'entityLabels.domainLabel'\n | 'entityLabels.partOfLabel',\n ),\n value: <HierarchyLinks refs={refs} />,\n });\n }\n return metadata;\n }, [entity, owners, t]);\n}\n\nfunction FavoriteEntityButton(props: { entity: Entity }) {\n const { t } = useTranslationRef(catalogReactTranslationRef);\n const { isStarredEntity, toggleStarredEntity } = useStarredEntity(\n props.entity,\n );\n return (\n <ButtonIcon\n variant=\"secondary\"\n aria-label={\n isStarredEntity\n ? t('favoriteEntity.removeFromFavorites')\n : t('favoriteEntity.addToFavorites')\n }\n icon={isStarredEntity ? <RiStarFill /> : <RiStarLine />}\n onPress={() => toggleStarredEntity()}\n />\n );\n}\n\nexport function EntityHeaderBui(props: {\n tabs: HeaderNavTabItem[];\n activeTabId?: string;\n contextMenuItems?: EntityContextMenuItemDataWithNode[];\n}) {\n const { entity } = useAsyncEntity();\n const routeParams = useRouteRefParams(entityRouteRef);\n const presentation = useEntityPresentation(entity ?? routeParams);\n const metadata = useMetadata(entity);\n const type = entity?.spec?.type?.toString();\n\n return (\n <Header\n title={presentation.primaryTitle}\n tags={[\n { label: entity?.kind ?? routeParams.kind },\n ...(type ? [{ label: type }] : []),\n ]}\n metadata={metadata}\n tabs={entity ? props.tabs : undefined}\n activeTabId={props.activeTabId}\n customActions={\n entity ? (\n <>\n <FavoriteEntityButton entity={entity} />\n <EntityContextMenu contextMenuItems={props.contextMenuItems} />\n </>\n ) : undefined\n }\n />\n );\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ComponentProps, ComponentType, ReactNode, useCallback } from 'react';\nimport { Helmet } from 'react-helmet';\nimport { useSearchParams } from 'react-router-dom';\nimport { Alert, Container } from '@backstage/ui';\nimport {\n configApiRef,\n useApi,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\nimport { Link, Progress } from '@backstage/core-components';\nimport { NotFoundErrorPage } from '@backstage/frontend-plugin-api';\nimport {\n entityRouteRef,\n InspectEntityDialog,\n useAsyncEntity,\n useEntityPresentation,\n} from '@backstage/plugin-catalog-react';\nimport {\n type EntityContentGroupDefinitions,\n type EntityHeaderLayoutProps,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { catalogTranslationRef } from '../../translation';\nimport { EntityHeaderBui } from '../EntityHeader/EntityHeaderBui';\nimport { useEntityTabs } from '../EntityTabs/useEntityTabs';\nimport {\n EntityLayoutRoute,\n filterEntityLayoutRoutes,\n} from './entityLayoutRoutes';\n\nfunction EntityDocumentTitle(props: { activeContentTitle?: string }) {\n const configApi = useApi(configApiRef);\n const routeParams = useRouteRefParams(entityRouteRef);\n const { entity } = useAsyncEntity();\n const presentation = useEntityPresentation(entity ?? routeParams);\n const appTitle = configApi.getOptionalString('app.title') || 'Backstage';\n return (\n <>\n <Helmet\n titleTemplate={`${presentation.primaryTitle} | %s | ${appTitle}`}\n defaultTitle={`${presentation.primaryTitle} | ${appTitle}`}\n />\n {props.activeContentTitle && <Helmet title={props.activeContentTitle} />}\n </>\n );\n}\n\nfunction InspectEntityDialogHost() {\n const { entity } = useAsyncEntity();\n const [searchParams, setSearchParams] = useSearchParams();\n const selectedTab = searchParams.get('inspect');\n const setSelectedTab = useCallback(\n (tab: string) =>\n setSearchParams(params => {\n const next = new URLSearchParams(params);\n next.set('inspect', tab);\n return next;\n }),\n [setSearchParams],\n );\n const close = useCallback(\n () =>\n setSearchParams(params => {\n const next = new URLSearchParams(params);\n next.delete('inspect');\n return next;\n }),\n [setSearchParams],\n );\n if (!entity) return null;\n return (\n <InspectEntityDialog\n entity={entity}\n initialTab={\n (selectedTab as ComponentProps<\n typeof InspectEntityDialog\n >['initialTab']) || undefined\n }\n open={typeof selectedTab === 'string'}\n onClose={close}\n onSelect={setSelectedTab}\n />\n );\n}\n\nfunction EntityLayoutContent(props: {\n content?: React.JSX.Element;\n NotFoundComponent?: ReactNode;\n}) {\n const { kind } = useRouteRefParams(entityRouteRef);\n const { entity, loading, error } = useAsyncEntity();\n const { t } = useTranslationRef(catalogTranslationRef);\n\n let content: ReactNode;\n if (error) {\n content = (\n <Container>\n <Alert status=\"danger\" title={error.toString()} />\n </Container>\n );\n } else if (entity) {\n content = <Container>{props.content ?? <NotFoundErrorPage />}</Container>;\n } else if (!loading) {\n content = (\n <Container>\n {props.NotFoundComponent ?? (\n <Alert\n status=\"warning\"\n title={t('entityLabels.warningPanelTitle')}\n description={t('entityPage.notFoundMessage', {\n kind,\n link: (\n <Link to=\"https://backstage.io/docs/features/software-catalog/references\">\n {t('entityPage.notFoundLinkText')}\n </Link>\n ),\n })}\n />\n )}\n </Container>\n );\n }\n\n return (\n <>\n {loading && <Progress />}\n {content}\n </>\n );\n}\n\nexport function EntityLayoutBui(props: {\n routes: EntityLayoutRoute[];\n NotFoundComponent?: ReactNode;\n groupDefinitions: EntityContentGroupDefinitions;\n defaultContentOrder: 'title' | 'natural';\n contextMenuItems?: ComponentProps<typeof EntityHeaderBui>['contextMenuItems'];\n HeaderComponent?: ComponentType<EntityHeaderLayoutProps>;\n}) {\n const {\n routes,\n NotFoundComponent,\n groupDefinitions,\n defaultContentOrder,\n contextMenuItems,\n HeaderComponent,\n } = props;\n const { entity } = useAsyncEntity();\n const visibleRoutes = filterEntityLayoutRoutes(routes, entity);\n const tabs = useEntityTabs({\n routes: visibleRoutes,\n groupDefinitions,\n defaultContentOrder,\n });\n\n return (\n <main>\n <EntityDocumentTitle activeContentTitle={tabs.title} />\n {HeaderComponent ? (\n <HeaderComponent tabs={tabs.tabs} activeTabId={tabs.activeTabId} />\n ) : (\n <EntityHeaderBui\n tabs={tabs.tabs}\n activeTabId={tabs.activeTabId}\n contextMenuItems={contextMenuItems}\n />\n )}\n <EntityLayoutContent\n content={tabs.content}\n NotFoundComponent={NotFoundComponent}\n />\n <InspectEntityDialogHost />\n </main>\n );\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useMemo } from 'react';\nimport { type HeaderNavTab, type HeaderNavTabItem } from '@backstage/ui';\nimport { type EntityContentGroupDefinitions } from '@backstage/plugin-catalog-react/alpha';\nimport { type SubRoute, useSelectedSubRoute } from './EntityTabs';\n\nfunction tabHrefFromPath(path: string): string {\n return path.replace(/\\/\\*$/, '').replace(/^\\//, '');\n}\n\nexport function buildHeaderTabs(\n routes: SubRoute[],\n groupDefinitions: EntityContentGroupDefinitions,\n defaultContentOrder: 'title' | 'natural',\n): HeaderNavTabItem[] {\n const aliases = Object.entries(groupDefinitions).reduce(\n (map, [id, group]) => {\n for (const alias of group.aliases ?? []) map[alias] = id;\n return map;\n },\n {} as Record<string, string>,\n );\n const groups = routes.reduce((result, route) => {\n const groupId =\n route.group &&\n (groupDefinitions[route.group] ? route.group : aliases[route.group]);\n const group = groupId ? groupDefinitions[groupId] : undefined;\n const key = groupId && group ? groupId : route.path;\n result[key] ??= { group, items: [] };\n result[key].items.push({\n id: route.path,\n label: route.title,\n href: tabHrefFromPath(route.path),\n });\n return result;\n }, {} as Record<string, { group?: EntityContentGroupDefinitions[string]; items: HeaderNavTab[] }>);\n const order = Object.keys(groupDefinitions);\n const entries = Object.entries(groups).sort(([a], [b]) => {\n const ai = order.indexOf(a);\n const bi = order.indexOf(b);\n if (ai !== -1 && bi !== -1) return ai - bi;\n if (ai !== -1) return -1;\n if (bi !== -1) return 1;\n return 0;\n });\n for (const [, group] of entries) {\n if (\n group.group &&\n (group.group.contentOrder ?? defaultContentOrder) === 'title'\n ) {\n group.items.sort((a, b) =>\n a.label.localeCompare(b.label, undefined, { sensitivity: 'base' }),\n );\n }\n }\n return entries.map(([id, group]) =>\n group.group && group.items.length > 1\n ? { id, label: group.group.title, items: group.items }\n : group.items[0],\n );\n}\n\nexport function useEntityTabs(props: {\n routes: SubRoute[];\n groupDefinitions: EntityContentGroupDefinitions;\n defaultContentOrder: 'title' | 'natural';\n}) {\n const { routes, groupDefinitions, defaultContentOrder } = props;\n const { route, element } = useSelectedSubRoute(routes);\n const tabs = useMemo(\n () => buildHeaderTabs(routes, groupDefinitions, defaultContentOrder),\n [routes, groupDefinitions, defaultContentOrder],\n );\n return {\n tabs,\n activeTabId: route?.path,\n content: element,\n title: route?.title,\n };\n}\n","/*\n * Copyright 2026 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ComponentType, ReactElement } from 'react';\nimport { Entity, stringifyEntityRef } from '@backstage/catalog-model';\nimport { useRouteRefParams } from '@backstage/core-plugin-api';\nimport {\n AsyncEntityProvider,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport {\n type EntityContentGroupDefinitions,\n type EntityHeaderLayoutProps,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { useEntityFromUrl } from '../../components/CatalogEntityPage/useEntityFromUrl';\nimport { EntityLayout } from './EntityLayout';\nimport { EntityLayoutBui } from './EntityLayout/EntityLayoutBui';\nimport type { EntityLayoutRoute } from './EntityLayout/entityLayoutRoutes';\nimport type { EntityContextMenuItemDataWithNode } from './EntityContextMenu';\n\nexport interface CatalogEntityPageProps {\n menuItems: Array<\n EntityContextMenuItemDataWithNode & { filter: (entity: Entity) => boolean }\n >;\n headerLayouts: Array<{\n Component: ComponentType<EntityHeaderLayoutProps>;\n filter: (entity: Entity) => boolean;\n }>;\n headers: Array<{\n element?: ReactElement;\n filter: (entity: Entity) => boolean;\n }>;\n routes: EntityLayoutRoute[];\n groupDefinitions: EntityContentGroupDefinitions;\n defaultContentOrder: 'title' | 'natural';\n showNavItemIcons: boolean;\n}\n\nexport function CatalogEntityPage(props: CatalogEntityPageProps) {\n const routeParams = useRouteRefParams(entityRouteRef);\n const entityFromUrl = useEntityFromUrl();\n const matchesRoute =\n !!entityFromUrl.entity &&\n stringifyEntityRef(entityFromUrl.entity) ===\n stringifyEntityRef(routeParams);\n const entity = matchesRoute ? entityFromUrl.entity : undefined;\n const entityProviderProps = {\n ...entityFromUrl,\n entity,\n loading: entityFromUrl.loading || (!!entityFromUrl.entity && !matchesRoute),\n };\n const filteredMenuItems = entity\n ? props.menuItems\n .filter(item => item.filter(entity))\n .map(({ data, node }) => ({ data, node }))\n : [];\n\n const HeaderComponent = entity\n ? props.headerLayouts.find(layout => layout.filter(entity))?.Component\n : undefined;\n const legacyHeader = entity\n ? props.headers.find(header => header.filter(entity))?.element\n : undefined;\n\n const layout =\n HeaderComponent || !legacyHeader ? (\n <EntityLayoutBui\n routes={props.routes}\n HeaderComponent={HeaderComponent}\n contextMenuItems={filteredMenuItems}\n groupDefinitions={props.groupDefinitions}\n defaultContentOrder={props.defaultContentOrder}\n />\n ) : (\n <EntityLayout\n routes={props.routes}\n header={legacyHeader}\n contextMenuItems={filteredMenuItems}\n groupDefinitions={props.groupDefinitions}\n defaultContentOrder={props.defaultContentOrder}\n showNavItemIcons={props.showNavItemIcons}\n />\n );\n\n return (\n <AsyncEntityProvider {...entityProviderProps}>{layout}</AsyncEntityProvider>\n );\n}\n","/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n errorApiRef,\n useApi,\n useRouteRefParams,\n} from '@backstage/core-plugin-api';\nimport {\n catalogApiRef,\n EntityLoadingStatus,\n entityRouteRef,\n} from '@backstage/plugin-catalog-react';\nimport { useEffect } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport useAsyncRetry from 'react-use/esm/useAsyncRetry';\n\nexport const useEntityFromUrl = (): EntityLoadingStatus => {\n const { kind, namespace, name } = useRouteRefParams(entityRouteRef);\n const navigate = useNavigate();\n const errorApi = useApi(errorApiRef);\n const catalogApi = useApi(catalogApiRef);\n\n const {\n value: entity,\n error,\n loading,\n retry: refresh,\n } = useAsyncRetry(\n () => catalogApi.getEntityByRef({ kind, namespace, name }),\n [catalogApi, kind, namespace, name],\n );\n\n useEffect(() => {\n if (!name) {\n errorApi.post(new Error('No name provided!'));\n navigate('/');\n }\n }, [errorApi, navigate, error, loading, entity, name]);\n\n return { entity, loading, error, refresh };\n};\n"],"names":["instance","b","options","isJsonObject","value","Array","isJsonObjectDeep","seen","Set","Object","v","isJsonValueDeep","result","validateMetaSchema","schema","InputError","ajv","Ajv","ajvErrors","error","message","jsonObjectSchema","z","x","jsonSchemaSchema","ctx","isError","opDeclareAnnotationV1Schema","opDeclareKindV1Schema","fullKindSchema","reduceKindSchema","parsed","allOf","rest","type","allProperties","kindRest","apiVersion","kind","properties","FORBIDDEN_SCHEMA_ROOT_FIELDS","FORBIDDEN_SCHEMA_STRUCTURAL_FIELDS","relationFieldSchema","opDeclareKindVersionV1Schema","opsFromCatalogModelAddKindVersion","definition","ops","version","jsonSchema","name","validateKindRootSchemaSemantics","undefined","field","rootProperties","fieldName","fieldSchema","specType","input","opDeclareLabelV1Schema","opDeclareRelationV1Schema","createDeclareRelationOp","opRemoveAnnotationV1Schema","opRemoveKindV1Schema","opRemoveLabelV1Schema","opRemoveTagV1Schema","opDeclareTagV1Schema","opUpdateAnnotationV1Schema","opUpdateKindV1Schema","opUpdateKindVersionV1Schema","opUpdateLabelV1Schema","opUpdateRelationV1Schema","createUpdateRelationOp","opUpdateTagV1Schema","OpaqueCatalogModelLayer","OpaqueType","DefaultCatalogModelLayerBuilder","opsFromCatalogModelUpdateKind","relation","opsFromCatalogModelRelationPair","relationPair","firstKind","secondKind","opsFromCatalogModelUpdateRelationPair","annotation","opsFromCatalogModelAnnotation","opsFromCatalogModelUpdateAnnotation","label","opsFromCatalogModelLabel","opsFromCatalogModelUpdateLabel","tag","layer","internal","RELATION_OWNED_BY","RELATION_DEPENDS_ON","RELATION_PART_OF","RELATION_HAS_PART","model","DependencyGraphTypes","useStyles","makeStyles","FavoriteToggleIcon","props","isFavorite","classes","Typography","StarIcon","UnstarredIcon","FavoriteToggle","id","title","onChange","iconButtonProps","Tooltip","IconButton","ClickableText","withStyles","StyledBox","Box","BreadcrumbsCurrentPage","Breadcrumbs","children","restProps","anchorEl","setAnchorEl","useState","childrenArray","Children","firstPage","secondPage","expandablePages","currentPage","hasHiddenBreadcrumbs","Fragment","MaterialBreadcrumbs","event","Popover","Boolean","List","pageLink","index","ListItem","theme","Content","className","stretch","noPadding","classNames","TypeFragment","typeLink","pageTitle","Link","TitleFragment","tooltip","contentRef","useContent","FinalTitle","SubtitleFragment","subtitle","Header","pageTitleOverride","style","appTitle","configApi","useApi","configApiRef","documentTitle","titleTemplate","defaultTitle","Helmet","Grid","alpha","HeaderLabelContent","typographyRootComponent","HeaderLabel","url","contentTypograpyRootComponent","content","Page","themeId","ThemeProvider","baseTheme","useRouteRefParams","_routeRef","useParams","ButtonLinkDefinition","defineComponent","styles","ButtonLinkView","definitionResult","navigation","forwardedRef","ownProps","dataAttributes","analytics","iconStart","iconEnd","navigationProps","getReactAriaAnchorProps","RALink","e","text","getNodeText","String","ButtonLink","forwardRef","ref","useDefinition","Navigation","CardDefinition","CardHeaderDefinition","CardBodyDefinition","CardFooterDefinition","Card","utilityStyle","onPress","href","linkTarget","rel","download","isInteractive","triggerRef","useRef","handleClick","useCallback","targetNode","targetElement","Element","window","MouseEvent","RAButton","CardHeader","CardBody","CardFooter","ContainerDefinition","Container","HeaderNavDefinition","HeaderNavItemDefinition","HeaderNavGroupDefinition","HeaderNavIndicators","navRef","itemRefs","activeKey","highlightedKey","prevActiveKey","prevHoveredKey","resetTimer","updateCSSVariables","container","containerRect","el","rect","relativeLeft","relativeTop","requestAnimationFrame","cancelAnimationFrame","useEffect","handleResize","isTabGroup","tab","HeaderNavLinkView","routerOptions","active","registerRef","onHighlight","linkRef","ariaHref","linkProps","useLink","hoverProps","useHover","_href","anchorProps","mergeProps","commonProps","browserHref","HeaderNavLink","HeaderNavGroupItem","group","activeChildId","MenuTrigger","RiArrowDownSLine","Menu","item","MenuItem","HeaderNavAutoDetect","activeTabId","useAutoActiveTabId","tabs","routing","useRoutingIntegration","basePath","pathname","useMemo","routeObjects","allTabs","resolvePath","matches","matchRoutes","HeaderNavInner","isFocusVisible","useFocusVisible","Map","setHighlightedKey","child","c","key","HeaderNav","inRouter","HeaderDefinition","customActions","breadcrumbs","description","tags","metadata","sticky","descriptionNodes","Lexer","token","i","sanitizeUrl","stickySentinelRef","isStuck","setIsStuck","sentinel","root","getScrollParent","element","parent","overflow","overflowX","overflowY","IntersectionObserver","updateStuckState","sentinelRect","rootTop","scrollTarget","observer","entry","Text","breadcrumb","RiArrowRightSLine","EntityRefLinks","entityRefs","hideIcons","r","entityRefString","stringifyEntityRef","EntityRefLink","getEntityRelations","entity","relationType","filter","entityNames","parseEntityRef","getEntityRef","entityOrRef","useStarredEntity","starredEntitiesApi","starredEntitiesApiRef","isStarredEntity","setIsStarredEntity","subscription","starredEntities","toggleStarredEntity","FavoriteEntity","t","useTranslationRef","catalogReactTranslationRef","LazyDependencyGraphContent","lazy","m","DependencyGraph","Suspense","DEFAULT_ICON","SvgIcon","EntityKindIcon","app","actualKind","entityRef","otherProps","Icon","useApp","getKind","CustomNode","node","navigate","useNavigate","entityRoute","useRouteRef","entityRouteRef","width","setWidth","height","setHeight","idRef","useLayoutEffect","renderedHeight","renderedWidth","Math","hasKindIcon","paddedIconWidth","iconSize","paddedHeight","padding","displayTitle","useEntityPresentation","DEFAULT_NAMESPACE","AncestryPage","loading","nodes","edges","useAncestry","catalogClient","catalogApiRef","useAsync","response","current","currentRef","isRootNode","parentRef","Progress","ResponseErrorPanel","ListSection","ListItemRow","EntityList","Contents","location","originLocation","colocatedEntities","useColocated","catalogApi","currentEntityRef","ANNOTATION_LOCATION","origin","ANNOTATION_ORIGIN_LOCATION","colocated","Alert","atLocation","atOrigin","ColocatedPage","sortKeys","data","a","JsonPage","CodeSnippet","JSON","TagGroupDefinition","TagDefinition","TagGroup","items","renderEmptyState","BUIRoutingProvider","ReactAriaTagGroup","ReactAriaTagList","Tag","icon","rawHref","textValue","ReactAriaTag","allowsRemoving","ReactAriaButton","RiCloseCircleLine","entriesToItems","entries","link","CopyButton","copied","setCopied","timerRef","clearTimeout","handlePress","setTimeout","ButtonIcon","RiCheckLine","RiFileCopyLine","VisuallyHidden","HelpIcon","RiQuestionLine","ListSubheader","KeyValueList","OverviewPage","spec","relations","status","groupedRelations","groupBy","sortBy","Flex","groupRelations","YamlPage","YAML","TAB_KEYS","DialogContents","initialTab","onSelect","tabNames","tabContent","DialogHeader","DialogBody","Tabs","TabList","Tab","TabPanel","InspectEntityDialog","open","onClose","Dialog","isOpen","EntityLabels","ownedByRelations","catalogTranslationRef","EntityContextMenuItemContent","useProps","disabled","onClick","menuItemProps","onAction","EntityContextMenuItem","ExtensionBoundary","EntityContextMenu","UNSTABLE_extraContextMenuItems","contextMenuItems","RiMore2Line","MenuSeparator","headerProps","paramKind","paramNamespace","paramName","namespace","findParentRelation","entityRelations","relationTypes","foundRelation","EntityHeaderTitle","useAsyncEntity","EntityDisplayName","EntityHeaderSubtitle","parentEntityRelations","parentEntity","ancestorEntity","EntityHeader","entityFallbackText","searchParams","setSearchParams","useSearchParams","selectedInspectEntityDialogTab","setInspectEntityDialogTab","newTab","closeInspectEntityDialog","EntityTabsPanel","resolveIcon","iconsApi","showIcons","iconsApiRef","disableFocusRipple","fullWidth","indicator","onSelectTab","selected","textColor","wrapped","highlightedButton","groupIcon","testId","handleMenuClose","classArray","capitalize","Button","classnames","hasIcons","ExpandMoreIcon","itemIcon","ListItemIcon","ListItemText","EntityTabsGroup","createStyles","resolveGroupId","tabGroup","groupDefinitions","aliasToGroup","EntityTabsList","selectedIndex","defaultContentOrder","map","groupId","def","alias","groups","byKey","resolvedGroupId","groupOrId","groupOrder","sorted","ai","bi","groupDef","order","selectedItem","selectedGroup","useSelectedSubRoute","subRoutes","params","routes","path","normalizeRoutePath","withoutLeading","trimmed","useRoutes","currentRoute","matchedRoute","foundIndex","EntityTabs","route","to","NotFoundErrorPage","filterEntityLayoutRoutes","EntityLayout","header","NotFoundComponent","showNavItemIcons","visibleRoutes","WarningPanel","AvatarDefinition","Avatar","size","src","purpose","imageStatus","setImageStatus","img","Image","initialsCount","initials","word","HeaderMetadataUsers","users","user","TooltipTrigger","Pressable","HierarchyLinks","entityLink","useEntityRefLink","FavoriteEntityButton","RiStarFill","RiStarLine","EntityHeaderBui","routeParams","presentation","useMetadata","owners","useOwnerUsers","ownerRefs","ownerRefStrings","ownerEntities","owner","profile","lifecycle","refs","hierarchyLabel","EntityDocumentTitle","InspectEntityDialogHost","selectedTab","setSelectedTab","next","URLSearchParams","close","EntityLayoutContent","EntityLayoutBui","HeaderComponent","useEntityTabs","buildHeaderTabs","aliases","CatalogEntityPage","entityFromUrl","useEntityFromUrl","errorApi","errorApiRef","refresh","useAsyncRetry","Error","matchesRoute","entityProviderProps","filteredMenuItems","layout","legacyHeader","AsyncEntityProvider"],"mappings":"0IAuBMA,ECwBEC,E,iDAfgCC,E,WCXjC,SAASC,EAAaC,CAAe,EAC1C,MAAO,AAAiB,UAAjB,OAAOA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