{"version":3,"names":["readOption","createToast","ToastProviderContext","ToastProvider","props","toast","timeout","limit","toastManager","store","children"],"sources":["toast-provider.tsx"],"sourcesContent":["import type { JSX } from \"@solidjs/web\";\n\nimport { type MaybeAccessor, readOption } from \"../../internals/maybe-accessor\";\nimport { createToast } from \"../create-toast\";\nimport type { ToastManager } from \"../create-toast-manager\";\nimport { ToastProviderContext } from \"./toast-provider-context\";\n\nexport interface ToastProviderProps {\n\tchildren?: JSX.Element;\n\t/**\n\t * Default auto-dismiss duration (ms). `0` disables auto-dismiss.\n\t * @default 5000\n\t */\n\ttimeout?: MaybeAccessor<number | undefined>;\n\t/**\n\t * Maximum number of toasts visible at once. Oldest toasts beyond the\n\t * limit are marked `limited` so consumers can animate them out.\n\t * @default 3\n\t */\n\tlimit?: MaybeAccessor<number | undefined>;\n\t/**\n\t * Optional standalone manager created via {@link createToastManager}.\n\t * Events emitted by the manager are forwarded into this provider's\n\t * store, letting code outside the component tree add / close / update\n\t * toasts.\n\t */\n\ttoastManager?: ToastManager | undefined;\n}\n\n/**\n * Root of the toast system — composes {@link createToast} and exposes the\n * store via context so descendants can call `useToastManager()` or render the\n * viewport.\n *\n * All queue logic lives in `createToast`; this component is a thin JSX wrapper\n * that binds the headless primitive to the existing `ToastProviderContext`\n * surface consumed by `Toast.Viewport`, `Toast.Root`, `Toast.Close`, etc.\n */\nexport function ToastProvider(props: ToastProviderProps): JSX.Element {\n\tconst toast = createToast({\n\t\tget timeout() {\n\t\t\treturn readOption(props.timeout);\n\t\t},\n\t\tget limit() {\n\t\t\treturn readOption(props.limit);\n\t\t},\n\t\tget toastManager() {\n\t\t\treturn props.toastManager;\n\t\t},\n\t});\n\n\treturn (\n\t\t<ToastProviderContext value={toast.store}>\n\t\t\t{props.children}\n\t\t</ToastProviderContext>\n\t);\n}\n"],"mappings":"AAEA,SAA6BA,UAAU,QAAQ,gCAAgC;AAC/E,SAASC,WAAW,QAAQ,iBAAiB;AAE7C,SAASC,oBAAoB,QAAQ,0BAA0B;AAwB/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,aAAaA,CAACC,KAAyB,EAAe;EACrE,MAAMC,KAAK,GAAGJ,WAAW,CAAC;IACzB,IAAIK,OAAOA,CAAA,EAAG;MACb,OAAON,UAAU,CAACI,KAAK,CAACE,OAAO,CAAC;IACjC,CAAC;IACD,IAAIC,KAAKA,CAAA,EAAG;MACX,OAAOP,UAAU,CAACI,KAAK,CAACG,KAAK,CAAC;IAC/B,CAAC;IACD,IAAIC,YAAYA,CAAA,EAAG;MAClB,OAAOJ,KAAK,CAACI,YAAY;IAC1B;EACD,CAAC,CAAC;EAEF,OACC,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAACH,KAAK,CAACI,KAAK,CAAC;AAC3C,GAAG,CAACL,KAAK,CAACM,QAAQ;AAClB,EAAE,EAAE,oBAAoB,CAAC;AAEzB","ignoreList":[]}