@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.
- package/CHANGELOG.md +29 -0
- package/dist/commands/generate/generate.cjs.js +32 -2
- package/dist/commands/generate/generate.cjs.js.map +1 -1
- package/dist/commands/index.cjs.js +9 -1
- package/dist/commands/index.cjs.js.map +1 -1
- package/dist/commands/publish/publish.cjs.js +47 -0
- package/dist/commands/publish/publish.cjs.js.map +1 -1
- package/dist/embedded-app/.config-schema.json +51 -46
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/index.html.tmpl +1 -1
- package/dist/embedded-app/static/123.91ba1b809deb.chunk.js +2 -0
- package/dist/embedded-app/static/123.91ba1b809deb.chunk.js.map +1 -0
- package/dist/embedded-app/static/1659.a99e4eb674e0.chunk.js +2 -0
- package/dist/embedded-app/static/1659.a99e4eb674e0.chunk.js.map +1 -0
- package/dist/embedded-app/static/1749.99ba95728e00.chunk.js +2 -0
- package/dist/embedded-app/static/1749.99ba95728e00.chunk.js.map +1 -0
- package/dist/embedded-app/static/1994.7736057c2e9f.chunk.js +2 -0
- package/dist/embedded-app/static/1994.7736057c2e9f.chunk.js.map +1 -0
- package/dist/embedded-app/static/{2055.fd3ccf91ac47.chunk.js → 2055.d938e6121e5f.chunk.js} +4 -4
- package/dist/embedded-app/static/2055.d938e6121e5f.chunk.js.map +1 -0
- package/dist/embedded-app/static/{2295.e8be8ba6c18d.chunk.js → 2295.aaedbca4c1c5.chunk.js} +2 -2
- package/dist/embedded-app/static/2295.aaedbca4c1c5.chunk.js.map +1 -0
- package/dist/embedded-app/static/2360.806f2e1ab212.chunk.js +2 -0
- package/dist/embedded-app/static/2360.806f2e1ab212.chunk.js.map +1 -0
- package/dist/embedded-app/static/3554.78dd0c182f6c.chunk.js +2 -0
- package/dist/embedded-app/static/3554.78dd0c182f6c.chunk.js.map +1 -0
- package/dist/embedded-app/static/4587.d1220800a7d6.chunk.js +2 -0
- package/dist/embedded-app/static/4587.d1220800a7d6.chunk.js.map +1 -0
- package/dist/embedded-app/static/4591.d741c025cb8a.chunk.js +2 -0
- package/dist/embedded-app/static/4591.d741c025cb8a.chunk.js.map +1 -0
- package/dist/embedded-app/static/4609.b1c67dc7cac2.chunk.js +531 -0
- package/dist/embedded-app/static/4609.b1c67dc7cac2.chunk.js.map +1 -0
- package/dist/embedded-app/static/4648.cd5b8df48435.chunk.js +2 -0
- package/dist/embedded-app/static/4648.cd5b8df48435.chunk.js.map +1 -0
- package/dist/embedded-app/static/6138.f15d6245c80d.chunk.js +2 -0
- package/dist/embedded-app/static/6138.f15d6245c80d.chunk.js.map +1 -0
- package/dist/embedded-app/static/6206.3e7f13e11c59.chunk.js +2 -0
- package/dist/embedded-app/static/6206.3e7f13e11c59.chunk.js.map +1 -0
- package/dist/embedded-app/static/6949.beeb90ede97f.chunk.js +4 -0
- package/dist/embedded-app/static/6949.beeb90ede97f.chunk.js.map +1 -0
- package/dist/embedded-app/static/7203.8b3d94b34b16.chunk.js +2 -0
- package/dist/embedded-app/static/7203.8b3d94b34b16.chunk.js.map +1 -0
- package/dist/embedded-app/static/8877.ab3d98868650.chunk.js +2 -0
- package/dist/embedded-app/static/8877.ab3d98868650.chunk.js.map +1 -0
- package/dist/embedded-app/static/9050.bd63e0a33f06.chunk.js +2 -0
- package/dist/embedded-app/static/9050.bd63e0a33f06.chunk.js.map +1 -0
- package/dist/embedded-app/static/9230.422824f655e0.chunk.js +2 -0
- package/dist/embedded-app/static/9230.422824f655e0.chunk.js.map +1 -0
- package/dist/embedded-app/static/main.9b48363c4ffa.js +2 -0
- package/dist/embedded-app/static/main.9b48363c4ffa.js.map +1 -0
- package/dist/embedded-app/static/module-remix-run.32d1d7665115.js +2 -0
- package/dist/embedded-app/static/module-remix-run.32d1d7665115.js.map +1 -0
- package/dist/embedded-app/static/{runtime.c8854f4ed6f8.js → runtime.720cb48cd7ae.js} +2 -2
- package/dist/embedded-app/static/{runtime.c8854f4ed6f8.js.map → runtime.720cb48cd7ae.js.map} +1 -1
- package/dist/embedded-app/static/vendor.470d3e8ecef1.js +2 -0
- package/dist/embedded-app/static/vendor.470d3e8ecef1.js.map +1 -0
- package/dist/lib/etag.cjs.js +40 -0
- package/dist/lib/etag.cjs.js.map +1 -0
- package/dist/package.json.cjs.js +1 -1
- package/package.json +8 -7
- package/dist/embedded-app/static/123.449f4a83fd2b.chunk.js +0 -2
- package/dist/embedded-app/static/123.449f4a83fd2b.chunk.js.map +0 -1
- package/dist/embedded-app/static/1659.41bf35e59592.chunk.js +0 -2
- package/dist/embedded-app/static/1659.41bf35e59592.chunk.js.map +0 -1
- package/dist/embedded-app/static/1749.75c83d8a41f6.chunk.js +0 -2
- package/dist/embedded-app/static/1749.75c83d8a41f6.chunk.js.map +0 -1
- package/dist/embedded-app/static/1994.78042a47b6c6.chunk.js +0 -2
- package/dist/embedded-app/static/1994.78042a47b6c6.chunk.js.map +0 -1
- package/dist/embedded-app/static/2055.fd3ccf91ac47.chunk.js.map +0 -1
- package/dist/embedded-app/static/2295.e8be8ba6c18d.chunk.js.map +0 -1
- package/dist/embedded-app/static/2360.82e9c38bff17.chunk.js +0 -2
- package/dist/embedded-app/static/2360.82e9c38bff17.chunk.js.map +0 -1
- package/dist/embedded-app/static/3554.bb882f8e4aea.chunk.js +0 -2
- package/dist/embedded-app/static/3554.bb882f8e4aea.chunk.js.map +0 -1
- package/dist/embedded-app/static/4587.96f03715ec4f.chunk.js +0 -2
- package/dist/embedded-app/static/4587.96f03715ec4f.chunk.js.map +0 -1
- package/dist/embedded-app/static/4591.5563e3a7aea4.chunk.js +0 -2
- package/dist/embedded-app/static/4591.5563e3a7aea4.chunk.js.map +0 -1
- package/dist/embedded-app/static/4609.152f14ef4904.chunk.js +0 -531
- package/dist/embedded-app/static/4609.152f14ef4904.chunk.js.map +0 -1
- package/dist/embedded-app/static/4648.c047b78345c6.chunk.js +0 -2
- package/dist/embedded-app/static/4648.c047b78345c6.chunk.js.map +0 -1
- package/dist/embedded-app/static/6138.113ed7a1d8cd.chunk.js +0 -2
- package/dist/embedded-app/static/6138.113ed7a1d8cd.chunk.js.map +0 -1
- package/dist/embedded-app/static/6206.b2713857572e.chunk.js +0 -2
- package/dist/embedded-app/static/6206.b2713857572e.chunk.js.map +0 -1
- package/dist/embedded-app/static/6949.62c7fa0aab7f.chunk.js +0 -4
- package/dist/embedded-app/static/6949.62c7fa0aab7f.chunk.js.map +0 -1
- package/dist/embedded-app/static/7203.6e3ffa800885.chunk.js +0 -2
- package/dist/embedded-app/static/7203.6e3ffa800885.chunk.js.map +0 -1
- package/dist/embedded-app/static/8877.58093d2c2ba0.chunk.js +0 -2
- package/dist/embedded-app/static/8877.58093d2c2ba0.chunk.js.map +0 -1
- package/dist/embedded-app/static/9050.0c0d51ee0fd8.chunk.js +0 -2
- package/dist/embedded-app/static/9050.0c0d51ee0fd8.chunk.js.map +0 -1
- package/dist/embedded-app/static/9230.ba752de28896.chunk.js +0 -2
- package/dist/embedded-app/static/9230.ba752de28896.chunk.js.map +0 -1
- package/dist/embedded-app/static/main.82ddbc06e504.js +0 -2
- package/dist/embedded-app/static/main.82ddbc06e504.js.map +0 -1
- package/dist/embedded-app/static/module-remix-run.0c80eb31316a.js +0 -2
- package/dist/embedded-app/static/module-remix-run.0c80eb31316a.js.map +0 -1
- package/dist/embedded-app/static/vendor.3bc2778face5.js +0 -2
- package/dist/embedded-app/static/vendor.3bc2778face5.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static/6138.f15d6245c80d.chunk.js","sources":["webpack://techdocs-cli-embedded-app/../../node_modules/@material-ui/icons/ArrowForward.js","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/LinkButton/LinkButton.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/OverflowTooltip/OverflowTooltip.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/Select/static/ClosedDropdown.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/Select/static/OpenedDropdown.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/Select/Select.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/Table/Filters.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/Table/TableLoadingBody.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/Table/Table.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/layout/BottomLink/BottomLink.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/layout/ErrorBoundary/ErrorBoundary.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/layout/InfoCard/InfoCard.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/Checkbox/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Checkbox/Checkbox.module.css?40f4","webpack://techdocs-cli-embedded-app/../ui/src/components/Checkbox/Checkbox.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Select/Select.module.css?4ca6","webpack://techdocs-cli-embedded-app/../ui/src/components/Select/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/FieldLabel/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/FieldLabel/FieldLabel.module.css?90c3","webpack://techdocs-cli-embedded-app/../ui/src/components/FieldLabel/FieldLabel.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/FieldError/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/FieldError/FieldError.module.css?1045","webpack://techdocs-cli-embedded-app/../ui/src/components/FieldError/FieldError.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Popover/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Popover/Popover.module.css?5c0e","webpack://techdocs-cli-embedded-app/../ui/src/components/Popover/Popover.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Select/SelectTrigger.tsx","webpack://techdocs-cli-embedded-app/../ui/src/utils/selectableCollection.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Select/SelectItem.tsx","webpack://techdocs-cli-embedded-app/../ui/src/hooks/useDelayedVisibility.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Select/SelectListBox.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Select/SelectContent.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Select/Select.tsx","webpack://techdocs-cli-embedded-app/../ui/src/hooks/useTrackedSelectionKeys.ts","webpack://techdocs-cli-embedded-app/../ui/src/hooks/useCollectionAdapter.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Skeleton/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Skeleton/Skeleton.module.css?994a","webpack://techdocs-cli-embedded-app/../ui/src/components/Skeleton/Skeleton.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/components/Cell.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/components/CellText.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/components/Column.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/components/TableRoot.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/components/TableHeader.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/components/TableBody.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/components/Row.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/TablePagination/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/TablePagination/TablePagination.module.css?4197","webpack://techdocs-cli-embedded-app/../ui/src/components/TablePagination/TablePagination.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/components/TableBodySkeleton.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/components/Table.tsx","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/Table.module.css?cce8","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/definition.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/useQueryState.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/useStableCallback.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/useDebouncedValue.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/getEffectivePageSize.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/usePageCache.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/useDebouncedReload.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/useTable.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/useCompletePagination.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/useOffsetPagination.ts","webpack://techdocs-cli-embedded-app/../ui/src/components/Table/hooks/useCursorPagination.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/apis/EntityPresentationApi/entityPresentationSnapshot.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityDataTable/columnFactories.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityDataTable/presets.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityInfoCard/EntityInfoCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityRefLink/EntityRefLinks.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityDataTable/EntityDataTable.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityRelationCard/EntityRelationCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityTable/columns.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityTable/presets.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityTable/EntityTable.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/components/EntityTable/TitleColumn.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/hooks/useRelatedEntities.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog-react/src/utils/getEntityRelations.ts","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/HasResourcesCard/HasResourcesCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/RelatedEntitiesCard/RelatedEntitiesCard.tsx","webpack://techdocs-cli-embedded-app/../../plugins/catalog/src/components/RelatedEntitiesCard/presets.ts"],"sourcesContent":["\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nvar _interopRequireWildcard = require(\"@babel/runtime/helpers/interopRequireWildcard\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar React = _interopRequireWildcard(require(\"react\"));\n\nvar _createSvgIcon = _interopRequireDefault(require(\"./utils/createSvgIcon\"));\n\nvar _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z\"\n}), 'ArrowForward');\n\nexports.default = _default;","/*\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\nimport MaterialButton, {\n ButtonProps as MaterialButtonProps,\n} from '@material-ui/core/Button';\nimport { forwardRef } from 'react';\nimport { UnstyledLink, LinkProps } from '../Link/Link';\n\n/**\n * Properties for {@link LinkButton}\n *\n * @public\n * @remarks\n *\n * See {@link https://v4.mui.com/api/button/#props | Material UI Button Props} for all properties\n */\nexport type LinkButtonProps = MaterialButtonProps &\n Omit<LinkProps, 'variant' | 'color'>;\n\n/**\n * This wrapper is here to reset the color of the Link and make typescript happy.\n */\nconst LinkWrapper = forwardRef<any, LinkProps>((props, ref) => (\n <UnstyledLink ref={ref} {...props} color=\"initial\" />\n));\n\n/**\n * Thin wrapper on top of material-ui's {@link https://v4.mui.com/components/buttons/ | Button} component\n *\n * @public\n * @remarks\n */\nexport const LinkButton = forwardRef<any, LinkButtonProps>((props, ref) => (\n <MaterialButton ref={ref} component={LinkWrapper} {...props} />\n)) as (props: LinkButtonProps) => JSX.Element;\n\n/**\n * @public\n * @deprecated use LinkButton instead\n */\nexport const Button = LinkButton;\n\n/**\n * @public\n * @deprecated use LinkButtonProps instead\n */\nexport type ButtonProps = LinkButtonProps;\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 } from '@material-ui/core/styles';\nimport Tooltip, { TooltipProps } from '@material-ui/core/Tooltip';\nimport Typography from '@material-ui/core/Typography';\n\ntype Props = {\n text?: string | undefined;\n title?: TooltipProps['title'];\n line?: number | undefined;\n placement?: TooltipProps['placement'];\n tooltipClasses?: TooltipProps['classes'];\n};\n\nexport type OverflowTooltipClassKey = 'container';\n\nconst useStyles = makeStyles(\n {\n container: {\n overflow: 'visible !important',\n },\n typo: {\n fontSize: 'inherit',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n display: '-webkit-box',\n '-webkit-line-clamp': ({ line }: Props) => line || 1,\n '-webkit-box-orient': 'vertical',\n },\n },\n { name: 'BackstageOverflowTooltip' },\n);\n\nexport function OverflowTooltip(props: Props) {\n const classes = useStyles(props);\n\n return (\n <Tooltip\n title={props.title ?? (props.text || '')}\n placement={props.placement}\n classes={props.tooltipClasses}\n >\n <Typography className={classes.typo} variant=\"inherit\">\n {props.text}\n </Typography>\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 */\nimport { makeStyles, createStyles } from '@material-ui/core/styles';\nimport SvgIcon from '@material-ui/core/SvgIcon';\n\n/** @public */\nexport type ClosedDropdownClassKey = 'icon';\n\nconst useStyles = makeStyles(\n theme =>\n createStyles({\n icon: {\n position: 'absolute',\n right: theme.spacing(0.5),\n pointerEvents: 'none',\n color: '#616161',\n },\n }),\n { name: 'BackstageClosedDropdown' },\n);\n\nconst ClosedDropdown = () => {\n const classes = useStyles();\n return (\n <SvgIcon\n className={classes.icon}\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M7.5 8L6 9.5L12.0703 15.5703L18.1406 9.5L16.6406 8L12.0703 12.5703L7.5 8Z\"\n fill=\"currentColor\"\n />\n </SvgIcon>\n );\n};\n\nexport default ClosedDropdown;\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 { makeStyles, createStyles } from '@material-ui/core/styles';\nimport SvgIcon from '@material-ui/core/SvgIcon';\n\nexport type OpenedDropdownClassKey = 'icon';\n\nconst useStyles = makeStyles(\n theme =>\n createStyles({\n icon: {\n position: 'absolute',\n right: theme.spacing(0.5),\n pointerEvents: 'none',\n color: '#616161',\n },\n }),\n { name: 'BackstageOpenedDropdown' },\n);\n\nconst OpenedDropdown = () => {\n const classes = useStyles();\n return (\n <SvgIcon\n className={classes.icon}\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M16.5 16L18 14.5L11.9297 8.42969L5.85938 14.5L7.35938 16L11.9297 11.4297L16.5 16Z\"\n fill=\"currentColor\"\n />\n </SvgIcon>\n );\n};\n\nexport default OpenedDropdown;\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 Box from '@material-ui/core/Box';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Chip from '@material-ui/core/Chip';\nimport FormControl from '@material-ui/core/FormControl';\nimport InputBase from '@material-ui/core/InputBase';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport Select from '@material-ui/core/Select';\nimport {\n createStyles,\n makeStyles,\n Theme,\n withStyles,\n} from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport CancelIcon from '@material-ui/icons/Cancel';\nimport { ChangeEvent, useEffect, useState } from 'react';\n\nimport ClosedDropdown from './static/ClosedDropdown';\nimport OpenedDropdown from './static/OpenedDropdown';\n\n/** @public */\nexport type SelectInputBaseClassKey = 'root' | 'input';\n\nconst BootstrapInput = withStyles(\n (theme: Theme) =>\n createStyles({\n root: {\n 'label + &': {\n marginTop: theme.spacing(3),\n },\n '&.Mui-focused > div[role=button]': {\n borderColor: theme.palette.primary.main,\n },\n },\n input: {\n borderRadius: theme.shape.borderRadius,\n position: 'relative',\n backgroundColor: theme.palette.background.paper,\n border: '1px solid #ced4da',\n fontSize: theme.typography.body1.fontSize,\n padding: theme.spacing(1.25, 3.25, 1.25, 1.5),\n transition: theme.transitions.create(['border-color', 'box-shadow']),\n '&:focus': {\n background: theme.palette.background.paper,\n borderRadius: theme.shape.borderRadius,\n },\n },\n }),\n { name: 'BackstageSelectInputBase' },\n)(InputBase);\n\n/** @public */\nexport type SelectClassKey =\n | 'formControl'\n | 'label'\n | 'chips'\n | 'chip'\n | 'checkbox'\n | 'root';\n\nconst useStyles = makeStyles(\n (theme: Theme) =>\n createStyles({\n formControl: {\n margin: theme.spacing(1, 0),\n },\n label: {\n transform: 'initial',\n fontWeight: 'bold',\n fontSize: theme.typography.body2.fontSize,\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n '&.Mui-focused': {\n color: theme.palette.text.primary,\n },\n },\n formLabel: {\n transform: 'initial',\n fontWeight: 'bold',\n fontSize: theme.typography.body2.fontSize,\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n '&.Mui-focused': {\n color: theme.palette.text.primary,\n },\n },\n chips: {\n display: 'flex',\n flexWrap: 'wrap',\n },\n chip: {\n margin: 2,\n },\n checkbox: {},\n\n root: {\n display: 'flex',\n flexDirection: 'column',\n },\n }),\n { name: 'BackstageSelect' },\n);\n\n/** @public */\nexport type SelectItem = {\n label: string;\n value: string | number;\n};\n\n/** @public */\nexport type SelectedItems = string | string[] | number | number[];\n\nexport type SelectProps = {\n multiple?: boolean;\n items: SelectItem[];\n label: string;\n placeholder?: string;\n selected?: SelectedItems;\n onChange: (arg: SelectedItems) => void;\n triggerReset?: boolean;\n native?: boolean;\n disabled?: boolean;\n margin?: 'dense' | 'none';\n 'data-testid'?: string;\n};\n\n/** @public */\nexport function SelectComponent(props: SelectProps) {\n const {\n multiple,\n items,\n label,\n placeholder,\n selected,\n onChange,\n triggerReset,\n native = false,\n disabled = false,\n margin,\n 'data-testid': dataTestId = 'select',\n } = props;\n const classes = useStyles();\n const [value, setValue] = useState<SelectedItems>(\n selected || (multiple ? [] : ''),\n );\n const [isOpen, setOpen] = useState(false);\n\n useEffect(() => {\n setValue(multiple ? [] : '');\n }, [triggerReset, multiple]);\n\n useEffect(() => {\n setValue(selected || (multiple ? [] : ''));\n }, [selected, multiple]);\n\n const handleChange = (event: ChangeEvent<{ value: unknown }>) => {\n setValue(event.target.value as SelectedItems);\n onChange(event.target.value as SelectedItems);\n };\n\n const handleOpen = (event: ChangeEvent<any>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n setOpen(previous => {\n if (multiple && !(event.target instanceof HTMLElement)) {\n return true;\n }\n return !previous;\n });\n };\n\n const handleClose = () => {\n setOpen(false);\n };\n\n const handleDelete = (selectedValue: string | number) => () => {\n const newValue = (value as any[]).filter(chip => chip !== selectedValue);\n setValue(newValue);\n onChange(newValue);\n };\n\n return (\n <Box className={classes.root}>\n <FormControl className={classes.formControl}>\n <InputLabel className={classes.formLabel}>{label}</InputLabel>\n <Select\n aria-label={label}\n value={value}\n native={native}\n disabled={disabled}\n data-testid={dataTestId}\n displayEmpty\n multiple={multiple}\n margin={margin}\n onChange={handleChange}\n open={isOpen}\n onOpen={handleOpen}\n onClose={handleClose}\n input={<BootstrapInput />}\n label={label}\n renderValue={s =>\n multiple && (value as any[]).length !== 0 ? (\n <Box className={classes.chips}>\n {(s as string[]).map(selectedValue => {\n const item = items.find(el => el.value === selectedValue);\n return item ? (\n <Chip\n data-testid=\"chip\"\n key={item?.value}\n label={item?.label}\n clickable\n deleteIcon={\n <CancelIcon\n data-testid=\"cancel-icon\"\n onMouseDown={event => event.stopPropagation()}\n />\n }\n onDelete={handleDelete(selectedValue)}\n className={classes.chip}\n />\n ) : (\n false\n );\n })}\n </Box>\n ) : (\n <Typography>\n {(value as any[]).length === 0\n ? placeholder || ''\n : items.find(el => el.value === s)?.label}\n </Typography>\n )\n }\n IconComponent={() =>\n !isOpen ? <ClosedDropdown /> : <OpenedDropdown />\n }\n MenuProps={{\n anchorOrigin: {\n vertical: 'bottom',\n horizontal: 'left',\n },\n transformOrigin: {\n vertical: 'top',\n horizontal: 'left',\n },\n getContentAnchorEl: null,\n }}\n >\n {!!placeholder && !multiple && (\n <MenuItem value={[]}>{placeholder}</MenuItem>\n )}\n {native\n ? items &&\n items.map(item => (\n <option value={item.value} key={item.value}>\n {item.label}\n </option>\n ))\n : items &&\n items.map(item => (\n <MenuItem key={item.value} value={item.value}>\n {multiple && (\n <Checkbox\n color=\"primary\"\n checked={(value as any[]).includes(item.value) || false}\n className={classes.checkbox}\n />\n )}\n {item.label}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\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 */\n\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useEffect, useState } from 'react';\n\nimport { Select } from '../Select';\nimport { SelectProps } from '../Select/Select';\nimport { coreComponentsTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\nexport type TableFiltersClassKey =\n | 'root'\n | 'value'\n | 'header'\n /**\n * @deprecated Use `'header'` instead. This was a typo in the original class key.\n */\n | 'heder'\n | 'filters';\n\nconst useFilterStyles = makeStyles(\n theme => ({\n root: {\n height: '100%',\n width: '315px',\n display: 'flex',\n flexDirection: 'column',\n marginRight: theme.spacing(3),\n },\n value: {\n fontWeight: 'bold',\n fontSize: 18,\n },\n header: {\n display: 'flex',\n alignItems: 'center',\n height: theme.spacing(7.5),\n justifyContent: 'space-between',\n borderBottom: `1px solid ${theme.palette.grey[500]}`,\n },\n // Intentionally empty: the deprecated `heder` class is still applied to\n // the same element as `header` so legacy theme overrides on\n // `BackstageTableFilters.heder` continue to work. Keeping this rule empty\n // (rather than duplicating `header`'s styles) avoids clobbering overrides\n // on the canonical `header` key — JSS injects rules in key order, so an\n // empty `heder` defined after `header` has no properties to override.\n heder: {},\n filters: {\n display: 'flex',\n flexDirection: 'column',\n '& > *': {\n marginTop: theme.spacing(2),\n },\n },\n }),\n { name: 'BackstageTableFilters' },\n);\n\nexport type Without<T, K> = Pick<T, Exclude<keyof T, K>>;\n\nexport type Filter = {\n type: 'select' | 'multiple-select';\n element: Without<SelectProps, 'onChange'>;\n};\n\nexport type SelectedFilters = {\n [key: string]: string | string[];\n};\n\ntype Props = {\n filters: Filter[];\n selectedFilters?: SelectedFilters;\n onChangeFilters: (arg: any) => any;\n};\n\nexport const Filters = (props: Props) => {\n const classes = useFilterStyles();\n\n const { onChangeFilters } = props;\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n\n const [selectedFilters, setSelectedFilters] = useState<SelectedFilters>({\n ...props.selectedFilters,\n });\n const [reset, triggerReset] = useState(false);\n\n // Trigger re-rendering\n const handleClick = () => {\n setSelectedFilters({});\n triggerReset(el => !el);\n };\n\n useEffect(() => {\n onChangeFilters(selectedFilters);\n }, [selectedFilters, onChangeFilters]);\n\n // As material table doesn't provide a way to add a column filter tab we will make our own filter logic\n return (\n <Box className={classes.root}>\n <Box className={`${classes.header} ${classes.heder}`}>\n <Box className={classes.value}>{t('table.filter.title')}</Box>\n <Button color=\"primary\" onClick={handleClick}>\n {t('table.filter.clearAll')}\n </Button>\n </Box>\n <Box className={classes.filters}>\n {!!props.filters?.length &&\n props.filters.map(filter => (\n <Select\n triggerReset={reset}\n key={filter.element.label}\n {...(filter.element as SelectProps)}\n selected={selectedFilters[filter.element.label]}\n onChange={el =>\n setSelectedFilters({\n ...selectedFilters,\n [filter.element.label]: el as any,\n })\n }\n />\n ))}\n </Box>\n </Box>\n );\n};\n","/*\n * Copyright 2023 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 CircularProgress from '@material-ui/core/CircularProgress';\n\n/**\n * @internal\n */\nexport function TableLoadingBody(props: { colSpan?: number }) {\n return (\n <tbody data-testid=\"loading-indicator\">\n <tr>\n <td colSpan={props.colSpan}>\n <Box\n sx={{\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n width: '100%',\n minHeight: '15rem',\n }}\n >\n <CircularProgress size=\"5rem\" />\n </Box>\n </td>\n </tr>\n </tbody>\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 TranslationFunction,\n useTranslationRef,\n} from '@backstage/core-plugin-api/alpha';\nimport MTable, {\n Column,\n Icons,\n MaterialTableProps,\n MTableBody,\n MTableHeader,\n MTableToolbar,\n Options,\n} from '@material-table/core';\nimport Box from '@material-ui/core/Box';\nimport IconButton from '@material-ui/core/IconButton';\nimport {\n makeStyles,\n Theme,\n useTheme,\n withStyles,\n} from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport AddBox from '@material-ui/icons/AddBox';\nimport ArrowUpward from '@material-ui/icons/ArrowUpward';\nimport Check from '@material-ui/icons/Check';\nimport ChevronLeft from '@material-ui/icons/ChevronLeft';\nimport ChevronRight from '@material-ui/icons/ChevronRight';\nimport Clear from '@material-ui/icons/Clear';\nimport DeleteOutline from '@material-ui/icons/DeleteOutline';\nimport Edit from '@material-ui/icons/Edit';\nimport FilterList from '@material-ui/icons/FilterList';\nimport Search from '@material-ui/icons/Search';\nimport FirstPage from '@material-ui/icons/FirstPage';\nimport LastPage from '@material-ui/icons/LastPage';\nimport Remove from '@material-ui/icons/Remove';\nimport SaveAlt from '@material-ui/icons/SaveAlt';\nimport ViewColumn from '@material-ui/icons/ViewColumn';\nimport { isEqual, transform } from 'lodash';\nimport {\n CSSProperties,\n forwardRef,\n MutableRefObject,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { coreComponentsTranslationRef } from '../../translation';\nimport { SelectProps } from '../Select/Select';\nimport { Filter, Filters, SelectedFilters, Without } from './Filters';\nimport { TableLoadingBody } from './TableLoadingBody';\n\n// Material-table is not using the standard icons available in in material-ui. https://github.com/mbrn/material-table/issues/51\nconst tableIcons: Icons = {\n Add: forwardRef<SVGSVGElement>((props, ref) => (\n <AddBox {...props} ref={ref} />\n )),\n Check: forwardRef<SVGSVGElement>((props, ref) => (\n <Check {...props} ref={ref} />\n )),\n Clear: forwardRef<SVGSVGElement>((props, ref) => (\n <Clear {...props} ref={ref} />\n )),\n Delete: forwardRef<SVGSVGElement>((props, ref) => (\n <DeleteOutline {...props} ref={ref} />\n )),\n DetailPanel: forwardRef<SVGSVGElement>((props, ref) => (\n <ChevronRight {...props} ref={ref} />\n )),\n Edit: forwardRef<SVGSVGElement>((props, ref) => (\n <Edit {...props} ref={ref} />\n )),\n Export: forwardRef<SVGSVGElement>((props, ref) => (\n <SaveAlt {...props} ref={ref} />\n )),\n Filter: forwardRef<SVGSVGElement>((props, ref) => (\n <FilterList {...props} ref={ref} />\n )),\n FirstPage: forwardRef<SVGSVGElement>((props, ref) => (\n <FirstPage {...props} ref={ref} />\n )),\n LastPage: forwardRef<SVGSVGElement>((props, ref) => (\n <LastPage {...props} ref={ref} />\n )),\n NextPage: forwardRef<SVGSVGElement>((props, ref) => (\n <ChevronRight {...props} ref={ref} />\n )),\n PreviousPage: forwardRef<SVGSVGElement>((props, ref) => (\n <ChevronLeft {...props} ref={ref} />\n )),\n ResetSearch: forwardRef<SVGSVGElement>((props, ref) => (\n <Clear {...props} ref={ref} />\n )),\n Search: forwardRef<SVGSVGElement>((props, ref) => (\n <Search {...props} ref={ref} />\n )),\n SortArrow: forwardRef<SVGSVGElement>((props, ref) => (\n <ArrowUpward {...props} ref={ref} />\n )),\n ThirdStateCheck: forwardRef<SVGSVGElement>((props, ref) => (\n <Remove {...props} ref={ref} />\n )),\n ViewColumn: forwardRef<SVGSVGElement>((props, ref) => (\n <ViewColumn {...props} ref={ref} />\n )),\n};\n\n// TODO: Material table might already have such a function internally that we can use?\nfunction extractValueByField(data: any, field: string): any | undefined {\n const path = field.split('.');\n let value = data[path[0]];\n\n for (let i = 1; i < path.length; ++i) {\n if (value === undefined) {\n return value;\n }\n\n const f = path[i];\n value = value[f];\n }\n\n return value;\n}\n\nexport type TableHeaderClassKey = 'header';\n\nconst StyledMTableHeader = withStyles(\n theme => ({\n header: {\n padding: theme.spacing(1, 2, 1, 2.5),\n borderTop: `1px solid ${theme.palette.grey.A100}`,\n borderBottom: `1px solid ${theme.palette.grey.A100}`,\n // withStyles hasn't a generic overload for theme\n fontWeight: theme.typography.fontWeightBold,\n position: 'static',\n wordBreak: 'normal',\n textTransform: 'uppercase',\n },\n }),\n { name: 'BackstageTableHeader' },\n)(MTableHeader);\n\nexport type TableToolbarClassKey = 'root' | 'title' | 'searchField';\n\nconst StyledMTableToolbar = withStyles(\n theme => ({\n root: {\n padding: theme.spacing(3, 0, 2.5, 2.5),\n },\n title: {\n '& > h6': {\n fontWeight: theme.typography.fontWeightBold,\n },\n },\n searchField: {\n paddingRight: theme.spacing(2),\n },\n }),\n { name: 'BackstageTableToolbar' },\n)(MTableToolbar);\n\n/** @public */\nexport type FiltersContainerClassKey = 'root' | 'filterControls' | 'title';\n\nconst useFilterStyles = makeStyles(\n theme => ({\n root: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n flexWrap: 'wrap',\n },\n filterControls: {\n display: 'flex',\n alignItems: 'center',\n },\n title: {\n fontWeight: theme.typography.fontWeightBold,\n fontSize: 18,\n whiteSpace: 'nowrap',\n },\n }),\n { name: 'BackstageTableFiltersContainer' },\n);\n\nexport type TableClassKey = 'root';\n\nconst useTableStyles = makeStyles(\n () => ({\n root: {\n display: 'flex',\n alignItems: 'start',\n },\n }),\n { name: 'BackstageTable' },\n);\n\nfunction convertColumns<T extends object>(\n columns: TableColumn<T>[],\n theme: Theme,\n): TableColumn<T>[] {\n return columns.map(column => {\n const headerStyle: CSSProperties = column.headerStyle ?? {};\n\n let cellStyle = column.cellStyle || {};\n\n if (column.highlight) {\n headerStyle.color = theme.palette.textContrast;\n\n if (typeof cellStyle === 'object') {\n (cellStyle as CSSProperties).fontWeight =\n theme.typography.fontWeightBold;\n } else {\n const cellStyleFn = cellStyle as (\n data: any,\n rowData: T,\n column?: Column<T>,\n ) => CSSProperties;\n cellStyle = (data, rowData, rowColumn) => {\n const style = cellStyleFn(data, rowData, rowColumn);\n return { ...style, fontWeight: theme.typography.fontWeightBold };\n };\n }\n }\n\n return {\n ...column,\n headerStyle,\n cellStyle,\n };\n });\n}\n\nfunction removeDefaultValues(state: any, defaultState: any): any {\n return transform(state, (result, value, key) => {\n if (!isEqual(value, defaultState[key])) {\n result[key] = value;\n }\n });\n}\n\nconst defaultInitialState = {\n search: '',\n filtersOpen: false,\n filters: {},\n};\n\nexport interface TableColumn<T extends object = {}> extends Column<T> {\n highlight?: boolean;\n width?: string;\n}\n\nexport type TableFilter = {\n column: string;\n type: 'select' | 'multiple-select';\n};\n\nexport type TableState = {\n search?: string;\n filtersOpen?: boolean;\n filters?: SelectedFilters;\n};\n\nexport interface TableProps<T extends object = {}>\n extends MaterialTableProps<T> {\n columns: TableColumn<T>[];\n subtitle?: string;\n filters?: TableFilter[];\n initialState?: TableState;\n emptyContent?: ReactNode;\n isLoading?: boolean;\n onStateChange?: (state: TableState) => any;\n}\n\nexport interface TableOptions<T extends object = {}> extends Options<T> {}\n\nexport function TableToolbar(toolbarProps: {\n toolbarRef: MutableRefObject<any>;\n setSearch: (value: string) => void;\n onSearchChanged: (value: string) => void;\n toggleFilters: () => void;\n hasFilters: boolean;\n selectedFiltersLength: number;\n}) {\n const {\n toolbarRef,\n setSearch,\n hasFilters,\n selectedFiltersLength,\n toggleFilters,\n } = toolbarProps;\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n const filtersClasses = useFilterStyles();\n const onSearchChanged = useCallback(\n (searchText: string) => {\n toolbarProps.onSearchChanged(searchText);\n setSearch(searchText);\n },\n [toolbarProps, setSearch],\n );\n\n if (hasFilters) {\n return (\n <Box className={filtersClasses.root}>\n <Box className={filtersClasses.filterControls}>\n <IconButton onClick={toggleFilters} aria-label=\"filter list\">\n <FilterList />\n </IconButton>\n <Typography className={filtersClasses.title}>\n {t('table.filter.title')} ({selectedFiltersLength})\n </Typography>\n </Box>\n <StyledMTableToolbar\n {...toolbarProps}\n ref={toolbarRef}\n onSearchChanged={onSearchChanged}\n />\n </Box>\n );\n }\n\n return (\n <StyledMTableToolbar\n {...toolbarProps}\n ref={toolbarRef}\n onSearchChanged={onSearchChanged}\n />\n );\n}\n\n/**\n * @public\n */\nexport function Table<T extends object = {}>(props: TableProps<T>) {\n const {\n data,\n columns,\n emptyContent,\n options,\n title,\n subtitle,\n localization,\n filters,\n initialState,\n onStateChange,\n components,\n isLoading: loading,\n style,\n ...restProps\n } = props;\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n const tableClasses = useTableStyles();\n\n const theme = useTheme();\n\n const calculatedInitialState = { ...defaultInitialState, ...initialState };\n\n const [filtersOpen, setFiltersOpen] = useState(\n calculatedInitialState.filtersOpen,\n );\n const toggleFilters = useCallback(\n () => setFiltersOpen(v => !v),\n [setFiltersOpen],\n );\n\n const [selectedFilters, setSelectedFilters] = useState(\n calculatedInitialState.filters,\n );\n\n const [search, setSearch] = useState(calculatedInitialState.search);\n\n useEffect(() => {\n if (onStateChange) {\n const state = removeDefaultValues(\n {\n search,\n filtersOpen,\n filters: selectedFilters,\n },\n defaultInitialState,\n );\n\n onStateChange(state);\n }\n }, [search, filtersOpen, selectedFilters, onStateChange]);\n\n const getFieldByTitle = useCallback(\n (titleValue: string | keyof T) =>\n columns.find(el => el.title === titleValue)?.field,\n [columns],\n );\n\n const tableData = useMemo(() => {\n if (typeof data === 'function' || !selectedFilters) {\n return data;\n }\n\n const selectedFiltersArray = Object.values(selectedFilters);\n if (data && selectedFiltersArray.flat().length) {\n const newData = (data as any[]).filter(\n el =>\n !!Object.entries(selectedFilters)\n .filter(([, value]) => !!(value as { length?: number }).length)\n .every(([key, filterValue]) => {\n const fieldValue = extractValueByField(\n el,\n getFieldByTitle(key) as string,\n );\n\n if (Array.isArray(fieldValue) && Array.isArray(filterValue)) {\n return fieldValue.some(v => filterValue.includes(v));\n } else if (Array.isArray(fieldValue)) {\n return fieldValue.includes(filterValue);\n } else if (Array.isArray(filterValue)) {\n return filterValue.includes(fieldValue);\n }\n\n return fieldValue === filterValue;\n }),\n );\n return newData;\n }\n return data;\n }, [data, selectedFilters, getFieldByTitle]);\n\n const selectedFiltersLength = Object.values(selectedFilters).flat().length;\n\n const hasFilters = !!filters?.length;\n const Toolbar = useCallback(\n (toolbarProps: any /* no type for this in material-table */) => {\n return (\n <TableToolbar\n setSearch={setSearch}\n hasFilters={hasFilters}\n selectedFiltersLength={selectedFiltersLength}\n toggleFilters={toggleFilters}\n {...toolbarProps}\n />\n );\n },\n [toggleFilters, hasFilters, selectedFiltersLength, setSearch],\n );\n\n const hasNoRows = typeof data !== 'function' && data.length === 0;\n const columnCount = columns.length;\n const Body = useMemo(\n () => makeBody({ hasNoRows, emptyContent, columnCount, loading }),\n [hasNoRows, emptyContent, columnCount, loading],\n );\n\n return (\n <Box className={tableClasses.root}>\n {filtersOpen && data && typeof data !== 'function' && filters?.length && (\n <Filters\n filters={constructFilters(filters, data as any[], columns, t)}\n selectedFilters={selectedFilters}\n onChangeFilters={setSelectedFilters}\n />\n )}\n <MTable<T>\n components={{\n Header: StyledMTableHeader,\n Body,\n Toolbar,\n ...components,\n }}\n options={options}\n columns={convertColumns(columns, theme)}\n icons={tableIcons}\n title={\n <>\n <Typography variant=\"h5\" component=\"h2\">\n {title}\n </Typography>\n {subtitle && (\n <Typography color=\"textSecondary\" variant=\"body1\">\n {subtitle}\n </Typography>\n )}\n </>\n }\n data={tableData}\n style={{ width: '100%', ...style }}\n localization={{\n ...localization,\n body: {\n emptyDataSourceMessage: t('table.body.emptyDataSourceMessage'),\n ...localization?.body,\n },\n pagination: {\n firstTooltip: t('table.pagination.firstTooltip'),\n labelDisplayedRows: t('table.pagination.labelDisplayedRows'),\n labelRowsSelect: t('table.pagination.labelRowsSelect'),\n lastTooltip: t('table.pagination.lastTooltip'),\n nextTooltip: t('table.pagination.nextTooltip'),\n previousTooltip: t('table.pagination.previousTooltip'),\n ...localization?.pagination,\n },\n header: {\n actions: t('table.header.actions'),\n ...localization?.header,\n },\n toolbar: {\n searchPlaceholder: t('table.toolbar.search'),\n searchTooltip: t('table.toolbar.search'),\n ...localization?.toolbar,\n },\n }}\n {...restProps}\n />\n </Box>\n );\n}\n\nTable.icons = Object.freeze(tableIcons);\n\nfunction makeBody({\n columnCount,\n emptyContent,\n hasNoRows,\n loading,\n}: {\n hasNoRows: boolean;\n emptyContent: ReactNode;\n columnCount: number;\n loading?: boolean;\n}) {\n return (bodyProps: any /* no type for this in material-table */) => {\n if (loading) {\n return <TableLoadingBody colSpan={columnCount} />;\n }\n\n if (emptyContent && hasNoRows) {\n return (\n <tbody>\n <tr>\n <td colSpan={columnCount}>{emptyContent}</td>\n </tr>\n </tbody>\n );\n }\n\n return <MTableBody {...bodyProps} />;\n };\n}\n\nfunction constructFilters<T extends object>(\n filterConfig: TableFilter[],\n dataValue: any[] | undefined,\n columns: TableColumn<T>[],\n t: TranslationFunction<typeof coreComponentsTranslationRef.T>,\n): Filter[] {\n const extractDistinctValues = (field: string | keyof T): Set<any> => {\n const distinctValues = new Set<any>();\n const addValue = (value: any) => {\n if (value !== undefined && value !== null) {\n distinctValues.add(value);\n }\n };\n\n if (dataValue) {\n dataValue.forEach(el => {\n const value = extractValueByField(\n el,\n columns.find(c => c.title === field)?.field as string,\n );\n\n if (Array.isArray(value)) {\n (value as []).forEach(addValue);\n } else {\n addValue(value);\n }\n });\n }\n\n return distinctValues;\n };\n\n const constructSelect = (\n filter: TableFilter,\n ): Without<SelectProps, 'onChange'> => {\n return {\n placeholder: t('table.filter.placeholder'),\n label: filter.column,\n multiple: filter.type === 'multiple-select',\n items: [...extractDistinctValues(filter.column)].sort().map(value => ({\n label: value,\n value,\n })),\n };\n };\n\n return filterConfig.map(filter => ({\n type: filter.type,\n element: constructSelect(filter),\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 Divider from '@material-ui/core/Divider';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Typography from '@material-ui/core/Typography';\nimport ArrowIcon from '@material-ui/icons/ArrowForward';\nimport { MouseEvent } from 'react';\nimport { Link } from '../../components/Link';\n\n/** @public */\nexport type BottomLinkClassKey = 'root' | 'boxTitle' | 'arrow';\n\nconst useStyles = makeStyles(\n theme => ({\n root: {\n maxWidth: 'fit-content',\n padding: theme.spacing(2, 2, 2, 2.5),\n },\n boxTitle: {\n margin: 0,\n color: theme.palette.textSubtle,\n },\n arrow: {\n color: theme.palette.textSubtle,\n },\n }),\n { name: 'BackstageBottomLink' },\n);\n\n/** @public */\nexport type BottomLinkProps = {\n link: string;\n title: string;\n onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;\n};\n\n/**\n * Footer with link used in {@link InfoCard } and {@link TabbedCard}\n *\n * @public\n *\n */\nexport function BottomLink(props: BottomLinkProps) {\n const { link, title, onClick } = props;\n const classes = useStyles();\n\n return (\n <Box>\n <Divider />\n <Link to={link} onClick={onClick} underline=\"none\">\n <Box display=\"flex\" alignItems=\"center\" className={classes.root}>\n <Box className={classes.boxTitle} fontWeight=\"fontWeightBold\" m={1}>\n <Typography>\n <strong>{title}</strong>\n </Typography>\n </Box>\n <ArrowIcon className={classes.arrow} />\n </Box>\n </Link>\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 */\n\nimport Typography from '@material-ui/core/Typography';\nimport { PropsWithChildren, ComponentClass, Component, ErrorInfo } from 'react';\nimport { LinkButton } from '../../components/LinkButton';\nimport { ErrorPanel } from '../../components/ErrorPanel';\nimport { coreComponentsTranslationRef } from '../../translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\ntype SlackChannel = {\n name: string;\n href?: string;\n};\n\n/** @public */\nexport type ErrorBoundaryProps = PropsWithChildren<{\n slackChannel?: string | SlackChannel;\n onError?: (error: Error, errorInfo: string) => null;\n}>;\n\ntype State = {\n error?: Error;\n errorInfo?: ErrorInfo;\n};\n\nconst SlackLink = (props: { slackChannel?: string | SlackChannel }) => {\n const { slackChannel } = props;\n const { t } = useTranslationRef(coreComponentsTranslationRef);\n\n if (!slackChannel) {\n return null;\n } else if (typeof slackChannel === 'string') {\n return (\n <Typography>{t('errorBoundary.title', { slackChannel })}</Typography>\n );\n } else if (!slackChannel.href) {\n return (\n <Typography>\n {t('errorBoundary.title', {\n slackChannel: slackChannel.name,\n })}\n </Typography>\n );\n }\n\n return (\n <LinkButton to={slackChannel.href} variant=\"contained\">\n {slackChannel.name}\n </LinkButton>\n );\n};\n\n/** @public */\nexport const ErrorBoundary: ComponentClass<\n ErrorBoundaryProps,\n State\n> = class ErrorBoundary extends Component<ErrorBoundaryProps, State> {\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = {\n error: undefined,\n errorInfo: undefined,\n };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n // eslint-disable-next-line no-console\n console.error(`ErrorBoundary, error: ${error}`, { error, errorInfo });\n this.setState({ error, errorInfo });\n }\n\n render() {\n const { slackChannel, children } = this.props;\n const { error } = this.state;\n\n if (!error) {\n return children;\n }\n\n return (\n <ErrorPanel title=\"Something Went Wrong\" error={error}>\n <SlackLink slackChannel={slackChannel} />\n </ErrorPanel>\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 Card from '@material-ui/core/Card';\nimport CardActions from '@material-ui/core/CardActions';\nimport CardContent from '@material-ui/core/CardContent';\nimport CardHeader, { CardHeaderProps } from '@material-ui/core/CardHeader';\nimport Divider from '@material-ui/core/Divider';\nimport { makeStyles, withStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\nimport { ReactNode } from 'react';\nimport { BottomLink, BottomLinkProps } from '../BottomLink';\nimport { ErrorBoundary, ErrorBoundaryProps } from '../ErrorBoundary';\n\n/** @public */\nexport type InfoCardClassKey =\n | 'noPadding'\n | 'header'\n | 'headerTitle'\n | 'headerSubheader'\n | 'headerAvatar'\n | 'headerAction'\n | 'headerContent';\n\nconst useStyles = makeStyles(\n theme => ({\n noPadding: {\n padding: 0,\n '&:last-child': {\n paddingBottom: 0,\n },\n },\n contentAlignBottom: {\n display: 'flex',\n alignItems: 'self-end',\n },\n header: {\n padding: theme.spacing(2, 2, 2, 2.5),\n },\n headerTitle: {\n fontWeight: theme.typography.fontWeightBold,\n },\n headerSubheader: {\n paddingTop: theme.spacing(1),\n },\n headerAvatar: {},\n headerAction: {},\n headerContent: {},\n subheader: {\n display: 'flex',\n },\n }),\n { name: 'BackstageInfoCard' },\n);\n\n/** @public */\nexport type CardActionsTopRightClassKey = 'root';\n\nconst CardActionsTopRight = withStyles(\n theme => ({\n root: {\n display: 'inline-block',\n padding: theme.spacing(8, 8, 0, 0),\n float: 'right',\n },\n }),\n { name: 'BackstageInfoCardCardActionsTopRight' },\n)(CardActions);\n\nconst VARIANT_STYLES = {\n card: {\n flex: {\n display: 'flex',\n flexDirection: 'column',\n },\n fullHeight: {\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n },\n gridItem: {\n display: 'flex',\n flexDirection: 'column',\n height: 'calc(100% - 10px)', // for pages without content header\n marginBottom: '10px',\n breakInside: 'avoid-page',\n '@media print': {\n height: 'auto',\n },\n },\n },\n cardContent: {\n fullHeight: {\n flex: 1,\n },\n gridItem: {\n flex: 1,\n },\n },\n};\n\n/** @public */\nexport type InfoCardVariants = 'flex' | 'fullHeight' | 'gridItem';\n\n/**\n * InfoCard is used to display a paper-styled block on the screen, similar to a panel.\n *\n * You can custom style an InfoCard with the 'className' (outer container) and 'cardClassName' (inner container)\n * props. This is typically used with the material-ui makeStyles mechanism.\n *\n * The InfoCard serves as an error boundary. As a result, if you provide an 'errorBoundaryProps' property this\n * specifies the extra information to display in the error component that is displayed if an error occurs\n * in any descendent components.\n *\n * By default the InfoCard has no custom layout of its children, but is treated as a block element. A\n * couple common variants are provided and can be specified via the variant property:\n *\n * When the InfoCard is displayed as a grid item within a grid, you may want items to have the same height for all items.\n * Set to the 'gridItem' variant to display the InfoCard with full height suitable for Grid:\n *\n * `<InfoCard variant=\"gridItem\">...</InfoCard>`\n */\nexport type Props = {\n title?: ReactNode;\n subheader?: ReactNode;\n divider?: boolean;\n deepLink?: BottomLinkProps;\n /** @deprecated Use errorBoundaryProps instead */\n slackChannel?: string;\n errorBoundaryProps?: ErrorBoundaryProps;\n variant?: InfoCardVariants;\n alignContent?: 'normal' | 'bottom';\n children?: ReactNode;\n headerStyle?: object;\n headerProps?: CardHeaderProps;\n icon?: ReactNode;\n action?: ReactNode;\n actionsClassName?: string;\n actions?: ReactNode;\n cardClassName?: string;\n actionsTopRight?: ReactNode;\n className?: string;\n noPadding?: boolean;\n titleTypographyProps?: object;\n subheaderTypographyProps?: object;\n};\n\n/**\n * Material-ui card with header , content and actions footer\n *\n * @public\n *\n */\nexport function InfoCard(props: Props): JSX.Element {\n const {\n title,\n subheader,\n divider = true,\n deepLink,\n slackChannel,\n errorBoundaryProps,\n variant,\n alignContent = 'normal',\n children,\n headerStyle,\n headerProps,\n icon,\n action,\n actionsClassName,\n actions,\n cardClassName,\n actionsTopRight,\n className,\n noPadding,\n titleTypographyProps,\n subheaderTypographyProps,\n } = props;\n const classes = useStyles();\n /**\n * If variant is specified, we build up styles for that particular variant for both\n * the Card and the CardContent (since these need to be synced)\n */\n let calculatedStyle = {};\n let calculatedCardStyle = {};\n if (variant) {\n const variants = variant.split(/[\\s]+/g);\n variants.forEach(name => {\n calculatedStyle = {\n ...calculatedStyle,\n ...VARIANT_STYLES.card[name as keyof (typeof VARIANT_STYLES)['card']],\n };\n calculatedCardStyle = {\n ...calculatedCardStyle,\n ...VARIANT_STYLES.cardContent[\n name as keyof (typeof VARIANT_STYLES)['cardContent']\n ],\n };\n });\n }\n\n const cardSubTitle = () => {\n if (!subheader && !icon) {\n return null;\n }\n\n return (\n <div data-testid=\"info-card-subheader\">\n {subheader && <div className={classes.subheader}>{subheader}</div>}\n {icon}\n </div>\n );\n };\n\n const errProps: ErrorBoundaryProps =\n errorBoundaryProps || (slackChannel ? { slackChannel } : {});\n\n return (\n <Card style={calculatedStyle} className={className}>\n <ErrorBoundary {...errProps}>\n {title && (\n <CardHeader\n classes={{\n root: classNames(classes.header),\n title: classes.headerTitle,\n subheader: classes.headerSubheader,\n avatar: classes.headerAvatar,\n action: classes.headerAction,\n content: classes.headerContent,\n }}\n title={title}\n subheader={cardSubTitle()}\n action={action}\n style={{ ...headerStyle }}\n titleTypographyProps={titleTypographyProps}\n subheaderTypographyProps={subheaderTypographyProps}\n {...headerProps}\n />\n )}\n {actionsTopRight && (\n <CardActionsTopRight>{actionsTopRight}</CardActionsTopRight>\n )}\n {divider && <Divider />}\n <CardContent\n className={classNames(cardClassName, {\n [classes.noPadding]: noPadding,\n [classes.contentAlignBottom]: alignContent === 'bottom',\n })}\n style={calculatedCardStyle}\n >\n {children}\n </CardContent>\n {actions && (\n <CardActions className={actionsClassName}>{actions}</CardActions>\n )}\n {deepLink && <BottomLink {...deepLink} />}\n </ErrorBoundary>\n </Card>\n );\n}\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 { CheckboxOwnProps } from './types';\nimport styles from './Checkbox.module.css';\n\n/**\n * Component definition for Checkbox\n * @public\n */\nexport const CheckboxDefinition = defineComponent<CheckboxOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Checkbox',\n indicator: 'bui-CheckboxIndicator',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-Checkbox\":\"hJtmqCNU8SMp97Lu\",\"bui-CheckboxIndicator\":\"AsCZ8LTTAs5lRnNR\"};","/*\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, useEffect } from 'react';\nimport { Checkbox as RACheckbox } from 'react-aria-components';\nimport type { CheckboxProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { CheckboxDefinition } from './definition';\nimport { RiCheckLine, RiSubtractLine } from '@remixicon/react';\n\n/**\n * A form checkbox input with support for indeterminate state and accessible labeling.\n *\n * @public\n */\nexport const Checkbox = forwardRef<HTMLLabelElement, CheckboxProps>(\n (props, ref) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n CheckboxDefinition,\n props,\n );\n const { classes, children } = ownProps;\n const ariaLabel = restProps['aria-label'];\n const ariaLabelledBy = restProps['aria-labelledby'];\n\n useEffect(() => {\n if (!children && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'Checkbox requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [children, ariaLabel, ariaLabelledBy]);\n\n return (\n <RACheckbox\n ref={ref}\n className={classes.root}\n {...dataAttributes}\n {...restProps}\n >\n {({ isIndeterminate }) => (\n <>\n <div className={classes.indicator} aria-hidden=\"true\">\n {isIndeterminate ? (\n <RiSubtractLine size={12} />\n ) : (\n <RiCheckLine size={12} />\n )}\n </div>\n {children != null && <div>{children}</div>}\n </>\n )}\n </RACheckbox>\n );\n },\n);\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-Select\":\"fl_o2cRttX8vIo5j\",\"bui-SelectPopover\":\"xRoZ59Ta50wTyFbP\",\"bui-SelectTrigger\":\"f6xSegNfnDAA591f\",\"bui-SelectTriggerChevron\":\"hey3g7_Ll4EtTJdE\",\"bui-SelectValue\":\"EOuke6Cxn9cos7ok\",\"bui-SelectItemIndicator\":\"LiF4f9w5zcb_V5q_\",\"bui-SelectList\":\"wCPzC0hbf30wVMOp\",\"bui-SelectItem\":\"Mn7kwp0_L8g4rWcf\",\"bui-SelectItemLabel\":\"sG8NrKzlnq4NyoHP\",\"bui-SelectItemContent\":\"dEYdQefcncAOEwHx\",\"bui-SelectItemLeadingIcon\":\"AKGYEGIB6gowSR1v\",\"bui-SelectItemAvatar\":\"yME5bCO7KXI8ytlf\",\"bui-SelectItemTextContent\":\"GxLJfL5leAuIEMf4\",\"bui-SelectItemTitle\":\"VpNS7MhLIRMk2oNQ\",\"bui-SelectItemDescription\":\"PIhKUXz6a8c4loYl\",\"bui-SelectSearchWrapper\":\"af0jN5t2MnkzSKwM\",\"bui-SelectContent\":\"PZwuqaalMCYxziS8\",\"bui-SelectResults\":\"XYK5W5M9fYWqIec2\",\"bui-SelectSearch\":\"MAcGzHfmHVw4bkcS\",\"bui-SelectSearchClear\":\"Qm0LMYJXqDozSs4J\",\"bui-SelectSection\":\"sPxu4s2LxhUkjdE5\",\"bui-SelectSectionHeader\":\"FuD_n78xDNQIkQ_A\",\"bui-SelectNoResults\":\"mai_FHtvkacjqFtg\",\"bui-SelectLoading\":\"J9z0FCamdHQrC3j_\",\"bui-SelectLoadingRow\":\"SbRLeO8aQQMTytTi\"};","/*\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 SelectOwnProps,\n SelectTriggerOwnProps,\n SelectContentOwnProps,\n SelectListBoxOwnProps,\n SelectListBoxItemOwnProps,\n SelectItemOwnProps,\n SelectItemProfileOwnProps,\n SelectItemTextOwnProps,\n SelectSectionOwnProps,\n} from './types';\nimport styles from './Select.module.css';\n\n/** @public */\nexport const SelectDefinition = defineComponent<SelectOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Select',\n popover: 'bui-SelectPopover',\n },\n propDefs: {\n icon: {},\n size: { dataAttribute: true, default: 'small' },\n options: {},\n items: {},\n children: {},\n dependencies: {},\n search: {},\n loading: {},\n searchable: {},\n searchPlaceholder: {},\n label: {},\n secondaryLabel: {},\n description: {},\n isRequired: {},\n className: {},\n },\n});\n\n/** @public */\nexport const SelectTriggerDefinition = defineComponent<SelectTriggerOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectTrigger',\n chevron: 'bui-SelectTriggerChevron',\n value: 'bui-SelectValue',\n },\n bg: 'consumer',\n propDefs: {\n icon: {},\n },\n },\n);\n\n/** @public */\nexport const SelectContentDefinition = defineComponent<SelectContentOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectContent',\n searchWrapper: 'bui-SelectSearchWrapper',\n results: 'bui-SelectResults',\n search: 'bui-SelectSearch',\n searchClear: 'bui-SelectSearchClear',\n },\n propDefs: {\n search: {},\n options: {},\n items: {},\n children: {},\n dependencies: {},\n loading: {},\n isStale: {},\n visibleIds: {},\n retainedOptions: {},\n },\n },\n);\n\n/** @public */\nexport const SelectListBoxDefinition = defineComponent<SelectListBoxOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectList',\n noResults: 'bui-SelectNoResults',\n loading: 'bui-SelectLoading',\n loadingRow: 'bui-SelectLoadingRow',\n },\n propDefs: {\n options: {},\n items: {},\n children: {},\n dependencies: {},\n loading: {},\n isStale: {},\n retainedOptions: {},\n },\n },\n);\n\n/** @public */\nexport const SelectListBoxItemDefinition =\n defineComponent<SelectListBoxItemOwnProps>()({\n styles,\n classNames: {\n label: 'bui-SelectItemLabel',\n },\n propDefs: {},\n });\n\n/** @public */\nexport const SelectItemDefinition = defineComponent<SelectItemOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SelectItem',\n indicator: 'bui-SelectItemIndicator',\n content: 'bui-SelectItemContent',\n },\n navigation: { type: 'anchor' },\n propDefs: {\n children: {},\n showSelectionIndicator: {},\n className: {},\n },\n});\n\n/** @public */\nexport const SelectItemTextDefinition =\n defineComponent<SelectItemTextOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SelectItemText',\n content: 'bui-SelectItemContent',\n leadingIcon: 'bui-SelectItemLeadingIcon',\n text: 'bui-SelectItemTextContent',\n title: 'bui-SelectItemTitle',\n description: 'bui-SelectItemDescription',\n },\n propDefs: {\n title: {},\n description: {},\n leadingIcon: {},\n className: {},\n },\n });\n\n/** @public */\nexport const SelectItemProfileDefinition =\n defineComponent<SelectItemProfileOwnProps>()({\n styles,\n classNames: {\n root: 'bui-SelectItemProfile',\n content: 'bui-SelectItemContent',\n avatar: 'bui-SelectItemAvatar',\n name: 'bui-SelectItemTitle',\n },\n propDefs: {\n name: {},\n src: {},\n className: {},\n },\n });\n\n/** @public */\nexport const SelectSectionDefinition = defineComponent<SelectSectionOwnProps>()(\n {\n styles,\n classNames: {\n root: 'bui-SelectSection',\n header: 'bui-SelectSectionHeader',\n },\n propDefs: {},\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 { FieldLabelOwnProps } from './types';\nimport styles from './FieldLabel.module.css';\n\n/**\n * Component definition for FieldLabel\n * @public\n */\nexport const FieldLabelDefinition = defineComponent<FieldLabelOwnProps>()({\n styles,\n classNames: {\n root: 'bui-FieldLabelWrapper',\n label: 'bui-FieldLabel',\n secondaryLabel: 'bui-FieldSecondaryLabel',\n description: 'bui-FieldDescription',\n },\n propDefs: {\n label: {},\n secondaryLabel: {},\n description: {},\n htmlFor: {},\n id: {},\n descriptionId: {},\n descriptionSlot: {},\n className: {},\n },\n});\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-FieldLabelWrapper\":\"QCxpyIls6to9Bn5w\",\"bui-FieldLabel\":\"qjnrgCeKosN0HGNG\",\"bui-FieldSecondaryLabel\":\"VAD8KU3Enrs4kH_k\",\"bui-FieldDescription\":\"KsFBKeDCTE86ZANx\"};","/*\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 { Label, Text } from 'react-aria-components';\nimport { forwardRef } from 'react';\nimport type { FieldLabelProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { FieldLabelDefinition } from './definition';\n\n/**\n * Renders a label for a form field with optional secondary label and description text.\n *\n * @public\n */\nexport const FieldLabel = forwardRef<HTMLDivElement, FieldLabelProps>(\n (props: FieldLabelProps, ref) => {\n const { ownProps, restProps } = useDefinition(FieldLabelDefinition, props);\n const {\n classes,\n label,\n secondaryLabel,\n description,\n htmlFor,\n id,\n descriptionId,\n descriptionSlot,\n } = ownProps;\n\n if (!label) return null;\n\n return (\n <div className={classes.root} {...restProps} ref={ref}>\n {label && (\n <Label className={classes.label} htmlFor={htmlFor} id={id}>\n {label}\n {secondaryLabel && (\n <span aria-hidden=\"true\" className={classes.secondaryLabel}>\n ({secondaryLabel})\n </span>\n )}\n </Label>\n )}\n {description && (\n <Text\n slot={descriptionSlot}\n className={classes.description}\n elementType=\"div\"\n id={descriptionId}\n >\n {description}\n </Text>\n )}\n </div>\n );\n },\n);\n\nFieldLabel.displayName = 'FieldLabel';\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 { FieldErrorOwnProps } from './types';\nimport styles from './FieldError.module.css';\n\n/**\n * Component definition for FieldError\n * @public\n */\nexport const FieldErrorDefinition = defineComponent<FieldErrorOwnProps>()({\n styles,\n classNames: {\n root: 'bui-FieldError',\n },\n propDefs: {\n className: {},\n },\n});\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-FieldError\":\"Ai9iNkHuNwQ8kqsz\"};","/*\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 } from 'react';\nimport { FieldError as AriaFieldError } from 'react-aria-components';\nimport type { FieldErrorProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { FieldErrorDefinition } from './definition';\n\n/**\n * Displays a validation error message associated with a form field.\n *\n * @public\n */\nexport const FieldError = forwardRef<HTMLDivElement, FieldErrorProps>(\n (props: FieldErrorProps, ref) => {\n const { ownProps, restProps } = useDefinition(FieldErrorDefinition, props);\n const { classes } = ownProps;\n\n return <AriaFieldError className={classes.root} ref={ref} {...restProps} />;\n },\n);\n\nFieldError.displayName = 'FieldError';\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 { PopoverOwnProps } from './types';\nimport styles from './Popover.module.css';\n\n/**\n * Component definition for Popover\n * @public\n */\nexport const PopoverDefinition = defineComponent<PopoverOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Popover',\n arrow: 'bui-PopoverArrow',\n content: 'bui-PopoverContent',\n },\n propDefs: {\n children: {},\n hideArrow: {},\n className: {},\n },\n});\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-Popover\":\"c6K43dAXzUIQYTPO\",\"bui-PopoverArrow\":\"nWNOVN9SSAkDCJc4\",\"bui-PopoverContent\":\"ndXnur8atSwrX9tW\"};","/*\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 } from 'react';\nimport { useId } from 'react-aria';\nimport { OverlayArrow, Popover as AriaPopover } from 'react-aria-components';\nimport { PopoverProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { PopoverDefinition } from './definition';\nimport { Box } from '../Box';\nimport { BgReset } from '../../hooks/useBg';\n\n/**\n * A popover component built on React Aria Components that displays floating\n * content anchored to a trigger element.\n *\n * @remarks\n * The Popover component supports multiple placements (top, right, bottom, left),\n * automatic viewport-constrained scrolling, and conditional arrow rendering. It\n * automatically handles positioning, collision detection, and ARIA attributes for\n * accessibility. Content is automatically padded and scrollable when it exceeds\n * available space.\n *\n * @example\n * Basic usage with DialogTrigger:\n * ```tsx\n * <DialogTrigger>\n * <Button>Open Popover</Button>\n * <Popover>\n * <Text>Popover content</Text>\n * </Popover>\n * </DialogTrigger>\n * ```\n *\n * @example\n * With custom placement and no arrow:\n * ```tsx\n * <DialogTrigger>\n * <Button>Open</Button>\n * <Popover placement=\"right\" hideArrow>\n * <Text>Content without arrow</Text>\n * </Popover>\n * </DialogTrigger>\n * ```\n *\n * @public\n */\nexport const Popover = forwardRef<HTMLDivElement, PopoverProps>(\n (props, ref) => {\n const { ownProps, restProps } = useDefinition(PopoverDefinition, props);\n const { classes, children, hideArrow } = ownProps;\n const svgPathId = useId();\n\n return (\n <AriaPopover className={classes.root} {...restProps} ref={ref}>\n {({ trigger }) => (\n <>\n {!hideArrow &&\n trigger !== 'MenuTrigger' &&\n trigger !== 'SubmenuTrigger' && (\n <OverlayArrow className={classes.arrow}>\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\n <defs>\n <path\n id={svgPathId}\n fillRule=\"evenodd\"\n d=\"M10.3356 7.39793L15.1924 3.02682C15.9269 2.36577 16.8801 2 17.8683 2H20V7.94781e-07L1.74846e-07 -9.53674e-07L0 2L1.4651 2C2.4532 2 3.4064 2.36577 4.1409 3.02682L8.9977 7.39793C9.378 7.7402 9.9553 7.74021 10.3356 7.39793Z M11.0046 8.14124C10.2439 8.82575 9.08939 8.82578 8.32869 8.14122L3.47189 3.77011C2.92109 3.27432 2.20619 2.99999 1.46509 2.99999L4.10999 3L8.99769 7.39793C9.37799 7.7402 9.95529 7.7402 10.3356 7.39793L15.2226 3L17.8683 2.99999C17.1271 2.99999 16.4122 3.27432 15.8614 3.77011L11.0046 8.14124Z\"\n />\n </defs>\n\n <use href={`#${svgPathId}`} />\n <use href={`#${svgPathId}`} />\n\n <path d=\"M11.0046 8.14124C10.2439 8.82575 9.08939 8.82578 8.32869 8.14122L3.47189 3.77011C2.92109 3.27432 2.20619 2.99999 1.46509 2.99999L4.10999 3L8.99769 7.39793C9.37799 7.7402 9.95529 7.7402 10.3356 7.39793L15.2226 3L17.8683 2.99999C17.1271 2.99999 16.4122 3.27432 15.8614 3.77011L11.0046 8.14124Z\" />\n </svg>\n </OverlayArrow>\n )}\n <BgReset>\n <Box bg=\"neutral\" className={classes.content}>\n {children}\n </Box>\n </BgReset>\n </>\n )}\n </AriaPopover>\n );\n },\n);\n\nPopover.displayName = 'Popover';\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 { ReactNode } from 'react';\nimport { Button, SelectValue } from 'react-aria-components';\nimport { RiArrowDownSLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SelectTriggerDefinition } from './definition';\n\ninterface SelectTriggerProps {\n icon?: ReactNode;\n}\n\nexport function SelectTrigger(props: SelectTriggerProps) {\n const { ownProps, dataAttributes } = useDefinition(\n SelectTriggerDefinition,\n props,\n );\n const { classes, icon } = ownProps;\n\n return (\n <Button className={classes.root} {...dataAttributes}>\n {icon}\n <SelectValue className={classes.value}>\n {({ isPlaceholder, selectedText, defaultChildren }) =>\n isPlaceholder ? defaultChildren : selectedText\n }\n </SelectValue>\n <div className={classes.chevron}>\n <RiArrowDownSLine aria-hidden=\"true\" />\n </div>\n </Button>\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 type {\n AsyncListSource,\n CollectionItem,\n IdentifiedOption,\n NormalizedOption,\n NormalizedOptionSection,\n Option,\n OptionSection,\n} from '../types/selectableCollection';\nimport type { Key, Selection } from 'react-aria-components';\n\n/** @internal */\nexport function normalizeOption(option: Option): NormalizedOption {\n if (option.id !== undefined) {\n return option;\n }\n\n return {\n id: option.value,\n label: option.label,\n disabled: option.disabled,\n };\n}\n\n/** @internal */\nexport function normalizeOptions(\n options: ReadonlyArray<Option | OptionSection>,\n): Array<NormalizedOption | NormalizedOptionSection> {\n return options.map(option => {\n if ('options' in option) {\n return {\n title: option.title,\n options: option.options.map(normalizeOption),\n };\n }\n\n return normalizeOption(option);\n });\n}\n\n/** @internal */\nexport function isAsyncListSource<T>(\n source: Iterable<T> | AsyncListSource<T>,\n): source is AsyncListSource<T> {\n return (\n typeof source === 'object' &&\n source !== null &&\n 'items' in source &&\n 'filterText' in source &&\n 'setFilterText' in source &&\n 'loadingState' in source &&\n 'loadMore' in source\n );\n}\n\n/** @internal */\nexport function flattenOptions(\n options: ReadonlyArray<NormalizedOption | NormalizedOptionSection>,\n): NormalizedOption[] {\n return options.flatMap(option => {\n if ('options' in option) {\n return option.options;\n }\n\n return option;\n });\n}\n\n/** @internal */\nexport function getItemKeys(items: Iterable<CollectionItem>) {\n return new Set(Array.from(items, item => item.id));\n}\n\n/** @internal */\nexport function resolveCollectionSource<T extends CollectionItem>({\n options,\n items,\n}: {\n options?:\n | ReadonlyArray<Option | OptionSection>\n | AsyncListSource<IdentifiedOption>;\n items?: Iterable<T> | AsyncListSource<T>;\n}) {\n const plainOptions = Array.isArray(options) ? options : undefined;\n const normalizedOptions = plainOptions\n ? normalizeOptions(plainOptions)\n : undefined;\n const flatOptions = normalizedOptions\n ? flattenOptions(normalizedOptions)\n : undefined;\n const asyncOptions = options && !Array.isArray(options) ? options : undefined;\n\n if (items !== undefined) {\n return {\n options: plainOptions,\n flatOptions,\n source: items,\n rendersItems: true,\n };\n }\n\n if (asyncOptions !== undefined) {\n return {\n options: plainOptions,\n flatOptions,\n source: asyncOptions as unknown as AsyncListSource<T>,\n rendersItems: true,\n };\n }\n\n return {\n options: plainOptions,\n flatOptions,\n source: (flatOptions as T[] | undefined) ?? [],\n rendersItems: false,\n };\n}\n\n/** @internal */\nexport function toSelection(\n value: Key | ReadonlyArray<Key> | null | undefined,\n): Selection {\n if (value == null) {\n return new Set();\n }\n\n return new Set(Array.isArray(value) ? value : [value]);\n}\n\n/** @internal */\nexport function filterOptionSections(\n options: ReadonlyArray<NormalizedOption | NormalizedOptionSection>,\n query: string,\n filter: (option: NormalizedOption, query: string) => boolean,\n): Array<NormalizedOption | NormalizedOptionSection> {\n return options.flatMap(option => {\n if (!('options' in option)) {\n return filter(option, query) ? option : [];\n }\n\n const filteredOptions = option.options.filter(item => filter(item, query));\n if (filteredOptions.length === 0) {\n return [];\n }\n\n return { title: option.title, options: filteredOptions };\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 { RiCheckLine } from '@remixicon/react';\nimport { ListBoxItem, Text } from 'react-aria-components';\nimport { Avatar } from '../Avatar';\nimport {\n useDefinition,\n type UseDefinitionResult,\n} from '../../hooks/useDefinition';\nimport {\n SelectItemDefinition,\n SelectItemProfileDefinition,\n SelectItemTextDefinition,\n} from './definition';\nimport type {\n SelectItemProfileProps,\n SelectItemProps,\n SelectItemTextProps,\n} from './types';\nimport {\n getReactAriaAnchorProps,\n type AnchorNavigation,\n} from '../../navigation/useNavigation';\n\ntype SelectItemViewProps = {\n definitionResult: UseDefinitionResult<\n typeof SelectItemDefinition,\n SelectItemProps\n >;\n navigation: AnchorNavigation;\n};\n\nfunction SelectItemView({ definitionResult, navigation }: SelectItemViewProps) {\n const { ownProps, restProps } = definitionResult;\n const { classes, children, showSelectionIndicator } = ownProps;\n const navigationProps = getReactAriaAnchorProps(navigation, restProps);\n\n return (\n <ListBoxItem className={classes.root} {...restProps} {...navigationProps}>\n {values => {\n const content =\n typeof children === 'function' ? children(values) : children;\n\n if (!showSelectionIndicator) {\n return content;\n }\n\n return (\n <>\n <div className={classes.indicator}>\n <RiCheckLine aria-hidden=\"true\" />\n </div>\n <div className={classes.content}>{content}</div>\n </>\n );\n }}\n </ListBoxItem>\n );\n}\n\n/**\n * A low-level Select item wrapper for custom item content.\n *\n * @public\n */\nexport function SelectItem<T extends object = object>(\n props: SelectItemProps<T>,\n) {\n const definitionResult = useDefinition(SelectItemDefinition, props);\n const Navigation = definitionResult.navigation;\n\n return (\n <Navigation\n props={definitionResult.restProps}\n view={SelectItemView}\n viewProps={{ definitionResult }}\n />\n );\n}\n\n/**\n * A Select item preset with a title and optional supporting content.\n *\n * @public\n */\nexport function SelectItemText<T extends object = object>(\n props: SelectItemTextProps<T>,\n) {\n const { ownProps, restProps } = useDefinition(\n SelectItemTextDefinition,\n props,\n );\n const { classes, title, description, leadingIcon } = ownProps;\n\n return (\n <SelectItem\n className={classes.root}\n textValue={title}\n showSelectionIndicator\n {...restProps}\n >\n <div className={classes.content}>\n {leadingIcon && (\n <div className={classes.leadingIcon}>{leadingIcon}</div>\n )}\n <div className={classes.text}>\n <Text slot=\"label\" className={classes.title}>\n {title}\n </Text>\n {description && (\n <Text slot=\"description\" className={classes.description}>\n {description}\n </Text>\n )}\n </div>\n </div>\n </SelectItem>\n );\n}\n\n/**\n * A Select item preset for a person or other named profile.\n *\n * @public\n */\nexport function SelectItemProfile<T extends object = object>(\n props: SelectItemProfileProps<T>,\n) {\n const { ownProps, restProps } = useDefinition(\n SelectItemProfileDefinition,\n props,\n );\n const { classes, name, src } = ownProps;\n\n return (\n <SelectItem\n className={classes.root}\n textValue={name}\n showSelectionIndicator\n {...restProps}\n >\n <div className={classes.content}>\n <div className={classes.avatar}>\n <Avatar\n src={src ?? ''}\n name={name}\n size=\"x-small\"\n purpose=\"decoration\"\n />\n </div>\n <Text slot=\"label\" className={classes.name}>\n {name}\n </Text>\n </div>\n </SelectItem>\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 { useEffect, useState } from 'react';\n\n/** @internal */\nexport function useDelayedVisibility(isVisible: boolean, delayMs: number) {\n const [isDelayedVisible, setIsDelayedVisible] = useState(false);\n\n useEffect(() => {\n if (!isVisible) {\n setIsDelayedVisible(false);\n return undefined;\n }\n\n const timer = setTimeout(() => setIsDelayedVisible(true), delayMs);\n return () => clearTimeout(timer);\n }, [delayMs, isVisible]);\n\n return isVisible && isDelayedVisible;\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 {\n Collection,\n Header,\n ListBox,\n ListBoxLoadMoreItem,\n ListBoxSection,\n Text,\n} from 'react-aria-components';\nimport clsx from 'clsx';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport {\n SelectItemTextDefinition,\n SelectListBoxDefinition,\n SelectListBoxItemDefinition,\n SelectSectionDefinition,\n} from './definition';\nimport { normalizeOptions } from '../../utils/selectableCollection';\nimport type {\n CollectionItem,\n LoadingConfig,\n NormalizedOption,\n NormalizedOptionSection,\n} from '../../types/selectableCollection';\nimport type { SelectListBoxOwnProps } from './types';\nimport { SelectItem } from './SelectItem';\nimport { Skeleton } from '../Skeleton';\nimport { useDelayedVisibility } from '../../hooks/useDelayedVisibility';\n\nconst loadingRowWidths = ['70%', '55%', '65%'];\nconst loadingIndicatorDelayMs = 300;\n\nfunction LoadingRows({\n count,\n className,\n rowClassName,\n}: {\n count: number;\n className: string;\n rowClassName: string;\n}) {\n return (\n <div className={className} aria-hidden=\"true\">\n {loadingRowWidths.slice(0, count).map(width => (\n <div key={width} className={rowClassName}>\n <Skeleton width={width} height=\"0.75rem\" />\n </div>\n ))}\n </div>\n );\n}\n\nconst NoResults = () => {\n const { ownProps } = useDefinition(SelectListBoxDefinition, {});\n const { classes } = ownProps;\n\n return <div className={classes.noResults}>No results found.</div>;\n};\n\nfunction PlainOptionItem({ option }: { option: NormalizedOption }) {\n const { ownProps } = useDefinition(SelectItemTextDefinition, {\n title: option.label,\n description: option.description,\n leadingIcon: option.leadingIcon,\n });\n const { classes } = ownProps;\n // Keep the original plain-option label class available for existing themes.\n const {\n ownProps: { classes: legacyOptionClasses },\n } = useDefinition(SelectListBoxItemDefinition, {});\n\n return (\n <SelectItem\n id={option.id}\n value={option}\n className={classes.root}\n textValue={option.label}\n isDisabled={option.disabled}\n showSelectionIndicator\n >\n <div className={classes.content}>\n {option.leadingIcon && (\n <div className={classes.leadingIcon}>{option.leadingIcon}</div>\n )}\n <div className={classes.text}>\n <Text\n slot=\"label\"\n className={clsx(classes.title, legacyOptionClasses.label)}\n >\n {option.label}\n </Text>\n {option.description && (\n <Text slot=\"description\" className={classes.description}>\n {option.description}\n </Text>\n )}\n </div>\n </div>\n </SelectItem>\n );\n}\n\nfunction SelectSectionItems({ section }: { section: NormalizedOptionSection }) {\n const { ownProps } = useDefinition(SelectSectionDefinition, {});\n const { classes } = ownProps;\n\n return (\n <ListBoxSection className={classes.root}>\n <Header className={classes.header}>{section.title}</Header>\n {section.options.map(option => (\n <PlainOptionItem key={option.id} option={option} />\n ))}\n </ListBoxSection>\n );\n}\n\nfunction renderSelectOption(item: NormalizedOption | NormalizedOptionSection) {\n if ('options' in item) {\n return <SelectSectionItems key={item.title} section={item} />;\n }\n\n return <PlainOptionItem key={item.id} option={item} />;\n}\n\nfunction SelectCollection<T extends CollectionItem>({\n normalizedOptions,\n retainedOptions,\n items,\n children,\n dependencies,\n}: {\n normalizedOptions?: Array<NormalizedOption | NormalizedOptionSection>;\n retainedOptions?: ReadonlyArray<NormalizedOption>;\n items?: Iterable<T>;\n children?: React.ReactNode | ((item: T) => React.ReactElement);\n dependencies?: ReadonlyArray<unknown>;\n}) {\n if (normalizedOptions) {\n return (\n <>\n {normalizedOptions.map(renderSelectOption)}\n {Array.from(retainedOptions ?? [], option => (\n <PlainOptionItem key={option.id} option={option} />\n ))}\n </>\n );\n }\n\n if (items) {\n const renderItem = (item: T) => {\n if (typeof children === 'function') {\n return children(item);\n }\n\n return <PlainOptionItem option={item as unknown as NormalizedOption} />;\n };\n\n return (\n <Collection items={items} dependencies={dependencies}>\n {renderItem}\n </Collection>\n );\n }\n\n return children as React.ReactNode;\n}\n\nfunction SelectEmptyState({\n isLoading,\n className,\n rowClassName,\n}: {\n isLoading: boolean;\n className: string;\n rowClassName: string;\n}) {\n if (!isLoading) {\n return <NoResults />;\n }\n\n return (\n <LoadingRows count={3} className={className} rowClassName={rowClassName} />\n );\n}\n\nfunction SelectLoadMoreIndicator({\n loading,\n isCollectionLoading,\n isIndicatorVisible,\n className,\n rowClassName,\n}: {\n loading?: LoadingConfig;\n isCollectionLoading: boolean;\n isIndicatorVisible: boolean;\n className: string;\n rowClassName: string;\n}) {\n if (!loading?.onLoadMore || isCollectionLoading) {\n return null;\n }\n\n const onLoadMore =\n loading.state === 'loadingMore' ? undefined : loading.onLoadMore;\n\n return (\n <ListBoxLoadMoreItem\n isLoading={isIndicatorVisible}\n onLoadMore={onLoadMore}\n scrollOffset={0}\n >\n <LoadingRows\n count={1}\n className={className}\n rowClassName={rowClassName}\n />\n </ListBoxLoadMoreItem>\n );\n}\n\nexport function SelectListBox<T extends CollectionItem = NormalizedOption>(\n props: SelectListBoxOwnProps<T>,\n) {\n const { ownProps } = useDefinition(SelectListBoxDefinition, props);\n const {\n classes,\n options,\n items,\n children,\n dependencies,\n loading,\n isStale,\n retainedOptions,\n } = ownProps;\n const normalizedOptions = options && normalizeOptions(options);\n const isCollectionLoading =\n loading?.state === 'loading' ||\n loading?.state === 'filtering' ||\n loading?.state === 'sorting';\n const isBusy = isCollectionLoading || loading?.state === 'loadingMore';\n const showStale = useDelayedVisibility(\n isStale ?? false,\n loadingIndicatorDelayMs,\n );\n const showLoadMoreIndicator = useDelayedVisibility(\n loading?.state === 'loadingMore',\n loadingIndicatorDelayMs,\n );\n\n const listBox = (\n <ListBox\n className={classes.root}\n data-stale={showStale || undefined}\n renderEmptyState={() => (\n <SelectEmptyState\n isLoading={isCollectionLoading}\n className={classes.loading}\n rowClassName={classes.loadingRow}\n />\n )}\n >\n <SelectCollection\n normalizedOptions={normalizedOptions}\n retainedOptions={retainedOptions}\n items={items}\n dependencies={dependencies}\n >\n {children}\n </SelectCollection>\n <SelectLoadMoreIndicator\n loading={loading}\n isCollectionLoading={isCollectionLoading}\n isIndicatorVisible={showLoadMoreIndicator}\n className={classes.loading}\n rowClassName={classes.loadingRow}\n />\n </ListBox>\n );\n\n return <div aria-busy={isBusy || undefined}>{listBox}</div>;\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 {\n Input,\n SearchField,\n Autocomplete,\n Button,\n type Key,\n} from 'react-aria-components';\nimport { useFilter } from 'react-aria';\nimport { RiCloseCircleLine } from '@remixicon/react';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SelectContentDefinition } from './definition';\nimport { SelectListBox } from './SelectListBox';\nimport type {\n CollectionItem,\n NormalizedOption,\n} from '../../types/selectableCollection';\nimport type { SelectContentOwnProps } from './types';\nimport type { Node } from '@react-types/shared';\n\ntype SearchFilter<T extends CollectionItem> = (\n textValue: string,\n inputValue: string,\n node: Node<T>,\n) => boolean;\n\nfunction getSearchFilter<T extends CollectionItem>({\n visibleIds,\n filter,\n contains,\n}: {\n visibleIds?: Set<Key>;\n filter?: (item: T, query: string) => boolean;\n contains: (textValue: string, inputValue: string) => boolean;\n}): SearchFilter<T> {\n if (visibleIds) {\n return (_textValue, _inputValue, node) => visibleIds.has(node.key);\n }\n\n if (filter) {\n return (_textValue, inputValue, node) =>\n filter(node.value as T, inputValue);\n }\n\n return (textValue, inputValue) => contains(textValue, inputValue);\n}\n\nexport function SelectContent<T extends CollectionItem = NormalizedOption>(\n props: SelectContentOwnProps<T>,\n) {\n const { contains } = useFilter({ sensitivity: 'base' });\n const { ownProps } = useDefinition(SelectContentDefinition, props);\n const {\n classes,\n search,\n options,\n items,\n children,\n dependencies,\n loading,\n isStale,\n visibleIds,\n retainedOptions,\n } = ownProps;\n\n const listBox = (\n <div className={classes.results}>\n <SelectListBox\n options={options}\n items={items}\n dependencies={dependencies}\n loading={loading}\n isStale={isStale}\n retainedOptions={retainedOptions}\n >\n {children}\n </SelectListBox>\n </div>\n );\n\n if (!search) {\n return <div className={classes.root}>{listBox}</div>;\n }\n\n const searchProps = typeof search === 'object' ? search : undefined;\n const placeholder = searchProps?.placeholder ?? 'Search...';\n const filter = getSearchFilter({\n visibleIds,\n filter: searchProps?.filter,\n contains,\n });\n\n return (\n <Autocomplete\n inputValue={searchProps?.inputValue}\n defaultInputValue={searchProps?.defaultInputValue}\n onInputChange={searchProps?.onInputChange}\n filter={filter}\n >\n <div className={classes.root}>\n <SearchField\n autoFocus\n className={classes.searchWrapper}\n aria-label={placeholder}\n >\n <Input placeholder={placeholder} className={classes.search} />\n <Button className={classes.searchClear}>\n <RiCloseCircleLine />\n </Button>\n </SearchField>\n {listBox}\n </div>\n </Autocomplete>\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, useEffect } from 'react';\nimport { Select as AriaSelect } from 'react-aria-components';\nimport type {\n CollectionItem,\n NormalizedOption,\n} from '../../types/selectableCollection';\nimport type { Key } from 'react-aria-components';\nimport type { ChangeValueType } from 'react-stately/useSelectState';\nimport type { SelectContentOwnProps, SelectProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SelectDefinition } from './definition';\nimport { FieldLabel } from '../FieldLabel';\nimport { FieldError } from '../FieldError';\nimport { Popover } from '../Popover';\nimport { SelectTrigger } from './SelectTrigger';\nimport { SelectContent } from './SelectContent';\nimport {\n useCollectionAdapter,\n type CollectionAdapterResult,\n} from '../../hooks/useCollectionAdapter';\nimport { useTrackedSelectionKeys } from '../../hooks/useTrackedSelectionKeys';\nimport {\n getItemKeys,\n resolveCollectionSource,\n toSelection,\n} from '../../utils/selectableCollection';\n\nfunction resolveSelectSearch<T extends CollectionItem>({\n search,\n searchable,\n searchPlaceholder,\n}: {\n search?: SelectContentOwnProps<T>['search'];\n searchable?: boolean;\n searchPlaceholder?: string;\n}): SelectContentOwnProps<T>['search'] {\n if (search !== undefined) {\n return search;\n }\n\n if (searchable) {\n return { placeholder: searchPlaceholder };\n }\n\n return undefined;\n}\n\nfunction resolveContentSearch<T extends CollectionItem>(\n search: SelectContentOwnProps<T>['search'],\n collection: CollectionAdapterResult<T>,\n): SelectContentOwnProps<T>['search'] {\n if (typeof search !== 'object') {\n return search;\n }\n\n return {\n ...search,\n inputValue: collection.inputValue,\n defaultInputValue: collection.defaultInputValue,\n onInputChange: collection.onInputChange,\n } as SelectContentOwnProps<T>['search'];\n}\n\nfunction getRetainedOptions<T extends CollectionItem>(\n flatOptions: NormalizedOption[] | undefined,\n canonicalItems: T[],\n) {\n if (!flatOptions) {\n return undefined;\n }\n\n const sourceIds = getItemKeys(flatOptions);\n return canonicalItems.filter(item => !sourceIds.has(item.id));\n}\n\n/**\n * A dropdown picker for selecting one or multiple options from a list, with optional search filtering and inline error display.\n *\n * @public\n */\nfunction SelectImpl<\n M extends 'single' | 'multiple' = 'single' | 'multiple',\n T extends CollectionItem = NormalizedOption,\n>(props: SelectProps<M, T>, ref: React.ForwardedRef<HTMLDivElement>) {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n SelectDefinition,\n {\n placeholder: 'Select an option',\n ...props,\n },\n );\n\n const {\n classes,\n label,\n description,\n options,\n icon,\n searchable,\n searchPlaceholder,\n search,\n loading,\n items,\n children,\n dependencies,\n isRequired,\n secondaryLabel,\n } = ownProps;\n\n const ariaLabel = restProps['aria-label'];\n const ariaLabelledBy = restProps['aria-labelledby'];\n\n useEffect(() => {\n if (!label && !ariaLabel && !ariaLabelledBy) {\n console.warn(\n 'Select requires either a visible label, aria-label, or aria-labelledby for accessibility',\n );\n }\n }, [label, ariaLabel, ariaLabelledBy]);\n\n const secondaryLabelText = secondaryLabel || (isRequired ? 'Required' : null);\n const resolvedSearch = resolveSelectSearch<T>({\n search: search as SelectContentOwnProps<T>['search'],\n searchable,\n searchPlaceholder,\n });\n const collectionSource = resolveCollectionSource<T>({ options, items });\n const controlledValue =\n restProps.value !== undefined ? restProps.value : restProps.selectedKey;\n const defaultValue =\n restProps.defaultValue !== undefined\n ? restProps.defaultValue\n : restProps.defaultSelectedKey;\n const trackedSelection = useTrackedSelectionKeys({\n selectedKeys:\n controlledValue === undefined ? undefined : toSelection(controlledValue),\n defaultSelectedKeys: toSelection(defaultValue),\n });\n const collection = useCollectionAdapter({\n items: collectionSource.source,\n selectedKeys: trackedSelection.selectedKeys,\n search: resolvedSearch,\n loading,\n });\n const retainedOptions = getRetainedOptions(\n collectionSource.flatOptions,\n collection.canonicalItems,\n );\n const renderedItems = collectionSource.rendersItems\n ? collection.canonicalItems\n : undefined;\n const contentSearch = resolveContentSearch(resolvedSearch, collection);\n const handleChange = (value: ChangeValueType<M>) => {\n trackedSelection.onSelectionChange(toSelection(value));\n restProps.onChange?.(value);\n };\n\n return (\n <AriaSelect\n className={classes.root}\n {...dataAttributes}\n ref={ref}\n {...restProps}\n onChange={handleChange}\n allowsEmptyCollection\n >\n <FieldLabel\n label={label}\n secondaryLabel={secondaryLabelText}\n description={description}\n descriptionSlot=\"description\"\n />\n <SelectTrigger icon={icon} />\n <FieldError />\n <Popover className={classes.popover} hideArrow {...dataAttributes}>\n <SelectContent\n search={contentSearch}\n options={collectionSource.options}\n items={renderedItems}\n dependencies={dependencies}\n loading={collection.loading}\n isStale={collection.isStale}\n visibleIds={collection.visibleIds}\n retainedOptions={\n retainedOptions as unknown as ReadonlyArray<NormalizedOption>\n }\n >\n {children}\n </SelectContent>\n </Popover>\n </AriaSelect>\n );\n}\n\n/** @public */\nexport const Select = forwardRef(SelectImpl) as {\n <\n M extends 'single' | 'multiple' = 'single' | 'multiple',\n T extends { id: Key } = NormalizedOption,\n >(\n props: SelectProps<M, T> & React.RefAttributes<HTMLDivElement>,\n ): React.ReactElement | null;\n displayName?: string;\n};\n\nSelect.displayName = 'Select';\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, useState } from 'react';\nimport type { Key, Selection } from 'react-aria-components';\n\ntype UseTrackedSelectionKeysProps = {\n selectedKeys?: Selection;\n defaultSelectedKeys?: Selection;\n onSelectionChange?: (keys: Selection) => void;\n};\n\nexport function useTrackedSelectionKeys({\n selectedKeys,\n defaultSelectedKeys,\n onSelectionChange,\n}: UseTrackedSelectionKeysProps) {\n const [uncontrolledSelectedKeys, setUncontrolledSelectedKeys] =\n useState<Selection>(() => defaultSelectedKeys ?? new Set<Key>());\n\n const handleSelectionChange = useCallback(\n (keys: Selection) => {\n setUncontrolledSelectedKeys(keys);\n onSelectionChange?.(keys);\n },\n [onSelectionChange],\n );\n\n return {\n selectedKeys: selectedKeys ?? uncontrolledSelectedKeys,\n onSelectionChange: handleSelectionChange,\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 { useRef } from 'react';\nimport type { Key } from 'react-aria-components';\nimport type {\n AsyncListSource,\n CollectionItem,\n LoadingConfig,\n} from '../types/selectableCollection';\nimport { getItemKeys, isAsyncListSource } from '../utils/selectableCollection';\n\ntype CollectionAdapterSearch =\n | true\n | {\n mode?: 'client' | 'server';\n inputValue?: string;\n defaultInputValue?: string;\n onInputChange?: (value: string) => void;\n };\n\ntype UseCollectionAdapterProps<T extends CollectionItem> = {\n items: Iterable<T> | AsyncListSource<T>;\n selectedKeys?: Iterable<Key>;\n search?: CollectionAdapterSearch;\n loading?: LoadingConfig;\n retainSelectedItems?: boolean;\n};\n\n/** @internal */\nexport type CollectionAdapterResult<T extends CollectionItem> = {\n canonicalItems: T[];\n visibleIds?: Set<Key>;\n loading?: LoadingConfig;\n isStale: boolean;\n inputValue?: string;\n defaultInputValue?: string;\n onInputChange?: (value: string) => void;\n};\n\n/** @internal */\nexport function useCollectionAdapter<T extends CollectionItem>({\n items,\n selectedKeys = [],\n search,\n loading,\n retainSelectedItems = true,\n}: UseCollectionAdapterProps<T>): CollectionAdapterResult<T> {\n const retainedItems = useRef(new Map<Key, T>());\n let asyncSource: AsyncListSource<T> | undefined;\n let sourceItems: T[];\n\n if (isAsyncListSource(items)) {\n asyncSource = items;\n sourceItems = [...items.items];\n } else {\n sourceItems = Array.from(items);\n }\n\n const selectedIdSet = new Set(selectedKeys);\n const searchProps = typeof search === 'object' ? search : undefined;\n const isServerSearch = searchProps?.mode === 'server';\n\n for (const key of retainedItems.current.keys()) {\n if (!selectedIdSet.has(key)) {\n retainedItems.current.delete(key);\n }\n }\n\n for (const item of sourceItems) {\n if (selectedIdSet.has(item.id)) {\n retainedItems.current.set(item.id, item);\n }\n }\n\n const sourceIds = getItemKeys(sourceItems);\n const shouldRetainSelectedItems = isServerSearch && retainSelectedItems;\n let canonicalItems = sourceItems;\n let visibleIds: Set<Key> | undefined;\n\n if (shouldRetainSelectedItems) {\n const missingSelectedItems = Array.from(retainedItems.current.entries())\n .filter(([id]) => !sourceIds.has(id))\n .map(([, item]) => item);\n\n canonicalItems = [...sourceItems, ...missingSelectedItems];\n visibleIds = sourceIds;\n }\n\n let resolvedLoading = loading;\n if (asyncSource) {\n resolvedLoading = {\n state: asyncSource.loadingState,\n onLoadMore: asyncSource.loadMore,\n };\n }\n\n let inputValue = searchProps?.inputValue;\n let onInputChange = searchProps?.onInputChange;\n if (asyncSource && isServerSearch) {\n inputValue = asyncSource.filterText;\n onInputChange = asyncSource.setFilterText;\n }\n\n return {\n canonicalItems,\n visibleIds,\n loading: resolvedLoading,\n isStale:\n sourceItems.length > 0 &&\n (resolvedLoading?.state === 'filtering' ||\n resolvedLoading?.state === 'sorting'),\n inputValue,\n defaultInputValue: searchProps?.defaultInputValue,\n onInputChange,\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 { SkeletonOwnProps } from './types';\nimport styles from './Skeleton.module.css';\n\n/**\n * Component definition for Skeleton\n * @public\n */\nexport const SkeletonDefinition = defineComponent<SkeletonOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Skeleton',\n },\n bg: 'consumer',\n propDefs: {\n width: { default: 80 },\n height: { default: 24 },\n rounded: { dataAttribute: true, default: false },\n className: {},\n style: {},\n },\n});\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-Skeleton\":\"dQdXlDCvsLk1w8Z3\"};","/*\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 type { SkeletonProps } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { SkeletonDefinition } from './definition';\n\n/**\n * A placeholder shape displayed while content is loading, matching the size and layout of the content it replaces.\n *\n * @public\n */\nexport const Skeleton = (props: SkeletonProps) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n SkeletonDefinition,\n props,\n );\n const { classes, width, height, style } = ownProps;\n\n return (\n <div\n className={classes.root}\n {...dataAttributes}\n style={{\n width,\n height,\n ...style,\n }}\n {...restProps}\n />\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 { Cell as ReactAriaCell } from 'react-aria-components';\nimport type { CellProps } from '../types';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { CellDefinition } from '../definition';\n\n/**\n * A low-level table cell primitive for building custom cell content.\n * For standard use cases, prefer `CellText` or `CellProfile`.\n *\n * @public\n */\nconst Cell = (props: CellProps) => {\n const { ownProps, restProps } = useDefinition(CellDefinition, props);\n\n return <ReactAriaCell className={ownProps.classes.root} {...restProps} />;\n};\n\nCell.displayName = 'Cell';\n\nexport { Cell };\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 { Text } from '../../Text';\nimport { Link } from '../../Link';\nimport { Cell as ReactAriaCell } from 'react-aria-components';\nimport type { CellTextProps } from '../types';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { CellTextDefinition } from '../definition';\n\n/**\n * A table cell that renders a primary text title with an optional secondary description, leading icon, and link.\n *\n * @public\n */\nconst CellText = (props: CellTextProps) => {\n const { ownProps, restProps } = useDefinition(CellTextDefinition, props);\n const { classes, title, description, color, leadingIcon, href } = ownProps;\n\n return (\n <ReactAriaCell className={classes.root} {...restProps}>\n <div className={classes.cellContentWrapper}>\n {leadingIcon && <div className={classes.cellIcon}>{leadingIcon}</div>}\n <div className={classes.cellContent}>\n {href ? (\n <Link\n href={href}\n variant=\"body-medium\"\n color={color}\n truncate\n title={title}\n >\n {title}\n </Link>\n ) : (\n <Text\n as=\"p\"\n variant=\"body-medium\"\n color={color}\n truncate\n title={title}\n >\n {title}\n </Text>\n )}\n {description && (\n <Text\n variant=\"body-medium\"\n color=\"secondary\"\n truncate\n title={description}\n >\n {description}\n </Text>\n )}\n </div>\n </div>\n </ReactAriaCell>\n );\n};\n\nCellText.displayName = 'CellText';\n\nexport { CellText };\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 { Column as ReactAriaColumn } from 'react-aria-components';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { ColumnDefinition } from '../definition';\nimport { ColumnProps } from '../types';\nimport { RiArrowUpLine } from '@remixicon/react';\n\n/**\n * A table column header cell with an optional sort toggle and support for resizable widths.\n *\n * @public\n */\nexport const Column = (props: ColumnProps) => {\n const { ownProps, restProps } = useDefinition(ColumnDefinition, props);\n const { classes, children } = ownProps;\n\n return (\n <ReactAriaColumn className={classes.root} {...restProps}>\n {({ allowsSorting }) => (\n <div className={classes.headContent}>\n <span className={classes.headLabel}>{children}</span>\n {allowsSorting && (\n <span aria-hidden=\"true\" className={classes.headSortButton}>\n <RiArrowUpLine size={16} />\n </span>\n )}\n </div>\n )}\n </ReactAriaColumn>\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 { useDefinition } from '../../../hooks/useDefinition';\nimport { TableDefinition } from '../definition';\nimport { Table as ReactAriaTable } from 'react-aria-components';\nimport { TableRootProps } from '../types';\nimport { BUIRoutingProvider } from '../../../navigation/BUIRoutingProvider';\n\n/**\n * The low-level table root element for building custom table layouts from atomic components.\n * For most use cases, prefer the `Table` convenience wrapper.\n *\n * @public\n */\nexport const TableRoot = (props: TableRootProps) => {\n const { ownProps, restProps, dataAttributes } = useDefinition(\n TableDefinition,\n // Merge deprecated `loading` into `isPending` so data attributes and\n // internal logic only need to check a single prop.\n {\n ...props,\n isPending:\n props.isPending || props.loading\n ? true\n : props.isPending ?? props.loading,\n },\n );\n\n return (\n <BUIRoutingProvider>\n <ReactAriaTable\n className={ownProps.classes.root}\n aria-label=\"Data table\"\n aria-busy={ownProps.stale || ownProps.isPending}\n {...dataAttributes}\n {...restProps}\n />\n </BUIRoutingProvider>\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 {\n TableHeader as ReactAriaTableHeader,\n Collection,\n useTableOptions,\n} from 'react-aria-components';\nimport { Checkbox } from '../../Checkbox';\nimport { Column } from './Column';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { TableHeaderDefinition } from '../definition';\nimport type { TableHeaderProps } from '../types';\nimport { Flex } from '../../Flex';\n\n/**\n * The header row of a table, rendering column labels and an optional select-all checkbox for toggle selection mode.\n *\n * @public\n */\nexport const TableHeader = <T extends object>(props: TableHeaderProps<T>) => {\n let { selectionBehavior, selectionMode } = useTableOptions();\n\n const { ownProps, restProps } = useDefinition(TableHeaderDefinition, props);\n const { classes, columns, children } = ownProps;\n\n return (\n <ReactAriaTableHeader className={classes.root} {...restProps}>\n {selectionBehavior === 'toggle' && selectionMode === 'multiple' && (\n <Column\n width={40}\n minWidth={40}\n maxWidth={40}\n className={classes.headSelection}\n >\n <Flex justify=\"center\" align=\"center\" aria-label=\"Row selection\">\n <Checkbox slot=\"selection\" aria-label=\"Select all\" />\n </Flex>\n </Column>\n )}\n <Collection items={columns}>{children}</Collection>\n </ReactAriaTableHeader>\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 { TableBody as ReactAriaTableBody } from 'react-aria-components';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { TableBodyDefinition } from '../definition';\nimport type { TableBodyProps } from '../types';\n\n/**\n * The body section of a table that renders data rows from the provided items collection.\n *\n * @public\n */\nexport const TableBody = <T extends object>(props: TableBodyProps<T>) => {\n const { ownProps, restProps } = useDefinition(TableBodyDefinition, props);\n\n return (\n <ReactAriaTableBody className={ownProps.classes.root} {...restProps} />\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 {\n Row as ReactAriaRow,\n useTableOptions,\n Cell as ReactAriaCell,\n Collection,\n} from 'react-aria-components';\nimport { Checkbox } from '../../Checkbox';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { RowDefinition } from '../definition';\nimport type { RowProps } from '../types';\nimport { isExternalLink } from '../../../utils/linkUtils';\nimport clsx from 'clsx';\nimport { Flex } from '../../Flex';\n\n/**\n * A table row that can optionally act as a navigation link or trigger an action when clicked, with analytics tracking.\n *\n * @public\n */\nexport function Row<T extends object>(props: RowProps<T>) {\n const { ownProps, restProps, dataAttributes, analytics } = useDefinition(\n RowDefinition,\n props,\n );\n const { classes, columns, children } = ownProps;\n const rawHref = restProps.href;\n const isExternal = isExternalLink(rawHref);\n const hasInternalHref = !!rawHref && !isExternal;\n const hasExternalHref = !!rawHref && isExternal;\n const hasInteraction = !!restProps.onAction || !!rawHref;\n\n // Derive the effective target, defaulting to _blank for external links.\n const effectiveTarget = hasExternalHref ? '_blank' : restProps.target;\n // Always include noopener noreferrer when target=_blank, merging any\n // consumer-provided rel tokens to avoid reverse-tabnabbing risk.\n const effectiveRel =\n effectiveTarget === '_blank'\n ? [\n ...new Set([\n 'noopener',\n 'noreferrer',\n ...(restProps.rel?.split(/\\s+/).filter(Boolean) ?? []),\n ]),\n ].join(' ')\n : restProps.rel;\n\n const handlePress = hasInteraction\n ? () => {\n restProps.onAction?.();\n if (rawHref) {\n analytics.captureEvent('click', rawHref, {\n attributes: { to: String(rawHref) },\n });\n }\n }\n : undefined;\n\n let { selectionBehavior, selectionMode } = useTableOptions();\n\n const content = (\n <>\n {selectionBehavior === 'toggle' && selectionMode === 'multiple' && (\n <ReactAriaCell className={clsx(classes.cell, classes.cellSelection)}>\n <Flex justify=\"center\" align=\"center\">\n <Checkbox slot=\"selection\" aria-label=\"Select row\" />\n </Flex>\n </ReactAriaCell>\n )}\n <Collection items={columns}>{children}</Collection>\n </>\n );\n\n return (\n <ReactAriaRow\n {...restProps}\n {...dataAttributes}\n target={effectiveTarget}\n rel={effectiveRel}\n className={clsx(classes.root, restProps.className)}\n data-react-aria-pressable={hasInternalHref ? 'true' : undefined}\n onAction={handlePress}\n >\n {content}\n </ReactAriaRow>\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 { TablePaginationOwnProps, PageSizeOption } from './types';\nimport styles from './TablePagination.module.css';\n\nconst DEFAULT_PAGE_SIZE_OPTIONS: PageSizeOption[] = [\n { label: 'Show 5 results', value: 5 },\n { label: 'Show 10 results', value: 10 },\n { label: 'Show 20 results', value: 20 },\n { label: 'Show 30 results', value: 30 },\n { label: 'Show 40 results', value: 40 },\n { label: 'Show 50 results', value: 50 },\n];\n\n/**\n * Component definition for TablePagination\n * @public\n */\nexport const TablePaginationDefinition =\n defineComponent<TablePaginationOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TablePagination',\n left: 'bui-TablePaginationLeft',\n right: 'bui-TablePaginationRight',\n select: 'bui-TablePaginationSelect',\n },\n propDefs: {\n pageSize: {},\n pageSizeOptions: { default: DEFAULT_PAGE_SIZE_OPTIONS },\n offset: {},\n totalCount: {},\n hasNextPage: {},\n hasPreviousPage: {},\n onNextPage: {},\n onPreviousPage: {},\n onPageSizeChange: {},\n showPageSizeOptions: { default: true },\n getLabel: {},\n showPaginationLabel: { default: true },\n },\n });\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-TablePagination\":\"Z_Iagacz0F1YYG04\",\"bui-TablePaginationLeft\":\"N_pRbW6lVsY4Hdgf\",\"bui-TablePaginationRight\":\"qXYnm03BkEcKl1FA\",\"bui-TablePaginationSelect\":\"plzZlLJyZhc3wn3s\"};","/*\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 { useId } from 'react-aria';\nimport { Text } from '../Text';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Select } from '../Select';\nimport type { TablePaginationProps, PageSizeOption } from './types';\nimport { useDefinition } from '../../hooks/useDefinition';\nimport { TablePaginationDefinition } from './definition';\nimport { RiArrowLeftSLine, RiArrowRightSLine } from '@remixicon/react';\nimport { useMemo } from 'react';\n\nfunction getOptionValue(option: number | PageSizeOption): number {\n return typeof option === 'number' ? option : option.value;\n}\n\nfunction isNumberArray(\n options: number[] | PageSizeOption[],\n): options is number[] {\n return options.length > 0 && typeof options[0] === 'number';\n}\n\nfunction normalizePageSizeOptions(\n options: number[] | PageSizeOption[],\n): PageSizeOption[] {\n if (isNumberArray(options)) {\n return options.map(value => ({\n label: `Show ${value} results`,\n value,\n }));\n }\n return options;\n}\n\n/**\n * Pagination controls for Table components with page navigation and size selection.\n *\n * @public\n */\nexport function TablePagination(props: TablePaginationProps) {\n const { ownProps } = useDefinition(TablePaginationDefinition, props);\n const {\n classes,\n pageSize,\n pageSizeOptions,\n offset,\n totalCount,\n hasNextPage,\n hasPreviousPage,\n onNextPage,\n onPreviousPage,\n onPageSizeChange,\n showPageSizeOptions,\n getLabel,\n showPaginationLabel,\n } = ownProps;\n\n const labelId = useId();\n const normalizedOptions = useMemo(\n () => normalizePageSizeOptions(pageSizeOptions),\n [pageSizeOptions],\n );\n\n const effectivePageSize = useMemo(() => {\n if (pageSizeOptions.length === 0) {\n return pageSize;\n }\n const isValid = pageSizeOptions.some(\n opt => getOptionValue(opt) === pageSize,\n );\n if (isValid) {\n return pageSize;\n }\n const firstValue = getOptionValue(pageSizeOptions[0]);\n console.warn(\n `TablePagination: pageSize ${pageSize} is not in pageSizeOptions, using ${firstValue} instead`,\n );\n return firstValue;\n }, [pageSize, pageSizeOptions]);\n\n const hasItems = totalCount !== undefined && totalCount !== 0;\n\n const showLabel = hasItems && showPaginationLabel !== false;\n\n let label = `${totalCount} items`;\n if (getLabel) {\n label = getLabel({ pageSize: effectivePageSize, offset, totalCount });\n } else if (offset !== undefined) {\n const fromCount = offset + 1;\n const toCount = Math.min(offset + effectivePageSize, totalCount ?? 0);\n label = `${fromCount} - ${toCount} of ${totalCount}`;\n }\n\n return (\n <div className={classes.root}>\n <div className={classes.left}>\n {showPageSizeOptions && normalizedOptions.length > 0 && (\n <Select\n name=\"pageSize\"\n size=\"small\"\n aria-label=\"Select table page size\"\n options={normalizedOptions.map(opt => ({\n label: opt.label,\n value: String(opt.value),\n }))}\n value={effectivePageSize.toString()}\n onChange={value => {\n const newPageSize = Number(value);\n onPageSizeChange?.(newPageSize);\n }}\n className={classes.select}\n />\n )}\n </div>\n <div className={classes.right}>\n {showLabel && (\n <Text as=\"p\" variant=\"body-medium\" id={labelId}>\n {label}\n </Text>\n )}\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={onPreviousPage}\n isDisabled={!hasPreviousPage}\n icon={<RiArrowLeftSLine />}\n aria-label=\"Previous table page\"\n aria-describedby={showLabel ? labelId : undefined}\n />\n <ButtonIcon\n variant=\"secondary\"\n size=\"small\"\n onClick={onNextPage}\n isDisabled={!hasNextPage}\n icon={<RiArrowRightSLine />}\n aria-label=\"Next table page\"\n aria-describedby={showLabel ? labelId : undefined}\n />\n </div>\n </div>\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 { TableBody } from './TableBody';\nimport { Row } from './Row';\nimport { Cell } from './Cell';\nimport { Skeleton } from '../../Skeleton';\n\nconst SKELETON_ROW_COUNT = 5;\nconst SKELETON_WIDTHS = ['75%', '50%', '60%', '45%', '70%'];\n\nconst skeletonItems = Array.from({ length: SKELETON_ROW_COUNT }, (_, i) => ({\n id: `skeleton-${i}`,\n index: i,\n}));\n\n/**\n * A table body that renders animated skeleton rows as a loading placeholder.\n *\n * @remarks\n * Accepts any column array whose items have an `id` property, making it\n * compatible with both `ColumnConfig` and custom column types.\n *\n * @public\n */\nexport function TableBodySkeleton<T extends { id: string }>({\n columns,\n}: {\n columns: readonly T[];\n}) {\n return (\n <TableBody items={skeletonItems} dependencies={[columns]}>\n {item => {\n const rowIndex = item.index;\n return (\n <Row id={item.id} columns={columns}>\n {column => (\n <Cell key={column.id} aria-hidden=\"true\">\n <Skeleton\n width={\n SKELETON_WIDTHS[\n (rowIndex + columns.indexOf(column)) %\n SKELETON_WIDTHS.length\n ]\n }\n />\n </Cell>\n )}\n </Row>\n );\n }}\n </TableBody>\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 { useId } from 'react-aria';\nimport {\n type Key,\n ResizableTableContainer,\n Virtualizer,\n} from 'react-aria-components';\nimport { TableLayout } from 'react-stately';\nimport { useDefinition } from '../../../hooks/useDefinition';\nimport { TableWrapperDefinition } from '../definition';\nimport { TableRoot } from './TableRoot';\nimport { TableHeader } from './TableHeader';\nimport { TableBody } from './TableBody';\nimport { Row } from './Row';\nimport { Column } from './Column';\nimport { TablePagination } from '../../TablePagination';\nimport type {\n TableProps,\n TableItem,\n RowConfig,\n RowRenderFn,\n TablePaginationType,\n} from '../types';\nimport { useMemo } from 'react';\nimport { VisuallyHidden } from '../../VisuallyHidden';\nimport { Flex } from '../../Flex';\nimport { TableBodySkeleton } from './TableBodySkeleton';\nimport { Text } from '../../Text';\n\nfunction isRowRenderFn<T extends TableItem>(\n rowConfig: RowConfig<T> | RowRenderFn<T> | undefined,\n): rowConfig is RowRenderFn<T> {\n return typeof rowConfig === 'function';\n}\n\nfunction useDisabledRows<T extends TableItem>({\n data,\n rowConfig,\n}: Pick<TableProps<T>, 'data' | 'rowConfig'>): Set<Key> | undefined {\n return useMemo(() => {\n if (!data || typeof rowConfig === 'function' || !rowConfig?.getIsDisabled) {\n return;\n }\n\n return data.reduce<Set<Key>>((set, item) => {\n const isDisabled = rowConfig.getIsDisabled?.(item);\n if (isDisabled) {\n set.add(String(item.id));\n }\n return set;\n }, new Set<Key>());\n }, [data, rowConfig]);\n}\n\nfunction useLiveRegionLabel(\n pagination: TablePaginationType,\n isStale: boolean,\n isLoading: boolean,\n hasData: boolean,\n): string {\n if (isLoading) {\n return 'Loading table data.';\n }\n\n if (!hasData || pagination.type === 'none') {\n return '';\n }\n\n const { pageSize, offset, totalCount, getLabel } = pagination;\n\n if (isStale) {\n return 'Loading table data.';\n }\n\n let liveRegionLabel = 'Table page loaded. ';\n\n if (getLabel) {\n liveRegionLabel += getLabel({ pageSize, offset, totalCount });\n } else if (offset !== undefined) {\n const fromCount = offset + 1;\n const toCount = Math.min(offset + pageSize, totalCount ?? 0);\n liveRegionLabel += `Showing ${fromCount} to ${toCount} of ${totalCount}`;\n }\n return liveRegionLabel;\n}\n\n/**\n * A full-featured data table with built-in pagination, sorting, row selection, loading and error states, and optional virtualization.\n * Pair with `useTable` to manage data fetching and state, or pass `data`, `columnConfig`, and `pagination` directly for manual control.\n *\n * @public\n */\nexport function Table<T extends TableItem>({\n columnConfig,\n data,\n isPending = false,\n loading = false,\n isStale = false,\n error,\n pagination,\n sort,\n rowConfig,\n selection,\n emptyState,\n className,\n style,\n virtualized,\n}: TableProps<T>) {\n const pending = isPending || loading;\n const {\n ownProps: { classes },\n } = useDefinition(TableWrapperDefinition, { className });\n const liveRegionId = useId();\n\n const visibleColumns = useMemo(\n () => columnConfig.filter(col => !col.isHidden),\n [columnConfig],\n );\n const disabledRows = useDisabledRows({ data, rowConfig });\n\n const {\n mode: selectionMode,\n selected: selectedKeys,\n behavior: selectionBehavior,\n onSelectionChange,\n } = selection || {};\n\n const isInitialLoading = pending && !data;\n\n if (error) {\n return (\n <div className={classes.root} style={style}>\n <Text variant=\"body-medium\">Error: {error.message}</Text>\n </div>\n );\n }\n\n const liveRegionLabel = useLiveRegionLabel(\n pagination,\n isStale,\n isInitialLoading,\n data !== undefined,\n );\n\n const manualColumnSizing = columnConfig.some(\n col =>\n col.width != null ||\n col.minWidth != null ||\n col.maxWidth != null ||\n col.defaultWidth != null,\n );\n\n const wrapResizable = manualColumnSizing\n ? (elem: React.ReactNode) => (\n <ResizableTableContainer className={classes.resizableContainer}>\n {elem}\n </ResizableTableContainer>\n )\n : (elem: React.ReactNode) => <>{elem}</>;\n\n const layoutOptions =\n typeof virtualized === 'object' ? virtualized : undefined;\n\n const wrapVirtualized = (elem: React.ReactNode) =>\n virtualized ? (\n <Virtualizer layout={TableLayout} layoutOptions={layoutOptions}>\n {elem}\n </Virtualizer>\n ) : (\n elem\n );\n\n const wrapScrollContainer = (elem: React.ReactNode) => (\n <div className={classes.scrollContainer}>{elem}</div>\n );\n\n return (\n <div className={classes.root} style={style}>\n <VisuallyHidden aria-live=\"polite\" id={liveRegionId}>\n {liveRegionLabel}\n </VisuallyHidden>\n {wrapResizable(\n wrapScrollContainer(\n wrapVirtualized(\n <TableRoot\n {...(isInitialLoading\n ? {}\n : {\n selectionMode,\n selectionBehavior,\n selectedKeys,\n onSelectionChange,\n })}\n sortDescriptor={sort?.descriptor ?? undefined}\n onSortChange={sort?.onSortChange}\n disabledKeys={disabledRows}\n stale={isStale}\n isPending={isInitialLoading}\n aria-describedby={liveRegionId}\n >\n <TableHeader columns={visibleColumns}>\n {column =>\n column.header ? (\n column.header()\n ) : (\n <Column\n id={column.id}\n isRowHeader={column.isRowHeader}\n allowsSorting={column.isSortable}\n width={column.width}\n defaultWidth={column.defaultWidth}\n minWidth={column.minWidth}\n maxWidth={column.maxWidth}\n >\n {column.label}\n </Column>\n )\n }\n </TableHeader>\n {isInitialLoading ? (\n <TableBodySkeleton columns={visibleColumns} />\n ) : (\n <TableBody\n items={data}\n dependencies={[visibleColumns]}\n renderEmptyState={\n emptyState\n ? () => <Flex p=\"3\">{emptyState}</Flex>\n : undefined\n }\n >\n {item => {\n const itemIndex = data?.indexOf(item) ?? -1;\n\n if (isRowRenderFn(rowConfig)) {\n return rowConfig({\n item,\n index: itemIndex,\n });\n }\n\n return (\n <Row\n id={String(item.id)}\n columns={visibleColumns}\n href={rowConfig?.getHref?.(item)}\n onAction={\n rowConfig?.onClick\n ? () => rowConfig?.onClick?.(item)\n : undefined\n }\n >\n {column => column.cell(item)}\n </Row>\n );\n }}\n </TableBody>\n )}\n </TableRoot>,\n ),\n ),\n )}\n {pagination.type === 'page' && (\n <TablePagination\n pageSize={pagination.pageSize}\n pageSizeOptions={pagination.pageSizeOptions}\n offset={pagination.offset}\n totalCount={pagination.totalCount}\n hasNextPage={pagination.hasNextPage}\n hasPreviousPage={pagination.hasPreviousPage}\n onNextPage={pagination.onNextPage}\n onPreviousPage={pagination.onPreviousPage}\n onPageSizeChange={pagination.onPageSizeChange}\n showPageSizeOptions={pagination.showPageSizeOptions}\n getLabel={pagination.getLabel}\n showPaginationLabel={pagination.showPaginationLabel}\n />\n )}\n </div>\n );\n}\n","// extracted by css-extract-rspack-plugin\nexport default {\"bui-TableWrapper\":\"v8W8N2dqiE5cGNxm\",\"bui-TableResizableContainer\":\"Q3dVWKchqFEGDxNm\",\"bui-TableScrollContainer\":\"cae_vIXVMIPSb9LO\",\"bui-Table\":\"kHZPXvGYPYAGYFhf\",\"bui-TableHeader\":\"oifZQr6gC_QyhRzd\",\"bui-TableHead\":\"X8xcDL8E6rIYbeSR\",\"bui-TableHeadSelection\":\"ae9pE72Zc07f8L6W\",\"bui-TableHeadContent\":\"d_1Lwe7cMab7Y7x8\",\"bui-TableHeadLabel\":\"c2mE5YTadTwCB9Cv\",\"bui-TableHeadSortButton\":\"U0p16BfATSMI0pZa\",\"bui-TableBody\":\"RevIL7d7UeIjyBcV\",\"bui-TableRow\":\"kPJhRwYa5RAAhwxF\",\"bui-TableCell\":\"lBJ1evBwz18CSuEb\",\"bui-TableCellSelection\":\"waN8m81er3MmoNwQ\",\"bui-TableCellContentWrapper\":\"AQrmv2_3dWQm8mkC\",\"bui-TableCellIcon\":\"pZfxgqebmIQNGPFo\",\"bui-TableCellContent\":\"VL_PIHABTKklOpWr\",\"bui-TableCellProfile\":\"qco3EFeJwhQRop02\"};","/*\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 TableRootOwnProps,\n TableHeaderOwnProps,\n TableBodyOwnProps,\n RowOwnProps,\n ColumnOwnProps,\n CellOwnProps,\n CellTextOwnProps,\n CellProfileOwnProps,\n} from './types';\nimport styles from './Table.module.css';\n\n/** @internal */\nexport const TableWrapperDefinition = defineComponent<{\n className?: string;\n}>()({\n styles,\n classNames: {\n root: 'bui-TableWrapper',\n resizableContainer: 'bui-TableResizableContainer',\n scrollContainer: 'bui-TableScrollContainer',\n },\n propDefs: {\n className: {},\n },\n});\n\n/**\n * Component definition for Table\n * @public\n */\nexport const TableDefinition = defineComponent<TableRootOwnProps>()({\n styles,\n classNames: {\n root: 'bui-Table',\n },\n propDefs: {\n stale: { dataAttribute: true },\n isPending: { dataAttribute: true },\n loading: { dataAttribute: true },\n },\n});\n\n/**\n * Component definition for TableHeader\n * @internal\n */\nexport const TableHeaderDefinition = defineComponent<TableHeaderOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableHeader',\n headSelection: 'bui-TableHeadSelection',\n },\n propDefs: {\n columns: {},\n children: {},\n },\n});\n\n/**\n * Component definition for TableBody\n * @internal\n */\nexport const TableBodyDefinition = defineComponent<TableBodyOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableBody',\n },\n propDefs: {},\n});\n\n/**\n * Component definition for Row\n * @internal\n */\nexport const RowDefinition = defineComponent<RowOwnProps>()({\n styles,\n analytics: true,\n bg: 'consumer',\n classNames: {\n root: 'bui-TableRow',\n cell: 'bui-TableCell',\n cellSelection: 'bui-TableCellSelection',\n },\n propDefs: {\n columns: {},\n children: {},\n noTrack: {},\n },\n});\n\n/**\n * Component definition for Column\n * @internal\n */\nexport const ColumnDefinition = defineComponent<ColumnOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableHead',\n headContent: 'bui-TableHeadContent',\n headLabel: 'bui-TableHeadLabel',\n headSortButton: 'bui-TableHeadSortButton',\n },\n propDefs: {\n children: {},\n className: {},\n },\n});\n\n/**\n * Component definition for Cell\n * @internal\n */\nexport const CellDefinition = defineComponent<CellOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableCell',\n },\n propDefs: {\n className: {},\n },\n});\n\n/**\n * Component definition for CellText\n * @internal\n */\nexport const CellTextDefinition = defineComponent<CellTextOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableCell',\n cellContentWrapper: 'bui-TableCellContentWrapper',\n cellContent: 'bui-TableCellContent',\n cellIcon: 'bui-TableCellIcon',\n },\n propDefs: {\n title: {},\n description: {},\n color: { default: 'primary' },\n leadingIcon: {},\n href: {},\n className: {},\n },\n});\n\n/**\n * Component definition for CellProfile\n * @internal\n */\nexport const CellProfileDefinition = defineComponent<CellProfileOwnProps>()({\n styles,\n classNames: {\n root: 'bui-TableCell',\n cellContentWrapper: 'bui-TableCellContentWrapper',\n cellContent: 'bui-TableCellContent',\n },\n propDefs: {\n src: {},\n name: {},\n href: {},\n description: {},\n color: { default: 'primary' },\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 { useMemo, useState, useCallback } from 'react';\nimport type { QueryOptions, QueryState } from './types';\n\nfunction useControlledStateHelper<T, TControlled = T, TInitial = TControlled>(\n initialValue: TInitial,\n controlledValue: TControlled | undefined,\n onChange: ((value: T) => void) | undefined,\n) {\n const [internalValue, setInternalValue] = useState<TInitial>(initialValue);\n\n const value = controlledValue !== undefined ? controlledValue : internalValue;\n\n const setValue = useCallback(\n (newValue: T) => {\n if (controlledValue === undefined) {\n setInternalValue(newValue as unknown as TInitial);\n }\n if (onChange) {\n onChange(newValue);\n }\n },\n [controlledValue, onChange],\n );\n\n return [value, setValue] as const;\n}\n\n/** @internal */\nexport function useQueryState<TFilter>(\n options: QueryOptions<TFilter>,\n): QueryState<TFilter> {\n const [sort, setSort] = useControlledStateHelper(\n options.initialSort ?? null,\n options.sort,\n options.onSortChange,\n );\n const [filter, setFilter] = useControlledStateHelper(\n options.initialFilter,\n options.filter,\n options.onFilterChange,\n );\n const [search, setSearch] = useControlledStateHelper(\n options.initialSearch ?? '',\n options.search,\n options.onSearchChange,\n );\n\n return useMemo(\n () => ({ sort, setSort, filter, setFilter, search, setSearch }),\n [sort, setSort, filter, setFilter, search, setSearch],\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 { useRef, useCallback } from 'react';\n\n/**\n * Returns a stable callback reference that always calls the latest version\n * of the provided function. Useful for callbacks passed as props that may\n * change on every render but shouldn't trigger effect re-runs.\n *\n * @internal\n */\nexport function useStableCallback<T extends (...args: any[]) => any>(fn: T): T {\n const ref = useRef(fn);\n ref.current = fn;\n\n return useCallback((...args: Parameters<T>) => ref.current(...args), []) as T;\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 { useEffect, useState } from 'react';\n\n/**\n * Returns a trailing-edge debounced surrogate of `value`.\n *\n * - When `delayMs <= 0`, the live `value` is returned directly without arming\n * a timer — a true bypass with no observable change relative to using\n * `value` itself.\n * - When `delayMs > 0`, the returned value lags behind `value` by `delayMs`\n * of stability. The timer is cleared on `value` change, `delayMs` change,\n * and on unmount.\n *\n * @internal\n */\nexport function useDebouncedValue<T>(value: T, delayMs: number): T {\n const [debounced, setDebounced] = useState<T>(value);\n\n useEffect(() => {\n if (delayMs <= 0) {\n return undefined;\n }\n const timer = setTimeout(() => setDebounced(value), delayMs);\n return () => clearTimeout(timer);\n }, [value, delayMs]);\n\n return delayMs <= 0 ? value : debounced;\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 { PageSizeOption } from '../../TablePagination/types';\nimport type { PaginationOptions } from './types';\n\nconst DEFAULT_PAGE_SIZE = 20;\n\nfunction getOptionValue(option: number | PageSizeOption): number {\n return typeof option === 'number' ? option : option.value;\n}\n\n/** @internal */\nexport function getEffectivePageSize(\n paginationOptions: PaginationOptions,\n): number {\n const { pageSize, pageSizeOptions } = paginationOptions;\n\n if (!pageSizeOptions?.length) {\n return pageSize ?? DEFAULT_PAGE_SIZE;\n }\n\n const firstValue = getOptionValue(pageSizeOptions[0]);\n\n if (pageSize === undefined) {\n return firstValue;\n }\n\n const isValid = pageSizeOptions.some(opt => getOptionValue(opt) === pageSize);\n\n if (isValid) {\n return pageSize;\n }\n\n console.warn(\n `useTable: pageSize ${pageSize} is not in pageSizeOptions, using ${firstValue} instead`,\n );\n return firstValue;\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 { useState, useCallback, useRef, useEffect, useReducer } from 'react';\n\nconst FIRST_PAGE_CURSOR = Symbol('firstPage');\n\ntype CursorType = string | number;\n\ntype InternalCursor<TCursor extends CursorType> =\n | TCursor\n | typeof FIRST_PAGE_CURSOR;\n\ninterface PageEntry<T, TCursor extends CursorType> {\n data: T[] | undefined;\n nextCursor: InternalCursor<TCursor> | undefined;\n prevCursor: InternalCursor<TCursor> | undefined;\n}\n\ninterface GetDataResult<T, TCursor extends CursorType> {\n data: T[];\n nextCursor?: TCursor;\n prevCursor?: TCursor;\n totalCount?: number;\n}\n\n/** @internal */\nexport interface UsePageCacheOptions<T, TCursor extends CursorType = string> {\n getData: (params: {\n cursor: TCursor | undefined;\n signal: AbortSignal;\n }) => Promise<GetDataResult<T, TCursor>>;\n initialCurrentCursor?: TCursor;\n}\n\n/** @internal */\nexport interface UsePageCacheResult<T, TCursor extends CursorType = string> {\n isPending: boolean;\n error: Error | undefined;\n data: T[] | undefined;\n totalCount: number | undefined;\n currentCursor: TCursor | undefined;\n hasPreviousPage: boolean;\n onPreviousPage: () => void;\n hasNextPage: boolean;\n onNextPage: () => void;\n reload: (options?: { keepCurrentCursor?: boolean }) => void;\n}\n\ntype Direction = 'mount' | 'reset' | 'refresh' | 'next' | 'prev';\n\nclass PageCacheStore<T, TCursor extends CursorType> {\n private cache = new Map<InternalCursor<TCursor>, PageEntry<T, TCursor>>();\n\n get(cursor: InternalCursor<TCursor>): PageEntry<T, TCursor> | undefined {\n return this.cache.get(cursor);\n }\n\n getOrCreate(cursor: InternalCursor<TCursor>): PageEntry<T, TCursor> {\n const existing = this.cache.get(cursor);\n if (existing) {\n return existing;\n }\n const entry: PageEntry<T, TCursor> = {\n data: undefined,\n nextCursor: undefined,\n prevCursor: undefined,\n };\n this.cache.set(cursor, entry);\n return entry;\n }\n\n clear() {\n this.cache.clear();\n }\n\n getTargetCursor(\n direction: Direction,\n currentCursor: InternalCursor<TCursor>,\n initialCurrentCursor: TCursor | undefined,\n ): InternalCursor<TCursor> | undefined {\n if (direction === 'mount') {\n return toInternalCursor(initialCurrentCursor);\n }\n if (direction === 'reset') {\n return FIRST_PAGE_CURSOR;\n }\n if (direction === 'refresh') {\n return currentCursor;\n }\n const currentEntry = this.cache.get(currentCursor);\n\n if (!currentEntry) {\n return;\n }\n\n return direction === 'next'\n ? currentEntry.nextCursor\n : currentEntry.prevCursor;\n }\n\n linkEntryToSource(\n entry: PageEntry<T, TCursor>,\n direction: Direction,\n currentCursor: InternalCursor<TCursor>,\n ) {\n if (direction === 'next') {\n entry.prevCursor = currentCursor;\n } else if (direction === 'prev') {\n entry.nextCursor = currentCursor;\n }\n }\n}\n\nfunction toInternalCursor<TCursor extends CursorType>(\n cursor: TCursor | undefined,\n): InternalCursor<TCursor> {\n return cursor === undefined ? FIRST_PAGE_CURSOR : cursor;\n}\n\nfunction toExternalCursor<TCursor extends CursorType>(\n cursor: InternalCursor<TCursor>,\n): TCursor | undefined {\n return cursor === FIRST_PAGE_CURSOR ? undefined : cursor;\n}\n\n/** @internal */\nexport function usePageCache<T, TCursor extends CursorType = string>(\n options: UsePageCacheOptions<T, TCursor>,\n): UsePageCacheResult<T, TCursor> {\n const { getData, initialCurrentCursor } = options;\n\n const [currentCursor, setCurrentCursor] = useState<InternalCursor<TCursor>>(\n () => toInternalCursor(initialCurrentCursor),\n );\n\n const cacheStore = useRef(new PageCacheStore<T, TCursor>()).current;\n\n const [isPending, setIsPending] = useState(true);\n const [error, setError] = useState<Error | undefined>(undefined);\n const [totalCount, setTotalCount] = useState<number | undefined>(undefined);\n const [, notifyCacheUpdate] = useReducer(version => version + 1, 0);\n\n const abortControllerRef = useRef<AbortController | null>(null);\n\n const currentPage = cacheStore.get(currentCursor);\n const data = currentPage?.data;\n const hasNextPage = currentPage?.nextCursor !== undefined;\n const hasPreviousPage = currentPage?.prevCursor !== undefined;\n\n const goToPage = useCallback(\n async (direction: Direction) => {\n const targetCursor = cacheStore.getTargetCursor(\n direction,\n currentCursor,\n initialCurrentCursor,\n );\n\n if (targetCursor === undefined) {\n return;\n }\n\n const existingEntry = cacheStore.get(targetCursor);\n if (existingEntry?.data !== undefined) {\n setCurrentCursor(targetCursor);\n setError(undefined);\n return;\n }\n\n const entry = cacheStore.getOrCreate(targetCursor);\n cacheStore.linkEntryToSource(entry, direction, currentCursor);\n setCurrentCursor(targetCursor);\n\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n }\n\n const abortController = new AbortController();\n abortControllerRef.current = abortController;\n\n setIsPending(true);\n setError(undefined);\n\n try {\n const result = await getData({\n cursor: toExternalCursor(targetCursor),\n signal: abortController.signal,\n });\n\n if (abortController.signal.aborted) {\n return;\n }\n\n entry.data = result.data;\n\n if (entry.nextCursor === undefined && result.nextCursor !== undefined) {\n entry.nextCursor = result.nextCursor;\n }\n if (entry.prevCursor === undefined && result.prevCursor !== undefined) {\n entry.prevCursor = result.prevCursor;\n }\n\n if (result.totalCount !== undefined) {\n setTotalCount(result.totalCount);\n }\n\n notifyCacheUpdate();\n setIsPending(false);\n } catch (err) {\n if (abortController.signal.aborted) {\n return;\n }\n\n setError(err instanceof Error ? err : new Error(String(err)));\n setIsPending(false);\n }\n },\n [getData, initialCurrentCursor, currentCursor, cacheStore],\n );\n\n useEffect(() => {\n goToPage('mount');\n\n return () => {\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n }\n };\n }, []);\n\n const onNextPage = useCallback(() => {\n if (isPending) return;\n const page = cacheStore.get(currentCursor);\n if (page?.nextCursor === undefined) return;\n goToPage('next');\n }, [isPending, currentCursor, goToPage, cacheStore]);\n\n const onPreviousPage = useCallback(() => {\n if (isPending) return;\n const page = cacheStore.get(currentCursor);\n if (page?.prevCursor === undefined) return;\n goToPage('prev');\n }, [isPending, currentCursor, goToPage, cacheStore]);\n\n const reload = useCallback(\n (reloadOptions?: { keepCurrentCursor?: boolean }) => {\n if (abortControllerRef.current) {\n abortControllerRef.current.abort();\n }\n\n cacheStore.clear();\n\n goToPage(reloadOptions?.keepCurrentCursor ? 'refresh' : 'reset');\n },\n [goToPage, cacheStore],\n );\n\n return {\n isPending,\n error,\n data,\n totalCount,\n currentCursor: toExternalCursor(currentCursor),\n hasPreviousPage,\n onPreviousPage,\n hasNextPage,\n onNextPage,\n reload,\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 { useEffect, useRef } from 'react';\nimport type { QueryState } from './types';\n\n/**\n * Triggers a debounced reload when query or pageSize changes.\n * Debouncing reduces backend load during rapid changes (e.g., typing in search).\n */\n/** @internal */\nexport function useDebouncedReload<TFilter>(\n query: QueryState<TFilter>,\n pageSize: number,\n reload: () => void,\n delay: number = 200,\n): void {\n const { sort, filter, search } = query;\n const prevDepsRef = useRef({ sort, filter, search, pageSize });\n\n useEffect(() => {\n const prev = prevDepsRef.current;\n if (\n prev.sort !== sort ||\n prev.filter !== filter ||\n prev.search !== search ||\n prev.pageSize !== pageSize\n ) {\n prevDepsRef.current = { sort, filter, search, pageSize };\n const timer = setTimeout(reload, delay);\n return () => clearTimeout(timer);\n }\n return undefined;\n }, [sort, filter, search, pageSize, reload, delay]);\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 { useMemo, useRef } from 'react';\nimport type { SortState, TableItem, TableProps } from '../types';\nimport type {\n PaginationResult,\n UseTableCompleteOptions,\n UseTableCursorOptions,\n UseTableOffsetOptions,\n UseTableOptions,\n UseTableResult,\n} from './types';\nimport { useQueryState } from './useQueryState';\nimport { useCompletePagination } from './useCompletePagination';\nimport { useCursorPagination } from './useCursorPagination';\nimport { useOffsetPagination } from './useOffsetPagination';\n\nfunction useTableProps<T extends TableItem>(\n paginationResult: PaginationResult<T>,\n sortState: SortState,\n paginationOptions: UseTableCompleteOptions<T>['paginationOptions'] = {},\n): Omit<\n TableProps<T>,\n 'columnConfig' | 'rowConfig' | 'selection' | 'emptyState'\n> {\n const {\n showPageSizeOptions = true,\n pageSizeOptions,\n onPageSizeChange: onPageSizeChangeCallback,\n onNextPage: onNextPageCallback,\n onPreviousPage: onPreviousPageCallback,\n getLabel,\n showPaginationLabel,\n } = paginationOptions;\n\n const previousDataRef = useRef(paginationResult.data);\n if (paginationResult.data) {\n previousDataRef.current = paginationResult.data;\n }\n\n const displayData = paginationResult.data ?? previousDataRef.current;\n const isStale = paginationResult.isPending && displayData !== undefined;\n\n const pagination = useMemo(() => {\n if (paginationOptions.type === 'none') {\n return { type: 'none' as const };\n }\n return {\n type: 'page' as const,\n pageSize: paginationResult.pageSize,\n pageSizeOptions,\n offset: paginationResult.offset,\n totalCount: paginationResult.totalCount,\n hasNextPage: paginationResult.hasNextPage,\n hasPreviousPage: paginationResult.hasPreviousPage,\n onNextPage: () => {\n paginationResult.onNextPage();\n onNextPageCallback?.();\n },\n onPreviousPage: () => {\n paginationResult.onPreviousPage();\n onPreviousPageCallback?.();\n },\n onPageSizeChange: (size: number) => {\n paginationResult.onPageSizeChange(size);\n onPageSizeChangeCallback?.(size);\n },\n showPageSizeOptions,\n getLabel,\n showPaginationLabel,\n };\n }, [\n paginationOptions.type,\n paginationResult.pageSize,\n pageSizeOptions,\n paginationResult.offset,\n paginationResult.totalCount,\n paginationResult.hasNextPage,\n paginationResult.hasPreviousPage,\n paginationResult.onNextPage,\n paginationResult.onPreviousPage,\n paginationResult.onPageSizeChange,\n onNextPageCallback,\n onPreviousPageCallback,\n onPageSizeChangeCallback,\n showPageSizeOptions,\n getLabel,\n showPaginationLabel,\n ]);\n\n return useMemo(\n () => ({\n data: displayData,\n isPending: paginationResult.isPending,\n loading: paginationResult.isPending,\n isStale,\n error: paginationResult.error,\n pagination,\n sort: sortState,\n }),\n [\n displayData,\n paginationResult.isPending,\n isStale,\n paginationResult.error,\n pagination,\n sortState,\n ],\n );\n}\n\n/**\n * A hook that manages table data fetching, pagination, sorting, search, and filtering.\n * Supports three modes: `complete` for client-side data, `offset` for server-side offset pagination, and `cursor` for server-side cursor pagination.\n *\n * @public\n */\nexport function useTable<T extends TableItem, TFilter = unknown>(\n options: UseTableCompleteOptions<T, TFilter>,\n): UseTableResult<T, TFilter>;\n/** @public */\nexport function useTable<T extends TableItem, TFilter = unknown>(\n options: UseTableOffsetOptions<T, TFilter>,\n): UseTableResult<T, TFilter>;\n/** @public */\nexport function useTable<T extends TableItem, TFilter = unknown>(\n options: UseTableCursorOptions<T, TFilter>,\n): UseTableResult<T, TFilter>;\nexport function useTable<T extends TableItem, TFilter = unknown>(\n options: UseTableOptions<T, TFilter>,\n): UseTableResult<T, TFilter> {\n const query = useQueryState<TFilter>(options);\n\n const initialModeRef = useRef(options.mode);\n if (initialModeRef.current !== options.mode) {\n throw new Error(\n `useTable mode cannot change from '${initialModeRef.current}' to '${options.mode}'. ` +\n `The mode must remain stable for the lifetime of the component.`,\n );\n }\n\n let pagination: PaginationResult<T> & { reload: () => void };\n\n if (options.mode === 'complete') {\n pagination = useCompletePagination(options, query);\n } else if (options.mode === 'offset') {\n pagination = useOffsetPagination(options, query);\n } else if (options.mode === 'cursor') {\n pagination = useCursorPagination(options, query);\n } else {\n throw new Error('Invalid mode');\n }\n\n const sortState: SortState = useMemo(\n () => ({ descriptor: query.sort, onSortChange: query.setSort }),\n [query.sort, query.setSort],\n );\n\n const tableProps = useTableProps(\n pagination,\n sortState,\n options.paginationOptions ?? {},\n );\n\n return {\n tableProps,\n reload: pagination.reload,\n filter: { value: query.filter, onChange: query.setFilter },\n search: { value: query.search, onChange: query.setSearch },\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 { useState, useCallback, useMemo, useEffect, useRef } from 'react';\nimport type { TableItem } from '../types';\nimport type {\n PaginationResult,\n QueryState,\n UseTableCompleteOptions,\n} from './types';\nimport { useStableCallback } from './useStableCallback';\nimport { useDebouncedValue } from './useDebouncedValue';\nimport { getEffectivePageSize } from './getEffectivePageSize';\n\n/** @internal */\nexport function useCompletePagination<T extends TableItem, TFilter>(\n options: UseTableCompleteOptions<T, TFilter>,\n query: QueryState<TFilter>,\n): PaginationResult<T> & { reload: () => void } {\n const {\n data,\n getData: getDataProp = () => [],\n paginationOptions = {},\n sortFn,\n filterFn,\n searchFn,\n searchDebounceMs = 0,\n filterDebounceMs = 0,\n } = options;\n const hasGetData = 'getData' in options;\n const noPagination = paginationOptions.type === 'none';\n const { initialOffset = 0 } = paginationOptions;\n const defaultPageSize = noPagination\n ? Infinity\n : getEffectivePageSize(paginationOptions);\n\n const getData = useStableCallback(getDataProp);\n const { sort, filter, search } = query;\n\n const [items, setItems] = useState<T[] | undefined>(undefined);\n const [isPending, setIsPending] = useState(!data);\n const [error, setError] = useState<Error | undefined>(undefined);\n const [loadCount, setLoadCount] = useState(0);\n\n const [offset, setOffset] = useState(initialOffset);\n const [pageSize, setPageSize] = useState(defaultPageSize);\n\n // Sync pageSize when the caller changes paginationOptions.pageSize\n const previousDefaultPageSize = useRef(defaultPageSize);\n useEffect(() => {\n if (previousDefaultPageSize.current !== defaultPageSize) {\n previousDefaultPageSize.current = defaultPageSize;\n setPageSize(defaultPageSize);\n setOffset(0);\n }\n }, [defaultPageSize]);\n\n // Load data on mount and when loadCount changes (reload trigger)\n useEffect(() => {\n if (data) {\n setIsPending(false);\n return;\n }\n\n if (!hasGetData) {\n setIsPending(true);\n return;\n }\n\n let cancelled = false;\n setIsPending(true);\n setError(undefined);\n\n (async () => {\n try {\n const result = getData();\n const resolvedData = result instanceof Promise ? await result : result;\n if (!cancelled) {\n setItems(resolvedData);\n setIsPending(false);\n }\n } catch (err) {\n if (!cancelled) {\n setError(err instanceof Error ? err : new Error(String(err)));\n setIsPending(false);\n }\n }\n })();\n\n return () => {\n cancelled = true;\n };\n }, [data, getData, hasGetData, loadCount]);\n\n // Debounced surrogates of search and filter feed the processing pipeline.\n // At delayMs === 0 (the default) these are referentially equal to the live\n // values, so behavior is identical to before this refactor.\n const debouncedSearch = useDebouncedValue(search, searchDebounceMs);\n const debouncedFilter = useDebouncedValue(filter, filterDebounceMs);\n\n // Reset offset when the *debounced* query changes — keying on the live query\n // would briefly flash page 1 of unfiltered data while the debounce settles.\n const debouncedQuery = useMemo(\n () => ({ sort, filter: debouncedFilter, search: debouncedSearch }),\n [sort, debouncedFilter, debouncedSearch],\n );\n const prevDebouncedQueryRef = useRef(debouncedQuery);\n useEffect(() => {\n if (prevDebouncedQueryRef.current !== debouncedQuery) {\n prevDebouncedQueryRef.current = debouncedQuery;\n setOffset(0);\n }\n }, [debouncedQuery]);\n\n const resolvedItems = useMemo(() => data ?? items, [data, items]);\n\n // Process data client-side (filter, search, sort)\n const processedData = useMemo(() => {\n if (!resolvedItems) {\n return undefined;\n }\n let result = [...resolvedItems];\n if (debouncedFilter !== undefined && filterFn) {\n result = filterFn(result, debouncedFilter);\n }\n if (debouncedSearch && searchFn) {\n result = searchFn(result, debouncedSearch);\n }\n if (sort && sortFn) {\n result = sortFn(result, sort);\n }\n return result;\n }, [\n resolvedItems,\n sort,\n debouncedFilter,\n debouncedSearch,\n filterFn,\n searchFn,\n sortFn,\n ]);\n\n const previousProcessedDataRef = useRef(processedData);\n if (processedData !== undefined) {\n previousProcessedDataRef.current = processedData;\n }\n const retainedProcessedData =\n processedData ?? previousProcessedDataRef.current;\n\n const totalCount = retainedProcessedData?.length ?? 0;\n\n const effectiveOffset = useMemo(() => {\n if (noPagination) {\n return 0;\n }\n if (retainedProcessedData === undefined) {\n return offset;\n }\n if (totalCount === 0) {\n return 0;\n }\n return Math.min(offset, Math.floor((totalCount - 1) / pageSize) * pageSize);\n }, [noPagination, offset, pageSize, retainedProcessedData, totalCount]);\n\n // Persist the corrected offset so later data growth does not restore it.\n useEffect(() => {\n if (offset !== effectiveOffset) {\n setOffset(effectiveOffset);\n }\n }, [effectiveOffset, offset]);\n\n // Paginate the processed data\n const paginatedData = useMemo(\n () =>\n noPagination\n ? retainedProcessedData\n : retainedProcessedData?.slice(\n effectiveOffset,\n effectiveOffset + pageSize,\n ),\n [retainedProcessedData, effectiveOffset, pageSize, noPagination],\n );\n\n const hasNextPage = !noPagination && effectiveOffset + pageSize < totalCount;\n const hasPreviousPage = !noPagination && effectiveOffset > 0;\n\n const onNextPage = useCallback(() => {\n if (effectiveOffset + pageSize < totalCount) {\n setOffset(effectiveOffset + pageSize);\n }\n }, [effectiveOffset, pageSize, totalCount]);\n\n const onPreviousPage = useCallback(() => {\n if (effectiveOffset > 0) {\n setOffset(Math.max(0, effectiveOffset - pageSize));\n }\n }, [effectiveOffset, pageSize]);\n\n const onPageSizeChange = useCallback((newSize: number) => {\n setPageSize(newSize);\n setOffset(0);\n }, []);\n\n const reload = useCallback(() => {\n setOffset(0);\n setLoadCount(c => c + 1);\n }, []);\n\n return {\n data: paginatedData,\n isPending: isPending,\n error,\n totalCount,\n offset: effectiveOffset,\n pageSize,\n hasNextPage,\n hasPreviousPage,\n onNextPage,\n onPreviousPage,\n onPageSizeChange,\n reload,\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 { useState, useCallback } from 'react';\nimport type { TableItem } from '../types';\nimport type {\n UseTableOffsetOptions,\n OffsetParams,\n QueryState,\n PaginationResult,\n} from './types';\nimport { usePageCache } from './usePageCache';\nimport { useStableCallback } from './useStableCallback';\nimport { useDebouncedReload } from './useDebouncedReload';\nimport { getEffectivePageSize } from './getEffectivePageSize';\n\nexport function useOffsetPagination<T extends TableItem, TFilter>(\n options: UseTableOffsetOptions<T, TFilter>,\n query: QueryState<TFilter>,\n): PaginationResult<T> & { reload: () => void } {\n const { getData: getDataProp, paginationOptions = {} } = options;\n const { initialOffset = 0 } = paginationOptions;\n const defaultPageSize = getEffectivePageSize(paginationOptions);\n\n const getData = useStableCallback(getDataProp);\n const { sort, filter, search } = query;\n\n const [pageSize, setPageSize] = useState(defaultPageSize);\n\n const wrappedGetData = useCallback(\n async ({\n cursor,\n signal,\n }: {\n cursor: number | undefined;\n signal: AbortSignal;\n }) => {\n const currentOffset = cursor ?? 0;\n\n const params: OffsetParams<TFilter> = {\n offset: currentOffset,\n pageSize,\n sort,\n filter,\n search,\n signal,\n };\n\n const response = await getData(params);\n\n const prevCursor =\n currentOffset > 0 ? Math.max(0, currentOffset - pageSize) : undefined;\n const nextCursor =\n currentOffset + pageSize < response.totalCount\n ? currentOffset + pageSize\n : undefined;\n\n return {\n data: response.data,\n prevCursor,\n nextCursor,\n totalCount: response.totalCount,\n };\n },\n [getData, pageSize, sort, filter, search],\n );\n\n const cache = usePageCache<T, number>({\n getData: wrappedGetData,\n initialCurrentCursor: initialOffset > 0 ? initialOffset : undefined,\n });\n\n useDebouncedReload(query, pageSize, cache.reload);\n\n const onPageSizeChange = useCallback(\n (newSize: number) => setPageSize(newSize),\n [],\n );\n\n return {\n data: cache.data,\n isPending: cache.isPending,\n error: cache.error,\n totalCount: cache.totalCount,\n offset: cache.currentCursor ?? 0,\n pageSize,\n hasNextPage: cache.hasNextPage,\n hasPreviousPage: cache.hasPreviousPage,\n onNextPage: cache.onNextPage,\n onPreviousPage: cache.onPreviousPage,\n onPageSizeChange,\n reload: cache.reload,\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 { useState, useCallback } from 'react';\nimport type { TableItem } from '../types';\nimport type {\n UseTableCursorOptions,\n CursorParams,\n QueryState,\n PaginationResult,\n} from './types';\nimport { usePageCache } from './usePageCache';\nimport { useStableCallback } from './useStableCallback';\nimport { useDebouncedReload } from './useDebouncedReload';\nimport { getEffectivePageSize } from './getEffectivePageSize';\n\nexport function useCursorPagination<T extends TableItem, TFilter>(\n options: UseTableCursorOptions<T, TFilter>,\n query: QueryState<TFilter>,\n): PaginationResult<T> & { reload: () => void } {\n const { getData: getDataProp, paginationOptions = {} } = options;\n const defaultPageSize = getEffectivePageSize(paginationOptions);\n\n const getData = useStableCallback(getDataProp);\n const { sort, filter, search } = query;\n\n const [pageSize, setPageSize] = useState(defaultPageSize);\n\n const wrappedGetData = useCallback(\n async ({\n cursor,\n signal,\n }: {\n cursor: string | undefined;\n signal: AbortSignal;\n }) => {\n const params: CursorParams<TFilter> = {\n cursor,\n pageSize,\n sort,\n filter,\n search,\n signal,\n };\n\n const response = await getData(params);\n\n return {\n data: response.data,\n prevCursor: response.prevCursor,\n nextCursor: response.nextCursor,\n totalCount: response.totalCount,\n };\n },\n [getData, pageSize, sort, filter, search],\n );\n\n const cache = usePageCache<T, string>({ getData: wrappedGetData });\n\n useDebouncedReload(query, pageSize, cache.reload);\n\n const onPageSizeChange = useCallback(\n (newSize: number) => setPageSize(newSize),\n [],\n );\n\n return {\n data: cache.data,\n isPending: cache.isPending,\n error: cache.error,\n totalCount: cache.totalCount,\n offset: undefined,\n pageSize,\n hasNextPage: cache.hasNextPage,\n hasPreviousPage: cache.hasPreviousPage,\n onNextPage: cache.onNextPage,\n onPreviousPage: cache.onPreviousPage,\n onPageSizeChange,\n reload: cache.reload,\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 CompoundEntityRef,\n Entity,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport {\n EntityPresentationApi,\n EntityRefPresentationSnapshot,\n} from './EntityPresentationApi';\nimport { defaultEntityPresentation } from './defaultEntityPresentation';\n\n/**\n * Returns a synchronous presentation snapshot for an entity in non-React\n * contexts.\n *\n * @remarks\n *\n * This is the synchronous, non-React counterpart to\n * {@link useEntityPresentation}. It handles `Entity`, `CompoundEntityRef`,\n * and string ref inputs uniformly, using the provided\n * {@link EntityPresentationApi} when available and falling back to\n * {@link defaultEntityPresentation} otherwise.\n *\n * Because this function is synchronous, it uses cached data from the\n * presentation API (via `.snapshot`). If the entity has been seen before,\n * the snapshot will contain the full resolved title; otherwise it falls\n * back to what can be extracted from the ref alone. This is the correct\n * trade-off for sort comparators, column factories, filter callbacks, and\n * data mappers where a synchronous return value is required.\n *\n * In async contexts such as data loaders where you can `await`, prefer\n * using the {@link EntityPresentationApi} directly via\n * `forEntity().promise` for the richest possible presentation.\n *\n * @public\n * @param entityOrRef - An entity, a compound entity ref, or a string entity ref.\n * @param context - Optional context that may affect the presentation.\n * @param entityPresentationApi - Optional presentation API instance. When not\n * provided, falls back to {@link defaultEntityPresentation}.\n */\nexport function entityPresentationSnapshot(\n entityOrRef: Entity | CompoundEntityRef | string,\n context?: { defaultKind?: string; defaultNamespace?: string },\n entityPresentationApi?: EntityPresentationApi,\n): EntityRefPresentationSnapshot {\n if (entityPresentationApi) {\n const ref =\n typeof entityOrRef === 'string' || 'metadata' in entityOrRef\n ? entityOrRef\n : stringifyEntityRef(entityOrRef);\n return entityPresentationApi.forEntity(ref, context).snapshot;\n }\n return defaultEntityPresentation(entityOrRef, context);\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 Entity,\n RELATION_OWNED_BY,\n RELATION_PART_OF,\n} from '@backstage/catalog-model';\nimport { Cell, CellText, Column, ColumnConfig, TableItem } from '@backstage/ui';\nimport { EntityRefLink, EntityRefLinks } from '../EntityRefLink';\nimport {\n entityPresentationSnapshot,\n EntityPresentationApi,\n} from '@backstage/plugin-catalog-react';\nimport { EntityTableColumnTitle } from '../EntityTable/TitleColumn';\nimport { getEntityRelations } from '../../utils';\n\n/** @public */\nexport type EntityRow = Entity & TableItem;\n\n/** @public */\nexport interface EntityColumnConfig extends ColumnConfig<EntityRow> {\n sortValue?: (entity: EntityRow) => string;\n}\n\n/** @public */\nexport const columnFactories = Object.freeze({\n createEntityRefColumn(options: {\n defaultKind?: string;\n isRowHeader?: boolean;\n entityPresentationApi?: EntityPresentationApi;\n }): EntityColumnConfig {\n const isRowHeader = options.isRowHeader ?? true;\n return {\n id: 'name',\n label: 'Name',\n header: () => (\n <Column id=\"name\" isRowHeader={isRowHeader} allowsSorting>\n <EntityTableColumnTitle translationKey=\"name\" />\n </Column>\n ),\n isRowHeader,\n isSortable: true,\n cell: entity => (\n <Cell>\n <EntityRefLink\n entityRef={entity}\n defaultKind={options.defaultKind}\n title={entity.metadata?.title}\n />\n </Cell>\n ),\n sortValue: entity =>\n entityPresentationSnapshot(\n entity,\n { defaultKind: options.defaultKind },\n options.entityPresentationApi,\n ).primaryTitle,\n };\n },\n\n createEntityRelationColumn(options: {\n id: string;\n translationKey: 'owner' | 'system' | 'domain';\n relation: string;\n defaultKind?: string;\n filter?: { kind: string };\n entityPresentationApi?: EntityPresentationApi;\n }): EntityColumnConfig {\n return {\n id: options.id,\n label: options.id.charAt(0).toUpperCase() + options.id.slice(1),\n header: () => (\n <Column id={options.id} allowsSorting>\n <EntityTableColumnTitle translationKey={options.translationKey} />\n </Column>\n ),\n isSortable: true,\n cell: entity => (\n <Cell>\n <EntityRefLinks\n entityRefs={getEntityRelations(\n entity,\n options.relation,\n options.filter,\n )}\n defaultKind={options.defaultKind}\n />\n </Cell>\n ),\n sortValue: entity =>\n getEntityRelations(entity, options.relation, options.filter)\n .map(\n r =>\n entityPresentationSnapshot(\n r,\n { defaultKind: options.defaultKind },\n options.entityPresentationApi,\n ).primaryTitle,\n )\n .join(', '),\n };\n },\n\n createOwnerColumn(): EntityColumnConfig {\n return columnFactories.createEntityRelationColumn({\n id: 'owner',\n translationKey: 'owner',\n relation: RELATION_OWNED_BY,\n defaultKind: 'group',\n });\n },\n\n createSystemColumn(): EntityColumnConfig {\n return columnFactories.createEntityRelationColumn({\n id: 'system',\n translationKey: 'system',\n relation: RELATION_PART_OF,\n defaultKind: 'system',\n filter: { kind: 'system' },\n });\n },\n\n createDomainColumn(): EntityColumnConfig {\n return columnFactories.createEntityRelationColumn({\n id: 'domain',\n translationKey: 'domain',\n relation: RELATION_PART_OF,\n defaultKind: 'domain',\n filter: { kind: 'domain' },\n });\n },\n\n createMetadataDescriptionColumn(): EntityColumnConfig {\n return {\n id: 'description',\n label: 'Description',\n header: () => (\n <Column id=\"description\" allowsSorting>\n <EntityTableColumnTitle translationKey=\"description\" />\n </Column>\n ),\n isSortable: true,\n cell: entity => <CellText title={entity.metadata.description ?? ''} />,\n sortValue: entity => entity.metadata.description ?? '',\n };\n },\n\n createSpecTypeColumn(): EntityColumnConfig {\n return {\n id: 'type',\n label: 'Type',\n header: () => (\n <Column id=\"type\" allowsSorting>\n <EntityTableColumnTitle translationKey=\"type\" />\n </Column>\n ),\n isSortable: true,\n cell: entity => (\n <CellText\n title={\n (entity.spec as Record<string, string> | undefined)?.type ?? ''\n }\n />\n ),\n sortValue: entity =>\n (entity.spec as Record<string, string> | undefined)?.type ?? '',\n };\n },\n\n createSpecLifecycleColumn(): EntityColumnConfig {\n return {\n id: 'lifecycle',\n label: 'Lifecycle',\n header: () => (\n <Column id=\"lifecycle\" allowsSorting>\n <EntityTableColumnTitle translationKey=\"lifecycle\" />\n </Column>\n ),\n isSortable: true,\n cell: entity => (\n <CellText\n title={\n (entity.spec as Record<string, string> | undefined)?.lifecycle ?? ''\n }\n />\n ),\n sortValue: entity =>\n (entity.spec as Record<string, string> | undefined)?.lifecycle ?? '',\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 { columnFactories, EntityColumnConfig } from './columnFactories';\n\n/** @alpha */\nexport const entityColumnPresets = {\n component: {\n columns: [\n columnFactories.createEntityRefColumn({ defaultKind: 'component' }),\n columnFactories.createOwnerColumn(),\n columnFactories.createSpecTypeColumn(),\n columnFactories.createSpecLifecycleColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n ] as EntityColumnConfig[],\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component',\n },\n resource: {\n columns: [\n columnFactories.createEntityRefColumn({ defaultKind: 'resource' }),\n columnFactories.createOwnerColumn(),\n columnFactories.createSpecTypeColumn(),\n columnFactories.createSpecLifecycleColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n ] as EntityColumnConfig[],\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource',\n },\n system: {\n columns: [\n columnFactories.createEntityRefColumn({ defaultKind: 'system' }),\n columnFactories.createOwnerColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n ] as EntityColumnConfig[],\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system',\n },\n domain: {\n columns: [\n columnFactories.createEntityRefColumn({ defaultKind: 'domain' }),\n columnFactories.createOwnerColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n ] as EntityColumnConfig[],\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-domain',\n },\n} as const;\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 { ReactNode } from 'react';\nimport {\n Card,\n CardHeader,\n CardBody,\n CardFooter,\n Text,\n Flex,\n} from '@backstage/ui';\nimport { makeStyles } from '@material-ui/core/styles';\nimport classNames from 'classnames';\n\nconst useStyles = makeStyles({\n root: {\n height: '100%',\n },\n title: {\n minWidth: 0,\n overflow: 'hidden',\n },\n footer: {\n display: 'flex',\n justifyContent: 'flex-end',\n },\n});\n\n/** @public */\nexport interface EntityInfoCardProps {\n title?: ReactNode;\n headerActions?: ReactNode;\n footerActions?: ReactNode;\n children?: ReactNode;\n className?: string;\n}\n\n/** @public */\nexport function EntityInfoCard(props: EntityInfoCardProps) {\n const { title, headerActions, footerActions, children, className } = props;\n const classes = useStyles();\n\n return (\n <Card className={classNames(classes.root, className)}>\n {title && (\n <CardHeader>\n <Flex justify=\"between\" align=\"center\">\n <Text\n as=\"h3\"\n variant=\"title-x-small\"\n weight=\"bold\"\n className={classes.title}\n >\n {title}\n </Text>\n {headerActions && (\n <Flex align=\"center\" gap=\"1\">\n {headerActions}\n </Flex>\n )}\n </Flex>\n </CardHeader>\n )}\n <CardBody>{children}</CardBody>\n {footerActions && (\n <CardFooter className={classes.footer}>{footerActions}</CardFooter>\n )}\n </Card>\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 */\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 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, stringifyEntityRef } from '@backstage/catalog-model';\nimport { Table, useTable } from '@backstage/ui';\nimport { useCallback, useMemo, ReactNode } from 'react';\nimport { EntityRow, EntityColumnConfig } from './columnFactories';\nimport { SortDescriptor } from '@backstage/ui';\n\n/** @public */\nexport interface EntityDataTableProps {\n columnConfig: EntityColumnConfig[];\n data: Entity[];\n loading?: boolean;\n error?: Error;\n emptyState?: ReactNode;\n}\n\n/** @public */\nexport function EntityDataTable(props: EntityDataTableProps) {\n const { columnConfig, data, loading, error, emptyState } = props;\n\n const tableData: EntityRow[] = useMemo(\n () =>\n data.map(entity => ({\n ...entity,\n id: stringifyEntityRef(entity),\n })),\n [data],\n );\n\n const sortFn = useCallback(\n (items: EntityRow[], sort: SortDescriptor) => {\n const column = columnConfig.find(c => c.id === sort.column);\n if (!column?.sortValue) {\n return items;\n }\n const getValue = column.sortValue;\n const direction = sort.direction === 'descending' ? -1 : 1;\n return [...items].sort(\n (a, b) => getValue(a).localeCompare(getValue(b)) * direction,\n );\n },\n [columnConfig],\n );\n\n const { tableProps } = useTable({\n mode: 'complete',\n data: tableData,\n sortFn,\n paginationOptions: { type: 'none' },\n });\n\n return (\n <Table\n columnConfig={columnConfig}\n {...tableProps}\n loading={loading}\n error={error}\n emptyState={emptyState}\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 { Alert, Link, Text } from '@backstage/ui';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { EntityInfoCard } from '../EntityInfoCard';\nimport { EntityDataTable } from '../EntityDataTable';\nimport { EntityColumnConfig } from '../EntityDataTable/columnFactories';\nimport { useEntity, useRelatedEntities } from '../../hooks';\nimport { catalogReactTranslationRef } from '../../translation';\n\n/** @public */\nexport interface EntityRelationCardProps {\n title: string;\n relationType: string;\n entityKind?: string;\n columnConfig: EntityColumnConfig[];\n emptyState?: {\n message: string;\n helpLink?: string;\n };\n className?: string;\n}\n\n/** @public */\nexport function EntityRelationCard(props: EntityRelationCardProps) {\n const {\n title,\n relationType,\n entityKind,\n columnConfig,\n emptyState,\n className,\n } = props;\n const { t } = useTranslationRef(catalogReactTranslationRef);\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: relationType,\n kind: entityKind,\n });\n\n return (\n <EntityInfoCard title={title} className={className}>\n {error ? (\n <Alert status=\"warning\" icon title={error.message} role=\"status\" />\n ) : (\n <EntityDataTable\n columnConfig={columnConfig}\n data={entities ?? []}\n loading={loading}\n emptyState={\n emptyState && (\n <Text as=\"p\">\n {emptyState.message}{' '}\n {emptyState.helpLink && (\n <Link\n href={emptyState.helpLink}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n variant=\"body-medium\"\n >\n {t('entityRelationCard.emptyHelpLinkTitle')}\n </Link>\n )}\n </Text>\n )\n }\n />\n )}\n </EntityInfoCard>\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 RELATION_OWNED_BY,\n RELATION_PART_OF,\n} from '@backstage/catalog-model';\nimport { OverflowTooltip, TableColumn } from '@backstage/core-components';\nimport { getEntityRelations } from '../../utils';\nimport { EntityRefLink, EntityRefLinks } from '../EntityRefLink';\nimport { entityPresentationSnapshot, EntityPresentationApi } from '../../apis';\nimport { EntityTableColumnTitle } from './TitleColumn';\n\n/** @public */\nexport const columnFactories = Object.freeze({\n createEntityRefColumn<T extends Entity>(options: {\n defaultKind?: string;\n entityPresentationApi?: EntityPresentationApi;\n }): TableColumn<T> {\n const { defaultKind, entityPresentationApi } = options;\n function formatContent(entity: T): string {\n return entityPresentationSnapshot(\n entity,\n { defaultKind },\n entityPresentationApi,\n ).primaryTitle;\n }\n\n return {\n title: <EntityTableColumnTitle translationKey=\"name\" />,\n highlight: true,\n customFilterAndSearch(filter, entity) {\n // TODO: We could implement this more efficiently, like searching over\n // each field that is displayed individually (kind, namespace, name).\n // but that might confuse the user as it will behave different than a\n // simple text search.\n // Another alternative would be to cache the values. But writing them\n // into the entity feels bad too.\n return formatContent(entity).includes(filter);\n },\n customSort(entity1, entity2) {\n // TODO: We could implement this more efficiently by comparing field by field.\n // This has similar issues as above.\n return formatContent(entity1).localeCompare(formatContent(entity2));\n },\n render: entity => (\n <EntityRefLink\n entityRef={entity}\n defaultKind={defaultKind}\n title={entity.metadata?.title}\n />\n ),\n };\n },\n createEntityRelationColumn<T extends Entity>(options: {\n title: string | JSX.Element;\n relation: string;\n defaultKind?: string;\n filter?: { kind: string };\n entityPresentationApi?: EntityPresentationApi;\n }): TableColumn<T> {\n const {\n title,\n relation,\n defaultKind,\n filter: entityFilter,\n entityPresentationApi,\n } = options;\n\n function getRelations(entity: T): CompoundEntityRef[] {\n return getEntityRelations(entity, relation, entityFilter);\n }\n\n function formatContent(entity: T): string {\n return getRelations(entity)\n .map(\n r =>\n entityPresentationSnapshot(\n r,\n { defaultKind },\n entityPresentationApi,\n ).primaryTitle,\n )\n .join(', ');\n }\n\n return {\n title,\n customFilterAndSearch(filter, entity) {\n return formatContent(entity).includes(filter);\n },\n customSort(entity1, entity2) {\n return formatContent(entity1).localeCompare(formatContent(entity2));\n },\n render: entity => {\n return (\n <EntityRefLinks\n entityRefs={getRelations(entity)}\n defaultKind={defaultKind}\n />\n );\n },\n };\n },\n createOwnerColumn<T extends Entity>(): TableColumn<T> {\n return this.createEntityRelationColumn({\n title: <EntityTableColumnTitle translationKey=\"owner\" />,\n relation: RELATION_OWNED_BY,\n defaultKind: 'group',\n });\n },\n createDomainColumn<T extends Entity>(): TableColumn<T> {\n return this.createEntityRelationColumn({\n title: <EntityTableColumnTitle translationKey=\"domain\" />,\n relation: RELATION_PART_OF,\n defaultKind: 'domain',\n filter: {\n kind: 'domain',\n },\n });\n },\n createSystemColumn<T extends Entity>(): TableColumn<T> {\n return this.createEntityRelationColumn({\n title: <EntityTableColumnTitle translationKey=\"system\" />,\n relation: RELATION_PART_OF,\n defaultKind: 'system',\n filter: {\n kind: 'system',\n },\n });\n },\n createMetadataDescriptionColumn<T extends Entity>(): TableColumn<T> {\n return {\n title: <EntityTableColumnTitle translationKey=\"description\" />,\n field: 'metadata.description',\n render: entity => (\n <OverflowTooltip\n text={entity.metadata.description}\n placement=\"bottom-start\"\n line={2}\n />\n ),\n };\n },\n createSpecLifecycleColumn<T extends Entity>(): TableColumn<T> {\n return {\n title: <EntityTableColumnTitle translationKey=\"lifecycle\" />,\n field: 'spec.lifecycle',\n };\n },\n createSpecTypeColumn<T extends Entity>(): TableColumn<T> {\n return {\n title: <EntityTableColumnTitle translationKey=\"type\" />,\n field: 'spec.type',\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 { ComponentEntity, SystemEntity } from '@backstage/catalog-model';\nimport { TableColumn } from '@backstage/core-components';\nimport { columnFactories } from './columns';\n\nexport const systemEntityColumns: TableColumn<SystemEntity>[] = [\n columnFactories.createEntityRefColumn({ defaultKind: 'system' }),\n columnFactories.createDomainColumn(),\n columnFactories.createOwnerColumn(),\n columnFactories.createMetadataDescriptionColumn(),\n];\n\nexport const componentEntityColumns: TableColumn<ComponentEntity>[] = [\n columnFactories.createEntityRefColumn({ defaultKind: 'component' }),\n columnFactories.createSystemColumn(),\n columnFactories.createOwnerColumn(),\n columnFactories.createSpecTypeColumn(),\n columnFactories.createSpecLifecycleColumn(),\n columnFactories.createMetadataDescriptionColumn(),\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 } from '@backstage/catalog-model';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { CSSProperties, ReactNode } from 'react';\nimport { columnFactories } from './columns';\nimport { componentEntityColumns, systemEntityColumns } from './presets';\nimport {\n InfoCardVariants,\n Table,\n TableColumn,\n TableOptions,\n} from '@backstage/core-components';\n\n/**\n * Props for {@link EntityTable}.\n *\n * @public\n */\nexport interface EntityTableProps<T extends Entity> {\n title: string;\n variant?: InfoCardVariants;\n entities: T[];\n emptyContent?: ReactNode;\n columns: TableColumn<T>[];\n tableOptions?: TableOptions;\n}\n\nconst useStyles = makeStyles(theme => ({\n empty: {\n padding: theme.spacing(2),\n display: 'flex',\n justifyContent: 'center',\n },\n}));\n\n/**\n * A general entity table component, that can be used for composing more\n * specific entity tables.\n *\n * @public\n */\nexport const EntityTable = <T extends Entity>(props: EntityTableProps<T>) => {\n const {\n entities,\n title,\n emptyContent,\n variant = 'gridItem',\n columns,\n tableOptions = {},\n } = props;\n\n const classes = useStyles();\n const tableStyle: CSSProperties = {\n minWidth: '0',\n width: '100%',\n };\n\n if (variant === 'gridItem') {\n tableStyle.height = 'calc(100% - 10px)';\n }\n\n return (\n <Table<T>\n columns={columns}\n title={title}\n style={tableStyle}\n emptyContent={\n emptyContent && <div className={classes.empty}>{emptyContent}</div>\n }\n options={{\n // TODO: Toolbar padding if off compared to other cards, should be: padding: 16px 24px;\n search: false,\n paging: false,\n actionsColumnIndex: -1,\n padding: 'dense',\n draggable: false,\n ...tableOptions,\n }}\n data={entities}\n />\n );\n};\n\nEntityTable.columns = columnFactories;\n\nEntityTable.systemEntityColumns = systemEntityColumns;\n\nEntityTable.componentEntityColumns = componentEntityColumns;\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 { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { catalogReactTranslationRef } from '../../translation';\n\n/**\n * @alpha\n */\nexport type EntityTableColumnTitleProps = {\n translationKey:\n | 'name'\n | 'system'\n | 'owner'\n | 'type'\n | 'lifecycle'\n | 'namespace'\n | 'description'\n | 'tags'\n | 'targets'\n | 'title'\n | 'label'\n | 'domain';\n};\n\n/**\n * @alpha\n */\nexport const EntityTableColumnTitle = ({\n translationKey,\n}: EntityTableColumnTitleProps) => {\n const { t } = useTranslationRef(catalogReactTranslationRef);\n return t(`entityTableColumnTitle.${translationKey}`);\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, parseEntityRef } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport useAsync from 'react-use/esm/useAsync';\nimport { catalogApiRef } from '../api';\n\n/**\n * Fetches all entities that appear in the entity's relations, optionally\n * filtered by relation type and kind.\n *\n * @public\n */\nexport function useRelatedEntities(\n entity: Entity,\n relationFilter: { type?: string; kind?: string },\n): {\n entities: Entity[] | undefined;\n loading: boolean;\n error: Error | undefined;\n} {\n const filterByTypeLower = relationFilter?.type?.toLowerCase();\n const filterByKindLower = relationFilter?.kind?.toLowerCase();\n const catalogApi = useApi(catalogApiRef);\n\n const {\n loading,\n value: entities,\n error,\n } = useAsync(async () => {\n const relations = entity.relations?.filter(\n r =>\n (!filterByTypeLower || r.type.toLowerCase() === filterByTypeLower) &&\n (!filterByKindLower ||\n parseEntityRef(r.targetRef).kind === filterByKindLower),\n );\n\n if (!relations?.length) {\n return [];\n }\n\n const { items } = await catalogApi.getEntitiesByRefs({\n entityRefs: relations.map(r => r.targetRef),\n });\n\n return items.filter((x): x is Entity => Boolean(x));\n }, [entity, filterByTypeLower, filterByKindLower]);\n\n return {\n entities,\n loading,\n error,\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 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 { RELATION_HAS_PART, ResourceEntity } from '@backstage/catalog-model';\nimport {\n InfoCardVariants,\n TableColumn,\n TableOptions,\n} from '@backstage/core-components';\nimport {\n EntityRelationCard,\n EntityColumnConfig,\n entityColumnPresets,\n} from '@backstage/plugin-catalog-react/alpha';\nimport {\n asResourceEntities,\n resourceEntityColumns,\n resourceEntityHelpLink as legacyHelpLink,\n RelatedEntitiesCard,\n} from '../RelatedEntitiesCard';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport interface HasResourcesCardProps {\n title?: string;\n columnConfig?: EntityColumnConfig[];\n}\n\n/**\n * Props for the legacy MUI-based rendering.\n * @deprecated Use {@link HasResourcesCardProps} instead.\n * @public\n */\nexport interface HasResourcesCardLegacyProps {\n title?: string;\n /** @deprecated Use `columnConfig` instead. */\n variant?: InfoCardVariants;\n /** @deprecated Use `columnConfig` instead. */\n columns?: TableColumn<ResourceEntity>[];\n /** @deprecated Use `columnConfig` instead. */\n tableOptions?: TableOptions;\n}\n\nfunction isLegacyProps(\n props: HasResourcesCardProps | HasResourcesCardLegacyProps,\n): props is HasResourcesCardLegacyProps {\n return 'variant' in props || 'columns' in props || 'tableOptions' in props;\n}\n\nexport function HasResourcesCard(\n props: HasResourcesCardProps | HasResourcesCardLegacyProps,\n) {\n const { t } = useTranslationRef(catalogTranslationRef);\n\n if (isLegacyProps(props)) {\n const {\n variant = 'gridItem',\n title = t('hasResourcesCard.title'),\n columns = resourceEntityColumns,\n tableOptions = {},\n } = props;\n return (\n <RelatedEntitiesCard\n variant={variant}\n title={title}\n entityKind=\"Resource\"\n relationType={RELATION_HAS_PART}\n columns={columns}\n emptyMessage={t('hasResourcesCard.emptyMessage')}\n emptyHelpLink={legacyHelpLink}\n asRenderableEntities={asResourceEntities}\n tableOptions={tableOptions}\n />\n );\n }\n\n const {\n title = t('hasResourcesCard.title'),\n columnConfig = entityColumnPresets.resource.columns,\n } = props;\n return (\n <EntityRelationCard\n title={title}\n entityKind=\"Resource\"\n relationType={RELATION_HAS_PART}\n columnConfig={columnConfig}\n emptyState={{\n message: t('hasResourcesCard.emptyMessage'),\n helpLink: entityColumnPresets.resource.helpLink,\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 { Entity } from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport {\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n ResponseErrorPanel,\n TableColumn,\n TableOptions,\n} from '@backstage/core-components';\nimport {\n asComponentEntities,\n asDomainEntities,\n asResourceEntities,\n asSystemEntities,\n componentEntityColumns,\n componentEntityHelpLink,\n domainEntityColumns,\n domainEntityHelpLink,\n resourceEntityColumns,\n resourceEntityHelpLink,\n systemEntityColumns,\n systemEntityHelpLink,\n} from './presets';\nimport { catalogTranslationRef } from '../../alpha/translation';\nimport { useTranslationRef } from '@backstage/core-plugin-api/alpha';\n\n/** @public */\nexport type RelatedEntitiesCardProps<T extends Entity> = {\n variant?: InfoCardVariants;\n title: string;\n columns: TableColumn<T>[];\n entityKind?: string;\n relationType: string;\n emptyMessage: string;\n emptyHelpLink: string;\n asRenderableEntities: (entities: Entity[]) => T[];\n tableOptions?: TableOptions;\n};\n\n/**\n * A low level card component that can be used as a building block for more\n * specific cards.\n *\n * @remarks\n *\n * You probably want to make a dedicated component for your needs, which renders\n * this card as its implementation with some of the props set to the appropriate\n * values.\n *\n * @deprecated Use {@link @backstage/plugin-catalog-react/alpha#EntityRelationCard} instead.\n * @public\n */\nexport const RelatedEntitiesCard = <T extends Entity>(\n props: RelatedEntitiesCardProps<T>,\n) => {\n const {\n variant = 'gridItem',\n title,\n columns,\n entityKind,\n relationType,\n emptyMessage,\n emptyHelpLink,\n asRenderableEntities,\n tableOptions = {},\n } = props;\n const { t } = useTranslationRef(catalogTranslationRef);\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: relationType,\n kind: entityKind,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error) {\n return (\n <InfoCard variant={variant} title={title}>\n <ResponseErrorPanel error={error} />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title={title}\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">{emptyMessage}</Typography>\n <Typography variant=\"body2\">\n <Link to={emptyHelpLink} externalLinkIcon>\n {t('relatedEntitiesCard.emptyHelpLinkTitle')}\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n entities={asRenderableEntities(entities || [])}\n tableOptions={tableOptions}\n />\n );\n};\n\nRelatedEntitiesCard.componentEntityColumns = componentEntityColumns;\nRelatedEntitiesCard.componentEntityHelpLink = componentEntityHelpLink;\nRelatedEntitiesCard.asComponentEntities = asComponentEntities;\nRelatedEntitiesCard.resourceEntityColumns = resourceEntityColumns;\nRelatedEntitiesCard.resourceEntityHelpLink = resourceEntityHelpLink;\nRelatedEntitiesCard.asResourceEntities = asResourceEntities;\nRelatedEntitiesCard.systemEntityColumns = systemEntityColumns;\nRelatedEntitiesCard.systemEntityHelpLink = systemEntityHelpLink;\nRelatedEntitiesCard.asSystemEntities = asSystemEntities;\nRelatedEntitiesCard.domainEntityColumns = domainEntityColumns;\n/**\n * @deprecated Use `RelatedEntitiesCard.domainEntityColumns` instead. This was a typo in the original property name.\n */\nRelatedEntitiesCard.domainEntityColums = domainEntityColumns;\nRelatedEntitiesCard.domainEntityHelpLink = domainEntityHelpLink;\nRelatedEntitiesCard.asDomainEntities = asDomainEntities;\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 */\nimport {\n ComponentEntity,\n DomainEntity,\n Entity,\n ResourceEntity,\n SystemEntity,\n} from '@backstage/catalog-model';\nimport { EntityTable } from '@backstage/plugin-catalog-react';\nimport { TableColumn } from '@backstage/core-components';\n\nexport const componentEntityColumns: TableColumn<ComponentEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'component' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const componentEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-component';\nexport const asComponentEntities = (entities: Entity[]): ComponentEntity[] =>\n entities as ComponentEntity[];\n\nexport const resourceEntityColumns: TableColumn<ResourceEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'resource' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createSpecTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const resourceEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-resource';\nexport const asResourceEntities = (entities: Entity[]): ResourceEntity[] =>\n entities as ResourceEntity[];\n\nexport const systemEntityColumns: TableColumn<SystemEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'system' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const systemEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-system';\nexport const asSystemEntities = (entities: Entity[]): SystemEntity[] =>\n entities as SystemEntity[];\n\nexport const domainEntityColumns: TableColumn<DomainEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'domain' }),\n EntityTable.columns.createOwnerColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\nexport const domainEntityHelpLink: string =\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-domain';\nexport const asDomainEntities = (entities: Entity[]): DomainEntity[] =>\n entities as DomainEntity[];\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","LinkWrapper","forwardRef","props","ref","UnstyledLink","LinkButton","MaterialButton","useStyles","makeStyles","line","OverflowTooltip","classes","Tooltip","Typography","theme","createStyles","SvgIcon","BootstrapInput","withStyles","InputBase","SelectComponent","multiple","items","placeholder","selected","onChange","triggerReset","native","disabled","margin","dataTestId","setValue","useState","isOpen","setOpen","useEffect","Box","FormControl","InputLabel","Select","event","previous","HTMLElement","s","selectedValue","item","el","Chip","CancelIcon","newValue","chip","OpenedDropdown","ClosedDropdown","MenuItem","Checkbox","useFilterStyles","Filters","onChangeFilters","t","useTranslationRef","coreComponentsTranslationRef","selectedFilters","setSelectedFilters","reset","Button","filter","TableLoadingBody","CircularProgress","tableIcons","AddBox","Check","Clear","DeleteOutline","ChevronRight","Edit","SaveAlt","FilterList","FirstPage","LastPage","ChevronLeft","Search","ArrowUpward","Remove","ViewColumn","extractValueByField","data","path","i","StyledMTableHeader","MTableHeader","StyledMTableToolbar","MTableToolbar","useTableStyles","defaultInitialState","TableToolbar","toolbarProps","toolbarRef","setSearch","hasFilters","selectedFiltersLength","toggleFilters","filtersClasses","onSearchChanged","useCallback","searchText","IconButton","Table","filterConfig","dataValue","columns","emptyContent","title","subtitle","localization","filters","initialState","onStateChange","components","loading","style","restProps","tableClasses","useTheme","calculatedInitialState","filtersOpen","setFiltersOpen","search","state","transform","key","isEqual","defaultState","getFieldByTitle","titleValue","tableData","useMemo","selectedFiltersArray","filterValue","fieldValue","Toolbar","hasNoRows","columnCount","Body","makeBody","bodyProps","MTableBody","distinctValues","addValue","c","MTable","column","headerStyle","cellStyle","cellStyleFn","rowData","rowColumn","BottomLink","link","onClick","Divider","Link","ArrowIcon","SlackLink","slackChannel","ErrorBoundary","Component","errorInfo","console","children","ErrorPanel","CardActionsTopRight","CardActions","InfoCard","subheader","divider","deepLink","errorBoundaryProps","variant","alignContent","headerProps","icon","action","actionsClassName","actions","cardClassName","actionsTopRight","className","noPadding","titleTypographyProps","subheaderTypographyProps","calculatedStyle","calculatedCardStyle","variants","VARIANT_STYLES","Card","CardHeader","classNames","CardContent","CardDefinition","defineComponent","styles","CardHeaderDefinition","CardBodyDefinition","CardFooterDefinition","ownProps","dataAttributes","utilityStyle","useDefinition","onPress","href","linkTarget","rel","download","isInteractive","triggerRef","useRef","handleClick","e","targetNode","targetElement","Element","window","MouseEvent","RAButton","CardBody","CardFooter","CheckboxDefinition","ariaLabel","ariaLabelledBy","RACheckbox","isIndeterminate","RiSubtractLine","RiCheckLine","SelectDefinition","SelectTriggerDefinition","SelectContentDefinition","SelectListBoxDefinition","SelectListBoxItemDefinition","SelectItemDefinition","SelectItemTextDefinition","SelectSectionDefinition","FieldLabelDefinition","FieldLabel","secondaryLabel","description","htmlFor","id","descriptionId","descriptionSlot","Label","Text","FieldErrorDefinition","FieldError","AriaFieldError","PopoverDefinition","Popover","hideArrow","svgPathId","useId","AriaPopover","trigger","OverlayArrow","BgReset","SelectTrigger","SelectValue","isPlaceholder","selectedText","defaultChildren","RiArrowDownSLine","normalizeOption","option","normalizeOptions","getItemKeys","toSelection","SelectItemView","definitionResult","navigation","showSelectionIndicator","navigationProps","getReactAriaAnchorProps","ListBoxItem","values","content","SelectItem","Navigation","useDelayedVisibility","isVisible","delayMs","isDelayedVisible","setIsDelayedVisible","timer","setTimeout","clearTimeout","loadingRowWidths","LoadingRows","count","rowClassName","width","Skeleton","NoResults","PlainOptionItem","legacyOptionClasses","clsx","SelectSectionItems","section","ListBoxSection","Header","renderSelectOption","SelectCollection","normalizedOptions","retainedOptions","dependencies","Collection","SelectEmptyState","isLoading","SelectLoadMoreIndicator","isCollectionLoading","isIndicatorVisible","onLoadMore","ListBoxLoadMoreItem","SelectListBox","isStale","isBusy","showStale","showLoadMoreIndicator","listBox","ListBox","SelectContent","contains","useFilter","visibleIds","searchProps","getSearchFilter","_textValue","_inputValue","node","inputValue","textValue","Autocomplete","SearchField","Input","RiCloseCircleLine","searchable","searchPlaceholder","isRequired","resolvedSearch","resolveSelectSearch","collectionSource","resolveCollectionSource","plainOptions","flatOptions","asyncOptions","controlledValue","defaultValue","trackedSelection","useTrackedSelectionKeys","selectedKeys","defaultSelectedKeys","onSelectionChange","uncontrolledSelectedKeys","setUncontrolledSelectedKeys","keys","collection","useCollectionAdapter","retainSelectedItems","asyncSource","sourceItems","retainedItems","Map","source","selectedIdSet","isServerSearch","sourceIds","canonicalItems","resolvedLoading","onInputChange","getRetainedOptions","renderedItems","contentSearch","AriaSelect","SkeletonDefinition","height","Cell","CellDefinition","ReactAriaCell","CellText","CellTextDefinition","color","leadingIcon","Column","ColumnDefinition","ReactAriaColumn","allowsSorting","RiArrowUpLine","TableRoot","TableDefinition","BUIRoutingProvider","ReactAriaTable","TableHeader","selectionBehavior","selectionMode","useTableOptions","TableHeaderDefinition","ReactAriaTableHeader","Flex","TableBody","TableBodyDefinition","ReactAriaTableBody","Row","analytics","RowDefinition","rawHref","isExternal","isExternalLink","hasInternalHref","hasExternalHref","hasInteraction","effectiveTarget","effectiveRel","Boolean","handlePress","String","ReactAriaRow","TablePaginationDefinition","getOptionValue","TablePagination","pageSize","pageSizeOptions","offset","totalCount","hasNextPage","hasPreviousPage","onNextPage","onPreviousPage","onPageSizeChange","showPageSizeOptions","getLabel","showPaginationLabel","labelId","effectivePageSize","opt","firstValue","showLabel","hasItems","fromCount","toCount","Math","newPageSize","Number","ButtonIcon","RiArrowLeftSLine","RiArrowRightSLine","SKELETON_WIDTHS","skeletonItems","_","TableBodySkeleton","rowIndex","columnConfig","isPending","pagination","sort","rowConfig","selection","emptyState","virtualized","elem","TableWrapperDefinition","liveRegionId","visibleColumns","col","disabledRows","useDisabledRows","set","isDisabled","isInitialLoading","pending","liveRegionLabel","useLiveRegionLabel","hasData","wrapResizable","manualColumnSizing","ResizableTableContainer","VisuallyHidden","itemIndex","Virtualizer","TableLayout","useControlledStateHelper","initialValue","internalValue","setInternalValue","useStableCallback","fn","args","useDebouncedValue","debounced","setDebounced","getEffectivePageSize","paginationOptions","FIRST_PAGE_CURSOR","Symbol","PageCacheStore","cursor","existing","entry","direction","currentCursor","initialCurrentCursor","toInternalCursor","currentEntry","toExternalCursor","usePageCache","getData","setCurrentCursor","cacheStore","setIsPending","setError","setTotalCount","notifyCacheUpdate","useReducer","abortControllerRef","currentPage","goToPage","targetCursor","existingEntry","abortController","AbortController","err","Error","page","reload","reloadOptions","useDebouncedReload","query","delay","prevDepsRef","prev","useTable","useQueryState","setSort","setFilter","initialModeRef","useCompletePagination","getDataProp","sortFn","filterFn","searchFn","searchDebounceMs","filterDebounceMs","hasGetData","noPagination","initialOffset","defaultPageSize","Infinity","setItems","loadCount","setLoadCount","setOffset","setPageSize","previousDefaultPageSize","cancelled","resolvedData","Promise","debouncedSearch","debouncedFilter","debouncedQuery","prevDebouncedQueryRef","resolvedItems","processedData","previousProcessedDataRef","retainedProcessedData","effectiveOffset","paginatedData","newSize","useOffsetPagination","cache","signal","currentOffset","response","prevCursor","nextCursor","useCursorPagination","tableProps","useTableProps","paginationResult","sortState","onPageSizeChangeCallback","onNextPageCallback","onPreviousPageCallback","previousDataRef","displayData","size","entityPresentationSnapshot","entityOrRef","context","entityPresentationApi","stringifyEntityRef","defaultEntityPresentation","columnFactories","isRowHeader","EntityTableColumnTitle","entity","EntityRefLink","EntityRefLinks","getEntityRelations","r","entityColumnPresets","EntityInfoCard","headerActions","footerActions","entityRefs","hideIcons","linkProps","entityRefString","Fragment","EntityDataTable","getValue","a","EntityRelationCard","relationType","entityKind","catalogReactTranslationRef","useEntity","entities","useRelatedEntities","Alert","defaultKind","formatContent","entity1","entity2","entityFilter","getRelations","systemEntityColumns","componentEntityColumns","EntityTable","tableOptions","tableStyle","translationKey","relationFilter","filterByTypeLower","filterByKindLower","catalogApi","useApi","catalogApiRef","useAsync","relations","parseEntityRef","entityNames","HasResourcesCard","catalogTranslationRef","resourceEntityColumns","RelatedEntitiesCard","legacyHelpLink","asResourceEntities","emptyMessage","emptyHelpLink","asRenderableEntities","Progress","ResponseErrorPanel","componentEntityHelpLink","asComponentEntities","resourceEntityHelpLink","systemEntityHelpLink","asSystemEntities","domainEntityColumns","domainEntityHelpLink","asDomainEntities"],"mappings":"sIAEA,IAAI,EAAyB,EAAQ,MA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