{"version":3,"file":"chunk-Show.mjs","names":["_Fragment"],"sources":["../../src/flow/Show.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport React, { type ReactNode } from 'react';\n\nexport type ShowProps<T> = {\n  /** Children render while this is present — anything except `undefined`/`null`/`false` (ui-template's `present`). */\n  when: T | undefined | null | false;\n  /** Rendered while `when` is absent. */\n  fallback?: ReactNode;\n  /** A render prop receives the narrowed value and defers evaluation to the taken branch. */\n  children: ReactNode | ((value: T) => ReactNode);\n};\n\n/**\n * Structural conditional rendering after Solid's `<Show>` and the ui-template `show`/`fallback`\n * grammar: the untaken branch is never rendered, not hidden.\n *\n * @example\n * ```tsx\n * <Show when={task} fallback={<EmptyState />}>\n *   {(task) => <TaskForm task={task} />}\n * </Show>\n * ```\n */\nexport const Show = <T,>({ when, fallback = null, children }: ShowProps<T>): ReactNode => {\n  if (when === undefined || when === null || when === false) {\n    return <>{fallback}</>;\n  }\n\n  return <>{typeof children === 'function' ? children(when) : children}</>;\n};\n\nShow.displayName = 'Show';\n"],"mappings":";;;;;;;;;;;;;;;;AA4BA,IAAa,QAAY,EAAE,MAAM,WAAW,MAAM,eAAwC;CACxF,IAAI,SAAS,KAAA,KAAa,SAAS,QAAQ,SAAS,OAClD,OAAO,oBAAAA,YAAA,EAAA,UAAG,SAAW,CAAA;CAGvB,OAAO,oBAAAA,YAAA,EAAA,UAAG,OAAO,aAAa,aAAa,SAAS,IAAI,IAAI,SAAW,CAAA;AACzE;AAEA,KAAK,cAAc"}