{"version":3,"file":"nodes.mjs","sourceRoot":"","sources":["../../src/ui/nodes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,8BAA8B;AAExE;;;;GAIG;AACH,MAAM,CAAN,IAAY,QAaX;AAbD,WAAY,QAAQ;IAClB,iCAAqB,CAAA;IACrB,+BAAmB,CAAA;IACnB,+BAAmB,CAAA;IACnB,2BAAe,CAAA;IACf,+BAAmB,CAAA;IACnB,yBAAa,CAAA;IACb,2BAAe,CAAA;IACf,uBAAW,CAAA;IACX,+BAAmB,CAAA;IACnB,6BAAiB,CAAA;IACjB,2BAAe,CAAA;IACf,yBAAa,CAAA;AACf,CAAC,EAbW,QAAQ,KAAR,QAAQ,QAanB;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC;IAC/B,IAAI,EAAE,MAAM,EAAE;CACf,CAAC,CAAC;AAWH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CACjC,UAAU,EACV,MAAM,CAAC;IACL,KAAK,EAAE,OAAO,EAAE;CACjB,CAAC,CACH,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { assign, object, string, unknown } from '@metamask/superstruct';\n\n/**\n * The supported node types. This is based on SIP-7.\n *\n * @see https://metamask.github.io/SIPs/SIPS/sip-7\n */\nexport enum NodeType {\n  Copyable = 'copyable',\n  Divider = 'divider',\n  Heading = 'heading',\n  Panel = 'panel',\n  Spinner = 'spinner',\n  Text = 'text',\n  Image = 'image',\n  Row = 'row',\n  Address = 'address',\n  Button = 'button',\n  Input = 'input',\n  Form = 'form',\n}\n\n/**\n * @internal\n */\nexport const NodeStruct = object({\n  type: string(),\n});\n\n/**\n * The base node type. All nodes extend this type.\n *\n * @property type - The type of the node. See {@link NodeType} for the supported\n * node types.\n * @internal\n */\nexport type Node = Infer<typeof NodeStruct>;\n\n/**\n * @internal\n */\nexport const LiteralStruct = assign(\n  NodeStruct,\n  object({\n    value: unknown(),\n  }),\n);\n\n/**\n * A node with a value. This is used for nodes that render a value, such as\n * {@link Text}.\n *\n * @property type - The type of the node.\n * @property value - The value of the node. The type of the value depends on the\n * node type.\n * @internal\n */\nexport type Literal = Infer<typeof LiteralStruct>;\n"]}