{"version":3,"file":"component.mjs","sourceRoot":"","sources":["../../src/ui/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,8BAA8B;AAC3C,OAAO,EAAE,YAAY,EAAE,wBAAwB;AAE/C,OAAO,EAAE,eAAe,EAAE,+BAAqB;AAG/C;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,OAAO,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;AACpC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,YAAY,CAAC,KAAK,EAAE,eAAe,EAAE,mBAAmB,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["import { is } from '@metamask/superstruct';\nimport { assertStruct } from '@metamask/utils';\n\nimport { ComponentStruct } from './components';\nimport type { Component } from './components';\n\n/**\n * Check if the given value is a {@link Component}. This performs recursive\n * validation of the component's children (if any).\n *\n * @param value - The value to check.\n * @returns `true` if the value is a {@link Component}, `false` otherwise.\n */\nexport function isComponent(value: unknown): value is Component {\n  return is(value, ComponentStruct);\n}\n\n/**\n * Assert that the given value is a {@link Component}. This performs recursive\n * validation of the component's children (if any).\n *\n * @param value - The value to check.\n * @throws If the value is not a {@link Component}.\n */\nexport function assertIsComponent(value: unknown): asserts value is Component {\n  assertStruct(value, ComponentStruct, 'Invalid component');\n}\n"]}