{"version":3,"names":["DialogHandle","DialogStore","createAlertDialogHandle"],"sources":["handle.ts"],"sourcesContent":["/**\n * Alert-dialog handle factory — mirrors Base UI React's\n * `createAlertDialogHandle`.\n *\n * Constructs a `DialogHandle` whose store is shape-compatible with\n * `<AlertDialog.Root>`. At runtime the handle is a plain `DialogHandle`;\n * only the store's default configuration differs (modal,\n * disablePointerDismissal, role=alertdialog). In the Solid port those\n * knobs are imposed by `<AlertDialog.Root>` itself (the root forces\n * `modal: true` / `disablePointerDismissal: true` regardless of store\n * state), so the handle is a bare `DialogHandle`.\n *\n * TypeScript-only `__brand` phantom discriminator:\n *\n * The `AlertDialogHandle<Payload>` type is a nominal branding of\n * `DialogHandle<Payload>` via a `declare readonly __brand:\n * \"AlertDialogHandle\"` phantom property. The property does not exist at\n * runtime — it only exists in the type system — so structural assignment\n * from a plain `DialogHandle` into an `AlertDialogHandle`-typed slot is\n * rejected. Branded handles remain assignable *to* `DialogHandle`-typed\n * slots (the Dialog `Trigger` re-exported under the `AlertDialog`\n * namespace accepts this), but a `DialogHandle` created via\n * `Dialog.createHandle()` cannot be passed where an `AlertDialogHandle`\n * is required.\n */\n\nimport { DialogHandle, DialogStore } from \"../dialog/store/dialog-store\";\n\n/**\n * Nominal (brand-typed) alias of `DialogHandle<Payload>` used by\n * `<AlertDialog.Root>` / `AlertDialog.createHandle`. Identical shape to\n * `DialogHandle` at runtime; the phantom `__brand` property exists only\n * in the type system so a plain `DialogHandle` cannot be passed where an\n * `AlertDialogHandle` is expected.\n */\nexport type AlertDialogHandle<Payload = unknown> = DialogHandle<Payload> & {\n\t/** @internal phantom discriminator — does not exist at runtime. */\n\treadonly __brand: \"AlertDialogHandle\";\n};\n\nexport function createAlertDialogHandle<\n\tPayload = unknown,\n>(): AlertDialogHandle<Payload> {\n\treturn new DialogHandle<Payload>(\n\t\tnew DialogStore<Payload>(),\n\t) as AlertDialogHandle<Payload>;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,YAAY,EAAEC,WAAW,QAAQ,8BAA8B;;AAExE;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,OAAO,SAASC,uBAAuBA,CAAA,EAEP;EAC/B,OAAO,IAAIF,YAAY,CACtB,IAAIC,WAAW,CAAU,CAC1B,CAAC;AACF","ignoreList":[]}