import { A as StateMachine, C as StateValue, D as PromiseActorLogic, a as ActorRefFromLogic, b as RequiredActorOptions, c as AnyEventObject, g as IsNotNever, h as InputFrom, i as ActorRefFrom, k as MachineSnapshot, m as GetConcreteByKey, o as AnyActorLogic, p as EventObject, r as ActorRef, s as AnyActorRef, u as ConditionalRequired, v as MetaObject, w as Values, x as RequiredLogicInput, y as NonReducibleUnknown } from "./spawn-D9jgw9pW.js"; import "./StateMachine-EDpYWy0i.js"; import { t as Manager } from "./Manager-CQQ99QOI.js"; import "./Actor-iTq7YY48.js"; //#region src/modules/consent/types.d.ts type ConsentConfig = { combinedConsents?: string; consentId?: string; language?: string; }; type ConsentCheckbox = { id: string; label: string; required: boolean; checked: boolean; }; type FetchCombinedConsentResponse = { languageConsentId: string; terms: string; title: string; consents: Array<{ checkboxId: string; consentText: string; optional: boolean; }>; }; //#endregion //#region src/modules/consent/consentStateMachine.d.ts type ConsentContext = { config: ConsentConfig; title: string; richText: string; languageConsentId: string; checkboxes: ConsentCheckbox[]; error: string | undefined; }; type ConsentInput = { config: ConsentConfig; }; declare const consentMachine: StateMachine> | ActorRefFromLogic> | undefined; }, Values<{ fetchConsent: { src: "fetchConsent"; logic: PromiseActorLogic; id: string | undefined; }; submitConsent: { src: "submitConsent"; logic: PromiseActorLogic; id: string | undefined; }; }>, Values<{ setError: { type: "setError"; params: NonReducibleUnknown; }; clearError: { type: "clearError"; params: NonReducibleUnknown; }; setConsentData: { type: "setConsentData"; params: NonReducibleUnknown; }; toggleCheckbox: { type: "toggleCheckbox"; params: NonReducibleUnknown; }; resetContext: { type: "resetContext"; params: NonReducibleUnknown; }; }>, { type: "canSubmit"; params: unknown; }, never, "error" | "idle" | "finished" | "submitting" | "loading" | "display", string, ConsentInput, NonReducibleUnknown, EventObject, MetaObject, { readonly id: "consent"; readonly initial: "idle"; readonly context: ({ input }: { spawn: { (logic: TSrc, ...[options]: ({ src: "fetchConsent"; logic: PromiseActorLogic; id: string | undefined; } extends (infer T) ? T extends { src: "fetchConsent"; logic: PromiseActorLogic; id: string | undefined; } ? T extends { src: TSrc; } ? ConditionalRequired<[options?: ({ id?: T["id"] | undefined; systemId?: string; input?: InputFrom | undefined; syncSnapshot?: boolean; } & { [K in RequiredActorOptions]: unknown; }) | undefined], IsNotNever>> : never : never : never) | ({ src: "submitConsent"; logic: PromiseActorLogic; id: string | undefined; } extends (infer T_1) ? T_1 extends { src: "submitConsent"; logic: PromiseActorLogic; id: string | undefined; } ? T_1 extends { src: TSrc; } ? ConditionalRequired<[options?: ({ id?: T_1["id"] | undefined; systemId?: string; input?: InputFrom | undefined; syncSnapshot?: boolean; } & { [K_1 in RequiredActorOptions]: unknown; }) | undefined], IsNotNever>> : never : never : never)): ActorRefFromLogic; id: string | undefined; }; submitConsent: { src: "submitConsent"; logic: PromiseActorLogic; id: string | undefined; }; }>, "src", TSrc>["logic"]>; (src: TLogic, ...[options]: ConditionalRequired<[options?: ({ id?: never; systemId?: string; input?: InputFrom | undefined; syncSnapshot?: boolean; } & { [K in RequiredLogicInput]: unknown; }) | undefined], IsNotNever>>): ActorRefFromLogic; }; input: ConsentInput; self: ActorRef, StateValue, string, unknown, any, any>, { type: "LOAD"; } | { type: "TOGGLE_CHECKBOX"; checkboxId: string; } | { type: "SUBMIT"; } | { type: "RETRY"; } | { type: "RESET"; }, AnyEventObject>; }) => { config: ConsentConfig; title: string; richText: string; languageConsentId: string; checkboxes: never[]; error: undefined; }; readonly states: { readonly idle: { readonly on: { readonly LOAD: { readonly target: "loading"; readonly actions: "clearError"; }; }; }; readonly loading: { readonly invoke: { readonly id: "fetchConsent"; readonly src: "fetchConsent"; readonly input: ({ context }: { context: ConsentContext; event: { type: "LOAD"; } | { type: "TOGGLE_CHECKBOX"; checkboxId: string; } | { type: "SUBMIT"; } | { type: "RETRY"; } | { type: "RESET"; }; self: ActorRef, StateValue, string, unknown, any, any>, { type: "LOAD"; } | { type: "TOGGLE_CHECKBOX"; checkboxId: string; } | { type: "SUBMIT"; } | { type: "RETRY"; } | { type: "RESET"; }, AnyEventObject>; }) => { consentId: string; language: string | undefined; }; readonly onDone: { readonly target: "display"; readonly actions: "setConsentData"; }; readonly onError: { readonly target: "error"; readonly actions: "setError"; }; }; }; readonly display: { readonly on: { readonly TOGGLE_CHECKBOX: { readonly actions: "toggleCheckbox"; }; readonly SUBMIT: { readonly target: "submitting"; readonly guard: "canSubmit"; }; readonly RETRY: { readonly target: "loading"; readonly actions: "clearError"; }; }; }; readonly submitting: { readonly invoke: { readonly id: "submitConsent"; readonly src: "submitConsent"; readonly input: ({ context }: { context: ConsentContext; event: { type: "LOAD"; } | { type: "TOGGLE_CHECKBOX"; checkboxId: string; } | { type: "SUBMIT"; } | { type: "RETRY"; } | { type: "RESET"; }; self: ActorRef, StateValue, string, unknown, any, any>, { type: "LOAD"; } | { type: "TOGGLE_CHECKBOX"; checkboxId: string; } | { type: "SUBMIT"; } | { type: "RETRY"; } | { type: "RESET"; }, AnyEventObject>; }) => { languageConsentId: string; checkboxes: ConsentCheckbox[]; }; readonly onDone: { readonly target: "finished"; }; readonly onError: { readonly target: "display"; readonly actions: "setError"; }; }; }; readonly error: { readonly on: { readonly RETRY: { readonly target: "loading"; readonly actions: "clearError"; }; readonly RESET: { readonly target: "idle"; readonly actions: "resetContext"; }; }; }; readonly finished: { readonly type: "final"; }; }; }>; type ConsentMachine = typeof consentMachine; //#endregion //#region src/modules/consent/consentActor.d.ts type CreateConsentActorOptions = { config: ConsentConfig; }; type ConsentActor = ActorRefFrom; //#endregion //#region src/modules/consent/consentManager.d.ts type ConsentIdleState = { status: 'idle'; }; type ConsentLoadingState = { status: 'loading'; }; type ConsentDisplayState = { status: 'display'; title: string; richText: string; checkboxes: ConsentCheckbox[]; canSubmit: boolean; error?: string; }; type ConsentSubmittingState = { status: 'submitting'; title: string; richText: string; checkboxes: ConsentCheckbox[]; canSubmit: false; }; type ConsentFinishedState = { status: 'finished'; }; type ConsentErrorState = { status: 'error'; error: string; }; type ConsentState = ConsentIdleState | ConsentLoadingState | ConsentDisplayState | ConsentSubmittingState | ConsentFinishedState | ConsentErrorState; declare function createConsentManager(options: CreateConsentActorOptions): Manager & { load(): void; toggleCheckbox(checkboxId: string): void; submit(): void; retry(): void; reset(): void; }; /** * Creates a consent manager from a pre-built actor. * Use this when overriding the machine via `.provide()` for custom backends * or for story-isolation testing. */ declare function createConsentManagerFromActor(actor: ConsentActor): Manager & { load(): void; toggleCheckbox(checkboxId: string): void; submit(): void; retry(): void; reset(): void; }; type ConsentManager = ReturnType; //#endregion export { ConsentActor as a, ConsentConfig as c, createConsentManagerFromActor as i, ConsentState as n, consentMachine as o, createConsentManager as r, ConsentCheckbox as s, ConsentManager as t };