{"version":3,"file":"condition.cjs","names":["NodeType"],"sources":["../../../../src/transpiler/condition/condition.ts"],"sourcesContent":["import { formatNodeType, NodeType, type TypedNodeModel } from '@intlayer/types';\n\nexport type ConditionContentStates<Content> = Record<`${boolean}`, Content> & {\n  fallback?: Content;\n};\n\nexport type ConditionContent<Content = unknown> = TypedNodeModel<\n  NodeType.Condition,\n  ConditionContentStates<Content>\n>;\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow to pick a content based on a condition.\n *\n * Usage:\n *\n * ```ts\n * cond({\n *  'true': 'The condition is validated',\n *  'false': 'The condition is not validated',\n * });\n * ```\n *\n * The last key provided will be used as the fallback value.\n *\n */\nconst condition = <Content>(content?: ConditionContentStates<Content>) =>\n  formatNodeType(NodeType.Condition, content);\n\nexport { condition as cond };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,aAAsB,iDACXA,0BAAS,WAAW,QAAQ"}