@walkeros/explorer 4.3.0-next-1784055686454 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";var e,n,t,r=Object.defineProperty,o=Object.getOwnPropertyNames,a=(e,n)=>function(){return e&&(n=(0,e[o(e)[0]])(e=0)),n};var s,i,l,c,d,u=a({"src/utils/monaco-context-types.ts"(){"use strict";e="\n// WalkerOS Core Types\ndeclare namespace WalkerOS {\n // Utility types\n type DeepPartial<T> = {\n [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];\n };\n\n type PromiseOrValue<T> = T | Promise<T>;\n\n // Property types\n type PropertyType = boolean | string | number | {\n [key: string]: Property;\n };\n\n type Property = PropertyType | Array<PropertyType>;\n\n interface Properties {\n [key: string]: Property | undefined;\n }\n\n interface OrderedProperties {\n [key: string]: [Property, number] | undefined;\n }\n\n // Consent\n interface Consent {\n [name: string]: boolean;\n }\n\n // User\n interface User extends Properties {\n id?: string;\n device?: string;\n session?: string;\n hash?: string;\n address?: string;\n email?: string;\n phone?: string;\n userAgent?: string;\n browser?: string;\n browserVersion?: string;\n deviceType?: string;\n language?: string;\n country?: string;\n region?: string;\n city?: string;\n zip?: string;\n timezone?: string;\n os?: string;\n osVersion?: string;\n screenSize?: string;\n ip?: string;\n internal?: boolean;\n }\n\n // Source\n type SourcePlatform =\n | 'web'\n | 'server'\n | 'app'\n | 'ios'\n | 'android'\n | 'terminal'\n | string;\n\n interface Source extends Properties {\n type: string;\n platform?: SourcePlatform;\n version?: string;\n schema?: string;\n count?: number;\n trace?: string;\n url?: string;\n referrer?: string;\n tool?: string;\n command?: string;\n }\n\n // Entity\n type Entities = Array<Entity>;\n\n interface Entity {\n entity: string;\n data: Properties;\n nested?: Entities;\n context?: OrderedProperties;\n }\n\n // Event\n interface Event {\n name: string;\n data: Properties;\n context: OrderedProperties;\n globals: Properties;\n custom: Properties;\n user: User;\n nested: Entities;\n consent: Consent;\n id: string;\n trigger: string;\n entity: string;\n action: string;\n timestamp: number;\n timing: number;\n source: Source;\n }\n\n type DeepPartialEvent = DeepPartial<Event>;\n}\n\n// Mapping Types\ndeclare namespace Mapping {\n type ValueType = string | ValueConfig;\n type Value = ValueType | Array<ValueType>;\n type Values = Array<Value>;\n\n interface ValueConfig {\n condition?: Condition;\n consent?: WalkerOS.Consent;\n fn?: Fn;\n key?: string;\n loop?: Loop;\n map?: Map;\n set?: Value[];\n validate?: Validate;\n value?: WalkerOS.PropertyType;\n }\n\n type Loop = [Value, Value];\n type Map = { [key: string]: Value };\n\n interface Context {\n event: WalkerOS.DeepPartialEvent;\n mapping: Value | Rule;\n collector: Collector.Instance;\n logger: Logger.Instance;\n consent?: WalkerOS.Consent;\n }\n\n type Condition = (\n value: WalkerOS.DeepPartialEvent | unknown,\n context: Context,\n ) => WalkerOS.PromiseOrValue<boolean>;\n\n type Fn = (\n value: WalkerOS.DeepPartialEvent | unknown,\n context: Context,\n ) => WalkerOS.PromiseOrValue<WalkerOS.Property | unknown>;\n\n type Validate = (\n value: unknown,\n context: Context,\n ) => WalkerOS.PromiseOrValue<boolean>;\n\n interface Rule {\n condition?: Condition;\n consent?: WalkerOS.Consent;\n name?: string;\n ignore?: boolean;\n silent?: boolean;\n }\n}\n\ndeclare namespace Logger {\n interface Instance {\n error: (msg: string, ...args: unknown[]) => void;\n warn: (msg: string, ...args: unknown[]) => void;\n info: (msg: string, ...args: unknown[]) => void;\n debug: (msg: string, ...args: unknown[]) => void;\n }\n}\n\n// Collector Types (minimal for fn context)\ndeclare namespace Collector {\n interface Instance {\n push: any;\n command: any;\n allowed: boolean;\n config: any;\n consent: WalkerOS.Consent;\n count: number;\n custom: WalkerOS.Properties;\n globals: WalkerOS.Properties;\n group: string;\n queue: any[];\n round: number;\n session: any;\n timing: number;\n user: WalkerOS.User;\n version: string;\n [key: string]: any;\n }\n}\n\n// Parameter declarations for fn context\ndeclare const value: WalkerOS.DeepPartialEvent | unknown;\ndeclare const context: Mapping.Context;\n",n="\n// WalkerOS Core Types\ndeclare namespace WalkerOS {\n // Utility types\n type DeepPartial<T> = {\n [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];\n };\n\n type PromiseOrValue<T> = T | Promise<T>;\n\n // Property types\n type PropertyType = boolean | string | number | {\n [key: string]: Property;\n };\n\n type Property = PropertyType | Array<PropertyType>;\n\n interface Properties {\n [key: string]: Property | undefined;\n }\n\n interface OrderedProperties {\n [key: string]: [Property, number] | undefined;\n }\n\n // Consent\n interface Consent {\n [name: string]: boolean;\n }\n\n // User\n interface User extends Properties {\n id?: string;\n device?: string;\n session?: string;\n hash?: string;\n address?: string;\n email?: string;\n phone?: string;\n userAgent?: string;\n browser?: string;\n browserVersion?: string;\n deviceType?: string;\n language?: string;\n country?: string;\n region?: string;\n city?: string;\n zip?: string;\n timezone?: string;\n os?: string;\n osVersion?: string;\n screenSize?: string;\n ip?: string;\n internal?: boolean;\n }\n\n // Source\n type SourcePlatform =\n | 'web'\n | 'server'\n | 'app'\n | 'ios'\n | 'android'\n | 'terminal'\n | string;\n\n interface Source extends Properties {\n type: string;\n platform?: SourcePlatform;\n version?: string;\n schema?: string;\n count?: number;\n trace?: string;\n url?: string;\n referrer?: string;\n tool?: string;\n command?: string;\n }\n\n // Entity\n type Entities = Array<Entity>;\n\n interface Entity {\n entity: string;\n data: Properties;\n nested?: Entities;\n context?: OrderedProperties;\n }\n\n // Event\n interface Event {\n name: string;\n data: Properties;\n context: OrderedProperties;\n globals: Properties;\n custom: Properties;\n user: User;\n nested: Entities;\n consent: Consent;\n id: string;\n trigger: string;\n entity: string;\n action: string;\n timestamp: number;\n timing: number;\n source: Source;\n }\n\n type DeepPartialEvent = DeepPartial<Event>;\n}\n\n// Mapping Types\ndeclare namespace Mapping {\n type ValueType = string | ValueConfig;\n type Value = ValueType | Array<ValueType>;\n type Values = Array<Value>;\n\n interface ValueConfig {\n condition?: Condition;\n consent?: WalkerOS.Consent;\n fn?: Fn;\n key?: string;\n loop?: Loop;\n map?: Map;\n set?: Value[];\n validate?: Validate;\n value?: WalkerOS.PropertyType;\n }\n\n type Loop = [Value, Value];\n type Map = { [key: string]: Value };\n\n interface Context {\n event: WalkerOS.DeepPartialEvent;\n mapping: Value | Rule;\n collector: Collector.Instance;\n logger: Logger.Instance;\n consent?: WalkerOS.Consent;\n }\n\n type Condition = (\n value: WalkerOS.DeepPartialEvent | unknown,\n context: Context,\n ) => WalkerOS.PromiseOrValue<boolean>;\n\n type Fn = (\n value: WalkerOS.DeepPartialEvent | unknown,\n context: Context,\n ) => WalkerOS.PromiseOrValue<WalkerOS.Property | unknown>;\n\n type Validate = (\n value: unknown,\n context: Context,\n ) => WalkerOS.PromiseOrValue<boolean>;\n\n interface Rule {\n condition?: Condition;\n consent?: WalkerOS.Consent;\n name?: string;\n ignore?: boolean;\n silent?: boolean;\n }\n}\n\ndeclare namespace Logger {\n interface Instance {\n error: (msg: string, ...args: unknown[]) => void;\n warn: (msg: string, ...args: unknown[]) => void;\n info: (msg: string, ...args: unknown[]) => void;\n debug: (msg: string, ...args: unknown[]) => void;\n }\n}\n\n// Collector Types (full interface for condition context)\ndeclare namespace Collector {\n interface SessionData extends WalkerOS.Properties {\n isStart: boolean;\n storage: boolean;\n id?: string;\n start?: number;\n marketing?: true;\n updated?: number;\n isNew?: boolean;\n device?: string;\n count?: number;\n runs?: number;\n }\n\n interface Config {\n run?: boolean;\n tagging: number;\n globalsStatic: WalkerOS.Properties;\n sessionStatic: Partial<SessionData>;\n verbose: boolean;\n onError?: any;\n onLog?: any;\n }\n\n interface Instance {\n push: any;\n command: any;\n allowed: boolean;\n config: Config;\n consent: WalkerOS.Consent;\n count: number;\n custom: WalkerOS.Properties;\n sources: any;\n destinations: any;\n globals: WalkerOS.Properties;\n group: string;\n hooks: any;\n on: any;\n queue: any[];\n round: number;\n session: undefined | SessionData;\n timing: number;\n user: WalkerOS.User;\n version: string;\n }\n}\n\n// Parameter declarations for condition context\ndeclare const value: WalkerOS.DeepPartialEvent | unknown;\ndeclare const context: Mapping.Context;\n",t="\n// WalkerOS Core Types\ndeclare namespace WalkerOS {\n // Utility types\n type DeepPartial<T> = {\n [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];\n };\n\n type PromiseOrValue<T> = T | Promise<T>;\n\n // Property types\n type PropertyType = boolean | string | number | {\n [key: string]: Property;\n };\n\n type Property = PropertyType | Array<PropertyType>;\n\n interface Properties {\n [key: string]: Property | undefined;\n }\n\n interface OrderedProperties {\n [key: string]: [Property, number] | undefined;\n }\n\n // Consent\n interface Consent {\n [name: string]: boolean;\n }\n\n // User\n interface User extends Properties {\n id?: string;\n device?: string;\n session?: string;\n hash?: string;\n address?: string;\n email?: string;\n phone?: string;\n userAgent?: string;\n browser?: string;\n browserVersion?: string;\n deviceType?: string;\n language?: string;\n country?: string;\n region?: string;\n city?: string;\n zip?: string;\n timezone?: string;\n os?: string;\n osVersion?: string;\n screenSize?: string;\n ip?: string;\n internal?: boolean;\n }\n\n // Source\n type SourcePlatform =\n | 'web'\n | 'server'\n | 'app'\n | 'ios'\n | 'android'\n | 'terminal'\n | string;\n\n interface Source extends Properties {\n type: string;\n platform?: SourcePlatform;\n version?: string;\n schema?: string;\n count?: number;\n trace?: string;\n url?: string;\n referrer?: string;\n tool?: string;\n command?: string;\n }\n\n // Entity\n type Entities = Array<Entity>;\n\n interface Entity {\n entity: string;\n data: Properties;\n nested?: Entities;\n context?: OrderedProperties;\n }\n\n // Event\n interface Event {\n name: string;\n data: Properties;\n context: OrderedProperties;\n globals: Properties;\n custom: Properties;\n user: User;\n nested: Entities;\n consent: Consent;\n id: string;\n trigger: string;\n entity: string;\n action: string;\n timestamp: number;\n timing: number;\n source: Source;\n }\n\n type DeepPartialEvent = DeepPartial<Event>;\n}\n\n// Mapping Types\ndeclare namespace Mapping {\n type ValueType = string | ValueConfig;\n type Value = ValueType | Array<ValueType>;\n type Values = Array<Value>;\n\n interface ValueConfig {\n condition?: Condition;\n consent?: WalkerOS.Consent;\n fn?: Fn;\n key?: string;\n loop?: Loop;\n map?: Map;\n set?: Value[];\n validate?: Validate;\n value?: WalkerOS.PropertyType;\n }\n\n type Loop = [Value, Value];\n type Map = { [key: string]: Value };\n\n interface Context {\n event: WalkerOS.DeepPartialEvent;\n mapping: Value | Rule;\n collector: Collector.Instance;\n logger: Logger.Instance;\n consent?: WalkerOS.Consent;\n }\n\n type Condition = (\n value: WalkerOS.DeepPartialEvent | unknown,\n context: Context,\n ) => WalkerOS.PromiseOrValue<boolean>;\n\n type Fn = (\n value: WalkerOS.DeepPartialEvent | unknown,\n context: Context,\n ) => WalkerOS.PromiseOrValue<WalkerOS.Property | unknown>;\n\n type Validate = (\n value: unknown,\n context: Context,\n ) => WalkerOS.PromiseOrValue<boolean>;\n\n interface Rule {\n condition?: Condition;\n consent?: WalkerOS.Consent;\n name?: string;\n ignore?: boolean;\n silent?: boolean;\n }\n}\n\ndeclare namespace Logger {\n interface Instance {\n error: (msg: string, ...args: unknown[]) => void;\n warn: (msg: string, ...args: unknown[]) => void;\n info: (msg: string, ...args: unknown[]) => void;\n debug: (msg: string, ...args: unknown[]) => void;\n }\n}\n\n// Collector Types (minimal for validate context)\ndeclare namespace Collector {\n interface Instance {\n push: any;\n command: any;\n allowed: boolean;\n config: any;\n consent: WalkerOS.Consent;\n count: number;\n custom: WalkerOS.Properties;\n globals: WalkerOS.Properties;\n group: string;\n queue: any[];\n round: number;\n session: any;\n timing: number;\n user: WalkerOS.User;\n version: string;\n [key: string]: any;\n }\n}\n\n// Parameter declarations for validate context\ndeclare const value: unknown;\ndeclare const context: Mapping.Context;\n"}}),p=a({"walkeros-types:virtual:walkeros-core-types"(){"use strict";s="type MatchExpression = MatchCondition | {\n and: MatchExpression[];\n} | {\n or: MatchExpression[];\n};\ninterface MatchCondition {\n key: string;\n operator: MatchOperator;\n value: string;\n not?: boolean;\n}\ntype MatchOperator = 'eq' | 'contains' | 'prefix' | 'suffix' | 'regex' | 'gt' | 'lt' | 'exists';\ntype CompiledMatcher = (context: Record<string, unknown>) => boolean;\n\ntype matcher_CompiledMatcher = CompiledMatcher;\ntype matcher_MatchCondition = MatchCondition;\ntype matcher_MatchExpression = MatchExpression;\ntype matcher_MatchOperator = MatchOperator;\ndeclare namespace matcher {\n export type { matcher_CompiledMatcher as CompiledMatcher, matcher_MatchCondition as MatchCondition, matcher_MatchExpression as MatchExpression, matcher_MatchOperator as MatchOperator };\n}\n\n/**\n * Shared mapping configuration interface.\n * Used by both Source.Config and Destination.Config.\n */\ninterface Config$7<T = unknown> {\n consent?: Consent;\n data?: Value | Values;\n include?: string[];\n mapping?: Rules<Rule<T>>;\n policy?: Policy$1;\n}\ninterface Policy$1 {\n [key: string]: Value;\n}\ninterface Rules<T = Rule> {\n [entity: string]: Record<string, T | Array<T>> | undefined;\n}\ninterface Rule<Settings = unknown> {\n /**\n * Batch scheduling for this event mapping. When present, it splits this\n * event type into its own buffer, overriding `config.batch` per field\n * (`rule ?? config ?? default`). A bare number is the debounce `wait`\n * window. Object form supports `wait` (debounce ms), `size` (count cap),\n * and `age` (max ms since first entry).\n */\n batch?: number | BatchOptions;\n condition?: Condition;\n consent?: Consent;\n settings?: Settings;\n data?: Data$1;\n include?: string[];\n ignore?: boolean;\n silent?: boolean;\n name?: string;\n policy?: Policy$1;\n /**\n * Merge mode (config layer): a partial Rule deep-merged onto the\n * package-shipped default rule at the same key, instead of replacing it.\n * Resolved at the consuming package's init via `mergeMappingRule`; not\n * seen by the runtime evaluator. A `null` value clears an inherited field.\n * Presence of `extend` or `remove` switches this rule from replace to merge.\n */\n extend?: RulePatch<Settings>;\n /**\n * Output layer: dotted paths stripped from the produced data payload\n * after evaluation, regardless of how each field was produced. Applied\n * last, so it always wins.\n */\n remove?: string[];\n}\n/**\n * A partial Rule used by `Rule.extend`. Every field is optional, and a\n * `null` value clears the inherited field (JSON merge-patch delete). The\n * control fields `extend` and `remove` are excluded: a patch models only\n * direct rule fields, matching what the runtime patch schema accepts.\n */\ntype RulePatchFields<Settings = unknown> = Omit<Rule<Settings>, 'extend' | 'remove'>;\ntype RulePatch<Settings = unknown> = {\n [K in keyof RulePatchFields<Settings>]?: RulePatchFields<Settings>[K] | null;\n};\ninterface Result$2 {\n eventMapping?: Rule;\n mappingKey?: string;\n}\ntype Data$1 = Value | Values;\ntype Value = ValueType | Array<ValueType>;\ntype Values = Array<Value>;\ntype ValueType = string | ValueConfig;\ninterface ValueConfig {\n condition?: Condition;\n consent?: Consent;\n fn?: Fn$4;\n key?: string;\n loop?: Loop;\n map?: Map;\n set?: Value[];\n validate?: Validate;\n value?: PropertyType;\n}\ninterface Context$6 {\n event: DeepPartialEvent;\n /** The surrounding mapping config: a Value (value-level) or a Rule (rule-level). */\n mapping: Value | Rule;\n collector: Instance$6;\n logger: Instance$3;\n consent?: Consent;\n}\ntype Fn$4 = (value: unknown, context: Context$6) => PromiseOrValue<Property | unknown>;\ntype Condition = (value: unknown, context: Context$6) => PromiseOrValue<boolean>;\ntype Validate = (value: unknown, context: Context$6) => PromiseOrValue<boolean>;\ntype Loop = [Value, Value];\ntype Map = {\n [key: string]: Value;\n};\n\ntype mapping_Condition = Condition;\ntype mapping_Loop = Loop;\ntype mapping_Map = Map;\ntype mapping_Rule<Settings = unknown> = Rule<Settings>;\ntype mapping_RulePatch<Settings = unknown> = RulePatch<Settings>;\ntype mapping_Rules<T = Rule> = Rules<T>;\ntype mapping_Validate = Validate;\ntype mapping_Value = Value;\ntype mapping_ValueConfig = ValueConfig;\ntype mapping_ValueType = ValueType;\ntype mapping_Values = Values;\ndeclare namespace mapping {\n export type { mapping_Condition as Condition, Config$7 as Config, Context$6 as Context, Data$1 as Data, Fn$4 as Fn, mapping_Loop as Loop, mapping_Map as Map, Policy$1 as Policy, Result$2 as Result, mapping_Rule as Rule, mapping_RulePatch as RulePatch, mapping_Rules as Rules, mapping_Validate as Validate, mapping_Value as Value, mapping_ValueConfig as ValueConfig, mapping_ValueType as ValueType, mapping_Values as Values };\n}\n\ninterface BaseCacheRule {\n /**\n * Optional match expression. Omitted means always-match.\n */\n match?: MatchExpression;\n ttl: number;\n}\ninterface EventCacheRule extends BaseCacheRule {\n key: string[];\n update?: Record<string, Value>;\n}\ninterface StoreCacheRule extends BaseCacheRule {\n}\ntype CacheRule = EventCacheRule | StoreCacheRule;\ninterface Cache<R extends CacheRule = CacheRule> {\n /**\n * Stop the chain on cache HIT (default: false). When true, skip remaining steps and return cached value.\n */\n stop?: boolean;\n store?: string;\n /**\n * Optional key prefix written to the store. When absent, cache keys are written directly. Same store + same key + same namespace = same cache entry.\n */\n namespace?: string;\n rules: R[];\n}\n\ntype cache_Cache<R extends CacheRule = CacheRule> = Cache<R>;\ntype cache_CacheRule = CacheRule;\ntype cache_EventCacheRule = EventCacheRule;\ntype cache_StoreCacheRule = StoreCacheRule;\ndeclare namespace cache {\n export type { cache_Cache as Cache, cache_CacheRule as CacheRule, cache_EventCacheRule as EventCacheRule, cache_StoreCacheRule as StoreCacheRule };\n}\n\n/**\n * Options for responding to an HTTP request.\n * Same interface for web and server — sources implement the handler.\n */\ninterface RespondOptions {\n /** Response body. Objects are JSON-serialized by source. */\n body?: unknown;\n /** HTTP status code (default: 200). Server-only, ignored by web sources. */\n status?: number;\n /** HTTP response headers. Server-only, ignored by web sources. */\n headers?: Record<string, string>;\n}\n/**\n * Standardized response function available on env for every step.\n * Idempotent: first call wins, subsequent calls are no-ops.\n * Created by sources via createRespond(), consumed by any step.\n */\ntype RespondFn = (options?: RespondOptions) => void;\n/**\n * Creates an idempotent respond function.\n * The sender callback is source-specific (Express wraps res, Fetch wraps Response, etc.).\n *\n * @param sender - Platform-specific function that actually sends the response\n * @returns Idempotent respond function (first call wins)\n */\ndeclare function createRespond(sender: (options: RespondOptions) => void): RespondFn;\n\n/**\n * Metadata managed by the runtime. Do not overwrite from step code.\n * The _ prefix signals \"runtime-managed.\"\n */\ninterface IngestMeta {\n /** Number of steps this data has passed through. */\n hops: number;\n /** Ordered list of step IDs visited. path[0] is always the source ID. */\n path: string[];\n /** Current chain context, e.g., \"destination.ga4.before\" or \"source.web.next\". */\n chainPath?: string;\n /** W3C 32-hex trace id adopted from an inbound traceparent header. */\n trace?: string;\n /** Parent span (upstream event.id) from an inbound traceparent header. */\n parentEventId?: string;\n}\n/**\n * Mutable shared context that accumulates knowledge as data flows through the graph.\n *\n * Event = strict schema (analytics data).\n * Ingest = wild west (pipeline context).\n *\n * Any step can read and write arbitrary keys. The `_meta` section is\n * managed by the runtime — increment hops and append to path before each step.\n */\ninterface Ingest {\n [key: string]: unknown;\n _meta: IngestMeta;\n}\n/** Create a fresh Ingest for a new pipeline invocation. */\ndeclare function createIngest(sourceId: string): Ingest;\n\n/**\n * FlowState is the canonical observation record emitted at each hop in a\n * walkerOS pipeline. Telemetry helpers populate one of these per (step,\n * phase) tuple and pass it to a user-supplied emit callback. The shape is\n * stable across step kinds (source, transformer, collector, destination,\n * store) so a single observer can correlate work across the pipeline.\n *\n * Optional fields are populated only when meaningful for the (step, phase)\n * pair, or when the telemetry options explicitly opt in (e.g. trace level\n * for inEvent/outEvent).\n */\ntype FlowStatePhase = 'init' | 'in' | 'out' | 'error' | 'skip' | 'flush';\ntype FlowStepType = 'source' | 'transformer' | 'collector' | 'destination' | 'store';\ninterface FlowStateBatch {\n size: number;\n index: number;\n}\ninterface FlowState {\n /** The flow this state belongs to. */\n flowId: string;\n /**\n * Runtime that produced this state: `web` (browser bundle) or `server`\n * (Node runtime). Mirrors the originating flow's `config.platform`.\n * Optional: emitters may omit it; populated when the runtime is known.\n */\n platform?: 'web' | 'server';\n /** Step identifier, e.g. 'destination.gtag', 'transformer.consent', 'collector.push'. */\n stepId: string;\n stepType: FlowStepType;\n phase: FlowStatePhase;\n /** W3C span-id of the originating WalkerOS.Event. Sourced from event.id; never synthesized. */\n eventId: string;\n /** W3C 32-hex trace id of the originating run. Sourced from event.source.trace; never synthesized here. */\n traceId?: string;\n /** Upstream runtime's event.id when this pipeline was entered via a $flow crossing (from traceparent). */\n parentEventId?: string;\n /** Originating source id (Ingest._meta.path[0]), when known. */\n sourceId?: string;\n /** Per-poster monotonic record counter for gap detection. Stamped by the batched poster, not emitters. */\n seq?: number;\n /**\n * Vendor calls recorded via wrapEnv on destination out records. Captured only\n * at trace level and only when the destination declares a `calls` list\n * (dot-paths of observable env callables); the recorded array then survives\n * projection when level === 'trace' or includeOut === true.\n */\n calls?: Call[];\n /** ISO 8601 timestamp. */\n timestamp: string;\n /** Milliseconds since the runtime's startedAt origin. Monotonic. */\n elapsedMs: number;\n /** Wall-clock duration of this step, if measured (typically only on 'out'). */\n durationMs?: number;\n /** Inbound walker event for this hop. Only populated when level === 'trace' or includeIn === true. */\n inEvent?: unknown;\n /** Outbound walker event/payload for this hop. Only populated when level === 'trace' or includeOut === true. */\n outEvent?: unknown;\n /** Error info when phase === 'error'. */\n error?: {\n name?: string;\n message: string;\n };\n /** The mapping rule that matched, when one matched. */\n mappingKey?: string;\n /** Contract rule that matched, if any. */\n contractRule?: string;\n /** Consent gate snapshot at hop time. */\n consent?: Record<string, boolean>;\n /** Consent state actually applied (after policy resolution). */\n consentApplied?: Record<string, boolean>;\n /** W3C 16-hex span-id of the child branch for `many` fan-out. */\n branchId?: string;\n /** For phase === 'flush', the batch size + entry index. */\n batch?: FlowStateBatch;\n /** Discriminator when phase === 'skip'. */\n skipReason?: 'consent' | 'cache_hit' | 'sampled_out' | 'disabled' | 'unknown';\n /** Free-form metadata: store key/value, cached: true, etc. */\n meta?: Record<string, unknown>;\n}\n\n/**\n * Pipeline observation channel. Observers receive a FlowState record per\n * step phase (init, in, out, error, skip, flush) and run synchronously in\n * the collector's emit loop. They must not throw; emitStep swallows\n * thrown values defensively so a slow or buggy observer cannot crash the\n * pipeline. Observers must not perform synchronous IO.\n */\ntype ObserverFn = (state: FlowState) => void;\n\n/** Identifies which kind of step a stepId belongs to. */\ntype StepKind = 'collector' | 'source' | 'transformer' | 'destination' | 'store';\n/**\n * Build a stepId for use as a key in `Status.dropped` /\n * `Status.connectionErrors` (and future status maps). The collector-level\n * stepId is the literal \"collector\" (no id). Source/transformer/destination/\n * store ids take the form `\"<kind>.<id>\"`, e.g. `\"destination.ga4\"`.\n *\n * The dot separator mirrors the vocabulary already used in collector\n * log messages (\"collector.queue overflow\", \"destination.dlq overflow\").\n */\ndeclare function stepId(kind: 'collector'): 'collector';\ndeclare function stepId(kind: 'source' | 'transformer' | 'destination' | 'store', id: string): string;\n/**\n * Drop counters at a single step. Each buffer is optional: a step kind\n * may have only `queue` (collector), only `dlq`, both (destinations\n * today), or neither. Counts are monotonic.\n */\ninterface DroppedCounters {\n queue?: number;\n dlq?: number;\n}\n/**\n * Circuit-breaker state for a single step (keyed by `stepId()` in\n * `Status.breakers`). Tracks consecutive transport failures so a step whose\n * transport is down can be skipped (gated) until a cooldown elapses, instead\n * of every event hammering a known-broken writer.\n *\n * - `closed`: healthy; events pass through. `consecutiveFailures` accrues on\n * transport failures and resets to 0 on any success.\n * - `open`: tripped; events are skipped until `openUntil`. The first event at\n * or after `openUntil` transitions to `half-open` and becomes the probe.\n * - `half-open`: a single probe event is allowed through; `probing` marks that\n * the probe slot is taken so concurrent events still skip. A probe success\n * closes the breaker; a probe failure re-opens it with a fresh `openUntil`.\n *\n * `consecutiveFailures` is CONSECUTIVE, not cumulative: a single success\n * resets it, so only an unbroken run reaching the threshold opens the breaker.\n */\ninterface BreakerState {\n state: 'closed' | 'open' | 'half-open';\n consecutiveFailures: number;\n /** Epoch ms after which an open breaker admits a single probe. */\n openUntil?: number;\n /** True while a half-open probe is in flight (probe slot taken). */\n probing?: boolean;\n}\n/**\n * Core collector configuration interface\n */\ninterface Config$6 {\n /** Whether to run collector automatically */\n run?: boolean;\n /** Static global properties even on a new run */\n globalsStatic: Properties;\n /** Static session data even on a new run */\n sessionStatic: Partial<SessionData>;\n /** Logger configuration */\n logger?: Config$3;\n /**\n * Maximum number of events retained in `collector.queue` for late-registered\n * destination backfill. Overflow drops oldest (FIFO). Default 1000.\n */\n queueMax?: number;\n /** Flow name; keys this flow's entry in event.source.release and the observer flowId. */\n name?: string;\n /** Config release id stamped into event.source.release for this flow. */\n release?: string;\n}\n/**\n * Initialization configuration that extends Config with initial state\n */\ninterface InitConfig extends Partial<Config$6> {\n /** Initial consent state */\n consent?: Consent;\n /** Initial user data */\n user?: User;\n /** Initial global properties */\n globals?: Properties;\n /** Source configurations */\n sources?: InitSources;\n /** Destination configurations */\n destinations?: InitDestinations;\n /** Transformer configurations */\n transformers?: InitTransformers;\n /** Store configurations */\n stores?: InitStores;\n /** Initial custom properties */\n custom?: Properties;\n /** Hooks for pipeline observation and interception */\n hooks?: Functions;\n}\ninterface SessionData extends Properties {\n isStart: boolean;\n storage: boolean;\n id?: string;\n start?: number;\n marketing?: true;\n updated?: number;\n isNew?: boolean;\n device?: string;\n count?: number;\n runs?: number;\n}\ninterface Status {\n startedAt: number;\n in: number;\n out: number;\n failed: number;\n sources: Record<string, SourceStatus>;\n destinations: Record<string, DestinationStatus>;\n /**\n * Monotonic counts of events dropped due to buffer caps, keyed by\n * stepId. See `stepId()` for key construction.\n *\n * Examples:\n * - `dropped[\"collector\"]?.queue`: collector replay buffer drops\n * - `dropped[\"destination.ga4\"]?.queue`: ga4's consent-denied buffer drops\n * - `dropped[\"destination.ga4\"]?.dlq`: ga4's dead-letter queue drops\n */\n dropped: Record<string, DroppedCounters>;\n /**\n * Per-step circuit-breaker state, keyed by stepId. See `stepId()` for key\n * construction; keyed step-agnostically (NOT embedded in\n * `DestinationStatus`) so the breaker can guard any step kind, though\n * destinations are the primary use today. A breaker is created lazily on\n * first accounting and stays inert unless its step is configured with a\n * `breaker` (presence-gated): existing flows never trip a breaker.\n *\n * A runtime status field, not drift-guarded (it is observed, never authored\n * in a flow config).\n *\n * Example:\n * - `breakers[\"destination.bigquery\"]`: bigquery's consecutive-failure gate.\n */\n breakers: Record<string, BreakerState>;\n /**\n * Monotonic counts of out-of-band connection-level errors reported by a\n * step via `context.reportError(err)` with no event (an orphan error from\n * an EventEmitter SDK object's `'error'` handler), keyed by stepId. See\n * `stepId()` for key construction; mirrors `dropped`.\n *\n * Distinct from `failed`: `failed` counts events lost in-band (a push that\n * threw, a DLQ'd entry). `connectionErrors` counts connection faults that\n * did not lose a specific event at the moment they fired. Operators read\n * both: a rising `connectionErrors` with flat `failed` means a writer is\n * flapping but events are still landing; both rising means the fault is\n * now dropping events.\n *\n * Example:\n * - `connectionErrors[\"destination.bigquery\"]`: BigQuery stream writer\n * `'error'` events reported between pushes.\n */\n connectionErrors: Record<string, number>;\n}\ninterface SourceStatus {\n count: number;\n lastAt?: number;\n duration: number;\n}\ninterface DestinationStatus {\n count: number;\n failed: number;\n lastAt?: number;\n duration: number;\n /** Current size of the destination's queuePush buffer (point-in-time). */\n queuePushSize: number;\n /** Current size of the destination's DLQ (point-in-time). */\n dlqSize: number;\n /**\n * Number of events buffered in batch scheduler windows but not yet\n * delivered to `pushBatch`. Incremented on enqueue, decremented on\n * flush (whether the flush succeeds or fails). Operators read this\n * to spot batches that never drain.\n */\n inFlightBatch?: number;\n}\ninterface Sources {\n [id: string]: Instance$2;\n}\ninterface Destinations$1 {\n [id: string]: Instance$5;\n}\ninterface Transformers$1 {\n [id: string]: Instance$4;\n}\ninterface Stores$1 {\n [id: string]: Instance$1;\n}\ntype CommandType = 'action' | 'config' | 'consent' | 'context' | 'destination' | 'elb' | 'globals' | 'hook' | 'init' | 'link' | 'run' | 'user' | 'walker' | string;\n/**\n * Options passed to collector.push() from sources.\n * NOT a Context - just push metadata.\n */\ninterface PushOptions {\n id?: string;\n ingest?: Ingest;\n respond?: RespondFn;\n mapping?: Config$7;\n preChain?: string[];\n include?: string[];\n exclude?: string[];\n}\n/**\n * Push function signature - handles events only\n */\ninterface PushFn$1 {\n (event: DeepPartialEvent, options?: PushOptions): Promise<PushResult>;\n}\n/**\n * Command function signature - handles walker commands only\n */\ninterface CommandFn {\n (command: 'config', config: Partial<Config$6>): Promise<PushResult>;\n (command: 'consent', consent: Consent): Promise<PushResult>;\n <T extends Types$4>(command: 'destination', init: Init$3<T>): Promise<PushResult>;\n <K extends keyof Functions>(command: 'hook', init: {\n name: K;\n fn: Functions[K];\n }): Promise<PushResult>;\n (command: 'on', init: {\n type: Types$2;\n rules: SingleOrArray<Subscription>;\n }): Promise<PushResult>;\n (command: 'user', user: User): Promise<PushResult>;\n (command: 'run', runState?: {\n consent?: Consent;\n user?: User;\n globals?: Properties;\n custom?: Properties;\n }): Promise<PushResult>;\n (command: string, data?: unknown): Promise<PushResult>;\n}\n/**\n * Per-cascade tracking for the bounded recursion guard (see `Instance.cascade`).\n * `counts` maps a subscriber identity object to per-cell-type delivery counts\n * within one top-level command's cascade. A pair is stopped once its count\n * exceeds the guard's bound; the non-convergence error logs once per pair on the\n * crossing transition.\n */\ninterface Cascade {\n counts: WeakMap<object, Record<string, number>>;\n}\ninterface Instance$6 {\n push: PushFn$1;\n command: CommandFn;\n /** Flexible elb() adapter: routes `walker *` to command, events to push. */\n elb: Fn$3;\n allowed: boolean;\n config: Config$6;\n consent: Consent;\n custom: Properties;\n sources: Sources;\n destinations: Destinations$1;\n transformers: Transformers$1;\n stores: Stores$1;\n globals: Properties;\n hooks: Functions;\n /**\n * First-class observation channel. The runtime self-emits FlowState\n * records at canonical step sites (collector.push, destination.push,\n * destination.init, destination.pushBatch, destination consent skip,\n * transformer.push, store.get/set/delete, store cache HIT/MISS).\n * Observers run synchronously inside emitStep; thrown values are\n * swallowed. Subscribers add/remove via the standard Set API.\n */\n observers: Set<ObserverFn>;\n /**\n * Optional observation-level supplier installed by bundle codegen. Returns\n * the level currently active for this runtime. Absent means no capture. At\n * `trace` the per-event destination push wraps its env (via `wrapEnv`) to\n * record a destination's declared vendor `calls`; `off`/`standard` and\n * absence leave the push path untouched (zero added per-push cost).\n */\n observeLevel?: () => 'off' | 'standard' | 'trace';\n logger: Instance$3;\n on: OnConfig;\n queue: Events;\n round: number;\n /** Run-scoped W3C trace id, minted on each run and stamped onto events. */\n trace?: string;\n /** Static flow name; keys source.release and the observer flowId. */\n name?: string;\n /** Static config release id stamped into source.release for this flow. */\n release?: string;\n /** Per-run emission sequence; reset on each run, incremented per stamped event. */\n count: number;\n /**\n * Monotonic counter bumped on every accepted reactive-state mutation\n * (consent, user, globals, custom). Used for per-subscriber high-water-mark\n * dedup. Not bumped for non-reactive config changes.\n */\n stateVersion: number;\n /**\n * Per-cell change version: the `stateVersion` at which each state cell\n * (`consent`/`user`/`globals`/`custom`) last changed. Lets delivery dedup be\n * per-cell — a subscriber owed two cells at the same `stateVersion` receives\n * both, because each cell's freshness is tracked independently rather than\n * against the single global `stateVersion`. A missing entry reads as 0.\n */\n cellVersion: Record<string, number>;\n /**\n * Per-subscriber, per-cell high-water mark registry for exactly-once state\n * delivery. Keys are subscriber identity objects (a ConsentRule object, a\n * generic-fn, or a source instance); the inner record maps each state-cell\n * type (`consent`/`user`/`globals`/`custom`) to the `stateVersion` at which\n * that subscriber was last invoked FOR THAT CELL. A missing entry means never\n * delivered (sentinel \"-infinity\", read as -1). A subscriber is invoked for a\n * cell iff `stateVersion > mark[cell]` AND `allowed === true`.\n *\n * Per-cell (not a single scalar per subscriber) so a handler owed two\n * distinct cells at the same `stateVersion` — e.g. consent and user both\n * bumped before run — receives both at the run barrier instead of the first\n * delivery advancing one mark and swallowing the second cell's edge.\n */\n delivery: WeakMap<object, Record<string, number>>;\n /**\n * Transient per-cascade tracking for the bounded recursion guard. A\n * top-level state command creates this when it first enters the delivery\n * cascade and tears it down when it returns; nested commands emitted by\n * reacting callbacks reuse the same structure. It counts deliveries per\n * `(subscriber, cell-type)` so a cyclic cascade terminates (and logs once)\n * instead of recursing until stack overflow. `undefined` between top-level\n * commands. See `on.ts` `cascadeAllow`.\n *\n * This tracker, together with `stateVersion` and `delivery`, assumes top-level\n * state commands are processed serially on a given collector. Concurrent,\n * overlapping state commands on one shared collector are not supported (web is\n * serial; the server per-request path is event push, not state commands).\n */\n cascade?: Cascade;\n session: undefined | SessionData;\n status: Status;\n timing: number;\n user: User;\n pending: {\n destinations: InitDestinations;\n };\n /**\n * Set true on the first `shutdown` command, guarding re-entrancy: a second\n * `walker shutdown` must not re-run `destroyAllSteps` and double-close\n * writers, destinations, or stores. Subsequent shutdown commands no-op.\n * Initialized to `false` by the collector factory; absence (`undefined`)\n * is treated as \"not yet shut down\", so the first shutdown still runs.\n */\n hasShutdown?: boolean;\n /**\n * Every event type ever broadcast through `onApply` (state, lifecycle, and\n * arbitrary). Lets a `require:[<arbitrary>]` gate be satisfied by the current\n * recorded state for events that have no backing cell, including a broadcast\n * that fired before the requiring step registered.\n */\n seenEvents: Set<string>;\n}\n\ntype collector_BreakerState = BreakerState;\ntype collector_Cascade = Cascade;\ntype collector_CommandFn = CommandFn;\ntype collector_CommandType = CommandType;\ntype collector_DestinationStatus = DestinationStatus;\ntype collector_DroppedCounters = DroppedCounters;\ntype collector_InitConfig = InitConfig;\ntype collector_PushOptions = PushOptions;\ntype collector_SessionData = SessionData;\ntype collector_SourceStatus = SourceStatus;\ntype collector_Sources = Sources;\ntype collector_Status = Status;\ntype collector_StepKind = StepKind;\ndeclare const collector_stepId: typeof stepId;\ndeclare namespace collector {\n export { type collector_BreakerState as BreakerState, type collector_Cascade as Cascade, type collector_CommandFn as CommandFn, type collector_CommandType as CommandType, type Config$6 as Config, type collector_DestinationStatus as DestinationStatus, type Destinations$1 as Destinations, type collector_DroppedCounters as DroppedCounters, type collector_InitConfig as InitConfig, type Instance$6 as Instance, type PushFn$1 as PushFn, type collector_PushOptions as PushOptions, type collector_SessionData as SessionData, type collector_SourceStatus as SourceStatus, type collector_Sources as Sources, type collector_Status as Status, type collector_StepKind as StepKind, type Stores$1 as Stores, type Transformers$1 as Transformers, collector_stepId as stepId };\n}\n\n/**\n * Base context interface for walkerOS stages.\n * Sources, Transformers, and Destinations extend this.\n */\ninterface Base<C = unknown, E = unknown> {\n collector: Instance$6;\n logger: Instance$3;\n config: C;\n env: E;\n /**\n * Out-of-band error seam available to every step kind (source,\n * transformer, store, destination). A step that owns an EventEmitter SDK\n * object (BigQuery `StreamConnection`, a Redis client, a Kafka producer)\n * calls this from the object's `'error'` handler, where there is no\n * surrounding `await`/`tryCatchAsync` to catch into and an unhandled\n * `'error'` would otherwise crash the process on a detached tick.\n *\n * MUST NOT throw (it runs on a detached emitter tick; a throw inside it\n * would reintroduce the uncaughtException it exists to prevent).\n *\n * - With `event`: routes that event through the same per-step failure\n * accounting an in-band push failure uses (the destination DLQ + the\n * `failed` counters), so a connection error that loses a specific event\n * is counted and surfaced exactly like a synchronous push failure.\n * - Without `event` (an orphan / connection-level error, e.g. a stream\n * writer that errored between pushes): a contained `logger.error` plus a\n * bump of `Status.connectionErrors[stepId]`. It does NOT bump\n * `Status.failed` (no event was lost at this instant; the next push that\n * hits the broken writer is what gets DLQ'd and counted as failed, so\n * counting the orphan against `failed` would double-count).\n */\n reportError?(err: unknown, event?: Event): void;\n}\n\ntype context_Base<C = unknown, E = unknown> = Base<C, E>;\ndeclare namespace context {\n export type { context_Base as Base };\n}\n\n/**\n * Shared credentials types for steps that authenticate against an external\n * service. A step's `Types['credentials']` points at one of these (or its own\n * shape). The value resolves like any other config field; back it with a\n * managed secret via `$secret.NAME` (credentials, tokens, and private keys\n * must use `$secret`, not `$env`, so the deploy pipeline injects them).\n */\n/**\n * Google-style service account credentials. The common shape for GCP-family\n * packages (Pub/Sub, Sheets, GCS, DataManager). `project_id` is optional\n * because some clients derive it from the runtime environment.\n */\ninterface ServiceAccount {\n client_email: string;\n private_key: string;\n project_id?: string;\n}\n/**\n * A credential value: either a JSON string (often a `$secret.NAME` reference to\n * a managed secret) or the already-parsed object form `T`.\n */\ntype Credential<T> = string | T;\n\n/**\n * Declarative store operation. Replaces `$code:` for simple fetch/stash.\n * key = store side, value = event side, mode = direction.\n */\ninterface State {\n /** Direction. 'delete' is reserved for a later release. */\n mode: 'get' | 'set';\n /** Store id; defaults to the in-memory `__cache` store when omitted. */\n store?: string;\n /** Resolves against the event to the store key. */\n key: Value;\n /**\n * set: resolves to the payload to store.\n * get: its `key`/bare-string path is the event write-target.\n * Optional at the type level to keep a future `delete` mode non-breaking;\n * validation requires it for get/set.\n */\n value?: Value;\n}\n\n/**\n * Shared context for one-shot lifecycle hooks (setup, destroy).\n * No event pipeline machinery — just config, env, logger, and id.\n */\ninterface LifecycleContext<C = unknown, E = unknown> {\n id: string;\n config: C;\n env: E;\n logger: Instance$3;\n}\n/**\n * Setup function signature. Called once via `walkeros setup <kind>.<name>`.\n * Packages own idempotency and error semantics. Return value (if any) is\n * JSON-stringified to stdout by the CLI for scripting use.\n */\ntype SetupFn<C = unknown, E = unknown> = (context: LifecycleContext<C, E>) => PromiseOrValue<unknown>;\n/**\n * Destroy function signature for step lifecycle cleanup.\n */\ntype DestroyFn<C = unknown, E = unknown> = (context: LifecycleContext<C, E>) => PromiseOrValue<void>;\n/**\n * @deprecated Use `LifecycleContext` instead. Kept as alias for one minor cycle.\n */\ntype DestroyContext<C = unknown, E = unknown> = LifecycleContext<C, E>;\n\ntype lifecycle_DestroyContext<C = unknown, E = unknown> = DestroyContext<C, E>;\ntype lifecycle_DestroyFn<C = unknown, E = unknown> = DestroyFn<C, E>;\ntype lifecycle_LifecycleContext<C = unknown, E = unknown> = LifecycleContext<C, E>;\ntype lifecycle_SetupFn<C = unknown, E = unknown> = SetupFn<C, E>;\ndeclare namespace lifecycle {\n export type { lifecycle_DestroyContext as DestroyContext, lifecycle_DestroyFn as DestroyFn, lifecycle_LifecycleContext as LifecycleContext, lifecycle_SetupFn as SetupFn };\n}\n\n/**\n * Base environment requirements interface for walkerOS destinations\n *\n * This defines the core interface that destinations can use to declare\n * their runtime environment requirements. Platform-specific extensions\n * should extend this interface.\n */\ninterface BaseEnv$3 {\n /**\n * Generic global properties that destinations may require\n * Platform-specific implementations can extend this interface\n */\n [key: string]: unknown;\n}\n/**\n * Observe-mode call recorder injected into a per-push env (under the runtime\n * `OBSERVE_ENV_KEY`) for vendor-call paths that could NOT be resolved at wrap\n * time (root or leaf missing, e.g. a live-web global not yet installed). The\n * resolution-point wrapper (web-core `getEnv`) reads this, wraps the matching\n * globals via a transparent Proxy, and forwards each intercepted call to\n * `record`. The key is stripped before the env reaches the destination.\n */\ninterface EnvObserve {\n /**\n * Dot-paths to intercept, with any `call:` prefix already stripped (as\n * `parseCallPath` returns them). Each is a `root.leaf` chain resolved against\n * the merged env.\n */\n paths: string[];\n /**\n * Appends one recorded invocation. `fn` is the full intercepted dot-path,\n * `args` the call arguments. Implementations push onto the shared `calls`\n * array that backs the destination out record.\n */\n record: (fn: string, args: unknown[]) => void;\n}\n/**\n * Type bundle for destination generics.\n * Groups Settings, InitSettings, Mapping, Env, and Setup into a single type parameter.\n */\ninterface Types$4<S = unknown, M = unknown, E = BaseEnv$3, I = S, U = unknown, C = unknown> {\n settings: S;\n initSettings: I;\n mapping: M;\n env: E;\n setup: U;\n credentials: C;\n}\n/**\n * Generic constraint for Types - ensures T has required properties for indexed access\n */\ntype TypesGeneric$3 = {\n settings: any;\n initSettings: any;\n mapping: any;\n env: any;\n setup: any;\n credentials: any;\n};\n/**\n * Type extractors for consistent usage with Types bundle\n */\ntype Settings$3<T extends TypesGeneric$3 = Types$4> = T['settings'];\ntype InitSettings$3<T extends TypesGeneric$3 = Types$4> = T['initSettings'];\ntype Mapping$1<T extends TypesGeneric$3 = Types$4> = T['mapping'];\ntype Env$3<T extends TypesGeneric$3 = Types$4> = T['env'];\ntype SetupOptions$2<T extends TypesGeneric$3 = Types$4> = T['setup'];\ntype Credentials$2<T extends TypesGeneric$3 = Types$4> = T['credentials'];\n/**\n * Inference helper: Extract Types from Instance\n */\ntype TypesOf$3<I> = I extends Instance$5<infer T> ? T : never;\ninterface Instance$5<T extends TypesGeneric$3 = Types$4> {\n config: Config$5<T>;\n queuePush?: Events;\n queueOn?: Array<{\n type: Types$2;\n data?: unknown;\n }>;\n dlq?: DLQ;\n batches?: BatchRegistry<Mapping$1<T>>;\n type?: string;\n /**\n * Observable env callables for trace-level vendor-call capture. Dot-paths of\n * the functions this destination invokes on its env, using the same grammar\n * as the dev-env `simulation` lists (incl. an optional `call:` prefix), e.g.\n * `['call:window.gtag']`. When present AND the collector reports trace level,\n * the per-event push env is wrapped (via `wrapEnv`) so each listed call is\n * recorded onto the destination out record. Absent or empty = no capture.\n */\n calls?: string[];\n env?: Env$3<T>;\n setup?: SetupFn<Config$5<T>, Env$3<T>>;\n init?: InitFn$2<T>;\n push: PushFn<T>;\n pushBatch?: PushBatchFn<T>;\n on?: OnFn;\n destroy?: DestroyFn<Config$5<T>, Env$3<T>>;\n}\ninterface Config$5<T extends TypesGeneric$3 = Types$4> {\n /** Required consent states to push events; queues events when not granted. */\n consent?: Consent;\n /** Implementation-specific configuration passed to the init function. */\n settings?: InitSettings$3<T>;\n /**\n * Optional, strictly-typed credentials slot. Back it with a managed secret\n * via `$secret.NAME` (credentials use `$secret`, not `$env`). The package\n * defines the shape via `Types['credentials']`. `settings.<sdk>` stays the\n * escape hatch for raw SDK options.\n */\n credentials?: Credentials$2<T>;\n /** Global data transformation applied to all events; result passed as context.data to push. */\n data?: Value | Values;\n /** Event sections to flatten into context.data. */\n include?: string[];\n /** Runtime dependencies merged from code and config env; extensible per destination. */\n env?: Env$3<T>;\n /** Destination identifier; auto-generated if not provided. */\n id?: string;\n /** Whether the destination has been initialized; prevents re-initialization. */\n init?: boolean;\n /** Whether to load external scripts (e.g., gtag.js); destination-specific behavior. */\n loadScript?: boolean;\n /** Logger configuration (level, handler) to override the collector's defaults. */\n logger?: Config$3;\n /** Entity-action rules to filter, rename, transform, and batch events for this destination. */\n mapping?: Rules<Rule<Mapping$1<T>>>;\n /** Pre-processing rules applied to all events before mapping; modifies events in-place. */\n policy?: Policy;\n /** Whether to queue events when consent is not granted; defaults to true. */\n queue?: boolean;\n /** Defer destination initialization until these collector events fire (e.g., `['consent']`). */\n require?: string[];\n /**\n * Provisioning options for `walkeros setup`. `boolean | object`.\n * Triggered only by explicit CLI invocation; never automatic.\n */\n setup?: boolean | SetupOptions$2<T>;\n /** Transformer chain to run after collector processing but before this destination. */\n before?: Route;\n /** Transformer chain to run after destination push completes. Push response available at ingest._response. */\n next?: Route;\n /** Cache configuration for deduplication (step-level: skip push on HIT). */\n cache?: Cache;\n /** Declarative store get/set operations applied around this destination. */\n state?: State | State[];\n /** Completely skip this destination — no init, no push, no queuing. */\n disabled?: boolean;\n /**\n * Per-destination delivery timeout in ms (default 10000); a delivery that\n * does not settle within this window is routed to the DLQ like a thrown push.\n */\n timeout?: number;\n /** Return this value instead of calling push(). Uses !== undefined check to support falsy values. */\n mock?: unknown;\n /**\n * Maximum number of consent-denied events retained in `queuePush` for\n * this destination. Overflow drops oldest (FIFO). Default 1000.\n */\n queueMax?: number;\n /**\n * Maximum number of failed-push entries retained in `dlq` for this\n * destination. Overflow drops oldest (FIFO). Default 100.\n */\n dlqMax?: number;\n /**\n * Enables batching for ALL of this destination's events into one shared\n * default buffer. A mapping rule's own `batch` splits that entity-action\n * into its own buffer and overrides per field (`rule ?? config ?? default`).\n * Batching stays off when neither is set. A bare number is treated as the\n * debounce `wait` window.\n *\n * - `wait`: debounce window in ms; the timer resets on every push.\n * - `size`: hard count cap; flush immediately when entries reach this number. Default 1000 when batching is enabled.\n * - `age`: time since the first entry of the current window. Forces a flush even if pushes keep arriving. Default 30000 (30s).\n */\n batch?: number | BatchOptions;\n /**\n * Per-destination circuit breaker. Presence-gated: when unset the breaker is\n * inert and behavior is unchanged. After `threshold` CONSECUTIVE transport\n * failures (a thrown push, a timed-out push, a whole-batch throw, a\n * connection-level `reportError(err, event)`) the breaker opens and events\n * are skipped (counted, not pushed) until `cooldown` ms elapse, then a single\n * probe event is allowed; its success closes the breaker, its failure\n * re-opens it. Partial-batch row failures are breaker-neutral. A bare number\n * is the `threshold`.\n *\n * - `threshold`: consecutive transport failures before opening. Default 5.\n * - `cooldown`: ms an open breaker waits before admitting a probe. Default 30000.\n */\n breaker?: number | BreakerOptions;\n}\n/**\n * Circuit-breaker tuning. Used at the destination-config layer\n * (`Destination.Config.breaker`). A bare number is treated as `threshold`.\n */\ninterface BreakerOptions {\n /** Consecutive transport failures before the breaker opens. Default 5. */\n threshold?: number;\n /** Milliseconds an open breaker waits before admitting a probe. Default 30000. */\n cooldown?: number;\n}\n/**\n * Batch scheduling options. Used at both the mapping-rule layer\n * (`Mapping.Rule.batch`) and the destination-config layer\n * (`Destination.Config.batch`). Same shape at both layers.\n */\ninterface BatchOptions {\n /** Debounce window in ms. Timer resets on every push. */\n wait?: number;\n /** Hard count cap. Flushes immediately at this size. */\n size?: number;\n /** Hard age cap in ms since first entry of current window. */\n age?: number;\n}\ntype PartialConfig$2<T extends TypesGeneric$3 = Types$4> = Config$5<Types$4<Partial<Settings$3<T>> | Settings$3<T>, Partial<Mapping$1<T>> | Mapping$1<T>, Env$3<T>, InitSettings$3<T>, SetupOptions$2<T>, Credentials$2<T>>>;\ninterface Policy {\n [key: string]: Value;\n}\ntype Code$1<T extends TypesGeneric$3 = Types$4> = Instance$5<T>;\ntype Init$3<T extends TypesGeneric$3 = Types$4> = {\n code: Code$1<T>;\n config?: Partial<Config$5<T>>;\n env?: Partial<Env$3<T>>;\n before?: Route;\n next?: Route;\n cache?: Cache;\n state?: State | State[];\n};\ninterface InitDestinations {\n [key: string]: Init$3<any>;\n}\ninterface Destinations {\n [key: string]: Instance$5;\n}\n/**\n * Context provided to destination functions.\n * Extends base context with destination-specific properties.\n */\ninterface Context$5<T extends TypesGeneric$3 = Types$4> extends Base<Config$5<T>, Env$3<T>> {\n id: string;\n data?: Data;\n}\ninterface PushContext<T extends TypesGeneric$3 = Types$4> extends Context$5<T> {\n ingest: Ingest;\n rule?: Rule<Mapping$1<T>>;\n}\ninterface PushBatchContext<T extends TypesGeneric$3 = Types$4> extends Context$5<T> {\n ingest: Ingest;\n rule?: Rule<Mapping$1<T>>;\n}\ntype InitFn$2<T extends TypesGeneric$3 = Types$4> = (context: Context$5<T>) => PromiseOrValue<void | false | Config$5<T>>;\ntype PushFn<T extends TypesGeneric$3 = Types$4> = (event: Event, context: PushContext<T>) => PromiseOrValue<void | unknown>;\n/**\n * Per-row outcome for a single failed batch entry.\n *\n * `index` is the position into the flushed batch's `entries` array (the same\n * order `flushBatch` iterates), so the collector can route exactly that entry\n * to the DLQ. `error` is the per-row failure carried into the DLQ pair; when\n * omitted the collector substitutes a generic batch error.\n */\ninterface BatchFailure {\n index: number;\n error?: unknown;\n}\n/**\n * Partial-failure result of a `pushBatch` call.\n *\n * `failed` lists the entries (by index into the flushed batch's `entries`\n * array) that did NOT succeed. Every other entry is treated as delivered.\n */\ninterface BatchOutcome {\n failed: BatchFailure[];\n}\n/**\n * Pushes a batch of events to a destination.\n *\n * Return contract (backward-compatible, additive):\n * - Resolve `void` (the historical contract): the WHOLE batch succeeded. The\n * collector counts every entry as delivered.\n * - Throw / reject: the WHOLE batch failed. The collector routes every entry\n * to the DLQ and increments `failed` by the batch size. Unchanged.\n * - Resolve a `BatchOutcome`: PARTIAL failure. Only the entries listed in\n * `outcome.failed` (by `index` into the flushed `entries` array) are routed\n * to the DLQ and counted as failed, each with its own `error`. The remaining\n * entries are counted as delivered. This lets a destination report row-level\n * failures without forcing already-succeeded rows onto the DLQ, which would\n * duplicate them on a later DLQ retry.\n *\n * Indices in `failed` must line up with the order of `batch.entries`.\n */\ntype PushBatchFn<T extends TypesGeneric$3 = Types$4> = (batch: Batch<Mapping$1<T>>, context: PushBatchContext<T>) => PromiseOrValue<void | BatchOutcome>;\ntype PushEvent<Mapping = unknown> = {\n event: Event;\n mapping?: Rule<Mapping>;\n};\ntype PushEvents<Mapping = unknown> = Array<PushEvent<Mapping>>;\ninterface BatchEntry<Mapping = unknown> {\n event: Event;\n ingest?: Ingest;\n respond?: RespondFn;\n rule?: Rule<Mapping>;\n data?: Data;\n}\ninterface Batch<Mapping> {\n key: string;\n /**\n * Per-event entries carrying per-event ingest, respond, rule, and data.\n * Destinations needing per-event metadata should read this instead of\n * (or in addition to) `events` and `data`.\n */\n entries: BatchEntry<Mapping>[];\n /** Derived view: events from `entries`. Kept for back-compat. */\n events: Events;\n /** Derived view: data from `entries`. Kept for back-compat. */\n data: Array<Data>;\n mapping?: Rule<Mapping>;\n}\ninterface BatchRegistry<Mapping> {\n [mappingKey: string]: {\n batched: Batch<Mapping>;\n /**\n * Marks a buffer created by `config.batch` (the destination-wide default\n * batch) rather than a mapping rule's own `batch`. The default buffer is\n * heterogeneous, so its flush reports `rule: undefined` to consumers.\n */\n isDefault?: boolean;\n batchFn: () => void;\n /**\n * Force a flush of the current batch immediately. Used by shutdown\n * drain and by tests for deterministic flushing without timer\n * advancement. Resolves after the underlying `pushBatch` settles.\n */\n flush: () => Promise<void>;\n };\n}\ntype Data = Property | undefined | Array<Property | undefined>;\ninterface Ref {\n type: string;\n data?: unknown;\n error?: unknown;\n}\ntype Push$1 = {\n queuePush?: Events;\n error?: unknown;\n};\ntype DLQ = Array<[Event, unknown]>;\n/**\n * Typed accessor for destinations registered on a collector.\n *\n * The collector's `destinations` bag indexes to `Destination.Instance`\n * (defaults erase the generic). Use this helper at the call site to recover\n * the narrow type without casts.\n *\n * @example\n * type MyDestTypes = Destination.Types<MySettings, MyMapping>;\n * const dest = getDestination<MyDestTypes>(collector, 'myDest');\n * await dest.push(event, context);\n *\n * @throws Error with message `Destination not found: <id>` when the id is unknown.\n */\ndeclare function getDestination<T extends TypesGeneric$3 = Types$4>(collector: {\n destinations: {\n [id: string]: Instance$5<any>;\n };\n}, id: string): Instance$5<T>;\n\ntype destination_Batch<Mapping> = Batch<Mapping>;\ntype destination_BatchEntry<Mapping = unknown> = BatchEntry<Mapping>;\ntype destination_BatchFailure = BatchFailure;\ntype destination_BatchOptions = BatchOptions;\ntype destination_BatchOutcome = BatchOutcome;\ntype destination_BatchRegistry<Mapping> = BatchRegistry<Mapping>;\ntype destination_BreakerOptions = BreakerOptions;\ntype destination_DLQ = DLQ;\ntype destination_Data = Data;\ntype destination_Destinations = Destinations;\ntype destination_EnvObserve = EnvObserve;\ntype destination_InitDestinations = InitDestinations;\ntype destination_Policy = Policy;\ntype destination_PushBatchContext<T extends TypesGeneric$3 = Types$4> = PushBatchContext<T>;\ntype destination_PushBatchFn<T extends TypesGeneric$3 = Types$4> = PushBatchFn<T>;\ntype destination_PushContext<T extends TypesGeneric$3 = Types$4> = PushContext<T>;\ntype destination_PushEvent<Mapping = unknown> = PushEvent<Mapping>;\ntype destination_PushEvents<Mapping = unknown> = PushEvents<Mapping>;\ntype destination_PushFn<T extends TypesGeneric$3 = Types$4> = PushFn<T>;\ntype destination_Ref = Ref;\ndeclare const destination_getDestination: typeof getDestination;\ndeclare namespace destination {\n export { type BaseEnv$3 as BaseEnv, type destination_Batch as Batch, type destination_BatchEntry as BatchEntry, type destination_BatchFailure as BatchFailure, type destination_BatchOptions as BatchOptions, type destination_BatchOutcome as BatchOutcome, type destination_BatchRegistry as BatchRegistry, type destination_BreakerOptions as BreakerOptions, type Code$1 as Code, type Config$5 as Config, type Context$5 as Context, type Credentials$2 as Credentials, type destination_DLQ as DLQ, type destination_Data as Data, type destination_Destinations as Destinations, type Env$3 as Env, type destination_EnvObserve as EnvObserve, type Init$3 as Init, type destination_InitDestinations as InitDestinations, type InitFn$2 as InitFn, type InitSettings$3 as InitSettings, type Instance$5 as Instance, type Mapping$1 as Mapping, type PartialConfig$2 as PartialConfig, type destination_Policy as Policy, type Push$1 as Push, type destination_PushBatchContext as PushBatchContext, type destination_PushBatchFn as PushBatchFn, type destination_PushContext as PushContext, type destination_PushEvent as PushEvent, type destination_PushEvents as PushEvents, type destination_PushFn as PushFn, type destination_Ref as Ref, type Settings$3 as Settings, type SetupOptions$2 as SetupOptions, type Types$4 as Types, type TypesGeneric$3 as TypesGeneric, type TypesOf$3 as TypesOf, destination_getDestination as getDestination };\n}\n\ninterface EventFn<R = Promise<PushResult>> {\n (partialEvent: DeepPartialEvent): R;\n (event: string): R;\n (event: string, data: Properties): R;\n}\ninterface Fn$3<R = Promise<PushResult>, Config = unknown> extends EventFn<R>, WalkerCommands<R, Config> {\n}\ninterface WalkerCommands<R = Promise<PushResult>, Config = unknown> {\n (event: 'walker config', config: Partial<Config>): R;\n (event: 'walker consent', consent: Consent): R;\n <T extends Types$4>(event: 'walker destination', init: Init$3<T>): R;\n <K extends keyof Functions>(event: 'walker hook', init: {\n name: K;\n fn: Functions[K];\n }): R;\n (event: 'walker on', init: {\n type: Types$2;\n rules: SingleOrArray<Subscription>;\n }): R;\n (event: 'walker user', user: User): R;\n (event: 'walker run', runState?: {\n consent?: Consent;\n user?: User;\n globals?: Properties;\n custom?: Properties;\n }): R;\n}\ntype Event$1<R = Promise<PushResult>> = (partialEvent: DeepPartialEvent) => R;\ntype PushData<Config = unknown> = DeepPartial<Config> | Consent | User | Properties;\ninterface PushResult {\n ok: boolean;\n event?: Event;\n done?: Record<string, Ref>;\n queued?: Record<string, Ref>;\n failed?: Record<string, Ref>;\n}\ntype Layer = Array<IArguments | DeepPartialEvent | unknown[]>;\n\ntype elb_EventFn<R = Promise<PushResult>> = EventFn<R>;\ntype elb_Layer = Layer;\ntype elb_PushData<Config = unknown> = PushData<Config>;\ntype elb_PushResult = PushResult;\ntype elb_WalkerCommands<R = Promise<PushResult>, Config = unknown> = WalkerCommands<R, Config>;\ndeclare namespace elb {\n export type { Event$1 as Event, elb_EventFn as EventFn, Fn$3 as Fn, elb_Layer as Layer, elb_PushData as PushData, elb_PushResult as PushResult, elb_WalkerCommands as WalkerCommands };\n}\n\n/**\n * Unified route grammar for Flow v4. A `Route` is one of:\n * - a transformer ID string (`\"redact\"`)\n * - a sequence of routes (`[\"a\", \"b\", \"c\"]` — sugar for chained `.next`)\n * - a `RouteConfig` — a gated / dispatching node.\n *\n * `RouteConfig` is a disjoint union — set exactly one of `next`, `one`,\n * `many`, or neither (pure gate). The disjointness is enforced by `never`\n * sibling properties at the type level and `z.strictObject` at the schema\n * level.\n *\n * Operators:\n * - `next`: single continuation.\n * - `one`: first-match dispatch (walk entries, first whose match passes wins).\n * - `many`: all-match terminal fan-out (every matching entry spawns an\n * independent flow; main chain terminates here). Restricted to\n * pre-collector positions (source.next, transformer.next, transformer.before).\n */\ntype Route = string | Route[] | RouteConfig;\ntype RouteConfig = RouteNextConfig | RouteOneConfig | RouteManyConfig | RouteGateConfig;\ninterface RouteNextConfig {\n match?: MatchExpression;\n next: Route;\n one?: never;\n many?: never;\n}\ninterface RouteOneConfig {\n match?: MatchExpression;\n one: Route[];\n next?: never;\n many?: never;\n}\ninterface RouteManyConfig {\n match?: MatchExpression;\n many: Route[];\n next?: never;\n one?: never;\n}\ninterface RouteGateConfig {\n match: MatchExpression;\n next?: never;\n one?: never;\n many?: never;\n}\n/**\n * Base environment interface for walkerOS transformers.\n *\n * Minimal like Destination - just an extensible object.\n * Transformers receive dependencies through context, not env.\n */\ninterface BaseEnv$2 {\n [key: string]: unknown;\n}\n/**\n * Type bundle for transformer generics.\n * Groups Settings, InitSettings, and Env into a single type parameter.\n * Follows the Source/Destination pattern.\n *\n * @template S - Settings configuration type\n * @template E - Environment type\n * @template I - InitSettings configuration type (user input)\n */\ninterface Types$3<S = unknown, E = BaseEnv$2, I = S> {\n settings: S;\n initSettings: I;\n env: E;\n}\n/**\n * Generic constraint for Types - ensures T has required properties for indexed access.\n */\ntype TypesGeneric$2 = {\n settings: any;\n initSettings: any;\n env: any;\n};\n/**\n * Type extractors for consistent usage with Types bundle.\n */\ntype Settings$2<T extends TypesGeneric$2 = Types$3> = T['settings'];\ntype InitSettings$2<T extends TypesGeneric$2 = Types$3> = T['initSettings'];\ntype Env$2<T extends TypesGeneric$2 = Types$3> = T['env'];\n/**\n * Inference helper: Extract Types from Instance.\n */\ntype TypesOf$2<I> = I extends Instance$4<infer T> ? T : never;\n/**\n * Transformer configuration.\n */\ninterface Config$4<T extends TypesGeneric$2 = Types$3> {\n settings?: InitSettings$2<T>;\n env?: Env$2<T>;\n id?: string;\n logger?: Config$3;\n before?: Route;\n next?: Route;\n cache?: Cache;\n /** Declarative store get/set operations applied around this transformer. */\n state?: State | State[];\n init?: boolean;\n disabled?: boolean;\n /** Return this value instead of calling push(). Global mock for all chains. */\n mock?: unknown;\n /** Path-specific mock values keyed by chain path (e.g., \"destination.ga4.before\"). Takes precedence over global mock. */\n chainMocks?: Record<string, unknown>;\n /**\n * Declarative event-to-event mapping applied when this transformer step\n * has no `code`. Same field name as on `Destination.Config`, but the\n * semantic differs by position: on a destination, `mapping` produces a\n * vendor-shaped payload; on a transformer step, it mutates the event\n * itself. The collector synthesizes a push that runs\n * `processEventMapping` and returns the transformed event (or drops it\n * when a rule has `ignore: true`).\n *\n * At the transformer position, only event-mutating fields apply:\n * `policy`, `mapping[].policy`, `mapping[].name`, `mapping[].ignore`,\n * `mapping[].consent`, `include`. Vendor-payload fields (`data`,\n * `mapping[].data`, `silent`) are ignored at this position with a\n * one-time warning.\n */\n mapping?: Config$7;\n}\n/**\n * Context provided to transformer functions.\n * Extends base context with transformer-specific properties.\n */\ninterface Context$4<T extends TypesGeneric$2 = Types$3> extends Base<Config$4<T>, Env$2<T>> {\n id: string;\n ingest: Ingest;\n}\n/**\n * Unified result type for transformer functions.\n * Replaces the old union return type with a structured object.\n *\n * @field event - Modified event to continue with\n * @field respond - Wrapped respond function for downstream transformers\n * @field next - Branch to a different chain (replaces BranchResult)\n */\ninterface Result$1<E = DeepPartialEvent> {\n event?: E;\n respond?: RespondFn;\n next?: Route;\n}\n/**\n * Result of running a transformer chain.\n * Returns the processed event (singular, fan-out array, or null if dropped)\n * alongside the potentially wrapped respond function.\n *\n * `stopped` signals pipeline-halt — when set, the caller MUST NOT propagate\n * the event further downstream (no destinations, no subsequent chains).\n * Used by `cache.stop: true` on pre-collector transformers so the documented\n * \"downstream transformers and destinations are skipped\" semantic holds.\n */\ninterface ChainResult {\n event: DeepPartialEvent | DeepPartialEvent[] | null;\n respond?: RespondFn;\n stopped?: true;\n}\n/**\n * The main transformer function.\n *\n * Pre-collector transformers use default E = DeepPartialEvent.\n * Post-collector transformers can use E = Event for type-safe access.\n * A transformer written for DeepPartialEvent works in both positions\n * because Event is a subtype of DeepPartialEvent.\n *\n * @returns Result - structured result with event, respond, next\n * @returns Result[] - fan-out: each Result continues independently through remaining chain\n * @returns void - continue with current event unchanged (passthrough)\n * @returns false - stop chain, cancel further processing\n */\ntype Fn$2<T extends TypesGeneric$2 = Types$3, E = DeepPartialEvent> = (event: E, context: Context$4<T>) => PromiseOrValue<Result$1<E> | Result$1<E>[] | false | void>;\n/**\n * Optional initialization function.\n * Called once before first push.\n *\n * @param context - Transformer context\n * @returns void - initialization successful\n * @returns false - initialization failed, skip this transformer\n * @returns Config<T> - return updated config\n */\ntype InitFn$1<T extends TypesGeneric$2 = Types$3> = (context: Context$4<T>) => PromiseOrValue<void | false | Config$4<T>>;\n/**\n * Transformer instance returned by Init function.\n */\ninterface Instance$4<T extends TypesGeneric$2 = Types$3> {\n type: string;\n config: Config$4<T>;\n push: Fn$2<T>;\n init?: InitFn$1<T>;\n destroy?: DestroyFn<Config$4<T>, Env$2<T>>;\n}\n/**\n * Transformer initialization function.\n * Creates a transformer instance from context.\n */\ntype Init$2<T extends TypesGeneric$2 = Types$3> = (context: Context$4<Types$3<Partial<Settings$2<T>>, Env$2<T>, InitSettings$2<T>>>) => Instance$4<T> | Promise<Instance$4<T>>;\n/**\n * Configuration for initializing a transformer.\n * Used in collector registration.\n */\ntype InitTransformer<T extends TypesGeneric$2 = Types$3> = {\n /**\n * Initialization function. When omitted, the entry is a pass-through step:\n * - If `mapping` is present, the collector synthesizes a mapping-only\n * push using `processEventMapping`.\n * - Otherwise it's a named hop that only hosts a `before` / `next` /\n * `cache` chain.\n *\n * Validation: an entry without `code` must declare at least one of\n * `package`, `before`, `next`, `cache`, `state`, `mapping`. Enforced by\n * `validateStepEntry` in `@walkeros/core`.\n */\n code?: Init$2<T>;\n config?: Partial<Config$4<T>>;\n env?: Partial<Env$2<T>>;\n before?: Route;\n next?: Route;\n cache?: Cache;\n state?: State | State[];\n mapping?: Config$7;\n};\n/**\n * Transformers configuration for collector.\n * Maps transformer IDs to their initialization configurations.\n */\ninterface InitTransformers {\n [transformerId: string]: InitTransformer<any>;\n}\n/**\n * Active transformer instances registry.\n */\ninterface Transformers {\n [transformerId: string]: Instance$4;\n}\n/**\n * Typed accessor for transformers registered on a collector.\n *\n * The collector's `transformers` bag indexes to `Transformer.Instance`\n * (defaults erase the generic). Use this helper at the call site to recover\n * the narrow type without casts.\n *\n * @example\n * type MyTransformerTypes = Transformer.Types<MySettings>;\n * const tx = getTransformer<MyTransformerTypes>(collector, 'redact');\n * await tx.push(event, context);\n *\n * @throws Error with message `Transformer not found: <id>` when the id is unknown.\n */\ndeclare function getTransformer<T extends TypesGeneric$2 = Types$3>(collector: {\n transformers: {\n [id: string]: Instance$4<any>;\n };\n}, id: string): Instance$4<T>;\n\ntype transformer_ChainResult = ChainResult;\ntype transformer_InitTransformer<T extends TypesGeneric$2 = Types$3> = InitTransformer<T>;\ntype transformer_InitTransformers = InitTransformers;\ntype transformer_Route = Route;\ntype transformer_RouteConfig = RouteConfig;\ntype transformer_RouteGateConfig = RouteGateConfig;\ntype transformer_RouteManyConfig = RouteManyConfig;\ntype transformer_RouteNextConfig = RouteNextConfig;\ntype transformer_RouteOneConfig = RouteOneConfig;\ntype transformer_Transformers = Transformers;\ndeclare const transformer_getTransformer: typeof getTransformer;\ndeclare namespace transformer {\n export { type BaseEnv$2 as BaseEnv, type transformer_ChainResult as ChainResult, type Config$4 as Config, type Context$4 as Context, type Env$2 as Env, type Fn$2 as Fn, type Init$2 as Init, type InitFn$1 as InitFn, type InitSettings$2 as InitSettings, type transformer_InitTransformer as InitTransformer, type transformer_InitTransformers as InitTransformers, type Instance$4 as Instance, type Result$1 as Result, type transformer_Route as Route, type transformer_RouteConfig as RouteConfig, type transformer_RouteGateConfig as RouteGateConfig, type transformer_RouteManyConfig as RouteManyConfig, type transformer_RouteNextConfig as RouteNextConfig, type transformer_RouteOneConfig as RouteOneConfig, type Settings$2 as Settings, type transformer_Transformers as Transformers, type Types$3 as Types, type TypesGeneric$2 as TypesGeneric, type TypesOf$2 as TypesOf, transformer_getTransformer as getTransformer };\n}\n\n/**\n * Structural JSON Schema type. Kept dep-free (no `ajv` import in core)\n * so the runtime graph of any consumer of `@walkeros/core` does not pull\n * AJV transitively.\n */\ntype JsonSchema = Record<string, unknown>;\n/**\n * Entity-action keyed event validation schemas.\n * Wildcard fallback semantic: entity.action → entity.* → *.action → *.*.\n */\ntype ValidateEvents = Record<string, Record<string, JsonSchema>>;\n\n/**\n * Flow Configuration System (v4)\n *\n * Core types for walkerOS unified configuration.\n * Platform-agnostic, runtime-focused.\n *\n * The Flow system enables \"one config to rule them all\" - a single\n * walkeros.config.json file that manages multiple flows\n * (web_prod, web_stage, server_prod, etc.) with shared configuration\n * and reusable variables.\n *\n * Single declaration merge: `Flow` is both the interface for one flow\n * and the namespace holding all related types.\n *\n * ## Connection Rules\n *\n * Sources use `next` to connect to transformers (pre-collector chain).\n * Sources use `before` for consent-exempt pre-source preprocessing\n * (decode, validate, authenticate raw input before the source.next chain).\n *\n * Destinations use `before` to connect to transformers (post-collector chain).\n * Destinations use `next` for post-push processing.\n *\n * Transformers use `next` to chain to other transformers. The same transformer\n * pool is shared by both pre-collector and post-collector chains.\n *\n * The collector is implicit - it is never referenced directly in connections.\n * It sits between the source chain and the destination chain automatically.\n *\n * Circular `next` references are safely handled at runtime by `walkChain()`\n * in the collector module (visited-set detection).\n *\n * ```\n * Source → [before → Preprocessing] → [next → Transformer chain] → Collector → [before → Transformer chain] → Destination → [next → Post-push]\n * ```\n *\n * @packageDocumentation\n */\n\n/**\n * Single flow configuration.\n *\n * Represents one deployment target (e.g., web_prod, server_stage).\n * Platform is determined by `config.platform` ('web' | 'server').\n *\n * Variables cascade (resolveFlowSettings): step > flow > root config.\n * \"step\" applies uniformly to source, destination, transformer, and store.\n */\ninterface Flow {\n /** Per-flow configuration: platform, url, settings, bundle. */\n config?: Flow.Config;\n /**\n * Source configurations (data capture).\n *\n * Sources capture events from various origins:\n * - Browser DOM interactions (clicks, page views)\n * - DataLayer pushes\n * - HTTP requests (server-side)\n * - Cloud function triggers\n *\n * Key = unique source identifier (arbitrary)\n * Value = source reference with package and config\n */\n sources?: Record<string, Flow.Source>;\n /**\n * Destination configurations (data output).\n *\n * Destinations send processed events to external services:\n * - Google Analytics (gtag)\n * - Meta Pixel (fbq)\n * - Custom APIs\n * - Data warehouses\n *\n * Key = unique destination identifier (arbitrary)\n * Value = destination reference with package and config\n */\n destinations?: Record<string, Flow.Destination>;\n /**\n * Transformer configurations (event transformation).\n *\n * Pre-collector (source.next) or post-collector (destination.before).\n *\n * Key = unique transformer identifier (referenced by source.next or destination.before)\n * Value = transformer reference with package and config\n */\n transformers?: Record<string, Flow.Transformer>;\n /**\n * Store configurations (key-value storage).\n *\n * Stores provide key-value storage consumed by sources, transformers,\n * and destinations via env injection. Referenced using $store.storeId\n * prefix in env values.\n *\n * Key = unique store identifier (arbitrary)\n * Value = store reference with package and config\n */\n stores?: Record<string, Flow.Store>;\n /**\n * Collector configuration (event processing).\n *\n * The collector is the central event processing engine.\n * Configuration includes consent management, global properties,\n * user identification, and processing rules.\n */\n collector?: InitConfig;\n /**\n * Flow-level variables.\n * Override root variables; overridden by source/destination variables.\n */\n variables?: Flow.Variables;\n}\ndeclare namespace Flow {\n /**\n * Complete multi-flow configuration.\n * Root type for walkeros.config.json files.\n *\n * If only one flow exists, it's auto-selected without --flow flag.\n * Convention: use \"default\" as the flow name for single-flow configs.\n *\n * @example\n * ```json\n * {\n * \"version\": 4,\n * \"$schema\": \"https://walkeros.io/schema/flow/v4.json\",\n * \"variables\": { \"CURRENCY\": \"USD\" },\n * \"flows\": {\n * \"default\": { \"config\": { \"platform\": \"web\" } }\n * }\n * }\n * ```\n */\n interface Json {\n /** Configuration schema version. */\n version: 4;\n /**\n * JSON Schema reference for IDE validation.\n * @example \"https://walkeros.io/schema/flow/v4.json\"\n */\n $schema?: string;\n /**\n * Folders to include in the bundle output.\n * Copied to dist/ during bundle, available at runtime for both local and Docker execution.\n *\n * Use for credential files, configuration, or other runtime assets.\n * Paths are relative to the config file location.\n * Default: `[\"./shared\"]` if the folder exists, otherwise `[]`.\n */\n include?: string[];\n /**\n * Shared variables for interpolation.\n * Resolution: destination/source > flow > root.\n * Syntax: $var.name\n */\n variables?: Variables;\n /**\n * Data contract definition.\n * Entity → action keyed JSON Schema with additive inheritance.\n */\n contract?: Contract;\n /**\n * Named flow configurations.\n * If only one flow exists, it's auto-selected.\n */\n flows: Record<string, Flow>;\n }\n /**\n * Per-flow configuration block.\n *\n * Groups platform identity, optional public URL, arbitrary settings bag,\n * and bundle (build-time) configuration.\n */\n interface Config {\n /**\n * Platform identity for this flow.\n * - `web` builds to IIFE format, ES2020 target, browser platform.\n * - `server` builds to ESM format, Node18 target, node platform.\n */\n platform: 'web' | 'server';\n /**\n * Public URL where this flow is reachable (for cross-flow `$flow.X.url` references).\n * Set explicitly by the user; the deployment process does not auto-populate it.\n */\n url?: string;\n /**\n * Arbitrary key-value settings consumed by the platform runtime.\n *\n * For web: typical keys include `windowCollector`.\n * For server: reserved for future server-specific options.\n *\n * The `windowElb` key is deprecated: the browser source is the single writer\n * of `window[settings.elb]`, so set the browser source's\n * `config.settings.elb` instead. The CLI forwards a `windowElb` value onto\n * that field during bundling for backward compatibility.\n *\n * This is a free-form bag — type promotion happens later if patterns emerge.\n */\n settings?: Settings;\n /**\n * Bundle configuration: NPM packages to include, transitive dependency\n * overrides, and extra trace includes for server bundles.\n * Consumed by the CLI bundler at build time.\n */\n bundle?: Bundle;\n /**\n * Observability configuration. Controls whether the runtime emits\n * FlowState records to a remote observer, and at what verbosity.\n *\n * When omitted, the runtime defaults to `{ level: 'standard' }` for\n * managed deployments. When `level: 'off'`, the bundle ships no\n * telemetry plumbing at all.\n */\n observe?: Observe;\n }\n /**\n * Observability configuration block.\n *\n * - `off` disables telemetry entirely (no hooks installed, no fetch).\n * - `standard` emits structural FlowState records (no inEvent/outEvent).\n * - `trace` emits full payloads on every hop. Use only for short debug\n * windows; the operator can also flip the deployment's `trace_until`\n * timestamp at runtime to enable trace without a redeploy.\n */\n interface Observe {\n level?: 'off' | 'standard' | 'trace';\n /** Deterministic sample fraction in [0, 1]. Defaults to 1. */\n sample?: number;\n }\n /**\n * Reusable values referenced via `$var.name` (with optional deep paths).\n * Whole-string references preserve native type; inline interpolation requires scalars.\n */\n type Variables = Record<string, unknown>;\n /**\n * Free-form settings bag inside `Flow.Config.settings`.\n * Mirrors the package settings convention (arbitrary keys).\n */\n type Settings = Record<string, unknown>;\n /**\n * Bundle configuration for a flow.\n *\n * Groups all build-time bundling concerns: NPM packages to include,\n * transitive dependency overrides, and extra trace includes (server only).\n * Consumed by the CLI bundler.\n *\n * The `flow.config.bundle.external` sub-field is no longer supported\n * (replaced by nft tracing in @walkeros/cli@4.x).\n */\n interface Bundle {\n /** NPM packages to bundle, keyed by package name. */\n packages?: Record<string, BundlePackage>;\n /**\n * Transitive dependency version pins.\n *\n * Maps package name to version spec. Applied during bundle package install\n * to force transitive dependencies to a specific version. Useful for\n * resolving conflicts between packages that depend on incompatible\n * versions of a shared dependency.\n *\n * @example\n * ```json\n * {\n * \"@amplitude/analytics-types\": \"2.11.1\"\n * }\n * ```\n */\n overrides?: Record<string, string>;\n /**\n * Extra paths the bundler must include in the trace output.\n *\n * Each entry is either a literal path or a glob (matched via picomatch),\n * resolved against the bundler's install root. Use as an escape hatch\n * when the file tracer cannot statically discover an asset (e.g.,\n * dynamic require, runtime configuration files).\n *\n * Server flows only.\n */\n traceInclude?: string[];\n }\n /**\n * Single bundle package entry.\n */\n interface BundlePackage {\n /** Version specifier (e.g., 'latest', '^2.0.0', '2.1.3'). */\n version?: string;\n /** Named imports to expose from the package. */\n imports?: string[];\n /** Local path to package directory (takes precedence over version). */\n path?: string;\n }\n /**\n * Inline code definition for sources/destinations/transformers/stores.\n * Used instead of `package` when defining inline functions.\n */\n interface Code {\n /** \"$code:...\" function (required). */\n push: string;\n /** Optional instance type identifier. */\n type?: string;\n /** Optional \"$code:...\" init function. */\n init?: string;\n }\n /**\n * Source reference with inline package syntax.\n *\n * References a source package and provides configuration.\n * The package is automatically downloaded and imported during build.\n * Alternatively, use `code` (string or inline Code) for inline code execution.\n */\n interface Source {\n /**\n * Package specifier with optional version.\n *\n * Formats:\n * - `\"@walkeros/web-source-browser\"` - latest\n * - `\"@walkeros/web-source-browser@2.0.0\"` - exact\n * - `\"@walkeros/web-source-browser@^2.0.0\"` - semver range\n *\n * Optional when `code` is used for inline code execution.\n */\n package?: string;\n /**\n * Inline code definition (object form only).\n *\n * Object: `{push, type?, init?}` for inline code definition.\n * For named-export selection from a package, use the `import` field with `package`.\n */\n code?: Code;\n /**\n * Named export from `package` to import as this source's implementation.\n *\n * Requires `package` to be set. Mutually exclusive with `code`.\n *\n * - Top-level identifier only: `/^[A-Za-z_$][A-Za-z0-9_$]*$/`. No dotted paths.\n * - `package: \"X\"` alone (no `import`, no `code`) loads X's default export.\n * - `package: \"X\"` + `import: \"fooFactory\"` loads named export `fooFactory` from X.\n *\n * @example\n * ```json\n * { \"package\": \"@walkeros/web-source-browser\", \"import\": \"sourceBrowser\" }\n * ```\n */\n import?: string;\n /**\n * Source-specific configuration. Structure depends on the source package.\n * Passed to the source's initialization function.\n */\n config?: unknown;\n /**\n * Source environment configuration.\n * Environment-specific settings merged with default source environment.\n */\n env?: unknown;\n /**\n * Mark as primary source (provides main ELB).\n *\n * The primary source's ELB function is returned by `startFlow()`.\n * Only one source should be marked as primary per flow.\n *\n * @default false\n */\n primary?: boolean;\n /**\n * First transformer in pre-source chain (consent-exempt).\n *\n * Runs before source.next chain. Consent-exempt because no analytics\n * event exists yet - these transformers handle transport-level preprocessing\n * (decode, validate, authenticate, normalize raw input).\n * Raw request data is available in context.ingest.\n */\n before?: Route;\n /**\n * First transformer in pre-collector chain.\n *\n * Name of the transformer to execute after this source captures an event.\n * Creates a pre-collector transformer chain. Chain ends at the collector.\n * If omitted, events route directly to the collector.\n * Can be an array for explicit chain control (bypasses transformer.next resolution).\n */\n next?: Route;\n /** Cache configuration for this source. */\n cache?: Cache<EventCacheRule>;\n /**\n * Source-level variables (highest priority in cascade).\n * Overrides flow and root variables.\n */\n variables?: Variables;\n /**\n * Named examples for testing and documentation.\n * Stripped during flow resolution (not included in bundles).\n */\n examples?: StepExamples;\n }\n /**\n * Destination reference with inline package syntax.\n *\n * References a destination package and provides configuration.\n * Structure mirrors `Flow.Source` for consistency.\n */\n interface Destination {\n /** Package specifier with optional version. Optional when `code` is provided. */\n package?: string;\n /**\n * Inline code definition (object form only).\n *\n * Object: `{push, type?, init?}` for inline code definition.\n * For named-export selection from a package, use the `import` field with `package`.\n */\n code?: Code;\n /**\n * Named export from `package` to import as this destination's implementation.\n * See `Flow.Source.import` for full rules.\n *\n * @example\n * ```json\n * { \"package\": \"@walkeros/web-destination-gtag\", \"import\": \"destinationGtag\" }\n * ```\n */\n import?: string;\n /**\n * Destination-specific configuration. Typically includes:\n * - settings: API keys, IDs, endpoints\n * - mapping: Event transformation rules\n * - consent: Required consent states\n * - policy: Processing rules\n */\n config?: unknown;\n /** Destination environment configuration, merged with default destination environment. */\n env?: unknown;\n /**\n * First transformer in post-collector chain.\n *\n * Name of the transformer to execute before sending events to this destination.\n * If omitted, events are sent directly from the collector.\n * Can be an array for explicit chain control.\n */\n before?: Route;\n /**\n * First transformer in post-push chain.\n *\n * Runs after destination.push completes. The push response is available\n * at context.ingest._response. Consent is inherited from the destination\n * gate - no separate consent check needed.\n */\n next?: Route;\n /** Cache configuration for this destination. */\n cache?: Cache<EventCacheRule>;\n /** Destination-level variables (highest priority in cascade). */\n variables?: Variables;\n /**\n * Named examples for testing and documentation.\n * Stripped during flow resolution.\n */\n examples?: StepExamples;\n }\n /**\n * Transformer reference with inline package syntax.\n *\n * Transformers transform events in the pipeline between sources and destinations.\n * Alternatively, use `code` for inline code execution.\n */\n interface Transformer {\n /** Package specifier with optional version. Optional when `code` is provided. */\n package?: string;\n /**\n * Inline code definition (object form only).\n *\n * Object: `{push, type?, init?}` for inline code definition.\n * For named-export selection from a package, use the `import` field with `package`.\n */\n code?: Code;\n /**\n * Named export from `package` to import as this transformer's implementation.\n * See `Flow.Source.import` for full rules.\n *\n * @example\n * ```json\n * { \"package\": \"@walkeros/transformer-ga4\", \"import\": \"transformerGa4\" }\n * ```\n */\n import?: string;\n /** Transformer-specific configuration. Structure depends on the package. */\n config?: unknown;\n /** Transformer environment configuration. */\n env?: unknown;\n /**\n * Pre-transformer chain.\n *\n * Runs before this transformer's push function.\n * Enables pre-processing or context loading before the main transform.\n * Uses the same chain resolution as source.next and destination.before.\n */\n before?: Route;\n /**\n * Next transformer in chain.\n *\n * Name of the next transformer to execute after this one.\n * In a pre-collector chain (source.next), terminates at the collector.\n * In a post-collector chain (destination.before), terminates at the destination.\n * If omitted, the chain ends and control passes to the next pipeline stage.\n * Array values define an explicit chain (no walking). Circular references\n * are safely detected at runtime by `walkChain()`.\n */\n next?: Route;\n /** Cache configuration for this transformer. */\n cache?: Cache<EventCacheRule>;\n /** Transformer-level variables (highest priority in cascade). */\n variables?: Variables;\n /**\n * Named examples for testing and documentation.\n * Stripped during flow resolution.\n */\n examples?: StepExamples;\n }\n /**\n * Store reference with inline package syntax.\n *\n * Stores provide key-value storage consumed by other components via env.\n * Unlike sources/transformers/destinations, stores have no chain properties\n * (no `next` or `before`) - they are passive infrastructure.\n */\n interface Store {\n /** Package specifier with optional version. Optional when `code` is provided. */\n package?: string;\n /**\n * Inline code definition (object form only).\n *\n * Object: `{push, type?, init?}` for inline code definition.\n * For named-export selection from a package, use the `import` field with `package`.\n */\n code?: Code;\n /**\n * Named export from `package` to import as this store's implementation.\n * See `Flow.Source.import` for full rules.\n *\n * @example\n * ```json\n * { \"package\": \"@walkeros/server-store-fs\", \"import\": \"storeFs\" }\n * ```\n */\n import?: string;\n /** Store-specific configuration. */\n config?: unknown;\n /** Store environment configuration. */\n env?: unknown;\n /**\n * Cache configuration for this store.\n *\n * When present, the collector wraps the bare store with a cache layer\n * (read-through, write-through, single-flight). The cache layer may\n * recursively delegate to another store via `cache.store`.\n */\n cache?: Cache<StoreCacheRule>;\n /** Store-level variables (highest priority in cascade). */\n variables?: Variables;\n /**\n * Named examples for testing and documentation.\n * Stripped during flow resolution.\n */\n examples?: StepExamples;\n }\n /**\n * Discriminator for the four step kinds in a Flow.\n *\n * Single source of truth for code that branches on step kind (bundler\n * codegen, validators, CLI helpers).\n */\n type StepKind = 'Source' | 'Transformer' | 'Destination' | 'Store';\n /**\n * Union of the four step interfaces.\n *\n * Use this where a function accepts \"any step in a flow\" — e.g. a\n * shared `validateReference` that branches on `StepKind` without\n * narrowing to one specific shape.\n */\n type Step = Source | Transformer | Destination | Store;\n /**\n * Named contract map.\n * Each key is a contract name, each value is a contract rule.\n *\n * @example\n * ```json\n * {\n * \"default\": { \"globals\": { ... }, \"consent\": { ... } },\n * \"web\": { \"extend\": \"default\", \"events\": { ... } },\n * \"server\": { \"extend\": \"default\", \"events\": { ... } }\n * }\n * ```\n */\n type Contract = Record<string, ContractRule>;\n /**\n * A single named contract rule.\n *\n * All sections are optional. Sections mirror WalkerOS.Event fields:\n * globals, context, custom, user, consent.\n * Entity-action schemas live under `events`.\n *\n * Use `extend` to inherit from another named contract (additive merge).\n */\n interface ContractRule {\n /** Inherit from another named contract entry. */\n extend?: string;\n /** Contract revision marker. */\n tagging?: number;\n /** Human-readable note. */\n description?: string;\n /** Entity-action keyed JSON Schemas (wildcard fallback at runtime). */\n events?: ValidateEvents;\n /** JSON Schema for the full event. */\n schema?: JsonSchema;\n }\n /**\n * JSON Schema object for contract rule validation.\n * Standard JSON Schema with description/examples annotations.\n * Compatible with AJV for runtime validation.\n */\n type ContractSchema = Record<string, unknown>;\n /**\n * Contract action entries keyed by action name.\n * Each value is a JSON Schema describing the expected WalkerOS.Event shape.\n * Use \"*\" as wildcard for all actions of an entity.\n */\n type ContractActions = Record<string, ContractSchema>;\n /**\n * Entity-action event map used inside contracts.\n * Keyed by entity name, each value is an action map.\n * Use \"*\" as wildcard for all entities or all actions.\n */\n type ContractEvents = Record<string, ContractActions>;\n /**\n * Walker command names that a step example can invoke instead of pushing\n * its `in` as a regular event. Mirrors the `elb('walker <command>', ...)`\n * surface in `WalkerCommands` (see types/elb.ts).\n *\n * - `config` - update collector config (maps to `elb('walker config', in)`)\n * - `consent` - update consent state (maps to `elb('walker consent', in)`)\n * - `user` - update user identification (maps to `elb('walker user', in)`)\n * - `run` - fire run state (maps to `elb('walker run', in)`)\n *\n * Note: `walker destination`, `walker hook`, and `walker on` are\n * intentionally excluded - they configure wiring, not test data.\n */\n type StepCommand = 'config' | 'consent' | 'user' | 'run';\n /** One observable effect: function/method call (`[callable, ...args]`) or return value (`['return', value]`). */\n type StepEffect = readonly [callable: string, ...args: unknown[]];\n /** The effects a step produces, in execution order. Empty = no observable effect (filtered, passthrough). */\n type StepOut = readonly StepEffect[];\n /**\n * Named example pair for a step.\n * `in` is the input to the step, `out` is the expected output.\n *\n * When `command` is set, the test runner invokes\n * `elb('walker <command>', in)` instead of pushing `in` as a regular event.\n * When `command` is absent (default), `in` is pushed as a normal event via\n * `elb(event)`.\n */\n interface StepExample {\n /** Human-readable title (overrides camelCase-to-spaced default heading in docs). */\n title?: string;\n description?: string;\n /**\n * Whether this example is meant for public consumption (docs, UI, MCP default output).\n * Defaults to `true`. Set to `false` for test-only fixtures that should stay out of\n * user-facing surfaces but still run in test suites and remain available to\n * `flow_simulate` / CLI `--simulate`.\n */\n public?: boolean;\n in?: unknown;\n /** Trigger metadata for sources - type and options for the trigger call. */\n trigger?: {\n /** Which mechanism to activate (e.g., 'click', 'POST', 'load'). */\n type?: string;\n /** Mechanism-specific options (e.g., CSS selector, threshold). */\n options?: unknown;\n };\n mapping?: unknown;\n out?: StepOut;\n /**\n * Invoke a walker command with `in` instead of pushing `in` as an event.\n * When set, the test runner calls `elb('walker <command>', in)`.\n * When absent (default), `in` is pushed as a regular event.\n */\n command?: StepCommand;\n }\n /** Named step examples keyed by scenario name. */\n type StepExamples = Record<string, StepExample>;\n}\n\ntype AnyFunction$1<P extends unknown[] = never[], R = unknown> = (...args: P) => R;\ntype Functions = {\n [key: string]: AnyFunction$1;\n};\ninterface Parameter<P extends unknown[], R> {\n fn: (...args: P) => R;\n result?: R;\n}\ntype HookFn<T extends AnyFunction$1> = (params: Parameter<Parameters<T>, ReturnType<T>>, ...args: Parameters<T>) => ReturnType<T>;\n\ntype hooks_Functions = Functions;\ntype hooks_HookFn<T extends AnyFunction$1> = HookFn<T>;\ndeclare namespace hooks {\n export type { AnyFunction$1 as AnyFunction, hooks_Functions as Functions, hooks_HookFn as HookFn };\n}\n\n/**\n * Log levels from most to least severe\n */\ndeclare enum Level {\n ERROR = 0,\n WARN = 1,\n INFO = 2,\n DEBUG = 3\n}\n/**\n * Normalized error context extracted from Error objects\n */\ninterface ErrorContext {\n message: string;\n name: string;\n stack?: string;\n cause?: unknown;\n}\n/**\n * Context passed to log handlers\n * If an Error was passed, it's normalized into the error property\n */\ninterface LogContext {\n [key: string]: unknown;\n error?: ErrorContext;\n}\n/**\n * Log message function signature\n * Accepts string or Error as message, with optional context\n */\ntype LogFn = (message: string | Error, context?: unknown | Error) => void;\n/**\n * Throw function signature - logs error then throws\n * Returns never as it always throws\n */\ntype ThrowFn = (message: string | Error, context?: unknown) => never;\n/**\n * Default handler function (passed to custom handlers for chaining)\n */\ntype DefaultHandler = (level: Level, message: string, context: LogContext, scope: string[]) => void;\n/**\n * Custom log handler function\n * Receives originalHandler to allow middleware-style chaining\n */\ntype Handler = (level: Level, message: string, context: LogContext, scope: string[], originalHandler: DefaultHandler) => void;\n/**\n * Logger instance with scoping support\n * All logs automatically include trace path from scoping\n */\ninterface Instance$3 {\n /**\n * Log an error message (always visible unless silenced)\n */\n error: LogFn;\n /**\n * Log a warning (degraded state, config issues, transient failures)\n */\n warn: LogFn;\n /**\n * Log an informational message\n */\n info: LogFn;\n /**\n * Log a debug message\n */\n debug: LogFn;\n /**\n * Log an error message and throw an Error\n * Combines logging and throwing in one call\n */\n throw: ThrowFn;\n /**\n * Output structured JSON data\n */\n json: (data: unknown) => void;\n /**\n * Create a scoped child logger with automatic trace path\n * @param name - Scope name (e.g., destination type, destination key)\n * @returns A new logger instance with the scope applied\n */\n scope: (name: string) => Instance$3;\n}\n/**\n * Logger configuration options\n */\ninterface Config$3 {\n /**\n * Minimum log level to display\n * @default Level.ERROR\n */\n level?: Level | keyof typeof Level;\n /**\n * Custom log handler function\n * Receives originalHandler to preserve default behavior\n */\n handler?: Handler;\n /** Custom handler for json() output. Default: console.log(JSON.stringify(data, null, 2)) */\n jsonHandler?: (data: unknown) => void;\n}\n/**\n * Internal config with resolved values and scope\n */\ninterface InternalConfig {\n level: Level;\n handler?: Handler;\n jsonHandler?: (data: unknown) => void;\n scope: string[];\n}\n/**\n * Logger factory function type\n */\ntype Factory = (config?: Config$3) => Instance$3;\n\ntype logger_DefaultHandler = DefaultHandler;\ntype logger_ErrorContext = ErrorContext;\ntype logger_Factory = Factory;\ntype logger_Handler = Handler;\ntype logger_InternalConfig = InternalConfig;\ntype logger_Level = Level;\ndeclare const logger_Level: typeof Level;\ntype logger_LogContext = LogContext;\ntype logger_LogFn = LogFn;\ntype logger_ThrowFn = ThrowFn;\ndeclare namespace logger {\n export { type Config$3 as Config, type logger_DefaultHandler as DefaultHandler, type logger_ErrorContext as ErrorContext, type logger_Factory as Factory, type logger_Handler as Handler, type Instance$3 as Instance, type logger_InternalConfig as InternalConfig, logger_Level as Level, type logger_LogContext as LogContext, type logger_LogFn as LogFn, type logger_ThrowFn as ThrowFn };\n}\n\n/** Collector state mapping for the `on` actions. */\ntype Config$2 = {\n config?: Array<GenericFn>;\n consent?: Array<ConsentRule>;\n custom?: Array<GenericFn>;\n globals?: Array<GenericFn>;\n ready?: Array<ReadyFn>;\n run?: Array<RunFn>;\n session?: Array<SessionFn>;\n user?: Array<UserFn>;\n};\n/** Allow arbitrary string events via `(string & {})`. */\ntype Types$2 = keyof Config$2 | (string & {});\n/** Map each event type to its expected data payload type. */\ninterface EventDataMap {\n config: Partial<Config$6>;\n consent: Consent;\n custom: Properties;\n globals: Properties;\n ready: void;\n run: void;\n session: SessionData | undefined;\n user: User;\n}\n/** Extract the data type for a specific event. */\ntype EventData<T extends keyof EventDataMap> = EventDataMap[T];\n/** Union of all possible data types. */\ntype AnyEventData = EventDataMap[keyof EventDataMap];\n/**\n * Context provided to every `on` callback.\n * Same posture as Mapping.Context: collector + logger only;\n * subscriptions are a collector-level concern, not a stage-level one.\n */\ninterface Context$3 {\n collector: Instance$6;\n logger: Instance$3;\n}\n/** Unified subscription callback shape. */\ntype Fn$1<TData = unknown> = (data: TData, context: Context$3) => PromiseOrValue<void>;\n/** Typed-data variants for readability and IntelliSense. All reduce to Fn<TData>. */\ntype ConsentFn = Fn$1<Consent>;\ntype GenericFn = Fn$1<unknown>;\ntype ReadyFn = Fn$1<void>;\ntype RunFn = Fn$1<void>;\ntype SessionFn = Fn$1<SessionData | undefined>;\ntype UserFn = Fn$1<User>;\n/**\n * Consent rule: a record of `{ [consentKey]: ConsentFn }`.\n * Only the consent action uses this shape (per-key handler dispatch).\n */\ninterface ConsentRule {\n [key: string]: ConsentFn;\n}\n/** Anything registerable via `walker.on(action, X)`: a typed callback or a consent rule record. */\ntype Subscription = ConsentRule | GenericFn | ReadyFn | RunFn | SessionFn | UserFn;\ninterface OnConfig {\n config?: GenericFn[];\n consent?: ConsentRule[];\n custom?: GenericFn[];\n globals?: GenericFn[];\n ready?: ReadyFn[];\n run?: RunFn[];\n session?: SessionFn[];\n user?: UserFn[];\n [key: string]: ConsentRule[] | GenericFn[] | ReadyFn[] | RunFn[] | SessionFn[] | UserFn[] | undefined;\n}\n/**\n * Destination `on` handler: receives the action type and a destination context.\n * Already context-style; kept for compatibility with the destination interface.\n */\ntype OnFn<T extends TypesGeneric$3 = Types$4> = (type: Types$2, context: Context$5<T>) => PromiseOrValue<void>;\ntype OnFnRuntime = (type: Types$2, context: Context$5) => PromiseOrValue<void>;\n\ntype on_AnyEventData = AnyEventData;\ntype on_ConsentFn = ConsentFn;\ntype on_ConsentRule = ConsentRule;\ntype on_EventData<T extends keyof EventDataMap> = EventData<T>;\ntype on_EventDataMap = EventDataMap;\ntype on_GenericFn = GenericFn;\ntype on_OnConfig = OnConfig;\ntype on_OnFn<T extends TypesGeneric$3 = Types$4> = OnFn<T>;\ntype on_OnFnRuntime = OnFnRuntime;\ntype on_ReadyFn = ReadyFn;\ntype on_RunFn = RunFn;\ntype on_SessionFn = SessionFn;\ntype on_Subscription = Subscription;\ntype on_UserFn = UserFn;\ndeclare namespace on {\n export type { on_AnyEventData as AnyEventData, Config$2 as Config, on_ConsentFn as ConsentFn, on_ConsentRule as ConsentRule, Context$3 as Context, on_EventData as EventData, on_EventDataMap as EventDataMap, Fn$1 as Fn, on_GenericFn as GenericFn, on_OnConfig as OnConfig, on_OnFn as OnFn, on_OnFnRuntime as OnFnRuntime, on_ReadyFn as ReadyFn, on_RunFn as RunFn, on_SessionFn as SessionFn, on_Subscription as Subscription, Types$2 as Types, on_UserFn as UserFn };\n}\n\ninterface Context$2 {\n city?: string;\n country?: string;\n encoding?: string;\n hash?: string;\n ip?: string;\n language?: string;\n origin?: string;\n region?: string;\n userAgent?: string;\n [key: string]: string | undefined;\n}\n\ndeclare namespace request {\n export type { Context$2 as Context };\n}\n\n/**\n * Base Env interface for dependency injection into sources.\n *\n * Sources receive all their dependencies through this environment object,\n * making them platform-agnostic and easily testable.\n */\ninterface BaseEnv$1 {\n [key: string]: unknown;\n push: PushFn$1;\n command: CommandFn;\n sources?: Sources;\n elb: Fn$3;\n logger: Instance$3;\n}\n/**\n * Type bundle for source generics.\n * Groups Settings, Mapping, Push, Env, InitSettings, and Setup into a single type parameter.\n *\n * @template S - Settings configuration type\n * @template M - Mapping configuration type\n * @template P - Push function signature (flexible to support HTTP handlers, etc.)\n * @template E - Environment dependencies type\n * @template I - InitSettings configuration type (user input)\n * @template U - Setup options type (provisioning options for `walkeros setup`)\n */\ninterface Types$1<S = unknown, M = unknown, P = Fn$3, E = BaseEnv$1, I = S, U = unknown, C = unknown> {\n settings: S;\n initSettings: I;\n mapping: M;\n push: P;\n env: E;\n setup: U;\n credentials: C;\n}\n/**\n * Generic constraint for Types - ensures T has required properties for indexed access\n */\ntype TypesGeneric$1 = {\n settings: any;\n initSettings: any;\n mapping: any;\n push: any;\n env: any;\n setup: any;\n credentials: any;\n};\n/**\n * Type extractors for consistent usage with Types bundle\n */\ntype Settings$1<T extends TypesGeneric$1 = Types$1> = T['settings'];\ntype InitSettings$1<T extends TypesGeneric$1 = Types$1> = T['initSettings'];\ntype Mapping<T extends TypesGeneric$1 = Types$1> = T['mapping'];\ntype Push<T extends TypesGeneric$1 = Types$1> = T['push'];\ntype Env$1<T extends TypesGeneric$1 = Types$1> = T['env'];\ntype SetupOptions$1<T extends TypesGeneric$1 = Types$1> = T['setup'];\ntype Credentials$1<T extends TypesGeneric$1 = Types$1> = T['credentials'];\n/**\n * Inference helper: Extract Types from Instance\n */\ntype TypesOf$1<I> = I extends Instance$2<infer T> ? T : never;\ninterface Config$1<T extends TypesGeneric$1 = Types$1> extends Config$7<Mapping<T>> {\n /** Implementation-specific configuration passed to the init function. */\n settings?: InitSettings$1<T>;\n /**\n * Optional, strictly-typed credentials slot. Back it with a managed secret\n * via `$secret.NAME` (credentials use `$secret`, not `$env`). The package\n * defines the shape via `Types['credentials']`. `settings.<sdk>` stays the\n * escape hatch for raw SDK options.\n */\n credentials?: Credentials$1<T>;\n /** Runtime dependencies injected by the collector (push, command, logger, etc.). */\n env?: Env$1<T>;\n /** Source identifier; defaults to the InitSources object key. */\n id?: string;\n /** Logger configuration (level, handler) to override the collector's defaults. */\n logger?: Config$3;\n /**\n * Respond-first acknowledgement for response-producing server sources.\n *\n * When a source produces an HTTP response (express today; future fetch /\n * lambda), `async: true` (the default for such sources) responds 2xx\n * (\"accepted\") before the event is delivered to the collector, so the\n * client is not blocked on backend delivery. `async: false` waits for\n * delivery to settle before responding. A 2xx means \"accepted\", not\n * \"delivered\".\n *\n * Browser and dataLayer sources have no HTTP response to defer and ignore\n * this flag. The default is per source type.\n */\n async?: boolean;\n /** Mark as primary source; its push function becomes the exported `elb` from startFlow. */\n primary?: boolean;\n /** Defer source initialization until these collector events fire (e.g., `['consent']`). */\n require?: string[];\n /**\n * Provisioning options for `walkeros setup`. `boolean | object`.\n * Triggered only by explicit CLI invocation; never automatic.\n */\n setup?: boolean | SetupOptions$1<T>;\n /**\n * Ingest metadata extraction mapping.\n * Extracts values from raw request objects (Express req, Lambda event, etc.)\n * using walkerOS mapping syntax. Extracted data flows to transformers/destinations.\n *\n * @example\n * ingest: {\n * ip: 'req.ip',\n * ua: 'req.headers.user-agent',\n * origin: 'req.headers.origin'\n * }\n */\n ingest?: Data$1;\n /** Completely skip this source — no init, no event capture. */\n disabled?: boolean;\n /**\n * Init lifecycle flag. Set by the collector to `true` after `Instance.init()`\n * has been called. Used together with `require` to gate `on()` delivery:\n * lifecycle events are queued in `Instance.queueOn` until both\n * `config.init === true` and `config.require` is empty/absent, then replayed.\n */\n init?: boolean;\n /** Declarative store get/set operations applied around this source. */\n state?: State | State[];\n}\ntype PartialConfig$1<T extends TypesGeneric$1 = Types$1> = Config$1<Types$1<Partial<Settings$1<T>> | Settings$1<T>, Partial<Mapping<T>> | Mapping<T>, Push<T>, Env$1<T>, InitSettings$1<T>, SetupOptions$1<T>, Credentials$1<T>>>;\ninterface Instance$2<T extends TypesGeneric$1 = Types$1> {\n type: string;\n config: Config$1<T>;\n setup?: SetupFn<Config$1<T>, Env$1<T>>;\n push: Push<T>;\n destroy?: DestroyFn<Config$1<T>, Env$1<T>>;\n on?(event: Types$2, context?: unknown): void | boolean | Promise<void | boolean>;\n /**\n * Optional setup hook. Called by the collector eagerly after all source\n * factories have run, regardless of `config.require`. Use for prep work\n * such as draining a pre-init window queue or attaching DOM listeners.\n * The collector still gates `on()` delivery, and `Collector.push`\n * enforces `allowed`/consent at the destination layer.\n */\n init?: () => void | Promise<void>;\n /**\n * Lifecycle event queue. Populated by `onApply` when the source is not\n * yet started (`config.init !== true` or `config.require` non-empty).\n * Flushed by the collector when the source becomes started.\n */\n queueOn?: Array<{\n type: Types$2;\n data: unknown;\n }>;\n}\n/**\n * Per-scope environment passed to the body of `Source.Context.withScope`.\n *\n * Each call to `withScope` builds a fresh `ScopeEnv` whose `push` captures\n * the per-scope `ingest` and `respond`. Concurrent scopes cannot crosstalk:\n * each one carries its own ingest and respond all the way through the\n * pipeline. Server sources MUST use `withScope` per inbound request; sources\n * with a single logical scope (browser tab lifetime, dataLayer) may skip it\n * and use the factory-scope `env.push` directly.\n */\ntype ScopeEnv<T extends TypesGeneric$1 = Types$1> = Env$1<T> & {\n /** Per-scope push: captures the scope's ingest and respond for this call. */\n push: PushFn$1;\n /** Ingest metadata extracted from the raw scope input (if config.ingest is set). */\n ingest: Ingest;\n /** Respond function bound to this scope (undefined for scopes without a response). */\n respond?: RespondFn;\n};\n/**\n * Context provided to source init function.\n * Extends base context with source-specific properties.\n */\ninterface Context$1<T extends TypesGeneric$1 = Types$1> extends Base<Partial<Config$1<T>>, Env$1<T>> {\n id: string;\n /**\n * Bind ingest and respond to a single scope of work (e.g. one inbound\n * HTTP request, one queue message). Builds a fresh `Ingest` from the\n * raw input via `config.ingest` mapping, wires the per-scope `respond`,\n * and invokes `body(scopeEnv)` with a push function that captures both.\n *\n * Server sources call this once per inbound request:\n *\n * ```ts\n * await context.withScope(req, createRespond(sender), async (env) => {\n * await env.push(parsedData);\n * });\n * ```\n *\n * Browser sources with a single tab-lifetime scope may skip `withScope`\n * and use `env.push` directly.\n *\n * @param rawScope - Raw input for `config.ingest` mapping (Express req,\n * Lambda event, fetch Request, etc.). Pass `undefined` if no ingest\n * mapping applies.\n * @param respond - Per-scope respond function, or `undefined` if the\n * scope produces no response.\n * @param body - Async callback receiving the per-scope env.\n * @returns The body's return value.\n */\n withScope: <R>(rawScope: unknown, respond: RespondFn | undefined, body: (env: ScopeEnv<T>) => Promise<R>) => Promise<R>;\n}\ntype Init$1<T extends TypesGeneric$1 = Types$1> = (context: Context$1<T>) => Instance$2<T> | Promise<Instance$2<T>>;\ntype InitSource<T extends TypesGeneric$1 = Types$1> = {\n code: Init$1<T>;\n config?: Partial<Config$1<T>>;\n env?: Partial<Env$1<T>>;\n primary?: boolean;\n next?: Route;\n before?: Route;\n cache?: Cache;\n state?: State | State[];\n};\n/**\n * Sources configuration for collector.\n * Maps source IDs to their initialization configurations.\n */\ninterface InitSources {\n [sourceId: string]: InitSource<any>;\n}\n/**\n * Renderer hint for source simulation UI.\n * - 'browser': Source needs a real DOM (iframe with live preview)\n * - 'codebox': Source uses a JSON/code editor (default)\n */\ntype Renderer = 'browser' | 'codebox';\n/**\n * Typed accessor for sources registered on a collector.\n *\n * The collector's `sources` bag indexes to `Source.Instance` (defaults erase\n * the generic), which collapses the source's declared `push` signature to\n * `Elb.Fn`. Use this helper at the call site to recover the narrow type\n * without casts.\n *\n * @example\n * type TestSourceTypes = Source.Types<unknown, unknown, TestPushFn>;\n * const src = getSource<TestSourceTypes>(collector, 'testSource');\n * await src.push({ method: 'GET', path: '/api/data' }); // typed!\n *\n * @throws Error with message `Source not found: <id>` when the id is unknown.\n */\ndeclare function getSource<T extends TypesGeneric$1 = Types$1>(collector: {\n sources: {\n [id: string]: Instance$2<any>;\n };\n}, id: string): Instance$2<T>;\n\ntype source_InitSource<T extends TypesGeneric$1 = Types$1> = InitSource<T>;\ntype source_InitSources = InitSources;\ntype source_Mapping<T extends TypesGeneric$1 = Types$1> = Mapping<T>;\ntype source_Push<T extends TypesGeneric$1 = Types$1> = Push<T>;\ntype source_Renderer = Renderer;\ntype source_ScopeEnv<T extends TypesGeneric$1 = Types$1> = ScopeEnv<T>;\ndeclare const source_getSource: typeof getSource;\ndeclare namespace source {\n export { type BaseEnv$1 as BaseEnv, type Config$1 as Config, type Context$1 as Context, type Credentials$1 as Credentials, type Env$1 as Env, type Init$1 as Init, type InitSettings$1 as InitSettings, type source_InitSource as InitSource, type source_InitSources as InitSources, type Instance$2 as Instance, type source_Mapping as Mapping, type PartialConfig$1 as PartialConfig, type source_Push as Push, type source_Renderer as Renderer, type source_ScopeEnv as ScopeEnv, type Settings$1 as Settings, type SetupOptions$1 as SetupOptions, type Types$1 as Types, type TypesGeneric$1 as TypesGeneric, type TypesOf$1 as TypesOf, source_getSource as getSource };\n}\n\ninterface BaseEnv {\n [key: string]: unknown;\n}\ninterface Types<S = unknown, E = BaseEnv, I = S, U = unknown, C = unknown> {\n settings: S;\n initSettings: I;\n env: E;\n setup: U;\n credentials: C;\n}\ntype TypesGeneric = {\n settings: any;\n initSettings: any;\n env: any;\n setup: any;\n credentials: any;\n};\ntype Settings<T extends TypesGeneric = Types> = T['settings'];\ntype InitSettings<T extends TypesGeneric = Types> = T['initSettings'];\ntype Env<T extends TypesGeneric = Types> = T['env'];\ntype SetupOptions<T extends TypesGeneric = Types> = T['setup'];\ntype Credentials<T extends TypesGeneric = Types> = T['credentials'];\ntype TypesOf<I> = I extends Instance$1<infer T> ? T : never;\ninterface Config<T extends TypesGeneric = Types> {\n settings?: InitSettings<T>;\n /**\n * Optional, strictly-typed credentials slot. Back it with a managed secret\n * via `$secret.NAME` (credentials use `$secret`, not `$env`). The package\n * defines the shape via `Types['credentials']`. `settings.<sdk>` stays the\n * escape hatch for raw SDK options.\n */\n credentials?: Credentials<T>;\n env?: Env<T>;\n id?: string;\n logger?: Config$3;\n /**\n * Provisioning options for `walkeros setup`. `boolean | object`.\n * Triggered only by explicit CLI invocation; never automatic.\n */\n setup?: boolean | SetupOptions<T>;\n /**\n * Persist values as raw bytes, byte-exact, bypassing the structured codec.\n * Default false: values are structured `StoreValue` and pass through the\n * shared core serialization codec. Set true only on byte-native backends\n * (fs/s3/gcs) whose consumer needs the exact bytes back, e.g. serving an\n * asset such as walker.js. Structured-only backends (sheets) reject `file:\n * true` at init. One store instance is exactly one mode.\n */\n file?: boolean;\n}\ntype PartialConfig<T extends TypesGeneric = Types> = Config<Types<Partial<Settings<T>> | Settings<T>, Env<T>, InitSettings<T>, SetupOptions<T>, Credentials<T>>>;\ninterface Context<T extends TypesGeneric = Types> extends Base<Config<T>, Env<T>> {\n id: string;\n}\n/**\n * Canonical structured value persisted by a store. Includes `null`, but\n * EXCLUDES `undefined`: `undefined` is the reserved \"miss\" sentinel returned\n * by `GetFn` for an absent key, so it must never be a stored value.\n * `Uint8Array` is the platform-neutral binary leaf (never Node `Buffer`).\n */\ntype StoreValue = string | number | boolean | null | Uint8Array | StoreValue[] | {\n [key: string]: StoreValue;\n};\ntype GetFn<T extends StoreValue = StoreValue> = (key: string) => T | undefined | Promise<T | undefined>;\ntype SetFn<T extends StoreValue = StoreValue> = (key: string, value: T, \n/**\n * Optional expiry hint in ms; honored only by TTL-native backends\n * (in-memory, Redis). Byte/JSON backends may ignore it. Authoritative cache\n * expiry lives in the cache wrapper's {value, exp} payload.\n */\nttl?: number) => void | Promise<void>;\ntype DeleteFn = (key: string) => void | Promise<void>;\ninterface Instance$1<T extends TypesGeneric = Types> {\n type: string;\n config: Config<T>;\n get: GetFn;\n set: SetFn;\n delete: DeleteFn;\n setup?: SetupFn<Config<T>, Env<T>>;\n destroy?: DestroyFn<Config<T>, Env<T>>;\n}\ntype Init<T extends TypesGeneric = Types> = (context: Context<Types<Partial<Settings<T>>, Env<T>, InitSettings<T>>>) => Instance$1<T> | Promise<Instance$1<T>>;\ntype InitFn<T extends TypesGeneric = Types> = (context: Context<T>) => PromiseOrValue<void | false | Config<T>>;\ntype InitStore<T extends TypesGeneric = Types> = {\n code: Init<T>;\n config?: Partial<Config<T>>;\n env?: Partial<Env<T>>;\n};\ninterface InitStores {\n [storeId: string]: InitStore<any>;\n}\ninterface Stores {\n [storeId: string]: Instance$1;\n}\n/**\n * Typed accessor for stores registered on a collector.\n *\n * The collector's `stores` bag indexes to `Store.Instance` (defaults erase\n * the generic). Use this helper at the call site to recover the narrow type\n * without casts.\n *\n * @example\n * type MyStoreTypes = Store.Types<MySettings>;\n * const store = getStore<MyStoreTypes>(collector, 'cache');\n * await store.set('key', 'value');\n *\n * @throws Error with message `Store not found: <id>` when the id is unknown.\n */\ndeclare function getStore<T extends TypesGeneric = Types>(collector: {\n stores: {\n [id: string]: Instance$1<any>;\n };\n}, id: string): Instance$1<T>;\n/**\n * Read-site narrowing helper for store values.\n *\n * `Instance.get`/`set` stay value-agnostic at `StoreValue`, so callers\n * that know the concrete shape narrow here instead of threading a value type\n * through `Store.Types`. The single narrow `as` cast is justified: the store\n * channel is structurally `StoreValue`, and the caller asserts the concrete\n * sub-shape it stored. `undefined` is preserved as the miss sentinel.\n */\ndeclare function getStoreValue<V extends StoreValue = StoreValue>(store: Instance$1, key: string): Promise<V | undefined>;\n\ntype store_BaseEnv = BaseEnv;\ntype store_Config<T extends TypesGeneric = Types> = Config<T>;\ntype store_Context<T extends TypesGeneric = Types> = Context<T>;\ntype store_Credentials<T extends TypesGeneric = Types> = Credentials<T>;\ntype store_DeleteFn = DeleteFn;\ntype store_Env<T extends TypesGeneric = Types> = Env<T>;\ntype store_GetFn<T extends StoreValue = StoreValue> = GetFn<T>;\ntype store_Init<T extends TypesGeneric = Types> = Init<T>;\ntype store_InitFn<T extends TypesGeneric = Types> = InitFn<T>;\ntype store_InitSettings<T extends TypesGeneric = Types> = InitSettings<T>;\ntype store_InitStore<T extends TypesGeneric = Types> = InitStore<T>;\ntype store_InitStores = InitStores;\ntype store_PartialConfig<T extends TypesGeneric = Types> = PartialConfig<T>;\ntype store_SetFn<T extends StoreValue = StoreValue> = SetFn<T>;\ntype store_Settings<T extends TypesGeneric = Types> = Settings<T>;\ntype store_SetupOptions<T extends TypesGeneric = Types> = SetupOptions<T>;\ntype store_StoreValue = StoreValue;\ntype store_Stores = Stores;\ntype store_Types<S = unknown, E = BaseEnv, I = S, U = unknown, C = unknown> = Types<S, E, I, U, C>;\ntype store_TypesGeneric = TypesGeneric;\ntype store_TypesOf<I> = TypesOf<I>;\ndeclare const store_getStore: typeof getStore;\ndeclare const store_getStoreValue: typeof getStoreValue;\ndeclare namespace store {\n export { type store_BaseEnv as BaseEnv, type store_Config as Config, type store_Context as Context, type store_Credentials as Credentials, type store_DeleteFn as DeleteFn, type store_Env as Env, type store_GetFn as GetFn, type store_Init as Init, type store_InitFn as InitFn, type store_InitSettings as InitSettings, type store_InitStore as InitStore, type store_InitStores as InitStores, type Instance$1 as Instance, type store_PartialConfig as PartialConfig, type store_SetFn as SetFn, type store_Settings as Settings, type store_SetupOptions as SetupOptions, type store_StoreValue as StoreValue, type store_Stores as Stores, type store_Types as Types, type store_TypesGeneric as TypesGeneric, type store_TypesOf as TypesOf, store_getStore as getStore, store_getStoreValue as getStoreValue };\n}\n\n/**\n * Trigger — unified interface for invoking any walkerOS step in simulation\n * and testing. Every package exports a `createTrigger` factory from its\n * examples that conforms to `Trigger.CreateFn`.\n *\n * Usage:\n * const { flow, trigger } = await createTrigger(initConfig);\n * const result = await trigger(type?, options?)(content);\n *\n * @packageDocumentation\n */\n\n/** Flow access handle returned by createTrigger. */\ninterface FlowHandle {\n /** The collector instance created by startFlow. */\n collector: Instance$6;\n /** The elb push function for direct event injection. */\n elb: Fn$3;\n}\n/** What createTrigger returns — a flow handle (lazy) and a trigger function. */\ninterface Instance<TContent = unknown, TResult = unknown> {\n /** Flow handle — undefined until first trigger() call, then stable. */\n readonly flow: FlowHandle | undefined;\n trigger: Fn<TContent, TResult>;\n}\n/**\n * Curried trigger function — always async.\n *\n * First call selects mechanism (type) and configures it (options).\n * Second call fires with content and returns result.\n *\n * @example\n * // Browser source — click trigger\n * trigger('click', 'button.cta')('<button data-elb=\"cta\">Sign Up</button>')\n *\n * // Express source — POST request\n * trigger('POST')({ path: '/collect', body: { name: 'page view' } })\n *\n * // DataLayer — default mechanism\n * trigger()(['event', 'purchase', { value: 25.42 }])\n */\ntype Fn<TContent = unknown, TResult = unknown> = (type?: string, options?: unknown) => (content: TContent) => Promise<TResult>;\n/**\n * Factory function exported by each package's examples.\n *\n * Receives full Collector.InitConfig. Does NOT call startFlow eagerly —\n * startFlow is deferred to the first trigger() invocation (lazy init).\n * The flow property uses a getter to read the closure variable live.\n * createTrigger itself stays async for consistency (other packages may\n * need await during setup). Config is passed through UNMODIFIED —\n * validation is startFlow's job.\n *\n * @example\n * // Package exports:\n * export const createTrigger: Trigger.CreateFn<HTMLContent, void> = async (config) => {\n * let flow: Trigger.FlowHandle | undefined;\n *\n * const trigger: Trigger.Fn<HTMLContent, void> = (type?, options?) => async (content) => {\n * // Pre-startFlow work (e.g., inject HTML for browser source)\n * // ...\n *\n * // Lazy init — only on first call\n * if (!flow) flow = await startFlow(config);\n *\n * // Post-startFlow work (e.g., dispatch click event)\n * // ...\n * };\n *\n * return {\n * get flow() { return flow; },\n * trigger,\n * };\n * };\n */\ntype CreateFn<TContent = unknown, TResult = unknown> = (config: InitConfig, options?: unknown) => Promise<Instance<TContent, TResult>>;\n\ntype trigger_CreateFn<TContent = unknown, TResult = unknown> = CreateFn<TContent, TResult>;\ntype trigger_FlowHandle = FlowHandle;\ntype trigger_Fn<TContent = unknown, TResult = unknown> = Fn<TContent, TResult>;\ntype trigger_Instance<TContent = unknown, TResult = unknown> = Instance<TContent, TResult>;\ndeclare namespace trigger {\n export type { trigger_CreateFn as CreateFn, trigger_FlowHandle as FlowHandle, trigger_Fn as Fn, trigger_Instance as Instance };\n}\n\ntype AnyObject<T = unknown> = Record<string, T>;\ntype Elb = Fn$3;\ntype AnyFunction = (...args: unknown[]) => unknown;\ntype SingleOrArray<T> = T | Array<T>;\ntype Events = Array<Event>;\ntype PartialEvent = Partial<Event>;\ntype DeepPartialEvent = DeepPartial<Event>;\ninterface Event {\n name: string;\n data: Properties;\n context: OrderedProperties;\n globals: Properties;\n custom: Properties;\n user: User;\n nested: Entities;\n consent: Consent;\n id: string;\n trigger: string;\n entity: string;\n action: string;\n timestamp: number;\n timing: number;\n source: Source;\n}\ninterface Consent {\n [name: string]: boolean;\n}\ninterface User extends Properties {\n id?: string;\n device?: string;\n session?: string;\n hash?: string;\n address?: string;\n email?: string;\n phone?: string;\n userAgent?: string;\n browser?: string;\n browserVersion?: string;\n deviceType?: string;\n language?: string;\n country?: string;\n region?: string;\n city?: string;\n zip?: string;\n timezone?: string;\n os?: string;\n osVersion?: string;\n screenSize?: string;\n ip?: string;\n internal?: boolean;\n}\ntype SourcePlatform = 'web' | 'server' | 'app' | 'ios' | 'android' | 'terminal' | string;\n/**\n * SourceMap is the discriminated-union registry for source kinds.\n * Each source package augments this interface via `declare module\n * '@walkeros/core'` to register its own `type` literal and any\n * source-specific fields. Conflicting declarations cause compile errors,\n * intentional, to surface naming collisions early.\n */\ninterface SourceMap {\n collector: {\n type: 'collector';\n };\n}\n/**\n * Declared (named) fields of an event Source. Kept as a standalone interface so\n * its key set stays index-signature-free: `Source extends Properties` adds a\n * string index signature that collapses `keyof Source` to `string | number`,\n * which would defeat the type↔schema drift guard. The guard compares\n * `keyof SourceFields` against `keyof z.infer<typeof SourceFieldsSchema>`\n * (see schemas/__tests__/config-drift.test-d.ts).\n */\ninterface SourceFields {\n type: string;\n platform?: SourcePlatform;\n /** Deployment version of the source emitter (string). */\n version?: string;\n /** Event-model spec version. Collector defaults to \"4\". */\n schema?: string;\n /** Emission sequence within the run. */\n count?: number;\n /** Trace id shared by every event of a run (W3C trace-id shape). */\n trace?: string;\n /** Per-flow config release map, keyed by flow name (source.release[flowName]). Accumulates across walkerOS→walkerOS crossings. */\n release?: Record<string, string>;\n /** Walker-controlled standard suggestions (sources may set). */\n url?: string;\n referrer?: string;\n tool?: string;\n command?: string;\n}\ninterface Source extends Properties, SourceFields {\n}\ntype PropertyType = boolean | string | number | {\n [key: string]: Property;\n};\ntype Property = PropertyType | Array<PropertyType>;\ninterface Properties {\n [key: string]: Property | undefined;\n}\ninterface OrderedProperties {\n [key: string]: [Property, number] | undefined;\n}\ntype Entities = Array<Entity>;\ninterface Entity {\n entity: string;\n data: Properties;\n nested?: Entities;\n context?: OrderedProperties;\n}\ntype ConsentHandler = Record<string, AnyFunction>;\ntype ActionHandler = AnyFunction;\ntype DeepPartial<T> = {\n [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];\n};\ntype PromiseOrValue<T> = T | Promise<T>;\n\ntype walkeros_ActionHandler = ActionHandler;\ntype walkeros_AnyFunction = AnyFunction;\ntype walkeros_AnyObject<T = unknown> = AnyObject<T>;\ntype walkeros_Consent = Consent;\ntype walkeros_ConsentHandler = ConsentHandler;\ntype walkeros_DeepPartial<T> = DeepPartial<T>;\ntype walkeros_DeepPartialEvent = DeepPartialEvent;\ntype walkeros_Elb = Elb;\ntype walkeros_Entities = Entities;\ntype walkeros_Entity = Entity;\ntype walkeros_Event = Event;\ntype walkeros_Events = Events;\ntype walkeros_OrderedProperties = OrderedProperties;\ntype walkeros_PartialEvent = PartialEvent;\ntype walkeros_PromiseOrValue<T> = PromiseOrValue<T>;\ntype walkeros_Properties = Properties;\ntype walkeros_Property = Property;\ntype walkeros_PropertyType = PropertyType;\ntype walkeros_SingleOrArray<T> = SingleOrArray<T>;\ntype walkeros_Source = Source;\ntype walkeros_SourceFields = SourceFields;\ntype walkeros_SourceMap = SourceMap;\ntype walkeros_SourcePlatform = SourcePlatform;\ntype walkeros_User = User;\ndeclare namespace walkeros {\n export type { walkeros_ActionHandler as ActionHandler, walkeros_AnyFunction as AnyFunction, walkeros_AnyObject as AnyObject, walkeros_Consent as Consent, walkeros_ConsentHandler as ConsentHandler, walkeros_DeepPartial as DeepPartial, walkeros_DeepPartialEvent as DeepPartialEvent, walkeros_Elb as Elb, walkeros_Entities as Entities, walkeros_Entity as Entity, walkeros_Event as Event, walkeros_Events as Events, walkeros_OrderedProperties as OrderedProperties, walkeros_PartialEvent as PartialEvent, walkeros_PromiseOrValue as PromiseOrValue, walkeros_Properties as Properties, walkeros_Property as Property, walkeros_PropertyType as PropertyType, walkeros_SingleOrArray as SingleOrArray, walkeros_Source as Source, walkeros_SourceFields as SourceFields, walkeros_SourceMap as SourceMap, walkeros_SourcePlatform as SourcePlatform, walkeros_User as User };\n}\n\n/**\n * A recorded function call made during simulation.\n * Captures what a destination called on its env (e.g., window.gtag).\n */\ninterface Call {\n /** Dot-path of the function called: \"window.gtag\", \"dataLayer.push\" */\n fn: string;\n /** Arguments passed to the function */\n args: unknown[];\n /** Unix timestamp in ms */\n ts: number;\n}\n/**\n * Result of simulating a single step.\n * Same shape for source, transformer, collector, and destination.\n */\ninterface Result {\n /** Which step type was simulated */\n step: 'source' | 'transformer' | 'destination' | 'collector';\n /** Step name, e.g. \"gtag\", \"dataLayer\", \"enricher\" */\n name: string;\n /**\n * Output events:\n * - source: captured pre-collector events\n * - transformer: [transformed event] or [] if filtered\n * - collector: [enriched event] (createEvent applied)\n * - destination: [] (destinations don't produce events)\n */\n events: DeepPartialEvent[];\n /** Intercepted env calls. Populated for destinations, empty [] for others. */\n calls: Call[];\n /** Execution time in ms */\n duration: number;\n /**\n * Entity-action key of the matched mapping rule, e.g. \"product add\" or\n * \"product *\". Populated for destination simulations when a mapping rule\n * matched; absent when no rule matched or the step has no mapping.\n * Also absent when the matched rule uses batched delivery (batching\n * reports no per-event key) and on error results, where the key is not\n * available.\n */\n mappingKey?: string;\n /** Error if the step threw */\n error?: Error;\n}\n\ntype simulation_Call = Call;\ntype simulation_Result = Result;\ndeclare namespace simulation {\n export type { simulation_Call as Call, simulation_Result as Result };\n}\n\ninterface Code {\n lang?: string;\n code: string;\n}\ninterface Hint {\n text: string;\n code?: Array<Code>;\n}\ntype Hints = Record<string, Hint>;\n\ntype hint_Code = Code;\ntype hint_Hint = Hint;\ntype hint_Hints = Hints;\ndeclare namespace hint {\n export type { hint_Code as Code, hint_Hint as Hint, hint_Hints as Hints };\n}\n\ntype StorageType = 'local' | 'session' | 'cookie';\ndeclare const Const: {\n readonly Utils: {\n readonly Storage: {\n readonly Local: \"local\";\n readonly Session: \"session\";\n readonly Cookie: \"cookie\";\n };\n };\n};\n\ntype SendDataValue = Property | Properties;\ntype SendHeaders = {\n [key: string]: string;\n};\ninterface SendResponse {\n ok: boolean;\n data?: unknown;\n error?: string;\n}\n\n/**\n * Journey types describe the assembled, cross-runtime life of one traced event\n * as reconstructed from raw `FlowState` records by `assembleJourneys`. The\n * assembler is pure and presentation-free: no session scoping, no display copy,\n * no formatting. Presenters map a `Journey` into their own view shapes.\n *\n * Optional fields are populated only when the underlying records carry the\n * corresponding data (e.g. trace-level payloads, consent snapshots, vendor\n * calls); an absent field means the records never supplied it.\n */\n/** Runtime that produced a hop: the non-empty subset of `FlowState.platform`. */\ntype JourneyPlatform = 'web' | 'server';\n/**\n * How a journey's records were correlated into one journey. `trace` groups by\n * the shared `traceId`; `legacy` is the fallback for records that predate trace\n * propagation and are grouped by their `eventId` alone.\n */\ntype JourneyCorrelation = 'trace' | 'legacy';\n/**\n * Collapsed outcome of a single hop, derived from its terminal phase. `pending`\n * covers a hop still in `in`/`init`/`flush` (no terminal phase observed yet);\n * `done` an `out`; `skipped` a `skip`; `error` an `error`.\n */\ntype JourneyHopStatus = 'pending' | 'done' | 'skipped' | 'error';\n/**\n * Completeness of a whole journey. `pending` while the journey may still gain\n * hops; `complete` when every expected hop reached a terminal phase; `partial`\n * when expected hops are missing after settling. Completeness resolution is\n * orthogonal to `lossy`.\n */\ntype JourneyStatus = 'pending' | 'complete' | 'partial';\n/**\n * Static shape of the pipeline the journey ran through, in topological order.\n * Core declares the type only; derivation lives in a shared presenter-side\n * helper. When supplied to `assembleJourneys`, node index is the within-segment\n * ordering rank. Hops match a node on `(platform, stepId)`, falling back to a\n * platform-less node with that stepId, then to the unique stepId match.\n */\ninterface JourneyTopologyNode {\n /** Step identifier this node ranks, e.g. 'destination.gtag'. */\n stepId: string;\n /** Runtime the node belongs to, when known. */\n platform?: JourneyPlatform;\n /**\n * stepIds reachable directly downstream of this node. Each entry resolves to\n * the node with that stepId AND the same platform as this (source) node; if\n * none, to the unique node with that stepId regardless of platform (the\n * $flow crossing case, where stepIds differ across the crossing); if still\n * ambiguous, the edge is ignored.\n */\n downstream: string[];\n}\n/**\n * Topology graph in topological order; a node's index is its rank. Roots\n * (nodes no edge targets) only bind journeys that touch their platform, so\n * disjoint per-platform sub-graphs are safe: prefer crossing edges when\n * encodable (they thread expectations below done crossing hops); disjoint\n * platform sub-graphs are acceptable otherwise.\n */\ninterface JourneyTopology {\n /** Nodes in topological order. */\n nodes: JourneyTopologyNode[];\n}\n/** Options controlling assembly. All optional; sensible defaults apply. */\ninterface AssembleJourneysOptions {\n /** Pipeline topology used to rank hops within a platform segment. */\n topology?: JourneyTopology;\n /**\n * Milliseconds a journey stays eligible to change after its last record\n * before completeness is finalized. Defaults to 15000.\n */\n settleMs?: number;\n /** Wall-clock reference (epoch ms) for settle evaluation. Defaults to now. */\n now?: number;\n}\n/** The originating event of a journey, taken from its entry collector hop. */\ninterface JourneyEntry {\n /** Originating event's id (W3C span-id). */\n eventId: string;\n /** Event name (e.g. 'page view'), when the entry record carried the inbound event. */\n name?: string;\n /** ISO 8601 wall-clock timestamp of the entry record. */\n timestamp: string;\n /** Originating source id, when known. */\n sourceId?: string;\n /** Runtime the entry occurred on, when known. */\n platform?: JourneyPlatform;\n}\n/**\n * A `many` fan-out child folded under its parent destination hop. Each branch\n * collapses the records carrying its `branchId` by terminal-phase precedence;\n * the parent hop's own outcome comes from its non-branch records only, so a\n * failing branch never poisons the parent status.\n */\ninterface JourneyBranch {\n /** W3C span-id of the child branch. */\n branchId: string;\n /** Collapsed outcome of the branch. */\n status: JourneyHopStatus;\n /** Terminal phase the branch reached. */\n terminalPhase: FlowStatePhase;\n /** Wall-clock duration of the branch, when measured. */\n durationMs?: number;\n /** Skip discriminator when the branch was skipped. */\n skipReason?: 'consent' | 'cache_hit' | 'sampled_out' | 'disabled' | 'unknown';\n /** Error info when the branch failed. */\n error?: {\n name?: string;\n message: string;\n };\n /** Outbound payload of the branch, when captured. */\n out?: unknown;\n /** Vendor calls recorded on the branch's out record, when captured. */\n calls?: Call[];\n}\n/**\n * One collapsed step of a journey: all `FlowState` records for a\n * `(platform, stepId)` pair reduced to a single row by terminal-phase\n * precedence.\n */\ninterface JourneyHop {\n /** Step identifier, e.g. 'destination.gtag'. */\n stepId: string;\n /** Kind of step this hop ran. */\n stepType: FlowStepType;\n /** Runtime that produced the hop, when known. Disambiguates same-named steps across sub-flows. */\n platform?: JourneyPlatform;\n /** Event id the hop's records belong to (per platform segment). */\n eventId: string;\n /** Upstream runtime's event id when this segment was entered via a $flow crossing. */\n parentEventId?: string;\n /** Collapsed outcome derived from `terminalPhase`. */\n status: JourneyHopStatus;\n /** Highest-precedence phase observed for the hop (error > skip > out > in > init > flush). */\n terminalPhase: FlowStatePhase;\n /** Earliest `elapsedMs` seen for the hop. Per-runtime; never compared across platforms. */\n startedAtMs: number;\n /** ISO 8601 wall-clock timestamp of the hop's earliest record. */\n timestamp: string;\n /** Wall-clock duration of the hop, when measured (typically from the out record). */\n durationMs?: number;\n /** Inbound event for the hop, when captured (trace level). */\n in?: unknown;\n /** Outbound event/payload for the hop, when captured (trace level). */\n out?: unknown;\n /** Error info when the hop's terminal phase is error. */\n error?: {\n name?: string;\n message: string;\n };\n /** Skip discriminator when the hop's terminal phase is skip. */\n skipReason?: 'consent' | 'cache_hit' | 'sampled_out' | 'disabled' | 'unknown';\n /** Matched mapping rule, when one matched. */\n mappingKey?: string;\n /** Matched contract rule, when one matched. */\n contractRule?: string;\n /** Consent gate snapshot at hop time, when present. */\n consent?: Record<string, boolean>;\n /** Consent actually applied after policy resolution, when present. */\n consentApplied?: Record<string, boolean>;\n /** Vendor calls recorded on the hop's out record, when captured. */\n calls?: Call[];\n /** Fan-out children when the hop produced `many` branches. */\n branches?: JourneyBranch[];\n /** True when the hop's terminal out record was part of a batched enqueue. */\n batched?: boolean;\n /**\n * True when a `flush` frame for this batched hop folded in, confirming the\n * batch was actually flushed to the vendor. Set only on batched hops; a\n * pre-wire flush-only frame (no batched out record) leaves the hop\n * non-terminal and is not a confirmation.\n */\n flushConfirmed?: boolean;\n /** Free-form metadata carried by the hop's records. */\n meta?: Record<string, unknown>;\n}\n/**\n * A wall-clock-bounded window on one platform's poster where the monotonic\n * `seq` counter skipped, indicating dropped records. Gaps are per-platform\n * because `seq` is stamped per poster. Detected by walking each platform's\n * records in wall-clock order: a forward `seq` jump of more than one is a gap\n * (bounds come from the adjacent records); a backward jump is a poster restart\n * (new generation, e.g. a page reload), never a loss.\n */\ninterface JourneyGap {\n /** Poster runtime the gap was detected on. */\n platform?: JourneyPlatform;\n /** Wall-clock lower bound of the missing window (epoch ms). */\n fromMs: number;\n /** Wall-clock upper bound of the missing window (epoch ms). */\n toMs: number;\n /** Last `seq` observed before the gap. */\n afterSeq: number;\n /** First `seq` observed after the gap. */\n beforeSeq: number;\n}\n/** One reconstructed event lifetime across the pipeline. */\ninterface Journey {\n /** `traceId` when trace-correlated, else `event:<eventId>`. */\n id: string;\n /** How the journey's records were correlated. */\n correlation: JourneyCorrelation;\n /** Shared trace id, when trace-correlated. */\n traceId?: string;\n /** Originating event of the journey. */\n entry: JourneyEntry;\n /** Collapsed hops in platform-segment then within-segment order. */\n hops: JourneyHop[];\n /** Distinct platforms present, in segment order. */\n platforms: JourneyPlatform[];\n /** Completeness of the journey. */\n status: JourneyStatus;\n /** True when the journey's window overlaps a detected `seq` gap. */\n lossy: boolean;\n /** Earliest record wall-clock timestamp (epoch ms). */\n firstTimestamp: number;\n /** Latest record wall-clock timestamp (epoch ms). */\n lastTimestamp: number;\n /** Approximate cross-runtime span (`lastTimestamp - firstTimestamp`), in ms. */\n totalMs: number;\n}\n/**\n * Result of assembling a set of `FlowState` records. `journeys` are returned in\n * first-seen wall-clock ascending order (oldest first); presenters that list\n * newest-first sort as needed. `gaps` are session-level, per-platform loss\n * windows shared across the journeys.\n */\ninterface JourneyAssembly {\n /** Assembled journeys, oldest first by `firstTimestamp`. */\n journeys: Journey[];\n /** Session-level per-platform loss windows. */\n gaps: JourneyGap[];\n}\n\n/**\n * Creates a TransformerResult for dynamic chain routing.\n * Use this in transformer push functions to redirect the chain.\n */\ndeclare function branch(event: DeepPartialEvent, next: Route): Result$1;\n\n/**\n * Anonymizes an IPv4 address by setting the last octet to 0.\n *\n * @param ip The IP address to anonymize.\n * @returns The anonymized IP address or an empty string if the IP is invalid.\n */\ndeclare function anonymizeIP(ip: string): string;\n\n/**\n * Flow Configuration Utilities\n *\n * Functions for resolving and processing Flow configurations.\n *\n * @packageDocumentation\n */\n\n/** Sentinel prefix for deferred $env resolution. Shared with CLI bundler. */\ndeclare const ENV_MARKER_PREFIX = \"__WALKEROS_ENV:\";\n/** Sentinel prefix for deferred $secret resolution. Shared with CLI bundler. */\ndeclare const SECRET_MARKER_PREFIX = \"__WALKEROS_SECRET:\";\ninterface ResolveOptions {\n deferred?: boolean;\n /**\n * When false, unresolved `$flow.X.Y` refs (unknown flow, missing key,\n * empty value) trigger {@link onWarning} and the original `$flow…` string\n * is left in place. Cycles always throw regardless of this flag.\n * Default: true (strict — throws as today).\n */\n strictFlowRefs?: boolean;\n /** Called for each unresolved $flow ref when {@link strictFlowRefs} is false. */\n onWarning?: (message: string) => void;\n}\n/**\n * Walk a dot-separated path into a value.\n * Throws if any intermediate segment is missing or not an object.\n */\ndeclare function walkPath(value: unknown, path: string, refPrefix: string): unknown;\n/**\n * Resolver callback for `$flow.X.Y` references.\n *\n * Given a sibling flow name, returns its fully resolved `Flow.Config` block\n * (with `$env`/`$var`/`$contract` already resolved) as `unknown` so that\n * {@link walkPath} can traverse it. Returns `undefined` if the flow does\n * not exist. Implementations are responsible for cycle detection across\n * recursive calls.\n */\ntype FlowConfigResolver = (flowName: string) => unknown;\n/**\n * Convert package name to valid JavaScript variable name.\n * Used for deterministic default import naming.\n * @example\n * packageNameToVariable('@walkeros/server-destination-api')\n * // → '_walkerosServerDestinationApi'\n */\ndeclare function packageNameToVariable(packageName: string): string;\n/**\n * Get resolved flow for a named flow.\n *\n * Resolution pass order:\n * 1. `$env` / `$var` resolve per-flow in isolation (no cross-flow context).\n * `$var` resolves recursively (variables may reference other variables,\n * `$env`, `$contract`, or `$flow`); cycles are detected via a visiting set.\n * 2. `$flow.X.Y` resolves against pass-1 outputs of sibling flows (so `$env`/`$var`\n * inside the referenced flow are already resolved when `$flow` reads it).\n * 3. `$contract` resolves last (with `$flow` results available).\n *\n * In practice these passes are interleaved by the resolver: when `$flow.X.Y`\n * is encountered, the sibling flow X's `Flow.Config` block is recursively\n * resolved on demand (with all its own `$env`/`$var`/`$contract` references\n * resolved first), then the deep path is walked. Cycles are detected via a\n * visiting set.\n *\n * @param config - The complete Flow.Json (root multi-flow config)\n * @param flowName - Flow name (auto-selected if only one exists)\n * @param options - Resolution options\n * @returns Resolved {@link Flow} with $var, $env, $contract, and $flow patterns resolved\n * @throws Error if flow selection is required but not specified, or flow not found\n * @throws Error if a `$flow.X.Y` reference forms a cycle\n *\n * @example\n * ```typescript\n * import { getFlowSettings } from '@walkeros/core';\n *\n * const config = JSON.parse(fs.readFileSync('walkeros.config.json', 'utf8'));\n *\n * // Auto-select if only one flow\n * const flow = getFlowSettings(config);\n *\n * // Or specify flow\n * const prodFlow = getFlowSettings(config, 'production');\n * ```\n */\ndeclare function getFlowSettings(config: Flow.Json, flowName?: string, options?: ResolveOptions): Flow;\n/**\n * Get the platform of a flow ('web' or 'server').\n *\n * Reads from `flow.config.platform`.\n *\n * @param flow - Resolved flow (output of {@link getFlowSettings})\n * @returns \"web\" or \"server\"\n * @throws Error if `config.platform` is missing\n *\n * @example\n * ```typescript\n * import { getPlatform } from '@walkeros/core';\n *\n * const platform = getPlatform(flow);\n * // Returns \"web\" or \"server\"\n * ```\n */\ndeclare function getPlatform(flow: Flow): 'web' | 'server';\n\n/**\n * @interface Assign\n * @description Options for the assign function.\n * @property merge - Merge array properties instead of overriding them.\n * @property shallow - Create a shallow copy instead of updating the target object.\n * @property extend - Extend the target with new properties instead of only updating existing ones.\n */\ninterface Assign {\n merge?: boolean;\n shallow?: boolean;\n extend?: boolean;\n}\n/**\n * Merges objects with advanced options.\n *\n * @template T, U\n * @param target - The target object to merge into.\n * @param obj - The source object to merge from.\n * @param options - Options for merging.\n * @returns The merged object.\n */\ndeclare function assign<T extends object, U extends object>(target: T, obj?: U, options?: Assign): T & U;\n\n/**\n * Gets a value from an object by a dot-notation string.\n * Supports wildcards for arrays.\n *\n * @example\n * getByPath({ data: { id: 1 } }, \"data.id\") // Returns 1\n *\n * @param event - The object to get the value from.\n * @param key - The dot-notation string.\n * @param defaultValue - The default value to return if the key is not found.\n * @returns The value from the object or the default value.\n */\ndeclare function getByPath(event: unknown, key?: string, defaultValue?: unknown): unknown;\n/**\n * Sets a value in an object by a dot-notation string.\n *\n * @param obj - The object to set the value in.\n * @param key - The dot-notation string.\n * @param value - The value to set.\n * @returns A new object with the updated value.\n */\ndeclare function setByPath<T = unknown>(obj: T, key: string, value: unknown): T;\n/**\n * Deletes a value in an object by a dot-notation string.\n * Returns a new object; the input is not mutated. No-op when the path is\n * absent or the target is neither an object nor an array. Numeric segments\n * index into arrays; a final numeric segment splices the element out so no\n * empty slot is left behind.\n */\ndeclare function deleteByPath<T = unknown>(obj: T, key: string): T;\n\ndeclare function flattenIncludeSections(event: DeepPartialEvent, sections: string[]): Record<string, unknown>;\n\n/**\n * Casts a value to a specific type.\n *\n * @param value The value to cast.\n * @returns The casted value.\n */\ndeclare function castValue(value: unknown): PropertyType;\n\n/**\n * Creates a deep clone of a value.\n * Supports primitive values, objects, arrays, dates, and regular expressions.\n * Handles circular references.\n *\n * @template T\n * @param org - The value to clone.\n * @param visited - A map of visited objects to handle circular references.\n * @returns The cloned value.\n */\ndeclare function clone<T>(org: T, visited?: WeakMap<object, unknown>): T;\n\n/**\n * Checks if the required consent is granted.\n *\n * @param required - The required consent states.\n * @param state - The current consent states.\n * @param individual - Individual consent states to prioritize.\n * @returns The granted consent states or false if not granted.\n */\ndeclare function getGrantedConsent(required: Consent | undefined, state?: Consent, individual?: Consent): false | Consent;\n\n/**\n * Creates a new destination instance by merging a base destination with additional configuration.\n *\n * This utility enables elegant destination configuration while avoiding config side-effects\n * that could occur when reusing destination objects across multiple collector instances.\n *\n * @param baseDestination - The base destination to extend\n * @param config - Additional configuration to merge with the base destination's config\n * @returns A new destination instance with merged configuration\n *\n * @example\n * ```typescript\n * // Types are inferred automatically from destinationGtag\n * elb('walker destination', createDestination(destinationGtag, {\n * settings: { ga4: { measurementId: 'G-123' } }\n * }));\n * ```\n */\ndeclare function createDestination<I extends Instance$5>(baseDestination: I, config: Partial<Config$5<TypesOf$3<I>>>): I;\n\n/**\n * Deep merges source into target, mutating target in-place.\n * Recurses into plain objects; everything else is a leaf (replaced).\n * Skips undefined source values; null overwrites.\n */\ndeclare function deepMerge<T extends Record<string, unknown>>(target: T, source: Record<string, unknown>): T;\n\n/**\n * Creates a complete event with default values.\n * Used for testing and debugging.\n *\n * Models a post-collector event: `source` always carries the run-stamped\n * `count` and `trace`, so a generated event matches one that has been pushed\n * through the collector. Override via `props.source` if needed.\n *\n * @param props - Properties to override the default values.\n * @returns A complete event.\n */\ndeclare function createEvent(props?: DeepPartialEvent): Event;\n/**\n * Creates a complete event with default values based on the event name.\n * Used for testing and debugging.\n *\n * @param name - The name of the event to create.\n * @param props - Properties to override the default values.\n * @returns A complete event.\n */\ndeclare function getEvent(name?: string, props?: DeepPartialEvent): Event;\n\ndeclare function getId(length?: number, charset?: string): string;\n\n/**\n * W3C span_id: 8 random bytes encoded as 16 lowercase hex characters.\n * Reference: W3C Trace Context (W3C Recommendation, January 2020).\n */\ndeclare function getSpanId(): string;\n\n/**\n * W3C trace_id: 16 random bytes encoded as 32 lowercase hex characters.\n * Shared by every event of a collector run. Reference: W3C Trace Context.\n */\ndeclare function getTraceId(): string;\n\ninterface ParsedTraceparent {\n /** W3C 32-hex trace id. */\n trace: string;\n /** W3C 16-hex parent span id (upstream event id). */\n parentSpan: string;\n}\n/**\n * Parse a W3C `traceparent` header value (`00-<32hex>-<16hex>-<2hex>`).\n * Returns undefined on any mismatch, and never throws. Rejects a non-string\n * input, wrong segment count, malformed segment lengths, uppercase hex, the\n * reserved `ff` version, an all-zero trace, and an all-zero span. Any other\n * 2-hex version is accepted for forward compatibility with future spec\n * revisions.\n */\ndeclare function parseTraceparent(value: unknown): ParsedTraceparent | undefined;\n\ninterface MarketingParameters {\n [key: string]: string;\n}\n/**\n * Click-ID registry entry — maps a URL parameter name to a canonical platform.\n *\n * Runtime shape only; the corresponding Zod schema lives in\n * `@walkeros/core/dev` (schemas/marketing.ts) for dev tooling that needs\n * validation or JSON Schema generation.\n */\ninterface ClickIdEntry {\n param: string;\n platform: string;\n}\n/**\n * Default click-ID registry.\n *\n * Ordered by priority: when a URL contains multiple click IDs, the entry\n * appearing earlier wins as the resolved `clickId` / `platform`. All matched\n * raw values are still preserved on the result.\n *\n * Extend via the third argument to {@link getMarketingParameters} or the\n * `clickIds` field in the session source settings.\n */\ndeclare const defaultClickIds: ClickIdEntry[];\n/**\n * Extracts marketing parameters from a URL.\n *\n * - UTM and custom params are mapped to friendly names (`utm_source` → `source`).\n * - Known click IDs are detected case-insensitively; each raw value is stored\n * under its canonical lowercase param name.\n * - `clickId` and `platform` reference the highest-priority match (first entry\n * in the registry present in the URL).\n * - Custom `clickIds` override default platforms by `param` in place and\n * append new params at the end of the priority list.\n */\ndeclare function getMarketingParameters(url: URL, custom?: MarketingParameters, clickIds?: ClickIdEntry[]): Properties;\n\n/**\n * Options for scheduling primitives ({@link debounce}, {@link throttle}).\n *\n * - `wait`: Debounce window in ms. Timer resets on every call.\n * - `size`: Hard call-count cap per window. Flush immediately when call\n * count reaches this number. Useful for batch buffers that must not\n * grow unbounded.\n * - `age`: Hard age cap in ms since the first call of the current window.\n * Forces a flush even if calls keep arriving and reset the debounce.\n * Prevents debounce starvation under sustained load.\n */\ninterface ScheduleOptions {\n wait?: number;\n size?: number;\n age?: number;\n}\n/**\n * Returned by {@link debounce}: a callable that schedules `fn` plus\n * deterministic `flush` / `cancel` controls.\n */\ninterface Debounced<P extends unknown[], R> {\n (...args: P): Promise<R | undefined>;\n /** Force an immediate flush with the most recent args. Resolves after `fn` settles. */\n flush(): Promise<R | undefined>;\n /** Cancel any pending invocation. No `fn` call, pending promises resolve to undefined. */\n cancel(): void;\n /** Number of scheduled calls since the current window opened. */\n size(): number;\n}\n/**\n * Creates a debounced function that delays invoking `fn` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `fn` invocations and a `flush` method to immediately invoke them.\n *\n * The second argument is either a `wait` number (legacy form) or a\n * {@link ScheduleOptions} object. The object form adds `size` (hard count\n * cap) and `age` (hard window-age cap) so the function flushes deterministically\n * under sustained load instead of letting the debounce reset forever.\n *\n * @template P, R\n * @param fn The function to debounce.\n * @param opts Either a wait-ms number or a {@link ScheduleOptions} object.\n * @param immediate Trigger the function on the leading edge, instead of the trailing.\n * @returns A {@link Debounced} callable with `flush`, `cancel`, and `size` methods.\n */\ndeclare function debounce<P extends unknown[], R>(fn: (...args: P) => R, opts?: number | ScheduleOptions, immediate?: boolean): Debounced<P, R>;\ndeclare function throttle<P extends unknown[], R>(fn: (...args: P) => R | undefined, opts?: number | ScheduleOptions): (...args: P) => R | undefined;\n\n/**\n * Checks if a value is an arguments object.\n *\n * @param value The value to check.\n * @returns True if the value is an arguments object, false otherwise.\n */\ndeclare function isArguments(value: unknown): value is IArguments;\n/**\n * Checks if a value is an array.\n *\n * @param value The value to check.\n * @returns True if the value is an array, false otherwise.\n */\ndeclare function isArray<T>(value: unknown): value is T[];\n/**\n * Checks if a value is a boolean.\n *\n * @param value The value to check.\n * @returns True if the value is a boolean, false otherwise.\n */\ndeclare function isBoolean(value: unknown): value is boolean;\n/**\n * Checks if an entity is a walker command.\n *\n * @param entity The entity to check.\n * @returns True if the entity is a walker command, false otherwise.\n */\ndeclare function isCommand(entity: string): entity is \"walker\";\n/**\n * Checks if a value is defined.\n *\n * @param value The value to check.\n * @returns True if the value is defined, false otherwise.\n */\ndeclare function isDefined<T>(val: T | undefined): val is T;\n/**\n * Checks if a value is an element or the document.\n *\n * @param elem The value to check.\n * @returns True if the value is an element or the document, false otherwise.\n */\ndeclare function isElementOrDocument(elem: unknown): elem is Element;\n/**\n * Checks if a value is a function.\n *\n * @param value The value to check.\n * @returns True if the value is a function, false otherwise.\n */\ndeclare function isFunction(value: unknown): value is Function;\n/**\n * Checks if a value is a number.\n *\n * @param value The value to check.\n * @returns True if the value is a number, false otherwise.\n */\ndeclare function isNumber(value: unknown): value is number;\n/**\n * Checks if a value is an object.\n *\n * @param value The value to check.\n * @returns True if the value is an object, false otherwise.\n */\ndeclare function isObject(value: unknown): value is AnyObject;\n/**\n * Checks if two variables have the same type.\n *\n * @param variable The first variable.\n * @param type The second variable.\n * @returns True if the variables have the same type, false otherwise.\n */\ndeclare function isSameType<T>(variable: unknown, type: T): variable is typeof type;\n/**\n * Checks if a value is a string.\n *\n * @param value The value to check.\n * @returns True if the value is a string, false otherwise.\n */\ndeclare function isString(value: unknown): value is string;\n\n/**\n * Create a logger instance\n *\n * @param config - Logger configuration\n * @returns Logger instance with all log methods and scoping support\n *\n * @example\n * ```typescript\n * // Basic usage\n * const logger = createLogger({ level: 'DEBUG' });\n * logger.info('Hello world');\n *\n * // With scoping\n * const destLogger = logger.scope('gtag').scope('myInstance');\n * destLogger.debug('Processing event'); // DEBUG [gtag:myInstance] Processing event\n *\n * // With custom handler\n * const logger = createLogger({\n * handler: (level, message, context, scope, originalHandler) => {\n * // Custom logic (e.g., send to Sentry)\n * originalHandler(level, message, context, scope);\n * }\n * });\n * ```\n *\n * // TODO: Consider compile-time stripping of debug logs in production builds\n * // e.g., if (__DEV__) { logger.debug(...) }\n */\ndeclare function createLogger(config?: Config$3): Instance$3;\n\n/**\n * Gets the mapping for an event.\n *\n * @param event The event to get the mapping for (can be partial or full).\n * @param mapping The mapping rules.\n * @param collector Required to evaluate rule-level conditions against the unified Context. Legacy callers may omit; rule-level conditions then run with `undefined as never` (defensive).\n * @returns The mapping result.\n */\ndeclare function getMappingEvent(event: DeepPartialEvent | PartialEvent | Event, mapping?: Rules, collector?: Instance$6): Promise<Result$2>;\n/**\n * Gets a value from a mapping.\n *\n * @param value The value to get the mapping from.\n * @param data The mapping data.\n * @param options The mapping options.\n * @returns The mapped value.\n */\ndeclare function getMappingValue(value: DeepPartialEvent | unknown | undefined, data?: Data$1, context?: Partial<Context$6>): Promise<Property | undefined>;\n/**\n * Processes an event through mapping configuration.\n *\n * This is the unified mapping logic used by both sources and destinations.\n * It applies transformations in this order:\n * 1. Config-level policy - modifies the event itself (global rules)\n * 2. Mapping rules - finds matching rule based on entity-action\n * 3. Event-level policy - modifies the event based on specific mapping rule\n * 4. Data transformation - creates context data\n * 5. Ignore check and name override\n *\n * Sources can pass partial events, destinations pass full events.\n * getMappingValue works with both partial and full events.\n *\n * @param event - The event to process (can be partial or full, will be mutated by policies)\n * @param config - Mapping configuration (mapping, data, policy, consent)\n * @param collector - Collector instance for context\n * @returns Object with transformed event, data, mapping rule, and ignore flag\n */\ndeclare function processEventMapping<T extends DeepPartialEvent | Event>(event: T, config: Config$7, collector: Instance$6): Promise<{\n event: T;\n data?: Property;\n mapping?: Rule;\n mappingKey?: string;\n ignore: boolean;\n silent: boolean;\n}>;\n\n/**\n * Resolve a user mapping rule against a package-shipped default rule.\n * - No extend/remove → replace (clone of override; today's behavior).\n * - extend → partial rule deep-merged onto base (null clears a field).\n * - remove → carried onto the merged rule for eval-time output stripping.\n * The returned rule never contains `extend`.\n */\ndeclare function mergeMappingRule(base: Rule, override: Rule): Rule;\n\n/**\n * Environment mocking utilities for walkerOS destinations\n *\n * Provides standardized tools for intercepting function calls in environment objects,\n * enabling consistent testing patterns across all destinations.\n */\ntype InterceptorFn = (path: string[], args: unknown[], original?: Function) => unknown;\n/**\n * Creates a proxied environment that intercepts function calls\n *\n * Uses Proxy to wrap environment objects and capture all function calls,\n * allowing for call recording, mocking, or simulation.\n *\n * @param env - The environment object to wrap\n * @param interceptor - Function called for each intercepted call\n * @returns Proxied environment with interceptor applied\n *\n * @example\n * ```typescript\n * const calls: Array<{ path: string[]; args: unknown[] }> = [];\n *\n * const testEnv = mockEnv(env.push, (path, args) => {\n * calls.push({ path, args });\n * });\n *\n * // Use testEnv with destination\n * await destination.push(event, { env: testEnv });\n *\n * // Analyze captured calls\n * expect(calls).toContainEqual({\n * path: ['window', 'gtag'],\n * args: ['event', 'purchase', { value: 99.99 }]\n * });\n * ```\n */\ndeclare function mockEnv<T extends object>(env: T, interceptor: InterceptorFn): T;\n/**\n * Traverses environment object and replaces values using a replacer function\n *\n * Alternative to mockEnv for environments where Proxy is not suitable.\n * Performs deep traversal and allows value transformation at each level.\n *\n * @param env - The environment object to traverse\n * @param replacer - Function to transform values during traversal\n * @returns New environment object with transformed values\n *\n * @example\n * ```typescript\n * const recordedCalls: APICall[] = [];\n *\n * const recordingEnv = traverseEnv(originalEnv, (value, path) => {\n * if (typeof value === 'function') {\n * return (...args: unknown[]) => {\n * recordedCalls.push({\n * path: path.join('.'),\n * args: structuredClone(args)\n * });\n * return value(...args);\n * };\n * }\n * return value;\n * });\n * ```\n */\ndeclare function traverseEnv<T extends object>(env: T, replacer: (value: unknown, path: string[]) => unknown): T;\n\n/**\n * Create a mock context for testing transformers and destinations.\n *\n * Provides sensible defaults for all required fields. Override only\n * what the test cares about. When context signatures change, only\n * this factory needs updating — not every test file.\n *\n * @example\n * ```typescript\n * // Transformer test — only specify config\n * const ctx = createMockContext({ config: { settings: { strict: true } } });\n * const result = await transformer.push(event, ctx);\n *\n * // Destination test — specify config and custom env\n * const ctx = createMockContext({ config: { settings: { url } }, env: { sendWeb } });\n * await destination.push(event, ctx);\n *\n * // With custom ingest data\n * const ctx = createMockContext({ ingest: { ...createIngest('test'), path: '/api' } });\n * ```\n */\ndeclare function createMockContext<T extends TypesGeneric$2 = Types$3>(overrides?: Partial<Omit<Context$4<T>, 'config' | 'ingest'> & {\n config?: Config$4<T> | Config$5<TypesGeneric$3>;\n ingest?: Ingest | (Record<string, unknown> & {\n _meta: Ingest['_meta'];\n });\n data?: unknown;\n rule?: unknown;\n}>): Context$4<T> & PushContext<TypesGeneric$3>;\n\n/**\n * Mock logger instance for testing\n * Includes all logger methods as jest.fn() plus tracking of scoped loggers\n * Extends Instance to ensure type compatibility\n */\ninterface MockLogger extends Instance$3 {\n error: jest.Mock;\n warn: jest.Mock;\n info: jest.Mock;\n debug: jest.Mock;\n throw: jest.Mock<never, [string | Error, unknown?]>;\n json: jest.Mock;\n scope: jest.Mock<MockLogger, [string]>;\n /**\n * Array of all scoped loggers created by this logger\n * Useful for asserting on scoped logger calls in tests\n */\n scopedLoggers: MockLogger[];\n}\n/**\n * Create a mock logger for testing\n * All methods are jest.fn() that can be used for assertions\n *\n * @example\n * ```typescript\n * const mockLogger = createMockLogger();\n *\n * // Use in code under test\n * someFunction(mockLogger);\n *\n * // Assert on calls\n * expect(mockLogger.error).toHaveBeenCalledWith('error message');\n *\n * // Assert on scoped logger\n * const scoped = mockLogger.scopedLoggers[0];\n * expect(scoped.debug).toHaveBeenCalledWith('debug in scope');\n * ```\n */\ndeclare function createMockLogger(): MockLogger;\n\n/**\n * Checks if a value is a valid property type.\n *\n * @param value The value to check.\n * @returns True if the value is a valid property type, false otherwise.\n */\ndeclare function isPropertyType(value: unknown): value is PropertyType;\n/**\n * Filters a value to only include valid property types.\n *\n * @param value The value to filter.\n * @returns The filtered value or undefined.\n */\ndeclare function filterValues(value: unknown): Property | undefined;\n/**\n * Casts a value to a valid property type.\n *\n * @param value The value to cast.\n * @returns The casted value or undefined.\n */\ndeclare function castToProperty(value: unknown): Property | undefined;\n\n/**\n * Converts a request string to a data object.\n *\n * @param parameter The request string to convert.\n * @returns The data object or undefined.\n */\ndeclare function requestToData(parameter: unknown): AnyObject | undefined;\n/**\n * Converts a data object to a request string.\n *\n * @param data The data object to convert.\n * @returns The request string.\n */\ndeclare function requestToParameter(data: AnyObject | PropertyType): string;\n\n/**\n * Transforms data to a string.\n *\n * @param data The data to transform.\n * @returns The transformed data.\n */\ndeclare function transformData(data?: SendDataValue): string | undefined;\n/**\n * Gets the headers for a request.\n *\n * @param headers The headers to merge with the default headers.\n * @returns The merged headers.\n */\ndeclare function getHeaders(headers?: SendHeaders): SendHeaders;\n\n/**\n * Normalize `config.setup` into a concrete options object, or null when disabled.\n *\n * - `false` / `undefined` → null (no setup)\n * - `true` → `defaults` as-is\n * - object → shallow merge of defaults and overrides (overrides win)\n */\ndeclare function resolveSetup<T extends object>(value: boolean | T | undefined, defaults: T): T | null;\n\n/**\n * Throws an error.\n *\n * @param error The error to throw.\n */\ndeclare function throwError(error: unknown): never;\n\n/**\n * Trims quotes and whitespaces from a string.\n *\n * @param str The string to trim.\n * @returns The trimmed string.\n */\ndeclare function trim(str: string): string;\n\n/**\n * A utility function that wraps a function in a try-catch block.\n *\n * @template P, R, S\n * @param fn The function to wrap.\n * @param onError A function to call when an error is caught.\n * @param onFinally A function to call in the finally block.\n * @returns The wrapped function.\n */\ndeclare function tryCatch<P extends unknown[], R, S>(fn: (...args: P) => R | undefined, onError: (err: unknown) => S, onFinally?: () => void): (...args: P) => R | S;\ndeclare function tryCatch<P extends unknown[], R>(fn: (...args: P) => R | undefined, onError?: undefined, onFinally?: () => void): (...args: P) => R | undefined;\n/**\n * A utility function that wraps an async function in a try-catch block.\n *\n * @template P, R, S\n * @param fn The async function to wrap.\n * @param onError A function to call when an error is caught.\n * @param onFinally A function to call in the finally block.\n * @returns The wrapped async function.\n */\ndeclare function tryCatchAsync<P extends unknown[], R, S>(fn: (...args: P) => R, onError: (err: unknown) => S, onFinally?: () => void | Promise<void>): (...args: P) => Promise<R | S>;\ndeclare function tryCatchAsync<P extends unknown[], R>(fn: (...args: P) => R, onError?: undefined, onFinally?: () => void | Promise<void>): (...args: P) => Promise<R | undefined>;\n\n/**\n * Error subclass for invariant violations or operator-initiated aborts\n * that must escape the top-level boundary catches in `collector.push`\n * and `collector.command`.\n *\n * Standard `Error` instances are absorbed by the boundary, logged, and\n * counted on `collector.status.failed`. A `FatalError` rethrows so a\n * runtime supervisor (CLI runner, Express server, container orchestrator)\n * can terminate the process cleanly.\n *\n * Use sparingly. Most operational failures are recoverable and should\n * be plain `Error`. Reserve `FatalError` for programmer-error invariant\n * violations or explicit fail-stop signals.\n */\ndeclare class FatalError extends Error {\n constructor(message: string, options?: ErrorOptions);\n}\n\n/**\n * A utility function that wraps a function with hooks.\n *\n * Pre/post hooks are user-supplied and may throw. A throwing hook must not\n * crash the surrounding pipeline. On failure, fall back to calling the\n * original function (pre-hook) or keep the original result (post-hook).\n *\n * The generic `F` preserves the exact call shape of `fn`, including named\n * parameters and overloaded interfaces, so call sites can assign the result\n * to the same interface slot without a cast.\n *\n * @template F The exact function type being wrapped.\n * @param fn The function to wrap.\n * @param name The name of the function.\n * @param hooks The hooks to use.\n * @param logger Optional logger for hook failure warnings. Falls back to\n * `console.warn` when not provided.\n * @returns The wrapped function with the same call shape as `fn`.\n */\ndeclare function useHooks<F extends AnyFunction$1>(fn: F, name: string, hooks: Functions, logger?: Instance$3): F;\n\n/**\n * Telemetry level. Off disables emission entirely. Standard projects\n * structural state without inEvent or outEvent payloads (unless explicitly\n * opted in). Trace emits full payloads on every hop.\n */\ntype TelemetryLevel = 'off' | 'standard' | 'trace';\n/**\n * Options that shape the telemetry projection strategy. Defaults are chosen\n * so a caller can pass `{ flowId }` and get sensible behavior.\n */\ninterface TelemetryOptions {\n /** Required flow identifier; observers may use this for cross-flow correlation. */\n flowId: string;\n /** Verbosity. Defaults to 'standard'. */\n level?: TelemetryLevel;\n /** Force-include the inbound event regardless of level. */\n includeIn?: boolean;\n /** Force-include the outbound event regardless of level. */\n includeOut?: boolean;\n /** Force-include the matched mapping key (only meaningful for transformers/destinations). */\n includeMappingKey?: boolean;\n /**\n * Fraction of events to emit, between 0 and 1. Deterministic by eventId:\n * the same eventId always falls on the same side of the threshold so\n * paired in/out states either both emit or both drop.\n */\n sample?: number;\n}\ntype EmitFn = (state: FlowState) => void;\n/**\n * Optional supplier form. When passed instead of static `TelemetryOptions`,\n * the observer evaluates the supplier on every emit so toggle-style runtime\n * overrides (e.g. `WALKEROS_TRACE_UNTIL`) reach the projection without\n * rebuilding the observer.\n */\ntype TelemetryOptionsSupplier = () => TelemetryOptions | null;\n/**\n * Build a telemetry observer that projects FlowState records according to\n * level/sample/include flags and forwards them to `emit`. The observer is\n * synchronous, never throws (a throwing emit is swallowed), and does no\n * IO of its own. Designed to be added to `collector.observers` so the\n * runtime self-emission loop drives it.\n *\n * Accepts either a static `TelemetryOptions` value or a supplier\n * `() => TelemetryOptions | null`. With a supplier, every emit reads the\n * current opts so toggles such as `WALKEROS_TRACE_UNTIL` reach the\n * projection without rebuilding the observer. A supplier returning `null`\n * suppresses the emit (telemetry off).\n */\ndeclare function createTelemetryObserver(emit: EmitFn, optsOrSupplier: TelemetryOptions | TelemetryOptionsSupplier): ObserverFn;\n/**\n * Convenience export: the internal sampling predicate so callers (and\n * tests) can verify the deterministic bucketing without importing the\n * private FNV-1a helper.\n */\ndeclare function isSampled(eventId: string, sample: number): boolean;\n\n/**\n * Runtime telemetry resolver.\n *\n * Converts a flow-side `Flow.Config.observe` block plus a runtime `traceUntil`\n * override into a concrete `TelemetryOptions` the collector hooks installer can\n * consume. Pure function of its inputs: it reads no environment.\n *\n * Resolution order (highest priority first):\n * 1. `traceUntil`, if a string that parses to a future ISO timestamp ->\n * force level=trace, sample=1, include in/out payloads.\n * 2. The `observe` block.\n * 3. A tier default of `{ level: 'standard' }`.\n *\n * The `traceUntil` value can flip between emits, so trace turns on and off as\n * the timestamp comes and goes. The platform-specific caller owns the value\n * and supplies it per emit.\n */\n\ninterface ResolveTelemetryInput {\n flowId: string;\n /** From `flow.config?.observe`. May be undefined. */\n observe?: {\n level?: 'off' | 'standard' | 'trace';\n sample?: number;\n };\n /** Runtime trace override. ISO timestamp parsing to a future time forces trace. */\n traceUntil?: string | null;\n /** Clock seam for tests. Defaults to `Date.now()`. */\n now?: () => number;\n}\n/**\n * Returns `TelemetryOptions` ready to pass to `createTelemetryObserver`,\n * or `null` if telemetry is disabled (`level === 'off'` with no trace\n * override). Callers should skip observer installation when this returns\n * null.\n */\ndeclare function resolveTelemetryOptions(input: ResolveTelemetryInput): TelemetryOptions | null;\n\n/** Claims carried by an activation grant. See the preview-sessions design spec. */\ninterface ActivationGrant {\n /** Issuing environment, e.g. 'app:stage'. Verifier rejects a foreign issuer. */\n iss: string;\n /** Exact origins this grant may activate on. Exact-membership match only. */\n aud: string[];\n /** Issue time, epoch seconds. The URL window is enforced against this. */\n iat: number;\n /** Session expiry, epoch seconds. Storage-sourced grants are rejected after it. */\n sxp: number;\n /** Opaque artifact id: the preview bundle is `preview/<art>.js`. */\n art: string;\n /** Subresource integrity of the artifact bytes, e.g. 'sha384-…'. */\n sri: string;\n /** Opaque per-project binding. Must equal the value baked into the host bundle. */\n pb: string;\n /** Capability. Only 'activate' exists today. */\n cap: 'activate';\n /** Per-grant unique id, for audit and revocation. */\n jti: string;\n /** Preview id, for correlation. Never a project id. */\n pid: string;\n /** Session id, present only on cross-part (web+server) grants. */\n ses?: string;\n /** Opaque per-session binding. Present iff `ses` is. */\n sb?: string;\n}\ntype PreviewFailure = 'no-grant' | 'malformed' | 'kid-mismatch' | 'bad-signature' | 'foreign-issuer' | 'expired' | 'aud-mismatch' | 'pb-mismatch' | 'sb-mismatch' | 'cap-mismatch' | 'no-subtle' | 'swap-failed';\ninterface ParsedGrant {\n grant: ActivationGrant;\n kid: string;\n /** The exact bytes covered by the signature: `${header}.${payload}` as UTF-8. */\n signed: Uint8Array;\n /** Raw r‖s signature, 64 bytes. */\n signature: Uint8Array;\n}\ntype VerifyResult = {\n ok: true;\n grant: ActivationGrant;\n} | {\n ok: false;\n reason: PreviewFailure;\n};\n/**\n * Parse a compact JWS activation grant. Pure and synchronous: this is the cheap\n * gate that runs before any crypto is touched. Returns null on anything\n * malformed: callers treat null as \"ignore, do not clear existing state\".\n */\ndeclare function parseGrant(raw: string): ParsedGrant | null;\n/** A public key a bundle or container will accept grants from. */\ninterface PreviewKey {\n kid: string;\n /** base64url-encoded P-256 SPKI. */\n spki: string;\n}\ntype PreviewBinary = ArrayBuffer | ArrayBufferView;\n/**\n * Structural slice of WebCrypto used by the verifier. Core compiles without\n * the DOM lib, so the ambient `Crypto` type is unavailable here: a structural\n * type also lets tests inject `node:crypto`'s webcrypto without casts and lets\n * `{}` model a subtle-less environment (same pattern as batchedPoster's\n * PosterFetch).\n */\ninterface PreviewSubtle {\n importKey(format: 'spki', keyData: PreviewBinary, algorithm: {\n name: string;\n namedCurve: string;\n }, extractable: boolean, keyUsages: string[]): Promise<unknown>;\n verify(algorithm: {\n name: string;\n hash: string;\n }, key: unknown, signature: PreviewBinary, data: PreviewBinary): Promise<boolean>;\n}\ninterface PreviewCrypto {\n subtle?: PreviewSubtle;\n}\n/**\n * The two real callers of `verifyActivation` bind audience differently: the\n * web loader always has a page origin and checks `aud` against it, while a\n * container has no origin at all and is bound to one session instead. A\n * discriminated union (rather than an optional `origin`) turns \"the caller\n * forgot `origin`\" from a silent aud-check skip into a compile error on the\n * web arm; `expectSession` is forced on the container arm for the same\n * reason, since that arm's whole job is proving it checked *something*.\n */\ntype VerifyAudience = {\n origin: string;\n expectSession?: undefined;\n} | {\n origin?: undefined;\n expectSession: {\n ses: string;\n sb: string;\n };\n};\ntype VerifyParams = VerifyAudience & {\n /** Keys this host accepts. Current + previous, so rotation is non-disruptive. */\n keyring: PreviewKey[];\n /** Expected issuer, e.g. 'app:stage'. */\n iss: string;\n /** This host's baked project binding. Required unless `acceptForeign`. */\n pb?: string;\n /** Demo hosts only: skip the pb match, require aud to be a single allowlisted origin. */\n acceptForeign?: boolean;\n demoAllowlist?: string[];\n /** Which clock applies: the URL handover window, or the session expiry. */\n source: 'url' | 'storage';\n /** Epoch milliseconds. Injected so tests and the server control the clock. */\n now: number;\n /** Defaults to globalThis.crypto. Injectable for jsdom/node tests. */\n crypto?: PreviewCrypto;\n};\n/** A grant handed over in a URL is only accepted this long after `iat`. */\ndeclare const URL_WINDOW_MS: number;\n/**\n * How far a grant's `iat` may sit in the future and still count as ordinary\n * clock skew rather than a broken or hostile mint clock (RFC 7519 §4.1.5\n * iat/nbf practice: reject a token issued in the future, with tolerance).\n */\ndeclare const CLOCK_SKEW_MS: number;\n/**\n * Verifier-side ceiling on `sxp - iat`, independent of whatever the mint's\n * clock claims. The design spec's session TTL is a 60-minute ceiling\n * (`sxp = min(iat + 60 min, session remaining)`); this adds a modest margin\n * above that so a legitimate boundary-exact grant is never rejected by\n * rounding, while still bounding how long a leaked grant stays usable if a\n * mint clock is skewed or wrong.\n */\ndeclare const MAX_SESSION_MS: number;\n/**\n * Verify an activation grant locally: no network, no DB, the signature plus\n * the baked bindings carry the whole decision.\n *\n * Claim checks run before the signature check so a hostile or malformed\n * value costs almost nothing, but `ok: true` is only ever reached after the\n * ES256 verify succeeds: no unsigned claim value is trusted on its own, it\n * only ever decides which rejection reason comes back.\n */\ndeclare function verifyActivation(raw: string, params: VerifyParams): Promise<VerifyResult>;\ninterface SwapActivatorConfig {\n keyring: PreviewKey[];\n iss: string;\n /** This bundle's project binding. Absent on demo hosts (see acceptForeign). */\n pb?: string;\n acceptForeign?: boolean;\n demoAllowlist?: string[];\n /** Bare CDN hostname, e.g. 'cdn.walkeros.io'. */\n previewOrigin: string;\n /** Injectable for tests. */\n now?: () => number;\n crypto?: PreviewCrypto;\n}\n/**\n * Decide whether a preview bundle should boot in place of this bundle's own flow.\n *\n * Returns true iff a preview took over, in which case the caller must not boot\n * the production flow. Every failure path deterministically returns false: the\n * loader never throws, never retries, and never leaves a page without a walker.\n *\n * Anti-griefing invariant: a rejected URL grant never touches stored state,\n * the activator falls back to the stored grant instead. Only a failing stored\n * grant clears storage (self-heal), plus `off` and `swap-failed`.\n */\ndeclare function browserSwapActivator(cfg: SwapActivatorConfig): Promise<boolean>;\n\n/**\n * Pure assembly of raw `FlowState` records into cross-runtime journeys. The\n * function is idempotent (duplicate records are deduped first) and\n * deterministic (output does not depend on input order; `options.now` supplies\n * the settle reference so tests never depend on the wall clock). It resolves\n * completeness (`pending`/`complete`/`partial`) against the settle window and,\n * when supplied, the topology frontier; loss is detected from per-platform\n * `seq` gaps and surfaced both session-level (`gaps`) and per journey (`lossy`).\n * Journeys are returned oldest-first by `firstTimestamp`; presenters re-sort as\n * needed. Each call recomputes everything from the raw records (there is no\n * incremental mode), so callers that re-resolve status on a settle tick re-run\n * the whole pipeline and should memoize on their inputs.\n */\ndeclare function assembleJourneys(records: FlowState[], options?: AssembleJourneysOptions): JourneyAssembly;\n\ndeclare function getTraceUntil(): string | null;\ndeclare function setTraceUntil(v: string | null): void;\n\n/**\n * Synchronously fans out a FlowState record to every registered observer\n * on the collector. Each call is wrapped in try/catch so a misbehaving\n * observer cannot crash the runtime; observers are advisory and must not\n * affect pipeline outcomes.\n *\n * Iterates a snapshot of the observer set so an observer adding or removing\n * another observer during the emit does not re-enter or skip in the same\n * pass. The early return on an empty set keeps the zero-observer hot path\n * allocation-free.\n */\ndeclare function emitStep(collector: Instance$6, state: FlowState): void;\n\n/**\n * Batched FlowState poster.\n *\n * Buffers FlowState records and flushes them to an HTTP endpoint either when\n * `batchMs` elapses since the first queued record, or when `batchSize` is\n * reached. Returns the emit callback that `createTelemetryObserver` consumes.\n *\n * Errors from the underlying fetch are swallowed (or routed through the\n * optional `onError` callback) so a transient observer outage cannot crash\n * the runtime.\n *\n * Uses the global `fetch` so the same primitive works in Node 18+, browsers,\n * and Edge runtimes. Tests may inject a stub via `opts.fetch`.\n */\n\n/**\n * Minimum HTTP response surface the poster touches. Anything that exposes\n * `ok` and `status` works. Decoupling from the DOM `Response` type lets the\n * helper run in Edge, browser, and Node-only test environments without\n * requiring `lib: dom` or a polyfill.\n */\ninterface PosterResponse {\n ok: boolean;\n status: number;\n}\n/**\n * Minimum fetch surface the poster needs. A subset of `typeof fetch` that\n * lets test harnesses pass a plain async function without dragging in the\n * Response/Request DOM types.\n */\ntype PosterFetch = (url: string, init: {\n method: string;\n headers: Record<string, string>;\n body: string;\n}) => Promise<PosterResponse>;\ninterface BatchedPosterOptions {\n /** Absolute HTTP endpoint URL. POST with JSON array body. */\n url: string;\n /** Bearer token sent in the `Authorization` header. */\n token: string;\n /** Max time to wait before flushing the current batch. Default 50 ms. */\n batchMs?: number;\n /** Max records per batch. When reached, flushes immediately. Default 50. */\n batchSize?: number;\n /**\n * Max serialized body size in UTF-8 bytes (the wire size body caps are\n * enforced in). A batch whose JSON exceeds this is split in half\n * recursively until each chunk fits. Default 60000.\n */\n maxBodyBytes?: number;\n /** Test seam. Defaults to the global `fetch`. */\n fetch?: PosterFetch;\n /** Called when the underlying POST rejects. Defaults to swallowing. */\n onError?: (err: unknown) => void;\n}\n/**\n * Build a batched emit callback. The returned function is synchronous, never\n * throws, and schedules an async flush in the background.\n *\n * Concurrency model: a single in-memory buffer plus a single pending timer.\n * When the timer fires (or `batchSize` is hit) the buffer is moved into a\n * local variable and reset, then POSTed. New records arriving during the in-\n * flight POST land in the next batch.\n */\ndeclare function createBatchedPoster(opts: BatchedPosterOptions): (state: FlowState) => void;\n\n/**\n * Parses a user agent string to extract browser, OS, and device information.\n *\n * @param userAgent The user agent string to parse.\n * @returns An object containing the parsed user agent information.\n */\ndeclare function parseUserAgent(userAgent?: string): User;\n/**\n * Gets the browser name from a user agent string.\n *\n * @param userAgent The user agent string.\n * @returns The browser name or undefined.\n */\ndeclare function getBrowser(userAgent: string): string | undefined;\n/**\n * Gets the browser version from a user agent string.\n *\n * @param userAgent The user agent string.\n * @returns The browser version or undefined.\n */\ndeclare function getBrowserVersion(userAgent: string): string | undefined;\n/**\n * Gets the OS name from a user agent string.\n *\n * @param userAgent The user agent string.\n * @returns The OS name or undefined.\n */\ndeclare function getOS(userAgent: string): string | undefined;\n/**\n * Gets the OS version from a user agent string.\n *\n * @param userAgent The user agent string.\n * @returns The OS version or undefined.\n */\ndeclare function getOSVersion(userAgent: string): string | undefined;\n/**\n * Gets the device type from a user agent string.\n *\n * @param userAgent The user agent string.\n * @returns The device type or undefined.\n */\ndeclare function getDeviceType(userAgent: string): string | undefined;\n\n/**\n * Inline Code Wrapping Utilities\n *\n * Converts inline code strings to executable functions for the three mapping\n * callbacks: condition, fn, validate. All three share a single signature:\n *\n * (value, context) => result\n *\n * Inside the inline body, the available bindings are:\n * - value: unknown - the value being mapped/validated/checked\n * - context: Mapping.Context with these fields:\n * event: WalkerOS.DeepPartialEvent\n * mapping: Mapping.Value | Mapping.Rule\n * collector: Collector.Instance\n * logger: Logger.Instance\n * consent?: WalkerOS.Consent\n *\n * If the body has no explicit `return`, it is auto-wrapped with `return`.\n *\n * @packageDocumentation\n */\n\n/**\n * Wrap inline code as a Mapping.Condition.\n *\n * @example\n * ```ts\n * const c = wrapCondition('context.consent?.marketing === true');\n * c(value, context); // boolean\n * ```\n */\ndeclare function wrapCondition(code: string): Condition;\n/**\n * Wrap inline code as a Mapping.Fn.\n *\n * @example\n * ```ts\n * const fn = wrapFn('value.user.email.split(\"@\")[1]');\n * fn(value, context); // domain\n * ```\n */\ndeclare function wrapFn(code: string): Fn$4;\n/**\n * Wrap inline code as a Mapping.Validate.\n *\n * @example\n * ```ts\n * const v = wrapValidate('typeof value === \"string\" && value.length > 0');\n * v(value, context); // boolean\n * ```\n */\ndeclare function wrapValidate(code: string): Validate;\n\ninterface ExampleSummary {\n name: string;\n description?: string;\n}\ninterface WalkerOSPackageMeta {\n packageName: string;\n version: string;\n description?: string;\n type?: string;\n platform?: string | string[];\n}\ninterface WalkerOSPackageInfo {\n packageName: string;\n version: string;\n type?: string;\n platform?: string | string[];\n schemas: Record<string, unknown>;\n examples: Record<string, unknown>;\n hints?: Record<string, unknown>;\n}\ninterface WalkerOSPackage extends WalkerOSPackageInfo {\n description?: string;\n docs?: string;\n source?: string;\n hintKeys: string[];\n exampleSummaries: ExampleSummary[];\n}\ndeclare function fetchPackage(packageName: string, options?: {\n version?: string;\n timeout?: number;\n baseUrl?: string;\n client?: string;\n}): Promise<WalkerOSPackage>;\n/**\n * @deprecated Use fetchPackage instead.\n * Still used by: entry.ts (validator), package-schemas.ts (MCP resource).\n */\ndeclare function fetchPackageSchema(packageName: string, options?: {\n version?: string;\n timeout?: number;\n baseUrl?: string;\n client?: string;\n}): Promise<WalkerOSPackageInfo>;\n\n/** Options for {@link resolveContracts}. */\ninterface ResolveContractsOptions {\n /**\n * When true (default), annotation keys (`description`, `examples`, `title`,\n * `$comment`) are stripped from event schemas so the result is AJV-clean for\n * runtime validation. Set to false to keep annotations (e.g. for IntelliSense\n * that surfaces property descriptions).\n */\n stripAnnotations?: boolean;\n}\n/**\n * Resolve all named contracts: process extend chains, expand wildcards,\n * strip annotations from event schemas.\n *\n * Returns a fully resolved map where each contract entry has inherited\n * properties merged in and wildcards expanded into concrete actions.\n *\n * By default annotations are stripped (AJV-clean). Pass\n * `{ stripAnnotations: false }` to preserve `description`/`examples`/`title`\n * on event schemas.\n */\ndeclare function resolveContracts(contracts: Flow.Contract, options?: ResolveContractsOptions): Record<string, Flow.ContractRule>;\n/**\n * Deep merge two JSON Schema objects with additive semantics.\n * - `required` arrays: union (deduplicated)\n * - `properties`: deep merge (child wins on conflict for scalars)\n * - Scalars: child overrides parent\n */\ndeclare function mergeContractSchemas(parent: Record<string, unknown>, child: Record<string, unknown>): Record<string, unknown>;\n\n/**\n * Env key under which the collector injects the observe-mode call recorder\n * (`Destination.EnvObserve`) into a per-push env. The resolution-point wrapper\n * strips this key before handing the env to the destination.\n */\ndeclare const OBSERVE_ENV_KEY: \"observe\";\n/**\n * Structural guard for `Destination.EnvObserve`: an object whose `paths` is a\n * string array and whose `record` is a function. Extra keys are tolerated.\n */\ndeclare function isEnvObserve(value: unknown): value is EnvObserve;\n/**\n * Parse a `simulation`/`calls` dot-path into segments, sharing one grammar with\n * `wrapEnv` so the two capture layers cannot drift. Strips a single leading\n * `call:` prefix (only the literal `call:`, never any other `<word>:`), then\n * splits on `.`. An empty path or any empty segment (leading, trailing, or\n * consecutive dots) is unresolvable and yields `[]`.\n */\ndeclare function parseCallPath(raw: string): string[];\n\ndeclare function mcpResult(result: unknown, hints?: {\n next?: string[];\n warnings?: string[];\n}): {\n content: {\n type: \"text\";\n text: string;\n }[];\n structuredContent: Record<string, unknown>;\n};\ndeclare function mcpError(error: unknown, hint?: string): {\n content: {\n type: \"text\";\n text: string;\n }[];\n structuredContent: Record<string, unknown>;\n isError: true;\n};\n\n/**\n * Compiles a match expression into a closure for fast runtime evaluation.\n * Regex patterns are compiled once. Numeric comparisons are parsed once.\n * Runtime evaluation is pure function calls with short-circuit logic.\n */\ndeclare function compileMatcher(expr: MatchExpression | '*' | undefined): CompiledMatcher;\n\ndeclare function isRouteConfigEntry(entry: unknown): boolean;\n/**\n * Pure RouteConfig array — every element is a RouteConfig object.\n * Used to detect the legacy first-match shape (treated as implicit `one`).\n */\ndeclare function isRouteArray(next: Route): next is RouteConfig[];\n/**\n * Resolve a Route spec against a matcher context. Returns the immediate\n * next transformer IDs.\n *\n * Return shape:\n * [] → terminate (gate failed, empty many, all matchers failed,\n * undefined spec).\n * [\"x\"] → continue main chain at x.\n * [\"a\",\"b\",…] → fan-out, only produced by `many`. Main chain terminates\n * at this dispatch point; each branch is an independent\n * flow running to its own exit.\n *\n * Reachability vs prediction: `match` rules read arbitrary event fields.\n * `getNextSteps` is deterministic for the SUPPLIED context only. Static\n * analyzers without a real event must over-approximate by treating each\n * match as \"may pass or fail\" — see `flattenRouteTargets` in the CLI\n * validator. This function does NOT predict the path a future event will\n * take; it computes the path for the event you give it.\n */\ndeclare function getNextSteps(spec: Route | undefined, context?: Record<string, unknown>): string[];\n\ninterface CompiledCacheRule {\n match: CompiledMatcher;\n key: string[];\n ttl: number;\n update?: EventCacheRule['update'];\n}\ninterface CompiledCache {\n stop: boolean;\n storeId?: string;\n namespace?: string;\n rules: CompiledCacheRule[];\n}\ninterface CacheResult {\n status: 'HIT' | 'MISS';\n key: string;\n value?: StoreValue;\n rule: CompiledCacheRule;\n}\n/**\n * Builds a structured context object for cache and routing operations.\n * Normalizes ingest (defaulting to {}) and optionally includes event.\n */\ndeclare function buildCacheContext(ingest?: unknown, event?: unknown): Record<string, unknown>;\ndeclare function compileCache(cache: Cache<EventCacheRule>): CompiledCache;\ndeclare function checkCache(compiled: CompiledCache, store: Instance$1, context: Record<string, unknown>, namespace?: string): Promise<CacheResult | null>;\ndeclare function storeCache(store: Instance$1, key: string, value: unknown, ttlSeconds: number): void;\ndeclare function applyUpdate(value: unknown, update: Record<string, unknown> | undefined, context: Record<string, unknown>, collector: Instance$6): Promise<unknown>;\n\n/**\n * Shared cache envelope used by BOTH cache mechanisms (the event cache in\n * `./cache.ts` and the store-cache wrapper in\n * `@walkeros/collector/store-cache-wrapper`). A cached value is wrapped in a\n * plain `{value, exp}` structured object, not a Buffer: the backing store\n * serializes it through the shared store codec (`./store/codec`), so any\n * structured store can persist it byte-exact, and a TTL-native tier\n * (in-memory `__cache`, Redis) can additionally evict via the `ttl` arg.\n *\n * The envelope owns expiry interpretation, not the store contract:\n * `StoreValue` carries no TTL field. The physical envelope keys are\n * namespaced (`__walkeros_cache_v__` / `__walkeros_cache_exp__`) so a user\n * value that happens to be shaped `{ value, exp }` is never mistaken for an\n * envelope, and conversely a wrapped envelope is unambiguous on read.\n */\ndeclare const ENVELOPE_VALUE = \"__walkeros_cache_v__\";\ndeclare const ENVELOPE_EXP = \"__walkeros_cache_exp__\";\n/** A wrapped cache envelope as it is persisted into the backing store. */\ntype CacheEnvelope = {\n [ENVELOPE_VALUE]: StoreValue;\n [ENVELOPE_EXP]?: number;\n};\n/**\n * Wrap a value in a `{value, exp}` envelope. When `ttlMs` is given, `exp` is\n * `now() + ttlMs`; when omitted, `exp` is left off entirely (no expiry).\n *\n * `now` is injectable so tests do not depend on ambient wall-clock time;\n * production callers omit it and the helper falls back to `Date.now`.\n */\ndeclare function wrapCacheEnvelope(value: StoreValue, ttlMs?: number, now?: () => number): CacheEnvelope;\n/**\n * Read a stored envelope. Returns:\n * - `undefined` when the key is absent (`stored === undefined`).\n * - `{ expired: true }` when the envelope's `exp` has elapsed (caller should\n * best-effort purge and treat as a MISS).\n * - `{ value }` otherwise.\n *\n * A stored value that is not a recognizable envelope (a raw live value, e.g.\n * a TTL-native tier that holds the value by reference, or a legacy entry) is\n * returned verbatim as `{ value: stored }`, so a non-enveloped HIT degrades\n * gracefully rather than being dropped.\n */\ndeclare function readCacheEnvelope(stored: StoreValue | undefined, now?: () => number): {\n value: StoreValue;\n} | {\n expired: true;\n} | undefined;\n\n/**\n * Thrown when a value cannot be serialized (e.g. a cyclic structure that\n * `JSON.stringify` rejects). Catchable and distinguishable from a raw\n * `TypeError` leaking out of the platform JSON implementation.\n */\ndeclare class StoreCodecError extends Error {\n constructor(message: string, options?: {\n cause?: unknown;\n });\n}\n/**\n * Recursive type guard: the restored value is structurally a `StoreValue`.\n * The single restore walk (`fromSerializableWith`) is JSON-derived plus\n * `Uint8Array` binary leaves, so this always holds; the guard makes the\n * narrowing explicit and cast-free at the public boundary.\n *\n * The guard accepts exactly what the serializer can encode. An `undefined`\n * object property is dropped and an `undefined` array element becomes `null`\n * on `JSON.stringify`, so an `undefined` nested value does NOT disqualify the\n * containing value (matching the serializer's runtime tolerance at the\n * `unknown -> StoreValue` boundary). The `StoreValue` TYPE still excludes\n * `undefined`; this only mirrors what survives serialization.\n */\ndeclare function isStoreValue(value: unknown): value is StoreValue;\n/**\n * Serialize a `StoreValue` to its UTF-8 JSON byte payload. Throws\n * `StoreCodecError` if the value cannot be encoded (e.g. a cyclic structure).\n */\ndeclare function serializeStoreValue(value: StoreValue): Uint8Array;\n/**\n * Restore a `StoreValue` from its UTF-8 JSON byte payload (or a JSON string).\n */\ndeclare function deserializeStoreValue(raw: Uint8Array | string): StoreValue;\n\n/**\n * Resolve a store by id. An `undefined` id falls back to the default\n * in-memory `__cache` store. Returns `undefined` when the id is unknown.\n */\ntype GetStore = (id: string | undefined) => Instance$1 | undefined;\n/** Normalize a single State or an array of States to an array. */\ndeclare function compileState(state: State | State[]): State[];\n/**\n * Apply declarative store operations against an event, in array order,\n * sequentially. `get` reads from the store and writes the fetched value to\n * the event's value path; `set` writes the resolved value to the store. Each\n * entry is fail-open: a store or resolution error is logged and the event is\n * left unmutated, the chain continues. Only `FatalError` rethrows (via\n * `getMappingValue`).\n */\ndeclare function applyState<E extends DeepPartialEvent>(states: State[], getStore: GetStore, event: E, collector: Instance$6): Promise<E>;\n\n/**\n * Single source of truth for step-entry validation across all four kinds.\n *\n * An empty entry (no `code`, no `package`, no `import`) is a valid no-op\n * step for all four kinds. The bundler emits no code; the runtime skips\n * registration. No error is raised for empty steps.\n *\n * Error codes:\n * - UNKNOWN_KEY unknown top-level key on a step entry\n * - CONFLICT two of {code, package, import} together, or other mutually exclusive pairs\n * - MISSING_PACKAGE `import` set without `package`\n * - OBSOLETE_CODE_STRING `code` is a string (legacy named-export shape; use `import` instead)\n * - INVALID_IMPORT `import` is set but is not a valid JS identifier\n * - INVALID_CODE_SHAPE `code` is present but is neither an object nor a string\n */\ndeclare const STEP_OPERATIVE_FIELDS: Record<Flow.StepKind, readonly string[]>;\ntype StepEntryErrorCode = 'UNKNOWN_KEY' | 'CONFLICT' | 'MISSING_PACKAGE' | 'OBSOLETE_CODE_STRING' | 'INVALID_IMPORT' | 'INVALID_CODE_SHAPE';\ninterface StepEntryValidation {\n ok: boolean;\n reason?: string;\n code?: StepEntryErrorCode;\n key?: string;\n}\ndeclare function validateStepEntry(entry: Record<string, unknown>, kind: Flow.StepKind): StepEntryValidation;\ndeclare function isPathStepEntry(entry: Record<string, unknown>, kind: Flow.StepKind): boolean;\n\ntype StepOut = Flow.StepOut;\n/**\n * Format a step example's `out` as readable code for docs/app rendering.\n *\n * - Empty `out` → `// no output`.\n * - `['return', value]` → `return <value>` (no parentheses).\n * - `[callable, ...args]` → `callable(<args>)`.\n * - Primitive args render as JSON (strings quoted, numbers/booleans/null bare).\n * - `undefined` renders as the literal token `undefined`.\n * - Objects/arrays render as `JSON.stringify(v, null, 2)`.\n * - Functions render as `[Function]` (rare in outs; safe fallback).\n *\n * Pure function. No runtime dependencies. Used by the website\n * `<StepExample>` renderer and the app `OutputPanel` for a single source of truth.\n */\ndeclare function formatOut(out: StepOut): string;\n\n/**\n * walkerOS reference-syntax regex constants — single source of truth.\n *\n * Rule:\n * - `.` = key or path (resolver walks it)\n * - `:` = literal value or raw-code payload (resolver uses it verbatim)\n *\n * Every tool that recognizes references (core resolver, CLI bundler,\n * app secrets service, explorer IntelliSense) imports these — no\n * inline regexes elsewhere.\n */\ndeclare const REF_VAR_FULL: RegExp;\ndeclare const REF_VAR_INLINE: RegExp;\ndeclare const REF_ENV: RegExp;\ndeclare const REF_CONTRACT: RegExp;\n/** Whole-string `$flow.<name>(.<path>)?`: cross-flow value reference. */\ndeclare const REF_FLOW: RegExp;\ndeclare const REF_STORE: RegExp;\ndeclare const REF_SECRET: RegExp;\ndeclare const REF_CODE_PREFIX = \"$code:\";\n/**\n * Canonical scanner for the `$flow.` reference grammar. Walks strings,\n * arrays, and objects and returns every referenced flow name. The returned\n * set is the same instance as `into` when one is supplied, so callers can\n * accumulate across multiple values.\n */\ndeclare function scanFlowRefs(value: unknown, into?: Set<string>): Set<string>;\n\nexport { type ActivationGrant, type AssembleJourneysOptions, type BatchedPosterOptions, type BreakerState, CLOCK_SKEW_MS, cache as Cache, type CacheEnvelope, type CacheResult, type ClickIdEntry, collector as Collector, type CompiledCache, Const, context as Context, type Credential, type Debounced, destination as Destination, type DestroyContext, type DestroyFn, type DroppedCounters, ENV_MARKER_PREFIX, elb as Elb, type EmitFn, type ExampleSummary, FatalError, Flow, type FlowConfigResolver, type FlowState, type FlowStateBatch, type FlowStatePhase, type FlowStepType, type GetStore, hint as Hint, hooks as Hooks, type Ingest, type IngestMeta, type Journey, type JourneyAssembly, type JourneyBranch, type JourneyCorrelation, type JourneyEntry, type JourneyGap, type JourneyHop, type JourneyHopStatus, type JourneyPlatform, type JourneyStatus, type JourneyTopology, type JourneyTopologyNode, type JsonSchema, Level, lifecycle as Lifecycle, type LifecycleContext, logger as Logger, MAX_SESSION_MS, mapping as Mapping, type MarketingParameters, matcher as Matcher, type MockLogger, OBSERVE_ENV_KEY, type ObserverFn, on as On, type ParsedGrant, type ParsedTraceparent, type PosterFetch, type PosterResponse, type PreviewCrypto, type PreviewFailure, type PreviewKey, type PreviewSubtle, REF_CODE_PREFIX, REF_CONTRACT, REF_ENV, REF_FLOW, REF_SECRET, REF_STORE, REF_VAR_FULL, REF_VAR_INLINE, request as Request, type ResolveContractsOptions, type ResolveOptions, type RespondFn, type RespondOptions, SECRET_MARKER_PREFIX, STEP_OPERATIVE_FIELDS, type ScheduleOptions, type SendDataValue, type SendHeaders, type SendResponse, type ServiceAccount, type SetupFn, simulation as Simulation, source as Source, type State, type StepEntryErrorCode, type StepEntryValidation, type StepKind, type StorageType, store as Store, StoreCodecError, type SwapActivatorConfig, type TelemetryLevel, type TelemetryOptions, type TelemetryOptionsSupplier, transformer as Transformer, trigger as Trigger, URL_WINDOW_MS, type ValidateEvents, type VerifyParams, type VerifyResult, walkeros as WalkerOS, type WalkerOSPackage, type WalkerOSPackageInfo, type WalkerOSPackageMeta, anonymizeIP, applyState, applyUpdate, assembleJourneys, assign, branch, browserSwapActivator, buildCacheContext, castToProperty, castValue, checkCache, clone, compileCache, compileMatcher, compileState, createBatchedPoster, createDestination, createEvent, createIngest, createLogger, createMockContext, createMockLogger, createRespond, createTelemetryObserver, debounce, deepMerge, defaultClickIds, deleteByPath, deserializeStoreValue, emitStep, fetchPackage, fetchPackageSchema, filterValues, flattenIncludeSections, formatOut, getBrowser, getBrowserVersion, getByPath, getDeviceType, getEvent, getFlowSettings, getGrantedConsent, getHeaders, getId, getMappingEvent, getMappingValue, getMarketingParameters, getNextSteps, getOS, getOSVersion, getPlatform, getSpanId, getTraceId, getTraceUntil, isArguments, isArray, isBoolean, isCommand, isDefined, isElementOrDocument, isEnvObserve, isFunction, isNumber, isObject, isPathStepEntry, isPropertyType, isRouteArray, isRouteConfigEntry, isSameType, isSampled, isStoreValue, isString, mcpError, mcpResult, mergeContractSchemas, mergeMappingRule, mockEnv, packageNameToVariable, parseCallPath, parseGrant, parseTraceparent, parseUserAgent, processEventMapping, readCacheEnvelope, requestToData, requestToParameter, resolveContracts, resolveSetup, resolveTelemetryOptions, scanFlowRefs, serializeStoreValue, setByPath, setTraceUntil, stepId, storeCache, throttle, throwError, transformData, traverseEnv, trim, tryCatch, tryCatchAsync, useHooks, validateStepEntry, verifyActivation, walkPath, wrapCacheEnvelope, wrapCondition, wrapFn, wrapValidate };\n"}}),f={};function g(e){l.has(e)||(l.add(e),e.languages.typescript.javascriptDefaults.setCompilerOptions({target:e.languages.typescript.ScriptTarget.ES2022??9,lib:["es2022","dom"],allowNonTsExtensions:!0,moduleResolution:e.languages.typescript.ModuleResolutionKind.NodeJs,module:e.languages.typescript.ModuleKind.ESNext,moduleDetection:3,noEmit:!0,esModuleInterop:!0,allowSyntheticDefaultImports:!0,skipLibCheck:!0,jsx:e.languages.typescript.JsxEmit.React,allowJs:!0,checkJs:!1,strict:!1,noImplicitAny:!1,strictNullChecks:!1}),e.languages.typescript.javascriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1,diagnosticCodesToIgnore:[1108,1005]}),e.languages.typescript.typescriptDefaults.setCompilerOptions({target:e.languages.typescript.ScriptTarget.ES2022??9,lib:["es2022","dom"],allowNonTsExtensions:!0,moduleResolution:e.languages.typescript.ModuleResolutionKind.NodeJs,module:e.languages.typescript.ModuleKind.ESNext,moduleDetection:3,noEmit:!0,esModuleInterop:!0,allowSyntheticDefaultImports:!0,skipLibCheck:!0,jsx:e.languages.typescript.JsxEmit.React,allowJs:!0,strict:!1,noImplicitAny:!1}))}function h(e,n,t){if(i.has(n))return!1;const r=e.languages.typescript.javascriptDefaults.addExtraLib(t,n),o=e.languages.typescript.typescriptDefaults.addExtraLib(t,n);return i.set(n,{uri:n,content:t,disposable:{dispose:()=>{r.dispose(),o.dispose()}}}),!0}function m(e){const n=i.get(e);return!!n&&(n.disposable?.dispose(),i.delete(e),!0)}function y(e,n,t){m(n),h(e,n,t)}async function b(e,n,t){try{const r=await fetch(n);if(!r.ok)return!1;const o=await r.text();return h(e,t||`file:///${n}`,o)}catch{return!1}}function v(e){let n=e.replace(/^import\s+(?:type\s+)?(?:\*\s+as\s+\w+|\{[^}]*\}|[\w$]+)(?:\s*,\s*(?:\{[^}]*\}|\*\s+as\s+\w+))?\s+from\s+['"][^'"]+['"];?\s*$/gm,"");return n=n.replace(/^import\s+(?:type\s+)?(?:\{[^}]*\}|\*\s+as\s+\w+|[\w$]+)\s+from\s+['"][^'"]+['"];?\s*$/gms,""),n=n.replace(/import\s*\(\s*['"][^'"]+['"]\s*\)/g,"any"),n=n.replace(/\n{3,}/g,"\n\n"),n}function w(e){d=e}function k(e,n){return d?`${d}/${encodeURIComponent(e)}/types?version=${encodeURIComponent(n)}`:`https://cdn.jsdelivr.net/npm/${e}@${n}/dist/index.d.ts`}async function x(e,n){const{package:t,version:r="latest"}=n,o=`file:///node_modules/${t}/index.d.ts`;if(i.has(o))return!0;const a=k(t,r);try{const n=await fetch(a);if(!n.ok)return!1;let r=await n.text();r=v(r);const s=`declare module '${t}' {\n${r}\n}`;return h(e,o,s)}catch{return!1}}function T(e){const n="file:///node_modules/@walkeros/core/index.d.ts";if(i.has(n))return!0;return h(e,n,`declare module '@walkeros/core' {\n${v(s)}\n}`)}function S(r,o){y(r,`file:///context/${o.type}.d.ts`,function(r){switch(r){case"fn":return e;case"condition":return n;case"validate":return t;default:return""}}(o.type))}function C(e,n,t){y(e,`file:///destinations/${n}.d.ts`,t)}function $(e){m(`file:///destinations/${e}.d.ts`)}function E(e){g(e),T(e),P(e)}function P(e){if(c.has(e))return;c.add(e);const n="\n import type {\n getMappingEvent as _getMappingEvent,\n getMappingValue as _getMappingValue,\n WalkerOS,\n } from '@walkeros/core';\n\n declare global {\n const getMappingEvent: typeof _getMappingEvent;\n const getMappingValue: typeof _getMappingValue;\n const elb: WalkerOS.Elb;\n }\n\n export {};\n ",t="file:///node_modules/@walkeros/_ambient/index.d.ts";e.languages.typescript.typescriptDefaults.addExtraLib(n,t),e.languages.typescript.javascriptDefaults.addExtraLib(n,t)}function R(e){g(e),T(e),S(e,{type:"condition"})}function _(){return Array.from(i.keys())}function O(){for(const e of i.values())e.disposable?.dispose();i.clear()}((e,n)=>{for(var t in n)r(e,t,{get:n[t],enumerable:!0})})(f,{addDestinationType:()=>C,addFunctionContextTypes:()=>S,addTypeLibrary:()=>h,clearAllTypeLibraries:()=>O,configureMonacoTypeScript:()=>g,getLoadedTypeLibraries:()=>_,initializeMonacoTypes:()=>R,loadPackageTypes:()=>x,loadTypeLibraryFromURL:()=>b,loadWalkerOSCoreTypes:()=>T,registerWalkerOSAmbients:()=>P,registerWalkerOSTypes:()=>E,removeDestinationType:()=>$,removeTypeLibrary:()=>m,resolveTypesUrl:()=>k,setPackageTypesBaseUrl:()=>w,updateTypeLibrary:()=>y});var F=a({"src/utils/monaco-types.ts"(){"use strict";u(),p(),i=new Map,l=new WeakSet,c=new WeakSet}});import{useState as I,useEffect as j,useRef as M,useCallback as D,useMemo as N}from"react";import{startFlow as A}from"@walkeros/collector";import{useRef as L,useState as V,useEffect as W,useCallback as B,useMemo as z}from"react";import{createContext as G,useContext as H,useRef as U}from"react";var q=G(null);function J(){return H(q)}import{jsx as K,jsxs as X}from"react/jsx-runtime";function Y({children:e,columns:n,minBoxWidth:t,gap:r,rowHeight:o="equal",maxRowHeight:a,showScrollButtons:s=!0,className:i=""}){const l=L(null),[c,d]=V(!1),[u,p]=V(!1),[f,g]=V(new Map),h=L(0),m=B(()=>h.current++,[]),y=B((e,n)=>{g(t=>{const r=new Map(t);return r.set(e,n),r})},[]),b=B(e=>{g(n=>{const t=new Map(n);return t.delete(e),t})},[]),v=z(()=>"synced"!==o||0===f.size?null:Math.min(600,Math.max(...Array.from(f.values()))),[f,o]),w=z(()=>({registerBox:y,unregisterBox:b,getBoxId:m,syncedHeight:v,enabled:"synced"===o}),[y,b,m,v,o]),k=["elb-explorer-grid"],x={};"auto"===o?k.push("elb-explorer-grid--row-auto"):"equal"===o?k.push("elb-explorer-grid--row-equal"):"synced"===o?k.push("elb-explorer-grid--row-synced"):"number"==typeof o&&(x["--grid-row-min-height"]=`${o}px`,x["--grid-row-max-height"]=`${o}px`),i&&k.push(i),void 0!==r&&(x.gap="number"==typeof r?`${r}px`:r),void 0!==t&&(x["--grid-min-box-width"]="number"==typeof t?`${t}px`:t),void 0!==a&&(x["--grid-row-max-height"]="none"===a?"none":"number"==typeof a?`${a}px`:a);const T=B(()=>{const e=l.current;if(!e)return;const n=e.scrollWidth>e.clientWidth,t=e.scrollLeft<=1,r=e.scrollLeft+e.clientWidth>=e.scrollWidth-1;d(n&&!t),p(n&&!r)},[]);return W(()=>{const e=l.current;if(e&&s)return T(),e.addEventListener("scroll",T),window.addEventListener("resize",T),()=>{e.removeEventListener("scroll",T),window.removeEventListener("resize",T)}},[T,s]),K(q.Provider,{value:w,children:X("div",{className:"elb-explorer elb-explorer-grid-wrapper",children:[s&&c&&K("button",{className:"elb-explorer-grid-scroll-button elb-explorer-grid-scroll-button--left",onClick:()=>{if(!l.current)return;const e=.8*l.current.clientWidth;l.current.scrollBy({left:-e,behavior:"smooth"})},"aria-label":"Scroll left",type:"button",children:"‹"}),K("div",{ref:l,className:k.join(" "),style:x,children:e}),s&&u&&K("button",{className:"elb-explorer-grid-scroll-button elb-explorer-grid-scroll-button--right",onClick:()=>{if(!l.current)return;const e=.8*l.current.clientWidth;l.current.scrollBy({left:e,behavior:"smooth"})},"aria-label":"Scroll right",type:"button",children:"›"})]})})}import{useState as Q,useEffect as Z,useRef as ee,useCallback as ne,useMemo as te}from"react";import{sourceBrowser as re}from"@walkeros/web-source-browser";import{useState as oe}from"react";import{jsx as ae,jsxs as se}from"react/jsx-runtime";function ie({label:e,children:n}){return se("div",{className:"elb-explorer-header",children:[ae("span",{className:"elb-explorer-label",children:e}),n]})}import{jsx as le,jsxs as ce}from"react/jsx-runtime";function de(){return ce("div",{className:"elb-explorer-traffic-lights",children:[le("span",{className:"elb-explorer-traffic-light elb-explorer-traffic-light--red"}),le("span",{className:"elb-explorer-traffic-light elb-explorer-traffic-light--yellow"}),le("span",{className:"elb-explorer-traffic-light elb-explorer-traffic-light--green"})]})}function ue({header:e,headerActions:n,footer:t,children:r,className:o="",style:a,height:s,minHeight:i,maxHeight:l,tiny:c=!1,resizable:d=!1,showHeader:u=!0,tabs:p,activeTab:f,onTabChange:g,defaultTab:h,showTrafficLights:m=!1}){const y=J(),[b,v]=oe(h||(p?.[0]?.id??"")),w=void 0!==f,k=w?f:b,x={...a};void 0!==s?x.height="number"==typeof s?`${s}px`:s:y?.syncedHeight&&(x.height=`${y.syncedHeight}px`),c?(x.height="auto",x.minHeight=void 0!==i?"number"==typeof i?`${i}px`:i:"100px"):void 0!==i&&(x.minHeight="number"==typeof i?`${i}px`:i),void 0!==l&&(x.maxHeight="number"==typeof l?`${l}px`:l),d&&(x.resize="vertical",x.overflow="auto");const T=!!y?.enabled?"elb-box--auto-height":"",S=p?.find(e=>e.id===k)?.content,C=S??r,$=p&&p.length>0,E=u&&e&&!$;return ce("div",{className:`elb-explorer elb-explorer-box ${T} ${o}`.trim(),style:x,children:[$&&ce("div",{className:"elb-explorer-tabs",children:[m&&le(de,{}),p.map(e=>le("button",{type:"button",className:"elb-explorer-tab "+(k===e.id?"elb-explorer-tab--active":""),onClick:()=>{return n=e.id,g&&g(n),void(w||v(n));var n},children:e.label},e.id)),n&&le("div",{className:"elb-explorer-tab-actions",children:n})]}),E&&le(ie,{label:e,children:n}),le("div",{className:"elb-explorer-content",children:C}),t&&le("div",{className:"elb-explorer-footer",children:t})]})}import{jsx as pe}from"react/jsx-runtime";var fe=[{type:"globals",label:"Globals",highlightClass:"highlight-globals"},{type:"context",label:"Context",highlightClass:"highlight-context"},{type:"entity",label:"Entity",highlightClass:"highlight-entity"},{type:"property",label:"Property",highlightClass:"highlight-property"},{type:"action",label:"Action",highlightClass:"highlight-action"}];function ge({highlights:e,onToggle:n,buttons:t=fe}){return pe("div",{className:"elb-preview-footer",children:t.map(t=>pe("button",{className:`elb-preview-btn ${e.has(t.type)?t.highlightClass:""}`,onClick:()=>n(t.type),type:"button",children:t.label},t.type))})}import{jsx as he}from"react/jsx-runtime";function me({active:e=!1,onClick:n,children:t,className:r=""}){return he("button",{className:`elb-explorer-btn ${e?"active":""} ${r}`,onClick:n,type:"button",children:t})}import{jsx as ye}from"react/jsx-runtime";function be({buttons:e,onButtonClick:n,className:t="",variant:r="segmented"}){return ye("div",{className:`elb-explorer-button-group${"tabs"===r?" elb-explorer-button-group--tabs":""} ${t}`,children:e.map(e=>ye(me,{active:e.active,onClick:()=>n(e.value),children:e.label},e.value))})}import{useEffect as ve,useState as we,useRef as ke,useCallback as xe}from"react";import{Editor as Te,loader as Se}from"@monaco-editor/react";var Ce="elbTheme-dark",$e="elbTheme-light";function Ee(e){return e.flatMap(e=>e.scopes.map(n=>{const t={token:n};return void 0!==e.foreground&&(t.foreground=e.foreground),void 0!==e.fontStyle&&(t.fontStyle=e.fontStyle),t}))}var Pe="697098",Re="c3e88d",_e="f78c6c",Oe="c084fc",Fe="82aaff",Ie="ffcb6b",je="bfc7d5",Me={base:"vs-dark",inherit:!0,rules:Ee([{foreground:Pe,fontStyle:"italic",scopes:["comment","comment.block","comment.line","comment.html","comment.line.double-slash","comment.line.number-sign","comment.block.documentation","punctuation.definition.comment"]},{foreground:Re,scopes:["string","string.quoted","string.template","string.value.json","string.json","string.html","string.css","string.js","string.ts","string.quoted.single","string.quoted.double","string.quoted.triple","punctuation.definition.string","punctuation.definition.string.begin","punctuation.definition.string.end","meta.string","attribute.value.html"]},{foreground:"89ddff",scopes:["string.regexp"]},{foreground:_e,scopes:["number","number.hex","number.binary","number.octal","number.float","constant.numeric","constant.numeric.decimal","constant.numeric.integer","constant.numeric.float","constant.numeric.hex","constant.numeric.binary","constant.numeric.octal","keyword.other.unit"]},{foreground:Oe,fontStyle:"italic",scopes:["keyword","keyword.control","keyword.control.flow","keyword.control.import","keyword.control.conditional","keyword.control.loop","storage.type","storage.modifier","keyword.declaration"]},{foreground:Oe,scopes:["keyword.other"]},{foreground:"89ddff",scopes:["operator","operators","keyword.operator","keyword.operator.assignment","keyword.operator.arithmetic","keyword.operator.logical","keyword.operator.comparison","keyword.operator.type","keyword.operator.type.ts"]},{foreground:Fe,scopes:["function","identifier.function","support.function","entity.name.function","meta.function-call","meta.function-call.entity.name.function","variable.function"]},{foreground:Ie,scopes:["type","type.identifier","entity.name.type","entity.name.class","support.type","support.class","support.type.primitive.ts","support.type.primitive.js","entity.name.type.ts","entity.name.type.js","meta.type.annotation","meta.type.annotation.ts","entity.other.inherited-class","storage.type.class","storage.type.function","storage.type.interface","support.type.primitive"]},{foreground:je,scopes:["variable","variable.name","variable.parameter","variable.parameter.ts","variable.parameter.js","variable.other","variable.other.readwrite","variable.other.constant","variable.language","meta.definition.variable","identifier","identifier.ts","identifier.js","support.type.property-name","support.type.property-name.json","string.key.json","string.name.tag.json","meta.object-literal.key","variable.other.property","variable.other.object.property","variable.other.constant.property"]},{foreground:Fe,scopes:["constant","constant.character","support.constant"]},{foreground:"ff5874",scopes:["constant.language","constant.language.boolean","constant.language.null","constant.language.undefined","constant.language.boolean.true","constant.language.boolean.false","keyword.constant.boolean"]},{foreground:"c792ea",scopes:["delimiter","delimiter.bracket","delimiter.parenthesis","delimiter.square","delimiter.html","punctuation","punctuation.separator","punctuation.definition","punctuation.terminator","punctuation.section","meta.brace","meta.brace.round","meta.brace.square","meta.brace.curly","meta.tag.html","punctuation.definition.tag.html"]},{foreground:"ff5572",scopes:["tag","meta.tag","entity.name.tag","entity.name.tag.tsx","entity.name.tag.jsx","punctuation.definition.tag","punctuation.definition.tag.begin","punctuation.definition.tag.end"]},{foreground:Re,scopes:["attribute.name","entity.other.attribute-name","meta.attribute"]},{foreground:"b2ccd6",scopes:["namespace","entity.name.namespace","storage.type.namespace"]},{foreground:"dddddd",scopes:["markup.underline.link","string.other.link"]},{foreground:Oe,fontStyle:"italic",scopes:["meta.tag.sgml.doctype"]},{fontStyle:"bold",scopes:["markup.bold"]},{fontStyle:"italic",scopes:["markup.italic"]},{foreground:Oe,fontStyle:"bold",scopes:["markup.heading"]},{foreground:Re,scopes:["markup.raw"]},{foreground:Pe,fontStyle:"italic",scopes:["markup.quote"]},{foreground:je,scopes:["markup.list"]},{foreground:je,scopes:["entity.name.tag.html","tag.html","entity.other.attribute-name.html","attribute.name.html"]},{foreground:"ff5572",scopes:["entity.name.tag.css"]},{foreground:Ie,scopes:["entity.other.attribute-name.class.css"]},{foreground:"82aaff",scopes:["entity.other.attribute-name.id.css"]},{foreground:"c084fc",scopes:["support.type.property-name.css"]},{foreground:_e,scopes:["support.constant.property-value.css","keyword.other.unit.css"]},{foreground:"ff5572",scopes:["invalid","invalid.illegal"]},{foreground:"f78c6c",scopes:["invalid.deprecated"]}]),colors:{"editor.background":"#00000000","editor.foreground":"#bfc7d5","editor.lineHighlightBackground":"#00000000","editorLineNumber.foreground":"#676E95","editorLineNumber.activeForeground":"#c084fc","editorCursor.foreground":"#c084fc","editor.selectionBackground":"#717CB450","editor.inactiveSelectionBackground":"#717CB430","editor.selectionHighlightBackground":"#717CB420","editorGutter.background":"#00000000","editorGutter.modifiedBackground":"#82aaff","editorGutter.addedBackground":"#c3e88d","editorGutter.deletedBackground":"#ff5572","editorWidget.background":"#1e1e2e","editorWidget.border":"#676E95","editorSuggestWidget.background":"#1e1e2e","editorSuggestWidget.border":"#676E95","editorSuggestWidget.selectedBackground":"#717CB440","editorStickyScroll.background":"#292d3e","editorStickyScroll.border":"#676E9540","editorStickyScrollHover.background":"#292d3e","editorStickyScroll.shadow":"#00000000","editorStickyScrollGutter.background":"#292d3e","editorHoverWidget.background":"#1e1e2e","editorHoverWidget.border":"#676E95","editorHoverWidget.statusBarBackground":"#676E95","editorInlineHint.background":"#292d3e","editorInlineHint.foreground":"#676E95","editorCodeLens.foreground":"#697098","editorGhostText.foreground":"#676E9540","editorWhitespace.foreground":"#676E9540","editorIndentGuide.background":"#676E9520","editorIndentGuide.activeBackground":"#676E95","scrollbar.shadow":"#00000000","scrollbarSlider.background":"#676E9530","scrollbarSlider.hoverBackground":"#676E9550","scrollbarSlider.activeBackground":"#676E9570","editorBracketMatch.background":"#676E9540","editorBracketMatch.border":"#676E95","editor.findMatchBackground":"#717CB440","editor.findMatchHighlightBackground":"#676E9530","editor.findRangeHighlightBackground":"#676E9520","minimap.background":"#292d3e","minimap.selectionHighlight":"#717CB440","minimap.findMatchHighlight":"#717CB440","editorOverviewRuler.border":"#676E9520","editorOverviewRuler.modifiedForeground":"#82aaff","editorOverviewRuler.addedForeground":"#c3e88d","editorOverviewRuler.deletedForeground":"#ff5572","peekView.border":"#676E95","peekViewEditor.background":"#1e1e2e","peekViewResult.background":"#1e1e2e","peekViewTitle.background":"#1e1e2e","diffEditor.insertedTextBackground":"#c3e88d20","diffEditor.removedTextBackground":"#ff557220"}};function De(e){e.editor.defineTheme(Ce,Me)}var Ne="6A737D",Ae="22863A",Le="6F42C1",Ve="005CC5",We="24292E",Be={base:"vs",inherit:!0,rules:Ee([{foreground:Ne,fontStyle:"italic",scopes:["comment","comment.block","comment.line","comment.html","comment.line.double-slash","comment.line.number-sign","comment.block.documentation","punctuation.definition.comment"]},{foreground:Ae,scopes:["string","string.quoted","string.template","string.value.json","string.json","string.html","string.css","string.js","string.ts","string.quoted.single","string.quoted.double","string.quoted.triple","punctuation.definition.string","punctuation.definition.string.begin","punctuation.definition.string.end","meta.string","attribute.value.html"]},{foreground:"032F62",scopes:["string.regexp"]},{foreground:"D73A49",scopes:["number","number.hex","number.binary","number.octal","number.float","constant.numeric.decimal","constant.numeric.integer","constant.numeric.float","constant.numeric.hex","constant.numeric.binary","constant.numeric.octal","keyword.other.unit"]},{foreground:"fb923c",scopes:["constant.numeric"]},{foreground:Le,fontStyle:"italic",scopes:["keyword","keyword.control","keyword.control.flow","keyword.control.import","keyword.control.conditional","keyword.control.loop","storage.type","storage.modifier","keyword.declaration"]},{foreground:Le,scopes:["keyword.other"]},{foreground:"01b5e2",scopes:["operator","operators"]},{foreground:"0086B3",scopes:["keyword.operator","keyword.operator.assignment","keyword.operator.arithmetic","keyword.operator.logical","keyword.operator.comparison","keyword.operator.type","keyword.operator.type.ts"]},{foreground:Ve,scopes:["function","identifier.function","support.function","entity.name.function","meta.function-call","meta.function-call.entity.name.function","variable.function"]},{foreground:"B08800",scopes:["type","type.identifier","entity.name.type","entity.name.class","support.type","support.class","support.type.primitive.ts","support.type.primitive.js","entity.name.type.ts","entity.name.type.js","meta.type.annotation","meta.type.annotation.ts","entity.other.inherited-class","storage.type.class","storage.type.function","storage.type.interface","support.type.primitive"]},{foreground:We,scopes:["variable","variable.name","variable.parameter","variable.parameter.ts","variable.parameter.js","variable.other","variable.other.readwrite","variable.other.constant","variable.language","meta.definition.variable","identifier","identifier.ts","identifier.js","support.type.property-name","support.type.property-name.json","string.key.json","string.name.tag.json","meta.object-literal.key","variable.other.property","variable.other.object.property","variable.other.constant.property"]},{foreground:Ve,scopes:["constant","constant.character","support.constant"]},{foreground:"ef4444",scopes:["constant.language","constant.language.boolean","constant.language.null","constant.language.undefined","constant.language.boolean.true","constant.language.boolean.false","keyword.constant.boolean"]},{foreground:We,scopes:["delimiter","delimiter.bracket","delimiter.parenthesis","delimiter.square","delimiter.html","punctuation","punctuation.separator","punctuation.definition","punctuation.terminator","punctuation.section","meta.brace","meta.brace.round","meta.brace.square","meta.brace.curly","meta.tag.html","punctuation.definition.tag.html"]},{foreground:"D73A49",scopes:["tag","meta.tag","entity.name.tag","entity.name.tag.tsx","entity.name.tag.jsx","punctuation.definition.tag","punctuation.definition.tag.begin","punctuation.definition.tag.end"]},{foreground:Ae,scopes:["attribute.name","entity.other.attribute-name","meta.attribute"]},{foreground:"6F42C1",scopes:["namespace","entity.name.namespace","storage.type.namespace"]},{foreground:"005CC5",scopes:["markup.underline.link","string.other.link"]},{foreground:Ne,fontStyle:"italic",scopes:["meta.tag.sgml.doctype"]},{fontStyle:"bold",scopes:["markup.bold"]},{fontStyle:"italic",scopes:["markup.italic"]},{foreground:Le,fontStyle:"bold",scopes:["markup.heading"]},{foreground:Ae,scopes:["markup.raw"]},{foreground:Ne,fontStyle:"italic",scopes:["markup.quote"]},{foreground:We,scopes:["markup.list"]},{foreground:We,scopes:["entity.name.tag.html","tag.html","entity.other.attribute-name.html","attribute.name.html"]},{foreground:"D73A49",scopes:["entity.name.tag.css"]},{foreground:"B08800",scopes:["entity.other.attribute-name.class.css"]},{foreground:"005CC5",scopes:["entity.other.attribute-name.id.css"]},{foreground:"6F42C1",scopes:["support.type.property-name.css"]},{foreground:"D73A49",scopes:["support.constant.property-value.css","keyword.other.unit.css"]},{foreground:"CB2431",scopes:["invalid","invalid.illegal"]},{foreground:"D73A49",scopes:["invalid.deprecated"]}]),colors:{"editor.background":"#00000000","editor.foreground":"#24292E","editor.lineHighlightBackground":"#00000000","editorLineNumber.foreground":"#1B1F2380","editorLineNumber.activeForeground":"#6F42C1","editorCursor.foreground":"#6F42C1","editor.selectionBackground":"#0366D630","editor.inactiveSelectionBackground":"#0366D620","editor.selectionHighlightBackground":"#0366D615","editorGutter.background":"#00000000","editorGutter.modifiedBackground":"#005CC5","editorGutter.addedBackground":"#28A745","editorGutter.deletedBackground":"#D73A49","editorWidget.background":"#F6F8FA","editorWidget.border":"#E1E4E8","editorSuggestWidget.background":"#F6F8FA","editorSuggestWidget.border":"#E1E4E8","editorSuggestWidget.selectedBackground":"#0366D625","editorStickyScroll.background":"#ffffff","editorStickyScroll.border":"#E1E4E8","editorStickyScrollHover.background":"#ffffff","editorStickyScroll.shadow":"#00000000","editorStickyScrollGutter.background":"#ffffff","editorHoverWidget.background":"#F6F8FA","editorHoverWidget.border":"#E1E4E8","editorHoverWidget.statusBarBackground":"#E1E4E8","editorInlineHint.background":"#F6F8FA","editorInlineHint.foreground":"#6A737D","editorCodeLens.foreground":"#6A737D","editorGhostText.foreground":"#1B1F2350","editorWhitespace.foreground":"#1B1F2340","editorIndentGuide.background":"#E1E4E820","editorIndentGuide.activeBackground":"#E1E4E8","scrollbar.shadow":"#00000000","scrollbarSlider.background":"#1B1F2330","scrollbarSlider.hoverBackground":"#1B1F2350","scrollbarSlider.activeBackground":"#1B1F2370","editorBracketMatch.background":"#34D05840","editorBracketMatch.border":"#34D058","editor.findMatchBackground":"#FFDF5D40","editor.findMatchHighlightBackground":"#FFDF5D30","editor.findRangeHighlightBackground":"#0366D620","minimap.background":"#FAFBFC","minimap.selectionHighlight":"#0366D625","minimap.findMatchHighlight":"#FFDF5D40","editorOverviewRuler.border":"#E1E4E820","editorOverviewRuler.modifiedForeground":"#005CC5","editorOverviewRuler.addedForeground":"#28A745","editorOverviewRuler.deletedForeground":"#D73A49","peekView.border":"#0366D6","peekViewEditor.background":"#F6F8FA","peekViewResult.background":"#FAFBFC","peekViewTitle.background":"#F6F8FA","diffEditor.insertedTextBackground":"#28A74520","diffEditor.removedTextBackground":"#D73A4920"}};function ze(e){e.editor.defineTheme($e,Be)}function Ge(e){De(e),ze(e)}F();var He=[/\bdata-elb(?!-)\b/g,/\bdata-elbaction\b/g,/\bdata-elbactions\b/g,/\bdata-elbglobals\b/g,/\bdata-elbcontext\b/g,/\bdata-elblink\b/g,/\bdata-elb-[\w-]+\b/g];var Ue=[{type:"variable",regex:/\$var\.(\w*(?:\.[\w.]*)?)/g,className:"elb-ref-variable"},{type:"secret",regex:/\$secret\.(\w*)/g,className:"elb-ref-secret"},{type:"env",regex:/\$env\.(\w*)(?::[^"}\s]*)?/g,className:"elb-ref-env"},{type:"contract",regex:/\$contract\.(\w*(?:\.[\w.]*)?)/g,className:"elb-ref-contract"},{type:"store",regex:/\$store\.(\w*)/g,className:"elb-ref-store"},{type:"flow",regex:/\$flow\.(\w*(?:\.[\w.]*)?)/g,className:"elb-ref-flow"},{type:"code",regex:/\$code:/g,className:"elb-ref-code"}];function qe(e){const n=[];for(const t of Ue){const r=new RegExp(t.regex.source,t.regex.flags);let o;for(;null!==(o=r.exec(e));)n.push({type:t.type,name:"code"===t.type?"":o[1]||"",startIndex:o.index,endIndex:o.index+o[0].length})}return n}function Je(e){let n=[];function t(){const t=e.getModel();if(!t)return;const r=qe(t.getValue()).map(e=>{const n=t.getPositionAt(e.startIndex),r=t.getPositionAt(e.endIndex),o=Ue.find(n=>n.type===e.type);return{range:{startLineNumber:n.lineNumber,startColumn:n.column,endLineNumber:r.lineNumber,endColumn:r.column},options:{inlineClassName:o.className}}});n=e.deltaDecorations(n,r)}t();const r=e.onDidChangeModelContent(()=>t());return()=>{r.dispose(),e.deltaDecorations(n,[])}}function Ke(){if("undefined"==typeof document)return;if(document.getElementById("walkeros-ref-styles"))return;const e=document.createElement("style");e.id="walkeros-ref-styles",e.textContent="\n .monaco-editor .elb-ref-variable { color: #89ddff !important; font-style: italic; }\n .monaco-editor .elb-ref-secret { color: #ffcb6b !important; font-style: italic; }\n .monaco-editor .elb-ref-env { color: #ffcb6b !important; font-style: italic; }\n .monaco-editor .elb-ref-contract { color: #c3e88d !important; font-style: italic; }\n .monaco-editor .elb-ref-store { color: #89ddff !important; font-style: italic; }\n .monaco-editor .elb-ref-flow { color: #82aaff !important; font-style: italic; }\n .monaco-editor .elb-ref-code { color: #c084fc !important; }\n ",document.head.appendChild(e)}import{REF_ENV as Xe,REF_CONTRACT as Ye,REF_FLOW as Qe,REF_STORE as Ze,REF_SECRET as en}from"@walkeros/core";import{resolveContracts as nn}from"@walkeros/core";var tn="",rn={};function on(e){const n=e.properties;return n&&"object"==typeof n?Object.entries(n).map(([e,n])=>({key:e,type:"string"==typeof n?.type?n.type:void 0})):[]}function an(e,n){if(!e||0===Object.keys(e).length)return[];const t=function(e){const n=JSON.stringify(e);if(n!==tn)try{rn=nn(e),tn=n}catch{return{}}return rn}(e);if(0===Object.keys(t).length)return[];if(0===n.length)return Object.keys(t).map(e=>({key:e,detail:t[e].description||"contract"}));const[r,...o]=n,a=t[r];if(!a)return[];if(0===o.length){const e=[];return void 0!==a.tagging&&e.push({key:"tagging",type:"number"}),void 0!==a.description&&e.push({key:"description",type:"string"}),a.schema&&e.push({key:"schema",detail:"JSON Schema"}),a.events&&e.push({key:"events",detail:"entity map"}),e}const s=o[0];if("schema"===s){const e=a.schema;return e&&"object"==typeof e?function(e,n){let t=e;for(const e of n){const n=t[e];if(!n||"object"!=typeof n)return[];t=n}if(t.properties&&"object"==typeof t.properties)return on(t);return Object.keys(t).filter(e=>"__proto__"!==e).map(e=>({key:e}))}(e,o.slice(1)):[]}if("events"===s){if(!a.events)return[];if(1===o.length)return Object.keys(a.events).filter(e=>"*"!==e).map(e=>({key:e,detail:"entity"}));const e=o[1],n=a.events[e];if(!n)return[];if(2===o.length)return Object.keys(n).filter(e=>"*"!==e).map(e=>({key:e,detail:"action"}));const t=n[o[2]];return t&&"object"==typeof t?3===o.length?on(t):function(e,n){let t=e;for(const e of n){const n=t.properties;if(!n||!n[e])return[];t=n[e]}return on(t)}(t,o.slice(3)):[]}return[]}function sn(e){return e&&0!==Object.keys(e).length?Object.entries(e).map(([e,n])=>({label:`$var.${e}`,insertText:`$var.${e}`,detail:`= ${JSON.stringify(n)}`,documentation:`Variable reference. Resolves to \`${JSON.stringify(n)}\` at runtime.`,kind:"variable",sortText:"0_var_"+e})):[]}function ln(e){return e&&0!==e.length?e.map(e=>({label:`$secret.${e}`,insertText:`$secret.${e}`,detail:"(secret)",documentation:"Secret reference. Value is securely injected at runtime. Never stored in config.",kind:"secret",sortText:"0_secret_"+e})):[]}function cn(e){return e&&0!==e.length?e.map(e=>({label:`$store.${e}`,insertText:`$store.${e}`,detail:"(store)",documentation:"Store reference. Injected as store instance at runtime.",kind:"reference",sortText:"0_store_"+e})):[]}function dn(e){return e&&0!==e.length?e.map(e=>({label:`$flow.${e}`,insertText:`$flow.${e}`,detail:"(flow)",documentation:`Cross-flow reference. Resolves to the resolved Flow.Config of "${e}" at runtime. Append \`.url\`, \`.settings.<key>\`, or another path inside that flow's config.`,kind:"reference",sortText:"0_flow_"+e})):[]}function un(e){return e&&0!==e.length?e.map(e=>({label:`$env.${e}`,insertText:`$env.${e}`,detail:"(env var)",documentation:`Environment variable. Resolved from process.env at runtime. Add a literal default with $env.${e}:default.`,kind:"variable",sortText:"0_env_"+e})):[]}var pn=[{label:"data",insertText:"data",detail:"(event data)",kind:"property",sortText:"0_event_data"},{label:"globals",insertText:"globals",detail:"(global properties)",kind:"property",sortText:"0_event_globals"},{label:"user",insertText:"user",detail:"(user properties)",kind:"property",sortText:"0_event_user"},{label:"context",insertText:"context",detail:"(context data)",kind:"property",sortText:"0_event_context"},{label:"custom",insertText:"custom",detail:"(custom properties)",kind:"property",sortText:"0_event_custom"},{label:"consent",insertText:"consent",detail:"(consent state)",kind:"property",sortText:"0_event_consent"},{label:"nested",insertText:"nested",detail:"(nested entities)",kind:"property",sortText:"0_event_nested"},{label:"entity",insertText:"entity",detail:"(string)",kind:"property",sortText:"1_event_entity"},{label:"action",insertText:"action",detail:"(string)",kind:"property",sortText:"1_event_action"},{label:"name",insertText:"name",detail:"(string)",kind:"property",sortText:"1_event_name"},{label:"trigger",insertText:"trigger",detail:"(string)",kind:"property",sortText:"1_event_trigger"},{label:"timestamp",insertText:"timestamp",detail:"(number)",kind:"property",sortText:"1_event_timestamp"},{label:"timing",insertText:"timing",detail:"(number)",kind:"property",sortText:"1_event_timing"},{label:"id",insertText:"id",detail:"(string)",kind:"property",sortText:"1_event_id"},{label:"group",insertText:"group",detail:"(string)",kind:"property",sortText:"1_event_group"},{label:"count",insertText:"count",detail:"(number)",kind:"property",sortText:"1_event_count"},{label:"source",insertText:"source",detail:"(source info)",kind:"property",sortText:"1_event_source"},{label:"version",insertText:"version",detail:"(version info)",kind:"property",sortText:"1_event_version"}];function fn(e,n,t,r){if(!r)return pn;if(!e||0===Object.keys(e).length)return[];const o="data"===r;if(!o&&!new Set(["globals","context","custom","user","consent"]).has(r))return[];const a=[],s=new Set;for(const i of Object.keys(e)){const l=an(e,o?[i,"events",n,t]:[i,"schema","properties",r,"properties"]);for(const e of l)s.has(e.key)||(s.add(e.key),a.push({label:`${r}.${e.key}`,insertText:`${r}.${e.key}`,detail:e.type?`(${e.type})`:"(property)",documentation:`Event property from contract. Maps to event.${r}.${e.key}.`,kind:"property",sortText:`0_mapping_${e.key}`}))}return a}function gn(e,n){if(!e||0===Object.keys(e).length)return[];const t=an(e,n),r=n.length>0?`$contract.${n.join(".")}.`:"$contract.";return t.map(e=>({label:`${r}${e.key}`.replace(/\.$/,""),insertText:0===n.length?`$contract.${e.key}`:`$contract.${n.join(".")}.${e.key}`,detail:e.type?`(${e.type})`:e.detail?`(${e.detail})`:"(contract)",documentation:`Contract reference. Resolves to the ${e.key} ${e.detail||"value"} at runtime.`,kind:"property",sortText:"0_contract_"+n.concat(e.key).join("_")}))}function hn(e,n){const t=[];let r,o=0,a=!1,s=-1,i=!1;for(;o<e.length&&o<=n;){const n=e[o];if(i)i=!1,o++;else if("\\"===n&&a)i=!0,o++;else{if('"'===n)if(a){const n=e.substring(s,o);a=!1;let t=o+1;for(;t<e.length&&/\s/.test(e[t]);)t++;":"===e[t]&&(r=n)}else a=!0,s=o+1;else a||("{"===n?void 0!==r&&(t.push(r),r=void 0):"}"===n&&t.pop());o++}}return void 0!==r&&t.push(r),t}function mn(e,n=[]){const t=["var","env","secret"],r=n.includes("env"),o=n.includes("settings");r&&t.push("store");("source"===e||"destination"===e)&&(o||r)&&t.push("flow");const a=n.indexOf("validate");return a>=0&&"events"===n[a+1]&&n.length>=a+4&&t.push("contract"),t}function yn(e){const n=e.source.replace(/^\^/,"").replace(/\$$/,"").replace(/\(\.\+\)\?$/,"([\\w.]+)?");return new RegExp(n,"g")}var bn=Ye.source.replace(/^\^/,"").split(/\\\./,1)[0],vn=new RegExp(`${bn}\\.([a-zA-Z0-9_.]*)?$`);var wn=new Map,kn=[],xn=!1;function Tn(e,n){wn.set(e,n)}function Sn(e){wn.delete(e)}function Cn(e){xn||(xn=!0,kn.push(e.languages.registerCompletionItemProvider("json",{triggerCharacters:['"',".","$"],provideCompletionItems(n,t){const r=n.uri.toString(),o=wn.get(r);if(!o)return{suggestions:[]};const a=n.getLineContent(t.lineNumber).substring(0,t.column-1),s=n.getOffsetAt(t),i=n.getValue(),l=function(e,n){const t=hn(e,n);if(!t||0===t.length)return null;const r=t[t.length-1],o=t[t.length-2];return"next"===r||"before"===r?r:"number"!=typeof r||"next"!==o&&"before"!==o?null:o}(i,s),c=[],d=hn(i,s),u=mn(o.nodeType,d);if(a.includes("$var.")||a.endsWith('"$var')){if(!u.includes("var"))return{suggestions:[]};c.push(...sn(o.variables))}else if(a.includes("$secret.")||a.endsWith('"$secret')){if(!u.includes("secret"))return{suggestions:[]};c.push(...ln(o.secrets))}else if(a.includes("$store.")||a.endsWith('"$store')){if(!u.includes("store"))return{suggestions:[]};c.push(...cn(o.stores))}else if(a.includes("$flow.")||a.endsWith('"$flow')){if(!u.includes("flow"))return{suggestions:[]};c.push(...dn(o.flows))}else if(a.includes("$env.")||a.endsWith('"$env')){if(!u.includes("env"))return{suggestions:[]};c.push(...un(o.envNames))}else if((a.includes("$contract.")||a.endsWith('"$contract'))&&function(e,n){const t=e.getLineContent(n.lineNumber),r=n.column-1,o=t.substring(0,r),a=o.lastIndexOf('"');if(a<0)return!1;const s=o.substring(a+1);return/^\$contract(\.[a-zA-Z0-9_.]*)?$/.test(s)}(n,t)){if(!u.includes("contract"))return{suggestions:[]};const e=a.match(vn),n=e?.[1]||"",t=n?n.split(".").filter(Boolean):[];n&&!n.endsWith(".")&&t.length>0&&t.pop(),c.push(...gn(o.contractRaw,t))}else!function(e,n,t){const r=hn(e,n);return!(!r||0===r.length)&&r[r.length-1]===t}(i,s,"package")?l?c.push(...function(e,n){return e?(e.transformers||[]).map(e=>({label:e,insertText:e,detail:`transformer (${n} chain)`,documentation:`Reference to transformer step "${e}" in this flow config.`,kind:"reference",sortText:"0_step_"+e})):[]}(o.stepNames,l)):(a.endsWith('"$')||a.endsWith('"'))&&(u.includes("var")&&c.push(...sn(o.variables)),u.includes("secret")&&c.push(...ln(o.secrets)),u.includes("store")&&c.push(...cn(o.stores)),u.includes("flow")&&c.push(...dn(o.flows)),u.includes("env")&&c.push(...un(o.envNames)),u.includes("contract")&&c.push(...gn(o.contractRaw,[]))):c.push(...(p=o.packages,f=o.platform,p&&0!==p.length?(f?p.filter(e=>e.platform===f):p).map(e=>({label:e.package,insertText:e.package,detail:`${e.type} (${e.platform})`,documentation:`walkerOS ${e.type}: ${e.shortName}`,kind:"module",sortText:"1_pkg_"+e.shortName})):[]));var p,f;if(0===c.length&&o.contractRaw){const e=function(e){const n=e.indexOf("mapping");if(-1===n)return null;const t=e[n+1],r=e[n+2];return t&&r?{entity:t,action:r}:null}(hn(i,s));if(e){const n=a.match(/"([a-z_]*)\.?$/);if(n){const t=n[1],r=fn(o.contractRaw,e.entity,e.action,t);r.length>0&&c.push(...r)}}}const g=a.match(/\$(?:var|secret|env|code|contract|store|flow)[.:]?[\w.]*$/),h=g?null:a.match(/[a-z_][\w.]*$/i),m=n.getWordUntilPosition(t),y=g?t.column-g[0].length:h?t.column-h[0].length:m.startColumn,b={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:y,endColumn:t.column};return{suggestions:c.map(n=>({label:n.label,insertText:n.insertText,detail:n.detail,documentation:n.documentation,kind:En(e,n.kind),sortText:n.sortText,range:b}))}}})),kn.push(e.languages.registerHoverProvider("json",{provideHover(e,n){const t=e.uri.toString(),r=wn.get(t);if(!r)return null;const o=e.getLineContent(n.lineNumber),a=n.column-1;function s(e){const n=new RegExp(e.source,"g");let t;for(;null!==(t=n.exec(o));)if(a>=t.index&&a<=t.index+t[0].length)return t;return null}const i=s(/\$var\.([a-zA-Z_][a-zA-Z0-9_]*)(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*/g);if(i&&r.variables){const e=i[1],t=i[0];if(e in r.variables){const o=r.variables[e];return{range:{startLineNumber:n.lineNumber,startColumn:i.index+1,endLineNumber:n.lineNumber,endColumn:i.index+t.length+1},contents:[{value:`**Variable:** \`${t}\`\n\n**Value:** \`${JSON.stringify(o)}\`\n\n*Resolved at runtime via variable interpolation*`}]}}return{contents:[{value:`**Unknown variable** \`$var.${e}\`\n\nDefined variables: ${Object.keys(r.variables).join(", ")||"none"}`}]}}const l=s(yn(en));if(l){const e=l[1];return r.secrets?.includes(e)?{range:{startLineNumber:n.lineNumber,startColumn:l.index+1,endLineNumber:n.lineNumber,endColumn:l.index+l[0].length+1},contents:[{value:`**Secret:** \`$secret.${e}\`\n\n*Securely injected at runtime. Value not stored in config.*`}]}:{contents:[{value:`**Unknown secret** \`$secret.${e}\`\n\nAvailable secrets: ${r.secrets?.join(", ")||"none"}`}]}}const c=s(yn(Ze));if(c){const e=c[1];return r.stores?.includes(e)?{range:{startLineNumber:n.lineNumber,startColumn:c.index+1,endLineNumber:n.lineNumber,endColumn:c.index+c[0].length+1},contents:[{value:`**Store:** \`$store.${e}\`\n\n*Resolved to store instance at runtime.*`}]}:{contents:[{value:`**Unknown store** \`$store.${e}\`\n\nAvailable: ${r.stores?.join(", ")||"none"}`}]}}const d=s(yn(Qe));if(d&&r.flows){const e=d[1],t=d[2],o=r.flows.includes(e),a=o?`**Flow reference:** \`$flow.${e}${t?`.${t}`:""}\``:`**Unknown flow** \`$flow.${e}\``,s=o?t?`Resolves to \`flows.${e}.config.${t}\` at runtime.`:`Resolves to the full \`Flow.Config\` block of "${e}" at runtime.`:`Available: ${r.flows.join(", ")||"none"}`;return{range:{startLineNumber:n.lineNumber,startColumn:d.index+1,endLineNumber:n.lineNumber,endColumn:d.index+d[0].length+1},contents:[{value:`${a}\n\n${s}`}]}}const u=s(yn(Xe));if(u){const e=u[1];return r.envNames&&r.envNames.length>0?r.envNames.includes(e)?{range:{startLineNumber:n.lineNumber,startColumn:u.index+1,endLineNumber:n.lineNumber,endColumn:u.index+u[0].length+1},contents:[{value:`**Env var:** \`$env.${e}\`\n\n*Resolved from process.env at runtime. Append \`:default\` for a literal fallback.*`}]}:{contents:[{value:`**Unknown env var** \`$env.${e}\`\n\nKnown: ${r.envNames.join(", ")||"none"}`}]}:{range:{startLineNumber:n.lineNumber,startColumn:u.index+1,endLineNumber:n.lineNumber,endColumn:u.index+u[0].length+1},contents:[{value:`**Env var:** \`$env.${e}\`\n\n*Resolved from process.env at runtime.*`}]}}const p=s(yn(Ye));if(p&&r.contractRaw){const e=p[0],t=e.replace("$contract.","").split("."),r=t[0],o=1===t.length?`**Contract:** \`${e}\`\n\nNamed contract entry "${r}".`:`**Contract reference:** \`${e}\`\n\nResolves path \`${t.slice(1).join(".")}\` in contract "${r}".`;return{range:{startLineNumber:n.lineNumber,startColumn:p.index+1,endLineNumber:n.lineNumber,endColumn:p.index+p[0].length+1},contents:[{value:o}]}}return null}})))}function $n(){for(const e of kn)e.dispose();kn.length=0,xn=!1,wn.clear()}function En(e,n){switch(n){case"variable":return e.languages.CompletionItemKind.Variable;case"reference":return e.languages.CompletionItemKind.Reference;case"secret":return e.languages.CompletionItemKind.Constant;case"module":return e.languages.CompletionItemKind.Module;case"property":return e.languages.CompletionItemKind.Property;default:return e.languages.CompletionItemKind.Text}}import*as Pn from"prettier/standalone";import Rn from"prettier/plugins/babel";import _n from"prettier/plugins/estree";import On from"prettier/plugins/typescript";import Fn from"prettier/plugins/html";var In,jn=new Map,Mn=0;var Dn={typescript:"ts",javascript:"js",typescriptreact:"tsx",javascriptreact:"jsx",json:"json",html:"html",css:"css",markdown:"md"};function Nn(e="json"){return`inmemory://walkeros/model-${++Mn}.${Dn[e]??"txt"}`}function An(e,n){jn.set(e,{uri:`schema://walkeros/${e}`,fileMatch:[e],schema:n}),Vn()}function Ln(e){jn.delete(e),Vn()}function Vn(){In&&In.jsonDefaults.setDiagnosticsOptions({validate:!0,schemaValidation:"error",schemaRequest:"ignore",enableSchemaRequest:!1,schemas:Array.from(jn.values())})}import{useState as Wn,useRef as Bn,useCallback as zn}from"react";function Gn(e){if(!e||"object"!=typeof e)return!1;const n=e;return"cancelation"===n.type||!(void 0===n.cause||!Gn(n.cause))}import{jsx as Hn}from"react/jsx-runtime";function Un({code:e,language:n="javascript",onChange:t,disabled:r=!1,lineNumbers:o=!1,minimap:a=!1,folding:s=!1,wordWrap:i=!1,className:l,beforeMount:c,onMount:d,autoHeight:u,fontSize:p=13,packages:g,sticky:h=!0,ide:m=!1,isolateScroll:y=!1,jsonSchema:b,intellisenseContext:v,validate:w,onMarkerCounts:k}){const[x,T]=we(!1),[S,C]=we("vs-light"),$=ke([]),P=ke(null),R=ke(null),_=ke(null),O=J(),I=ke(null);O?.enabled&&null===I.current&&(I.current=O.getBoxId());const j=xe(e=>{O?.enabled&&null!==I.current&&O.registerBox(I.current,e)},[O]);ve(()=>()=>{O?.enabled&&null!==I.current&&O.unregisterBox(I.current)},[O]);const M="object"==typeof u?u:{},[D,N]=function({enabled:e=!1,minHeight:n=100,maxHeight:t=800,defaultHeight:r=400,onHeightChange:o}={}){const[a,s]=Wn(e?n:r),i=Bn(null),l=Bn(e?n:r),c=Bn(null),d=zn(()=>{if(e&&i.current)try{const e=i.current.getContentHeight(),r=Math.max(n,Math.min(t,e));if(r===l.current)return;l.current=r,s(r),o&&o(r+36+2)}catch(e){}},[e,n,t,o]);return[a,zn(n=>{if(c.current&&(clearTimeout(c.current),c.current=null),i.current=n,!e||!n)return s(r),void(l.current=r);setTimeout(()=>d(),50);const t=n.onDidContentSizeChange(()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{d(),c.current=null},150)});n.__heightDisposable=t},[e,r,d])]}({enabled:!!u||!!O?.enabled,minHeight:M.min??(O?.enabled?1:20),maxHeight:M.max??600,defaultHeight:O?.enabled?250:400,onHeightChange:j});ve(()=>{!function(){if("undefined"==typeof document)return;const e="elb-monaco-data-attribute-styles";if(document.getElementById(e))return;const n=document.createElement("style");n.id=e,n.textContent="\n .monaco-editor .elb-data-attribute {\n color: var(--color-highlight-primary, #01b5e2) !important;\n }\n ",document.head.appendChild(n)}()},[]);const A=xe(()=>{if("undefined"==typeof document)return null;if(_.current){const e=_.current.closest("[data-theme]");if(e)return e.getAttribute("data-theme")}return document.documentElement.getAttribute("data-theme")},[]);ve(()=>{T(!0)},[]),ve(()=>{if(!x)return;const e=()=>{const e=A(),n="dark"===e||null===e&&window.matchMedia("(prefers-color-scheme: dark)").matches;C(n?Ce:$e)};e();const n=new MutationObserver(()=>{e()});n.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});const t=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{e()};return t.addEventListener("change",r),()=>{n.disconnect(),t.removeEventListener("change",r)}},[x,A]),ve(()=>{const e=R.current,n=_.current;if(!e||!n)return;const t=new ResizeObserver(()=>{requestAnimationFrame(()=>{e.layout()})});return t.observe(n),()=>{t.disconnect()}},[]);const L=ke(null);ke(v).current=v;const V=ke(w);V.current=w;const W=ke(k);W.current=k,L.current||(L.current=Nn(n)),ve(()=>{if(b&&L.current)return An(L.current,b),()=>{L.current&&Ln(L.current)}},[b]),ve(()=>{if(v&&L.current)return Tn(L.current,v),()=>{L.current&&Sn(L.current)}},[v]),ve(()=>{const n=R.current,t=n?.getModel();if(!n||!t)return;if(t.getValue()===e)return;const r=n.saveViewState();t.pushEditOperations([],[{range:t.getFullModelRange(),text:e}],()=>null),r&&n.restoreViewState(r)},[e]);const B=Te;ve(()=>()=>{for(const e of $.current)e();$.current=[]},[]);const z=u||O?.enabled?`${D}px`:"100%",G=`elb-code ${!!u||!!O?.enabled?"elb-code--auto-height":""} ${l||""}`.trim();return Hn("div",{className:G,ref:_,children:Hn(B,{height:z,language:n,defaultValue:e,onChange:e=>{t&&void 0!==e&&t(e)},beforeMount:async e=>{var t;if(P.current=e,function(e){In||(In=e.json,jn.size>0&&Vn())}(e),Ge(e),(t=e).languages.registerDocumentFormattingEditProvider("javascript",{async provideDocumentFormattingEdits(e,n){try{const t=e.getValue(),r=await Pn.format(t,{parser:"babel",plugins:[Rn,_n],tabWidth:n.tabSize,useTabs:!n.insertSpaces,semi:!0,singleQuote:!0,trailingComma:"all"});return[{range:e.getFullModelRange(),text:r}]}catch(e){return[]}}}),t.languages.registerDocumentFormattingEditProvider("typescript",{async provideDocumentFormattingEdits(e,n){try{const t=e.getValue(),r=await Pn.format(t,{parser:"typescript",plugins:[On,_n],tabWidth:n.tabSize,useTabs:!n.insertSpaces,semi:!0,singleQuote:!0,trailingComma:"all"});return[{range:e.getFullModelRange(),text:r}]}catch(e){return[]}}}),t.languages.registerDocumentFormattingEditProvider("json",{async provideDocumentFormattingEdits(e,n){try{const t=e.getValue(),r=JSON.parse(t),o=JSON.stringify(r,null,n.tabSize);return[{range:e.getFullModelRange(),text:o}]}catch(e){return[]}}}),t.languages.registerDocumentFormattingEditProvider("html",{async provideDocumentFormattingEdits(e,n){try{const t=e.getValue(),r=await Pn.format(t,{parser:"html",plugins:[Fn],tabWidth:n.tabSize,useTabs:!n.insertSpaces,htmlWhitespaceSensitivity:"css"});return[{range:e.getFullModelRange(),text:r}]}catch(e){return[]}}}),t.languages.registerDocumentFormattingEditProvider("css",{async provideDocumentFormattingEdits(e,n){try{const t=e.getValue(),r=await Pn.format(t,{parser:"css",plugins:[Fn],tabWidth:n.tabSize,useTabs:!n.insertSpaces});return[{range:e.getFullModelRange(),text:r}]}catch(e){return[]}}}),g&&g.length>0){E(e);const{loadPackageTypes:n}=await Promise.resolve().then(()=>(F(),f));for(const t of g)"@walkeros/core"!==t&&await n(e,{package:t}).catch(()=>{})}const r=A(),o="dark"===r||null===r&&window.matchMedia("(prefers-color-scheme: dark)").matches?Ce:$e;e.editor.setTheme(o),"json"===n&&Cn(e),c&&c(e)},onMount:e=>{if(R.current=e,(u||O?.enabled)&&N(e),"html"===n&&P.current&&$.current.push(function(e,n){const t=[],r=()=>{const r=e.getModel();if(!r)return;const o=r.getValue(),a=[];He.forEach(e=>{let t;for(;null!==(t=e.exec(o));){const e=r.getPositionAt(t.index),o=r.getPositionAt(t.index+t[0].length);a.push({range:new n.Range(e.lineNumber,e.column,o.lineNumber,o.column),options:{inlineClassName:"elb-data-attribute",inlineClassNameAffectsLetterSpacing:!0}})}});const s=e.deltaDecorations(t,a);t.length=0,t.push(...s)};r();const o=e.onDidChangeModelContent(()=>{r()});return()=>{o.dispose(),e.deltaDecorations(t,[])}}(e,P.current)),"json"===n&&(Ke(),$.current.push(Je(e))),V.current&&P.current){const n=P.current;let t;const r=()=>{const t=e.getModel();if(!t)return;const r=t.getValue(),o=V.current;if(!o)return;const a=o(r),s=[...a.errors,...a.warnings];n.editor.setModelMarkers(t,"validate",s.map(e=>({severity:"error"===e.severity?8:4,message:e.message,startLineNumber:e.line,startColumn:e.column,endLineNumber:e.endLine??e.line,endColumn:e.endColumn??e.column+1})))};r();const o=e.onDidChangeModelContent(()=>{clearTimeout(t),t=setTimeout(r,300)});$.current.push(()=>{clearTimeout(t),o.dispose()})}if(W.current&&P.current){const n=P.current,t=e.getModel(),r=!!V.current;if(t){const e=()=>{r&&n.editor.setModelMarkers(t,"json",[]);const e=n.editor.getModelMarkers({resource:t.uri});let o=0,a=0;const s=[];for(const n of e)8===n.severity?(o++,s.push({message:n.message,severity:"error",line:n.startLineNumber,column:n.startColumn})):4===n.severity&&(a++,s.push({message:n.message,severity:"warning",line:n.startLineNumber,column:n.startColumn}));W.current?.({errors:o,warnings:a,markers:s})},o=n.editor.onDidChangeMarkers(n=>{n.some(e=>e.toString()===t.uri.toString())&&e()});requestAnimationFrame(e),$.current.push(()=>{o.dispose()})}}requestAnimationFrame(()=>{e.layout()}),d&&d(e)},theme:S,path:L.current||void 0,options:{readOnly:r||!t,readOnlyMessage:{value:""},minimap:{enabled:a},fontSize:p,lineHeight:Math.round(1.5*p),padding:0,lineNumbers:o?"on":"off",lineNumbersMinChars:3,glyphMargin:!1,folding:s,lineDecorationsWidth:8,scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,detectIndentation:!1,trimAutoWhitespace:!1,wordWrap:i?"on":"off",fixedOverflowWidgets:!0,overviewRulerLanes:0,renderLineHighlight:"none",renderValidationDecorations:m||b?"editable":"off",hover:{enabled:m||!!b||!!v},"semanticHighlighting.enabled":m,showDeprecated:m,showUnused:m,"bracketPairColorization.enabled":!1,guides:{bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveBracketPair:!1,indentation:!1},scrollbar:{vertical:"auto",horizontal:"auto",alwaysConsumeMouseWheel:y},cursorBlinking:"blink",cursorStyle:"line",cursorWidth:2,cursorSmoothCaretAnimation:"off",selectionHighlight:!1,occurrencesHighlight:"off",selectOnLineNumbers:!1,wordBasedSuggestions:"off",quickSuggestions:!(!b&&!v)&&{strings:!0,other:!1,comments:!1},stickyScroll:{enabled:h}}})})}"undefined"!=typeof window&&window.addEventListener("unhandledrejection",e=>{Gn(e.reason)&&e.preventDefault()}),"undefined"!=typeof window&&Se.init().then(e=>{g(e),P(e)}).catch(e=>{console.warn("[walkerOS] Monaco loader.init() failed:",e)});import{Fragment as qn,jsx as Jn,jsxs as Kn}from"react/jsx-runtime";var Xn='<div data-elb="product" data-elbaction="click:add"><button data-elb-product="name:Example;price:9.99">Add to cart</button></div>';function Yn({html:e,css:n="",js:t="",elb:r,label:o="Preview",editable:a=!1,initialTab:s="preview",onHtmlChange:i,onCssChange:l,onJsChange:c,lineNumbers:d=!1,wordWrap:u=!1}){const p=e&&e.trim().length>0?e:Xn,[f,g]=Q(s),[h,m]=Q(new Set),y=ee(null),b=ee(void 0),v=ee(r),w=ee(e),k=ee(n),x=ee(h),T=ee(null),S=ee(!1);v.current=r,w.current=p,k.current=n,x.current=h;const C=ne(e=>{e.querySelectorAll("[data-elb]").forEach(e=>{const n=e.getAttribute("data-elb");if(!n)return;const t=`[data-elb-${n}]`;e.querySelectorAll(t).forEach(e=>{e.setAttribute("data-elbproperty","")})})},[]),$=ne(async({fireLoad:e})=>{const n=y.current;if(!n||!n.contentDocument)return;const t=n.contentDocument,r=Array.from(x.current).map(e=>`highlight-${e}`).join(" ");if(t.open(),t.write(`\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset="utf-8">\n <style>\n /* Reset */\n * { margin: 0; padding: 0; box-sizing: border-box; }\n body {\n padding: 1.5rem;\n background: #f9fafb;\n color: #111827;\n min-height: 100vh;\n }\n\n @media (prefers-color-scheme: dark) {\n body {\n background: #1f2937;\n color: #e5e7eb;\n }\n }\n\n /* User CSS */\n ${k.current}\n\n /* Highlight CSS - imported from highlight styles */\n :root {\n --highlight-globals: #4fc3f7cc;\n --highlight-context: #ffbd44cc;\n --highlight-entity: #00ca4ecc;\n --highlight-property: #ff605ccc;\n --highlight-action: #9900ffcc;\n }\n\n body.elb-highlight.highlight-globals [data-elbglobals] {\n box-shadow: 0 0 0 2px var(--highlight-globals);\n }\n\n body.elb-highlight.highlight-entity [data-elb] {\n box-shadow: 0 0 0 2px var(--highlight-entity);\n }\n\n body.elb-highlight.highlight-context [data-elbcontext] {\n box-shadow: 0 0 0 2px var(--highlight-context);\n }\n\n body.elb-highlight.highlight-property [data-elbproperty] {\n box-shadow: 0 0 0 2px var(--highlight-property);\n }\n\n body.elb-highlight.highlight-action [data-elbaction] {\n box-shadow: 0 0 0 2px var(--highlight-action);\n }\n\n /* Combined highlights */\n body.elb-highlight.highlight-entity.highlight-action [data-elb][data-elbaction] {\n box-shadow: 0 0 0 2px var(--highlight-action), 0 0 0 4px var(--highlight-entity);\n }\n\n body.elb-highlight.highlight-entity.highlight-context [data-elb][data-elbcontext] {\n box-shadow: 0 0 0 2px var(--highlight-entity), 0 0 0 4px var(--highlight-context);\n }\n\n body.elb-highlight.highlight-action.highlight-context [data-elbaction][data-elbcontext] {\n box-shadow: 0 0 0 2px var(--highlight-action), 0 0 0 4px var(--highlight-context);\n }\n </style>\n </head>\n <body class="elb-highlight ${r}">\n ${w.current}\n </body>\n </html>\n `),t.close(),C(t),T.current){try{await(T.current.instance.destroy?.(T.current.destroyContext))}catch{}T.current=null}if(v.current&&n.contentWindow&&n.contentDocument&&(await new Promise(e=>setTimeout(e,50)),n.contentWindow&&n.contentDocument&&v.current))try{const t=()=>({error:()=>{},warn:()=>{},info:()=>{},debug:()=>{},json:()=>{},throw:e=>{throw e instanceof Error?e:new Error(e)},scope:()=>t()}),r=t(),o=async()=>({ok:!0,destination:{}}),a={settings:{pageview:!1,prefix:"data-elb",elb:"elb",elbLayer:"elbLayer",scope:n.contentDocument.body}},s={elb:v.current,push:o,command:async()=>({ok:!0,destination:{}}),logger:r,window:n.contentWindow,document:n.contentDocument},i=await re({id:"preview",collector:{},logger:r,withScope:async(e,n,t)=>t({}),config:a,env:s});await(i.init?.()),!e&&S.current||(await(i.on?.("run")),S.current=!0),T.current={instance:i,destroyContext:{id:"preview",config:a,env:s,logger:r}}}catch{}},[C]);Z(()=>(b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{$({fireLoad:!1})},200),()=>{b.current&&clearTimeout(b.current),T.current&&(T.current.instance.destroy?.(T.current.destroyContext),T.current=null)}),[p,n,r,$]),Z(()=>{const e=y.current?.contentDocument;if(!e?.body)return;const n=Array.from(h).map(e=>`highlight-${e}`).join(" ");e.body.className=`elb-highlight ${n}`.trim()},[h]);const E=ne(()=>{b.current&&clearTimeout(b.current),$({fireLoad:!0})},[$]),P=!a||"preview"===f,R=te(()=>[{label:"Preview",value:"preview"},{label:"HTML",value:"html"},{label:"CSS",value:"css"},{label:"JS",value:"js"}],[]),_=Jn("button",{type:"button",className:"elb-explorer-btn",onClick:E,title:"Reload preview","aria-label":"Reload preview",children:Kn("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Jn("polyline",{points:"23 4 23 10 17 10"}),Jn("polyline",{points:"1 20 1 14 7 14"}),Jn("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})}),O=Jn(be,{buttons:R.map(e=>({label:e.label,value:e.value,active:f===e.value})),onButtonClick:g,variant:"tabs"});return Kn(ue,{header:o,headerActions:a?Kn(qn,{children:[O,P?_:null]}):_,footer:P?Jn(ge,{highlights:h,onToggle:e=>{m(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t})}}):null,children:[Jn("div",{className:"elb-preview-content",style:P?void 0:{display:"none"},children:Jn("iframe",{ref:y,className:"elb-preview-iframe",title:"HTML Preview"})}),a&&"html"===f?Jn(Un,{code:p,language:"html",onChange:i,disabled:!i,lineNumbers:d,wordWrap:u}):null,a&&"css"===f?Jn(Un,{code:n,language:"css",onChange:l,disabled:!l,lineNumbers:d,wordWrap:u}):null,a&&"js"===f?Jn(Un,{code:t,language:"javascript",onChange:c,disabled:!c,lineNumbers:d,wordWrap:u}):null]})}import{useState as Qn,useMemo as Zn}from"react";import{jsx as et}from"react/jsx-runtime";function nt({html:e,css:n,js:t,onHtmlChange:r,onCssChange:o,onJsChange:a,showPreview:s=!0,label:i="Code",className:l="",initialTab:c,lineNumbers:d=!1,wordWrap:u=!1}){const p=Zn(()=>{const r=[];return s&&void 0!==e&&r.push({label:"Preview",value:"preview"}),void 0!==e&&r.push({label:"HTML",value:"html"}),void 0!==n&&r.push({label:"CSS",value:"css"}),void 0!==t&&r.push({label:"JS",value:"js"}),r},[e,n,t,s]),[f,g]=Qn(()=>c&&p.some(e=>e.value===c)?c:p[0]?.value||"preview"),{content:h,language:m,onChange:y}=Zn(()=>{switch(f){case"html":return{content:e||"",language:"html",onChange:r};case"css":return{content:n||"",language:"css",onChange:o};case"js":return{content:t||"",language:"javascript",onChange:a};default:return{content:"",language:"text",onChange:void 0}}},[f,e,n,t,r,o,a]),b=Zn(()=>p.map(e=>({label:e.label,value:e.value,active:f===e.value})),[p,f]);return et(ue,{header:i,headerActions:p.length>1?et(be,{buttons:b,onButtonClick:g,variant:"tabs"}):null,className:l,children:"preview"===f?et(Yn,{html:e||"",css:n||""}):et(Un,{code:h,language:m,onChange:y,disabled:!y,lineNumbers:d,wordWrap:u})})}import tt,{useState as rt,useCallback as ot,useRef as at,useEffect as st,useMemo as it}from"react";import{useMonaco as lt}from"@monaco-editor/react";import{Fragment as ct,jsx as dt,jsxs as ut}from"react/jsx-runtime";function pt({code:e,language:n="javascript",onChange:t,disabled:r=!1,autoHeight:o,label:a,header:s,showHeader:i=!0,tabs:l,activeTab:c,onTabChange:d,defaultTab:u,showTrafficLights:p=!1,showCopy:f=!0,showFormat:g=!1,showSettings:h=!1,onValidationIssues:m,footer:y,height:b,style:v,className:w,...k}){const{onMount:x,...T}=k,[S,C]=(lt(),rt(!1)),[$,E]=rt(!1),[P,R]=rt({lineNumbers:k.lineNumbers??!1,minimap:k.minimap??!1,wordWrap:k.wordWrap??!1,sticky:k.sticky??!0}),_=at(null),[O,F]=rt({errors:0,warnings:0}),[I,j]=rt([]),[M,D]=rt(null),N=at(null),A=at(null);st(()=>{if(!$&&!M)return;const e=e=>{$&&_.current&&!_.current.contains(e.target)&&E(!1),M&&N.current&&!N.current.contains(e.target)&&D(null)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[$,M]);const[L,V]=rt(c??u??l?.[0]?.id??""),W=c??L,B=ot(e=>{V(e),d?.(e)},[d]),z=l?.find(e=>e.id===W),G=z?.code??e??"",H=z?.language??n,U=s??a??"Code",q=ot(e=>{A.current=e,x?.(e)},[x]),J=ot(e=>{F({errors:e.errors,warnings:e.warnings}),j(e.markers),m?.({errors:e.errors,warnings:e.warnings})},[m]),K=ot((e,n)=>{const t=A.current;t&&(t.revealLineInCenter(e),t.setPosition({lineNumber:e,column:n}),t.focus(),D(null))},[]),X=it(()=>({lineNumbers:P.lineNumbers,minimap:P.minimap,wordWrap:P.wordWrap,sticky:P.sticky}),[P.lineNumbers,P.minimap,P.wordWrap,P.sticky]),Y=ut("div",{style:{display:"flex",gap:"4px",alignItems:"center"},children:[dt(ft,{markerCounts:O,markerDetails:I,openMarkerMenu:M,setOpenMarkerMenu:D,jumpToLine:K,markerMenuRef:N}),g&&!r&&"json"===H&&dt("button",{className:"elb-explorer-btn",onClick:()=>{if(t&&!r&&"json"===H)try{const e=JSON.parse(G),n=JSON.stringify(e,null,2);t(n)}catch(e){}},title:"Format JSON",children:ut("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[dt("line",{x1:"3",y1:"5",x2:"16",y2:"5"}),dt("line",{x1:"7",y1:"10",x2:"20",y2:"10"}),dt("line",{x1:"7",y1:"15",x2:"18",y2:"15"}),dt("line",{x1:"3",y1:"20",x2:"12",y2:"20"})]})}),f&&dt("button",{className:"elb-explorer-btn",onClick:async()=>{try{await navigator.clipboard.writeText(G),C(!0),setTimeout(()=>C(!1),2e3)}catch{}},title:S?"Copied!":"Copy to clipboard",children:S?dt("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:dt("polyline",{points:"20 6 9 17 4 12"})}):ut("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[dt("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),dt("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),h&&ut("div",{ref:_,style:{position:"relative"},children:[dt("button",{className:"elb-explorer-btn"+($?" active":""),onClick:()=>E(!$),title:"Editor settings",children:ut("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[dt("circle",{cx:"12",cy:"12",r:"3"}),dt("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}),$&&ut("div",{className:"elb-codebox-settings",children:[ut("label",{className:"elb-codebox-settings-option",children:[dt("input",{type:"checkbox",checked:P.lineNumbers,onChange:()=>R(e=>({...e,lineNumbers:!e.lineNumbers}))}),"Line numbers"]}),ut("label",{className:"elb-codebox-settings-option",children:[dt("input",{type:"checkbox",checked:P.minimap,onChange:()=>R(e=>({...e,minimap:!e.minimap}))}),"Minimap"]}),ut("label",{className:"elb-codebox-settings-option",children:[dt("input",{type:"checkbox",checked:P.wordWrap,onChange:()=>R(e=>({...e,wordWrap:!e.wordWrap}))}),"Word wrap"]}),ut("label",{className:"elb-codebox-settings-option",children:[dt("input",{type:"checkbox",checked:P.sticky,onChange:()=>R(e=>({...e,sticky:!e.sticky}))}),"Sticky scroll"]})]})]})]}),Q=`${o?"elb-box--auto-height":""} ${w||""}`.trim(),Z=it(()=>l?.map(e=>({id:e.id,label:e.label,content:dt(Un,{code:e.code,language:e.language??n,onChange:t,disabled:r,autoHeight:o,onMount:q,onMarkerCounts:J,...T,...X})})),[l,n,t,r,o,X,T,q,J]);return dt(ue,{header:U,headerActions:Y,showHeader:i,tabs:Z,defaultTab:u,activeTab:c,onTabChange:B,showTrafficLights:p,footer:y,height:b,style:v,className:Q,children:!l&&dt(Un,{code:e??"",language:n,onChange:t,disabled:r,autoHeight:o,onMount:q,onMarkerCounts:J,...T,...X})})}var ft=tt.memo(function({markerCounts:e,markerDetails:n,openMarkerMenu:t,setOpenMarkerMenu:r,jumpToLine:o,markerMenuRef:a}){return ut(ct,{children:[e.errors>0&&ut("div",{ref:"error"===t?a:void 0,style:{position:"relative"},children:[ut("button",{className:"elb-codebox-marker-badge elb-codebox-marker-badge--error",onClick:()=>r("error"===t?null:"error"),children:[ut("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[dt("circle",{cx:"12",cy:"12",r:"10"}),dt("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),dt("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),dt("span",{children:e.errors})]}),"error"===t&&dt(gt,{markers:n.filter(e=>"error"===e.severity),onJump:o})]}),e.warnings>0&&ut("div",{ref:"warning"===t?a:void 0,style:{position:"relative"},children:[ut("button",{className:"elb-codebox-marker-badge elb-codebox-marker-badge--warning",onClick:()=>r("warning"===t?null:"warning"),children:[ut("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[dt("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),dt("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),dt("circle",{cx:"12",cy:"17",r:".5"})]}),dt("span",{children:e.warnings})]}),"warning"===t&&dt(gt,{markers:n.filter(e=>"warning"===e.severity),onJump:o})]})]})});function gt({markers:e,onJump:n}){return dt("div",{className:"elb-codebox-marker-menu",children:e.sort((e,n)=>e.line-n.line||e.column-n.column).map((e,t)=>ut("button",{className:"elb-codebox-marker-menu-item",onClick:()=>n(e.line,e.column),children:[ut("span",{className:"elb-codebox-marker-menu-line",children:["Ln ",e.line]}),dt("span",{className:"elb-codebox-marker-menu-msg",children:e.message})]},t))})}function ht(){return{type:"gtag",config:{},push(e,n){const{data:t,env:r}=n,o=`gtag('event', '${e.name}', ${JSON.stringify(t,null,2)});`;r.elb(o)}}}function mt(){return{type:"fbq",config:{},push(e,n){const{data:t,env:r}=n,o=`fbq('track', '${e.name}', ${JSON.stringify(t,null,2)});`;r.elb(o)}}}function yt(){return{type:"plausible",config:{},push(e,n){const{data:t,env:r}=n,o=`plausible('${e.name}', { props: ${JSON.stringify(t,null,2)} });`;r.elb(o)}}}import{jsx as bt,jsxs as vt}from"react/jsx-runtime";function wt({initialHtml:e='<div\n data-elb="product"\n data-elbaction="load:view"\n data-elbcontext="stage:inspire"\n class="product-card"\n>\n <figure class="product-figure">\n <div class="product-badge-container">\n <div data-elb-product="badge:delicious" class="product-badge">delicious</div>\n </div>\n </figure>\n <div class="product-body">\n <h3 data-elb-product="name:#innerText" class="product-title">\n Everyday Ruck Snack\n </h3>\n <div class="form-control">\n <label class="form-label">Taste</label>\n <select\n data-elb-product="taste:#value"\n class="form-select"\n >\n <option value="sweet">Sweet</option>\n <option value="spicy">Spicy</option>\n </select>\n </div>\n <p data-elb-product="price:2.50" class="product-price">\n € 2.50 <span data-elb-product="old_price:3.14" class="product-old-price">€ 3.14</span>\n </p>\n <div data-elbcontext="stage:hooked" class="product-actions">\n <button\n data-elbaction="click:save"\n class="btn btn-secondary"\n >\n Maybe later\n </button>\n <button\n data-elbaction="click:add"\n class="btn btn-primary"\n >\n Add to Cart\n </button>\n </div>\n </div>\n</div>\n<span data-elbglobals="language:en"></span>',initialCss:n="* {\n box-sizing: border-box;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n}\n\n.product-card {\n width: 100%;\n max-width: 400px;\n margin: 0 auto;\n background: #ffffff;\n border-radius: 16px;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n overflow: hidden;\n}\n\n.product-figure {\n position: relative;\n margin: 0;\n padding: 0;\n width: 100%;\n height: 160px;\n background:\n linear-gradient(135deg, rgba(243, 244, 246, 0.9) 0%, rgba(229, 231, 235, 0.9) 100%),\n repeating-linear-gradient(\n 45deg,\n #f9fafb,\n #f9fafb 10px,\n #f3f4f6 10px,\n #f3f4f6 20px\n );\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.product-figure::before {\n content: '🍟';\n font-size: 8rem;\n opacity: 0.8;\n}\n\n.product-badge-container {\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n}\n\n.product-badge {\n background: #01b5e2;\n color: white;\n padding: 0.25rem 0.75rem;\n border-radius: 9999px;\n font-size: 0.75rem;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.025em;\n}\n\n.product-body {\n padding: 1.5rem;\n}\n\n.product-title {\n font-size: 1.125rem;\n font-weight: 700;\n margin: 0 0 1rem 0;\n color: #111827;\n}\n\n.form-control {\n margin-bottom: 1rem;\n}\n\n.form-label {\n display: block;\n font-size: 0.875rem;\n font-weight: 500;\n color: #6b7280;\n margin-bottom: 0.5rem;\n}\n\n.form-select {\n width: 100%;\n padding: 0.5rem 0.75rem;\n border: 1px solid #d1d5db;\n border-radius: 8px;\n font-size: 0.875rem;\n color: #111827;\n background: white;\n cursor: pointer;\n transition: border-color 0.2s;\n}\n\n.form-select:hover {\n border-color: #9ca3af;\n}\n\n.form-select:focus {\n outline: none;\n border-color: #01b5e2;\n box-shadow: 0 0 0 3px rgba(1, 181, 226, 0.1);\n}\n\n.product-price {\n font-size: 1.25rem;\n font-weight: 700;\n color: #111827;\n margin: 0 0 1rem 0;\n}\n\n.product-old-price {\n font-size: 1rem;\n font-weight: 400;\n color: #9ca3af;\n text-decoration: line-through;\n margin-left: 0.5rem;\n}\n\n.product-actions {\n display: flex;\n justify-content: space-between;\n gap: 0.5rem;\n}\n\n.btn {\n flex: 1;\n padding: 0.75rem 1rem;\n border: none;\n border-radius: 8px;\n font-size: 0.875rem;\n font-weight: 600;\n cursor: pointer;\n transition: all 0.2s;\n text-align: center;\n}\n\n.btn:hover {\n transform: translateY(-1px);\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);\n}\n\n.btn:active {\n transform: translateY(0);\n}\n\n.btn-primary {\n background: #01b5e2;\n color: white;\n}\n\n.btn-primary:hover {\n background: #0195b8;\n}\n\n.btn-secondary {\n background: #ffffff;\n color: #01b5e2;\n border: 1px solid #01b5e2;\n}\n\n.btn-secondary:hover {\n background: #01b5e2;\n color: #ffffff;\n}",initialJs:t="",initialMapping:r='{\n "product": {\n "view": {\n "name": "view_item",\n "data": {\n "map": {\n "currency": { "value": "EUR" },\n "value": "data.price",\n "items": {\n "set": [\n {\n "map": {\n "item_name": "data.name",\n "item_variant": "data.taste",\n "price": "data.price",\n "quantity": { "value": 1 }\n }\n }\n ]\n }\n }\n }\n },\n "add": {\n "name": "add_to_cart",\n "data": {\n "map": {\n "currency": { "value": "EUR" },\n "value": "data.price",\n "items": {\n "set": [\n {\n "map": {\n "item_name": "data.name",\n "item_variant": "data.taste",\n "price": "data.price",\n "quantity": { "value": 1 }\n }\n }\n ]\n }\n }\n }\n },\n "save": {\n "name": "add_to_wishlist",\n "data": {\n "map": {\n "currency": { "value": "EUR" },\n "value": "data.price",\n "items": {\n "set": [\n {\n "map": {\n "item_name": "data.name",\n "item_variant": "data.taste",\n "price": "data.price",\n "quantity": { "value": 1 }\n }\n }\n ]\n }\n }\n }\n }\n }\n}',labelCode:o="Code",labelPreview:a="Preview",labelEvents:s="Events",labelMapping:i="Mapping",labelResult:l="Result",destination:c}){const d=N(()=>c??ht(),[c]),[u,p]=I(e),[f,g]=I(n),[h,m]=I(t),[y,b]=I(r),[v,w]=I("// Click elements in the preview to see events"),[k,x]=I("// Click elements in the preview to see function call"),T=M(null),S=M(null),C=M(null),[$,E]=I(!1);j(()=>{let e=!0;return(async()=>{try{const n=JSON.parse(r),{collector:t,elb:o}=await A({destinations:{rawCapture:{code:{type:"rawCapture",config:{},push:async n=>{e&&(C.current=n,w(JSON.stringify(n,null,2)))}}},gtag:{code:d,config:{mapping:n},env:{elb:n=>{e&&x(n)}}}},consent:{functional:!0,marketing:!0},user:{session:"playground"}});if(!e)return;T.current=t,S.current=o,E(!0)}catch{}})(),()=>{e=!1,T.current}},[r,d]);const P=D(e=>{b(e);const n=setTimeout(()=>{try{const n=JSON.parse(e);T.current?.destinations?.gtag?.config&&(T.current.destinations.gtag.config.mapping=n),C.current&&T.current&&T.current.push(C.current)}catch{}},500);return()=>clearTimeout(n)},[]);return vt(Y,{columns:5,rowHeight:600,children:[bt(nt,{label:o,html:u,css:f,js:h,onHtmlChange:p,onCssChange:g,onJsChange:m,showPreview:!1,initialTab:"html",lineNumbers:!1,wordWrap:!0}),bt(Yn,{label:a,html:u,css:f,elb:$?S.current??void 0:void 0}),bt(pt,{label:s,code:v,onChange:w,language:"json",wordWrap:!0}),bt(pt,{label:i,code:y,onChange:P,language:"json",wordWrap:!0,folding:!0,sticky:!0}),bt(pt,{label:l,code:k,language:"javascript",disabled:!0,wordWrap:!0})]})}import{useState as kt,useEffect as xt,useCallback as Tt}from"react";import{debounce as St,isString as Ct,tryCatchAsync as $t}from"@walkeros/core";import*as Et from"prettier/standalone";import Pt from"prettier/plugins/babel";import Rt from"prettier/plugins/estree";import _t from"prettier/plugins/typescript";import Ot from"prettier/plugins/html";async function Ft(e,n){try{let t;switch(n){case"javascript":case"js":{const n=e.trimStart().startsWith("{")&&e.includes("\n"),r=n?`(${e})`:e;t=await Et.format(r,{parser:"babel",plugins:[Pt,Rt],semi:!0,singleQuote:!0,trailingComma:"all"}),n&&(t=t.replace(/^\(/,"").replace(/\);?\s*$/,""));break}case"typescript":case"ts":case"tsx":t=await Et.format(e,{parser:"typescript",plugins:[_t,Rt],semi:!0,singleQuote:!0,trailingComma:"all"});break;case"json":const n=JSON.parse(e);t=JSON.stringify(n,null,2);break;case"html":t=await Et.format(e,{parser:"html",plugins:[Ot],htmlWhitespaceSensitivity:"css"});break;case"css":case"scss":t=await Et.format(e,{parser:"css",plugins:[Ot]});break;default:return e}return t.trim()}catch(n){return e}}import{jsx as It,jsxs as jt}from"react/jsx-runtime";function Mt(e,n={}){if(void 0===e)return"";const t=Ct(e)?e.trim():JSON.stringify(e,null,2);return n.quotes&&Ct(e)?`"${t}"`:t}function Dt({input:e,config:n,output:t="",options:r,fn:o,fnName:a,labelInput:s="Event",labelConfig:i="Config",labelOutput:l="Result",emptyText:c="No event yet.",disableInput:d=!1,disableConfig:u=!1,showQuotes:p=!0,className:f,language:g="json",format:h=!0,rowHeight:m,outputLanguage:y="json",configLanguage:b="json"}){const[v,w]=kt(Mt(e)),[k,x]=kt(Mt(n)),[T,S]=kt([Mt(t)]);xt(()=>{if(h&&e){Ft(Mt(e),g).then(w)}},[e,g,h]),xt(()=>{if(h&&n){Ft(Mt(n),g).then(x)}},[n,g,h]);const C=Tt((...e)=>{const n=e.map(e=>Mt(e,{quotes:p})).join(", ");S([a?`${a}(${n})`:n])},[a,p]),$=Tt(St(async(e,n,t)=>{o&&(S([]),await $t(o,e=>{S([`Error: ${String(e)}`])})(e,n,C,t))},500,!0),[o,C]);return xt(()=>{$(v,k,r||{})},[v,k,r,$]),jt(Y,{columns:3,className:f,rowHeight:m,children:[It(pt,{label:s,code:v,onChange:d?void 0:w,disabled:d,language:g,showFormat:!d&&"json"===g}),k&&It(pt,{label:i,code:k,onChange:u?void 0:x,disabled:u,language:b,showFormat:!u&&"json"===b}),It(pt,{label:l,code:T[0]||c,disabled:!0,language:y})]})}import{useState as Nt,useEffect as At}from"react";import{startFlow as Lt}from"@walkeros/collector";import{jsx as Vt}from"react/jsx-runtime";function Wt({event:e,mapping:n,destination:t,label:r="Result",wordWrap:o=!1}){const[a,s]=Nt("// Click elements in the preview to see function call");return At(()=>{(async()=>{try{const r=JSON.parse(e),o=JSON.parse(n),{collector:a}=await Lt({destinations:{demo:{code:t,config:{mapping:o},env:{elb:s}}}});await a.push(r)}catch(e){e instanceof Error?s(`// Error: ${e.message}`):s(`// Error: ${String(e)}`)}})()},[e,n,t]),Vt(pt,{code:a,language:"javascript",disabled:!0,label:r,wordWrap:o})}import{createElement as Bt,forwardRef as zt,useState as Gt,useEffect as Ht}from"react";var Ut=Object.freeze({left:0,top:0,width:16,height:16}),qt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Jt=Object.freeze({...Ut,...qt}),Kt=Object.freeze({...Jt,body:"",hidden:!1});function Xt(e,n){const t=function(e,n){const t={};!e.hFlip!=!n.hFlip&&(t.hFlip=!0),!e.vFlip!=!n.vFlip&&(t.vFlip=!0);const r=((e.rotate||0)+(n.rotate||0))%4;return r&&(t.rotate=r),t}(e,n);for(const r in Kt)r in qt?r in e&&!(r in t)&&(t[r]=qt[r]):r in n?t[r]=n[r]:r in e&&(t[r]=e[r]);return t}function Yt(e,n,t){const r=e.icons,o=e.aliases||Object.create(null);let a={};function s(e){a=Xt(r[e]||o[e],a)}return s(n),t.forEach(s),Xt(e,a)}function Qt(e,n){const t=[];if("object"!=typeof e||"object"!=typeof e.icons)return t;e.not_found instanceof Array&&e.not_found.forEach(e=>{n(e,null),t.push(e)});const r=function(e){const n=e.icons,t=e.aliases||Object.create(null),r=Object.create(null);return Object.keys(n).concat(Object.keys(t)).forEach(function e(o){if(n[o])return r[o]=[];if(!(o in r)){r[o]=null;const n=t[o]&&t[o].parent,a=n&&e(n);a&&(r[o]=[n].concat(a))}return r[o]}),r}(e);for(const o in r){const a=r[o];a&&(n(o,Yt(e,o,a)),t.push(o))}return t}var Zt={provider:"",aliases:{},not_found:{},...Ut};function er(e,n){for(const t in n)if(t in e&&typeof e[t]!=typeof n[t])return!1;return!0}function nr(e){if("object"!=typeof e||null===e)return null;const n=e;if("string"!=typeof n.prefix||!e.icons||"object"!=typeof e.icons)return null;if(!er(e,Zt))return null;const t=n.icons;for(const e in t){const n=t[e];if(!e||"string"!=typeof n.body||!er(n,Kt))return null}const r=n.aliases||Object.create(null);for(const e in r){const n=r[e],o=n.parent;if(!e||"string"!=typeof o||!t[o]&&!r[o]||!er(n,Kt))return null}return n}var tr=Object.create(null);function rr(e,n){const t=tr[e]||(tr[e]=Object.create(null));return t[n]||(t[n]=function(e,n){return{provider:e,prefix:n,icons:Object.create(null),missing:new Set}}(e,n))}function or(e,n){return nr(n)?Qt(n,(n,t)=>{t?e.icons[n]=t:e.missing.add(n)}):[]}var ar=/^[a-z0-9]+(-[a-z0-9]+)*$/,sr=(e,n,t,r="")=>{const o=e.split(":");if("@"===e.slice(0,1)){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const e=o.pop(),t=o.pop(),a={provider:o.length>0?o[0]:r,prefix:t,name:e};return n&&!ir(a)?null:a}const a=o[0],s=a.split("-");if(s.length>1){const e={provider:r,prefix:s.shift(),name:s.join("-")};return n&&!ir(e)?null:e}if(t&&""===r){const e={provider:r,prefix:"",name:a};return n&&!ir(e,t)?null:e}return null},ir=(e,n)=>!!e&&!(!(n&&""===e.prefix||e.prefix)||!e.name),lr=!1;function cr(e){return"boolean"==typeof e&&(lr=e),lr}function dr(e){const n="string"==typeof e?sr(e,!0,lr):e;if(n){const e=rr(n.provider,n.prefix),t=n.name;return e.icons[t]||(e.missing.has(t)?null:void 0)}}function ur(e,n){const t=sr(e,!0,lr);if(!t)return!1;const r=rr(t.provider,t.prefix);return n?function(e,n,t){try{if("string"==typeof t.body)return e.icons[n]={...t},!0}catch(e){}return!1}(r,t.name,n):(r.missing.add(t.name),!0)}var pr=Object.freeze({width:null,height:null}),fr=Object.freeze({...pr,...qt}),gr=/(-?[0-9.]*[0-9]+[0-9.]*)/g,hr=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function mr(e,n,t){if(1===n)return e;if(t=t||100,"number"==typeof e)return Math.ceil(e*n*t)/t;if("string"!=typeof e)return e;const r=e.split(gr);if(null===r||!r.length)return e;const o=[];let a=r.shift(),s=hr.test(a);for(;;){if(s){const e=parseFloat(a);isNaN(e)?o.push(a):o.push(Math.ceil(e*n*t)/t)}else o.push(a);if(a=r.shift(),void 0===a)return o.join("");s=!s}}var yr=/\sid="(\S+)"/g,br="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16),vr=0;function wr(e,n=br){const t=[];let r;for(;r=yr.exec(e);)t.push(r[1]);if(!t.length)return e;const o="suffix"+(16777216*Math.random()|Date.now()).toString(16);return t.forEach(t=>{const r="function"==typeof n?n(t):n+(vr++).toString(),a=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+r+o+"$3")}),e=e.replace(new RegExp(o,"g"),"")}var kr=Object.create(null);function xr(e){return kr[e]||kr[""]}function Tr(e){let n;if("string"==typeof e.resources)n=[e.resources];else if(n=e.resources,!(n instanceof Array&&n.length))return null;return{resources:n,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:!0===e.random,index:e.index||0,dataAfterTimeout:!1!==e.dataAfterTimeout}}for(var Sr=Object.create(null),Cr=["https://api.simplesvg.com","https://api.unisvg.com"],$r=[];Cr.length>0;)1===Cr.length||Math.random()>.5?$r.push(Cr.shift()):$r.push(Cr.pop());function Er(e,n){const t=Tr(n);return null!==t&&(Sr[e]=t,!0)}function Pr(e){return Sr[e]}Sr[""]=Tr({resources:["https://api.iconify.design"].concat($r)});var Rr=(()=>{let e;try{if(e=fetch,"function"==typeof e)return e}catch(e){}})();var _r={prepare:(e,n,t)=>{const r=[],o=function(e,n){const t=Pr(e);if(!t)return 0;let r;if(t.maxURL){let e=0;t.resources.forEach(n=>{const t=n;e=Math.max(e,t.length)});const o=n+".json?icons=";r=t.maxURL-e-t.path.length-o.length}else r=0;return r}(e,n),a="icons";let s={type:a,provider:e,prefix:n,icons:[]},i=0;return t.forEach((t,l)=>{i+=t.length+1,i>=o&&l>0&&(r.push(s),s={type:a,provider:e,prefix:n,icons:[]},i=t.length),s.icons.push(t)}),r.push(s),r},send:(e,n,t)=>{if(!Rr)return void t("abort",424);let r=function(e){if("string"==typeof e){const n=Pr(e);if(n)return n.path}return"/"}(n.provider);switch(n.type){case"icons":{const e=n.prefix,t=n.icons.join(",");r+=e+".json?"+new URLSearchParams({icons:t}).toString();break}case"custom":{const e=n.uri;r+="/"===e.slice(0,1)?e.slice(1):e;break}default:return void t("abort",400)}let o=503;Rr(e+r).then(e=>{const n=e.status;if(200===n)return o=501,e.json();setTimeout(()=>{t(function(e){return 404===e}(n)?"abort":"next",n)})}).then(e=>{"object"==typeof e&&null!==e?setTimeout(()=>{t("success",e)}):setTimeout(()=>{404===e?t("abort",e):t("next",o)})}).catch(()=>{t("next",o)})}};function Or(e,n){e.forEach(e=>{const t=e.loaderCallbacks;t&&(e.loaderCallbacks=t.filter(e=>e.id!==n))})}var Fr=0;var Ir={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function jr(e,n,t,r){const o=e.resources.length,a=e.random?Math.floor(Math.random()*o):e.index;let s;if(e.random){let n=e.resources.slice(0);for(s=[];n.length>1;){const e=Math.floor(Math.random()*n.length);s.push(n[e]),n=n.slice(0,e).concat(n.slice(e+1))}s=s.concat(n)}else s=e.resources.slice(a).concat(e.resources.slice(0,a));const i=Date.now();let l,c="pending",d=0,u=null,p=[],f=[];function g(){u&&(clearTimeout(u),u=null)}function h(){"pending"===c&&(c="aborted"),g(),p.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),p=[]}function m(e,n){n&&(f=[]),"function"==typeof e&&f.push(e)}function y(){c="failed",f.forEach(e=>{e(void 0,l)})}function b(){p.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),p=[]}function v(){if("pending"!==c)return;g();const r=s.shift();if(void 0===r)return p.length?void(u=setTimeout(()=>{g(),"pending"===c&&(b(),y())},e.timeout)):void y();const o={status:"pending",resource:r,callback:(n,t)=>{!function(n,t,r){const o="success"!==t;switch(p=p.filter(e=>e!==n),c){case"pending":break;case"failed":if(o||!e.dataAfterTimeout)return;break;default:return}if("abort"===t)return l=r,void y();if(o)return l=r,void(p.length||(s.length?v():y()));if(g(),b(),!e.random){const t=e.resources.indexOf(n.resource);-1!==t&&t!==e.index&&(e.index=t)}c="completed",f.forEach(e=>{e(r)})}(o,n,t)}};p.push(o),d++,u=setTimeout(v,e.rotate),t(r,n,o.callback)}return"function"==typeof r&&f.push(r),setTimeout(v),function(){return{startTime:i,payload:n,status:c,queriesSent:d,queriesPending:p.length,subscribe:m,abort:h}}}function Mr(e){const n={...Ir,...e};let t=[];function r(){t=t.filter(e=>"pending"===e().status)}return{query:function(e,o,a){const s=jr(n,e,o,(e,n)=>{r(),a&&a(e,n)});return t.push(s),s},find:function(e){return t.find(n=>e(n))||null},setIndex:e=>{n.index=e},getIndex:()=>n.index,cleanup:r}}function Dr(){}var Nr=Object.create(null);function Ar(e,n,t){let r,o;if("string"==typeof e){const n=xr(e);if(!n)return t(void 0,424),Dr;o=n.send;const a=function(e){if(!Nr[e]){const n=Pr(e);if(!n)return;const t={config:n,redundancy:Mr(n)};Nr[e]=t}return Nr[e]}(e);a&&(r=a.redundancy)}else{const n=Tr(e);if(n){r=Mr(n);const t=xr(e.resources?e.resources[0]:"");t&&(o=t.send)}}return r&&o?r.query(n,o,t)().abort:(t(void 0,424),Dr)}function Lr(){}function Vr(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,function(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const n=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!n.length)return;let t=!1;const r=e.provider,o=e.prefix;n.forEach(n=>{const a=n.icons,s=a.pending.length;a.pending=a.pending.filter(n=>{if(n.prefix!==o)return!0;const s=n.name;if(e.icons[s])a.loaded.push({provider:r,prefix:o,name:s});else{if(!e.missing.has(s))return t=!0,!0;a.missing.push({provider:r,prefix:o,name:s})}return!1}),a.pending.length!==s&&(t||Or([e],n.id),n.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),n.abort))})}))}(e)}))}function Wr(e,n,t){function r(){const t=e.pendingIcons;n.forEach(n=>{t&&t.delete(n),e.icons[n]||e.missing.add(n)})}if(t&&"object"==typeof t)try{if(!or(e,t).length)return void r()}catch(e){console.error(e)}r(),Vr(e)}function Br(e,n){e instanceof Promise?e.then(e=>{n(e)}).catch(()=>{n(null)}):n(e)}function zr(e,n){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(n).sort():e.iconsToLoad=n,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:t}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;const o=e.loadIcon;if(e.loadIcons&&(r.length>1||!o))return void Br(e.loadIcons(r,t,n),n=>{Wr(e,r,n)});if(o)return void r.forEach(r=>{Br(o(r,t,n),n=>{Wr(e,[r],n?{prefix:t,icons:{[r]:n}}:null)})});const{valid:a,invalid:s}=function(e){const n=[],t=[];return e.forEach(e=>{(e.match(ar)?n:t).push(e)}),{valid:n,invalid:t}}(r);if(s.length&&Wr(e,s,null),!a.length)return;const i=t.match(ar)?xr(n):null;if(!i)return void Wr(e,a,null);i.prepare(n,t,a).forEach(t=>{Ar(n,t,n=>{Wr(e,t.icons,n)})})}))}var Gr=(e,n)=>{const t=function(e){const n={loaded:[],missing:[],pending:[]},t=Object.create(null);e.sort((e,n)=>e.provider!==n.provider?e.provider.localeCompare(n.provider):e.prefix!==n.prefix?e.prefix.localeCompare(n.prefix):e.name.localeCompare(n.name));let r={provider:"",prefix:"",name:""};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;const o=e.provider,a=e.prefix,s=e.name,i=t[o]||(t[o]=Object.create(null)),l=i[a]||(i[a]=rr(o,a));let c;c=s in l.icons?n.loaded:""===a||l.missing.has(s)?n.missing:n.pending;const d={provider:o,prefix:a,name:s};c.push(d)}),n}(function(e,n=!0,t=!1){const r=[];return e.forEach(e=>{const o="string"==typeof e?sr(e,n,t):e;o&&r.push(o)}),r}(e,!0,cr()));if(!t.pending.length){let e=!0;return n&&setTimeout(()=>{e&&n(t.loaded,t.missing,t.pending,Lr)}),()=>{e=!1}}const r=Object.create(null),o=[];let a,s;return t.pending.forEach(e=>{const{provider:n,prefix:t}=e;if(t===s&&n===a)return;a=n,s=t,o.push(rr(n,t));const i=r[n]||(r[n]=Object.create(null));i[t]||(i[t]=[])}),t.pending.forEach(e=>{const{provider:n,prefix:t,name:o}=e,a=rr(n,t),s=a.pendingIcons||(a.pendingIcons=new Set);s.has(o)||(s.add(o),r[n][t].push(o))}),o.forEach(e=>{const n=r[e.provider][e.prefix];n.length&&zr(e,n)}),n?function(e,n,t){const r=Fr++,o=Or.bind(null,t,r);if(!n.pending.length)return o;const a={id:r,icons:n,callback:e,abort:o};return t.forEach(e=>{(e.loaderCallbacks||(e.loaderCallbacks=[])).push(a)}),o}(n,t,o):Lr};var Hr,Ur=/[\s,]+/;function qr(e,n){n.split(Ur).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}function Jr(e,n=0){const t=e.replace(/^-?[0-9.]*/,"");function r(e){for(;e<0;)e+=4;return e%4}if(""===t){const n=parseInt(e);return isNaN(n)?0:r(n)}if(t!==e){let n=0;switch(t){case"%":n=25;break;case"deg":n=90}if(n){let o=parseFloat(e.slice(0,e.length-t.length));return isNaN(o)?0:(o/=n,o%1==0?r(o):0)}}return n}function Kr(e){return void 0===Hr&&function(){try{Hr=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch(e){Hr=null}}(),Hr?Hr.createHTML(e):e}var Xr={...fr,inline:!1},Yr={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Qr={display:"inline-block"},Zr={backgroundColor:"currentColor"},eo={backgroundColor:"transparent"},no={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},to={WebkitMask:Zr,mask:Zr,background:eo};for(const e in to){const n=to[e];for(const t in no)n[e+t]=no[t]}var ro={...Xr,inline:!0};function oo(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}var ao,so=(e,n,t)=>{const r=n.inline?ro:Xr,o=function(e,n){const t={...e};for(const e in n){const r=n[e],o=typeof r;e in pr?(null===r||r&&("string"===o||"number"===o))&&(t[e]=r):o===typeof t[e]&&(t[e]="rotate"===e?r%4:r)}return t}(r,n),a=n.mode||"svg",s={},i=n.style||{},l={..."svg"===a?Yr:{}};if(t){const e=sr(t,!1,!0);if(e){const n=["iconify"],t=["provider","prefix"];for(const r of t)e[r]&&n.push("iconify--"+e[r]);l.className=n.join(" ")}}for(let e in n){const t=n[e];if(void 0!==t)switch(e){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":case"fallback":break;case"_ref":l.ref=t;break;case"className":l[e]=(l[e]?l[e]+" ":"")+t;break;case"inline":case"hFlip":case"vFlip":o[e]=!0===t||"true"===t||1===t;break;case"flip":"string"==typeof t&&qr(o,t);break;case"color":s.color=t;break;case"rotate":"string"==typeof t?o[e]=Jr(t):"number"==typeof t&&(o[e]=t);break;case"ariaHidden":case"aria-hidden":!0!==t&&"true"!==t&&delete l["aria-hidden"];break;default:void 0===r[e]&&(l[e]=t)}}const c=function(e,n){const t={...Jt,...e},r={...fr,...n},o={left:t.left,top:t.top,width:t.width,height:t.height};let a=t.body;[t,r].forEach(e=>{const n=[],t=e.hFlip,r=e.vFlip;let s,i=e.rotate;switch(t?r?i+=2:(n.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),n.push("scale(-1 1)"),o.top=o.left=0):r&&(n.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),n.push("scale(1 -1)"),o.top=o.left=0),i<0&&(i-=4*Math.floor(i/4)),i%=4,i){case 1:s=o.height/2+o.top,n.unshift("rotate(90 "+s.toString()+" "+s.toString()+")");break;case 2:n.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:s=o.width/2+o.left,n.unshift("rotate(-90 "+s.toString()+" "+s.toString()+")")}i%2==1&&(o.left!==o.top&&(s=o.left,o.left=o.top,o.top=s),o.width!==o.height&&(s=o.width,o.width=o.height,o.height=s)),n.length&&(a=function(e,n,t){const r=function(e,n="defs"){let t="";const r=e.indexOf("<"+n);for(;r>=0;){const o=e.indexOf(">",r),a=e.indexOf("</"+n);if(-1===o||-1===a)break;const s=e.indexOf(">",a);if(-1===s)break;t+=e.slice(o+1,a).trim(),e=e.slice(0,r).trim()+e.slice(s+1)}return{defs:t,content:e}}(e);return o=r.defs,a=n+r.content+t,o?"<defs>"+o+"</defs>"+a:a;var o,a}(a,'<g transform="'+n.join(" ")+'">',"</g>"))});const s=r.width,i=r.height,l=o.width,c=o.height;let d,u;null===s?(u=null===i?"1em":"auto"===i?c:i,d=mr(u,l/c)):(d="auto"===s?l:s,u=null===i?mr(d,c/l):"auto"===i?c:i);const p={},f=(e,n)=>{(e=>"unset"===e||"undefined"===e||"none"===e)(n)||(p[e]=n.toString())};f("width",d),f("height",u);const g=[o.left,o.top,l,c];return p.viewBox=g.join(" "),{attributes:p,viewBox:g,body:a}}(e,o),d=c.attributes;if(o.inline&&(s.verticalAlign="-0.125em"),"svg"===a){l.style={...s,...i},Object.assign(l,d);let e=0,t=n.id;return"string"==typeof t&&(t=t.replace(/-/g,"_")),l.dangerouslySetInnerHTML={__html:Kr(wr(c.body,t?()=>t+"ID"+e++:"iconifyReact"))},Bt("svg",l)}const{body:u,width:p,height:f}=e,g="mask"===a||"bg"!==a&&-1!==u.indexOf("currentColor"),h=function(e,n){let t=-1===e.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const e in n)t+=" "+e+'="'+n[e]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+t+">"+e+"</svg>"}(u,{...d,width:p+"",height:f+""});var m;return l.style={...s,"--svg":(m=h,'url("'+function(e){return"data:image/svg+xml,"+function(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(e)}(m)+'")'),width:oo(d.width),height:oo(d.height),...Qr,...g?Zr:eo,...i},Bt("span",l)};if(cr(!0),ao=_r,kr[""]=ao,"undefined"!=typeof document&&"undefined"!=typeof window){const e=window;if(void 0!==e.IconifyPreload){const n=e.IconifyPreload,t="Invalid IconifyPreload syntax.";"object"==typeof n&&null!==n&&(n instanceof Array?n:[n]).forEach(e=>{try{("object"!=typeof e||null===e||e instanceof Array||"object"!=typeof e.icons||"string"!=typeof e.prefix||!function(e,n){if("object"!=typeof e)return!1;if("string"!=typeof n&&(n=e.provider||""),lr&&!n&&!e.prefix){let n=!1;return nr(e)&&(e.prefix="",Qt(e,(e,t)=>{ur(e,t)&&(n=!0)})),n}const t=e.prefix;return!!ir({prefix:t,name:"a"})&&!!or(rr(n,t),e)}(e))&&console.error(t)}catch(e){console.error(t)}})}if(void 0!==e.IconifyProviders){const n=e.IconifyProviders;if("object"==typeof n&&null!==n)for(let e in n){const t="IconifyProviders["+e+"] is invalid.";try{const r=n[e];if("object"!=typeof r||!r||void 0===r.resources)continue;Er(e,r)||console.error(t)}catch(e){console.error(t)}}}}function io(e){const[n,t]=Gt(!!e.ssr),[r,o]=Gt({});const[a,s]=Gt(function(n){if(n){const n=e.icon;if("object"==typeof n)return{name:"",data:n};const t=dr(n);if(t)return{name:n,data:t}}return{name:""}}(!!e.ssr));function i(){const e=r.callback;e&&(e(),o({}))}function l(e){if(JSON.stringify(a)!==JSON.stringify(e))return i(),s(e),!0}function c(){var n;const t=e.icon;if("object"==typeof t)return void l({name:"",data:t});const r=dr(t);if(l({name:t,data:r}))if(void 0===r){const e=Gr([t],c);o({callback:e})}else r&&(null===(n=e.onLoad)||void 0===n||n.call(e,t))}Ht(()=>(t(!0),i),[]),Ht(()=>{n&&c()},[e.icon,n]);const{name:d,data:u}=a;return u?so({...Jt,...u},e,d):e.children?e.children:e.fallback?e.fallback:Bt("span",{})}var lo=zt((e,n)=>io({...e,_ref:n}));zt((e,n)=>io({inline:!0,...e,_ref:n}));function co(e){var n,t,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(t=co(e[n]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}var uo=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),po="-",fo=[],go=e=>{const n=yo(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return mo(e);const t=e.split(po),r=""===t[0]&&t.length>1?1:0;return ho(t,r,n)},getConflictingClassGroupIds:(e,n)=>{if(n){const n=r[e],o=t[e];return n?o?((e,n)=>{const t=new Array(e.length+n.length);for(let n=0;n<e.length;n++)t[n]=e[n];for(let r=0;r<n.length;r++)t[e.length+r]=n[r];return t})(o,n):n:o||fo}return t[e]||fo}}},ho=(e,n,t)=>{if(0===e.length-n)return t.classGroupId;const r=e[n],o=t.nextPart.get(r);if(o){const t=ho(e,n+1,o);if(t)return t}const a=t.validators;if(null===a)return;const s=0===n?e.join(po):e.slice(n).join(po),i=a.length;for(let e=0;e<i;e++){const n=a[e];if(n.validator(s))return n.classGroupId}},mo=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const n=e.slice(1,-1),t=n.indexOf(":"),r=n.slice(0,t);return r?"arbitrary.."+r:void 0})(),yo=e=>{const{theme:n,classGroups:t}=e;return bo(t,n)},bo=(e,n)=>{const t=uo();for(const r in e){const o=e[r];vo(o,t,r,n)}return t},vo=(e,n,t,r)=>{const o=e.length;for(let a=0;a<o;a++){const o=e[a];wo(o,n,t,r)}},wo=(e,n,t,r)=>{"string"!=typeof e?"function"!=typeof e?To(e,n,t,r):xo(e,n,t,r):ko(e,n,t)},ko=(e,n,t)=>{(""===e?n:So(n,e)).classGroupId=t},xo=(e,n,t,r)=>{Co(e)?vo(e(r),n,t,r):(null===n.validators&&(n.validators=[]),n.validators.push(((e,n)=>({classGroupId:e,validator:n}))(t,e)))},To=(e,n,t,r)=>{const o=Object.entries(e),a=o.length;for(let e=0;e<a;e++){const[a,s]=o[e];vo(s,So(n,a),t,r)}},So=(e,n)=>{let t=e;const r=n.split(po),o=r.length;for(let e=0;e<o;e++){const n=r[e];let o=t.nextPart.get(n);o||(o=uo(),t.nextPart.set(n,o)),t=o}return t},Co=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,$o=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,t=Object.create(null),r=Object.create(null);const o=(o,a)=>{t[o]=a,n++,n>e&&(n=0,r=t,t=Object.create(null))};return{get(e){let n=t[e];return void 0!==n?n:void 0!==(n=r[e])?(o(e,n),n):void 0},set(e,n){e in t?t[e]=n:o(e,n)}}},Eo=[],Po=(e,n,t,r,o)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:o}),Ro=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=e=>{const n=[];let t,r=0,o=0,a=0;const s=e.length;for(let i=0;i<s;i++){const s=e[i];if(0===r&&0===o){if(":"===s){n.push(e.slice(a,i)),a=i+1;continue}if("/"===s){t=i;continue}}"["===s?r++:"]"===s?r--:"("===s?o++:")"===s&&o--}const i=0===n.length?e:e.slice(a);let l=i,c=!1;i.endsWith("!")?(l=i.slice(0,-1),c=!0):i.startsWith("!")&&(l=i.slice(1),c=!0);return Po(n,c,l,t&&t>a?t-a:void 0)};if(n){const e=n+":",t=r;r=n=>n.startsWith(e)?t(n.slice(e.length)):Po(Eo,!1,n,void 0,!0)}if(t){const e=r;r=n=>t({className:n,parseClassName:e})}return r},_o=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((e,t)=>{n.set(e,1e6+t)}),e=>{const t=[];let r=[];for(let o=0;o<e.length;o++){const a=e[o],s="["===a[0],i=n.has(a);s||i?(r.length>0&&(r.sort(),t.push(...r),r=[]),t.push(a)):r.push(a)}return r.length>0&&(r.sort(),t.push(...r)),t}},Oo=e=>{const n=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let e=0;e<t.length;e++)n[t[e]]=!0;return n},Fo=/\s+/,Io=e=>{if("string"==typeof e)return e;let n,t="";for(let r=0;r<e.length;r++)e[r]&&(n=Io(e[r]))&&(t&&(t+=" "),t+=n);return t},jo=[],Mo=e=>{const n=n=>n[e]||jo;return n.isThemeGetter=!0,n},Do=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,No=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ao=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Lo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Vo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Wo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Bo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Go=e=>Ao.test(e),Ho=e=>!!e&&!Number.isNaN(Number(e)),Uo=e=>!!e&&Number.isInteger(Number(e)),qo=e=>e.endsWith("%")&&Ho(e.slice(0,-1)),Jo=e=>Lo.test(e),Ko=()=>!0,Xo=e=>Vo.test(e)&&!Wo.test(e),Yo=()=>!1,Qo=e=>Bo.test(e),Zo=e=>zo.test(e),ea=e=>!ra(e)&&!ua(e),na=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),ta=e=>va(e,Ta,Yo),ra=e=>Do.test(e),oa=e=>va(e,Sa,Xo),aa=e=>va(e,Ca,Ho),sa=e=>va(e,Ea,Ko),ia=e=>va(e,$a,Yo),la=e=>va(e,ka,Yo),ca=e=>va(e,xa,Zo),da=e=>va(e,Pa,Qo),ua=e=>No.test(e),pa=e=>wa(e,Sa),fa=e=>wa(e,$a),ga=e=>wa(e,ka),ha=e=>wa(e,Ta),ma=e=>wa(e,xa),ya=e=>wa(e,Pa,!0),ba=e=>wa(e,Ea,!0),va=(e,n,t)=>{const r=Do.exec(e);return!!r&&(r[1]?n(r[1]):t(r[2]))},wa=(e,n,t=!1)=>{const r=No.exec(e);return!!r&&(r[1]?n(r[1]):t)},ka=e=>"position"===e||"percentage"===e,xa=e=>"image"===e||"url"===e,Ta=e=>"length"===e||"size"===e||"bg-size"===e,Sa=e=>"length"===e,Ca=e=>"number"===e,$a=e=>"family-name"===e,Ea=e=>"number"===e||"weight"===e,Pa=e=>"shadow"===e,Ra=((e,...n)=>{let t,r,o,a;const s=e=>{const n=r(e);if(n)return n;const a=((e,n)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:a,postfixLookupClassGroupIds:s}=n,i=[],l=e.trim().split(Fo);let c="";for(let e=l.length-1;e>=0;e-=1){const n=l[e],{isExternal:d,modifiers:u,hasImportantModifier:p,baseClassName:f,maybePostfixModifierPosition:g}=t(n);if(d){c=n+(c.length>0?" "+c:c);continue}let h,m=!!g;if(m){h=r(f.substring(0,g));const e=h&&s[h]?r(f):void 0;e&&e!==h&&(h=e,m=!1)}else h=r(f);if(!h){if(!m){c=n+(c.length>0?" "+c:c);continue}if(h=r(f),!h){c=n+(c.length>0?" "+c:c);continue}m=!1}const y=0===u.length?"":1===u.length?u[0]:a(u).join(":"),b=p?y+"!":y,v=b+h;if(i.indexOf(v)>-1)continue;i.push(v);const w=o(h,m);for(let e=0;e<w.length;++e){const n=w[e];i.push(b+n)}c=n+(c.length>0?" "+c:c)}return c})(e,t);return o(e,a),a};return a=i=>{const l=n.reduce((e,n)=>n(e),e());return t=(e=>({cache:$o(e.cacheSize),parseClassName:Ro(e),sortModifiers:_o(e),postfixLookupClassGroupIds:Oo(e),...go(e)}))(l),r=t.cache.get,o=t.cache.set,a=s,s(i)},(...e)=>a(((...e)=>{let n,t,r=0,o="";for(;r<e.length;)(n=e[r++])&&(t=Io(n))&&(o&&(o+=" "),o+=t);return o})(...e))})(()=>{const e=Mo("color"),n=Mo("font"),t=Mo("text"),r=Mo("font-weight"),o=Mo("tracking"),a=Mo("leading"),s=Mo("breakpoint"),i=Mo("container"),l=Mo("spacing"),c=Mo("radius"),d=Mo("shadow"),u=Mo("inset-shadow"),p=Mo("text-shadow"),f=Mo("drop-shadow"),g=Mo("blur"),h=Mo("perspective"),m=Mo("aspect"),y=Mo("ease"),b=Mo("animate"),v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ua,ra],w=()=>[ua,ra,l],k=()=>[Go,"full","auto",...w()],x=()=>[Uo,"none","subgrid",ua,ra],T=()=>["auto",{span:["full",Uo,ua,ra]},Uo,ua,ra],S=()=>[Uo,"auto",ua,ra],C=()=>["auto","min","max","fr",ua,ra],$=()=>["auto",...w()],E=()=>[Go,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],P=()=>[Go,"screen","full","dvw","lvw","svw","min","max","fit",...w()],R=()=>[Go,"screen","full","lh","dvh","lvh","svh","min","max","fit",...w()],_=()=>[e,ua,ra],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ga,la,{position:[ua,ra]}],F=()=>["auto","cover","contain",ha,ta,{size:[ua,ra]}],I=()=>[qo,pa,oa],j=()=>["","none","full",c,ua,ra],M=()=>["",Ho,pa,oa],D=()=>[Ho,qo,ga,la],N=()=>["","none",g,ua,ra],A=()=>["none",Ho,ua,ra],L=()=>["none",Ho,ua,ra],V=()=>[Ho,ua,ra],W=()=>[Go,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jo],breakpoint:[Jo],color:[Ko],container:[Jo],"drop-shadow":[Jo],ease:["in","out","in-out"],font:[ea],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jo],shadow:[Jo],spacing:["px",Ho],text:[Jo],"text-shadow":[Jo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Go,ra,ua,m]}],container:["container"],"container-type":[{"@container":["","normal","size",ua,ra]}],"container-named":[na],columns:[{columns:[Ho,ra,ua,i]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:v()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{"inset-s":k(),start:k()}],end:[{"inset-e":k(),end:k()}],"inset-bs":[{"inset-bs":k()}],"inset-be":[{"inset-be":k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[Uo,"auto",ua,ra]}],basis:[{basis:[Go,"full","auto",i,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ho,Go,"auto","initial","none",ra]}],grow:[{grow:["",Ho,ua,ra]}],shrink:[{shrink:["",Ho,ua,ra]}],order:[{order:[Uo,"first","last","none",ua,ra]}],"grid-cols":[{"grid-cols":x()}],"col-start-end":[{col:T()}],"col-start":[{"col-start":S()}],"col-end":[{"col-end":S()}],"grid-rows":[{"grid-rows":x()}],"row-start-end":[{row:T()}],"row-start":[{"row-start":S()}],"row-end":[{"row-end":S()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mbs:[{mbs:$()}],mbe:[{mbe:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:E()}],"inline-size":[{inline:["auto",...P()]}],"min-inline-size":[{"min-inline":["auto",...P()]}],"max-inline-size":[{"max-inline":["none",...P()]}],"block-size":[{block:["auto",...R()]}],"min-block-size":[{"min-block":["auto",...R()]}],"max-block-size":[{"max-block":["none",...R()]}],w:[{w:[i,"screen",...E()]}],"min-w":[{"min-w":[i,"screen","none",...E()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[s]},...E()]}],h:[{h:["screen","lh",...E()]}],"min-h":[{"min-h":["screen","lh","none",...E()]}],"max-h":[{"max-h":["screen","lh",...E()]}],"font-size":[{text:["base",t,pa,oa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ba,sa]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qo,ra]}],"font-family":[{font:[fa,ia,n]}],"font-features":[{"font-features":[ra]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ua,ra]}],"line-clamp":[{"line-clamp":[Ho,"none",ua,aa]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":["none",ua,ra]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ua,ra]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Ho,"from-font","auto",ua,oa]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[Ho,"auto",ua,ra]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"tab-size":[{tab:[Uo,ua,ra]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ua,ra]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ua,ra]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Uo,ua,ra],radial:["",ua,ra],conic:[Uo,ua,ra]},ma,ca]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:j()}],"rounded-s":[{"rounded-s":j()}],"rounded-e":[{"rounded-e":j()}],"rounded-t":[{"rounded-t":j()}],"rounded-r":[{"rounded-r":j()}],"rounded-b":[{"rounded-b":j()}],"rounded-l":[{"rounded-l":j()}],"rounded-ss":[{"rounded-ss":j()}],"rounded-se":[{"rounded-se":j()}],"rounded-ee":[{"rounded-ee":j()}],"rounded-es":[{"rounded-es":j()}],"rounded-tl":[{"rounded-tl":j()}],"rounded-tr":[{"rounded-tr":j()}],"rounded-br":[{"rounded-br":j()}],"rounded-bl":[{"rounded-bl":j()}],"border-w":[{border:M()}],"border-w-x":[{"border-x":M()}],"border-w-y":[{"border-y":M()}],"border-w-s":[{"border-s":M()}],"border-w-e":[{"border-e":M()}],"border-w-bs":[{"border-bs":M()}],"border-w-be":[{"border-be":M()}],"border-w-t":[{"border-t":M()}],"border-w-r":[{"border-r":M()}],"border-w-b":[{"border-b":M()}],"border-w-l":[{"border-l":M()}],"divide-x":[{"divide-x":M()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":M()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-bs":[{"border-bs":_()}],"border-color-be":[{"border-be":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Ho,ua,ra]}],"outline-w":[{outline:["",Ho,pa,oa]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",d,ya,da]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",u,ya,da]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[Ho,oa]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":M()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",p,ya,da]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[Ho,ua,ra]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ho]}],"mask-image-linear-from-pos":[{"mask-linear-from":D()}],"mask-image-linear-to-pos":[{"mask-linear-to":D()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":D()}],"mask-image-t-to-pos":[{"mask-t-to":D()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":D()}],"mask-image-r-to-pos":[{"mask-r-to":D()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":D()}],"mask-image-b-to-pos":[{"mask-b-to":D()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":D()}],"mask-image-l-to-pos":[{"mask-l-to":D()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":D()}],"mask-image-x-to-pos":[{"mask-x-to":D()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":D()}],"mask-image-y-to-pos":[{"mask-y-to":D()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[ua,ra]}],"mask-image-radial-from-pos":[{"mask-radial-from":D()}],"mask-image-radial-to-pos":[{"mask-radial-to":D()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Ho]}],"mask-image-conic-from-pos":[{"mask-conic-from":D()}],"mask-image-conic-to-pos":[{"mask-conic-to":D()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ua,ra]}],filter:[{filter:["","none",ua,ra]}],blur:[{blur:N()}],brightness:[{brightness:[Ho,ua,ra]}],contrast:[{contrast:[Ho,ua,ra]}],"drop-shadow":[{"drop-shadow":["","none",f,ya,da]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",Ho,ua,ra]}],"hue-rotate":[{"hue-rotate":[Ho,ua,ra]}],invert:[{invert:["",Ho,ua,ra]}],saturate:[{saturate:[Ho,ua,ra]}],sepia:[{sepia:["",Ho,ua,ra]}],"backdrop-filter":[{"backdrop-filter":["","none",ua,ra]}],"backdrop-blur":[{"backdrop-blur":N()}],"backdrop-brightness":[{"backdrop-brightness":[Ho,ua,ra]}],"backdrop-contrast":[{"backdrop-contrast":[Ho,ua,ra]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ho,ua,ra]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ho,ua,ra]}],"backdrop-invert":[{"backdrop-invert":["",Ho,ua,ra]}],"backdrop-opacity":[{"backdrop-opacity":[Ho,ua,ra]}],"backdrop-saturate":[{"backdrop-saturate":[Ho,ua,ra]}],"backdrop-sepia":[{"backdrop-sepia":["",Ho,ua,ra]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ua,ra]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ho,"initial",ua,ra]}],ease:[{ease:["linear","initial",y,ua,ra]}],delay:[{delay:[Ho,ua,ra]}],animate:[{animate:["none",b,ua,ra]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,ua,ra]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:A()}],"rotate-x":[{"rotate-x":A()}],"rotate-y":[{"rotate-y":A()}],"rotate-z":[{"rotate-z":A()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:V()}],"skew-x":[{"skew-x":V()}],"skew-y":[{"skew-y":V()}],transform:[{transform:[ua,ra,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:W()}],"translate-x":[{"translate-x":W()}],"translate-y":[{"translate-y":W()}],"translate-z":[{"translate-z":W()}],"translate-none":["translate-none"],zoom:[{zoom:[Uo,ua,ra]}],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ua,ra]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":_()}],"scrollbar-track-color":[{"scrollbar-track":_()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ua,ra]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[Ho,pa,oa,aa]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function _a(...e){return Ra(function(){for(var e,n,t=0,r="",o=arguments.length;t<o;t++)(e=arguments[t])&&(n=co(e))&&(r&&(r+=" "),r+=n);return r}(e))}import{Fragment as Oa,jsx as Fa,jsxs as Ia}from"react/jsx-runtime";function ja({sources:e,center:n,centerTitle:t,destinations:r,arrowRight:o=Fa(lo,{icon:"mdi:arrow-right"}),arrowDown:a=Fa(lo,{icon:"mdi:arrow-down"}),className:s}){return Fa("div",{className:_a("elb-architecture-flow",s),children:Ia("div",{className:"elb-architecture-flow__grid",children:[Fa("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--desktop",children:e.title}),Fa("div",{className:"elb-architecture-flow__spacer"}),Fa("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--desktop",children:t}),Fa("div",{className:"elb-architecture-flow__spacer"}),Fa("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--desktop",children:r.title}),Ia("div",{className:"elb-architecture-flow__column",children:[Fa("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--mobile",children:e.title}),Fa("div",{className:"elb-architecture-flow__sections",children:e.sections.map(e=>Fa(Ma,{section:e},e.title))})]}),Fa("div",{className:"elb-architecture-flow__arrow elb-architecture-flow__arrow--desktop",children:o}),Fa("div",{className:"elb-architecture-flow__arrow elb-architecture-flow__arrow--mobile",children:a}),Ia("div",{className:"elb-architecture-flow__center",children:[Fa("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--mobile",children:t}),Fa("div",{className:"elb-architecture-flow__center-content",children:n})]}),Fa("div",{className:"elb-architecture-flow__arrow elb-architecture-flow__arrow--desktop",children:o}),Fa("div",{className:"elb-architecture-flow__arrow elb-architecture-flow__arrow--mobile",children:a}),Ia("div",{className:"elb-architecture-flow__column",children:[Fa("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--mobile",children:r.title}),Fa("div",{className:"elb-architecture-flow__sections",children:r.sections.map(e=>Fa(Ma,{section:e},e.title))})]})]})})}function Ma({section:e}){return Ia("div",{className:"elb-architecture-flow__section",children:[Fa("span",{className:"elb-architecture-flow__section-title",children:e.title}),Ia("div",{className:"elb-architecture-flow__items",children:[e.items.map(e=>{const n=Ia(Oa,{children:[Fa("span",{className:"elb-architecture-flow__item-icon",children:e.icon}),Fa("span",{className:"elb-architecture-flow__item-label",children:e.label})]});return e.link?Fa("a",{href:e.link,className:"elb-architecture-flow__item elb-architecture-flow__item--link",children:n},e.label):Fa("div",{className:"elb-architecture-flow__item",children:n},e.label)}),e.moreLink?Fa("a",{href:e.moreLink,className:"elb-architecture-flow__more elb-architecture-flow__more--link",children:"and more…"}):Fa("span",{className:"elb-architecture-flow__more",children:"and more…"})]})]})}import{useCallback as Da,useEffect as Na,useRef as Aa,useState as La}from"react";import{useCallback as Va,useEffect as Wa,useMemo as Ba,useRef as za,useState as Ga}from"react";import{DiffEditor as Ha}from"@monaco-editor/react";import{jsx as Ua}from"react/jsx-runtime";var qa={readOnly:!0,domReadOnly:!0,originalEditable:!1,renderIndicators:!0,renderMarginRevertIcon:!1,renderGutterMenu:!1,ignoreTrimWhitespace:!1,diffAlgorithm:"advanced",experimental:{showMoves:!0,useTrueInlineView:!0},hideUnchangedRegions:{enabled:!0,revealLineCount:20,minimumLineCount:3,contextLineCount:3},useInlineViewWhenSpaceIsLimited:!0,renderSideBySideInlineBreakpoint:720,fixedOverflowWidgets:!0,automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,lineNumbers:"on",lineNumbersMinChars:3,glyphMargin:!1,lineDecorationsWidth:8,fontSize:13,wordWrap:"off",diffWordWrap:"inherit",renderLineHighlight:"none",overviewRulerLanes:0,scrollbar:{vertical:"auto",horizontal:"auto",alwaysConsumeMouseWheel:!1}};function Ja({original:e,modified:n,language:t="json",height:r="100%",renderSideBySide:o=!0,onSummaryChange:a,beforeMount:s,onMount:i,className:l}){const c=za(null),d=za(null),u=za([]),p=za(a);p.current=a;const[f,g]=Ga($e);Wa(()=>{const e=()=>{const e=function(e){if("undefined"==typeof document)return null;if(e){const n=e.closest("[data-theme]");if(n)return n.getAttribute("data-theme")}return document.documentElement.getAttribute("data-theme")}(c.current),n="dark"===e||null===e&&window.matchMedia("(prefers-color-scheme: dark)").matches;g(n?Ce:$e)};e();const n=new MutationObserver(e);n.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});const t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>{n.disconnect(),t.removeEventListener("change",e)}},[]),Wa(()=>{d.current?.updateOptions({renderSideBySide:o})},[o]);const h=Va(e=>{Ge(e),s?.(e)},[s]),m=Va((e,n)=>{d.current=e,u.current.push(Je(e.getOriginalEditor())),u.current.push(Je(e.getModifiedEditor()));const t=e.onDidUpdateDiff(()=>{const n=e.getLineChanges()??[];let t=0,r=0,o=0;for(const e of n)0===e.originalEndLineNumber?t++:0===e.modifiedEndLineNumber?r++:o++;p.current?.({added:t,deleted:r,modified:o})});u.current.push(()=>t.dispose()),i?.(e)},[i]);Wa(()=>()=>{for(const e of u.current)try{e()}catch{}u.current=[]},[]);const y=Ba(()=>({...qa,renderSideBySide:o}),[o]);return Ua("div",{ref:c,className:l,style:{height:"100%",width:"100%"},children:Ua(Ha,{language:t,original:e,modified:n,theme:f,height:r,options:y,beforeMount:h,onMount:m})})}import{jsx as Ka,jsxs as Xa}from"react/jsx-runtime";var Ya={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};function Qa({summary:e}){return Xa("div",{className:"flex items-center gap-1.5 text-xs font-medium tabular-nums",children:[Xa("span",{className:"text-green-600 dark:text-green-400",children:["+",e.added]}),Xa("span",{className:"text-red-600 dark:text-red-400",children:["-",e.deleted]}),Xa("span",{className:"text-zinc-500 dark:text-zinc-400",children:["~",e.modified]})]})}function Za({view:e,onChange:n}){const t="px-2 py-0.5 text-xs font-medium rounded transition-colors cursor-pointer select-none",r="bg-zinc-200 text-zinc-900 dark:bg-zinc-700 dark:text-zinc-100",o="text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200";return Xa("div",{className:"flex rounded bg-zinc-100 p-0.5 dark:bg-zinc-800","aria-label":"Diff view mode",children:[Ka("button",{type:"button",className:`${t} ${"split"===e?r:o}`,"aria-pressed":"split"===e,onClick:()=>n("split"),children:"Split"}),Ka("button",{type:"button",className:`${t} ${"inline"===e?r:o}`,"aria-pressed":"inline"===e,onClick:()=>n("inline"),children:"Inline"})]})}function es({value:e}){const[n,t]=La("idle"),r=Aa(null);Na(()=>()=>{null!==r.current&&window.clearTimeout(r.current)},[]);const o="copied"===n?"Copied!":"failed"===n?"Copy failed":"Copy modified to clipboard";return Xa("button",{type:"button",className:"elb-explorer-btn",onClick:async()=>{try{await navigator.clipboard.writeText(e),t("copied")}catch{t("failed")}null!==r.current&&window.clearTimeout(r.current),r.current=window.setTimeout(()=>t("idle"),2e3)},title:o,"aria-label":"Copy modified content",children:[Ka("span",{className:"sr-only","aria-live":"polite",children:"idle"!==n?o:""}),"copied"===n?Ka("svg",{...Ya,children:Ka("polyline",{points:"20 6 9 17 4 12"})}):Xa("svg",{...Ya,children:[Ka("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),Ka("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})]})}function ns({original:e,modified:n,language:t="json",label:r,header:o,showHeader:a=!0,showTrafficLights:s=!1,showCopy:i=!0,showViewToggle:l=!0,showSummary:c=!1,defaultView:d="split",footer:u,height:p,style:f,className:g,onMount:h}){const[m,y]=La(d),[b,v]=La({added:0,deleted:0,modified:0}),w=Da(e=>v(e),[]);return Ka(ue,{header:o??r??"Diff",headerActions:Xa("div",{className:"flex items-center gap-2",children:[c&&Ka(Qa,{summary:b}),l&&Ka(Za,{view:m,onChange:y}),i&&Ka(es,{value:n})]}),showHeader:a,showTrafficLights:s,footer:u,height:p,style:f,className:g,children:Ka(Ja,{original:e,modified:n,language:t,renderSideBySide:"split"===m,onSummaryChange:w,onMount:h})})}import{useState as ts,useCallback as rs}from"react";import{createHighlighterCoreSync as os}from"shiki/core";import{createJavaScriptRegexEngine as as}from"shiki/engine/javascript";import ss from"shiki/langs/json.mjs";import is from"shiki/langs/javascript.mjs";import ls from"shiki/langs/typescript.mjs";import cs from"shiki/langs/tsx.mjs";import ds from"shiki/langs/bash.mjs";import us from"shiki/langs/html.mjs";import ps from"shiki/langs/css.mjs";function fs(e){if(e)return e.startsWith("#")?e:`#${e}`}function gs(e,n){const t=e.rules.map(e=>{const n={},t=fs(e.foreground);return t&&(n.foreground=t),e.fontStyle&&(n.fontStyle=e.fontStyle),{scope:e.token,settings:n}}),r=function(e){if(!e)return{};const n={};for(const[t,r]of Object.entries(e)){const e=fs(r);e&&(n[t]=e)}return n}(e.colors),o=!(a=r["editor.background"])||"#00000000"===a||/^#[0-9a-f]{6}00$/i.test(a)?n.defaultBackground??("dark"===n.type?"#292d3e":"#ffffff"):r["editor.background"];var a;const s=r["editor.foreground"]??n.defaultForeground??("dark"===n.type?"#bfc7d5":"#24292E"),i=[{settings:{foreground:s,background:o}},...t];return{name:n.name,type:n.type,bg:o,fg:s,colors:{...r,"editor.background":o,"editor.foreground":s},settings:i,tokenColors:t}}import{jsx as hs}from"react/jsx-runtime";var ms=["json","javascript","typescript","tsx","bash","html","css"],ys=gs(Be,{name:$e,type:"light",defaultBackground:"#ffffff",defaultForeground:"#24292E"}),bs=gs(Me,{name:Ce,type:"dark",defaultBackground:"#292d3e",defaultForeground:"#bfc7d5"}),vs=null;function ws(e){return e?ms.includes(e)?e:"text":"json"}function ks({code:e,language:n,className:t}){const r=(vs||(vs=os({themes:[ys,bs],langs:[ss,is,ls,cs,ds,us,ps],engine:as()})),vs).codeToHtml(e,{lang:ws(n),themes:{light:$e,dark:Ce},defaultColor:"light"});return hs("div",{className:"elb-code-static"+(t?` ${t}`:""),dangerouslySetInnerHTML:{__html:r}})}import{jsx as xs,jsxs as Ts}from"react/jsx-runtime";function Ss({code:e,language:n="javascript",tabs:t,activeTab:r,onTabChange:o,defaultTab:a,label:s,header:i,showHeader:l=!0,showTrafficLights:c=!1,showCopy:d=!0,footer:u,height:p,className:f,style:g}){const[h,m]=ts(!1),[y,b]=ts(r??a??t?.[0]?.id??""),v=r??y,w=rs(e=>{b(e),o?.(e)},[o]),k=t?.find(e=>e.id===v),x=k?.code??e??"",T=k?.language??n,S=i??s??"Code",C=d?xs("div",{style:{display:"flex",gap:"4px",alignItems:"center"},children:xs("button",{className:"elb-explorer-btn",onClick:async()=>{try{await navigator.clipboard.writeText(x),m(!0),setTimeout(()=>m(!1),2e3)}catch{}},title:h?"Copied!":"Copy to clipboard",children:h?xs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:xs("polyline",{points:"20 6 9 17 4 12"})}):Ts("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[xs("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),xs("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})}):void 0,$=t?.map(e=>({id:e.id,label:e.label,content:xs(ks,{code:e.code,language:e.language??n})}));return xs(ue,{header:S,headerActions:C,showHeader:l,tabs:$,defaultTab:a,activeTab:r,onTabChange:w,showTrafficLights:c,footer:u,height:p,style:g,className:f,children:!t&&xs(ks,{code:e??"",language:T})})}import{jsx as Cs}from"react/jsx-runtime";function $s({code:e,language:n="javascript",className:t}){const r=`elb-code-snippet ${t||""}`.trim();return Cs(Ss,{code:e,language:n,className:r,showHeader:!1,showCopy:!0})}import Es,{useEffect as Ps,useRef as Rs}from"react";import _s from"roughjs";import{Fragment as Os,jsx as Fs,jsxs as Is}from"react/jsx-runtime";function js({x:e,y:n,width:t,height:r,fill:o,stroke:a}){const s=Rs(null);return Ps(()=>{if(!s.current)return;const i=s.current.ownerSVGElement;if(!i)return;s.current.replaceChildren();const l=_s.svg(i),c=`M ${e+8} ${n}\n L ${e+t-8} ${n}\n Q ${e+t} ${n} ${e+t} ${n+8}\n L ${e+t} ${n+r-8}\n Q ${e+t} ${n+r} ${e+t-8} ${n+r}\n L ${e+8} ${n+r}\n Q ${e} ${n+r} ${e} ${n+r-8}\n L ${e} ${n+8}\n Q ${e} ${n} ${e+8} ${n}\n Z`,d=l.path(c,{fill:o,fillStyle:"solid",stroke:a,strokeWidth:1.5,roughness:1.2,bowing:1});return s.current.appendChild(d),()=>{s.current?.replaceChildren()}},[e,n,t,r,o,a]),Fs("g",{ref:s})}function Ms({cx:e,cy:n,diameter:t,fill:r,stroke:o}){const a=Rs(null);return Ps(()=>{if(!a.current)return;const s=a.current.ownerSVGElement;if(!s)return;a.current.replaceChildren();const i=_s.svg(s).circle(e,n,t,{fill:r,fillStyle:"solid",stroke:o,strokeWidth:1.5,roughness:.8});return a.current.appendChild(i),()=>{a.current?.replaceChildren()}},[e,n,t,r,o]),Fs("g",{ref:a})}function Ds({x:e,y:n,text:t}){return Is("g",{children:[Fs(Ms,{cx:e,cy:n,diameter:Gs,fill:"var(--flow-marker-fill, #dc2626)",stroke:"var(--flow-marker-stroke, #991b1b)"}),Fs("text",{x:e,y:n,textAnchor:"middle",dominantBaseline:"central",fill:"var(--flow-marker-text, #ffffff)",fontSize:10,fontWeight:600,fontFamily:"system-ui, -apple-system, sans-serif",children:t})]})}function Ns({fromX:e,fromY:n,toX:t,toY:r,stroke:o,arrowSize:a=8,centerY:s}){const i=Rs(null);return Ps(()=>{if(!i.current)return;const l=i.current.ownerSVGElement;if(!l)return;i.current.replaceChildren();const c=_s.svg(l),d=o,u=t-e,p=r-n,f=Math.sqrt(u*u+p*p),g=(e+t)/2,h=(n+r)/2;let m,y;if(Math.abs(p)<2)m=g,y=h-Math.min(.08*f,12);else if(void 0!==s){const t=Math.abs(n-s),o=Math.abs(r-s);m=e+.5*u,y=t>=o?n<s?h-.3*Math.abs(p):h+.3*Math.abs(p):r<s?h-.3*Math.abs(p):h+.3*Math.abs(p)}else m=e+.5*u,y=p>0?n-.3*Math.abs(p):n+.3*Math.abs(p);const b=t-m,v=r-y,w=Math.atan2(v,b),k=t-Math.cos(w)*a,x=r-Math.sin(w)*a,T=`M ${e} ${n} Q ${m} ${y} ${k} ${x}`,S=c.path(T,{stroke:d,strokeWidth:1.5,roughness:.8,fill:"none"});i.current.appendChild(S);const C=Math.PI/6,$=k-8*Math.cos(w-C),E=x-8*Math.sin(w-C),P=c.line(k,x,$,E,{stroke:d,strokeWidth:1.5,roughness:.5});i.current.appendChild(P);const R=k-8*Math.cos(w+C),_=x-8*Math.sin(w+C),O=c.line(k,x,R,_,{stroke:d,strokeWidth:1.5,roughness:.5});return i.current.appendChild(O),()=>{i.current?.replaceChildren()}},[e,n,t,r,o,a,s]),Fs("g",{ref:i})}var As={labelSize:13,labelWeight:"600",textSize:12,textWeight:"normal",boxHeight:50,descriptionSize:13},Ls=120,Vs=50;function Ws(e,n){if(!e||!n)return[];const t=[],r=new Set;let o=n;for(;o;){if(r.has(o))throw new Error(`FlowMap: Circular reference detected in transformer chain at "${o}"`);const n=e[o];if(!n)throw new Error(`FlowMap: Invalid transformer reference "${o}". Available transformers: ${Object.keys(e).join(", ")||"none"}`);r.add(o),t.push({name:o,config:n}),o=n.next}return t}function Bs(e,n){if(!e)return[];const t=new Set;for(const r of n){if(!r||!e[r])continue;Ws(e,r).forEach(e=>t.add(e.name))}if(0===t.size)return[];const r=new Set;for(const n of t){const o=e[n]?.next;o&&t.has(o)&&r.add(o)}let o;for(const e of t)if(!r.has(e)){o=e;break}return o||(o=[...t][0]),Ws(e,o)}function zs(e,n){if(!e)return n.length;const t=n.findIndex(n=>n.name===e);return t>=0?t:n.length}var Gs=16;function Hs({stageBefore:e,sources:n,preTransformers:t,collector:r,postTransformers:o,destinations:a,stageAfter:s,title:i,layout:l=As,boxHeight:c,descriptionHeight:d,markers:u,className:p,withReturn:f}){const g=Object.entries(n??{default:{}}),h=Object.entries(a??{default:{}}),m=g.map(([,e])=>e.next),y=Bs(t,m),b=h.map(([,e])=>e.before),v=Bs(o,b),w=[...g].sort(([,e],[,n])=>zs(e.next,y)-zs(n.next,y)),k=[...h].sort(([,e],[,n])=>zs(e.before,v)-zs(n.before,v)),x=Rs(null),T=e?.description||g.some(([,e])=>e.description)||y.some(e=>e.config.description)||r?.description||v.some(e=>e.config.description)||h.some(([,e])=>e.description)||s?.description||h.some(([,e])=>e.after?.description),S=!1!==e?.link||g.some(([,e])=>!1!==e.link)||y.some(e=>!1!==e.config.link)||!1!==r?.link||v.some(e=>!1!==e.config.link)||h.some(([,e])=>!1!==e.link)||!1!==s?.link||h.some(([,e])=>!1!==e.after?.link),C=["stage-before","stage-before-right","source","source-left","source-right","collector","collector-left","collector-right","destination","destination-left","destination-right","stage-after","stage-after-left"],$=u?.some(e=>{return n=e.position,!!C.includes(n)||/^(source|destination|pre|post)-[^-]+(-left|-right)?$/.test(n);var n})??!1?Gs/2+4:0,E=u?.filter(e=>e.text)??[],P=E.reduce((e,n)=>e+(n.text?.length??0),0),R=Math.max(1,Math.ceil(P/70)),_=E.length>0?18*R+8:0,O=c??l.boxHeight,F=d??30,I=T||S?F+10:0,j=Math.max(g.length,h.length,1),M=O*j+12*(j-1),D=s||h.some(([,e])=>e.after),N=function(e,n,t){return(n?0:25)+Ls*e+Vs*(e-1)+(t?0:25)}(1+(e?1:0)+y.length+1+v.length+1+(D?1:0),!!e,!!D),A=16+M+I+$+_,L=i?A+30:A,V=8+(i?30:0)+$,W=V+M/2,B=(e,n)=>W-(O*n+12*(n-1))/2+e*(O+12);let z=e?0:25;const G={},H=[],U=[];e&&(G.before={x:z,y:W-O/2,width:Ls,height:O},z+=170);const q=z;w.forEach(([e],n)=>{const t={x:q,y:B(n,w.length),width:Ls,height:O};H.push({name:e,pos:t}),G[`source-${e}`]=t}),H.length>0&&(G.source=H[0].pos),z+=170;const J=[],K=new Map;w.forEach(([e,n])=>{const t=n.next;if(t){const n=K.get(t)??[];n.push(e),K.set(t,n)}}),y.forEach(({name:e,config:n})=>{if(n.next){K.get(e);const t=K.get(n.next)??[];K.set(n.next,[...new Set([...t,`chain:${e}`])])}}),y.forEach(({name:e})=>{const n=K.get(e)??[],t=n.filter(e=>!e.startsWith("chain:")),r=n.some(e=>e.startsWith("chain:"));let o;if(1!==t.length||r)o=W-O/2;else{const e=G[`source-${t[0]}`];o=e?e.y:W-O/2}const a={x:z,y:o,width:Ls,height:O};J.push({name:e,pos:a}),G[`pre-${e}`]=a,z+=170}),G.collector={x:z,y:W-O/2,width:Ls,height:O},z+=170;const X=[],Y=new Map;k.forEach(([e,n])=>{const t=n.before;if(t){const n=Y.get(t)??[];n.push(e),Y.set(t,n)}});for(let e=v.length-1;e>=0;e--){const{name:n,config:t}=v[e];if(t.next){Y.get(t.next);const e=Y.get(n)??[];Y.set(n,[...new Set([...e,`chain:${t.next}`])])}}const Q=z+170*v.length;k.forEach(([e],n)=>{const t={x:Q,y:B(n,k.length),width:Ls,height:O};U.push({name:e,pos:t}),G[`destination-${e}`]=t}),U.length>0&&(G.destination=U[0].pos),v.forEach(({name:e})=>{const n=Y.get(e)??[],t=n.filter(e=>!e.startsWith("chain:")),r=n.some(e=>e.startsWith("chain:"));let o;if(1!==t.length||r)if(t.length>1&&!r){const e=t.map(e=>G[`destination-${e}`]?.y).filter(e=>void 0!==e);if(e.length>0){o=e.reduce((e,n)=>e+n,0)/e.length}else o=W-O/2}else o=W-O/2;else{const e=G[`destination-${t[0]}`];o=e?e.y:W-O/2}const a={x:z,y:o,width:Ls,height:O};X.push({name:e,pos:a}),G[`post-${e}`]=a,z+=170});const Z=[];if(D){const e=z+Ls+Vs;k.forEach(([n,t],r)=>{const o=t.after??s;if(o){const t={x:e,y:B(r,k.length),width:Ls,height:O};Z.push({name:n,pos:t,config:o}),G[`after-${n}`]=t}}),Z.length>0&&(G.after=Z[0].pos)}const ee=W,ne=[...e?[{key:"before",config:e,fillVar:"--flow-before-fill",strokeVar:"--flow-before-stroke",defaultLabel:"Before",defaultLink:void 0}]:[],...w.map(([e,n])=>({key:`source-${e}`,config:n,fillVar:"--flow-source-fill",strokeVar:"--flow-source-stroke",defaultLabel:"Source",defaultLink:"/docs/sources"})),...y.map(({name:e,config:n})=>({key:`pre-${e}`,config:n,fillVar:"--flow-transformer-fill",strokeVar:"--flow-transformer-stroke",defaultLabel:e.charAt(0).toUpperCase()+e.slice(1),defaultLink:"/docs/transformers"})),{key:"collector",config:r,fillVar:"--flow-collector-fill",strokeVar:"--flow-collector-stroke",defaultLabel:"Collector",defaultLink:"/docs/collectors"},...v.map(({name:e,config:n})=>({key:`post-${e}`,config:n,fillVar:"--flow-transformer-fill",strokeVar:"--flow-transformer-stroke",defaultLabel:e.charAt(0).toUpperCase()+e.slice(1),defaultLink:"/docs/transformers"})),...k.map(([e,n])=>({key:`destination-${e}`,config:n,fillVar:"--flow-destination-fill",strokeVar:"--flow-destination-stroke",defaultLabel:"Destination",defaultLink:"/docs/destinations"})),...Z.map(({name:e,config:n})=>({key:`after-${e}`,config:n,fillVar:"--flow-after-fill",strokeVar:"--flow-after-stroke",defaultLabel:"External",defaultLink:void 0}))];return Fs("div",{ref:x,className:`elb-explorer elb-flow-map ${p||""}`,style:{width:"100%",maxWidth:N},children:Is("svg",{viewBox:`0 0 ${N} ${L}`,style:{width:"100%",height:"auto",display:"block"},children:[i&&Fs("text",{x:N/2,y:18,textAnchor:"middle",dominantBaseline:"middle",fill:"var(--color-text, #f3f4f6)",fontSize:14,fontWeight:600,fontFamily:"system-ui, -apple-system, sans-serif",children:i}),(()=>{const r=G.collector,s=r.y+O/2;return Is(Os,{children:[!e&&1===g.length&&Fs(Ns,{fromX:0,fromY:ee,toX:G.source.x,toY:ee,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),e&&Fs(Ns,{fromX:G.before.x+Ls,fromY:ee,toX:G.source.x,toY:G.source.y+O/2,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),(()=>{const e=new Map;return H.forEach(({name:t,pos:r},o)=>{const a=n?.[t]??{},s=a.next?`pre-${a.next}`:y.length>0?`pre-${y[0].name}`:"collector",i=e.get(s)??[];i.push({name:t,pos:r,sortIndex:o}),e.set(s,i)}),H.map(({name:o,pos:a})=>{const s=n?.[o]??{},i=((e,n)=>n.next&&t?.[n.next]?G[`pre-${n.next}`]:y.length>0?G[`pre-${y[0].name}`]:r)(0,s),l=a.y+O/2,c=i.y+O/2,d=s.next?`pre-${s.next}`:y.length>0?`pre-${y[0].name}`:"collector",u=e.get(d)??[],p=((e,n,t)=>{if(n<=1)return t;const r=Math.min(.6*O,12*(n-1));return t-r/2+e*(r/(n-1))})(u.findIndex(e=>e.name===o),u.length,c),g=f?6:0;return Is(Es.Fragment,{children:[Fs(Ns,{fromX:a.x+Ls,fromY:l-g,toX:i.x,toY:p-g,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),f&&Fs(Ns,{fromX:i.x,fromY:p+g,toX:a.x+Ls,toY:l+g,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]},`source-${o}-arrows`)})})(),J.map(({name:e,pos:n},o)=>{const a=t?.[e]??{};let s;s=a.next&&t?.[a.next]?G[`pre-${a.next}`]:r;const i=n.y+O/2,l=s.y+O/2,c=f?6:0;return Is(Es.Fragment,{children:[Fs(Ns,{fromX:n.x+Ls,fromY:i-c,toX:s.x,toY:l-c,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),f&&Fs(Ns,{fromX:s.x,fromY:l+c,toX:n.x+Ls,toY:i+c,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]},`pre-${e}-chain`)}),U.map(({name:e,pos:n})=>{const t=((e,n)=>n.before&&o?.[n.before]?G[`post-${n.before}`]:r)(0,a?.[e]??{}),s=n.y+O/2,i=t.y+O/2,l=f?6:0;return Is(Es.Fragment,{children:[Fs(Ns,{fromX:t.x+Ls,fromY:i-l,toX:n.x,toY:s-l,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),f&&Fs(Ns,{fromX:n.x,fromY:s+l,toX:t.x+Ls,toY:i+l,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]},`destination-${e}-arrows`)}),X.slice(0,-1).map(({name:e,pos:n},t)=>{const r=X[t+1];if(!r)return null;const o=r.pos,a=n.y+O/2,s=o.y+O/2,i=f?6:0;return Is(Es.Fragment,{children:[Fs(Ns,{fromX:n.x+Ls,fromY:a-i,toX:o.x,toY:s-i,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),f&&Fs(Ns,{fromX:o.x,fromY:s+i,toX:n.x+Ls,toY:a+i,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]},`post-${e}-chain`)}),v.length>0&&(()=>{const e=G[`post-${v[0].name}`],n=s,t=e.y+O/2,o=f?6:0;return Is(Os,{children:[Fs(Ns,{fromX:r.x+Ls,fromY:n-o,toX:e.x,toY:t-o,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),f&&Fs(Ns,{fromX:e.x,fromY:t+o,toX:r.x+Ls,toY:n+o,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]})})(),Z.map(({name:e,pos:n})=>{const t=G[`destination-${e}`];if(!t)return null;const r=t.y+O/2,o=n.y+O/2;return Fs(Ns,{fromX:t.x+Ls,fromY:r,toX:n.x,toY:o,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee},`dest-${e}-after`)}),!D&&1===h.length&&Fs(Ns,{fromX:G.destination.x+Ls,fromY:ee,toX:N,toY:ee,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]})})(),ne.map(({key:e,config:n,fillVar:t,strokeVar:r,defaultLabel:o,defaultLink:a})=>{const s=G[e],i=n?.icon,c=n?.label||o,d=n?.text,u=n?.description,p=n?.link,f=!1!==n?.highlight,g=d?s.y+.28*s.height:s.y+s.height/2,h=!1===p?null:"string"==typeof p?p:a,m=Is(Os,{children:[Fs(js,{x:s.x,y:s.y,width:s.width,height:s.height,fill:`var(${t}, #6b7280)`,stroke:f?`var(${r}, #6b7280)`:"var(--flow-edge-stroke, #9ca3af)"}),Fs("foreignObject",{x:s.x+4,y:g-l.labelSize/2-2,width:s.width-8,height:l.labelSize+4,children:Is("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",height:"100%",fontSize:l.labelSize,fontWeight:l.labelWeight,fontFamily:"system-ui, -apple-system, sans-serif",color:"var(--color-text)"},children:[i&&Fs(lo,{icon:i,width:14,height:14}),Fs("span",{children:c})]})}),d&&Fs("foreignObject",{x:s.x+4,y:s.y+.34*s.height,width:s.width-8,height:.62*s.height,children:Fs("div",{style:{fontSize:l.textSize,fontWeight:l.textWeight,color:"var(--color-text)",textAlign:"center",fontFamily:"system-ui, -apple-system, sans-serif",lineHeight:1.3,height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:d})}),u&&Fs("foreignObject",{x:s.x,y:s.y+s.height+8,width:Ls,height:F,children:Fs("div",{style:{fontSize:l.descriptionSize,color:"var(--color-text-muted)",textAlign:"center",fontFamily:"system-ui, -apple-system, sans-serif",lineHeight:1.3},children:u})})]});return h?Fs("a",{href:h,style:{cursor:"pointer",textDecoration:"none"},children:m},e):Fs("g",{children:m},e)}),u?.map((e,n)=>{const t=function(e,n,t,r){const o=n.source,a=n.collector,s=n.destination,i=n.before,l=n.after,c=(e,n)=>e?"-left"===n?{x:e.x+4,y:e.y-4}:{x:e.x+e.width-4,y:e.y-4}:null,d=e=>{if(!e)return null;const n=e.y+e.height/2;return{x:e.x+e.width+25-6,y:n+Gs/2+4}};switch(e){case"stage-before":case"stage-before-right":return c(i);case"source":case"source-right":return c(o);case"source-left":return c(o,"-left");case"collector":case"collector-right":return c(a);case"collector-left":return c(a,"-left");case"destination":case"destination-right":return c(s);case"destination-left":return c(s,"-left");case"stage-after":case"stage-after-left":return c(l,"-left");case"incoming":return{x:12.5,y:t+Gs/2+8};case"outgoing":return{x:r-12.5,y:t+Gs/2+8};case"before-source":return d(i);case"source-collector":return d(o);case"collector-destination":case"collector-post":return d(a);case"destination-after":return d(s);case"pre-collector":const u=Object.keys(n).filter(e=>e.startsWith("pre-"));return 0===u.length?null:d(n[u[u.length-1]]);default:{const t=e.match(/^source-([^-]+)(-left|-right)?$/);if(t){const e=t[1],r=t[2];return c(n[`source-${e}`],r)}const r=e.match(/^destination-([^-]+)(-left|-right)?$/);if(r){const e=r[1],t=r[2];return c(n[`destination-${e}`],t)}const o=e.match(/^pre-([^-]+)(-left|-right)?$/);if(o){const e=o[1],t=o[2];return"collector"===e?null:c(n[`pre-${e}`],t)}const s=e.match(/^post-([^-]+)(-left|-right)?$/);if(s){const e=s[1],t=s[2];return c(n[`post-${e}`],t)}const i=e.match(/^source-([^-]+)-pre$/);if(i)return d(n[`source-${i[1]}`]);const l=e.match(/^source-([^-]+)-collector$/);if(l)return d(n[`source-${l[1]}`]);const u=e.match(/^pre-([^-]+)-next$/);if(u)return d(n[`pre-${u[1]}`]);const p=e.match(/^post-([^-]+)-next$/);if(p)return d(n[`post-${p[1]}`]);const f=e.match(/^post-destination-([^-]+)$/);if(f){f[1];const e=Object.keys(n).filter(e=>e.startsWith("post-"));return 0===e.length?d(a):d(n[e[e.length-1]])}return null}}}(e.position,G,ee,N);if(!t)return null;const r=e.id??String(n+1);return Fs(Ds,{x:t.x,y:t.y,text:r},`marker-${n}`)}),E.length>0&&Fs("foreignObject",{x:8,y:V+M+I+4,width:N-16,height:18*R,children:Fs("div",{style:{fontSize:11,fontFamily:"system-ui, -apple-system, sans-serif",color:"var(--color-text-muted)",lineHeight:1.6},children:E.map((e,n)=>{const t=e.id??String((u?.indexOf(e)??n)+1);return Is("span",{children:[Fs("span",{style:{width:12,height:12,borderRadius:"50%",background:"var(--flow-marker-fill, #dc2626)",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:8,fontWeight:600,color:"var(--flow-marker-text, #ffffff)",verticalAlign:"middle",marginRight:4,position:"relative",top:-1},children:t}),Fs("span",{style:{marginRight:10},children:e.text})]},`legend-${n}`)})})})]})})}import{useState as Us}from"react";import{jsx as qs,jsxs as Js}from"react/jsx-runtime";var Ks={"Mapping.Value":"/docs/mapping/value","Mapping.Rule":"/docs/mapping/rule","WalkerOS.Consent":"/docs/guides/consent"};function Xs(e,n){if(!e.startsWith("#/"))return;const t=e.slice(2).split("/");let r=n;for(const e of t){if(!r||"object"!=typeof r||!(e in r))return;r=r[e]}return r}function Ys(e,n){const t=e=>{const t=Xs(e,n),r=(o=t,a=function(e){const n=e.lastIndexOf("/");return n>=0?e.slice(n+1):e}(e),o&&"string"==typeof o.title?o.title:a);var o,a;return{title:r,href:Ks[r]}};if("string"==typeof e.$ref){const n=t(e.$ref);return{type:n.title,typeRefs:[n]}}if(Array.isArray(e.allOf)){const n=e.allOf,r=n.map(e=>"string"==typeof e.$ref?e.$ref:void 0).filter(e=>!!e);if(1===r.length&&1===n.length){const e=t(r[0]);return{type:e.title,typeRefs:[e]}}}if(Array.isArray(e.anyOf)){const n=e.anyOf,r=[];let o,a;for(const e of n)"string"==typeof e.$ref?(a=e.$ref,r.push(a)):"array"===e.type&&e.items&&"string"==typeof e.items.$ref&&(o=e.items.$ref,r.push(o));if(2===n.length&&a&&o&&a===o){const e=t(a);return{type:`${e.title} | ${e.title}[]`,typeRefs:[e]}}if(r.length>0&&r.length===n.length){const e=r.map(t);return{type:e.map(e=>e.title).join(" | "),typeRefs:e}}}if("array"===e.type&&e.items&&"string"==typeof e.items.$ref){const n=t(e.items.$ref);return{type:`${n.title}[]`,typeRefs:[n]}}if("object"===e.type&&e.additionalProperties&&"string"==typeof e.additionalProperties.$ref){const n=t(e.additionalProperties.$ref);return{type:`Record<string, ${n.title}>`,typeRefs:[n]}}}function Qs(e){const n=e;let t=e;if(Array.isArray(t.allOf)&&1===t.allOf.length&&"string"==typeof t.allOf[0].$ref){const e=Xs(t.allOf[0].$ref,n);e&&(t=e)}const r=[];return Zs(t,n,0,"",r),r}function Zs(e,n,t,r,o){const a=e.required||[];if(e.properties)for(const[s,i]of Object.entries(e.properties)){const e=i,l=r?`${r}.${s}`:s,c=Ys(e,n);let d,u;if(c)d=c.type,u=c.typeRefs;else{if(d=e.type||"any",e.enum&&(d=e.enum.map(e=>`'${e}'`).join(" | ")),"array"===d&&e.items){const n=e.items;d=n.enum?`Array<${n.enum.map(e=>`'${e}'`).join(" | ")}>`:`Array<${n.type||"any"}>`}if("object"===d&&e.additionalProperties){d=`Record<string, ${e.additionalProperties.type||"any"}>`}if(e.anyOf||e.oneOf){d=(e.anyOf||e.oneOf).map(e=>e.type||"any").join(" | ")}}let p,f=e.description||"";const g=f.match(/\(like\s+(.+?)\)$/);g&&(p=g[1],f=f.replace(/\s*\(like\s+.+?\)$/,"")),"any"===d&&f.toLowerCase().includes("function")&&(d="function");const h=!c&&"object"===e.type&&e.properties&&"object"==typeof e.properties;h&&"string"==typeof e.title&&(d=e.title),o.push({name:l,type:d,typeRefs:u,description:f,required:a.includes(s),default:void 0!==e.default?String(e.default):void 0,example:p,depth:t}),h&&Zs(e,n,t+1,l,o)}}function ei({property:e,isOpen:n,onClose:t}){if(!n||!e)return null;return qs("div",{className:"elb-property-table__modal-backdrop",onClick:e=>{e.target===e.currentTarget&&t()},children:Js("div",{className:"elb-property-table__modal-content",children:[Js("div",{className:"elb-property-table__modal-header",children:[Js("h3",{className:"elb-property-table__modal-title",children:[qs("code",{className:"elb-property-table__modal-property-name",children:e.name}),e.required&&qs("span",{className:"elb-property-table__required-icon",children:"*"})]}),qs("button",{className:"elb-property-table__close-button",onClick:t,"aria-label":"Close",children:Js("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[qs("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),qs("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),Js("div",{className:"elb-property-table__modal-body",children:[Js("div",{className:"elb-property-table__modal-row",children:[qs("span",{className:"elb-property-table__modal-label",children:"Type:"}),qs("code",{className:"elb-property-table__modal-type elb-property-table__modal-type--wrap",children:e.type})]}),e.description&&Js("div",{className:"elb-property-table__modal-row",children:[qs("span",{className:"elb-property-table__modal-label",children:"Description:"}),qs("p",{className:"elb-property-table__modal-description",children:e.description})]}),e.default&&Js("div",{className:"elb-property-table__modal-row",children:[qs("span",{className:"elb-property-table__modal-label",children:"Default:"}),qs("code",{className:"elb-property-table__modal-default",children:e.default})]}),e.example&&Js("div",{className:"elb-property-table__modal-row",children:[qs("span",{className:"elb-property-table__modal-label",children:"Example:"}),qs("code",{className:"elb-property-table__modal-example",children:e.example})]})]})]})})}function ni(e,n){const t=Array.from(new Set(n.map(e=>e.title)));if(0===t.length)return e;t.sort((e,n)=>n.length-e.length);const r=t.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),o=new RegExp(`(${r.join("|")})`,"g"),a={};for(const e of n)a[e.title]=e.href;return e.split(o).map((e,n)=>{if(t.includes(e)){const t=a[e];return t?qs("a",{href:t,className:"elb-property-table__type-link",children:e},n):qs("span",{children:e},n)}return qs("span",{children:e},n)})}function ti({schema:e,className:n,emptyMessage:t}){const[r,o]=Us(null),[a,s]=Us(!1),[i,l]=Us(new Set),c=Qs(e),d=new Set;for(const e of c){const n=e.name.lastIndexOf(".");n>0&&d.add(e.name.slice(0,n))}const u=function(e,n){return 0===n.size?e:e.filter(e=>{const t=e.name.split(".");for(let e=1;e<t.length;e++)if(n.has(t.slice(0,e).join(".")))return!1;return!0})}(c,i);if(0===c.length)return qs("div",{className:`elb-explorer elb-property-table__empty ${n||""}`,role:"note",children:t??"No specific properties available."});const p=c.some(e=>e.required),f=e=>e.length<=30?e:e.slice(0,30),g=e=>{o(e),s(!0)};return Js("div",{className:`elb-explorer ${n||""}`,children:[qs("div",{className:"elb-property-table__container",children:Js("table",{className:"elb-property-table",children:[qs("thead",{children:Js("tr",{children:[qs("th",{children:"Property"}),qs("th",{children:"Type"}),qs("th",{children:"Description"}),qs("th",{children:"More"})]})}),qs("tbody",{children:u.map((e,n)=>{const t=d.has(e.name),r=i.has(e.name),o=e.depth>0?e.name.slice(e.name.lastIndexOf(".")+1):e.name;return Js("tr",{className:e.depth>0?"elb-property-table__row--nested":void 0,children:[Js("td",{className:"elb-property-table__property-cell","data-label":"Property",style:e.depth>0?{paddingLeft:.75+1.25*e.depth+"rem"}:void 0,children:[t&&qs("button",{type:"button",className:"elb-property-table__group-toggle",onClick:()=>{return n=e.name,void l(e=>{const t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t});var n},"aria-expanded":!r,"aria-label":`${r?"Expand":"Collapse"} ${o}`,children:qs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:r?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.15s ease"},children:qs("polyline",{points:"6 9 12 15 18 9"})})}),Js("code",{className:"elb-property-table__property-name",children:[o,e.required&&qs("span",{className:"elb-property-table__required-icon",children:"*"})]})]}),qs("td",{className:"elb-property-table__type-cell","data-label":"Type",children:e.typeRefs&&e.typeRefs.length>0?qs("code",{className:"elb-property-table__property-type",children:ni(e.type,e.typeRefs)}):(a=e.type,a.length>30?qs("button",{className:"elb-property-table__type-button",onClick:()=>g(e),"aria-label":`View full type for ${e.name}`,children:qs("code",{className:"elb-property-table__property-type elb-property-table__property-type--truncated",children:f(e.type)})}):qs("code",{className:"elb-property-table__property-type",children:e.type}))}),qs("td",{className:"elb-property-table__description","data-label":"Description",children:e.description}),qs("td",{className:"elb-property-table__action-cell","data-label":"More",children:qs("button",{className:"elb-property-table__more-button",onClick:()=>g(e),"aria-label":`More info about ${e.name}`,children:Js("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[qs("circle",{cx:"12",cy:"12",r:"10"}),qs("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),qs("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})})})]},e.name||n);var a})})]})}),p&&Js("div",{className:"elb-property-table__required-notice",children:[qs("span",{className:"elb-property-table__required-icon",children:"*"})," Required fields"]}),qs(ei,{property:r,isOpen:a,onClose:()=>{s(!1),o(null)}})]})}import{jsx as ri,jsxs as oi}from"react/jsx-runtime";function ai({trigger:e,isOpen:n,onToggle:t,children:r,align:o="left",ariaLabel:a,className:s=""}){return oi("div",{className:`elb-dropdown ${s}`.trim(),children:[ri("div",{className:"elb-dropdown__trigger",onClick:t,role:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":n,"aria-label":a,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t())},children:e}),n&&ri("div",{className:`elb-dropdown__panel elb-dropdown__panel--${o}`,role:"menu",children:r})]})}function si({children:e,onClick:n,disabled:t=!1,variant:r="default",className:o=""}){return ri("button",{type:"button",role:"menuitem",className:`elb-dropdown__item elb-dropdown__item--${r} ${t?"elb-dropdown__item--disabled":""} ${o}`.trim(),onClick:n,disabled:t,children:e})}function ii({className:e=""}){return ri("div",{className:`elb-dropdown__divider ${e}`.trim(),role:"separator"})}import{jsx as li}from"react/jsx-runtime";function ci({children:e,className:n=""}){return li("div",{className:`elb-explorer-footer ${n}`,children:e})}import{jsx as di}from"react/jsx-runtime";function ui({variant:e="default",size:n="md",href:t,onClick:r,children:o,className:a="",disabled:s=!1}){const i="elb-button-link",l=`${i} ${i}-${e} ${i}-${n} ${a}`.trim();return t&&!s?di("a",{href:t,className:l,children:o}):di("button",{type:"button",className:l,onClick:r,disabled:s,children:o})}import{jsx as pi}from"react/jsx-runtime";function fi({size:e="md",className:n=""}){return pi("span",{className:`elb-spinner elb-spinner--${e} ${n}`.trim(),role:"status","aria-label":"Loading"})}ur("walkeros:piwik-pro",{body:'<g fill="none" fill-rule="evenodd"><path fill="#231F20" d="M0 0h90v90H0z"/><path d="M50.792 57.21v.044H37.99v8.675c0 3.38-2.652 6.07-6.006 6.07a5.917 5.917 0 0 1-4.243-1.77 6.073 6.073 0 0 1-1.74-4.3v-38.88C26 23.67 28.65 21 31.983 21H50.79v.022c9.58.4 17.209 8.341 17.209 18.104 0 9.764-7.628 17.704-17.209 18.083h.001Zm-2.148-25.29H37.99v14.57h10.872c3.88-.112 6.993-3.337 6.993-7.274a7.347 7.347 0 0 0-2.114-5.16 7.16 7.16 0 0 0-5.098-2.134Z" fill="#FFF" fill-rule="nonzero"/></g>',width:90,height:90}),ur("walkeros:snowplow",{body:'<path d="M328.55 135.473L259.662 14.399a31.246 31.246 0 0 0-10.654-10.224 30.715 30.715 0 0 0-14.09-4.123h-51.362c-.47-.07-.948-.07-1.419 0H97.061a30.545 30.545 0 0 0-14.086 4.136A31.074 31.074 0 0 0 72.36 14.45L3.45 135.473A32.012 32.012 0 0 0 0 149.939c0 5.031 1.183 9.99 3.45 14.465L72.38 285.539a31.203 31.203 0 0 0 10.607 10.279A30.68 30.68 0 0 0 97.06 300h137.857a30.669 30.669 0 0 0 14.087-4.178 31.19 31.19 0 0 0 10.616-10.283l68.929-121.135a32.018 32.018 0 0 0 3.45-14.465c0-5.032-1.183-9.991-3.45-14.466zM251.086 19.439l25.159 44.225-44.074 76.53-28.848-50.129a4.973 4.973 0 0 0-1.804-1.814 4.884 4.884 0 0 0-2.454-.665h-57.261l43.851-77.506h49.263a21.061 21.061 0 0 1 9.12 2.79 21.41 21.41 0 0 1 7.008 6.548l.04.021zm-81.954 125.887l-27.47-47.722h54.585l27.491 47.712-54.606.01zm-8.971 4.844l-27.155 47.197-27.258-47.423l27.146-47.198 27.267 47.424zm8.687 5.245h54.302l-26.974 46.91h-54.514l27.186-46.91zM80.985 19.439a21.263 21.263 0 0 1 6.988-6.505 20.922 20.922 0 0 1 9.088-2.751h77.129l-43.8 77.403H42.202L80.985 19.44zM12.056 140.512l24.399-42.908h87.924l-28.686 49.789a5.065 5.065 0 0 0 0 5.071l28.686 49.85H36.455l-24.43-42.867a22.01 22.01 0 0 1-2.13-9.452c0-3.273.729-6.504 2.13-9.452l.031-.031zm85.005 149.419a21.067 21.067 0 0 1-9.136-2.841 21.415 21.415 0 0 1-6.99-6.611l-38.803-68.137h87.924l44.236 77.589h-77.23zm153.974-9.452a21.41 21.41 0 0 1-6.986 6.609 21.071 21.071 0 0 1-9.131 2.843h-49.152l-44.246-77.62h57.474c.861 0 1.707-.229 2.454-.664a4.973 4.973 0 0 0 1.804-1.814l28.625-49.697 44.013 76.705-24.855 43.638zm68.929-121.135l-38.336 67.428-43.851-76.468 44.205-76.664 38.053 66.852a22.014 22.014 0 0 1 2.131 9.452c0 3.273-.729 6.504-2.131 9.452" fill="#9E62DD"/>',width:332,height:300});import gi from"react";var hi={},mi=gi.createContext(hi);function yi(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(hi):e.components||hi:function(e){const n=gi.useContext(mi);return gi.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}(e.components),gi.createElement(mi.Provider,{value:n},e.children)}import{Children as bi}from"react";import{jsx as vi}from"react/jsx-runtime";var wi=({className:e,children:n})=>{const t=bi.toArray(n),r="string"==typeof e,o=t.some(e=>"string"==typeof e&&e.match(/[\n\r]/g));if(!r||!o)return vi("code",{className:"elb-code-inline",children:n});const a=e.replace(/^language-/,""),s={js:"javascript",ts:"typescript",jsx:"javascript",tsx:"typescript",bash:"shell",sh:"shell",yml:"yaml",md:"markdown"}[a]||a,i=t.map(e=>"string"==typeof e?e:"").join("").trim();return vi(pt,{code:i,language:s,disabled:!0,showCopy:!0,showHeader:!1,autoHeight:{min:100,max:600}})};import{jsx as ki}from"react/jsx-runtime";var xi=({children:e})=>ki(yi,{components:{code:wi,CodeBox:pt,PropertyTable:ti},children:e});import{useState as Ti,useRef as Si,useEffect as Ci,useCallback as $i}from"react";function Ei(){const[e,n]=Ti(!1),t=Si(null),r=$i(()=>{n(e=>!e)},[]),o=$i(()=>{n(!0)},[]),a=$i(()=>{n(!1)},[]);return Ci(()=>{if(e)return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r);function r(e){t.current&&!t.current.contains(e.target)&&n(!1)}},[e]),Ci(()=>{if(e)return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&n(!1)}},[e]),{isOpen:e,toggle:r,open:o,close:a,containerRef:t}}function Pi(e,n){const t=JSON.parse(JSON.stringify(e));for(const[e,r]of Object.entries(n)){const n=""===e?t:Ri(t,e);n&&"object"==typeof n&&Object.assign(n,r)}return t}function Ri(e,n){const t=n.split(".");let r=e;for(const e of t){if(!r||"object"!=typeof r||!(e in r))return;r=r[e]}return r}function _i(e){const n=JSON.parse(JSON.stringify(e)),t=n.definitions?.FlowJson,r=n.definitions?.Flow,o=n.definitions?.FlowConfig;if(!t?.properties)return n;const a=t.properties,s=r?.properties,i=o?.properties;return a.version&&(a.version.markdownDescription='Schema version number. Use `4` for the current format.\n\n```json\n"version": 4\n```'),a.$schema&&(a.$schema.markdownDescription='JSON Schema URI for IDE validation.\n\n```json\n"$schema": "https://walkeros.io/schema/flow/v4.json"\n```'),a.include&&(a.include.markdownDescription='Folders to include in the bundle output.\n\n```json\n"include": ["./src", "./lib"]\n```'),a.variables&&(a.variables.markdownDescription='Reusable values referenced via `$var.name` (with optional deep paths).\n\nWhole-string references preserve native type (objects/arrays/scalars).\nInline interpolation requires scalars.\n\n```json\n"variables": {\n "apiKey": "G-XXXXXXXXXX",\n "debug": false,\n "mapping": {\n "map": { "id": "data.id" }\n }\n}\n```\n\nReference scalars or structures: `"$var.apiKey"`, `"$var.mapping"`, `"$var.mapping.map.id"`.',a.variables.defaultSnippets=[{label:"Add scalar variable",description:"String/number/boolean variable",body:{"${1:name}":"${2:value}"}},{label:"Add structural variable",description:"Reusable mapping or object fragment",body:{"${1:name}":{"${2:key}":"${3:value}"}}}]),a.flows&&(a.flows.markdownDescription='Flow configurations keyed by name. Each flow defines a complete event pipeline.\n\n```json\n"flows": {\n "myFlow": {\n "config": { "platform": "web" },\n "sources": { ... },\n "destinations": { ... }\n }\n}\n```',a.flows.defaultSnippets=[{label:"Web flow (basic)",description:"Minimal web flow with browser source",body:{"${1:myFlow}":{config:{platform:"web"},sources:{browser:{package:"@walkeros/web-source-browser"}},destinations:{}}}},{label:"Server flow (basic)",description:"Minimal server flow with Express source",body:{"${1:myFlow}":{config:{platform:"server"},sources:{express:{package:"@walkeros/server-source-express"}},destinations:{}}}},{label:"Web + GA4 flow",description:"Web flow with browser source and GA4 destination",body:{"${1:myFlow}":{config:{platform:"web"},sources:{browser:{package:"@walkeros/web-source-browser"}},destinations:{ga4:{package:"@walkeros/web-destination-gtag",config:{measurementId:"$var.${2:measurementId}"}}}}}}]),s&&(s.config&&(s.config.markdownDescription='Per-flow configuration: platform identity, optional public URL, free-form settings, bundle.\n\n```json\n"config": {\n "platform": "web",\n "settings": {\n "windowCollector": "collector"\n }\n}\n```',s.config.defaultSnippets=[{label:"Web platform config",description:"Browser-based flow configuration",body:{platform:"web"}},{label:"Server platform config",description:"Node.js flow configuration",body:{platform:"server"}}]),s.sources&&(s.sources.markdownDescription='Source configurations for data capture, keyed by step name.\n\n```json\n"sources": {\n "browser": { "package": "@walkeros/web-source-browser" }\n}\n```',s.sources.defaultSnippets=[{label:"Add web source",description:"Browser source for web tracking",body:{"${1:browser}":{package:"@walkeros/web-source-browser"}}},{label:"Add server source",description:"Express source for server tracking",body:{"${1:express}":{package:"@walkeros/server-source-express"}}}]),s.destinations&&(s.destinations.markdownDescription='Destination configurations for data output, keyed by step name.\n\n```json\n"destinations": {\n "ga4": {\n "package": "@walkeros/web-destination-ga4",\n "config": { "measurementId": "$var.trackingId" }\n }\n}\n```',s.destinations.defaultSnippets=[{label:"Add GA4 destination",description:"Google Analytics 4 destination",body:{"${1:ga4}":{package:"@walkeros/web-destination-gtag",config:{measurementId:"$var.${2:measurementId}"}}}},{label:"Add custom destination",description:"Custom destination with inline code",body:{"${1:custom}":{code:{push:"$code:(event) => { ${2:// handle event} }"}}}}]),s.transformers&&(s.transformers.markdownDescription='Transformer configurations for event transformation, keyed by step name.\n\n```json\n"transformers": {\n "validator": {\n "code": { "push": "$code:(event) => event" }\n }\n}\n```',s.transformers.defaultSnippets=[{label:"Add transformer",description:"Inline transformer with code",body:{"${1:transformer}":{code:{push:"$code:(event) => { ${2:return event;} }"}}}}])),i&&(i.platform&&(i.platform.markdownDescription='Platform identity for this flow.\n\n- `web` builds to IIFE format, ES2020 target, browser platform.\n- `server` builds to ESM format, Node18 target, node platform.\n\n```json\n"platform": "web"\n```'),i.url&&(i.url.markdownDescription='Public URL where this flow is reachable. Used for cross-flow `$flow.X.url` references.\n\n```json\n"url": "https://collect.example.com"\n```'),i.settings&&(i.settings.markdownDescription='Free-form key-value settings consumed by the platform runtime.\n\nFor web: typical keys include `windowCollector`. The `windowElb` key is deprecated — set the browser source\'s `config.settings.elb` instead.\n\n```json\n"settings": {\n "windowCollector": "collector"\n}\n```'),i.bundle&&(i.bundle.markdownDescription='Bundle configuration: NPM packages to include and transitive dependency overrides.\n\n```json\n"bundle": {\n "packages": {\n "@walkeros/web-source-browser": { "version": "^2.0.0" }\n }\n}\n```')),n}function Oi(){return{type:"object",markdownDescription:'walkerOS Data Contract. Defines entity→action schemas for event validation.\n\n```json\n{\n "$tagging": 1,\n "page": {\n "view": {\n "type": "object",\n "properties": {\n "title": { "type": "string" }\n }\n }\n }\n}\n```',properties:{$tagging:{type:"number",markdownDescription:'Contract version number. Increment when making breaking changes.\n\n```json\n"$tagging": 1\n```'}},additionalProperties:{type:"object",markdownDescription:"Entity name. Contains action→schema mappings.",additionalProperties:{type:"object",markdownDescription:'Action schema (JSON Schema). Defines valid event data for this entity+action.\n\n```json\n{\n "type": "object",\n "properties": {\n "name": { "type": "string" },\n "price": { "type": "number" }\n },\n "required": ["name"]\n}\n```',defaultSnippets:[{label:"Object schema",description:"Schema with typed properties",body:{type:"object",properties:{"${1:name}":{type:"${2:string}"}}}}]},defaultSnippets:[{label:"Add action",description:"Action with event data schema",body:{"${1:action}":{type:"object",properties:{"${2:property}":{type:"${3:string}"}}}}}]},defaultSnippets:[{label:"Entity with action",description:"New entity with one action and properties",body:{"${1:entity}":{"${2:action}":{type:"object",properties:{"${3:property}":{type:"${4:string}"}}}}}}]}}function Fi(){return{type:"object",markdownDescription:'Flow variables for `$var.name` interpolation. Values must be string, number, or boolean.\n\n```json\n{\n "measurementId": "G-XXXXXXXXXX",\n "debug": false,\n "batchSize": 10\n}\n```\n\nReference in any config value: `"$var.measurementId"`',additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"}]},defaultSnippets:[{label:"Add string variable",body:{"${1:name}":"${2:value}"}},{label:"Add boolean variable",body:{"${1:name}":"${2|true,false|}"}},{label:"Add number variable",body:{"${1:name}":0}}]}}F();import{REF_ENV as Ii,REF_FLOW as ji,REF_STORE as Mi,REF_SECRET as Di}from"@walkeros/core";function Ni(e){const n=e.source.replace(/^\^/,"").replace(/\$$/,"").replace(/\(\.\+\)\?$/,"([\\w.]+)?");return new RegExp(n,"g")}function Ai(e,n){const t=[];if(n.variables){const r=/\$var\.([a-zA-Z_][a-zA-Z0-9_]*)(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*/g;let o;for(;null!==(o=r.exec(e));){const e=o[1];e in n.variables||t.push({message:`Unknown variable "$var.${e}". Defined variables: ${Object.keys(n.variables).join(", ")||"none"}`,severity:"warning",startIndex:o.index,endIndex:o.index+o[0].length})}}if(n.secrets){const r=Ni(Di);let o;for(;null!==(o=r.exec(e));)n.secrets.includes(o[1])||t.push({message:`Unknown secret "$secret.${o[1]}". Available: ${n.secrets.join(", ")||"none"}`,severity:"warning",startIndex:o.index,endIndex:o.index+o[0].length})}if(n.stores){const r=Ni(Mi);let o;for(;null!==(o=r.exec(e));)n.stores.includes(o[1])||t.push({message:`Unknown store "$store.${o[1]}". Available: ${n.stores.join(", ")||"none"}`,severity:"warning",startIndex:o.index,endIndex:o.index+o[0].length})}if(n.flows){const r=Ni(ji);let o;for(;null!==(o=r.exec(e));)n.flows.includes(o[1])||t.push({message:`Unknown flow "$flow.${o[1]}". Available: ${n.flows.join(", ")||"none"}`,severity:"warning",startIndex:o.index,endIndex:o.index+o[0].length})}if(n.envNames){const r=Ni(Ii);let o;for(;null!==(o=r.exec(e));)n.envNames.includes(o[1])||t.push({message:`Unknown env var "$env.${o[1]}". Known: ${n.envNames.join(", ")||"none"}`,severity:"warning",startIndex:o.index,endIndex:o.index+o[0].length})}return t.push(...function(e,n){const t=[];if(!n)return t;const r=n;let o;try{o=JSON.parse(e)}catch{return t}function a(e){if("string"==typeof e)return[e];if(Array.isArray(e)){const n=[];for(const t of e)"string"==typeof t?n.push(t):t&&"object"==typeof t&&"next"in t&&n.push(...a(t.next));return n}return[]}function s(e,n){if(e&&"object"==typeof e)if(Array.isArray(e))e.forEach((e,t)=>s(e,[...n,t]));else for(const[o,i]of Object.entries(e)){const e=[...n,o];if("next"!==o&&"before"!==o)s(i,e);else for(const n of a(i))r.includes(n)||t.push({message:`Unknown transformer "${n}" in ${e.join(".")}. Available: ${r.join(", ")||"none"}`,severity:"warning",startIndex:0,endIndex:0})}}return s(o,[]),t}(e,n.stepNames?.transformers)),t}function Li(e){let n;try{n=JSON.parse(e)}catch{return{}}if(!(Vi(t=n)&&"version"in t&&"flows"in t&&Vi(t.flows)))return{};var t;const r={},o=[],a=[],s=[],i=[],l=[],c=[],d={};let u;Wi(r,n.variables),Bi(c,n.contract),Vi(n.contract)&&Object.assign(d,n.contract);for(const e of Object.values(n.flows))if(Vi(e)){if(!u&&Vi(e.config)){const n=e.config.platform;"web"!==n&&"server"!==n||(u=n)}if(Wi(r,e.variables),Bi(c,e.contract),Vi(e.contract)&&Object.assign(d,e.contract),Vi(e.sources))for(const[n,t]of Object.entries(e.sources))o.push(n),Vi(t)&&(Wi(r,t.variables),"string"==typeof t.package&&l.push({package:t.package,shortName:n,type:"source",platform:u||"web"}));if(Vi(e.destinations))for(const[n,t]of Object.entries(e.destinations))a.push(n),Vi(t)&&(Wi(r,t.variables),"string"==typeof t.package&&l.push({package:t.package,shortName:n,type:"destination",platform:u||"web"}));if(Vi(e.transformers))for(const[n,t]of Object.entries(e.transformers))s.push(n),Vi(t)&&(Wi(r,t.variables),"string"==typeof t.package&&l.push({package:t.package,shortName:n,type:"transformer",platform:u||"web"}));if(Vi(e.stores))for(const[n,t]of Object.entries(e.stores))i.push(n),Vi(t)&&Wi(r,t.variables)}const p={variables:r,stepNames:{sources:o,destinations:a,transformers:s}};return u&&(p.platform=u),l.length>0&&(p.packages=l),c.length>0&&(p.contract=c),Object.keys(d).length>0&&(p.contractRaw=d),i.length>0&&(p.stores=i),p}function Vi(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Wi(e,n){if(Vi(n))for(const[t,r]of Object.entries(n))e[t]=r}function Bi(e,n){if(Vi(n))for(const[t,r]of Object.entries(n)){if(t.startsWith("$")||!Vi(r))continue;const n=e.find(e=>e.entity===t),o=Object.keys(r);if(n)for(const e of o)n.actions.includes(e)||n.actions.push(e);else e.push({entity:t,actions:o})}}export{ja as ArchitectureFlow,ue as Box,nt as BrowserBox,me as Button,be as ButtonGroup,ui as ButtonLink,Un as Code,pt as CodeBox,Ja as CodeDiff,ns as CodeDiffBox,$s as CodeSnippet,ks as CodeStatic,Ss as CodeView,Wt as CollectorBox,Xn as DEFAULT_FALLBACK_HTML,ai as Dropdown,ii as DropdownDivider,si as DropdownItem,Hs as FlowMap,ci as Footer,Y as Grid,ie as Header,lo as Icon,Dt as LiveCode,wi as MDXCode,xi as MDXProvider,Yn as Preview,wt as PromotionPlayground,ti as PropertyTable,Ue as REFERENCE_PATTERNS,fi as Spinner,mn as allowedRefKinds,Je as applyWalkerOSDecorations,_a as cn,mt as createFbqDestination,ht as createGtagDestination,yt as createPlausibleDestination,$n as disposeWalkerOSProviders,_i as enrichFlowConfigSchema,Pi as enrichSchema,Li as extractFlowIntelliSenseContext,qe as findWalkerOSReferences,Nn as generateModelPath,gn as getContractCompletions,Oi as getEnrichedContractSchema,un as getEnvCompletions,dn as getFlowCompletions,hn as getJsonPathAtOffset,fn as getMappingPathCompletions,ln as getSecretCompletions,cn as getStoreCompletions,sn as getVariableCompletions,Fi as getVariablesSchema,R as initializeMonacoTypes,Gn as isMonacoCancellation,Be as lighthouseTheme,x as loadPackageTypes,b as loadTypeLibraryFromURL,Me as palenightTheme,Ge as registerAllThemes,An as registerJsonSchema,ze as registerLighthouseTheme,De as registerPalenightTheme,Ke as registerWalkerOSDecorationStyles,Cn as registerWalkerOSProviders,E as registerWalkerOSTypes,Sn as removeIntelliSenseContext,k as resolveTypesUrl,Tn as setIntelliSenseContext,w as setPackageTypesBaseUrl,Ln as unregisterJsonSchema,Ei as useDropdown,Ai as validateWalkerOSReferences};//# sourceMappingURL=index.mjs.map
|
|
1
|
+
"use client";var e,n,t,r=Object.defineProperty,o=Object.getOwnPropertyNames,a=(e,n)=>function(){return e&&(n=(0,e[o(e)[0]])(e=0)),n};var s,i,l,c,d,u=a({"src/utils/monaco-context-types.ts"(){"use strict";e="\n// WalkerOS Core Types\ndeclare namespace WalkerOS {\n // Utility types\n type DeepPartial<T> = {\n [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];\n };\n\n type PromiseOrValue<T> = T | Promise<T>;\n\n // Property types\n type PropertyType = boolean | string | number | {\n [key: string]: Property;\n };\n\n type Property = PropertyType | Array<PropertyType>;\n\n interface Properties {\n [key: string]: Property | undefined;\n }\n\n interface OrderedProperties {\n [key: string]: [Property, number] | undefined;\n }\n\n // Consent\n interface Consent {\n [name: string]: boolean;\n }\n\n // User\n interface User extends Properties {\n id?: string;\n device?: string;\n session?: string;\n hash?: string;\n address?: string;\n email?: string;\n phone?: string;\n userAgent?: string;\n browser?: string;\n browserVersion?: string;\n deviceType?: string;\n language?: string;\n country?: string;\n region?: string;\n city?: string;\n zip?: string;\n timezone?: string;\n os?: string;\n osVersion?: string;\n screenSize?: string;\n ip?: string;\n internal?: boolean;\n }\n\n // Source\n type SourcePlatform =\n | 'web'\n | 'server'\n | 'app'\n | 'ios'\n | 'android'\n | 'terminal'\n | string;\n\n interface Source extends Properties {\n type: string;\n platform?: SourcePlatform;\n version?: string;\n schema?: string;\n count?: number;\n trace?: string;\n url?: string;\n referrer?: string;\n tool?: string;\n command?: string;\n }\n\n // Entity\n type Entities = Array<Entity>;\n\n interface Entity {\n entity: string;\n data: Properties;\n nested?: Entities;\n context?: OrderedProperties;\n }\n\n // Event\n interface Event {\n name: string;\n data: Properties;\n context: OrderedProperties;\n globals: Properties;\n custom: Properties;\n user: User;\n nested: Entities;\n consent: Consent;\n id: string;\n trigger: string;\n entity: string;\n action: string;\n timestamp: number;\n timing: number;\n source: Source;\n }\n\n type DeepPartialEvent = DeepPartial<Event>;\n}\n\n// Mapping Types\ndeclare namespace Mapping {\n type ValueType = string | ValueConfig;\n type Value = ValueType | Array<ValueType>;\n type Values = Array<Value>;\n\n interface ValueConfig {\n condition?: Condition;\n consent?: WalkerOS.Consent;\n fn?: Fn;\n key?: string;\n loop?: Loop;\n map?: Map;\n set?: Value[];\n validate?: Validate;\n value?: WalkerOS.PropertyType;\n }\n\n type Loop = [Value, Value];\n type Map = { [key: string]: Value };\n\n interface Context {\n event: WalkerOS.DeepPartialEvent;\n mapping: Value | Rule;\n collector: Collector.Instance;\n logger: Logger.Instance;\n consent?: WalkerOS.Consent;\n }\n\n type Condition = (\n value: WalkerOS.DeepPartialEvent | unknown,\n context: Context,\n ) => WalkerOS.PromiseOrValue<boolean>;\n\n type Fn = (\n value: WalkerOS.DeepPartialEvent | unknown,\n context: Context,\n ) => WalkerOS.PromiseOrValue<WalkerOS.Property | unknown>;\n\n type Validate = (\n value: unknown,\n context: Context,\n ) => WalkerOS.PromiseOrValue<boolean>;\n\n interface Rule {\n condition?: Condition;\n consent?: WalkerOS.Consent;\n name?: string;\n ignore?: boolean;\n silent?: boolean;\n }\n}\n\ndeclare namespace Logger {\n interface Instance {\n error: (msg: string, ...args: unknown[]) => void;\n warn: (msg: string, ...args: unknown[]) => void;\n info: (msg: string, ...args: unknown[]) => void;\n debug: (msg: string, ...args: unknown[]) => void;\n }\n}\n\n// Collector Types (minimal for fn context)\ndeclare namespace Collector {\n interface Instance {\n push: any;\n command: any;\n allowed: boolean;\n config: any;\n consent: WalkerOS.Consent;\n count: number;\n custom: WalkerOS.Properties;\n globals: WalkerOS.Properties;\n group: string;\n queue: any[];\n round: number;\n session: any;\n timing: number;\n user: WalkerOS.User;\n version: string;\n [key: string]: any;\n }\n}\n\n// Parameter declarations for fn context\ndeclare const value: WalkerOS.DeepPartialEvent | unknown;\ndeclare const context: Mapping.Context;\n",n="\n// WalkerOS Core Types\ndeclare namespace WalkerOS {\n // Utility types\n type DeepPartial<T> = {\n [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];\n };\n\n type PromiseOrValue<T> = T | Promise<T>;\n\n // Property types\n type PropertyType = boolean | string | number | {\n [key: string]: Property;\n };\n\n type Property = PropertyType | Array<PropertyType>;\n\n interface Properties {\n [key: string]: Property | undefined;\n }\n\n interface OrderedProperties {\n [key: string]: [Property, number] | undefined;\n }\n\n // Consent\n interface Consent {\n [name: string]: boolean;\n }\n\n // User\n interface User extends Properties {\n id?: string;\n device?: string;\n session?: string;\n hash?: string;\n address?: string;\n email?: string;\n phone?: string;\n userAgent?: string;\n browser?: string;\n browserVersion?: string;\n deviceType?: string;\n language?: string;\n country?: string;\n region?: string;\n city?: string;\n zip?: string;\n timezone?: string;\n os?: string;\n osVersion?: string;\n screenSize?: string;\n ip?: string;\n internal?: boolean;\n }\n\n // Source\n type SourcePlatform =\n | 'web'\n | 'server'\n | 'app'\n | 'ios'\n | 'android'\n | 'terminal'\n | string;\n\n interface Source extends Properties {\n type: string;\n platform?: SourcePlatform;\n version?: string;\n schema?: string;\n count?: number;\n trace?: string;\n url?: string;\n referrer?: string;\n tool?: string;\n command?: string;\n }\n\n // Entity\n type Entities = Array<Entity>;\n\n interface Entity {\n entity: string;\n data: Properties;\n nested?: Entities;\n context?: OrderedProperties;\n }\n\n // Event\n interface Event {\n name: string;\n data: Properties;\n context: OrderedProperties;\n globals: Properties;\n custom: Properties;\n user: User;\n nested: Entities;\n consent: Consent;\n id: string;\n trigger: string;\n entity: string;\n action: string;\n timestamp: number;\n timing: number;\n source: Source;\n }\n\n type DeepPartialEvent = DeepPartial<Event>;\n}\n\n// Mapping Types\ndeclare namespace Mapping {\n type ValueType = string | ValueConfig;\n type Value = ValueType | Array<ValueType>;\n type Values = Array<Value>;\n\n interface ValueConfig {\n condition?: Condition;\n consent?: WalkerOS.Consent;\n fn?: Fn;\n key?: string;\n loop?: Loop;\n map?: Map;\n set?: Value[];\n validate?: Validate;\n value?: WalkerOS.PropertyType;\n }\n\n type Loop = [Value, Value];\n type Map = { [key: string]: Value };\n\n interface Context {\n event: WalkerOS.DeepPartialEvent;\n mapping: Value | Rule;\n collector: Collector.Instance;\n logger: Logger.Instance;\n consent?: WalkerOS.Consent;\n }\n\n type Condition = (\n value: WalkerOS.DeepPartialEvent | unknown,\n context: Context,\n ) => WalkerOS.PromiseOrValue<boolean>;\n\n type Fn = (\n value: WalkerOS.DeepPartialEvent | unknown,\n context: Context,\n ) => WalkerOS.PromiseOrValue<WalkerOS.Property | unknown>;\n\n type Validate = (\n value: unknown,\n context: Context,\n ) => WalkerOS.PromiseOrValue<boolean>;\n\n interface Rule {\n condition?: Condition;\n consent?: WalkerOS.Consent;\n name?: string;\n ignore?: boolean;\n silent?: boolean;\n }\n}\n\ndeclare namespace Logger {\n interface Instance {\n error: (msg: string, ...args: unknown[]) => void;\n warn: (msg: string, ...args: unknown[]) => void;\n info: (msg: string, ...args: unknown[]) => void;\n debug: (msg: string, ...args: unknown[]) => void;\n }\n}\n\n// Collector Types (full interface for condition context)\ndeclare namespace Collector {\n interface SessionData extends WalkerOS.Properties {\n isStart: boolean;\n storage: boolean;\n id?: string;\n start?: number;\n marketing?: true;\n updated?: number;\n isNew?: boolean;\n device?: string;\n count?: number;\n runs?: number;\n }\n\n interface Config {\n run?: boolean;\n tagging: number;\n globalsStatic: WalkerOS.Properties;\n sessionStatic: Partial<SessionData>;\n verbose: boolean;\n onError?: any;\n onLog?: any;\n }\n\n interface Instance {\n push: any;\n command: any;\n allowed: boolean;\n config: Config;\n consent: WalkerOS.Consent;\n count: number;\n custom: WalkerOS.Properties;\n sources: any;\n destinations: any;\n globals: WalkerOS.Properties;\n group: string;\n hooks: any;\n on: any;\n queue: any[];\n round: number;\n session: undefined | SessionData;\n timing: number;\n user: WalkerOS.User;\n version: string;\n }\n}\n\n// Parameter declarations for condition context\ndeclare const value: WalkerOS.DeepPartialEvent | unknown;\ndeclare const context: Mapping.Context;\n",t="\n// WalkerOS Core Types\ndeclare namespace WalkerOS {\n // Utility types\n type DeepPartial<T> = {\n [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];\n };\n\n type PromiseOrValue<T> = T | Promise<T>;\n\n // Property types\n type PropertyType = boolean | string | number | {\n [key: string]: Property;\n };\n\n type Property = PropertyType | Array<PropertyType>;\n\n interface Properties {\n [key: string]: Property | undefined;\n }\n\n interface OrderedProperties {\n [key: string]: [Property, number] | undefined;\n }\n\n // Consent\n interface Consent {\n [name: string]: boolean;\n }\n\n // User\n interface User extends Properties {\n id?: string;\n device?: string;\n session?: string;\n hash?: string;\n address?: string;\n email?: string;\n phone?: string;\n userAgent?: string;\n browser?: string;\n browserVersion?: string;\n deviceType?: string;\n language?: string;\n country?: string;\n region?: string;\n city?: string;\n zip?: string;\n timezone?: string;\n os?: string;\n osVersion?: string;\n screenSize?: string;\n ip?: string;\n internal?: boolean;\n }\n\n // Source\n type SourcePlatform =\n | 'web'\n | 'server'\n | 'app'\n | 'ios'\n | 'android'\n | 'terminal'\n | string;\n\n interface Source extends Properties {\n type: string;\n platform?: SourcePlatform;\n version?: string;\n schema?: string;\n count?: number;\n trace?: string;\n url?: string;\n referrer?: string;\n tool?: string;\n command?: string;\n }\n\n // Entity\n type Entities = Array<Entity>;\n\n interface Entity {\n entity: string;\n data: Properties;\n nested?: Entities;\n context?: OrderedProperties;\n }\n\n // Event\n interface Event {\n name: string;\n data: Properties;\n context: OrderedProperties;\n globals: Properties;\n custom: Properties;\n user: User;\n nested: Entities;\n consent: Consent;\n id: string;\n trigger: string;\n entity: string;\n action: string;\n timestamp: number;\n timing: number;\n source: Source;\n }\n\n type DeepPartialEvent = DeepPartial<Event>;\n}\n\n// Mapping Types\ndeclare namespace Mapping {\n type ValueType = string | ValueConfig;\n type Value = ValueType | Array<ValueType>;\n type Values = Array<Value>;\n\n interface ValueConfig {\n condition?: Condition;\n consent?: WalkerOS.Consent;\n fn?: Fn;\n key?: string;\n loop?: Loop;\n map?: Map;\n set?: Value[];\n validate?: Validate;\n value?: WalkerOS.PropertyType;\n }\n\n type Loop = [Value, Value];\n type Map = { [key: string]: Value };\n\n interface Context {\n event: WalkerOS.DeepPartialEvent;\n mapping: Value | Rule;\n collector: Collector.Instance;\n logger: Logger.Instance;\n consent?: WalkerOS.Consent;\n }\n\n type Condition = (\n value: WalkerOS.DeepPartialEvent | unknown,\n context: Context,\n ) => WalkerOS.PromiseOrValue<boolean>;\n\n type Fn = (\n value: WalkerOS.DeepPartialEvent | unknown,\n context: Context,\n ) => WalkerOS.PromiseOrValue<WalkerOS.Property | unknown>;\n\n type Validate = (\n value: unknown,\n context: Context,\n ) => WalkerOS.PromiseOrValue<boolean>;\n\n interface Rule {\n condition?: Condition;\n consent?: WalkerOS.Consent;\n name?: string;\n ignore?: boolean;\n silent?: boolean;\n }\n}\n\ndeclare namespace Logger {\n interface Instance {\n error: (msg: string, ...args: unknown[]) => void;\n warn: (msg: string, ...args: unknown[]) => void;\n info: (msg: string, ...args: unknown[]) => void;\n debug: (msg: string, ...args: unknown[]) => void;\n }\n}\n\n// Collector Types (minimal for validate context)\ndeclare namespace Collector {\n interface Instance {\n push: any;\n command: any;\n allowed: boolean;\n config: any;\n consent: WalkerOS.Consent;\n count: number;\n custom: WalkerOS.Properties;\n globals: WalkerOS.Properties;\n group: string;\n queue: any[];\n round: number;\n session: any;\n timing: number;\n user: WalkerOS.User;\n version: string;\n [key: string]: any;\n }\n}\n\n// Parameter declarations for validate context\ndeclare const value: unknown;\ndeclare const context: Mapping.Context;\n"}}),p=a({"walkeros-types:virtual:walkeros-core-types"(){"use strict";s="type MatchExpression = MatchCondition | {\n and: MatchExpression[];\n} | {\n or: MatchExpression[];\n};\ninterface MatchCondition {\n key: string;\n operator: MatchOperator;\n value: string;\n not?: boolean;\n}\ntype MatchOperator = 'eq' | 'contains' | 'prefix' | 'suffix' | 'regex' | 'gt' | 'lt' | 'exists';\ntype CompiledMatcher = (context: Record<string, unknown>) => boolean;\n\ntype matcher_CompiledMatcher = CompiledMatcher;\ntype matcher_MatchCondition = MatchCondition;\ntype matcher_MatchExpression = MatchExpression;\ntype matcher_MatchOperator = MatchOperator;\ndeclare namespace matcher {\n export type { matcher_CompiledMatcher as CompiledMatcher, matcher_MatchCondition as MatchCondition, matcher_MatchExpression as MatchExpression, matcher_MatchOperator as MatchOperator };\n}\n\n/**\n * Shared mapping configuration interface.\n * Used by both Source.Config and Destination.Config.\n */\ninterface Config$7<T = unknown> {\n consent?: Consent;\n data?: Value | Values;\n include?: string[];\n mapping?: Rules<Rule<T>>;\n policy?: Policy$1;\n}\ninterface Policy$1 {\n [key: string]: Value;\n}\ninterface Rules<T = Rule> {\n [entity: string]: Record<string, T | Array<T>> | undefined;\n}\ninterface Rule<Settings = unknown> {\n /**\n * Batch scheduling for this event mapping. When present, it splits this\n * event type into its own buffer, overriding `config.batch` per field\n * (`rule ?? config ?? default`). A bare number is the debounce `wait`\n * window. Object form supports `wait` (debounce ms), `size` (count cap),\n * and `age` (max ms since first entry).\n */\n batch?: number | BatchOptions;\n condition?: Condition;\n consent?: Consent;\n settings?: Settings;\n data?: Data$1;\n include?: string[];\n ignore?: boolean;\n silent?: boolean;\n name?: string;\n policy?: Policy$1;\n /**\n * Merge mode (config layer): a partial Rule deep-merged onto the\n * package-shipped default rule at the same key, instead of replacing it.\n * Resolved at the consuming package's init via `mergeMappingRule`; not\n * seen by the runtime evaluator. A `null` value clears an inherited field.\n * Presence of `extend` or `remove` switches this rule from replace to merge.\n */\n extend?: RulePatch<Settings>;\n /**\n * Output layer: dotted paths stripped from the produced data payload\n * after evaluation, regardless of how each field was produced. Applied\n * last, so it always wins.\n */\n remove?: string[];\n}\n/**\n * A partial Rule used by `Rule.extend`. Every field is optional, and a\n * `null` value clears the inherited field (JSON merge-patch delete). The\n * control fields `extend` and `remove` are excluded: a patch models only\n * direct rule fields, matching what the runtime patch schema accepts.\n */\ntype RulePatchFields<Settings = unknown> = Omit<Rule<Settings>, 'extend' | 'remove'>;\ntype RulePatch<Settings = unknown> = {\n [K in keyof RulePatchFields<Settings>]?: RulePatchFields<Settings>[K] | null;\n};\ninterface Result$2 {\n eventMapping?: Rule;\n mappingKey?: string;\n}\ntype Data$1 = Value | Values;\ntype Value = ValueType | Array<ValueType>;\ntype Values = Array<Value>;\ntype ValueType = string | ValueConfig;\ninterface ValueConfig {\n condition?: Condition;\n consent?: Consent;\n fn?: Fn$4;\n key?: string;\n loop?: Loop;\n map?: Map;\n set?: Value[];\n validate?: Validate;\n value?: PropertyType;\n}\ninterface Context$6 {\n event: DeepPartialEvent;\n /** The surrounding mapping config: a Value (value-level) or a Rule (rule-level). */\n mapping: Value | Rule;\n collector: Instance$6;\n logger: Instance$3;\n consent?: Consent;\n}\ntype Fn$4 = (value: unknown, context: Context$6) => PromiseOrValue<Property | unknown>;\ntype Condition = (value: unknown, context: Context$6) => PromiseOrValue<boolean>;\ntype Validate = (value: unknown, context: Context$6) => PromiseOrValue<boolean>;\ntype Loop = [Value, Value];\ntype Map = {\n [key: string]: Value;\n};\n\ntype mapping_Condition = Condition;\ntype mapping_Loop = Loop;\ntype mapping_Map = Map;\ntype mapping_Rule<Settings = unknown> = Rule<Settings>;\ntype mapping_RulePatch<Settings = unknown> = RulePatch<Settings>;\ntype mapping_Rules<T = Rule> = Rules<T>;\ntype mapping_Validate = Validate;\ntype mapping_Value = Value;\ntype mapping_ValueConfig = ValueConfig;\ntype mapping_ValueType = ValueType;\ntype mapping_Values = Values;\ndeclare namespace mapping {\n export type { mapping_Condition as Condition, Config$7 as Config, Context$6 as Context, Data$1 as Data, Fn$4 as Fn, mapping_Loop as Loop, mapping_Map as Map, Policy$1 as Policy, Result$2 as Result, mapping_Rule as Rule, mapping_RulePatch as RulePatch, mapping_Rules as Rules, mapping_Validate as Validate, mapping_Value as Value, mapping_ValueConfig as ValueConfig, mapping_ValueType as ValueType, mapping_Values as Values };\n}\n\ninterface BaseCacheRule {\n /**\n * Optional match expression. Omitted means always-match.\n */\n match?: MatchExpression;\n ttl: number;\n}\ninterface EventCacheRule extends BaseCacheRule {\n key: string[];\n update?: Record<string, Value>;\n}\ninterface StoreCacheRule extends BaseCacheRule {\n}\ntype CacheRule = EventCacheRule | StoreCacheRule;\ninterface Cache<R extends CacheRule = CacheRule> {\n /**\n * Stop the chain on cache HIT (default: false). When true, skip remaining steps and return cached value.\n */\n stop?: boolean;\n store?: string;\n /**\n * Optional key prefix written to the store. When absent, cache keys are written directly. Same store + same key + same namespace = same cache entry.\n */\n namespace?: string;\n rules: R[];\n}\n\ntype cache_Cache<R extends CacheRule = CacheRule> = Cache<R>;\ntype cache_CacheRule = CacheRule;\ntype cache_EventCacheRule = EventCacheRule;\ntype cache_StoreCacheRule = StoreCacheRule;\ndeclare namespace cache {\n export type { cache_Cache as Cache, cache_CacheRule as CacheRule, cache_EventCacheRule as EventCacheRule, cache_StoreCacheRule as StoreCacheRule };\n}\n\n/**\n * Options for responding to an HTTP request.\n * Same interface for web and server — sources implement the handler.\n */\ninterface RespondOptions {\n /** Response body. Objects are JSON-serialized by source. */\n body?: unknown;\n /** HTTP status code (default: 200). Server-only, ignored by web sources. */\n status?: number;\n /** HTTP response headers. Server-only, ignored by web sources. */\n headers?: Record<string, string>;\n}\n/**\n * Standardized response function available on env for every step.\n * Idempotent: first call wins, subsequent calls are no-ops.\n * Created by sources via createRespond(), consumed by any step.\n */\ntype RespondFn = (options?: RespondOptions) => void;\n/**\n * Creates an idempotent respond function.\n * The sender callback is source-specific (Express wraps res, Fetch wraps Response, etc.).\n *\n * @param sender - Platform-specific function that actually sends the response\n * @returns Idempotent respond function (first call wins)\n */\ndeclare function createRespond(sender: (options: RespondOptions) => void): RespondFn;\n\n/**\n * Metadata managed by the runtime. Do not overwrite from step code.\n * The _ prefix signals \"runtime-managed.\"\n */\ninterface IngestMeta {\n /** Number of steps this data has passed through. */\n hops: number;\n /** Ordered list of step IDs visited. path[0] is always the source ID. */\n path: string[];\n /** Current chain context, e.g., \"destination.ga4.before\" or \"source.web.next\". */\n chainPath?: string;\n /** W3C 32-hex trace id adopted from an inbound traceparent header. */\n trace?: string;\n /** Parent span (upstream event.id) from an inbound traceparent header. */\n parentEventId?: string;\n}\n/**\n * Mutable shared context that accumulates knowledge as data flows through the graph.\n *\n * Event = strict schema (analytics data).\n * Ingest = wild west (pipeline context).\n *\n * Any step can read and write arbitrary keys. The `_meta` section is\n * managed by the runtime — increment hops and append to path before each step.\n */\ninterface Ingest {\n [key: string]: unknown;\n _meta: IngestMeta;\n}\n/** Create a fresh Ingest for a new pipeline invocation. */\ndeclare function createIngest(sourceId: string): Ingest;\n\n/**\n * FlowState is the canonical observation record emitted at each hop in a\n * walkerOS pipeline. Telemetry helpers populate one of these per (step,\n * phase) tuple and pass it to a user-supplied emit callback. The shape is\n * stable across step kinds (source, transformer, collector, destination,\n * store) so a single observer can correlate work across the pipeline.\n *\n * Optional fields are populated only when meaningful for the (step, phase)\n * pair, or when the telemetry options explicitly opt in (e.g. trace level\n * for inEvent/outEvent).\n */\ntype FlowStatePhase = 'init' | 'in' | 'out' | 'error' | 'skip' | 'flush';\ntype FlowStepType = 'source' | 'transformer' | 'collector' | 'destination' | 'store';\ninterface FlowStateBatch {\n size: number;\n index: number;\n}\ninterface FlowState {\n /** The flow this state belongs to. */\n flowId: string;\n /**\n * Runtime that produced this state: `web` (browser bundle) or `server`\n * (Node runtime). Mirrors the originating flow's `config.platform`.\n * Optional: emitters may omit it; populated when the runtime is known.\n */\n platform?: 'web' | 'server';\n /** Step identifier, e.g. 'destination.gtag', 'transformer.consent', 'collector.push'. */\n stepId: string;\n stepType: FlowStepType;\n phase: FlowStatePhase;\n /** W3C span-id of the originating WalkerOS.Event. Sourced from event.id; never synthesized. */\n eventId: string;\n /** W3C 32-hex trace id of the originating run. Sourced from event.source.trace; never synthesized here. */\n traceId?: string;\n /** Upstream runtime's event.id when this pipeline was entered via a $flow crossing (from traceparent). */\n parentEventId?: string;\n /** Originating source id (Ingest._meta.path[0]), when known. */\n sourceId?: string;\n /** Per-poster monotonic record counter for gap detection. Stamped by the batched poster, not emitters. */\n seq?: number;\n /**\n * Vendor calls recorded via wrapEnv on destination out records. Captured only\n * at trace level and only when the destination declares a `calls` list\n * (dot-paths of observable env callables); the recorded array then survives\n * projection when level === 'trace' or includeOut === true.\n */\n calls?: Call[];\n /** ISO 8601 timestamp. */\n timestamp: string;\n /** Milliseconds since the runtime's startedAt origin. Monotonic. */\n elapsedMs: number;\n /** Wall-clock duration of this step, if measured (typically only on 'out'). */\n durationMs?: number;\n /** Inbound walker event for this hop. Only populated when level === 'trace' or includeIn === true. */\n inEvent?: unknown;\n /** Outbound walker event/payload for this hop. Only populated when level === 'trace' or includeOut === true. */\n outEvent?: unknown;\n /** Error info when phase === 'error'. */\n error?: {\n name?: string;\n message: string;\n };\n /** The mapping rule that matched, when one matched. */\n mappingKey?: string;\n /** Contract rule that matched, if any. */\n contractRule?: string;\n /** Consent gate snapshot at hop time. */\n consent?: Record<string, boolean>;\n /** Consent state actually applied (after policy resolution). */\n consentApplied?: Record<string, boolean>;\n /** W3C 16-hex span-id of the child branch for `many` fan-out. */\n branchId?: string;\n /** For phase === 'flush', the batch size + entry index. */\n batch?: FlowStateBatch;\n /** Discriminator when phase === 'skip'. */\n skipReason?: 'consent' | 'cache_hit' | 'sampled_out' | 'disabled' | 'unknown';\n /** Free-form metadata: store key/value, cached: true, etc. */\n meta?: Record<string, unknown>;\n}\n\n/**\n * Pipeline observation channel. Observers receive a FlowState record per\n * step phase (init, in, out, error, skip, flush) and run synchronously in\n * the collector's emit loop. They must not throw; emitStep swallows\n * thrown values defensively so a slow or buggy observer cannot crash the\n * pipeline. Observers must not perform synchronous IO.\n */\ntype ObserverFn = (state: FlowState) => void;\n\n/** Identifies which kind of step a stepId belongs to. */\ntype StepKind = 'collector' | 'source' | 'transformer' | 'destination' | 'store';\n/**\n * Build a stepId for use as a key in `Status.dropped` /\n * `Status.connectionErrors` (and future status maps). The collector-level\n * stepId is the literal \"collector\" (no id). Source/transformer/destination/\n * store ids take the form `\"<kind>.<id>\"`, e.g. `\"destination.ga4\"`.\n *\n * The dot separator mirrors the vocabulary already used in collector\n * log messages (\"collector.queue overflow\", \"destination.dlq overflow\").\n */\ndeclare function stepId(kind: 'collector'): 'collector';\ndeclare function stepId(kind: 'source' | 'transformer' | 'destination' | 'store', id: string): string;\n/**\n * Drop counters at a single step. Each buffer is optional: a step kind\n * may have only `queue` (collector), only `dlq`, both (destinations\n * today), or neither. Counts are monotonic.\n */\ninterface DroppedCounters {\n queue?: number;\n dlq?: number;\n}\n/**\n * Circuit-breaker state for a single step (keyed by `stepId()` in\n * `Status.breakers`). Tracks consecutive transport failures so a step whose\n * transport is down can be skipped (gated) until a cooldown elapses, instead\n * of every event hammering a known-broken writer.\n *\n * - `closed`: healthy; events pass through. `consecutiveFailures` accrues on\n * transport failures and resets to 0 on any success.\n * - `open`: tripped; events are skipped until `openUntil`. The first event at\n * or after `openUntil` transitions to `half-open` and becomes the probe.\n * - `half-open`: a single probe event is allowed through; `probing` marks that\n * the probe slot is taken so concurrent events still skip. A probe success\n * closes the breaker; a probe failure re-opens it with a fresh `openUntil`.\n *\n * `consecutiveFailures` is CONSECUTIVE, not cumulative: a single success\n * resets it, so only an unbroken run reaching the threshold opens the breaker.\n */\ninterface BreakerState {\n state: 'closed' | 'open' | 'half-open';\n consecutiveFailures: number;\n /** Epoch ms after which an open breaker admits a single probe. */\n openUntil?: number;\n /** True while a half-open probe is in flight (probe slot taken). */\n probing?: boolean;\n}\n/**\n * Core collector configuration interface\n */\ninterface Config$6 {\n /** Whether to run collector automatically */\n run?: boolean;\n /** Static global properties even on a new run */\n globalsStatic: Properties;\n /** Static session data even on a new run */\n sessionStatic: Partial<SessionData>;\n /** Logger configuration */\n logger?: Config$3;\n /**\n * Maximum number of events retained in `collector.queue` for late-registered\n * destination backfill. Overflow drops oldest (FIFO). Default 1000.\n */\n queueMax?: number;\n /** Flow name; keys this flow's entry in event.source.release and the observer flowId. */\n name?: string;\n /** Config release id stamped into event.source.release for this flow. */\n release?: string;\n}\n/**\n * Initialization configuration that extends Config with initial state\n */\ninterface InitConfig extends Partial<Config$6> {\n /** Initial consent state */\n consent?: Consent;\n /** Initial user data */\n user?: User;\n /** Initial global properties */\n globals?: Properties;\n /** Source configurations */\n sources?: InitSources;\n /** Destination configurations */\n destinations?: InitDestinations;\n /** Transformer configurations */\n transformers?: InitTransformers;\n /** Store configurations */\n stores?: InitStores;\n /** Initial custom properties */\n custom?: Properties;\n /** Hooks for pipeline observation and interception */\n hooks?: Functions;\n}\ninterface SessionData extends Properties {\n isStart: boolean;\n storage: boolean;\n id?: string;\n start?: number;\n marketing?: true;\n updated?: number;\n isNew?: boolean;\n device?: string;\n count?: number;\n runs?: number;\n}\ninterface Status {\n startedAt: number;\n in: number;\n out: number;\n failed: number;\n sources: Record<string, SourceStatus>;\n destinations: Record<string, DestinationStatus>;\n /**\n * Monotonic counts of events dropped due to buffer caps, keyed by\n * stepId. See `stepId()` for key construction.\n *\n * Examples:\n * - `dropped[\"collector\"]?.queue`: collector replay buffer drops\n * - `dropped[\"destination.ga4\"]?.queue`: ga4's consent-denied buffer drops\n * - `dropped[\"destination.ga4\"]?.dlq`: ga4's dead-letter queue drops\n */\n dropped: Record<string, DroppedCounters>;\n /**\n * Per-step circuit-breaker state, keyed by stepId. See `stepId()` for key\n * construction; keyed step-agnostically (NOT embedded in\n * `DestinationStatus`) so the breaker can guard any step kind, though\n * destinations are the primary use today. A breaker is created lazily on\n * first accounting and stays inert unless its step is configured with a\n * `breaker` (presence-gated): existing flows never trip a breaker.\n *\n * A runtime status field, not drift-guarded (it is observed, never authored\n * in a flow config).\n *\n * Example:\n * - `breakers[\"destination.bigquery\"]`: bigquery's consecutive-failure gate.\n */\n breakers: Record<string, BreakerState>;\n /**\n * Monotonic counts of out-of-band connection-level errors reported by a\n * step via `context.reportError(err)` with no event (an orphan error from\n * an EventEmitter SDK object's `'error'` handler), keyed by stepId. See\n * `stepId()` for key construction; mirrors `dropped`.\n *\n * Distinct from `failed`: `failed` counts events lost in-band (a push that\n * threw, a DLQ'd entry). `connectionErrors` counts connection faults that\n * did not lose a specific event at the moment they fired. Operators read\n * both: a rising `connectionErrors` with flat `failed` means a writer is\n * flapping but events are still landing; both rising means the fault is\n * now dropping events.\n *\n * Example:\n * - `connectionErrors[\"destination.bigquery\"]`: BigQuery stream writer\n * `'error'` events reported between pushes.\n */\n connectionErrors: Record<string, number>;\n}\ninterface SourceStatus {\n count: number;\n lastAt?: number;\n duration: number;\n}\ninterface DestinationStatus {\n count: number;\n failed: number;\n lastAt?: number;\n duration: number;\n /** Current size of the destination's queuePush buffer (point-in-time). */\n queuePushSize: number;\n /** Current size of the destination's DLQ (point-in-time). */\n dlqSize: number;\n /**\n * Number of events buffered in batch scheduler windows but not yet\n * delivered to `pushBatch`. Incremented on enqueue, decremented on\n * flush (whether the flush succeeds or fails). Operators read this\n * to spot batches that never drain.\n */\n inFlightBatch?: number;\n}\ninterface Sources {\n [id: string]: Instance$2;\n}\ninterface Destinations$1 {\n [id: string]: Instance$5;\n}\ninterface Transformers$1 {\n [id: string]: Instance$4;\n}\ninterface Stores$1 {\n [id: string]: Instance$1;\n}\ntype CommandType = 'action' | 'config' | 'consent' | 'context' | 'destination' | 'elb' | 'globals' | 'hook' | 'init' | 'link' | 'run' | 'user' | 'walker' | string;\n/**\n * Options passed to collector.push() from sources.\n * NOT a Context - just push metadata.\n */\ninterface PushOptions {\n id?: string;\n ingest?: Ingest;\n respond?: RespondFn;\n mapping?: Config$7;\n preChain?: string[];\n include?: string[];\n exclude?: string[];\n}\n/**\n * Push function signature - handles events only\n */\ninterface PushFn$1 {\n (event: DeepPartialEvent, options?: PushOptions): Promise<PushResult>;\n}\n/**\n * Command function signature - handles walker commands only\n */\ninterface CommandFn {\n (command: 'config', config: Partial<Config$6>): Promise<PushResult>;\n (command: 'consent', consent: Consent): Promise<PushResult>;\n <T extends Types$4>(command: 'destination', init: Init$3<T>): Promise<PushResult>;\n <K extends keyof Functions>(command: 'hook', init: {\n name: K;\n fn: Functions[K];\n }): Promise<PushResult>;\n (command: 'on', init: {\n type: Types$2;\n rules: SingleOrArray<Subscription>;\n }): Promise<PushResult>;\n (command: 'user', user: User): Promise<PushResult>;\n (command: 'run', runState?: {\n consent?: Consent;\n user?: User;\n globals?: Properties;\n custom?: Properties;\n }): Promise<PushResult>;\n (command: string, data?: unknown): Promise<PushResult>;\n}\n/**\n * Per-cascade tracking for the bounded recursion guard (see `Instance.cascade`).\n * `counts` maps a subscriber identity object to per-cell-type delivery counts\n * within one top-level command's cascade. A pair is stopped once its count\n * exceeds the guard's bound; the non-convergence error logs once per pair on the\n * crossing transition.\n */\ninterface Cascade {\n counts: WeakMap<object, Record<string, number>>;\n}\ninterface Instance$6 {\n push: PushFn$1;\n command: CommandFn;\n /** Flexible elb() adapter: routes `walker *` to command, events to push. */\n elb: Fn$3;\n allowed: boolean;\n config: Config$6;\n consent: Consent;\n custom: Properties;\n sources: Sources;\n destinations: Destinations$1;\n transformers: Transformers$1;\n stores: Stores$1;\n globals: Properties;\n hooks: Functions;\n /**\n * First-class observation channel. The runtime self-emits FlowState\n * records at canonical step sites (collector.push, destination.push,\n * destination.init, destination.pushBatch, destination consent skip,\n * transformer.push, store.get/set/delete, store cache HIT/MISS).\n * Observers run synchronously inside emitStep; thrown values are\n * swallowed. Subscribers add/remove via the standard Set API.\n */\n observers: Set<ObserverFn>;\n /**\n * Optional observation-level supplier installed by bundle codegen. Returns\n * the level currently active for this runtime. Absent means no capture. At\n * `trace` the per-event destination push wraps its env (via `wrapEnv`) to\n * record a destination's declared vendor `calls`; `off`/`standard` and\n * absence leave the push path untouched (zero added per-push cost).\n */\n observeLevel?: () => 'off' | 'standard' | 'trace';\n logger: Instance$3;\n on: OnConfig;\n queue: Events;\n round: number;\n /** Run-scoped W3C trace id, minted on each run and stamped onto events. */\n trace?: string;\n /** Static flow name; keys source.release and the observer flowId. */\n name?: string;\n /** Static config release id stamped into source.release for this flow. */\n release?: string;\n /** Per-run emission sequence; reset on each run, incremented per stamped event. */\n count: number;\n /**\n * Monotonic counter bumped on every accepted reactive-state mutation\n * (consent, user, globals, custom). Used for per-subscriber high-water-mark\n * dedup. Not bumped for non-reactive config changes.\n */\n stateVersion: number;\n /**\n * Per-cell change version: the `stateVersion` at which each state cell\n * (`consent`/`user`/`globals`/`custom`) last changed. Lets delivery dedup be\n * per-cell — a subscriber owed two cells at the same `stateVersion` receives\n * both, because each cell's freshness is tracked independently rather than\n * against the single global `stateVersion`. A missing entry reads as 0.\n */\n cellVersion: Record<string, number>;\n /**\n * Per-subscriber, per-cell high-water mark registry for exactly-once state\n * delivery. Keys are subscriber identity objects (a ConsentRule object, a\n * generic-fn, or a source instance); the inner record maps each state-cell\n * type (`consent`/`user`/`globals`/`custom`) to the `stateVersion` at which\n * that subscriber was last invoked FOR THAT CELL. A missing entry means never\n * delivered (sentinel \"-infinity\", read as -1). A subscriber is invoked for a\n * cell iff `stateVersion > mark[cell]` AND `allowed === true`.\n *\n * Per-cell (not a single scalar per subscriber) so a handler owed two\n * distinct cells at the same `stateVersion` — e.g. consent and user both\n * bumped before run — receives both at the run barrier instead of the first\n * delivery advancing one mark and swallowing the second cell's edge.\n */\n delivery: WeakMap<object, Record<string, number>>;\n /**\n * Transient per-cascade tracking for the bounded recursion guard. A\n * top-level state command creates this when it first enters the delivery\n * cascade and tears it down when it returns; nested commands emitted by\n * reacting callbacks reuse the same structure. It counts deliveries per\n * `(subscriber, cell-type)` so a cyclic cascade terminates (and logs once)\n * instead of recursing until stack overflow. `undefined` between top-level\n * commands. See `on.ts` `cascadeAllow`.\n *\n * This tracker, together with `stateVersion` and `delivery`, assumes top-level\n * state commands are processed serially on a given collector. Concurrent,\n * overlapping state commands on one shared collector are not supported (web is\n * serial; the server per-request path is event push, not state commands).\n */\n cascade?: Cascade;\n session: undefined | SessionData;\n status: Status;\n timing: number;\n user: User;\n pending: {\n destinations: InitDestinations;\n };\n /**\n * Set true on the first `shutdown` command, guarding re-entrancy: a second\n * `walker shutdown` must not re-run `destroyAllSteps` and double-close\n * writers, destinations, or stores. Subsequent shutdown commands no-op.\n * Initialized to `false` by the collector factory; absence (`undefined`)\n * is treated as \"not yet shut down\", so the first shutdown still runs.\n */\n hasShutdown?: boolean;\n /**\n * Every event type ever broadcast through `onApply` (state, lifecycle, and\n * arbitrary). Lets a `require:[<arbitrary>]` gate be satisfied by the current\n * recorded state for events that have no backing cell, including a broadcast\n * that fired before the requiring step registered.\n */\n seenEvents: Set<string>;\n}\n\ntype collector_BreakerState = BreakerState;\ntype collector_Cascade = Cascade;\ntype collector_CommandFn = CommandFn;\ntype collector_CommandType = CommandType;\ntype collector_DestinationStatus = DestinationStatus;\ntype collector_DroppedCounters = DroppedCounters;\ntype collector_InitConfig = InitConfig;\ntype collector_PushOptions = PushOptions;\ntype collector_SessionData = SessionData;\ntype collector_SourceStatus = SourceStatus;\ntype collector_Sources = Sources;\ntype collector_Status = Status;\ntype collector_StepKind = StepKind;\ndeclare const collector_stepId: typeof stepId;\ndeclare namespace collector {\n export { type collector_BreakerState as BreakerState, type collector_Cascade as Cascade, type collector_CommandFn as CommandFn, type collector_CommandType as CommandType, type Config$6 as Config, type collector_DestinationStatus as DestinationStatus, type Destinations$1 as Destinations, type collector_DroppedCounters as DroppedCounters, type collector_InitConfig as InitConfig, type Instance$6 as Instance, type PushFn$1 as PushFn, type collector_PushOptions as PushOptions, type collector_SessionData as SessionData, type collector_SourceStatus as SourceStatus, type collector_Sources as Sources, type collector_Status as Status, type collector_StepKind as StepKind, type Stores$1 as Stores, type Transformers$1 as Transformers, collector_stepId as stepId };\n}\n\n/**\n * Base context interface for walkerOS stages.\n * Sources, Transformers, and Destinations extend this.\n */\ninterface Base<C = unknown, E = unknown> {\n collector: Instance$6;\n logger: Instance$3;\n config: C;\n env: E;\n /**\n * Out-of-band error seam available to every step kind (source,\n * transformer, store, destination). A step that owns an EventEmitter SDK\n * object (BigQuery `StreamConnection`, a Redis client, a Kafka producer)\n * calls this from the object's `'error'` handler, where there is no\n * surrounding `await`/`tryCatchAsync` to catch into and an unhandled\n * `'error'` would otherwise crash the process on a detached tick.\n *\n * MUST NOT throw (it runs on a detached emitter tick; a throw inside it\n * would reintroduce the uncaughtException it exists to prevent).\n *\n * - With `event`: routes that event through the same per-step failure\n * accounting an in-band push failure uses (the destination DLQ + the\n * `failed` counters), so a connection error that loses a specific event\n * is counted and surfaced exactly like a synchronous push failure.\n * - Without `event` (an orphan / connection-level error, e.g. a stream\n * writer that errored between pushes): a contained `logger.error` plus a\n * bump of `Status.connectionErrors[stepId]`. It does NOT bump\n * `Status.failed` (no event was lost at this instant; the next push that\n * hits the broken writer is what gets DLQ'd and counted as failed, so\n * counting the orphan against `failed` would double-count).\n */\n reportError?(err: unknown, event?: Event): void;\n}\n\ntype context_Base<C = unknown, E = unknown> = Base<C, E>;\ndeclare namespace context {\n export type { context_Base as Base };\n}\n\n/**\n * Shared credentials types for steps that authenticate against an external\n * service. A step's `Types['credentials']` points at one of these (or its own\n * shape). The value resolves like any other config field; back it with a\n * managed secret via `$secret.NAME` (credentials, tokens, and private keys\n * must use `$secret`, not `$env`, so the deploy pipeline injects them).\n */\n/**\n * Google-style service account credentials. The common shape for GCP-family\n * packages (Pub/Sub, Sheets, GCS, DataManager). `project_id` is optional\n * because some clients derive it from the runtime environment.\n */\ninterface ServiceAccount {\n client_email: string;\n private_key: string;\n project_id?: string;\n}\n/**\n * A credential value: either a JSON string (often a `$secret.NAME` reference to\n * a managed secret) or the already-parsed object form `T`.\n */\ntype Credential<T> = string | T;\n\n/**\n * Declarative store operation. Replaces `$code:` for simple fetch/stash.\n * key = store side, value = event side, mode = direction.\n */\ninterface State {\n /** Direction. 'delete' is reserved for a later release. */\n mode: 'get' | 'set';\n /** Store id; defaults to the in-memory `__cache` store when omitted. */\n store?: string;\n /** Resolves against the event to the store key. */\n key: Value;\n /**\n * set: resolves to the payload to store.\n * get: its `key`/bare-string path is the event write-target.\n * Optional at the type level to keep a future `delete` mode non-breaking;\n * validation requires it for get/set.\n */\n value?: Value;\n}\n\n/**\n * Shared context for one-shot lifecycle hooks (setup, destroy).\n * No event pipeline machinery — just config, env, logger, and id.\n */\ninterface LifecycleContext<C = unknown, E = unknown> {\n id: string;\n config: C;\n env: E;\n logger: Instance$3;\n}\n/**\n * Setup function signature. Called once via `walkeros setup <kind>.<name>`.\n * Packages own idempotency and error semantics. Return value (if any) is\n * JSON-stringified to stdout by the CLI for scripting use.\n */\ntype SetupFn<C = unknown, E = unknown> = (context: LifecycleContext<C, E>) => PromiseOrValue<unknown>;\n/**\n * Destroy function signature for step lifecycle cleanup.\n */\ntype DestroyFn<C = unknown, E = unknown> = (context: LifecycleContext<C, E>) => PromiseOrValue<void>;\n/**\n * @deprecated Use `LifecycleContext` instead. Kept as alias for one minor cycle.\n */\ntype DestroyContext<C = unknown, E = unknown> = LifecycleContext<C, E>;\n\ntype lifecycle_DestroyContext<C = unknown, E = unknown> = DestroyContext<C, E>;\ntype lifecycle_DestroyFn<C = unknown, E = unknown> = DestroyFn<C, E>;\ntype lifecycle_LifecycleContext<C = unknown, E = unknown> = LifecycleContext<C, E>;\ntype lifecycle_SetupFn<C = unknown, E = unknown> = SetupFn<C, E>;\ndeclare namespace lifecycle {\n export type { lifecycle_DestroyContext as DestroyContext, lifecycle_DestroyFn as DestroyFn, lifecycle_LifecycleContext as LifecycleContext, lifecycle_SetupFn as SetupFn };\n}\n\n/**\n * Base environment requirements interface for walkerOS destinations\n *\n * This defines the core interface that destinations can use to declare\n * their runtime environment requirements. Platform-specific extensions\n * should extend this interface.\n */\ninterface BaseEnv$3 {\n /**\n * Generic global properties that destinations may require\n * Platform-specific implementations can extend this interface\n */\n [key: string]: unknown;\n}\n/**\n * Observe-mode call recorder injected into a per-push env (under the runtime\n * `OBSERVE_ENV_KEY`) for vendor-call paths that could NOT be resolved at wrap\n * time (root or leaf missing, e.g. a live-web global not yet installed). The\n * resolution-point wrapper (web-core `getEnv`) reads this, wraps the matching\n * globals via a transparent Proxy, and forwards each intercepted call to\n * `record`. The key is stripped before the env reaches the destination.\n */\ninterface EnvObserve {\n /**\n * Dot-paths to intercept, with any `call:` prefix already stripped (as\n * `parseCallPath` returns them). Each is a `root.leaf` chain resolved against\n * the merged env.\n */\n paths: string[];\n /**\n * Appends one recorded invocation. `fn` is the full intercepted dot-path,\n * `args` the call arguments. Implementations push onto the shared `calls`\n * array that backs the destination out record.\n */\n record: (fn: string, args: unknown[]) => void;\n}\n/**\n * Type bundle for destination generics.\n * Groups Settings, InitSettings, Mapping, Env, and Setup into a single type parameter.\n */\ninterface Types$4<S = unknown, M = unknown, E = BaseEnv$3, I = S, U = unknown, C = unknown> {\n settings: S;\n initSettings: I;\n mapping: M;\n env: E;\n setup: U;\n credentials: C;\n}\n/**\n * Generic constraint for Types - ensures T has required properties for indexed access\n */\ntype TypesGeneric$3 = {\n settings: any;\n initSettings: any;\n mapping: any;\n env: any;\n setup: any;\n credentials: any;\n};\n/**\n * Type extractors for consistent usage with Types bundle\n */\ntype Settings$3<T extends TypesGeneric$3 = Types$4> = T['settings'];\ntype InitSettings$3<T extends TypesGeneric$3 = Types$4> = T['initSettings'];\ntype Mapping$1<T extends TypesGeneric$3 = Types$4> = T['mapping'];\ntype Env$3<T extends TypesGeneric$3 = Types$4> = T['env'];\ntype SetupOptions$2<T extends TypesGeneric$3 = Types$4> = T['setup'];\ntype Credentials$2<T extends TypesGeneric$3 = Types$4> = T['credentials'];\n/**\n * Inference helper: Extract Types from Instance\n */\ntype TypesOf$3<I> = I extends Instance$5<infer T> ? T : never;\ninterface Instance$5<T extends TypesGeneric$3 = Types$4> {\n config: Config$5<T>;\n queuePush?: Events;\n queueOn?: Array<{\n type: Types$2;\n data?: unknown;\n }>;\n dlq?: DLQ;\n batches?: BatchRegistry<Mapping$1<T>>;\n type?: string;\n /**\n * Observable env callables for trace-level vendor-call capture. Dot-paths of\n * the functions this destination invokes on its env, using the same grammar\n * as the dev-env `simulation` lists (incl. an optional `call:` prefix), e.g.\n * `['call:window.gtag']`. When present AND the collector reports trace level,\n * the per-event push env is wrapped (via `wrapEnv`) so each listed call is\n * recorded onto the destination out record. Absent or empty = no capture.\n */\n calls?: string[];\n env?: Env$3<T>;\n setup?: SetupFn<Config$5<T>, Env$3<T>>;\n init?: InitFn$2<T>;\n push: PushFn<T>;\n pushBatch?: PushBatchFn<T>;\n on?: OnFn;\n destroy?: DestroyFn<Config$5<T>, Env$3<T>>;\n}\ninterface Config$5<T extends TypesGeneric$3 = Types$4> {\n /** Required consent states to push events; queues events when not granted. */\n consent?: Consent;\n /** Implementation-specific configuration passed to the init function. */\n settings?: InitSettings$3<T>;\n /**\n * Optional, strictly-typed credentials slot. Back it with a managed secret\n * via `$secret.NAME` (credentials use `$secret`, not `$env`). The package\n * defines the shape via `Types['credentials']`. `settings.<sdk>` stays the\n * escape hatch for raw SDK options.\n */\n credentials?: Credentials$2<T>;\n /** Global data transformation applied to all events; result passed as context.data to push. */\n data?: Value | Values;\n /** Event sections to flatten into context.data. */\n include?: string[];\n /** Runtime dependencies merged from code and config env; extensible per destination. */\n env?: Env$3<T>;\n /** Destination identifier; auto-generated if not provided. */\n id?: string;\n /** Whether the destination has been initialized; prevents re-initialization. */\n init?: boolean;\n /** Whether to load external scripts (e.g., gtag.js); destination-specific behavior. */\n loadScript?: boolean;\n /** Logger configuration (level, handler) to override the collector's defaults. */\n logger?: Config$3;\n /** Entity-action rules to filter, rename, transform, and batch events for this destination. */\n mapping?: Rules<Rule<Mapping$1<T>>>;\n /** Pre-processing rules applied to all events before mapping; modifies events in-place. */\n policy?: Policy;\n /** Whether to queue events when consent is not granted; defaults to true. */\n queue?: boolean;\n /** Defer destination initialization until these collector events fire (e.g., `['consent']`). */\n require?: string[];\n /**\n * Provisioning options for `walkeros setup`. `boolean | object`.\n * Triggered only by explicit CLI invocation; never automatic.\n */\n setup?: boolean | SetupOptions$2<T>;\n /** Transformer chain to run after collector processing but before this destination. */\n before?: Route;\n /** Transformer chain to run after destination push completes. Push response available at ingest._response. */\n next?: Route;\n /** Cache configuration for deduplication (step-level: skip push on HIT). */\n cache?: Cache;\n /** Declarative store get/set operations applied around this destination. */\n state?: State | State[];\n /** Completely skip this destination — no init, no push, no queuing. */\n disabled?: boolean;\n /**\n * Per-destination delivery timeout in ms (default 10000); a delivery that\n * does not settle within this window is routed to the DLQ like a thrown push.\n */\n timeout?: number;\n /** Return this value instead of calling push(). Uses !== undefined check to support falsy values. */\n mock?: unknown;\n /**\n * Maximum number of consent-denied events retained in `queuePush` for\n * this destination. Overflow drops oldest (FIFO). Default 1000.\n */\n queueMax?: number;\n /**\n * Maximum number of failed-push entries retained in `dlq` for this\n * destination. Overflow drops oldest (FIFO). Default 100.\n */\n dlqMax?: number;\n /**\n * Enables batching for ALL of this destination's events into one shared\n * default buffer. A mapping rule's own `batch` splits that entity-action\n * into its own buffer and overrides per field (`rule ?? config ?? default`).\n * Batching stays off when neither is set. A bare number is treated as the\n * debounce `wait` window.\n *\n * - `wait`: debounce window in ms; the timer resets on every push.\n * - `size`: hard count cap; flush immediately when entries reach this number. Default 1000 when batching is enabled.\n * - `age`: time since the first entry of the current window. Forces a flush even if pushes keep arriving. Default 30000 (30s).\n */\n batch?: number | BatchOptions;\n /**\n * Per-destination circuit breaker. Presence-gated: when unset the breaker is\n * inert and behavior is unchanged. After `threshold` CONSECUTIVE transport\n * failures (a thrown push, a timed-out push, a whole-batch throw, a\n * connection-level `reportError(err, event)`) the breaker opens and events\n * are skipped (counted, not pushed) until `cooldown` ms elapse, then a single\n * probe event is allowed; its success closes the breaker, its failure\n * re-opens it. Partial-batch row failures are breaker-neutral. A bare number\n * is the `threshold`.\n *\n * - `threshold`: consecutive transport failures before opening. Default 5.\n * - `cooldown`: ms an open breaker waits before admitting a probe. Default 30000.\n */\n breaker?: number | BreakerOptions;\n}\n/**\n * Circuit-breaker tuning. Used at the destination-config layer\n * (`Destination.Config.breaker`). A bare number is treated as `threshold`.\n */\ninterface BreakerOptions {\n /** Consecutive transport failures before the breaker opens. Default 5. */\n threshold?: number;\n /** Milliseconds an open breaker waits before admitting a probe. Default 30000. */\n cooldown?: number;\n}\n/**\n * Batch scheduling options. Used at both the mapping-rule layer\n * (`Mapping.Rule.batch`) and the destination-config layer\n * (`Destination.Config.batch`). Same shape at both layers.\n */\ninterface BatchOptions {\n /** Debounce window in ms. Timer resets on every push. */\n wait?: number;\n /** Hard count cap. Flushes immediately at this size. */\n size?: number;\n /** Hard age cap in ms since first entry of current window. */\n age?: number;\n}\ntype PartialConfig$2<T extends TypesGeneric$3 = Types$4> = Config$5<Types$4<Partial<Settings$3<T>> | Settings$3<T>, Partial<Mapping$1<T>> | Mapping$1<T>, Env$3<T>, InitSettings$3<T>, SetupOptions$2<T>, Credentials$2<T>>>;\ninterface Policy {\n [key: string]: Value;\n}\ntype Code$1<T extends TypesGeneric$3 = Types$4> = Instance$5<T>;\ntype Init$3<T extends TypesGeneric$3 = Types$4> = {\n code: Code$1<T>;\n config?: Partial<Config$5<T>>;\n env?: Partial<Env$3<T>>;\n before?: Route;\n next?: Route;\n cache?: Cache;\n state?: State | State[];\n};\ninterface InitDestinations {\n [key: string]: Init$3<any>;\n}\ninterface Destinations {\n [key: string]: Instance$5;\n}\n/**\n * Context provided to destination functions.\n * Extends base context with destination-specific properties.\n */\ninterface Context$5<T extends TypesGeneric$3 = Types$4> extends Base<Config$5<T>, Env$3<T>> {\n id: string;\n data?: Data;\n}\ninterface PushContext<T extends TypesGeneric$3 = Types$4> extends Context$5<T> {\n ingest: Ingest;\n rule?: Rule<Mapping$1<T>>;\n}\ninterface PushBatchContext<T extends TypesGeneric$3 = Types$4> extends Context$5<T> {\n ingest: Ingest;\n rule?: Rule<Mapping$1<T>>;\n}\ntype InitFn$2<T extends TypesGeneric$3 = Types$4> = (context: Context$5<T>) => PromiseOrValue<void | false | Config$5<T>>;\ntype PushFn<T extends TypesGeneric$3 = Types$4> = (event: Event, context: PushContext<T>) => PromiseOrValue<void | unknown>;\n/**\n * Per-row outcome for a single failed batch entry.\n *\n * `index` is the position into the flushed batch's `entries` array (the same\n * order `flushBatch` iterates), so the collector can route exactly that entry\n * to the DLQ. `error` is the per-row failure carried into the DLQ pair; when\n * omitted the collector substitutes a generic batch error.\n */\ninterface BatchFailure {\n index: number;\n error?: unknown;\n}\n/**\n * Partial-failure result of a `pushBatch` call.\n *\n * `failed` lists the entries (by index into the flushed batch's `entries`\n * array) that did NOT succeed. Every other entry is treated as delivered.\n */\ninterface BatchOutcome {\n failed: BatchFailure[];\n}\n/**\n * Pushes a batch of events to a destination.\n *\n * Return contract (backward-compatible, additive):\n * - Resolve `void` (the historical contract): the WHOLE batch succeeded. The\n * collector counts every entry as delivered.\n * - Throw / reject: the WHOLE batch failed. The collector routes every entry\n * to the DLQ and increments `failed` by the batch size. Unchanged.\n * - Resolve a `BatchOutcome`: PARTIAL failure. Only the entries listed in\n * `outcome.failed` (by `index` into the flushed `entries` array) are routed\n * to the DLQ and counted as failed, each with its own `error`. The remaining\n * entries are counted as delivered. This lets a destination report row-level\n * failures without forcing already-succeeded rows onto the DLQ, which would\n * duplicate them on a later DLQ retry.\n *\n * Indices in `failed` must line up with the order of `batch.entries`.\n */\ntype PushBatchFn<T extends TypesGeneric$3 = Types$4> = (batch: Batch<Mapping$1<T>>, context: PushBatchContext<T>) => PromiseOrValue<void | BatchOutcome>;\ntype PushEvent<Mapping = unknown> = {\n event: Event;\n mapping?: Rule<Mapping>;\n};\ntype PushEvents<Mapping = unknown> = Array<PushEvent<Mapping>>;\ninterface BatchEntry<Mapping = unknown> {\n event: Event;\n ingest?: Ingest;\n respond?: RespondFn;\n rule?: Rule<Mapping>;\n data?: Data;\n}\ninterface Batch<Mapping> {\n key: string;\n /**\n * Per-event entries carrying per-event ingest, respond, rule, and data.\n * Destinations needing per-event metadata should read this instead of\n * (or in addition to) `events` and `data`.\n */\n entries: BatchEntry<Mapping>[];\n /** Derived view: events from `entries`. Kept for back-compat. */\n events: Events;\n /** Derived view: data from `entries`. Kept for back-compat. */\n data: Array<Data>;\n mapping?: Rule<Mapping>;\n}\ninterface BatchRegistry<Mapping> {\n [mappingKey: string]: {\n batched: Batch<Mapping>;\n /**\n * Marks a buffer created by `config.batch` (the destination-wide default\n * batch) rather than a mapping rule's own `batch`. The default buffer is\n * heterogeneous, so its flush reports `rule: undefined` to consumers.\n */\n isDefault?: boolean;\n batchFn: () => void;\n /**\n * Force a flush of the current batch immediately. Used by shutdown\n * drain and by tests for deterministic flushing without timer\n * advancement. Resolves after the underlying `pushBatch` settles.\n */\n flush: () => Promise<void>;\n };\n}\ntype Data = Property | undefined | Array<Property | undefined>;\ninterface Ref {\n type: string;\n data?: unknown;\n error?: unknown;\n}\ntype Push$1 = {\n queuePush?: Events;\n error?: unknown;\n};\ntype DLQ = Array<[Event, unknown]>;\n/**\n * Typed accessor for destinations registered on a collector.\n *\n * The collector's `destinations` bag indexes to `Destination.Instance`\n * (defaults erase the generic). Use this helper at the call site to recover\n * the narrow type without casts.\n *\n * @example\n * type MyDestTypes = Destination.Types<MySettings, MyMapping>;\n * const dest = getDestination<MyDestTypes>(collector, 'myDest');\n * await dest.push(event, context);\n *\n * @throws Error with message `Destination not found: <id>` when the id is unknown.\n */\ndeclare function getDestination<T extends TypesGeneric$3 = Types$4>(collector: {\n destinations: {\n [id: string]: Instance$5<any>;\n };\n}, id: string): Instance$5<T>;\n\ntype destination_Batch<Mapping> = Batch<Mapping>;\ntype destination_BatchEntry<Mapping = unknown> = BatchEntry<Mapping>;\ntype destination_BatchFailure = BatchFailure;\ntype destination_BatchOptions = BatchOptions;\ntype destination_BatchOutcome = BatchOutcome;\ntype destination_BatchRegistry<Mapping> = BatchRegistry<Mapping>;\ntype destination_BreakerOptions = BreakerOptions;\ntype destination_DLQ = DLQ;\ntype destination_Data = Data;\ntype destination_Destinations = Destinations;\ntype destination_EnvObserve = EnvObserve;\ntype destination_InitDestinations = InitDestinations;\ntype destination_Policy = Policy;\ntype destination_PushBatchContext<T extends TypesGeneric$3 = Types$4> = PushBatchContext<T>;\ntype destination_PushBatchFn<T extends TypesGeneric$3 = Types$4> = PushBatchFn<T>;\ntype destination_PushContext<T extends TypesGeneric$3 = Types$4> = PushContext<T>;\ntype destination_PushEvent<Mapping = unknown> = PushEvent<Mapping>;\ntype destination_PushEvents<Mapping = unknown> = PushEvents<Mapping>;\ntype destination_PushFn<T extends TypesGeneric$3 = Types$4> = PushFn<T>;\ntype destination_Ref = Ref;\ndeclare const destination_getDestination: typeof getDestination;\ndeclare namespace destination {\n export { type BaseEnv$3 as BaseEnv, type destination_Batch as Batch, type destination_BatchEntry as BatchEntry, type destination_BatchFailure as BatchFailure, type destination_BatchOptions as BatchOptions, type destination_BatchOutcome as BatchOutcome, type destination_BatchRegistry as BatchRegistry, type destination_BreakerOptions as BreakerOptions, type Code$1 as Code, type Config$5 as Config, type Context$5 as Context, type Credentials$2 as Credentials, type destination_DLQ as DLQ, type destination_Data as Data, type destination_Destinations as Destinations, type Env$3 as Env, type destination_EnvObserve as EnvObserve, type Init$3 as Init, type destination_InitDestinations as InitDestinations, type InitFn$2 as InitFn, type InitSettings$3 as InitSettings, type Instance$5 as Instance, type Mapping$1 as Mapping, type PartialConfig$2 as PartialConfig, type destination_Policy as Policy, type Push$1 as Push, type destination_PushBatchContext as PushBatchContext, type destination_PushBatchFn as PushBatchFn, type destination_PushContext as PushContext, type destination_PushEvent as PushEvent, type destination_PushEvents as PushEvents, type destination_PushFn as PushFn, type destination_Ref as Ref, type Settings$3 as Settings, type SetupOptions$2 as SetupOptions, type Types$4 as Types, type TypesGeneric$3 as TypesGeneric, type TypesOf$3 as TypesOf, destination_getDestination as getDestination };\n}\n\ninterface EventFn<R = Promise<PushResult>> {\n (partialEvent: DeepPartialEvent): R;\n (event: string): R;\n (event: string, data: Properties): R;\n}\ninterface Fn$3<R = Promise<PushResult>, Config = unknown> extends EventFn<R>, WalkerCommands<R, Config> {\n}\ninterface WalkerCommands<R = Promise<PushResult>, Config = unknown> {\n (event: 'walker config', config: Partial<Config>): R;\n (event: 'walker consent', consent: Consent): R;\n <T extends Types$4>(event: 'walker destination', init: Init$3<T>): R;\n <K extends keyof Functions>(event: 'walker hook', init: {\n name: K;\n fn: Functions[K];\n }): R;\n (event: 'walker on', init: {\n type: Types$2;\n rules: SingleOrArray<Subscription>;\n }): R;\n (event: 'walker user', user: User): R;\n (event: 'walker run', runState?: {\n consent?: Consent;\n user?: User;\n globals?: Properties;\n custom?: Properties;\n }): R;\n}\ntype Event$1<R = Promise<PushResult>> = (partialEvent: DeepPartialEvent) => R;\ntype PushData<Config = unknown> = DeepPartial<Config> | Consent | User | Properties;\ninterface PushResult {\n ok: boolean;\n event?: Event;\n done?: Record<string, Ref>;\n queued?: Record<string, Ref>;\n failed?: Record<string, Ref>;\n /** Event was intentionally not forwarded: a transformer chain stopped it. */\n dropped?: boolean;\n}\ntype Layer = Array<IArguments | DeepPartialEvent | unknown[]>;\n\ntype elb_EventFn<R = Promise<PushResult>> = EventFn<R>;\ntype elb_Layer = Layer;\ntype elb_PushData<Config = unknown> = PushData<Config>;\ntype elb_PushResult = PushResult;\ntype elb_WalkerCommands<R = Promise<PushResult>, Config = unknown> = WalkerCommands<R, Config>;\ndeclare namespace elb {\n export type { Event$1 as Event, elb_EventFn as EventFn, Fn$3 as Fn, elb_Layer as Layer, elb_PushData as PushData, elb_PushResult as PushResult, elb_WalkerCommands as WalkerCommands };\n}\n\n/**\n * Unified route grammar for Flow v4. A `Route` is one of:\n * - a transformer ID string (`\"redact\"`)\n * - a sequence of routes (`[\"a\", \"b\", \"c\"]` — sugar for chained `.next`)\n * - a `RouteConfig` — a gated / dispatching node.\n *\n * `RouteConfig` is a disjoint union — set exactly one of `next`, `one`,\n * `many`, or neither (pure gate). The disjointness is enforced by `never`\n * sibling properties at the type level and `z.strictObject` at the schema\n * level.\n *\n * Operators:\n * - `next`: single continuation.\n * - `one`: first-match dispatch (walk entries, first whose match passes wins).\n * - `many`: all-match terminal fan-out (every matching entry spawns an\n * independent flow; main chain terminates here). Restricted to\n * pre-collector positions (source.next, transformer.next, transformer.before).\n */\ntype Route = string | Route[] | RouteConfig;\ntype RouteConfig = RouteNextConfig | RouteOneConfig | RouteManyConfig | RouteGateConfig;\ninterface RouteNextConfig {\n match?: MatchExpression;\n next: Route;\n one?: never;\n many?: never;\n}\ninterface RouteOneConfig {\n match?: MatchExpression;\n one: Route[];\n next?: never;\n many?: never;\n}\ninterface RouteManyConfig {\n match?: MatchExpression;\n many: Route[];\n next?: never;\n one?: never;\n}\ninterface RouteGateConfig {\n match: MatchExpression;\n next?: never;\n one?: never;\n many?: never;\n}\n/**\n * Base environment interface for walkerOS transformers.\n *\n * Minimal like Destination - just an extensible object.\n * Transformers receive dependencies through context, not env.\n */\ninterface BaseEnv$2 {\n [key: string]: unknown;\n}\n/**\n * Type bundle for transformer generics.\n * Groups Settings, InitSettings, and Env into a single type parameter.\n * Follows the Source/Destination pattern.\n *\n * @template S - Settings configuration type\n * @template E - Environment type\n * @template I - InitSettings configuration type (user input)\n */\ninterface Types$3<S = unknown, E = BaseEnv$2, I = S> {\n settings: S;\n initSettings: I;\n env: E;\n}\n/**\n * Generic constraint for Types - ensures T has required properties for indexed access.\n */\ntype TypesGeneric$2 = {\n settings: any;\n initSettings: any;\n env: any;\n};\n/**\n * Type extractors for consistent usage with Types bundle.\n */\ntype Settings$2<T extends TypesGeneric$2 = Types$3> = T['settings'];\ntype InitSettings$2<T extends TypesGeneric$2 = Types$3> = T['initSettings'];\ntype Env$2<T extends TypesGeneric$2 = Types$3> = T['env'];\n/**\n * Inference helper: Extract Types from Instance.\n */\ntype TypesOf$2<I> = I extends Instance$4<infer T> ? T : never;\n/**\n * Transformer configuration.\n */\ninterface Config$4<T extends TypesGeneric$2 = Types$3> {\n settings?: InitSettings$2<T>;\n env?: Env$2<T>;\n id?: string;\n logger?: Config$3;\n before?: Route;\n next?: Route;\n cache?: Cache;\n /** Declarative store get/set operations applied around this transformer. */\n state?: State | State[];\n init?: boolean;\n disabled?: boolean;\n /** Return this value instead of calling push(). Global mock for all chains. */\n mock?: unknown;\n /** Path-specific mock values keyed by chain path (e.g., \"destination.ga4.before\"). Takes precedence over global mock. */\n chainMocks?: Record<string, unknown>;\n /**\n * Declarative event-to-event mapping applied when this transformer step\n * has no `code`. Same field name as on `Destination.Config`, but the\n * semantic differs by position: on a destination, `mapping` produces a\n * vendor-shaped payload; on a transformer step, it mutates the event\n * itself. The collector synthesizes a push that runs\n * `processEventMapping` and returns the transformed event (or drops it\n * when a rule has `ignore: true`).\n *\n * At the transformer position, only event-mutating fields apply:\n * `policy`, `mapping[].policy`, `mapping[].name`, `mapping[].ignore`,\n * `mapping[].consent`, `include`. Vendor-payload fields (`data`,\n * `mapping[].data`, `silent`) are ignored at this position with a\n * one-time warning.\n */\n mapping?: Config$7;\n}\n/**\n * Context provided to transformer functions.\n * Extends base context with transformer-specific properties.\n */\ninterface Context$4<T extends TypesGeneric$2 = Types$3> extends Base<Config$4<T>, Env$2<T>> {\n id: string;\n ingest: Ingest;\n}\n/**\n * Unified result type for transformer functions.\n * Replaces the old union return type with a structured object.\n *\n * @field event - Modified event to continue with\n * @field respond - Wrapped respond function for downstream transformers\n * @field next - Branch to a different chain (replaces BranchResult)\n */\ninterface Result$1<E = DeepPartialEvent> {\n event?: E;\n respond?: RespondFn;\n next?: Route;\n}\n/**\n * Result of running a transformer chain.\n * Returns the processed event (singular, fan-out array, or null if dropped)\n * alongside the potentially wrapped respond function.\n *\n * `stopped` signals pipeline-halt — when set, the caller MUST NOT propagate\n * the event further downstream (no destinations, no subsequent chains).\n * Used by `cache.stop: true` on pre-collector transformers so the documented\n * \"downstream transformers and destinations are skipped\" semantic holds.\n */\ninterface ChainResult {\n event: DeepPartialEvent | DeepPartialEvent[] | null;\n respond?: RespondFn;\n stopped?: true;\n /** Transformer that stopped the chain (returned false or threw). */\n droppedBy?: string;\n}\n/**\n * The main transformer function.\n *\n * Pre-collector transformers use default E = DeepPartialEvent.\n * Post-collector transformers can use E = Event for type-safe access.\n * A transformer written for DeepPartialEvent works in both positions\n * because Event is a subtype of DeepPartialEvent.\n *\n * @returns Result - structured result with event, respond, next\n * @returns Result[] - fan-out: each Result continues independently through remaining chain\n * @returns void - continue with current event unchanged (passthrough)\n * @returns false - stop chain, cancel further processing\n */\ntype Fn$2<T extends TypesGeneric$2 = Types$3, E = DeepPartialEvent> = (event: E, context: Context$4<T>) => PromiseOrValue<Result$1<E> | Result$1<E>[] | false | void>;\n/**\n * Optional initialization function.\n * Called once before first push.\n *\n * @param context - Transformer context\n * @returns void - initialization successful\n * @returns false - initialization failed, skip this transformer\n * @returns Config<T> - return updated config\n */\ntype InitFn$1<T extends TypesGeneric$2 = Types$3> = (context: Context$4<T>) => PromiseOrValue<void | false | Config$4<T>>;\n/**\n * Transformer instance returned by Init function.\n */\ninterface Instance$4<T extends TypesGeneric$2 = Types$3> {\n type: string;\n config: Config$4<T>;\n push: Fn$2<T>;\n init?: InitFn$1<T>;\n destroy?: DestroyFn<Config$4<T>, Env$2<T>>;\n}\n/**\n * Transformer initialization function.\n * Creates a transformer instance from context.\n */\ntype Init$2<T extends TypesGeneric$2 = Types$3> = (context: Context$4<Types$3<Partial<Settings$2<T>>, Env$2<T>, InitSettings$2<T>>>) => Instance$4<T> | Promise<Instance$4<T>>;\n/**\n * Configuration for initializing a transformer.\n * Used in collector registration.\n */\ntype InitTransformer<T extends TypesGeneric$2 = Types$3> = {\n /**\n * Initialization function. When omitted, the entry is a pass-through step:\n * - If `mapping` is present, the collector synthesizes a mapping-only\n * push using `processEventMapping`.\n * - Otherwise it's a named hop that only hosts a `before` / `next` /\n * `cache` chain.\n *\n * Validation: an entry without `code` must declare at least one of\n * `package`, `before`, `next`, `cache`, `state`, `mapping`. Enforced by\n * `validateStepEntry` in `@walkeros/core`.\n */\n code?: Init$2<T>;\n config?: Partial<Config$4<T>>;\n env?: Partial<Env$2<T>>;\n before?: Route;\n next?: Route;\n cache?: Cache;\n state?: State | State[];\n mapping?: Config$7;\n};\n/**\n * Transformers configuration for collector.\n * Maps transformer IDs to their initialization configurations.\n */\ninterface InitTransformers {\n [transformerId: string]: InitTransformer<any>;\n}\n/**\n * Active transformer instances registry.\n */\ninterface Transformers {\n [transformerId: string]: Instance$4;\n}\n/**\n * Typed accessor for transformers registered on a collector.\n *\n * The collector's `transformers` bag indexes to `Transformer.Instance`\n * (defaults erase the generic). Use this helper at the call site to recover\n * the narrow type without casts.\n *\n * @example\n * type MyTransformerTypes = Transformer.Types<MySettings>;\n * const tx = getTransformer<MyTransformerTypes>(collector, 'redact');\n * await tx.push(event, context);\n *\n * @throws Error with message `Transformer not found: <id>` when the id is unknown.\n */\ndeclare function getTransformer<T extends TypesGeneric$2 = Types$3>(collector: {\n transformers: {\n [id: string]: Instance$4<any>;\n };\n}, id: string): Instance$4<T>;\n\ntype transformer_ChainResult = ChainResult;\ntype transformer_InitTransformer<T extends TypesGeneric$2 = Types$3> = InitTransformer<T>;\ntype transformer_InitTransformers = InitTransformers;\ntype transformer_Route = Route;\ntype transformer_RouteConfig = RouteConfig;\ntype transformer_RouteGateConfig = RouteGateConfig;\ntype transformer_RouteManyConfig = RouteManyConfig;\ntype transformer_RouteNextConfig = RouteNextConfig;\ntype transformer_RouteOneConfig = RouteOneConfig;\ntype transformer_Transformers = Transformers;\ndeclare const transformer_getTransformer: typeof getTransformer;\ndeclare namespace transformer {\n export { type BaseEnv$2 as BaseEnv, type transformer_ChainResult as ChainResult, type Config$4 as Config, type Context$4 as Context, type Env$2 as Env, type Fn$2 as Fn, type Init$2 as Init, type InitFn$1 as InitFn, type InitSettings$2 as InitSettings, type transformer_InitTransformer as InitTransformer, type transformer_InitTransformers as InitTransformers, type Instance$4 as Instance, type Result$1 as Result, type transformer_Route as Route, type transformer_RouteConfig as RouteConfig, type transformer_RouteGateConfig as RouteGateConfig, type transformer_RouteManyConfig as RouteManyConfig, type transformer_RouteNextConfig as RouteNextConfig, type transformer_RouteOneConfig as RouteOneConfig, type Settings$2 as Settings, type transformer_Transformers as Transformers, type Types$3 as Types, type TypesGeneric$2 as TypesGeneric, type TypesOf$2 as TypesOf, transformer_getTransformer as getTransformer };\n}\n\n/**\n * Structural JSON Schema type. Kept dep-free (no `ajv` import in core)\n * so the runtime graph of any consumer of `@walkeros/core` does not pull\n * AJV transitively.\n */\ntype JsonSchema = Record<string, unknown>;\n/**\n * Entity-action keyed event validation schemas.\n * Wildcard fallback semantic: entity.action → entity.* → *.action → *.*.\n */\ntype ValidateEvents = Record<string, Record<string, JsonSchema>>;\n\n/**\n * Flow Configuration System (v4)\n *\n * Core types for walkerOS unified configuration.\n * Platform-agnostic, runtime-focused.\n *\n * The Flow system enables \"one config to rule them all\" - a single\n * walkeros.config.json file that manages multiple flows\n * (web_prod, web_stage, server_prod, etc.) with shared configuration\n * and reusable variables.\n *\n * Single declaration merge: `Flow` is both the interface for one flow\n * and the namespace holding all related types.\n *\n * ## Connection Rules\n *\n * Sources use `next` to connect to transformers (pre-collector chain).\n * Sources use `before` for consent-exempt pre-source preprocessing\n * (decode, validate, authenticate raw input before the source.next chain).\n *\n * Destinations use `before` to connect to transformers (post-collector chain).\n * Destinations use `next` for post-push processing.\n *\n * Transformers use `next` to chain to other transformers. The same transformer\n * pool is shared by both pre-collector and post-collector chains.\n *\n * The collector is implicit - it is never referenced directly in connections.\n * It sits between the source chain and the destination chain automatically.\n *\n * Circular `next` references are safely handled at runtime by `walkChain()`\n * in the collector module (visited-set detection).\n *\n * ```\n * Source → [before → Preprocessing] → [next → Transformer chain] → Collector → [before → Transformer chain] → Destination → [next → Post-push]\n * ```\n *\n * @packageDocumentation\n */\n\n/**\n * Single flow configuration.\n *\n * Represents one deployment target (e.g., web_prod, server_stage).\n * Platform is determined by `config.platform` ('web' | 'server').\n *\n * Variables cascade (resolveFlowSettings): step > flow > root config.\n * \"step\" applies uniformly to source, destination, transformer, and store.\n */\ninterface Flow {\n /** Per-flow configuration: platform, url, settings, bundle. */\n config?: Flow.Config;\n /**\n * Source configurations (data capture).\n *\n * Sources capture events from various origins:\n * - Browser DOM interactions (clicks, page views)\n * - DataLayer pushes\n * - HTTP requests (server-side)\n * - Cloud function triggers\n *\n * Key = unique source identifier (arbitrary)\n * Value = source reference with package and config\n */\n sources?: Record<string, Flow.Source>;\n /**\n * Destination configurations (data output).\n *\n * Destinations send processed events to external services:\n * - Google Analytics (gtag)\n * - Meta Pixel (fbq)\n * - Custom APIs\n * - Data warehouses\n *\n * Key = unique destination identifier (arbitrary)\n * Value = destination reference with package and config\n */\n destinations?: Record<string, Flow.Destination>;\n /**\n * Transformer configurations (event transformation).\n *\n * Pre-collector (source.next) or post-collector (destination.before).\n *\n * Key = unique transformer identifier (referenced by source.next or destination.before)\n * Value = transformer reference with package and config\n */\n transformers?: Record<string, Flow.Transformer>;\n /**\n * Store configurations (key-value storage).\n *\n * Stores provide key-value storage consumed by sources, transformers,\n * and destinations via env injection. Referenced using $store.storeId\n * prefix in env values.\n *\n * Key = unique store identifier (arbitrary)\n * Value = store reference with package and config\n */\n stores?: Record<string, Flow.Store>;\n /**\n * Collector configuration (event processing).\n *\n * The collector is the central event processing engine.\n * Configuration includes consent management, global properties,\n * user identification, and processing rules.\n */\n collector?: InitConfig;\n /**\n * Flow-level variables.\n * Override root variables; overridden by source/destination variables.\n */\n variables?: Flow.Variables;\n}\ndeclare namespace Flow {\n /**\n * Complete multi-flow configuration.\n * Root type for walkeros.config.json files.\n *\n * If only one flow exists, it's auto-selected without --flow flag.\n * Convention: use \"default\" as the flow name for single-flow configs.\n *\n * @example\n * ```json\n * {\n * \"version\": 4,\n * \"$schema\": \"https://walkeros.io/schema/flow/v4.json\",\n * \"variables\": { \"CURRENCY\": \"USD\" },\n * \"flows\": {\n * \"default\": { \"config\": { \"platform\": \"web\" } }\n * }\n * }\n * ```\n */\n interface Json {\n /** Configuration schema version. */\n version: 4;\n /**\n * JSON Schema reference for IDE validation.\n * @example \"https://walkeros.io/schema/flow/v4.json\"\n */\n $schema?: string;\n /**\n * Folders to include in the bundle output.\n * Copied to dist/ during bundle, available at runtime for both local and Docker execution.\n *\n * Use for credential files, configuration, or other runtime assets.\n * Paths are relative to the config file location.\n * Default: `[\"./shared\"]` if the folder exists, otherwise `[]`.\n */\n include?: string[];\n /**\n * Shared variables for interpolation.\n * Resolution: destination/source > flow > root.\n * Syntax: $var.name\n */\n variables?: Variables;\n /**\n * Data contract definition.\n * Entity → action keyed JSON Schema with additive inheritance.\n */\n contract?: Contract;\n /**\n * Named flow configurations.\n * If only one flow exists, it's auto-selected.\n */\n flows: Record<string, Flow>;\n }\n /**\n * Per-flow configuration block.\n *\n * Groups platform identity, optional public URL, arbitrary settings bag,\n * and bundle (build-time) configuration.\n */\n interface Config {\n /**\n * Platform identity for this flow.\n * - `web` builds to IIFE format, ES2020 target, browser platform.\n * - `server` builds to ESM format, Node18 target, node platform.\n */\n platform: 'web' | 'server';\n /**\n * Public URL where this flow is reachable (for cross-flow `$flow.X.url` references).\n * Set explicitly by the user; the deployment process does not auto-populate it.\n */\n url?: string;\n /**\n * Arbitrary key-value settings consumed by the platform runtime.\n *\n * For web: typical keys include `windowCollector`.\n * For server: reserved for future server-specific options.\n *\n * The `windowElb` key is deprecated: the browser source is the single writer\n * of `window[settings.elb]`, so set the browser source's\n * `config.settings.elb` instead. The CLI forwards a `windowElb` value onto\n * that field during bundling for backward compatibility.\n *\n * This is a free-form bag — type promotion happens later if patterns emerge.\n */\n settings?: Settings;\n /**\n * Bundle configuration: NPM packages to include, transitive dependency\n * overrides, and extra trace includes for server bundles.\n * Consumed by the CLI bundler at build time.\n */\n bundle?: Bundle;\n /**\n * Observability configuration. Controls whether the runtime emits\n * FlowState records to a remote observer, and at what verbosity.\n *\n * When omitted, the runtime defaults to `{ level: 'standard' }` for\n * managed deployments. When `level: 'off'`, the bundle ships no\n * telemetry plumbing at all.\n */\n observe?: Observe;\n }\n /**\n * Observability configuration block.\n *\n * - `off` disables telemetry entirely (no hooks installed, no fetch).\n * - `standard` emits structural FlowState records (no inEvent/outEvent).\n * - `trace` emits full payloads on every hop. Use only for short debug\n * windows; the operator can also flip the deployment's `trace_until`\n * timestamp at runtime to enable trace without a redeploy.\n */\n interface Observe {\n level?: 'off' | 'standard' | 'trace';\n /** Deterministic sample fraction in [0, 1]. Defaults to 1. */\n sample?: number;\n }\n /**\n * Reusable values referenced via `$var.name` (with optional deep paths).\n * Whole-string references preserve native type; inline interpolation requires scalars.\n */\n type Variables = Record<string, unknown>;\n /**\n * Free-form settings bag inside `Flow.Config.settings`.\n * Mirrors the package settings convention (arbitrary keys).\n */\n type Settings = Record<string, unknown>;\n /**\n * Bundle configuration for a flow.\n *\n * Groups all build-time bundling concerns: NPM packages to include,\n * transitive dependency overrides, and extra trace includes (server only).\n * Consumed by the CLI bundler.\n *\n * The `flow.config.bundle.external` sub-field is no longer supported\n * (replaced by nft tracing in @walkeros/cli@4.x).\n */\n interface Bundle {\n /** NPM packages to bundle, keyed by package name. */\n packages?: Record<string, BundlePackage>;\n /**\n * Transitive dependency version pins.\n *\n * Maps package name to version spec. Applied during bundle package install\n * to force transitive dependencies to a specific version. Useful for\n * resolving conflicts between packages that depend on incompatible\n * versions of a shared dependency.\n *\n * @example\n * ```json\n * {\n * \"@amplitude/analytics-types\": \"2.11.1\"\n * }\n * ```\n */\n overrides?: Record<string, string>;\n /**\n * Extra paths the bundler must include in the trace output.\n *\n * Each entry is either a literal path or a glob (matched via picomatch),\n * resolved against the bundler's install root. Use as an escape hatch\n * when the file tracer cannot statically discover an asset (e.g.,\n * dynamic require, runtime configuration files).\n *\n * Server flows only.\n */\n traceInclude?: string[];\n }\n /**\n * Single bundle package entry.\n */\n interface BundlePackage {\n /** Version specifier (e.g., 'latest', '^2.0.0', '2.1.3'). */\n version?: string;\n /** Named imports to expose from the package. */\n imports?: string[];\n /** Local path to package directory (takes precedence over version). */\n path?: string;\n }\n /**\n * Inline code definition for sources/destinations/transformers/stores.\n * Used instead of `package` when defining inline functions.\n */\n interface Code {\n /** \"$code:...\" function (required). */\n push: string;\n /** Optional instance type identifier. */\n type?: string;\n /** Optional \"$code:...\" init function. */\n init?: string;\n }\n /**\n * Source reference with inline package syntax.\n *\n * References a source package and provides configuration.\n * The package is automatically downloaded and imported during build.\n * Alternatively, use `code` (string or inline Code) for inline code execution.\n */\n interface Source {\n /**\n * Package specifier with optional version.\n *\n * Formats:\n * - `\"@walkeros/web-source-browser\"` - latest\n * - `\"@walkeros/web-source-browser@2.0.0\"` - exact\n * - `\"@walkeros/web-source-browser@^2.0.0\"` - semver range\n *\n * Optional when `code` is used for inline code execution.\n */\n package?: string;\n /**\n * Inline code definition (object form only).\n *\n * Object: `{push, type?, init?}` for inline code definition.\n * For named-export selection from a package, use the `import` field with `package`.\n */\n code?: Code;\n /**\n * Named export from `package` to import as this source's implementation.\n *\n * Requires `package` to be set. Mutually exclusive with `code`.\n *\n * - Top-level identifier only: `/^[A-Za-z_$][A-Za-z0-9_$]*$/`. No dotted paths.\n * - `package: \"X\"` alone (no `import`, no `code`) loads X's default export.\n * - `package: \"X\"` + `import: \"fooFactory\"` loads named export `fooFactory` from X.\n *\n * @example\n * ```json\n * { \"package\": \"@walkeros/web-source-browser\", \"import\": \"sourceBrowser\" }\n * ```\n */\n import?: string;\n /**\n * Source-specific configuration. Structure depends on the source package.\n * Passed to the source's initialization function.\n */\n config?: unknown;\n /**\n * Source environment configuration.\n * Environment-specific settings merged with default source environment.\n */\n env?: unknown;\n /**\n * Mark as primary source (provides main ELB).\n *\n * The primary source's ELB function is returned by `startFlow()`.\n * Only one source should be marked as primary per flow.\n *\n * @default false\n */\n primary?: boolean;\n /**\n * First transformer in pre-source chain (consent-exempt).\n *\n * Runs before source.next chain. Consent-exempt because no analytics\n * event exists yet - these transformers handle transport-level preprocessing\n * (decode, validate, authenticate, normalize raw input).\n * Raw request data is available in context.ingest.\n */\n before?: Route;\n /**\n * First transformer in pre-collector chain.\n *\n * Name of the transformer to execute after this source captures an event.\n * Creates a pre-collector transformer chain. Chain ends at the collector.\n * If omitted, events route directly to the collector.\n * Can be an array for explicit chain control (bypasses transformer.next resolution).\n */\n next?: Route;\n /** Cache configuration for this source. */\n cache?: Cache<EventCacheRule>;\n /**\n * Source-level variables (highest priority in cascade).\n * Overrides flow and root variables.\n */\n variables?: Variables;\n /**\n * Named examples for testing and documentation.\n * Stripped during flow resolution (not included in bundles).\n */\n examples?: StepExamples;\n }\n /**\n * Destination reference with inline package syntax.\n *\n * References a destination package and provides configuration.\n * Structure mirrors `Flow.Source` for consistency.\n */\n interface Destination {\n /** Package specifier with optional version. Optional when `code` is provided. */\n package?: string;\n /**\n * Inline code definition (object form only).\n *\n * Object: `{push, type?, init?}` for inline code definition.\n * For named-export selection from a package, use the `import` field with `package`.\n */\n code?: Code;\n /**\n * Named export from `package` to import as this destination's implementation.\n * See `Flow.Source.import` for full rules.\n *\n * @example\n * ```json\n * { \"package\": \"@walkeros/web-destination-gtag\", \"import\": \"destinationGtag\" }\n * ```\n */\n import?: string;\n /**\n * Destination-specific configuration. Typically includes:\n * - settings: API keys, IDs, endpoints\n * - mapping: Event transformation rules\n * - consent: Required consent states\n * - policy: Processing rules\n */\n config?: unknown;\n /** Destination environment configuration, merged with default destination environment. */\n env?: unknown;\n /**\n * First transformer in post-collector chain.\n *\n * Name of the transformer to execute before sending events to this destination.\n * If omitted, events are sent directly from the collector.\n * Can be an array for explicit chain control.\n */\n before?: Route;\n /**\n * First transformer in post-push chain.\n *\n * Runs after destination.push completes. The push response is available\n * at context.ingest._response. Consent is inherited from the destination\n * gate - no separate consent check needed.\n */\n next?: Route;\n /** Cache configuration for this destination. */\n cache?: Cache<EventCacheRule>;\n /** Destination-level variables (highest priority in cascade). */\n variables?: Variables;\n /**\n * Named examples for testing and documentation.\n * Stripped during flow resolution.\n */\n examples?: StepExamples;\n }\n /**\n * Transformer reference with inline package syntax.\n *\n * Transformers transform events in the pipeline between sources and destinations.\n * Alternatively, use `code` for inline code execution.\n */\n interface Transformer {\n /** Package specifier with optional version. Optional when `code` is provided. */\n package?: string;\n /**\n * Inline code definition (object form only).\n *\n * Object: `{push, type?, init?}` for inline code definition.\n * For named-export selection from a package, use the `import` field with `package`.\n */\n code?: Code;\n /**\n * Named export from `package` to import as this transformer's implementation.\n * See `Flow.Source.import` for full rules.\n *\n * @example\n * ```json\n * { \"package\": \"@walkeros/transformer-ga4\", \"import\": \"transformerGa4\" }\n * ```\n */\n import?: string;\n /** Transformer-specific configuration. Structure depends on the package. */\n config?: unknown;\n /** Transformer environment configuration. */\n env?: unknown;\n /**\n * Pre-transformer chain.\n *\n * Runs before this transformer's push function.\n * Enables pre-processing or context loading before the main transform.\n * Uses the same chain resolution as source.next and destination.before.\n */\n before?: Route;\n /**\n * Next transformer in chain.\n *\n * Name of the next transformer to execute after this one.\n * In a pre-collector chain (source.next), terminates at the collector.\n * In a post-collector chain (destination.before), terminates at the destination.\n * If omitted, the chain ends and control passes to the next pipeline stage.\n * Array values define an explicit chain (no walking). Circular references\n * are safely detected at runtime by `walkChain()`.\n */\n next?: Route;\n /** Cache configuration for this transformer. */\n cache?: Cache<EventCacheRule>;\n /** Transformer-level variables (highest priority in cascade). */\n variables?: Variables;\n /**\n * Named examples for testing and documentation.\n * Stripped during flow resolution.\n */\n examples?: StepExamples;\n }\n /**\n * Store reference with inline package syntax.\n *\n * Stores provide key-value storage consumed by other components via env.\n * Unlike sources/transformers/destinations, stores have no chain properties\n * (no `next` or `before`) - they are passive infrastructure.\n */\n interface Store {\n /** Package specifier with optional version. Optional when `code` is provided. */\n package?: string;\n /**\n * Inline code definition (object form only).\n *\n * Object: `{push, type?, init?}` for inline code definition.\n * For named-export selection from a package, use the `import` field with `package`.\n */\n code?: Code;\n /**\n * Named export from `package` to import as this store's implementation.\n * See `Flow.Source.import` for full rules.\n *\n * @example\n * ```json\n * { \"package\": \"@walkeros/server-store-fs\", \"import\": \"storeFs\" }\n * ```\n */\n import?: string;\n /** Store-specific configuration. */\n config?: unknown;\n /** Store environment configuration. */\n env?: unknown;\n /**\n * Cache configuration for this store.\n *\n * When present, the collector wraps the bare store with a cache layer\n * (read-through, write-through, single-flight). The cache layer may\n * recursively delegate to another store via `cache.store`.\n */\n cache?: Cache<StoreCacheRule>;\n /** Store-level variables (highest priority in cascade). */\n variables?: Variables;\n /**\n * Named examples for testing and documentation.\n * Stripped during flow resolution.\n */\n examples?: StepExamples;\n }\n /**\n * Discriminator for the four step kinds in a Flow.\n *\n * Single source of truth for code that branches on step kind (bundler\n * codegen, validators, CLI helpers).\n */\n type StepKind = 'Source' | 'Transformer' | 'Destination' | 'Store';\n /**\n * Union of the four step interfaces.\n *\n * Use this where a function accepts \"any step in a flow\" — e.g. a\n * shared `validateReference` that branches on `StepKind` without\n * narrowing to one specific shape.\n */\n type Step = Source | Transformer | Destination | Store;\n /**\n * Named contract map.\n * Each key is a contract name, each value is a contract rule.\n *\n * @example\n * ```json\n * {\n * \"default\": { \"globals\": { ... }, \"consent\": { ... } },\n * \"web\": { \"extend\": \"default\", \"events\": { ... } },\n * \"server\": { \"extend\": \"default\", \"events\": { ... } }\n * }\n * ```\n */\n type Contract = Record<string, ContractRule>;\n /**\n * A single named contract rule.\n *\n * All sections are optional. Sections mirror WalkerOS.Event fields:\n * globals, context, custom, user, consent.\n * Entity-action schemas live under `events`.\n *\n * Use `extend` to inherit from another named contract (additive merge).\n */\n interface ContractRule {\n /** Inherit from another named contract entry. */\n extend?: string;\n /** Contract revision marker. */\n tagging?: number;\n /** Human-readable note. */\n description?: string;\n /** Entity-action keyed JSON Schemas (wildcard fallback at runtime). */\n events?: ValidateEvents;\n /** JSON Schema for the full event. */\n schema?: JsonSchema;\n }\n /**\n * JSON Schema object for contract rule validation.\n * Standard JSON Schema with description/examples annotations.\n * Compatible with AJV for runtime validation.\n */\n type ContractSchema = Record<string, unknown>;\n /**\n * Contract action entries keyed by action name.\n * Each value is a JSON Schema describing the expected WalkerOS.Event shape.\n * Use \"*\" as wildcard for all actions of an entity.\n */\n type ContractActions = Record<string, ContractSchema>;\n /**\n * Entity-action event map used inside contracts.\n * Keyed by entity name, each value is an action map.\n * Use \"*\" as wildcard for all entities or all actions.\n */\n type ContractEvents = Record<string, ContractActions>;\n /**\n * Walker command names that a step example can invoke instead of pushing\n * its `in` as a regular event. Mirrors the `elb('walker <command>', ...)`\n * surface in `WalkerCommands` (see types/elb.ts).\n *\n * - `config` - update collector config (maps to `elb('walker config', in)`)\n * - `consent` - update consent state (maps to `elb('walker consent', in)`)\n * - `user` - update user identification (maps to `elb('walker user', in)`)\n * - `run` - fire run state (maps to `elb('walker run', in)`)\n *\n * Note: `walker destination`, `walker hook`, and `walker on` are\n * intentionally excluded - they configure wiring, not test data.\n */\n type StepCommand = 'config' | 'consent' | 'user' | 'run';\n /** One observable effect: function/method call (`[callable, ...args]`) or return value (`['return', value]`). */\n type StepEffect = readonly [callable: string, ...args: unknown[]];\n /** The effects a step produces, in execution order. Empty = no observable effect (filtered, passthrough). */\n type StepOut = readonly StepEffect[];\n /**\n * Named example pair for a step.\n * `in` is the input to the step, `out` is the expected output.\n *\n * When `command` is set, the test runner invokes\n * `elb('walker <command>', in)` instead of pushing `in` as a regular event.\n * When `command` is absent (default), `in` is pushed as a normal event via\n * `elb(event)`.\n */\n interface StepExample {\n /** Human-readable title (overrides camelCase-to-spaced default heading in docs). */\n title?: string;\n description?: string;\n /**\n * Whether this example is meant for public consumption (docs, UI, MCP default output).\n * Defaults to `true`. Set to `false` for test-only fixtures that should stay out of\n * user-facing surfaces but still run in test suites and remain available to\n * `flow_simulate` / CLI `--simulate`.\n */\n public?: boolean;\n in?: unknown;\n /** Trigger metadata for sources - type and options for the trigger call. */\n trigger?: {\n /** Which mechanism to activate (e.g., 'click', 'POST', 'load'). */\n type?: string;\n /** Mechanism-specific options (e.g., CSS selector, threshold). */\n options?: unknown;\n };\n mapping?: unknown;\n out?: StepOut;\n /**\n * Invoke a walker command with `in` instead of pushing `in` as an event.\n * When set, the test runner calls `elb('walker <command>', in)`.\n * When absent (default), `in` is pushed as a regular event.\n */\n command?: StepCommand;\n }\n /** Named step examples keyed by scenario name. */\n type StepExamples = Record<string, StepExample>;\n}\n\ntype AnyFunction$1<P extends unknown[] = never[], R = unknown> = (...args: P) => R;\ntype Functions = {\n [key: string]: AnyFunction$1;\n};\ninterface Parameter<P extends unknown[], R> {\n fn: (...args: P) => R;\n result?: R;\n}\ntype HookFn<T extends AnyFunction$1> = (params: Parameter<Parameters<T>, ReturnType<T>>, ...args: Parameters<T>) => ReturnType<T>;\n\ntype hooks_Functions = Functions;\ntype hooks_HookFn<T extends AnyFunction$1> = HookFn<T>;\ndeclare namespace hooks {\n export type { AnyFunction$1 as AnyFunction, hooks_Functions as Functions, hooks_HookFn as HookFn };\n}\n\n/**\n * Log levels from most to least severe\n */\ndeclare enum Level {\n ERROR = 0,\n WARN = 1,\n INFO = 2,\n DEBUG = 3\n}\n/**\n * Normalized error context extracted from Error objects\n */\ninterface ErrorContext {\n message: string;\n name: string;\n stack?: string;\n cause?: unknown;\n}\n/**\n * Context passed to log handlers\n * If an Error was passed, it's normalized into the error property\n */\ninterface LogContext {\n [key: string]: unknown;\n error?: ErrorContext;\n}\n/**\n * Log message function signature\n * Accepts string or Error as message, with optional context\n */\ntype LogFn = (message: string | Error, context?: unknown | Error) => void;\n/**\n * Throw function signature - logs error then throws\n * Returns never as it always throws\n */\ntype ThrowFn = (message: string | Error, context?: unknown) => never;\n/**\n * Default handler function (passed to custom handlers for chaining)\n */\ntype DefaultHandler = (level: Level, message: string, context: LogContext, scope: string[]) => void;\n/**\n * Custom log handler function\n * Receives originalHandler to allow middleware-style chaining\n */\ntype Handler = (level: Level, message: string, context: LogContext, scope: string[], originalHandler: DefaultHandler) => void;\n/**\n * Logger instance with scoping support\n * All logs automatically include trace path from scoping\n */\ninterface Instance$3 {\n /**\n * Log an error message (always visible unless silenced)\n */\n error: LogFn;\n /**\n * Log a warning (degraded state, config issues, transient failures)\n */\n warn: LogFn;\n /**\n * Log an informational message\n */\n info: LogFn;\n /**\n * Log a debug message\n */\n debug: LogFn;\n /**\n * Log an error message and throw an Error\n * Combines logging and throwing in one call\n */\n throw: ThrowFn;\n /**\n * Output structured JSON data\n */\n json: (data: unknown) => void;\n /**\n * Create a scoped child logger with automatic trace path\n * @param name - Scope name (e.g., destination type, destination key)\n * @returns A new logger instance with the scope applied\n */\n scope: (name: string) => Instance$3;\n}\n/**\n * Logger configuration options\n */\ninterface Config$3 {\n /**\n * Minimum log level to display\n * @default Level.ERROR\n */\n level?: Level | keyof typeof Level;\n /**\n * Custom log handler function\n * Receives originalHandler to preserve default behavior\n */\n handler?: Handler;\n /** Custom handler for json() output. Default: console.log(JSON.stringify(data, null, 2)) */\n jsonHandler?: (data: unknown) => void;\n}\n/**\n * Internal config with resolved values and scope\n */\ninterface InternalConfig {\n level: Level;\n handler?: Handler;\n jsonHandler?: (data: unknown) => void;\n scope: string[];\n}\n/**\n * Logger factory function type\n */\ntype Factory = (config?: Config$3) => Instance$3;\n\ntype logger_DefaultHandler = DefaultHandler;\ntype logger_ErrorContext = ErrorContext;\ntype logger_Factory = Factory;\ntype logger_Handler = Handler;\ntype logger_InternalConfig = InternalConfig;\ntype logger_Level = Level;\ndeclare const logger_Level: typeof Level;\ntype logger_LogContext = LogContext;\ntype logger_LogFn = LogFn;\ntype logger_ThrowFn = ThrowFn;\ndeclare namespace logger {\n export { type Config$3 as Config, type logger_DefaultHandler as DefaultHandler, type logger_ErrorContext as ErrorContext, type logger_Factory as Factory, type logger_Handler as Handler, type Instance$3 as Instance, type logger_InternalConfig as InternalConfig, logger_Level as Level, type logger_LogContext as LogContext, type logger_LogFn as LogFn, type logger_ThrowFn as ThrowFn };\n}\n\n/** Collector state mapping for the `on` actions. */\ntype Config$2 = {\n config?: Array<GenericFn>;\n consent?: Array<ConsentRule>;\n custom?: Array<GenericFn>;\n globals?: Array<GenericFn>;\n ready?: Array<ReadyFn>;\n run?: Array<RunFn>;\n session?: Array<SessionFn>;\n user?: Array<UserFn>;\n};\n/** Allow arbitrary string events via `(string & {})`. */\ntype Types$2 = keyof Config$2 | (string & {});\n/** Map each event type to its expected data payload type. */\ninterface EventDataMap {\n config: Partial<Config$6>;\n consent: Consent;\n custom: Properties;\n globals: Properties;\n ready: void;\n run: void;\n session: SessionData | undefined;\n user: User;\n}\n/** Extract the data type for a specific event. */\ntype EventData<T extends keyof EventDataMap> = EventDataMap[T];\n/** Union of all possible data types. */\ntype AnyEventData = EventDataMap[keyof EventDataMap];\n/**\n * Context provided to every `on` callback.\n * Same posture as Mapping.Context: collector + logger only;\n * subscriptions are a collector-level concern, not a stage-level one.\n */\ninterface Context$3 {\n collector: Instance$6;\n logger: Instance$3;\n}\n/** Unified subscription callback shape. */\ntype Fn$1<TData = unknown> = (data: TData, context: Context$3) => PromiseOrValue<void>;\n/** Typed-data variants for readability and IntelliSense. All reduce to Fn<TData>. */\ntype ConsentFn = Fn$1<Consent>;\ntype GenericFn = Fn$1<unknown>;\ntype ReadyFn = Fn$1<void>;\ntype RunFn = Fn$1<void>;\ntype SessionFn = Fn$1<SessionData | undefined>;\ntype UserFn = Fn$1<User>;\n/**\n * Consent rule: a record of `{ [consentKey]: ConsentFn }`.\n * Only the consent action uses this shape (per-key handler dispatch).\n */\ninterface ConsentRule {\n [key: string]: ConsentFn;\n}\n/** Anything registerable via `walker.on(action, X)`: a typed callback or a consent rule record. */\ntype Subscription = ConsentRule | GenericFn | ReadyFn | RunFn | SessionFn | UserFn;\ninterface OnConfig {\n config?: GenericFn[];\n consent?: ConsentRule[];\n custom?: GenericFn[];\n globals?: GenericFn[];\n ready?: ReadyFn[];\n run?: RunFn[];\n session?: SessionFn[];\n user?: UserFn[];\n [key: string]: ConsentRule[] | GenericFn[] | ReadyFn[] | RunFn[] | SessionFn[] | UserFn[] | undefined;\n}\n/**\n * Destination `on` handler: receives the action type and a destination context.\n * Already context-style; kept for compatibility with the destination interface.\n */\ntype OnFn<T extends TypesGeneric$3 = Types$4> = (type: Types$2, context: Context$5<T>) => PromiseOrValue<void>;\ntype OnFnRuntime = (type: Types$2, context: Context$5) => PromiseOrValue<void>;\n\ntype on_AnyEventData = AnyEventData;\ntype on_ConsentFn = ConsentFn;\ntype on_ConsentRule = ConsentRule;\ntype on_EventData<T extends keyof EventDataMap> = EventData<T>;\ntype on_EventDataMap = EventDataMap;\ntype on_GenericFn = GenericFn;\ntype on_OnConfig = OnConfig;\ntype on_OnFn<T extends TypesGeneric$3 = Types$4> = OnFn<T>;\ntype on_OnFnRuntime = OnFnRuntime;\ntype on_ReadyFn = ReadyFn;\ntype on_RunFn = RunFn;\ntype on_SessionFn = SessionFn;\ntype on_Subscription = Subscription;\ntype on_UserFn = UserFn;\ndeclare namespace on {\n export type { on_AnyEventData as AnyEventData, Config$2 as Config, on_ConsentFn as ConsentFn, on_ConsentRule as ConsentRule, Context$3 as Context, on_EventData as EventData, on_EventDataMap as EventDataMap, Fn$1 as Fn, on_GenericFn as GenericFn, on_OnConfig as OnConfig, on_OnFn as OnFn, on_OnFnRuntime as OnFnRuntime, on_ReadyFn as ReadyFn, on_RunFn as RunFn, on_SessionFn as SessionFn, on_Subscription as Subscription, Types$2 as Types, on_UserFn as UserFn };\n}\n\ninterface Context$2 {\n city?: string;\n country?: string;\n encoding?: string;\n hash?: string;\n ip?: string;\n language?: string;\n origin?: string;\n region?: string;\n userAgent?: string;\n [key: string]: string | undefined;\n}\n\ndeclare namespace request {\n export type { Context$2 as Context };\n}\n\n/**\n * Base Env interface for dependency injection into sources.\n *\n * Sources receive all their dependencies through this environment object,\n * making them platform-agnostic and easily testable.\n */\ninterface BaseEnv$1 {\n [key: string]: unknown;\n push: PushFn$1;\n command: CommandFn;\n sources?: Sources;\n elb: Fn$3;\n logger: Instance$3;\n}\n/**\n * Type bundle for source generics.\n * Groups Settings, Mapping, Push, Env, InitSettings, and Setup into a single type parameter.\n *\n * @template S - Settings configuration type\n * @template M - Mapping configuration type\n * @template P - Push function signature (flexible to support HTTP handlers, etc.)\n * @template E - Environment dependencies type\n * @template I - InitSettings configuration type (user input)\n * @template U - Setup options type (provisioning options for `walkeros setup`)\n */\ninterface Types$1<S = unknown, M = unknown, P = Fn$3, E = BaseEnv$1, I = S, U = unknown, C = unknown> {\n settings: S;\n initSettings: I;\n mapping: M;\n push: P;\n env: E;\n setup: U;\n credentials: C;\n}\n/**\n * Generic constraint for Types - ensures T has required properties for indexed access\n */\ntype TypesGeneric$1 = {\n settings: any;\n initSettings: any;\n mapping: any;\n push: any;\n env: any;\n setup: any;\n credentials: any;\n};\n/**\n * Type extractors for consistent usage with Types bundle\n */\ntype Settings$1<T extends TypesGeneric$1 = Types$1> = T['settings'];\ntype InitSettings$1<T extends TypesGeneric$1 = Types$1> = T['initSettings'];\ntype Mapping<T extends TypesGeneric$1 = Types$1> = T['mapping'];\ntype Push<T extends TypesGeneric$1 = Types$1> = T['push'];\ntype Env$1<T extends TypesGeneric$1 = Types$1> = T['env'];\ntype SetupOptions$1<T extends TypesGeneric$1 = Types$1> = T['setup'];\ntype Credentials$1<T extends TypesGeneric$1 = Types$1> = T['credentials'];\n/**\n * Inference helper: Extract Types from Instance\n */\ntype TypesOf$1<I> = I extends Instance$2<infer T> ? T : never;\ninterface Config$1<T extends TypesGeneric$1 = Types$1> extends Config$7<Mapping<T>> {\n /** Implementation-specific configuration passed to the init function. */\n settings?: InitSettings$1<T>;\n /**\n * Optional, strictly-typed credentials slot. Back it with a managed secret\n * via `$secret.NAME` (credentials use `$secret`, not `$env`). The package\n * defines the shape via `Types['credentials']`. `settings.<sdk>` stays the\n * escape hatch for raw SDK options.\n */\n credentials?: Credentials$1<T>;\n /** Runtime dependencies injected by the collector (push, command, logger, etc.). */\n env?: Env$1<T>;\n /** Source identifier; defaults to the InitSources object key. */\n id?: string;\n /** Logger configuration (level, handler) to override the collector's defaults. */\n logger?: Config$3;\n /**\n * Respond-first acknowledgement for response-producing server sources.\n *\n * When a source produces an HTTP response (express today; future fetch /\n * lambda), `async: true` (the default for such sources) responds 2xx\n * (\"accepted\") before the event is delivered to the collector, so the\n * client is not blocked on backend delivery. `async: false` waits for\n * delivery to settle before responding. A 2xx means \"accepted\", not\n * \"delivered\".\n *\n * Browser and dataLayer sources have no HTTP response to defer and ignore\n * this flag. The default is per source type.\n */\n async?: boolean;\n /** Mark as primary source; its push function becomes the exported `elb` from startFlow. */\n primary?: boolean;\n /** Defer source initialization until these collector events fire (e.g., `['consent']`). */\n require?: string[];\n /**\n * Provisioning options for `walkeros setup`. `boolean | object`.\n * Triggered only by explicit CLI invocation; never automatic.\n */\n setup?: boolean | SetupOptions$1<T>;\n /**\n * Ingest metadata extraction mapping.\n * Extracts values from raw request objects (Express req, Lambda event, etc.)\n * using walkerOS mapping syntax. Extracted data flows to transformers/destinations.\n *\n * @example\n * ingest: {\n * ip: 'req.ip',\n * ua: 'req.headers.user-agent',\n * origin: 'req.headers.origin'\n * }\n */\n ingest?: Data$1;\n /** Completely skip this source — no init, no event capture. */\n disabled?: boolean;\n /**\n * Init lifecycle flag. Set by the collector to `true` after `Instance.init()`\n * has been called. Used together with `require` to gate `on()` delivery:\n * lifecycle events are queued in `Instance.queueOn` until both\n * `config.init === true` and `config.require` is empty/absent, then replayed.\n */\n init?: boolean;\n /** Declarative store get/set operations applied around this source. */\n state?: State | State[];\n}\ntype PartialConfig$1<T extends TypesGeneric$1 = Types$1> = Config$1<Types$1<Partial<Settings$1<T>> | Settings$1<T>, Partial<Mapping<T>> | Mapping<T>, Push<T>, Env$1<T>, InitSettings$1<T>, SetupOptions$1<T>, Credentials$1<T>>>;\ninterface Instance$2<T extends TypesGeneric$1 = Types$1> {\n type: string;\n config: Config$1<T>;\n setup?: SetupFn<Config$1<T>, Env$1<T>>;\n push: Push<T>;\n destroy?: DestroyFn<Config$1<T>, Env$1<T>>;\n on?(event: Types$2, context?: unknown): void | boolean | Promise<void | boolean>;\n /**\n * Optional setup hook. Called by the collector eagerly after all source\n * factories have run, regardless of `config.require`. Use for prep work\n * such as draining a pre-init window queue or attaching DOM listeners.\n * The collector still gates `on()` delivery, and `Collector.push`\n * enforces `allowed`/consent at the destination layer.\n */\n init?: () => void | Promise<void>;\n /**\n * Lifecycle event queue. Populated by `onApply` when the source is not\n * yet started (`config.init !== true` or `config.require` non-empty).\n * Flushed by the collector when the source becomes started.\n */\n queueOn?: Array<{\n type: Types$2;\n data: unknown;\n }>;\n}\n/**\n * Per-scope environment passed to the body of `Source.Context.withScope`.\n *\n * Each call to `withScope` builds a fresh `ScopeEnv` whose `push` captures\n * the per-scope `ingest` and `respond`. Concurrent scopes cannot crosstalk:\n * each one carries its own ingest and respond all the way through the\n * pipeline. Server sources MUST use `withScope` per inbound request; sources\n * with a single logical scope (browser tab lifetime, dataLayer) may skip it\n * and use the factory-scope `env.push` directly.\n */\ntype ScopeEnv<T extends TypesGeneric$1 = Types$1> = Env$1<T> & {\n /** Per-scope push: captures the scope's ingest and respond for this call. */\n push: PushFn$1;\n /** Ingest metadata extracted from the raw scope input (if config.ingest is set). */\n ingest: Ingest;\n /** Respond function bound to this scope (undefined for scopes without a response). */\n respond?: RespondFn;\n};\n/**\n * Context provided to source init function.\n * Extends base context with source-specific properties.\n */\ninterface Context$1<T extends TypesGeneric$1 = Types$1> extends Base<Partial<Config$1<T>>, Env$1<T>> {\n id: string;\n /**\n * Bind ingest and respond to a single scope of work (e.g. one inbound\n * HTTP request, one queue message). Builds a fresh `Ingest` from the\n * raw input via `config.ingest` mapping, wires the per-scope `respond`,\n * and invokes `body(scopeEnv)` with a push function that captures both.\n *\n * Server sources call this once per inbound request:\n *\n * ```ts\n * await context.withScope(req, createRespond(sender), async (env) => {\n * await env.push(parsedData);\n * });\n * ```\n *\n * Browser sources with a single tab-lifetime scope may skip `withScope`\n * and use `env.push` directly.\n *\n * @param rawScope - Raw input for `config.ingest` mapping (Express req,\n * Lambda event, fetch Request, etc.). Pass `undefined` if no ingest\n * mapping applies.\n * @param respond - Per-scope respond function, or `undefined` if the\n * scope produces no response.\n * @param body - Async callback receiving the per-scope env.\n * @returns The body's return value.\n */\n withScope: <R>(rawScope: unknown, respond: RespondFn | undefined, body: (env: ScopeEnv<T>) => Promise<R>) => Promise<R>;\n}\ntype Init$1<T extends TypesGeneric$1 = Types$1> = (context: Context$1<T>) => Instance$2<T> | Promise<Instance$2<T>>;\ntype InitSource<T extends TypesGeneric$1 = Types$1> = {\n code: Init$1<T>;\n config?: Partial<Config$1<T>>;\n env?: Partial<Env$1<T>>;\n primary?: boolean;\n next?: Route;\n before?: Route;\n cache?: Cache;\n state?: State | State[];\n};\n/**\n * Sources configuration for collector.\n * Maps source IDs to their initialization configurations.\n */\ninterface InitSources {\n [sourceId: string]: InitSource<any>;\n}\n/**\n * Renderer hint for source simulation UI.\n * - 'browser': Source needs a real DOM (iframe with live preview)\n * - 'codebox': Source uses a JSON/code editor (default)\n */\ntype Renderer = 'browser' | 'codebox';\n/**\n * Typed accessor for sources registered on a collector.\n *\n * The collector's `sources` bag indexes to `Source.Instance` (defaults erase\n * the generic), which collapses the source's declared `push` signature to\n * `Elb.Fn`. Use this helper at the call site to recover the narrow type\n * without casts.\n *\n * @example\n * type TestSourceTypes = Source.Types<unknown, unknown, TestPushFn>;\n * const src = getSource<TestSourceTypes>(collector, 'testSource');\n * await src.push({ method: 'GET', path: '/api/data' }); // typed!\n *\n * @throws Error with message `Source not found: <id>` when the id is unknown.\n */\ndeclare function getSource<T extends TypesGeneric$1 = Types$1>(collector: {\n sources: {\n [id: string]: Instance$2<any>;\n };\n}, id: string): Instance$2<T>;\n\ntype source_InitSource<T extends TypesGeneric$1 = Types$1> = InitSource<T>;\ntype source_InitSources = InitSources;\ntype source_Mapping<T extends TypesGeneric$1 = Types$1> = Mapping<T>;\ntype source_Push<T extends TypesGeneric$1 = Types$1> = Push<T>;\ntype source_Renderer = Renderer;\ntype source_ScopeEnv<T extends TypesGeneric$1 = Types$1> = ScopeEnv<T>;\ndeclare const source_getSource: typeof getSource;\ndeclare namespace source {\n export { type BaseEnv$1 as BaseEnv, type Config$1 as Config, type Context$1 as Context, type Credentials$1 as Credentials, type Env$1 as Env, type Init$1 as Init, type InitSettings$1 as InitSettings, type source_InitSource as InitSource, type source_InitSources as InitSources, type Instance$2 as Instance, type source_Mapping as Mapping, type PartialConfig$1 as PartialConfig, type source_Push as Push, type source_Renderer as Renderer, type source_ScopeEnv as ScopeEnv, type Settings$1 as Settings, type SetupOptions$1 as SetupOptions, type Types$1 as Types, type TypesGeneric$1 as TypesGeneric, type TypesOf$1 as TypesOf, source_getSource as getSource };\n}\n\ninterface BaseEnv {\n [key: string]: unknown;\n}\ninterface Types<S = unknown, E = BaseEnv, I = S, U = unknown, C = unknown> {\n settings: S;\n initSettings: I;\n env: E;\n setup: U;\n credentials: C;\n}\ntype TypesGeneric = {\n settings: any;\n initSettings: any;\n env: any;\n setup: any;\n credentials: any;\n};\ntype Settings<T extends TypesGeneric = Types> = T['settings'];\ntype InitSettings<T extends TypesGeneric = Types> = T['initSettings'];\ntype Env<T extends TypesGeneric = Types> = T['env'];\ntype SetupOptions<T extends TypesGeneric = Types> = T['setup'];\ntype Credentials<T extends TypesGeneric = Types> = T['credentials'];\ntype TypesOf<I> = I extends Instance$1<infer T> ? T : never;\ninterface Config<T extends TypesGeneric = Types> {\n settings?: InitSettings<T>;\n /**\n * Optional, strictly-typed credentials slot. Back it with a managed secret\n * via `$secret.NAME` (credentials use `$secret`, not `$env`). The package\n * defines the shape via `Types['credentials']`. `settings.<sdk>` stays the\n * escape hatch for raw SDK options.\n */\n credentials?: Credentials<T>;\n env?: Env<T>;\n id?: string;\n logger?: Config$3;\n /**\n * Provisioning options for `walkeros setup`. `boolean | object`.\n * Triggered only by explicit CLI invocation; never automatic.\n */\n setup?: boolean | SetupOptions<T>;\n /**\n * Persist values as raw bytes, byte-exact, bypassing the structured codec.\n * Default false: values are structured `StoreValue` and pass through the\n * shared core serialization codec. Set true only on byte-native backends\n * (fs/s3/gcs) whose consumer needs the exact bytes back, e.g. serving an\n * asset such as walker.js. Structured-only backends (sheets) reject `file:\n * true` at init. One store instance is exactly one mode.\n */\n file?: boolean;\n}\ntype PartialConfig<T extends TypesGeneric = Types> = Config<Types<Partial<Settings<T>> | Settings<T>, Env<T>, InitSettings<T>, SetupOptions<T>, Credentials<T>>>;\ninterface Context<T extends TypesGeneric = Types> extends Base<Config<T>, Env<T>> {\n id: string;\n}\n/**\n * Canonical structured value persisted by a store. Includes `null`, but\n * EXCLUDES `undefined`: `undefined` is the reserved \"miss\" sentinel returned\n * by `GetFn` for an absent key, so it must never be a stored value.\n * `Uint8Array` is the platform-neutral binary leaf (never Node `Buffer`).\n */\ntype StoreValue = string | number | boolean | null | Uint8Array | StoreValue[] | {\n [key: string]: StoreValue;\n};\ntype GetFn<T extends StoreValue = StoreValue> = (key: string) => T | undefined | Promise<T | undefined>;\ntype SetFn<T extends StoreValue = StoreValue> = (key: string, value: T, \n/**\n * Optional expiry hint in ms; honored only by TTL-native backends\n * (in-memory, Redis). Byte/JSON backends may ignore it. Authoritative cache\n * expiry lives in the cache wrapper's {value, exp} payload.\n */\nttl?: number) => void | Promise<void>;\ntype DeleteFn = (key: string) => void | Promise<void>;\ninterface Instance$1<T extends TypesGeneric = Types> {\n type: string;\n config: Config<T>;\n get: GetFn;\n set: SetFn;\n delete: DeleteFn;\n setup?: SetupFn<Config<T>, Env<T>>;\n destroy?: DestroyFn<Config<T>, Env<T>>;\n}\ntype Init<T extends TypesGeneric = Types> = (context: Context<Types<Partial<Settings<T>>, Env<T>, InitSettings<T>>>) => Instance$1<T> | Promise<Instance$1<T>>;\ntype InitFn<T extends TypesGeneric = Types> = (context: Context<T>) => PromiseOrValue<void | false | Config<T>>;\ntype InitStore<T extends TypesGeneric = Types> = {\n code: Init<T>;\n config?: Partial<Config<T>>;\n env?: Partial<Env<T>>;\n};\ninterface InitStores {\n [storeId: string]: InitStore<any>;\n}\ninterface Stores {\n [storeId: string]: Instance$1;\n}\n/**\n * Typed accessor for stores registered on a collector.\n *\n * The collector's `stores` bag indexes to `Store.Instance` (defaults erase\n * the generic). Use this helper at the call site to recover the narrow type\n * without casts.\n *\n * @example\n * type MyStoreTypes = Store.Types<MySettings>;\n * const store = getStore<MyStoreTypes>(collector, 'cache');\n * await store.set('key', 'value');\n *\n * @throws Error with message `Store not found: <id>` when the id is unknown.\n */\ndeclare function getStore<T extends TypesGeneric = Types>(collector: {\n stores: {\n [id: string]: Instance$1<any>;\n };\n}, id: string): Instance$1<T>;\n/**\n * Read-site narrowing helper for store values.\n *\n * `Instance.get`/`set` stay value-agnostic at `StoreValue`, so callers\n * that know the concrete shape narrow here instead of threading a value type\n * through `Store.Types`. The single narrow `as` cast is justified: the store\n * channel is structurally `StoreValue`, and the caller asserts the concrete\n * sub-shape it stored. `undefined` is preserved as the miss sentinel.\n */\ndeclare function getStoreValue<V extends StoreValue = StoreValue>(store: Instance$1, key: string): Promise<V | undefined>;\n\ntype store_BaseEnv = BaseEnv;\ntype store_Config<T extends TypesGeneric = Types> = Config<T>;\ntype store_Context<T extends TypesGeneric = Types> = Context<T>;\ntype store_Credentials<T extends TypesGeneric = Types> = Credentials<T>;\ntype store_DeleteFn = DeleteFn;\ntype store_Env<T extends TypesGeneric = Types> = Env<T>;\ntype store_GetFn<T extends StoreValue = StoreValue> = GetFn<T>;\ntype store_Init<T extends TypesGeneric = Types> = Init<T>;\ntype store_InitFn<T extends TypesGeneric = Types> = InitFn<T>;\ntype store_InitSettings<T extends TypesGeneric = Types> = InitSettings<T>;\ntype store_InitStore<T extends TypesGeneric = Types> = InitStore<T>;\ntype store_InitStores = InitStores;\ntype store_PartialConfig<T extends TypesGeneric = Types> = PartialConfig<T>;\ntype store_SetFn<T extends StoreValue = StoreValue> = SetFn<T>;\ntype store_Settings<T extends TypesGeneric = Types> = Settings<T>;\ntype store_SetupOptions<T extends TypesGeneric = Types> = SetupOptions<T>;\ntype store_StoreValue = StoreValue;\ntype store_Stores = Stores;\ntype store_Types<S = unknown, E = BaseEnv, I = S, U = unknown, C = unknown> = Types<S, E, I, U, C>;\ntype store_TypesGeneric = TypesGeneric;\ntype store_TypesOf<I> = TypesOf<I>;\ndeclare const store_getStore: typeof getStore;\ndeclare const store_getStoreValue: typeof getStoreValue;\ndeclare namespace store {\n export { type store_BaseEnv as BaseEnv, type store_Config as Config, type store_Context as Context, type store_Credentials as Credentials, type store_DeleteFn as DeleteFn, type store_Env as Env, type store_GetFn as GetFn, type store_Init as Init, type store_InitFn as InitFn, type store_InitSettings as InitSettings, type store_InitStore as InitStore, type store_InitStores as InitStores, type Instance$1 as Instance, type store_PartialConfig as PartialConfig, type store_SetFn as SetFn, type store_Settings as Settings, type store_SetupOptions as SetupOptions, type store_StoreValue as StoreValue, type store_Stores as Stores, type store_Types as Types, type store_TypesGeneric as TypesGeneric, type store_TypesOf as TypesOf, store_getStore as getStore, store_getStoreValue as getStoreValue };\n}\n\n/**\n * Trigger — unified interface for invoking any walkerOS step in simulation\n * and testing. Every package exports a `createTrigger` factory from its\n * examples that conforms to `Trigger.CreateFn`.\n *\n * Usage:\n * const { flow, trigger } = await createTrigger(initConfig);\n * const result = await trigger(type?, options?)(content);\n *\n * @packageDocumentation\n */\n\n/** Flow access handle returned by createTrigger. */\ninterface FlowHandle {\n /** The collector instance created by startFlow. */\n collector: Instance$6;\n /** The elb push function for direct event injection. */\n elb: Fn$3;\n}\n/** What createTrigger returns — a flow handle (lazy) and a trigger function. */\ninterface Instance<TContent = unknown, TResult = unknown> {\n /** Flow handle — undefined until first trigger() call, then stable. */\n readonly flow: FlowHandle | undefined;\n trigger: Fn<TContent, TResult>;\n}\n/**\n * Curried trigger function — always async.\n *\n * First call selects mechanism (type) and configures it (options).\n * Second call fires with content and returns result.\n *\n * @example\n * // Browser source — click trigger\n * trigger('click', 'button.cta')('<button data-elb=\"cta\">Sign Up</button>')\n *\n * // Express source — POST request\n * trigger('POST')({ path: '/collect', body: { name: 'page view' } })\n *\n * // DataLayer — default mechanism\n * trigger()(['event', 'purchase', { value: 25.42 }])\n */\ntype Fn<TContent = unknown, TResult = unknown> = (type?: string, options?: unknown) => (content: TContent) => Promise<TResult>;\n/**\n * Factory function exported by each package's examples.\n *\n * Receives full Collector.InitConfig. Does NOT call startFlow eagerly —\n * startFlow is deferred to the first trigger() invocation (lazy init).\n * The flow property uses a getter to read the closure variable live.\n * createTrigger itself stays async for consistency (other packages may\n * need await during setup). Config is passed through UNMODIFIED —\n * validation is startFlow's job.\n *\n * @example\n * // Package exports:\n * export const createTrigger: Trigger.CreateFn<HTMLContent, void> = async (config) => {\n * let flow: Trigger.FlowHandle | undefined;\n *\n * const trigger: Trigger.Fn<HTMLContent, void> = (type?, options?) => async (content) => {\n * // Pre-startFlow work (e.g., inject HTML for browser source)\n * // ...\n *\n * // Lazy init — only on first call\n * if (!flow) flow = await startFlow(config);\n *\n * // Post-startFlow work (e.g., dispatch click event)\n * // ...\n * };\n *\n * return {\n * get flow() { return flow; },\n * trigger,\n * };\n * };\n */\ntype CreateFn<TContent = unknown, TResult = unknown> = (config: InitConfig, options?: unknown) => Promise<Instance<TContent, TResult>>;\n\ntype trigger_CreateFn<TContent = unknown, TResult = unknown> = CreateFn<TContent, TResult>;\ntype trigger_FlowHandle = FlowHandle;\ntype trigger_Fn<TContent = unknown, TResult = unknown> = Fn<TContent, TResult>;\ntype trigger_Instance<TContent = unknown, TResult = unknown> = Instance<TContent, TResult>;\ndeclare namespace trigger {\n export type { trigger_CreateFn as CreateFn, trigger_FlowHandle as FlowHandle, trigger_Fn as Fn, trigger_Instance as Instance };\n}\n\ntype AnyObject<T = unknown> = Record<string, T>;\ntype Elb = Fn$3;\ntype AnyFunction = (...args: unknown[]) => unknown;\ntype SingleOrArray<T> = T | Array<T>;\ntype Events = Array<Event>;\ntype PartialEvent = Partial<Event>;\ntype DeepPartialEvent = DeepPartial<Event>;\ninterface Event {\n name: string;\n data: Properties;\n context: OrderedProperties;\n globals: Properties;\n custom: Properties;\n user: User;\n nested: Entities;\n consent: Consent;\n id: string;\n trigger: string;\n entity: string;\n action: string;\n timestamp: number;\n timing: number;\n source: Source;\n}\ninterface Consent {\n [name: string]: boolean;\n}\ninterface User extends Properties {\n id?: string;\n device?: string;\n session?: string;\n hash?: string;\n address?: string;\n email?: string;\n phone?: string;\n userAgent?: string;\n browser?: string;\n browserVersion?: string;\n deviceType?: string;\n language?: string;\n country?: string;\n region?: string;\n city?: string;\n zip?: string;\n timezone?: string;\n os?: string;\n osVersion?: string;\n screenSize?: string;\n ip?: string;\n internal?: boolean;\n}\ntype SourcePlatform = 'web' | 'server' | 'app' | 'ios' | 'android' | 'terminal' | string;\n/**\n * SourceMap is the discriminated-union registry for source kinds.\n * Each source package augments this interface via `declare module\n * '@walkeros/core'` to register its own `type` literal and any\n * source-specific fields. Conflicting declarations cause compile errors,\n * intentional, to surface naming collisions early.\n */\ninterface SourceMap {\n collector: {\n type: 'collector';\n };\n}\n/**\n * Declared (named) fields of an event Source. Kept as a standalone interface so\n * its key set stays index-signature-free: `Source extends Properties` adds a\n * string index signature that collapses `keyof Source` to `string | number`,\n * which would defeat the type↔schema drift guard. The guard compares\n * `keyof SourceFields` against `keyof z.infer<typeof SourceFieldsSchema>`\n * (see schemas/__tests__/config-drift.test-d.ts).\n */\ninterface SourceFields {\n type: string;\n platform?: SourcePlatform;\n /** Deployment version of the source emitter (string). */\n version?: string;\n /** Event-model spec version. Collector defaults to \"4\". */\n schema?: string;\n /** Emission sequence within the run. */\n count?: number;\n /** Trace id shared by every event of a run (W3C trace-id shape). */\n trace?: string;\n /** Per-flow config release map, keyed by flow name (source.release[flowName]). Accumulates across walkerOS→walkerOS crossings. */\n release?: Record<string, string>;\n /** Walker-controlled standard suggestions (sources may set). */\n url?: string;\n referrer?: string;\n tool?: string;\n command?: string;\n}\ninterface Source extends Properties, SourceFields {\n}\ntype PropertyType = boolean | string | number | {\n [key: string]: Property;\n};\ntype Property = PropertyType | Array<PropertyType>;\ninterface Properties {\n [key: string]: Property | undefined;\n}\ninterface OrderedProperties {\n [key: string]: [Property, number] | undefined;\n}\ntype Entities = Array<Entity>;\ninterface Entity {\n entity: string;\n data: Properties;\n nested?: Entities;\n context?: OrderedProperties;\n}\ntype ConsentHandler = Record<string, AnyFunction>;\ntype ActionHandler = AnyFunction;\ntype DeepPartial<T> = {\n [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];\n};\ntype PromiseOrValue<T> = T | Promise<T>;\n\ntype walkeros_ActionHandler = ActionHandler;\ntype walkeros_AnyFunction = AnyFunction;\ntype walkeros_AnyObject<T = unknown> = AnyObject<T>;\ntype walkeros_Consent = Consent;\ntype walkeros_ConsentHandler = ConsentHandler;\ntype walkeros_DeepPartial<T> = DeepPartial<T>;\ntype walkeros_DeepPartialEvent = DeepPartialEvent;\ntype walkeros_Elb = Elb;\ntype walkeros_Entities = Entities;\ntype walkeros_Entity = Entity;\ntype walkeros_Event = Event;\ntype walkeros_Events = Events;\ntype walkeros_OrderedProperties = OrderedProperties;\ntype walkeros_PartialEvent = PartialEvent;\ntype walkeros_PromiseOrValue<T> = PromiseOrValue<T>;\ntype walkeros_Properties = Properties;\ntype walkeros_Property = Property;\ntype walkeros_PropertyType = PropertyType;\ntype walkeros_SingleOrArray<T> = SingleOrArray<T>;\ntype walkeros_Source = Source;\ntype walkeros_SourceFields = SourceFields;\ntype walkeros_SourceMap = SourceMap;\ntype walkeros_SourcePlatform = SourcePlatform;\ntype walkeros_User = User;\ndeclare namespace walkeros {\n export type { walkeros_ActionHandler as ActionHandler, walkeros_AnyFunction as AnyFunction, walkeros_AnyObject as AnyObject, walkeros_Consent as Consent, walkeros_ConsentHandler as ConsentHandler, walkeros_DeepPartial as DeepPartial, walkeros_DeepPartialEvent as DeepPartialEvent, walkeros_Elb as Elb, walkeros_Entities as Entities, walkeros_Entity as Entity, walkeros_Event as Event, walkeros_Events as Events, walkeros_OrderedProperties as OrderedProperties, walkeros_PartialEvent as PartialEvent, walkeros_PromiseOrValue as PromiseOrValue, walkeros_Properties as Properties, walkeros_Property as Property, walkeros_PropertyType as PropertyType, walkeros_SingleOrArray as SingleOrArray, walkeros_Source as Source, walkeros_SourceFields as SourceFields, walkeros_SourceMap as SourceMap, walkeros_SourcePlatform as SourcePlatform, walkeros_User as User };\n}\n\n/**\n * A recorded function call made during simulation.\n * Captures what a destination called on its env (e.g., window.gtag).\n */\ninterface Call {\n /** Dot-path of the function called: \"window.gtag\", \"dataLayer.push\" */\n fn: string;\n /** Arguments passed to the function */\n args: unknown[];\n /** Unix timestamp in ms */\n ts: number;\n}\n/**\n * Result of simulating a single step.\n * Same shape for source, transformer, collector, and destination.\n */\ninterface Result {\n /** Which step type was simulated */\n step: 'source' | 'transformer' | 'destination' | 'collector';\n /** Step name, e.g. \"gtag\", \"dataLayer\", \"enricher\" */\n name: string;\n /**\n * Output events:\n * - source: captured pre-collector events\n * - transformer: [transformed event] or [] if filtered\n * - collector: [enriched event] (createEvent applied)\n * - destination: [] (destinations don't produce events)\n */\n events: DeepPartialEvent[];\n /** Intercepted env calls. Populated for destinations, empty [] for others. */\n calls: Call[];\n /** Execution time in ms */\n duration: number;\n /**\n * Entity-action key of the matched mapping rule, e.g. \"product add\" or\n * \"product *\". Populated for destination simulations when a mapping rule\n * matched; absent when no rule matched or the step has no mapping.\n * Also absent when the matched rule uses batched delivery (batching\n * reports no per-event key) and on error results, where the key is not\n * available.\n */\n mappingKey?: string;\n /** Error if the step threw */\n error?: Error;\n}\n\ntype simulation_Call = Call;\ntype simulation_Result = Result;\ndeclare namespace simulation {\n export type { simulation_Call as Call, simulation_Result as Result };\n}\n\ninterface Code {\n lang?: string;\n code: string;\n}\ninterface Hint {\n text: string;\n code?: Array<Code>;\n}\ntype Hints = Record<string, Hint>;\n\ntype hint_Code = Code;\ntype hint_Hint = Hint;\ntype hint_Hints = Hints;\ndeclare namespace hint {\n export type { hint_Code as Code, hint_Hint as Hint, hint_Hints as Hints };\n}\n\ntype StorageType = 'local' | 'session' | 'cookie';\ndeclare const Const: {\n readonly Utils: {\n readonly Storage: {\n readonly Local: \"local\";\n readonly Session: \"session\";\n readonly Cookie: \"cookie\";\n };\n };\n};\n\ntype SendDataValue = Property | Properties;\ntype SendHeaders = {\n [key: string]: string;\n};\ninterface SendResponse {\n ok: boolean;\n data?: unknown;\n error?: string;\n}\n\n/**\n * Journey types describe the assembled, cross-runtime life of one traced event\n * as reconstructed from raw `FlowState` records by `assembleJourneys`. The\n * assembler is pure and presentation-free: no session scoping, no display copy,\n * no formatting. Presenters map a `Journey` into their own view shapes.\n *\n * Optional fields are populated only when the underlying records carry the\n * corresponding data (e.g. trace-level payloads, consent snapshots, vendor\n * calls); an absent field means the records never supplied it.\n */\n/** Runtime that produced a hop: the non-empty subset of `FlowState.platform`. */\ntype JourneyPlatform = 'web' | 'server';\n/**\n * How a journey's records were correlated into one journey. `trace` groups by\n * the shared `traceId`; `legacy` is the fallback for records that predate trace\n * propagation and are grouped by their `eventId` alone.\n */\ntype JourneyCorrelation = 'trace' | 'legacy';\n/**\n * Collapsed outcome of a single hop, derived from its terminal phase. `pending`\n * covers a hop still in `in`/`init`/`flush` (no terminal phase observed yet);\n * `done` an `out`; `skipped` a `skip`; `error` an `error`.\n */\ntype JourneyHopStatus = 'pending' | 'done' | 'skipped' | 'error';\n/**\n * Completeness of a whole journey. `pending` while the journey may still gain\n * hops; `complete` when every expected hop reached a terminal phase; `partial`\n * when expected hops are missing after settling. Completeness resolution is\n * orthogonal to `lossy`.\n */\ntype JourneyStatus = 'pending' | 'complete' | 'partial';\n/**\n * Static shape of the pipeline the journey ran through, in topological order.\n * Core declares the type only; derivation lives in a shared presenter-side\n * helper. When supplied to `assembleJourneys`, node index is the within-segment\n * ordering rank. Hops match a node on `(platform, stepId)`, falling back to a\n * platform-less node with that stepId, then to the unique stepId match.\n */\ninterface JourneyTopologyNode {\n /** Step identifier this node ranks, e.g. 'destination.gtag'. */\n stepId: string;\n /** Runtime the node belongs to, when known. */\n platform?: JourneyPlatform;\n /**\n * stepIds reachable directly downstream of this node. Each entry resolves to\n * the node with that stepId AND the same platform as this (source) node; if\n * none, to the unique node with that stepId regardless of platform (the\n * $flow crossing case, where stepIds differ across the crossing); if still\n * ambiguous, the edge is ignored.\n */\n downstream: string[];\n}\n/**\n * Topology graph in topological order; a node's index is its rank. Roots\n * (nodes no edge targets) only bind journeys that touch their platform, so\n * disjoint per-platform sub-graphs are safe: prefer crossing edges when\n * encodable (they thread expectations below done crossing hops); disjoint\n * platform sub-graphs are acceptable otherwise.\n */\ninterface JourneyTopology {\n /** Nodes in topological order. */\n nodes: JourneyTopologyNode[];\n}\n/** Options controlling assembly. All optional; sensible defaults apply. */\ninterface AssembleJourneysOptions {\n /** Pipeline topology used to rank hops within a platform segment. */\n topology?: JourneyTopology;\n /**\n * Milliseconds a journey stays eligible to change after its last record\n * before completeness is finalized. Defaults to 15000.\n */\n settleMs?: number;\n /** Wall-clock reference (epoch ms) for settle evaluation. Defaults to now. */\n now?: number;\n}\n/** The originating event of a journey, taken from its entry collector hop. */\ninterface JourneyEntry {\n /** Originating event's id (W3C span-id). */\n eventId: string;\n /** Event name (e.g. 'page view'), when the entry record carried the inbound event. */\n name?: string;\n /** ISO 8601 wall-clock timestamp of the entry record. */\n timestamp: string;\n /** Originating source id, when known. */\n sourceId?: string;\n /** Runtime the entry occurred on, when known. */\n platform?: JourneyPlatform;\n}\n/**\n * A `many` fan-out child folded under its parent destination hop. Each branch\n * collapses the records carrying its `branchId` by terminal-phase precedence;\n * the parent hop's own outcome comes from its non-branch records only, so a\n * failing branch never poisons the parent status.\n */\ninterface JourneyBranch {\n /** W3C span-id of the child branch. */\n branchId: string;\n /** Collapsed outcome of the branch. */\n status: JourneyHopStatus;\n /** Terminal phase the branch reached. */\n terminalPhase: FlowStatePhase;\n /** Wall-clock duration of the branch, when measured. */\n durationMs?: number;\n /** Skip discriminator when the branch was skipped. */\n skipReason?: 'consent' | 'cache_hit' | 'sampled_out' | 'disabled' | 'unknown';\n /** Error info when the branch failed. */\n error?: {\n name?: string;\n message: string;\n };\n /** Outbound payload of the branch, when captured. */\n out?: unknown;\n /** Vendor calls recorded on the branch's out record, when captured. */\n calls?: Call[];\n}\n/**\n * One collapsed step of a journey: all `FlowState` records for a\n * `(platform, stepId)` pair reduced to a single row by terminal-phase\n * precedence.\n */\ninterface JourneyHop {\n /** Step identifier, e.g. 'destination.gtag'. */\n stepId: string;\n /** Kind of step this hop ran. */\n stepType: FlowStepType;\n /** Runtime that produced the hop, when known. Disambiguates same-named steps across sub-flows. */\n platform?: JourneyPlatform;\n /** Event id the hop's records belong to (per platform segment). */\n eventId: string;\n /** Upstream runtime's event id when this segment was entered via a $flow crossing. */\n parentEventId?: string;\n /** Collapsed outcome derived from `terminalPhase`. */\n status: JourneyHopStatus;\n /** Highest-precedence phase observed for the hop (error > skip > out > in > init > flush). */\n terminalPhase: FlowStatePhase;\n /** Earliest `elapsedMs` seen for the hop. Per-runtime; never compared across platforms. */\n startedAtMs: number;\n /** ISO 8601 wall-clock timestamp of the hop's earliest record. */\n timestamp: string;\n /** Wall-clock duration of the hop, when measured (typically from the out record). */\n durationMs?: number;\n /** Inbound event for the hop, when captured (trace level). */\n in?: unknown;\n /** Outbound event/payload for the hop, when captured (trace level). */\n out?: unknown;\n /** Error info when the hop's terminal phase is error. */\n error?: {\n name?: string;\n message: string;\n };\n /** Skip discriminator when the hop's terminal phase is skip. */\n skipReason?: 'consent' | 'cache_hit' | 'sampled_out' | 'disabled' | 'unknown';\n /** Matched mapping rule, when one matched. */\n mappingKey?: string;\n /** Matched contract rule, when one matched. */\n contractRule?: string;\n /** Consent gate snapshot at hop time, when present. */\n consent?: Record<string, boolean>;\n /** Consent actually applied after policy resolution, when present. */\n consentApplied?: Record<string, boolean>;\n /** Vendor calls recorded on the hop's out record, when captured. */\n calls?: Call[];\n /** Fan-out children when the hop produced `many` branches. */\n branches?: JourneyBranch[];\n /** True when the hop's terminal out record was part of a batched enqueue. */\n batched?: boolean;\n /**\n * True when a `flush` frame for this batched hop folded in, confirming the\n * batch was actually flushed to the vendor. Set only on batched hops; a\n * pre-wire flush-only frame (no batched out record) leaves the hop\n * non-terminal and is not a confirmation.\n */\n flushConfirmed?: boolean;\n /** Free-form metadata carried by the hop's records. */\n meta?: Record<string, unknown>;\n}\n/**\n * A wall-clock-bounded window on one platform's poster where the monotonic\n * `seq` counter skipped, indicating dropped records. Gaps are per-platform\n * because `seq` is stamped per poster. Detected by walking each platform's\n * records in wall-clock order: a forward `seq` jump of more than one is a gap\n * (bounds come from the adjacent records); a backward jump is a poster restart\n * (new generation, e.g. a page reload), never a loss.\n */\ninterface JourneyGap {\n /** Poster runtime the gap was detected on. */\n platform?: JourneyPlatform;\n /** Wall-clock lower bound of the missing window (epoch ms). */\n fromMs: number;\n /** Wall-clock upper bound of the missing window (epoch ms). */\n toMs: number;\n /** Last `seq` observed before the gap. */\n afterSeq: number;\n /** First `seq` observed after the gap. */\n beforeSeq: number;\n}\n/** One reconstructed event lifetime across the pipeline. */\ninterface Journey {\n /** `traceId` when trace-correlated, else `event:<eventId>`. */\n id: string;\n /** How the journey's records were correlated. */\n correlation: JourneyCorrelation;\n /** Shared trace id, when trace-correlated. */\n traceId?: string;\n /** Originating event of the journey. */\n entry: JourneyEntry;\n /** Collapsed hops in platform-segment then within-segment order. */\n hops: JourneyHop[];\n /** Distinct platforms present, in segment order. */\n platforms: JourneyPlatform[];\n /** Completeness of the journey. */\n status: JourneyStatus;\n /** True when the journey's window overlaps a detected `seq` gap. */\n lossy: boolean;\n /** Earliest record wall-clock timestamp (epoch ms). */\n firstTimestamp: number;\n /** Latest record wall-clock timestamp (epoch ms). */\n lastTimestamp: number;\n /** Approximate cross-runtime span (`lastTimestamp - firstTimestamp`), in ms. */\n totalMs: number;\n}\n/**\n * Result of assembling a set of `FlowState` records. `journeys` are returned in\n * first-seen wall-clock ascending order (oldest first); presenters that list\n * newest-first sort as needed. `gaps` are session-level, per-platform loss\n * windows shared across the journeys.\n */\ninterface JourneyAssembly {\n /** Assembled journeys, oldest first by `firstTimestamp`. */\n journeys: Journey[];\n /** Session-level per-platform loss windows. */\n gaps: JourneyGap[];\n}\n\n/**\n * Creates a TransformerResult for dynamic chain routing.\n * Use this in transformer push functions to redirect the chain.\n */\ndeclare function branch(event: DeepPartialEvent, next: Route): Result$1;\n\n/**\n * Anonymizes an IPv4 address by setting the last octet to 0.\n *\n * @param ip The IP address to anonymize.\n * @returns The anonymized IP address or an empty string if the IP is invalid.\n */\ndeclare function anonymizeIP(ip: string): string;\n\n/**\n * Flow Configuration Utilities\n *\n * Functions for resolving and processing Flow configurations.\n *\n * @packageDocumentation\n */\n\n/** Sentinel prefix for deferred $env resolution. Shared with CLI bundler. */\ndeclare const ENV_MARKER_PREFIX = \"__WALKEROS_ENV:\";\n/** Sentinel prefix for deferred $secret resolution. Shared with CLI bundler. */\ndeclare const SECRET_MARKER_PREFIX = \"__WALKEROS_SECRET:\";\ninterface ResolveOptions {\n deferred?: boolean;\n /**\n * When false, unresolved `$flow.X.Y` refs (unknown flow, missing key,\n * empty value) trigger {@link onWarning} and the original `$flow…` string\n * is left in place. Cycles always throw regardless of this flag.\n * Default: true (strict — throws as today).\n */\n strictFlowRefs?: boolean;\n /** Called for each unresolved $flow ref when {@link strictFlowRefs} is false. */\n onWarning?: (message: string) => void;\n}\n/**\n * Walk a dot-separated path into a value.\n * Throws if any intermediate segment is missing or not an object.\n */\ndeclare function walkPath(value: unknown, path: string, refPrefix: string): unknown;\n/**\n * Resolver callback for `$flow.X.Y` references.\n *\n * Given a sibling flow name, returns its fully resolved `Flow.Config` block\n * (with `$env`/`$var`/`$contract` already resolved) as `unknown` so that\n * {@link walkPath} can traverse it. Returns `undefined` if the flow does\n * not exist. Implementations are responsible for cycle detection across\n * recursive calls.\n */\ntype FlowConfigResolver = (flowName: string) => unknown;\n/**\n * Convert package name to valid JavaScript variable name.\n * Used for deterministic default import naming.\n * @example\n * packageNameToVariable('@walkeros/server-destination-api')\n * // → '_walkerosServerDestinationApi'\n */\ndeclare function packageNameToVariable(packageName: string): string;\n/**\n * Get resolved flow for a named flow.\n *\n * Resolution pass order:\n * 1. `$env` / `$var` resolve per-flow in isolation (no cross-flow context).\n * `$var` resolves recursively (variables may reference other variables,\n * `$env`, `$contract`, or `$flow`); cycles are detected via a visiting set.\n * 2. `$flow.X.Y` resolves against pass-1 outputs of sibling flows (so `$env`/`$var`\n * inside the referenced flow are already resolved when `$flow` reads it).\n * 3. `$contract` resolves last (with `$flow` results available).\n *\n * In practice these passes are interleaved by the resolver: when `$flow.X.Y`\n * is encountered, the sibling flow X's `Flow.Config` block is recursively\n * resolved on demand (with all its own `$env`/`$var`/`$contract` references\n * resolved first), then the deep path is walked. Cycles are detected via a\n * visiting set.\n *\n * @param config - The complete Flow.Json (root multi-flow config)\n * @param flowName - Flow name (auto-selected if only one exists)\n * @param options - Resolution options\n * @returns Resolved {@link Flow} with $var, $env, $contract, and $flow patterns resolved\n * @throws Error if flow selection is required but not specified, or flow not found\n * @throws Error if a `$flow.X.Y` reference forms a cycle\n *\n * @example\n * ```typescript\n * import { getFlowSettings } from '@walkeros/core';\n *\n * const config = JSON.parse(fs.readFileSync('walkeros.config.json', 'utf8'));\n *\n * // Auto-select if only one flow\n * const flow = getFlowSettings(config);\n *\n * // Or specify flow\n * const prodFlow = getFlowSettings(config, 'production');\n * ```\n */\ndeclare function getFlowSettings(config: Flow.Json, flowName?: string, options?: ResolveOptions): Flow;\n/**\n * Get the platform of a flow ('web' or 'server').\n *\n * Reads from `flow.config.platform`.\n *\n * @param flow - Resolved flow (output of {@link getFlowSettings})\n * @returns \"web\" or \"server\"\n * @throws Error if `config.platform` is missing\n *\n * @example\n * ```typescript\n * import { getPlatform } from '@walkeros/core';\n *\n * const platform = getPlatform(flow);\n * // Returns \"web\" or \"server\"\n * ```\n */\ndeclare function getPlatform(flow: Flow): 'web' | 'server';\n\n/**\n * @interface Assign\n * @description Options for the assign function.\n * @property merge - Merge array properties instead of overriding them.\n * @property shallow - Create a shallow copy instead of updating the target object.\n * @property extend - Extend the target with new properties instead of only updating existing ones.\n */\ninterface Assign {\n merge?: boolean;\n shallow?: boolean;\n extend?: boolean;\n}\n/**\n * Merges objects with advanced options.\n *\n * @template T, U\n * @param target - The target object to merge into.\n * @param obj - The source object to merge from.\n * @param options - Options for merging.\n * @returns The merged object.\n */\ndeclare function assign<T extends object, U extends object>(target: T, obj?: U, options?: Assign): T & U;\n\n/**\n * Gets a value from an object by a dot-notation string.\n * Supports wildcards for arrays.\n *\n * @example\n * getByPath({ data: { id: 1 } }, \"data.id\") // Returns 1\n *\n * @param event - The object to get the value from.\n * @param key - The dot-notation string.\n * @param defaultValue - The default value to return if the key is not found.\n * @returns The value from the object or the default value.\n */\ndeclare function getByPath(event: unknown, key?: string, defaultValue?: unknown): unknown;\n/**\n * Sets a value in an object by a dot-notation string.\n *\n * @param obj - The object to set the value in.\n * @param key - The dot-notation string.\n * @param value - The value to set.\n * @returns A new object with the updated value.\n */\ndeclare function setByPath<T = unknown>(obj: T, key: string, value: unknown): T;\n/**\n * Deletes a value in an object by a dot-notation string.\n * Returns a new object; the input is not mutated. No-op when the path is\n * absent or the target is neither an object nor an array. Numeric segments\n * index into arrays; a final numeric segment splices the element out so no\n * empty slot is left behind.\n */\ndeclare function deleteByPath<T = unknown>(obj: T, key: string): T;\n\ndeclare function flattenIncludeSections(event: DeepPartialEvent, sections: string[]): Record<string, unknown>;\n\n/**\n * Casts a value to a specific type.\n *\n * @param value The value to cast.\n * @returns The casted value.\n */\ndeclare function castValue(value: unknown): PropertyType;\n\n/**\n * Creates a deep clone of a value.\n * Supports primitive values, objects, arrays, dates, and regular expressions.\n * Handles circular references.\n *\n * @template T\n * @param org - The value to clone.\n * @param visited - A map of visited objects to handle circular references.\n * @returns The cloned value.\n */\ndeclare function clone<T>(org: T, visited?: WeakMap<object, unknown>): T;\n\n/**\n * Checks if the required consent is granted.\n *\n * @param required - The required consent states.\n * @param state - The current consent states.\n * @param individual - Individual consent states to prioritize.\n * @returns The granted consent states or false if not granted.\n */\ndeclare function getGrantedConsent(required: Consent | undefined, state?: Consent, individual?: Consent): false | Consent;\n\n/**\n * Creates a new destination instance by merging a base destination with additional configuration.\n *\n * This utility enables elegant destination configuration while avoiding config side-effects\n * that could occur when reusing destination objects across multiple collector instances.\n *\n * @param baseDestination - The base destination to extend\n * @param config - Additional configuration to merge with the base destination's config\n * @returns A new destination instance with merged configuration\n *\n * @example\n * ```typescript\n * // Types are inferred automatically from destinationGtag\n * elb('walker destination', createDestination(destinationGtag, {\n * settings: { ga4: { measurementId: 'G-123' } }\n * }));\n * ```\n */\ndeclare function createDestination<I extends Instance$5>(baseDestination: I, config: Partial<Config$5<TypesOf$3<I>>>): I;\n\n/**\n * Deep merges source into target, mutating target in-place.\n * Recurses into plain objects; everything else is a leaf (replaced).\n * Skips undefined source values; null overwrites.\n */\ndeclare function deepMerge<T extends Record<string, unknown>>(target: T, source: Record<string, unknown>): T;\n\n/**\n * Creates a complete event with default values.\n * Used for testing and debugging.\n *\n * Models a post-collector event: `source` always carries the run-stamped\n * `count` and `trace`, so a generated event matches one that has been pushed\n * through the collector. Override via `props.source` if needed.\n *\n * @param props - Properties to override the default values.\n * @returns A complete event.\n */\ndeclare function createEvent(props?: DeepPartialEvent): Event;\n/**\n * Creates a complete event with default values based on the event name.\n * Used for testing and debugging.\n *\n * @param name - The name of the event to create.\n * @param props - Properties to override the default values.\n * @returns A complete event.\n */\ndeclare function getEvent(name?: string, props?: DeepPartialEvent): Event;\n\ndeclare function getId(length?: number, charset?: string): string;\n\n/**\n * W3C span_id: 8 random bytes encoded as 16 lowercase hex characters.\n * Reference: W3C Trace Context (W3C Recommendation, January 2020).\n */\ndeclare function getSpanId(): string;\n\n/**\n * W3C trace_id: 16 random bytes encoded as 32 lowercase hex characters.\n * Shared by every event of a collector run. Reference: W3C Trace Context.\n */\ndeclare function getTraceId(): string;\n\ninterface ParsedTraceparent {\n /** W3C 32-hex trace id. */\n trace: string;\n /** W3C 16-hex parent span id (upstream event id). */\n parentSpan: string;\n}\n/**\n * Parse a W3C `traceparent` header value (`00-<32hex>-<16hex>-<2hex>`).\n * Returns undefined on any mismatch, and never throws. Rejects a non-string\n * input, wrong segment count, malformed segment lengths, uppercase hex, the\n * reserved `ff` version, an all-zero trace, and an all-zero span. Any other\n * 2-hex version is accepted for forward compatibility with future spec\n * revisions.\n */\ndeclare function parseTraceparent(value: unknown): ParsedTraceparent | undefined;\n\ninterface MarketingParameters {\n [key: string]: string;\n}\n/**\n * Click-ID registry entry — maps a URL parameter name to a canonical platform.\n *\n * Runtime shape only; the corresponding Zod schema lives in\n * `@walkeros/core/dev` (schemas/marketing.ts) for dev tooling that needs\n * validation or JSON Schema generation.\n */\ninterface ClickIdEntry {\n param: string;\n platform: string;\n}\n/**\n * Default click-ID registry.\n *\n * Ordered by priority: when a URL contains multiple click IDs, the entry\n * appearing earlier wins as the resolved `clickId` / `platform`. All matched\n * raw values are still preserved on the result.\n *\n * Extend via the third argument to {@link getMarketingParameters} or the\n * `clickIds` field in the session source settings.\n */\ndeclare const defaultClickIds: ClickIdEntry[];\n/**\n * Extracts marketing parameters from a URL.\n *\n * - UTM and custom params are mapped to friendly names (`utm_source` → `source`).\n * - Known click IDs are detected case-insensitively; each raw value is stored\n * under its canonical lowercase param name.\n * - `clickId` and `platform` reference the highest-priority match (first entry\n * in the registry present in the URL).\n * - Custom `clickIds` override default platforms by `param` in place and\n * append new params at the end of the priority list.\n */\ndeclare function getMarketingParameters(url: URL, custom?: MarketingParameters, clickIds?: ClickIdEntry[]): Properties;\n\n/**\n * Options for scheduling primitives ({@link debounce}, {@link throttle}).\n *\n * - `wait`: Debounce window in ms. Timer resets on every call.\n * - `size`: Hard call-count cap per window. Flush immediately when call\n * count reaches this number. Useful for batch buffers that must not\n * grow unbounded.\n * - `age`: Hard age cap in ms since the first call of the current window.\n * Forces a flush even if calls keep arriving and reset the debounce.\n * Prevents debounce starvation under sustained load.\n */\ninterface ScheduleOptions {\n wait?: number;\n size?: number;\n age?: number;\n}\n/**\n * Returned by {@link debounce}: a callable that schedules `fn` plus\n * deterministic `flush` / `cancel` controls.\n */\ninterface Debounced<P extends unknown[], R> {\n (...args: P): Promise<R | undefined>;\n /** Force an immediate flush with the most recent args. Resolves after `fn` settles. */\n flush(): Promise<R | undefined>;\n /** Cancel any pending invocation. No `fn` call, pending promises resolve to undefined. */\n cancel(): void;\n /** Number of scheduled calls since the current window opened. */\n size(): number;\n}\n/**\n * Creates a debounced function that delays invoking `fn` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `fn` invocations and a `flush` method to immediately invoke them.\n *\n * The second argument is either a `wait` number (legacy form) or a\n * {@link ScheduleOptions} object. The object form adds `size` (hard count\n * cap) and `age` (hard window-age cap) so the function flushes deterministically\n * under sustained load instead of letting the debounce reset forever.\n *\n * @template P, R\n * @param fn The function to debounce.\n * @param opts Either a wait-ms number or a {@link ScheduleOptions} object.\n * @param immediate Trigger the function on the leading edge, instead of the trailing.\n * @returns A {@link Debounced} callable with `flush`, `cancel`, and `size` methods.\n */\ndeclare function debounce<P extends unknown[], R>(fn: (...args: P) => R, opts?: number | ScheduleOptions, immediate?: boolean): Debounced<P, R>;\ndeclare function throttle<P extends unknown[], R>(fn: (...args: P) => R | undefined, opts?: number | ScheduleOptions): (...args: P) => R | undefined;\n\n/**\n * Checks if a value is an arguments object.\n *\n * @param value The value to check.\n * @returns True if the value is an arguments object, false otherwise.\n */\ndeclare function isArguments(value: unknown): value is IArguments;\n/**\n * Checks if a value is an array.\n *\n * @param value The value to check.\n * @returns True if the value is an array, false otherwise.\n */\ndeclare function isArray<T>(value: unknown): value is T[];\n/**\n * Checks if a value is a boolean.\n *\n * @param value The value to check.\n * @returns True if the value is a boolean, false otherwise.\n */\ndeclare function isBoolean(value: unknown): value is boolean;\n/**\n * Checks if an entity is a walker command.\n *\n * @param entity The entity to check.\n * @returns True if the entity is a walker command, false otherwise.\n */\ndeclare function isCommand(entity: string): entity is \"walker\";\n/**\n * Checks if a value is defined.\n *\n * @param value The value to check.\n * @returns True if the value is defined, false otherwise.\n */\ndeclare function isDefined<T>(val: T | undefined): val is T;\n/**\n * Checks if a value is an element or the document.\n *\n * @param elem The value to check.\n * @returns True if the value is an element or the document, false otherwise.\n */\ndeclare function isElementOrDocument(elem: unknown): elem is Element;\n/**\n * Checks if a value is a function.\n *\n * @param value The value to check.\n * @returns True if the value is a function, false otherwise.\n */\ndeclare function isFunction(value: unknown): value is Function;\n/**\n * Checks if a value is a number.\n *\n * @param value The value to check.\n * @returns True if the value is a number, false otherwise.\n */\ndeclare function isNumber(value: unknown): value is number;\n/**\n * Checks if a value is an object.\n *\n * @param value The value to check.\n * @returns True if the value is an object, false otherwise.\n */\ndeclare function isObject(value: unknown): value is AnyObject;\n/**\n * Checks if two variables have the same type.\n *\n * @param variable The first variable.\n * @param type The second variable.\n * @returns True if the variables have the same type, false otherwise.\n */\ndeclare function isSameType<T>(variable: unknown, type: T): variable is typeof type;\n/**\n * Checks if a value is a string.\n *\n * @param value The value to check.\n * @returns True if the value is a string, false otherwise.\n */\ndeclare function isString(value: unknown): value is string;\n\n/**\n * Create a logger instance\n *\n * @param config - Logger configuration\n * @returns Logger instance with all log methods and scoping support\n *\n * @example\n * ```typescript\n * // Basic usage\n * const logger = createLogger({ level: 'DEBUG' });\n * logger.info('Hello world');\n *\n * // With scoping\n * const destLogger = logger.scope('gtag').scope('myInstance');\n * destLogger.debug('Processing event'); // DEBUG [gtag:myInstance] Processing event\n *\n * // With custom handler\n * const logger = createLogger({\n * handler: (level, message, context, scope, originalHandler) => {\n * // Custom logic (e.g., send to Sentry)\n * originalHandler(level, message, context, scope);\n * }\n * });\n * ```\n *\n * // TODO: Consider compile-time stripping of debug logs in production builds\n * // e.g., if (__DEV__) { logger.debug(...) }\n */\ndeclare function createLogger(config?: Config$3): Instance$3;\n\n/**\n * Gets the mapping for an event.\n *\n * @param event The event to get the mapping for (can be partial or full).\n * @param mapping The mapping rules.\n * @param collector Required to evaluate rule-level conditions against the unified Context. Legacy callers may omit; rule-level conditions then run with `undefined as never` (defensive).\n * @returns The mapping result.\n */\ndeclare function getMappingEvent(event: DeepPartialEvent | PartialEvent | Event, mapping?: Rules, collector?: Instance$6): Promise<Result$2>;\n/**\n * Gets a value from a mapping.\n *\n * @param value The value to get the mapping from.\n * @param data The mapping data.\n * @param options The mapping options.\n * @returns The mapped value.\n */\ndeclare function getMappingValue(value: DeepPartialEvent | unknown | undefined, data?: Data$1, context?: Partial<Context$6>): Promise<Property | undefined>;\n/**\n * Processes an event through mapping configuration.\n *\n * This is the unified mapping logic used by both sources and destinations.\n * It applies transformations in this order:\n * 1. Config-level policy - modifies the event itself (global rules)\n * 2. Mapping rules - finds matching rule based on entity-action\n * 3. Event-level policy - modifies the event based on specific mapping rule\n * 4. Data transformation - creates context data\n * 5. Ignore check and name override\n *\n * Sources can pass partial events, destinations pass full events.\n * getMappingValue works with both partial and full events.\n *\n * @param event - The event to process (can be partial or full, will be mutated by policies)\n * @param config - Mapping configuration (mapping, data, policy, consent)\n * @param collector - Collector instance for context\n * @returns Object with transformed event, data, mapping rule, and ignore flag\n */\ndeclare function processEventMapping<T extends DeepPartialEvent | Event>(event: T, config: Config$7, collector: Instance$6): Promise<{\n event: T;\n data?: Property;\n mapping?: Rule;\n mappingKey?: string;\n ignore: boolean;\n silent: boolean;\n}>;\n\n/**\n * Resolve a user mapping rule against a package-shipped default rule.\n * - No extend/remove → replace (clone of override; today's behavior).\n * - extend → partial rule deep-merged onto base (null clears a field).\n * - remove → carried onto the merged rule for eval-time output stripping.\n * The returned rule never contains `extend`.\n */\ndeclare function mergeMappingRule(base: Rule, override: Rule): Rule;\n\n/**\n * Environment mocking utilities for walkerOS destinations\n *\n * Provides standardized tools for intercepting function calls in environment objects,\n * enabling consistent testing patterns across all destinations.\n */\ntype InterceptorFn = (path: string[], args: unknown[], original?: Function) => unknown;\n/**\n * Creates a proxied environment that intercepts function calls\n *\n * Uses Proxy to wrap environment objects and capture all function calls,\n * allowing for call recording, mocking, or simulation.\n *\n * @param env - The environment object to wrap\n * @param interceptor - Function called for each intercepted call\n * @returns Proxied environment with interceptor applied\n *\n * @example\n * ```typescript\n * const calls: Array<{ path: string[]; args: unknown[] }> = [];\n *\n * const testEnv = mockEnv(env.push, (path, args) => {\n * calls.push({ path, args });\n * });\n *\n * // Use testEnv with destination\n * await destination.push(event, { env: testEnv });\n *\n * // Analyze captured calls\n * expect(calls).toContainEqual({\n * path: ['window', 'gtag'],\n * args: ['event', 'purchase', { value: 99.99 }]\n * });\n * ```\n */\ndeclare function mockEnv<T extends object>(env: T, interceptor: InterceptorFn): T;\n/**\n * Traverses environment object and replaces values using a replacer function\n *\n * Alternative to mockEnv for environments where Proxy is not suitable.\n * Performs deep traversal and allows value transformation at each level.\n *\n * @param env - The environment object to traverse\n * @param replacer - Function to transform values during traversal\n * @returns New environment object with transformed values\n *\n * @example\n * ```typescript\n * const recordedCalls: APICall[] = [];\n *\n * const recordingEnv = traverseEnv(originalEnv, (value, path) => {\n * if (typeof value === 'function') {\n * return (...args: unknown[]) => {\n * recordedCalls.push({\n * path: path.join('.'),\n * args: structuredClone(args)\n * });\n * return value(...args);\n * };\n * }\n * return value;\n * });\n * ```\n */\ndeclare function traverseEnv<T extends object>(env: T, replacer: (value: unknown, path: string[]) => unknown): T;\n\n/**\n * Create a mock context for testing transformers and destinations.\n *\n * Provides sensible defaults for all required fields. Override only\n * what the test cares about. When context signatures change, only\n * this factory needs updating — not every test file.\n *\n * @example\n * ```typescript\n * // Transformer test — only specify config\n * const ctx = createMockContext({ config: { settings: { strict: true } } });\n * const result = await transformer.push(event, ctx);\n *\n * // Destination test — specify config and custom env\n * const ctx = createMockContext({ config: { settings: { url } }, env: { sendWeb } });\n * await destination.push(event, ctx);\n *\n * // With custom ingest data\n * const ctx = createMockContext({ ingest: { ...createIngest('test'), path: '/api' } });\n * ```\n */\ndeclare function createMockContext<T extends TypesGeneric$2 = Types$3>(overrides?: Partial<Omit<Context$4<T>, 'config' | 'ingest'> & {\n config?: Config$4<T> | Config$5<TypesGeneric$3>;\n ingest?: Ingest | (Record<string, unknown> & {\n _meta: Ingest['_meta'];\n });\n data?: unknown;\n rule?: unknown;\n}>): Context$4<T> & PushContext<TypesGeneric$3>;\n\n/**\n * Mock logger instance for testing\n * Includes all logger methods as jest.fn() plus tracking of scoped loggers\n * Extends Instance to ensure type compatibility\n */\ninterface MockLogger extends Instance$3 {\n error: jest.Mock;\n warn: jest.Mock;\n info: jest.Mock;\n debug: jest.Mock;\n throw: jest.Mock<never, [string | Error, unknown?]>;\n json: jest.Mock;\n scope: jest.Mock<MockLogger, [string]>;\n /**\n * Array of all scoped loggers created by this logger\n * Useful for asserting on scoped logger calls in tests\n */\n scopedLoggers: MockLogger[];\n}\n/**\n * Create a mock logger for testing\n * All methods are jest.fn() that can be used for assertions\n *\n * @example\n * ```typescript\n * const mockLogger = createMockLogger();\n *\n * // Use in code under test\n * someFunction(mockLogger);\n *\n * // Assert on calls\n * expect(mockLogger.error).toHaveBeenCalledWith('error message');\n *\n * // Assert on scoped logger\n * const scoped = mockLogger.scopedLoggers[0];\n * expect(scoped.debug).toHaveBeenCalledWith('debug in scope');\n * ```\n */\ndeclare function createMockLogger(): MockLogger;\n\n/**\n * Checks if a value is a valid property type.\n *\n * @param value The value to check.\n * @returns True if the value is a valid property type, false otherwise.\n */\ndeclare function isPropertyType(value: unknown): value is PropertyType;\n/**\n * Filters a value to only include valid property types.\n *\n * @param value The value to filter.\n * @returns The filtered value or undefined.\n */\ndeclare function filterValues(value: unknown): Property | undefined;\n/**\n * Casts a value to a valid property type.\n *\n * @param value The value to cast.\n * @returns The casted value or undefined.\n */\ndeclare function castToProperty(value: unknown): Property | undefined;\n\n/**\n * Converts a request string to a data object.\n *\n * @param parameter The request string to convert.\n * @returns The data object or undefined.\n */\ndeclare function requestToData(parameter: unknown): AnyObject | undefined;\n/**\n * Converts a data object to a request string.\n *\n * @param data The data object to convert.\n * @returns The request string.\n */\ndeclare function requestToParameter(data: AnyObject | PropertyType): string;\n\n/**\n * Transforms data to a string.\n *\n * @param data The data to transform.\n * @returns The transformed data.\n */\ndeclare function transformData(data?: SendDataValue): string | undefined;\n/**\n * Gets the headers for a request.\n *\n * @param headers The headers to merge with the default headers.\n * @returns The merged headers.\n */\ndeclare function getHeaders(headers?: SendHeaders): SendHeaders;\n\n/**\n * Normalize `config.setup` into a concrete options object, or null when disabled.\n *\n * - `false` / `undefined` → null (no setup)\n * - `true` → `defaults` as-is\n * - object → shallow merge of defaults and overrides (overrides win)\n */\ndeclare function resolveSetup<T extends object>(value: boolean | T | undefined, defaults: T): T | null;\n\n/**\n * Throws an error.\n *\n * @param error The error to throw.\n */\ndeclare function throwError(error: unknown): never;\n\n/**\n * Trims quotes and whitespaces from a string.\n *\n * @param str The string to trim.\n * @returns The trimmed string.\n */\ndeclare function trim(str: string): string;\n\n/**\n * A utility function that wraps a function in a try-catch block.\n *\n * @template P, R, S\n * @param fn The function to wrap.\n * @param onError A function to call when an error is caught.\n * @param onFinally A function to call in the finally block.\n * @returns The wrapped function.\n */\ndeclare function tryCatch<P extends unknown[], R, S>(fn: (...args: P) => R | undefined, onError: (err: unknown) => S, onFinally?: () => void): (...args: P) => R | S;\ndeclare function tryCatch<P extends unknown[], R>(fn: (...args: P) => R | undefined, onError?: undefined, onFinally?: () => void): (...args: P) => R | undefined;\n/**\n * A utility function that wraps an async function in a try-catch block.\n *\n * @template P, R, S\n * @param fn The async function to wrap.\n * @param onError A function to call when an error is caught.\n * @param onFinally A function to call in the finally block.\n * @returns The wrapped async function.\n */\ndeclare function tryCatchAsync<P extends unknown[], R, S>(fn: (...args: P) => R, onError: (err: unknown) => S, onFinally?: () => void | Promise<void>): (...args: P) => Promise<R | S>;\ndeclare function tryCatchAsync<P extends unknown[], R>(fn: (...args: P) => R, onError?: undefined, onFinally?: () => void | Promise<void>): (...args: P) => Promise<R | undefined>;\n\n/**\n * Error subclass for invariant violations or operator-initiated aborts\n * that must escape the top-level boundary catches in `collector.push`\n * and `collector.command`.\n *\n * Standard `Error` instances are absorbed by the boundary, logged, and\n * counted on `collector.status.failed`. A `FatalError` rethrows so a\n * runtime supervisor (CLI runner, Express server, container orchestrator)\n * can terminate the process cleanly.\n *\n * Use sparingly. Most operational failures are recoverable and should\n * be plain `Error`. Reserve `FatalError` for programmer-error invariant\n * violations or explicit fail-stop signals.\n */\ndeclare class FatalError extends Error {\n constructor(message: string, options?: ErrorOptions);\n}\n\n/**\n * A utility function that wraps a function with hooks.\n *\n * Pre/post hooks are user-supplied and may throw. A throwing hook must not\n * crash the surrounding pipeline. On failure, fall back to calling the\n * original function (pre-hook) or keep the original result (post-hook).\n *\n * The generic `F` preserves the exact call shape of `fn`, including named\n * parameters and overloaded interfaces, so call sites can assign the result\n * to the same interface slot without a cast.\n *\n * @template F The exact function type being wrapped.\n * @param fn The function to wrap.\n * @param name The name of the function.\n * @param hooks The hooks to use.\n * @param logger Optional logger for hook failure warnings. Falls back to\n * `console.warn` when not provided.\n * @returns The wrapped function with the same call shape as `fn`.\n */\ndeclare function useHooks<F extends AnyFunction$1>(fn: F, name: string, hooks: Functions, logger?: Instance$3): F;\n\n/**\n * Telemetry level. Off disables emission entirely. Standard projects\n * structural state without inEvent or outEvent payloads (unless explicitly\n * opted in). Trace emits full payloads on every hop.\n */\ntype TelemetryLevel = 'off' | 'standard' | 'trace';\n/**\n * Options that shape the telemetry projection strategy. Defaults are chosen\n * so a caller can pass `{ flowId }` and get sensible behavior.\n */\ninterface TelemetryOptions {\n /** Required flow identifier; observers may use this for cross-flow correlation. */\n flowId: string;\n /** Verbosity. Defaults to 'standard'. */\n level?: TelemetryLevel;\n /** Force-include the inbound event regardless of level. */\n includeIn?: boolean;\n /** Force-include the outbound event regardless of level. */\n includeOut?: boolean;\n /** Force-include the matched mapping key (only meaningful for transformers/destinations). */\n includeMappingKey?: boolean;\n /**\n * Fraction of events to emit, between 0 and 1. Deterministic by eventId:\n * the same eventId always falls on the same side of the threshold so\n * paired in/out states either both emit or both drop.\n */\n sample?: number;\n}\ntype EmitFn = (state: FlowState) => void;\n/**\n * Optional supplier form. When passed instead of static `TelemetryOptions`,\n * the observer evaluates the supplier on every emit so toggle-style runtime\n * overrides (e.g. `WALKEROS_TRACE_UNTIL`) reach the projection without\n * rebuilding the observer.\n */\ntype TelemetryOptionsSupplier = () => TelemetryOptions | null;\n/**\n * Build a telemetry observer that projects FlowState records according to\n * level/sample/include flags and forwards them to `emit`. The observer is\n * synchronous, never throws (a throwing emit is swallowed), and does no\n * IO of its own. Designed to be added to `collector.observers` so the\n * runtime self-emission loop drives it.\n *\n * Accepts either a static `TelemetryOptions` value or a supplier\n * `() => TelemetryOptions | null`. With a supplier, every emit reads the\n * current opts so toggles such as `WALKEROS_TRACE_UNTIL` reach the\n * projection without rebuilding the observer. A supplier returning `null`\n * suppresses the emit (telemetry off).\n */\ndeclare function createTelemetryObserver(emit: EmitFn, optsOrSupplier: TelemetryOptions | TelemetryOptionsSupplier): ObserverFn;\n/**\n * Convenience export: the internal sampling predicate so callers (and\n * tests) can verify the deterministic bucketing without importing the\n * private FNV-1a helper.\n */\ndeclare function isSampled(eventId: string, sample: number): boolean;\n\n/**\n * Runtime telemetry resolver.\n *\n * Converts a flow-side `Flow.Config.observe` block plus a runtime `traceUntil`\n * override into a concrete `TelemetryOptions` the collector hooks installer can\n * consume. Pure function of its inputs: it reads no environment.\n *\n * Resolution order (highest priority first):\n * 1. `traceUntil`, if a string that parses to a future ISO timestamp ->\n * force level=trace, sample=1, include in/out payloads.\n * 2. The `observe` block.\n * 3. A tier default of `{ level: 'standard' }`.\n *\n * The `traceUntil` value can flip between emits, so trace turns on and off as\n * the timestamp comes and goes. The platform-specific caller owns the value\n * and supplies it per emit.\n */\n\ninterface ResolveTelemetryInput {\n flowId: string;\n /** From `flow.config?.observe`. May be undefined. */\n observe?: {\n level?: 'off' | 'standard' | 'trace';\n sample?: number;\n };\n /** Runtime trace override. ISO timestamp parsing to a future time forces trace. */\n traceUntil?: string | null;\n /** Clock seam for tests. Defaults to `Date.now()`. */\n now?: () => number;\n}\n/**\n * Returns `TelemetryOptions` ready to pass to `createTelemetryObserver`,\n * or `null` if telemetry is disabled (`level === 'off'` with no trace\n * override). Callers should skip observer installation when this returns\n * null.\n */\ndeclare function resolveTelemetryOptions(input: ResolveTelemetryInput): TelemetryOptions | null;\n\n/** Claims carried by an activation grant. See the preview-sessions design spec. */\ninterface ActivationGrant {\n /** Issuing environment, e.g. 'app:stage'. Verifier rejects a foreign issuer. */\n iss: string;\n /** Exact origins this grant may activate on. Exact-membership match only. */\n aud: string[];\n /** Issue time, epoch seconds. The URL window is enforced against this. */\n iat: number;\n /** Session expiry, epoch seconds. Storage-sourced grants are rejected after it. */\n sxp: number;\n /** Opaque artifact id: the preview bundle is `preview/<art>.js`. */\n art: string;\n /** Subresource integrity of the artifact bytes, e.g. 'sha384-…'. */\n sri: string;\n /** Opaque per-project binding. Must equal the value baked into the host bundle. */\n pb: string;\n /** Capability. Only 'activate' exists today. */\n cap: 'activate';\n /** Per-grant unique id, for audit and revocation. */\n jti: string;\n /** Preview id, for correlation. Never a project id. */\n pid: string;\n /** Session id, present only on cross-part (web+server) grants. */\n ses?: string;\n /** Opaque per-session binding. Present iff `ses` is. */\n sb?: string;\n}\ntype PreviewFailure = 'no-grant' | 'malformed' | 'kid-mismatch' | 'bad-signature' | 'foreign-issuer' | 'expired' | 'aud-mismatch' | 'pb-mismatch' | 'sb-mismatch' | 'cap-mismatch' | 'no-subtle' | 'swap-failed';\ninterface ParsedGrant {\n grant: ActivationGrant;\n kid: string;\n /** The exact bytes covered by the signature: `${header}.${payload}` as UTF-8. */\n signed: Uint8Array;\n /** Raw r‖s signature, 64 bytes. */\n signature: Uint8Array;\n}\ntype VerifyResult = {\n ok: true;\n grant: ActivationGrant;\n} | {\n ok: false;\n reason: PreviewFailure;\n};\n/**\n * Parse a compact JWS activation grant. Pure and synchronous: this is the cheap\n * gate that runs before any crypto is touched. Returns null on anything\n * malformed: callers treat null as \"ignore, do not clear existing state\".\n */\ndeclare function parseGrant(raw: string): ParsedGrant | null;\n/** A public key a bundle or container will accept grants from. */\ninterface PreviewKey {\n kid: string;\n /** base64url-encoded P-256 SPKI. */\n spki: string;\n}\ntype PreviewBinary = ArrayBuffer | ArrayBufferView;\n/**\n * Structural slice of WebCrypto used by the verifier. Core compiles without\n * the DOM lib, so the ambient `Crypto` type is unavailable here: a structural\n * type also lets tests inject `node:crypto`'s webcrypto without casts and lets\n * `{}` model a subtle-less environment (same pattern as batchedPoster's\n * PosterFetch).\n */\ninterface PreviewSubtle {\n importKey(format: 'spki', keyData: PreviewBinary, algorithm: {\n name: string;\n namedCurve: string;\n }, extractable: boolean, keyUsages: string[]): Promise<unknown>;\n verify(algorithm: {\n name: string;\n hash: string;\n }, key: unknown, signature: PreviewBinary, data: PreviewBinary): Promise<boolean>;\n}\ninterface PreviewCrypto {\n subtle?: PreviewSubtle;\n}\n/**\n * The two real callers of `verifyActivation` bind audience differently: the\n * web loader always has a page origin and checks `aud` against it, while a\n * container has no origin at all and is bound to one session instead. A\n * discriminated union (rather than an optional `origin`) turns \"the caller\n * forgot `origin`\" from a silent aud-check skip into a compile error on the\n * web arm; `expectSession` is forced on the container arm for the same\n * reason, since that arm's whole job is proving it checked *something*.\n */\ntype VerifyAudience = {\n origin: string;\n expectSession?: undefined;\n} | {\n origin?: undefined;\n expectSession: {\n ses: string;\n sb: string;\n };\n};\ntype VerifyParams = VerifyAudience & {\n /** Keys this host accepts. Current + previous, so rotation is non-disruptive. */\n keyring: PreviewKey[];\n /** Expected issuer, e.g. 'app:stage'. */\n iss: string;\n /** This host's baked project binding. Required unless `acceptForeign`. */\n pb?: string;\n /** Demo hosts only: skip the pb match, require aud to be a single allowlisted origin. */\n acceptForeign?: boolean;\n demoAllowlist?: string[];\n /** Which clock applies: the URL handover window, or the session expiry. */\n source: 'url' | 'storage';\n /** Epoch milliseconds. Injected so tests and the server control the clock. */\n now: number;\n /** Defaults to globalThis.crypto. Injectable for jsdom/node tests. */\n crypto?: PreviewCrypto;\n};\n/** A grant handed over in a URL is only accepted this long after `iat`. */\ndeclare const URL_WINDOW_MS: number;\n/**\n * How far a grant's `iat` may sit in the future and still count as ordinary\n * clock skew rather than a broken or hostile mint clock (RFC 7519 §4.1.5\n * iat/nbf practice: reject a token issued in the future, with tolerance).\n */\ndeclare const CLOCK_SKEW_MS: number;\n/**\n * Verifier-side ceiling on `sxp - iat`, independent of whatever the mint's\n * clock claims. The design spec's session TTL is a 60-minute ceiling\n * (`sxp = min(iat + 60 min, session remaining)`); this adds a modest margin\n * above that so a legitimate boundary-exact grant is never rejected by\n * rounding, while still bounding how long a leaked grant stays usable if a\n * mint clock is skewed or wrong.\n */\ndeclare const MAX_SESSION_MS: number;\n/**\n * Verify an activation grant locally: no network, no DB, the signature plus\n * the baked bindings carry the whole decision.\n *\n * Claim checks run before the signature check so a hostile or malformed\n * value costs almost nothing, but `ok: true` is only ever reached after the\n * ES256 verify succeeds: no unsigned claim value is trusted on its own, it\n * only ever decides which rejection reason comes back.\n */\ndeclare function verifyActivation(raw: string, params: VerifyParams): Promise<VerifyResult>;\ninterface SwapActivatorConfig {\n keyring: PreviewKey[];\n iss: string;\n /** This bundle's project binding. Absent on demo hosts (see acceptForeign). */\n pb?: string;\n acceptForeign?: boolean;\n demoAllowlist?: string[];\n /** Bare CDN hostname, e.g. 'cdn.walkeros.io'. */\n previewOrigin: string;\n /** Injectable for tests. */\n now?: () => number;\n crypto?: PreviewCrypto;\n}\n/**\n * Storage slot for the session-forwarding companion grant. The web arm never\n * verifies it (it is session-bound by design; the session container is its\n * verifier) — the activator only ferries it from the activation URL into\n * storage, where the seamed preview artifact reads it to stamp the\n * `X-Walkeros-Preview` header. It lives and dies with the activation state:\n * set (or cleared) whenever a URL activation succeeds, cleared whenever the\n * stored activation clears.\n */\ndeclare const SESSION_STORAGE_KEY = \"elbPreviewSession\";\n/**\n * Decide whether a preview bundle should boot in place of this bundle's own flow.\n *\n * Returns true iff a preview took over, in which case the caller must not boot\n * the production flow. Every failure path deterministically returns false: the\n * loader never throws, never retries, and never leaves a page without a walker.\n *\n * Anti-griefing invariant: a rejected URL grant never touches stored state,\n * the activator falls back to the stored grant instead. Only a failing stored\n * grant clears storage (self-heal), plus `off` and `swap-failed`.\n */\ndeclare function browserSwapActivator(cfg: SwapActivatorConfig): Promise<boolean>;\n\n/**\n * Pure assembly of raw `FlowState` records into cross-runtime journeys. The\n * function is idempotent (duplicate records are deduped first) and\n * deterministic (output does not depend on input order; `options.now` supplies\n * the settle reference so tests never depend on the wall clock). It resolves\n * completeness (`pending`/`complete`/`partial`) against the settle window and,\n * when supplied, the topology frontier; loss is detected from per-platform\n * `seq` gaps and surfaced both session-level (`gaps`) and per journey (`lossy`).\n * Journeys are returned oldest-first by `firstTimestamp`; presenters re-sort as\n * needed. Each call recomputes everything from the raw records (there is no\n * incremental mode), so callers that re-resolve status on a settle tick re-run\n * the whole pipeline and should memoize on their inputs.\n */\ndeclare function assembleJourneys(records: FlowState[], options?: AssembleJourneysOptions): JourneyAssembly;\n\ndeclare function getTraceUntil(): string | null;\ndeclare function setTraceUntil(v: string | null): void;\n\n/**\n * Synchronously fans out a FlowState record to every registered observer\n * on the collector. Each call is wrapped in try/catch so a misbehaving\n * observer cannot crash the runtime; observers are advisory and must not\n * affect pipeline outcomes.\n *\n * Iterates a snapshot of the observer set so an observer adding or removing\n * another observer during the emit does not re-enter or skip in the same\n * pass. The early return on an empty set keeps the zero-observer hot path\n * allocation-free.\n */\ndeclare function emitStep(collector: Instance$6, state: FlowState): void;\n\n/**\n * Batched FlowState poster.\n *\n * Buffers FlowState records and flushes them to an HTTP endpoint either when\n * `batchMs` elapses since the first queued record, or when `batchSize` is\n * reached. Returns the emit callback that `createTelemetryObserver` consumes.\n *\n * Errors from the underlying fetch are swallowed (or routed through the\n * optional `onError` callback) so a transient observer outage cannot crash\n * the runtime.\n *\n * Uses the global `fetch` so the same primitive works in Node 18+, browsers,\n * and Edge runtimes. Tests may inject a stub via `opts.fetch`.\n */\n\n/**\n * Minimum HTTP response surface the poster touches. Anything that exposes\n * `ok` and `status` works. Decoupling from the DOM `Response` type lets the\n * helper run in Edge, browser, and Node-only test environments without\n * requiring `lib: dom` or a polyfill.\n */\ninterface PosterResponse {\n ok: boolean;\n status: number;\n}\n/**\n * Minimum fetch surface the poster needs. A subset of `typeof fetch` that\n * lets test harnesses pass a plain async function without dragging in the\n * Response/Request DOM types.\n */\ntype PosterFetch = (url: string, init: {\n method: string;\n headers: Record<string, string>;\n body: string;\n}) => Promise<PosterResponse>;\ninterface BatchedPosterOptions {\n /** Absolute HTTP endpoint URL. POST with JSON array body. */\n url: string;\n /** Bearer token sent in the `Authorization` header. */\n token: string;\n /** Max time to wait before flushing the current batch. Default 50 ms. */\n batchMs?: number;\n /** Max records per batch. When reached, flushes immediately. Default 50. */\n batchSize?: number;\n /**\n * Max serialized body size in UTF-8 bytes (the wire size body caps are\n * enforced in). A batch whose JSON exceeds this is split in half\n * recursively until each chunk fits. Default 60000.\n */\n maxBodyBytes?: number;\n /** Test seam. Defaults to the global `fetch`. */\n fetch?: PosterFetch;\n /** Called when the underlying POST rejects. Defaults to swallowing. */\n onError?: (err: unknown) => void;\n}\n/**\n * Build a batched emit callback. The returned function is synchronous, never\n * throws, and schedules an async flush in the background.\n *\n * Concurrency model: a single in-memory buffer plus a single pending timer.\n * When the timer fires (or `batchSize` is hit) the buffer is moved into a\n * local variable and reset, then POSTed. New records arriving during the in-\n * flight POST land in the next batch.\n */\ndeclare function createBatchedPoster(opts: BatchedPosterOptions): (state: FlowState) => void;\n\n/**\n * Parses a user agent string to extract browser, OS, and device information.\n *\n * @param userAgent The user agent string to parse.\n * @returns An object containing the parsed user agent information.\n */\ndeclare function parseUserAgent(userAgent?: string): User;\n/**\n * Gets the browser name from a user agent string.\n *\n * @param userAgent The user agent string.\n * @returns The browser name or undefined.\n */\ndeclare function getBrowser(userAgent: string): string | undefined;\n/**\n * Gets the browser version from a user agent string.\n *\n * @param userAgent The user agent string.\n * @returns The browser version or undefined.\n */\ndeclare function getBrowserVersion(userAgent: string): string | undefined;\n/**\n * Gets the OS name from a user agent string.\n *\n * @param userAgent The user agent string.\n * @returns The OS name or undefined.\n */\ndeclare function getOS(userAgent: string): string | undefined;\n/**\n * Gets the OS version from a user agent string.\n *\n * @param userAgent The user agent string.\n * @returns The OS version or undefined.\n */\ndeclare function getOSVersion(userAgent: string): string | undefined;\n/**\n * Gets the device type from a user agent string.\n *\n * @param userAgent The user agent string.\n * @returns The device type or undefined.\n */\ndeclare function getDeviceType(userAgent: string): string | undefined;\n\n/**\n * Inline Code Wrapping Utilities\n *\n * Converts inline code strings to executable functions for the three mapping\n * callbacks: condition, fn, validate. All three share a single signature:\n *\n * (value, context) => result\n *\n * Inside the inline body, the available bindings are:\n * - value: unknown - the value being mapped/validated/checked\n * - context: Mapping.Context with these fields:\n * event: WalkerOS.DeepPartialEvent\n * mapping: Mapping.Value | Mapping.Rule\n * collector: Collector.Instance\n * logger: Logger.Instance\n * consent?: WalkerOS.Consent\n *\n * If the body has no explicit `return`, it is auto-wrapped with `return`.\n *\n * @packageDocumentation\n */\n\n/**\n * Wrap inline code as a Mapping.Condition.\n *\n * @example\n * ```ts\n * const c = wrapCondition('context.consent?.marketing === true');\n * c(value, context); // boolean\n * ```\n */\ndeclare function wrapCondition(code: string): Condition;\n/**\n * Wrap inline code as a Mapping.Fn.\n *\n * @example\n * ```ts\n * const fn = wrapFn('value.user.email.split(\"@\")[1]');\n * fn(value, context); // domain\n * ```\n */\ndeclare function wrapFn(code: string): Fn$4;\n/**\n * Wrap inline code as a Mapping.Validate.\n *\n * @example\n * ```ts\n * const v = wrapValidate('typeof value === \"string\" && value.length > 0');\n * v(value, context); // boolean\n * ```\n */\ndeclare function wrapValidate(code: string): Validate;\n\ninterface ExampleSummary {\n name: string;\n description?: string;\n}\ninterface WalkerOSPackageMeta {\n packageName: string;\n version: string;\n description?: string;\n type?: string;\n platform?: string | string[];\n}\ninterface WalkerOSPackageInfo {\n packageName: string;\n version: string;\n type?: string;\n platform?: string | string[];\n schemas: Record<string, unknown>;\n examples: Record<string, unknown>;\n hints?: Record<string, unknown>;\n}\ninterface WalkerOSPackage extends WalkerOSPackageInfo {\n description?: string;\n docs?: string;\n source?: string;\n hintKeys: string[];\n exampleSummaries: ExampleSummary[];\n}\ndeclare function fetchPackage(packageName: string, options?: {\n version?: string;\n timeout?: number;\n baseUrl?: string;\n client?: string;\n}): Promise<WalkerOSPackage>;\n/**\n * @deprecated Use fetchPackage instead.\n * Still used by: entry.ts (validator), package-schemas.ts (MCP resource).\n */\ndeclare function fetchPackageSchema(packageName: string, options?: {\n version?: string;\n timeout?: number;\n baseUrl?: string;\n client?: string;\n}): Promise<WalkerOSPackageInfo>;\n\n/** Options for {@link resolveContracts}. */\ninterface ResolveContractsOptions {\n /**\n * When true (default), annotation keys (`description`, `examples`, `title`,\n * `$comment`) are stripped from event schemas so the result is AJV-clean for\n * runtime validation. Set to false to keep annotations (e.g. for IntelliSense\n * that surfaces property descriptions).\n */\n stripAnnotations?: boolean;\n}\n/**\n * Resolve all named contracts: process extend chains, expand wildcards,\n * strip annotations from event schemas.\n *\n * Returns a fully resolved map where each contract entry has inherited\n * properties merged in and wildcards expanded into concrete actions.\n *\n * By default annotations are stripped (AJV-clean). Pass\n * `{ stripAnnotations: false }` to preserve `description`/`examples`/`title`\n * on event schemas.\n */\ndeclare function resolveContracts(contracts: Flow.Contract, options?: ResolveContractsOptions): Record<string, Flow.ContractRule>;\n/**\n * Deep merge two JSON Schema objects with additive semantics.\n * - `required` arrays: union (deduplicated)\n * - `properties`: deep merge (child wins on conflict for scalars)\n * - Scalars: child overrides parent\n */\ndeclare function mergeContractSchemas(parent: Record<string, unknown>, child: Record<string, unknown>): Record<string, unknown>;\n\n/**\n * Env key under which the collector injects the observe-mode call recorder\n * (`Destination.EnvObserve`) into a per-push env. The resolution-point wrapper\n * strips this key before handing the env to the destination.\n */\ndeclare const OBSERVE_ENV_KEY: \"observe\";\n/**\n * Structural guard for `Destination.EnvObserve`: an object whose `paths` is a\n * string array and whose `record` is a function. Extra keys are tolerated.\n */\ndeclare function isEnvObserve(value: unknown): value is EnvObserve;\n/**\n * Parse a `simulation`/`calls` dot-path into segments, sharing one grammar with\n * `wrapEnv` so the two capture layers cannot drift. Strips a single leading\n * `call:` prefix (only the literal `call:`, never any other `<word>:`), then\n * splits on `.`. An empty path or any empty segment (leading, trailing, or\n * consecutive dots) is unresolvable and yields `[]`.\n */\ndeclare function parseCallPath(raw: string): string[];\n\ndeclare function mcpResult(result: unknown, hints?: {\n next?: string[];\n warnings?: string[];\n}): {\n content: {\n type: \"text\";\n text: string;\n }[];\n structuredContent: Record<string, unknown>;\n};\ndeclare function mcpError(error: unknown, hint?: string): {\n content: {\n type: \"text\";\n text: string;\n }[];\n structuredContent: Record<string, unknown>;\n isError: true;\n};\n\n/**\n * Compiles a match expression into a closure for fast runtime evaluation.\n * Regex patterns are compiled once. Numeric comparisons are parsed once.\n * Runtime evaluation is pure function calls with short-circuit logic.\n */\ndeclare function compileMatcher(expr: MatchExpression | '*' | undefined): CompiledMatcher;\n\ndeclare function isRouteConfigEntry(entry: unknown): boolean;\n/**\n * Pure RouteConfig array — every element is a RouteConfig object.\n * Used to detect the legacy first-match shape (treated as implicit `one`).\n */\ndeclare function isRouteArray(next: Route): next is RouteConfig[];\n/**\n * Resolve a Route spec against a matcher context. Returns the immediate\n * next transformer IDs.\n *\n * Return shape:\n * [] → terminate (gate failed, empty many, all matchers failed,\n * undefined spec).\n * [\"x\"] → continue main chain at x.\n * [\"a\",\"b\",…] → fan-out, only produced by `many`. Main chain terminates\n * at this dispatch point; each branch is an independent\n * flow running to its own exit.\n *\n * Reachability vs prediction: `match` rules read arbitrary event fields.\n * `getNextSteps` is deterministic for the SUPPLIED context only. Static\n * analyzers without a real event must over-approximate by treating each\n * match as \"may pass or fail\" — see `flattenRouteTargets` in the CLI\n * validator. This function does NOT predict the path a future event will\n * take; it computes the path for the event you give it.\n */\ndeclare function getNextSteps(spec: Route | undefined, context?: Record<string, unknown>): string[];\n\ninterface CompiledCacheRule {\n match: CompiledMatcher;\n key: string[];\n ttl: number;\n update?: EventCacheRule['update'];\n}\ninterface CompiledCache {\n stop: boolean;\n storeId?: string;\n namespace?: string;\n rules: CompiledCacheRule[];\n}\ninterface CacheResult {\n status: 'HIT' | 'MISS';\n key: string;\n value?: StoreValue;\n rule: CompiledCacheRule;\n}\n/**\n * Builds a structured context object for cache and routing operations.\n * Normalizes ingest (defaulting to {}) and optionally includes event.\n */\ndeclare function buildCacheContext(ingest?: unknown, event?: unknown): Record<string, unknown>;\ndeclare function compileCache(cache: Cache<EventCacheRule>): CompiledCache;\ndeclare function checkCache(compiled: CompiledCache, store: Instance$1, context: Record<string, unknown>, namespace?: string): Promise<CacheResult | null>;\ndeclare function storeCache(store: Instance$1, key: string, value: unknown, ttlSeconds: number): void;\ndeclare function applyUpdate(value: unknown, update: Record<string, unknown> | undefined, context: Record<string, unknown>, collector: Instance$6): Promise<unknown>;\n\n/**\n * Shared cache envelope used by BOTH cache mechanisms (the event cache in\n * `./cache.ts` and the store-cache wrapper in\n * `@walkeros/collector/store-cache-wrapper`). A cached value is wrapped in a\n * plain `{value, exp}` structured object, not a Buffer: the backing store\n * serializes it through the shared store codec (`./store/codec`), so any\n * structured store can persist it byte-exact, and a TTL-native tier\n * (in-memory `__cache`, Redis) can additionally evict via the `ttl` arg.\n *\n * The envelope owns expiry interpretation, not the store contract:\n * `StoreValue` carries no TTL field. The physical envelope keys are\n * namespaced (`__walkeros_cache_v__` / `__walkeros_cache_exp__`) so a user\n * value that happens to be shaped `{ value, exp }` is never mistaken for an\n * envelope, and conversely a wrapped envelope is unambiguous on read.\n */\ndeclare const ENVELOPE_VALUE = \"__walkeros_cache_v__\";\ndeclare const ENVELOPE_EXP = \"__walkeros_cache_exp__\";\n/** A wrapped cache envelope as it is persisted into the backing store. */\ntype CacheEnvelope = {\n [ENVELOPE_VALUE]: StoreValue;\n [ENVELOPE_EXP]?: number;\n};\n/**\n * Wrap a value in a `{value, exp}` envelope. When `ttlMs` is given, `exp` is\n * `now() + ttlMs`; when omitted, `exp` is left off entirely (no expiry).\n *\n * `now` is injectable so tests do not depend on ambient wall-clock time;\n * production callers omit it and the helper falls back to `Date.now`.\n */\ndeclare function wrapCacheEnvelope(value: StoreValue, ttlMs?: number, now?: () => number): CacheEnvelope;\n/**\n * Read a stored envelope. Returns:\n * - `undefined` when the key is absent (`stored === undefined`).\n * - `{ expired: true }` when the envelope's `exp` has elapsed (caller should\n * best-effort purge and treat as a MISS).\n * - `{ value }` otherwise.\n *\n * A stored value that is not a recognizable envelope (a raw live value, e.g.\n * a TTL-native tier that holds the value by reference, or a legacy entry) is\n * returned verbatim as `{ value: stored }`, so a non-enveloped HIT degrades\n * gracefully rather than being dropped.\n */\ndeclare function readCacheEnvelope(stored: StoreValue | undefined, now?: () => number): {\n value: StoreValue;\n} | {\n expired: true;\n} | undefined;\n\n/**\n * Thrown when a value cannot be serialized (e.g. a cyclic structure that\n * `JSON.stringify` rejects). Catchable and distinguishable from a raw\n * `TypeError` leaking out of the platform JSON implementation.\n */\ndeclare class StoreCodecError extends Error {\n constructor(message: string, options?: {\n cause?: unknown;\n });\n}\n/**\n * Recursive type guard: the restored value is structurally a `StoreValue`.\n * The single restore walk (`fromSerializableWith`) is JSON-derived plus\n * `Uint8Array` binary leaves, so this always holds; the guard makes the\n * narrowing explicit and cast-free at the public boundary.\n *\n * The guard accepts exactly what the serializer can encode. An `undefined`\n * object property is dropped and an `undefined` array element becomes `null`\n * on `JSON.stringify`, so an `undefined` nested value does NOT disqualify the\n * containing value (matching the serializer's runtime tolerance at the\n * `unknown -> StoreValue` boundary). The `StoreValue` TYPE still excludes\n * `undefined`; this only mirrors what survives serialization.\n */\ndeclare function isStoreValue(value: unknown): value is StoreValue;\n/**\n * Serialize a `StoreValue` to its UTF-8 JSON byte payload. Throws\n * `StoreCodecError` if the value cannot be encoded (e.g. a cyclic structure).\n */\ndeclare function serializeStoreValue(value: StoreValue): Uint8Array;\n/**\n * Restore a `StoreValue` from its UTF-8 JSON byte payload (or a JSON string).\n */\ndeclare function deserializeStoreValue(raw: Uint8Array | string): StoreValue;\n\n/**\n * Resolve a store by id. An `undefined` id falls back to the default\n * in-memory `__cache` store. Returns `undefined` when the id is unknown.\n */\ntype GetStore = (id: string | undefined) => Instance$1 | undefined;\n/** Normalize a single State or an array of States to an array. */\ndeclare function compileState(state: State | State[]): State[];\n/**\n * Apply declarative store operations against an event, in array order,\n * sequentially. `get` reads from the store and writes the fetched value to\n * the event's value path; `set` writes the resolved value to the store. Each\n * entry is fail-open: a store or resolution error is logged and the event is\n * left unmutated, the chain continues. Only `FatalError` rethrows (via\n * `getMappingValue`).\n */\ndeclare function applyState<E extends DeepPartialEvent>(states: State[], getStore: GetStore, event: E, collector: Instance$6): Promise<E>;\n\n/**\n * Single source of truth for step-entry validation across all four kinds.\n *\n * An empty entry (no `code`, no `package`, no `import`) is a valid no-op\n * step for all four kinds. The bundler emits no code; the runtime skips\n * registration. No error is raised for empty steps.\n *\n * Error codes:\n * - UNKNOWN_KEY unknown top-level key on a step entry\n * - CONFLICT two of {code, package, import} together, or other mutually exclusive pairs\n * - MISSING_PACKAGE `import` set without `package`\n * - OBSOLETE_CODE_STRING `code` is a string (legacy named-export shape; use `import` instead)\n * - INVALID_IMPORT `import` is set but is not a valid JS identifier\n * - INVALID_CODE_SHAPE `code` is present but is neither an object nor a string\n */\ndeclare const STEP_OPERATIVE_FIELDS: Record<Flow.StepKind, readonly string[]>;\ntype StepEntryErrorCode = 'UNKNOWN_KEY' | 'CONFLICT' | 'MISSING_PACKAGE' | 'OBSOLETE_CODE_STRING' | 'INVALID_IMPORT' | 'INVALID_CODE_SHAPE';\ninterface StepEntryValidation {\n ok: boolean;\n reason?: string;\n code?: StepEntryErrorCode;\n key?: string;\n}\ndeclare function validateStepEntry(entry: Record<string, unknown>, kind: Flow.StepKind): StepEntryValidation;\ndeclare function isPathStepEntry(entry: Record<string, unknown>, kind: Flow.StepKind): boolean;\n\ntype StepOut = Flow.StepOut;\n/**\n * Format a step example's `out` as readable code for docs/app rendering.\n *\n * - Empty `out` → `// no output`.\n * - `['return', value]` → `return <value>` (no parentheses).\n * - `[callable, ...args]` → `callable(<args>)`.\n * - Primitive args render as JSON (strings quoted, numbers/booleans/null bare).\n * - `undefined` renders as the literal token `undefined`.\n * - Objects/arrays render as `JSON.stringify(v, null, 2)`.\n * - Functions render as `[Function]` (rare in outs; safe fallback).\n *\n * Pure function. No runtime dependencies. Used by the website\n * `<StepExample>` renderer and the app `OutputPanel` for a single source of truth.\n */\ndeclare function formatOut(out: StepOut): string;\n\n/**\n * walkerOS reference-syntax regex constants — single source of truth.\n *\n * Rule:\n * - `.` = key or path (resolver walks it)\n * - `:` = literal value or raw-code payload (resolver uses it verbatim)\n *\n * Every tool that recognizes references (core resolver, CLI bundler,\n * app secrets service, explorer IntelliSense) imports these — no\n * inline regexes elsewhere.\n */\ndeclare const REF_VAR_FULL: RegExp;\ndeclare const REF_VAR_INLINE: RegExp;\ndeclare const REF_ENV: RegExp;\ndeclare const REF_CONTRACT: RegExp;\n/** Whole-string `$flow.<name>(.<path>)?`: cross-flow value reference. */\ndeclare const REF_FLOW: RegExp;\ndeclare const REF_STORE: RegExp;\ndeclare const REF_SECRET: RegExp;\ndeclare const REF_CODE_PREFIX = \"$code:\";\n/**\n * Canonical scanner for the `$flow.` reference grammar. Walks strings,\n * arrays, and objects and returns every referenced flow name. The returned\n * set is the same instance as `into` when one is supplied, so callers can\n * accumulate across multiple values.\n */\ndeclare function scanFlowRefs(value: unknown, into?: Set<string>): Set<string>;\n\nexport { type ActivationGrant, type AssembleJourneysOptions, type BatchedPosterOptions, type BreakerState, CLOCK_SKEW_MS, cache as Cache, type CacheEnvelope, type CacheResult, type ClickIdEntry, collector as Collector, type CompiledCache, Const, context as Context, type Credential, type Debounced, destination as Destination, type DestroyContext, type DestroyFn, type DroppedCounters, ENV_MARKER_PREFIX, elb as Elb, type EmitFn, type ExampleSummary, FatalError, Flow, type FlowConfigResolver, type FlowState, type FlowStateBatch, type FlowStatePhase, type FlowStepType, type GetStore, hint as Hint, hooks as Hooks, type Ingest, type IngestMeta, type Journey, type JourneyAssembly, type JourneyBranch, type JourneyCorrelation, type JourneyEntry, type JourneyGap, type JourneyHop, type JourneyHopStatus, type JourneyPlatform, type JourneyStatus, type JourneyTopology, type JourneyTopologyNode, type JsonSchema, Level, lifecycle as Lifecycle, type LifecycleContext, logger as Logger, MAX_SESSION_MS, mapping as Mapping, type MarketingParameters, matcher as Matcher, type MockLogger, OBSERVE_ENV_KEY, type ObserverFn, on as On, type ParsedGrant, type ParsedTraceparent, type PosterFetch, type PosterResponse, type PreviewCrypto, type PreviewFailure, type PreviewKey, type PreviewSubtle, REF_CODE_PREFIX, REF_CONTRACT, REF_ENV, REF_FLOW, REF_SECRET, REF_STORE, REF_VAR_FULL, REF_VAR_INLINE, request as Request, type ResolveContractsOptions, type ResolveOptions, type RespondFn, type RespondOptions, SECRET_MARKER_PREFIX, SESSION_STORAGE_KEY, STEP_OPERATIVE_FIELDS, type ScheduleOptions, type SendDataValue, type SendHeaders, type SendResponse, type ServiceAccount, type SetupFn, simulation as Simulation, source as Source, type State, type StepEntryErrorCode, type StepEntryValidation, type StepKind, type StorageType, store as Store, StoreCodecError, type SwapActivatorConfig, type TelemetryLevel, type TelemetryOptions, type TelemetryOptionsSupplier, transformer as Transformer, trigger as Trigger, URL_WINDOW_MS, type ValidateEvents, type VerifyParams, type VerifyResult, walkeros as WalkerOS, type WalkerOSPackage, type WalkerOSPackageInfo, type WalkerOSPackageMeta, anonymizeIP, applyState, applyUpdate, assembleJourneys, assign, branch, browserSwapActivator, buildCacheContext, castToProperty, castValue, checkCache, clone, compileCache, compileMatcher, compileState, createBatchedPoster, createDestination, createEvent, createIngest, createLogger, createMockContext, createMockLogger, createRespond, createTelemetryObserver, debounce, deepMerge, defaultClickIds, deleteByPath, deserializeStoreValue, emitStep, fetchPackage, fetchPackageSchema, filterValues, flattenIncludeSections, formatOut, getBrowser, getBrowserVersion, getByPath, getDeviceType, getEvent, getFlowSettings, getGrantedConsent, getHeaders, getId, getMappingEvent, getMappingValue, getMarketingParameters, getNextSteps, getOS, getOSVersion, getPlatform, getSpanId, getTraceId, getTraceUntil, isArguments, isArray, isBoolean, isCommand, isDefined, isElementOrDocument, isEnvObserve, isFunction, isNumber, isObject, isPathStepEntry, isPropertyType, isRouteArray, isRouteConfigEntry, isSameType, isSampled, isStoreValue, isString, mcpError, mcpResult, mergeContractSchemas, mergeMappingRule, mockEnv, packageNameToVariable, parseCallPath, parseGrant, parseTraceparent, parseUserAgent, processEventMapping, readCacheEnvelope, requestToData, requestToParameter, resolveContracts, resolveSetup, resolveTelemetryOptions, scanFlowRefs, serializeStoreValue, setByPath, setTraceUntil, stepId, storeCache, throttle, throwError, transformData, traverseEnv, trim, tryCatch, tryCatchAsync, useHooks, validateStepEntry, verifyActivation, walkPath, wrapCacheEnvelope, wrapCondition, wrapFn, wrapValidate };\n"}}),f={};function g(e){l.has(e)||(l.add(e),e.languages.typescript.javascriptDefaults.setCompilerOptions({target:e.languages.typescript.ScriptTarget.ES2022??9,lib:["es2022","dom"],allowNonTsExtensions:!0,moduleResolution:e.languages.typescript.ModuleResolutionKind.NodeJs,module:e.languages.typescript.ModuleKind.ESNext,moduleDetection:3,noEmit:!0,esModuleInterop:!0,allowSyntheticDefaultImports:!0,skipLibCheck:!0,jsx:e.languages.typescript.JsxEmit.React,allowJs:!0,checkJs:!1,strict:!1,noImplicitAny:!1,strictNullChecks:!1}),e.languages.typescript.javascriptDefaults.setDiagnosticsOptions({noSemanticValidation:!1,noSyntaxValidation:!1,diagnosticCodesToIgnore:[1108,1005]}),e.languages.typescript.typescriptDefaults.setCompilerOptions({target:e.languages.typescript.ScriptTarget.ES2022??9,lib:["es2022","dom"],allowNonTsExtensions:!0,moduleResolution:e.languages.typescript.ModuleResolutionKind.NodeJs,module:e.languages.typescript.ModuleKind.ESNext,moduleDetection:3,noEmit:!0,esModuleInterop:!0,allowSyntheticDefaultImports:!0,skipLibCheck:!0,jsx:e.languages.typescript.JsxEmit.React,allowJs:!0,strict:!1,noImplicitAny:!1}))}function h(e,n,t){if(i.has(n))return!1;const r=e.languages.typescript.javascriptDefaults.addExtraLib(t,n),o=e.languages.typescript.typescriptDefaults.addExtraLib(t,n);return i.set(n,{uri:n,content:t,disposable:{dispose:()=>{r.dispose(),o.dispose()}}}),!0}function m(e){const n=i.get(e);return!!n&&(n.disposable?.dispose(),i.delete(e),!0)}function y(e,n,t){m(n),h(e,n,t)}async function b(e,n,t){try{const r=await fetch(n);if(!r.ok)return!1;const o=await r.text();return h(e,t||`file:///${n}`,o)}catch{return!1}}function v(e){let n=e.replace(/^import\s+(?:type\s+)?(?:\*\s+as\s+\w+|\{[^}]*\}|[\w$]+)(?:\s*,\s*(?:\{[^}]*\}|\*\s+as\s+\w+))?\s+from\s+['"][^'"]+['"];?\s*$/gm,"");return n=n.replace(/^import\s+(?:type\s+)?(?:\{[^}]*\}|\*\s+as\s+\w+|[\w$]+)\s+from\s+['"][^'"]+['"];?\s*$/gms,""),n=n.replace(/import\s*\(\s*['"][^'"]+['"]\s*\)/g,"any"),n=n.replace(/\n{3,}/g,"\n\n"),n}function w(e){d=e}function k(e,n){return d?`${d}/${encodeURIComponent(e)}/types?version=${encodeURIComponent(n)}`:`https://cdn.jsdelivr.net/npm/${e}@${n}/dist/index.d.ts`}async function x(e,n){const{package:t,version:r="latest"}=n,o=`file:///node_modules/${t}/index.d.ts`;if(i.has(o))return!0;const a=k(t,r);try{const n=await fetch(a);if(!n.ok)return!1;let r=await n.text();r=v(r);const s=`declare module '${t}' {\n${r}\n}`;return h(e,o,s)}catch{return!1}}function T(e){const n="file:///node_modules/@walkeros/core/index.d.ts";if(i.has(n))return!0;return h(e,n,`declare module '@walkeros/core' {\n${v(s)}\n}`)}function S(r,o){y(r,`file:///context/${o.type}.d.ts`,function(r){switch(r){case"fn":return e;case"condition":return n;case"validate":return t;default:return""}}(o.type))}function C(e,n,t){y(e,`file:///destinations/${n}.d.ts`,t)}function $(e){m(`file:///destinations/${e}.d.ts`)}function E(e){g(e),T(e),P(e)}function P(e){if(c.has(e))return;c.add(e);const n="\n import type {\n getMappingEvent as _getMappingEvent,\n getMappingValue as _getMappingValue,\n WalkerOS,\n } from '@walkeros/core';\n\n declare global {\n const getMappingEvent: typeof _getMappingEvent;\n const getMappingValue: typeof _getMappingValue;\n const elb: WalkerOS.Elb;\n }\n\n export {};\n ",t="file:///node_modules/@walkeros/_ambient/index.d.ts";e.languages.typescript.typescriptDefaults.addExtraLib(n,t),e.languages.typescript.javascriptDefaults.addExtraLib(n,t)}function R(e){g(e),T(e),S(e,{type:"condition"})}function _(){return Array.from(i.keys())}function O(){for(const e of i.values())e.disposable?.dispose();i.clear()}((e,n)=>{for(var t in n)r(e,t,{get:n[t],enumerable:!0})})(f,{addDestinationType:()=>C,addFunctionContextTypes:()=>S,addTypeLibrary:()=>h,clearAllTypeLibraries:()=>O,configureMonacoTypeScript:()=>g,getLoadedTypeLibraries:()=>_,initializeMonacoTypes:()=>R,loadPackageTypes:()=>x,loadTypeLibraryFromURL:()=>b,loadWalkerOSCoreTypes:()=>T,registerWalkerOSAmbients:()=>P,registerWalkerOSTypes:()=>E,removeDestinationType:()=>$,removeTypeLibrary:()=>m,resolveTypesUrl:()=>k,setPackageTypesBaseUrl:()=>w,updateTypeLibrary:()=>y});var F=a({"src/utils/monaco-types.ts"(){"use strict";u(),p(),i=new Map,l=new WeakSet,c=new WeakSet}});import{useState as I,useEffect as j,useRef as M,useCallback as N,useMemo as D}from"react";import{startFlow as A}from"@walkeros/collector";import{useRef as L,useState as V,useEffect as W,useCallback as B,useMemo as z}from"react";import{createContext as G,useContext as U,useRef as H}from"react";var q=G(null);function J(){return U(q)}import{jsx as K,jsxs as X}from"react/jsx-runtime";function Y({children:e,columns:n,minBoxWidth:t,gap:r,rowHeight:o="equal",maxRowHeight:a,showScrollButtons:s=!0,className:i=""}){const l=L(null),[c,d]=V(!1),[u,p]=V(!1),[f,g]=V(new Map),h=L(0),m=B(()=>h.current++,[]),y=B((e,n)=>{g(t=>{const r=new Map(t);return r.set(e,n),r})},[]),b=B(e=>{g(n=>{const t=new Map(n);return t.delete(e),t})},[]),v=z(()=>"synced"!==o||0===f.size?null:Math.min(600,Math.max(...Array.from(f.values()))),[f,o]),w=z(()=>({registerBox:y,unregisterBox:b,getBoxId:m,syncedHeight:v,enabled:"synced"===o}),[y,b,m,v,o]),k=["elb-explorer-grid"],x={};"auto"===o?k.push("elb-explorer-grid--row-auto"):"equal"===o?k.push("elb-explorer-grid--row-equal"):"synced"===o?k.push("elb-explorer-grid--row-synced"):"number"==typeof o&&(x["--grid-row-min-height"]=`${o}px`,x["--grid-row-max-height"]=`${o}px`),i&&k.push(i),void 0!==r&&(x.gap="number"==typeof r?`${r}px`:r),void 0!==t&&(x["--grid-min-box-width"]="number"==typeof t?`${t}px`:t),void 0!==a&&(x["--grid-row-max-height"]="none"===a?"none":"number"==typeof a?`${a}px`:a);const T=B(()=>{const e=l.current;if(!e)return;const n=e.scrollWidth>e.clientWidth,t=e.scrollLeft<=1,r=e.scrollLeft+e.clientWidth>=e.scrollWidth-1;d(n&&!t),p(n&&!r)},[]);return W(()=>{const e=l.current;if(e&&s)return T(),e.addEventListener("scroll",T),window.addEventListener("resize",T),()=>{e.removeEventListener("scroll",T),window.removeEventListener("resize",T)}},[T,s]),K(q.Provider,{value:w,children:X("div",{className:"elb-explorer elb-explorer-grid-wrapper",children:[s&&c&&K("button",{className:"elb-explorer-grid-scroll-button elb-explorer-grid-scroll-button--left",onClick:()=>{if(!l.current)return;const e=.8*l.current.clientWidth;l.current.scrollBy({left:-e,behavior:"smooth"})},"aria-label":"Scroll left",type:"button",children:"‹"}),K("div",{ref:l,className:k.join(" "),style:x,children:e}),s&&u&&K("button",{className:"elb-explorer-grid-scroll-button elb-explorer-grid-scroll-button--right",onClick:()=>{if(!l.current)return;const e=.8*l.current.clientWidth;l.current.scrollBy({left:e,behavior:"smooth"})},"aria-label":"Scroll right",type:"button",children:"›"})]})})}import{useState as Q,useEffect as Z,useRef as ee,useCallback as ne,useMemo as te}from"react";import{sourceBrowser as re}from"@walkeros/web-source-browser";import{useState as oe}from"react";import{jsx as ae,jsxs as se}from"react/jsx-runtime";function ie({label:e,children:n}){return se("div",{className:"elb-explorer-header",children:[ae("span",{className:"elb-explorer-label",children:e}),n]})}import{jsx as le,jsxs as ce}from"react/jsx-runtime";function de(){return ce("div",{className:"elb-explorer-traffic-lights",children:[le("span",{className:"elb-explorer-traffic-light elb-explorer-traffic-light--red"}),le("span",{className:"elb-explorer-traffic-light elb-explorer-traffic-light--yellow"}),le("span",{className:"elb-explorer-traffic-light elb-explorer-traffic-light--green"})]})}function ue({header:e,headerActions:n,footer:t,children:r,className:o="",style:a,height:s,minHeight:i,maxHeight:l,tiny:c=!1,resizable:d=!1,showHeader:u=!0,tabs:p,activeTab:f,onTabChange:g,defaultTab:h,showTrafficLights:m=!1}){const y=J(),[b,v]=oe(h||(p?.[0]?.id??"")),w=void 0!==f,k=w?f:b,x={...a};void 0!==s?x.height="number"==typeof s?`${s}px`:s:y?.syncedHeight&&(x.height=`${y.syncedHeight}px`),c?(x.height="auto",x.minHeight=void 0!==i?"number"==typeof i?`${i}px`:i:"100px"):void 0!==i&&(x.minHeight="number"==typeof i?`${i}px`:i),void 0!==l&&(x.maxHeight="number"==typeof l?`${l}px`:l),d&&(x.resize="vertical",x.overflow="auto");const T=!!y?.enabled?"elb-box--auto-height":"",S=p?.find(e=>e.id===k)?.content,C=S??r,$=p&&p.length>0,E=u&&e&&!$;return ce("div",{className:`elb-explorer elb-explorer-box ${T} ${o}`.trim(),style:x,children:[$&&ce("div",{className:"elb-explorer-tabs",children:[m&&le(de,{}),p.map(e=>le("button",{type:"button",className:"elb-explorer-tab "+(k===e.id?"elb-explorer-tab--active":""),onClick:()=>{return n=e.id,g&&g(n),void(w||v(n));var n},children:e.label},e.id)),n&&le("div",{className:"elb-explorer-tab-actions",children:n})]}),E&&le(ie,{label:e,children:n}),le("div",{className:"elb-explorer-content",children:C}),t&&le("div",{className:"elb-explorer-footer",children:t})]})}import{jsx as pe}from"react/jsx-runtime";var fe=[{type:"globals",label:"Globals",highlightClass:"highlight-globals"},{type:"context",label:"Context",highlightClass:"highlight-context"},{type:"entity",label:"Entity",highlightClass:"highlight-entity"},{type:"property",label:"Property",highlightClass:"highlight-property"},{type:"action",label:"Action",highlightClass:"highlight-action"}];function ge({highlights:e,onToggle:n,buttons:t=fe}){return pe("div",{className:"elb-preview-footer",children:t.map(t=>pe("button",{className:`elb-preview-btn ${e.has(t.type)?t.highlightClass:""}`,onClick:()=>n(t.type),type:"button",children:t.label},t.type))})}import{jsx as he}from"react/jsx-runtime";function me({active:e=!1,onClick:n,children:t,className:r=""}){return he("button",{className:`elb-explorer-btn ${e?"active":""} ${r}`,onClick:n,type:"button",children:t})}import{jsx as ye}from"react/jsx-runtime";function be({buttons:e,onButtonClick:n,className:t="",variant:r="segmented"}){return ye("div",{className:`elb-explorer-button-group${"tabs"===r?" elb-explorer-button-group--tabs":""} ${t}`,children:e.map(e=>ye(me,{active:e.active,onClick:()=>n(e.value),children:e.label},e.value))})}import{useEffect as ve,useState as we,useRef as ke,useCallback as xe}from"react";import{Editor as Te,loader as Se}from"@monaco-editor/react";var Ce="elbTheme-dark",$e="elbTheme-light";function Ee(e){return e.flatMap(e=>e.scopes.map(n=>{const t={token:n};return void 0!==e.foreground&&(t.foreground=e.foreground),void 0!==e.fontStyle&&(t.fontStyle=e.fontStyle),t}))}var Pe="697098",Re="c3e88d",_e="f78c6c",Oe="c084fc",Fe="82aaff",Ie="ffcb6b",je="bfc7d5",Me={base:"vs-dark",inherit:!0,rules:Ee([{foreground:Pe,fontStyle:"italic",scopes:["comment","comment.block","comment.line","comment.html","comment.line.double-slash","comment.line.number-sign","comment.block.documentation","punctuation.definition.comment"]},{foreground:Re,scopes:["string","string.quoted","string.template","string.value.json","string.json","string.html","string.css","string.js","string.ts","string.quoted.single","string.quoted.double","string.quoted.triple","punctuation.definition.string","punctuation.definition.string.begin","punctuation.definition.string.end","meta.string","attribute.value.html"]},{foreground:"89ddff",scopes:["string.regexp"]},{foreground:_e,scopes:["number","number.hex","number.binary","number.octal","number.float","constant.numeric","constant.numeric.decimal","constant.numeric.integer","constant.numeric.float","constant.numeric.hex","constant.numeric.binary","constant.numeric.octal","keyword.other.unit"]},{foreground:Oe,fontStyle:"italic",scopes:["keyword","keyword.control","keyword.control.flow","keyword.control.import","keyword.control.conditional","keyword.control.loop","storage.type","storage.modifier","keyword.declaration"]},{foreground:Oe,scopes:["keyword.other"]},{foreground:"89ddff",scopes:["operator","operators","keyword.operator","keyword.operator.assignment","keyword.operator.arithmetic","keyword.operator.logical","keyword.operator.comparison","keyword.operator.type","keyword.operator.type.ts"]},{foreground:Fe,scopes:["function","identifier.function","support.function","entity.name.function","meta.function-call","meta.function-call.entity.name.function","variable.function"]},{foreground:Ie,scopes:["type","type.identifier","entity.name.type","entity.name.class","support.type","support.class","support.type.primitive.ts","support.type.primitive.js","entity.name.type.ts","entity.name.type.js","meta.type.annotation","meta.type.annotation.ts","entity.other.inherited-class","storage.type.class","storage.type.function","storage.type.interface","support.type.primitive"]},{foreground:je,scopes:["variable","variable.name","variable.parameter","variable.parameter.ts","variable.parameter.js","variable.other","variable.other.readwrite","variable.other.constant","variable.language","meta.definition.variable","identifier","identifier.ts","identifier.js","support.type.property-name","support.type.property-name.json","string.key.json","string.name.tag.json","meta.object-literal.key","variable.other.property","variable.other.object.property","variable.other.constant.property"]},{foreground:Fe,scopes:["constant","constant.character","support.constant"]},{foreground:"ff5874",scopes:["constant.language","constant.language.boolean","constant.language.null","constant.language.undefined","constant.language.boolean.true","constant.language.boolean.false","keyword.constant.boolean"]},{foreground:"c792ea",scopes:["delimiter","delimiter.bracket","delimiter.parenthesis","delimiter.square","delimiter.html","punctuation","punctuation.separator","punctuation.definition","punctuation.terminator","punctuation.section","meta.brace","meta.brace.round","meta.brace.square","meta.brace.curly","meta.tag.html","punctuation.definition.tag.html"]},{foreground:"ff5572",scopes:["tag","meta.tag","entity.name.tag","entity.name.tag.tsx","entity.name.tag.jsx","punctuation.definition.tag","punctuation.definition.tag.begin","punctuation.definition.tag.end"]},{foreground:Re,scopes:["attribute.name","entity.other.attribute-name","meta.attribute"]},{foreground:"b2ccd6",scopes:["namespace","entity.name.namespace","storage.type.namespace"]},{foreground:"dddddd",scopes:["markup.underline.link","string.other.link"]},{foreground:Oe,fontStyle:"italic",scopes:["meta.tag.sgml.doctype"]},{fontStyle:"bold",scopes:["markup.bold"]},{fontStyle:"italic",scopes:["markup.italic"]},{foreground:Oe,fontStyle:"bold",scopes:["markup.heading"]},{foreground:Re,scopes:["markup.raw"]},{foreground:Pe,fontStyle:"italic",scopes:["markup.quote"]},{foreground:je,scopes:["markup.list"]},{foreground:je,scopes:["entity.name.tag.html","tag.html","entity.other.attribute-name.html","attribute.name.html"]},{foreground:"ff5572",scopes:["entity.name.tag.css"]},{foreground:Ie,scopes:["entity.other.attribute-name.class.css"]},{foreground:"82aaff",scopes:["entity.other.attribute-name.id.css"]},{foreground:"c084fc",scopes:["support.type.property-name.css"]},{foreground:_e,scopes:["support.constant.property-value.css","keyword.other.unit.css"]},{foreground:"ff5572",scopes:["invalid","invalid.illegal"]},{foreground:"f78c6c",scopes:["invalid.deprecated"]}]),colors:{"editor.background":"#00000000","editor.foreground":"#bfc7d5","editor.lineHighlightBackground":"#00000000","editorLineNumber.foreground":"#676E95","editorLineNumber.activeForeground":"#c084fc","editorCursor.foreground":"#c084fc","editor.selectionBackground":"#717CB450","editor.inactiveSelectionBackground":"#717CB430","editor.selectionHighlightBackground":"#717CB420","editorGutter.background":"#00000000","editorGutter.modifiedBackground":"#82aaff","editorGutter.addedBackground":"#c3e88d","editorGutter.deletedBackground":"#ff5572","editorWidget.background":"#1e1e2e","editorWidget.border":"#676E95","editorSuggestWidget.background":"#1e1e2e","editorSuggestWidget.border":"#676E95","editorSuggestWidget.selectedBackground":"#717CB440","editorStickyScroll.background":"#292d3e","editorStickyScroll.border":"#676E9540","editorStickyScrollHover.background":"#292d3e","editorStickyScroll.shadow":"#00000000","editorStickyScrollGutter.background":"#292d3e","editorHoverWidget.background":"#1e1e2e","editorHoverWidget.border":"#676E95","editorHoverWidget.statusBarBackground":"#676E95","editorInlineHint.background":"#292d3e","editorInlineHint.foreground":"#676E95","editorCodeLens.foreground":"#697098","editorGhostText.foreground":"#676E9540","editorWhitespace.foreground":"#676E9540","editorIndentGuide.background":"#676E9520","editorIndentGuide.activeBackground":"#676E95","scrollbar.shadow":"#00000000","scrollbarSlider.background":"#676E9530","scrollbarSlider.hoverBackground":"#676E9550","scrollbarSlider.activeBackground":"#676E9570","editorBracketMatch.background":"#676E9540","editorBracketMatch.border":"#676E95","editor.findMatchBackground":"#717CB440","editor.findMatchHighlightBackground":"#676E9530","editor.findRangeHighlightBackground":"#676E9520","minimap.background":"#292d3e","minimap.selectionHighlight":"#717CB440","minimap.findMatchHighlight":"#717CB440","editorOverviewRuler.border":"#676E9520","editorOverviewRuler.modifiedForeground":"#82aaff","editorOverviewRuler.addedForeground":"#c3e88d","editorOverviewRuler.deletedForeground":"#ff5572","peekView.border":"#676E95","peekViewEditor.background":"#1e1e2e","peekViewResult.background":"#1e1e2e","peekViewTitle.background":"#1e1e2e","diffEditor.insertedTextBackground":"#c3e88d20","diffEditor.removedTextBackground":"#ff557220"}};function Ne(e){e.editor.defineTheme(Ce,Me)}var De="6A737D",Ae="22863A",Le="6F42C1",Ve="005CC5",We="24292E",Be={base:"vs",inherit:!0,rules:Ee([{foreground:De,fontStyle:"italic",scopes:["comment","comment.block","comment.line","comment.html","comment.line.double-slash","comment.line.number-sign","comment.block.documentation","punctuation.definition.comment"]},{foreground:Ae,scopes:["string","string.quoted","string.template","string.value.json","string.json","string.html","string.css","string.js","string.ts","string.quoted.single","string.quoted.double","string.quoted.triple","punctuation.definition.string","punctuation.definition.string.begin","punctuation.definition.string.end","meta.string","attribute.value.html"]},{foreground:"032F62",scopes:["string.regexp"]},{foreground:"D73A49",scopes:["number","number.hex","number.binary","number.octal","number.float","constant.numeric.decimal","constant.numeric.integer","constant.numeric.float","constant.numeric.hex","constant.numeric.binary","constant.numeric.octal","keyword.other.unit"]},{foreground:"fb923c",scopes:["constant.numeric"]},{foreground:Le,fontStyle:"italic",scopes:["keyword","keyword.control","keyword.control.flow","keyword.control.import","keyword.control.conditional","keyword.control.loop","storage.type","storage.modifier","keyword.declaration"]},{foreground:Le,scopes:["keyword.other"]},{foreground:"01b5e2",scopes:["operator","operators"]},{foreground:"0086B3",scopes:["keyword.operator","keyword.operator.assignment","keyword.operator.arithmetic","keyword.operator.logical","keyword.operator.comparison","keyword.operator.type","keyword.operator.type.ts"]},{foreground:Ve,scopes:["function","identifier.function","support.function","entity.name.function","meta.function-call","meta.function-call.entity.name.function","variable.function"]},{foreground:"B08800",scopes:["type","type.identifier","entity.name.type","entity.name.class","support.type","support.class","support.type.primitive.ts","support.type.primitive.js","entity.name.type.ts","entity.name.type.js","meta.type.annotation","meta.type.annotation.ts","entity.other.inherited-class","storage.type.class","storage.type.function","storage.type.interface","support.type.primitive"]},{foreground:We,scopes:["variable","variable.name","variable.parameter","variable.parameter.ts","variable.parameter.js","variable.other","variable.other.readwrite","variable.other.constant","variable.language","meta.definition.variable","identifier","identifier.ts","identifier.js","support.type.property-name","support.type.property-name.json","string.key.json","string.name.tag.json","meta.object-literal.key","variable.other.property","variable.other.object.property","variable.other.constant.property"]},{foreground:Ve,scopes:["constant","constant.character","support.constant"]},{foreground:"ef4444",scopes:["constant.language","constant.language.boolean","constant.language.null","constant.language.undefined","constant.language.boolean.true","constant.language.boolean.false","keyword.constant.boolean"]},{foreground:We,scopes:["delimiter","delimiter.bracket","delimiter.parenthesis","delimiter.square","delimiter.html","punctuation","punctuation.separator","punctuation.definition","punctuation.terminator","punctuation.section","meta.brace","meta.brace.round","meta.brace.square","meta.brace.curly","meta.tag.html","punctuation.definition.tag.html"]},{foreground:"D73A49",scopes:["tag","meta.tag","entity.name.tag","entity.name.tag.tsx","entity.name.tag.jsx","punctuation.definition.tag","punctuation.definition.tag.begin","punctuation.definition.tag.end"]},{foreground:Ae,scopes:["attribute.name","entity.other.attribute-name","meta.attribute"]},{foreground:"6F42C1",scopes:["namespace","entity.name.namespace","storage.type.namespace"]},{foreground:"005CC5",scopes:["markup.underline.link","string.other.link"]},{foreground:De,fontStyle:"italic",scopes:["meta.tag.sgml.doctype"]},{fontStyle:"bold",scopes:["markup.bold"]},{fontStyle:"italic",scopes:["markup.italic"]},{foreground:Le,fontStyle:"bold",scopes:["markup.heading"]},{foreground:Ae,scopes:["markup.raw"]},{foreground:De,fontStyle:"italic",scopes:["markup.quote"]},{foreground:We,scopes:["markup.list"]},{foreground:We,scopes:["entity.name.tag.html","tag.html","entity.other.attribute-name.html","attribute.name.html"]},{foreground:"D73A49",scopes:["entity.name.tag.css"]},{foreground:"B08800",scopes:["entity.other.attribute-name.class.css"]},{foreground:"005CC5",scopes:["entity.other.attribute-name.id.css"]},{foreground:"6F42C1",scopes:["support.type.property-name.css"]},{foreground:"D73A49",scopes:["support.constant.property-value.css","keyword.other.unit.css"]},{foreground:"CB2431",scopes:["invalid","invalid.illegal"]},{foreground:"D73A49",scopes:["invalid.deprecated"]}]),colors:{"editor.background":"#00000000","editor.foreground":"#24292E","editor.lineHighlightBackground":"#00000000","editorLineNumber.foreground":"#1B1F2380","editorLineNumber.activeForeground":"#6F42C1","editorCursor.foreground":"#6F42C1","editor.selectionBackground":"#0366D630","editor.inactiveSelectionBackground":"#0366D620","editor.selectionHighlightBackground":"#0366D615","editorGutter.background":"#00000000","editorGutter.modifiedBackground":"#005CC5","editorGutter.addedBackground":"#28A745","editorGutter.deletedBackground":"#D73A49","editorWidget.background":"#F6F8FA","editorWidget.border":"#E1E4E8","editorSuggestWidget.background":"#F6F8FA","editorSuggestWidget.border":"#E1E4E8","editorSuggestWidget.selectedBackground":"#0366D625","editorStickyScroll.background":"#ffffff","editorStickyScroll.border":"#E1E4E8","editorStickyScrollHover.background":"#ffffff","editorStickyScroll.shadow":"#00000000","editorStickyScrollGutter.background":"#ffffff","editorHoverWidget.background":"#F6F8FA","editorHoverWidget.border":"#E1E4E8","editorHoverWidget.statusBarBackground":"#E1E4E8","editorInlineHint.background":"#F6F8FA","editorInlineHint.foreground":"#6A737D","editorCodeLens.foreground":"#6A737D","editorGhostText.foreground":"#1B1F2350","editorWhitespace.foreground":"#1B1F2340","editorIndentGuide.background":"#E1E4E820","editorIndentGuide.activeBackground":"#E1E4E8","scrollbar.shadow":"#00000000","scrollbarSlider.background":"#1B1F2330","scrollbarSlider.hoverBackground":"#1B1F2350","scrollbarSlider.activeBackground":"#1B1F2370","editorBracketMatch.background":"#34D05840","editorBracketMatch.border":"#34D058","editor.findMatchBackground":"#FFDF5D40","editor.findMatchHighlightBackground":"#FFDF5D30","editor.findRangeHighlightBackground":"#0366D620","minimap.background":"#FAFBFC","minimap.selectionHighlight":"#0366D625","minimap.findMatchHighlight":"#FFDF5D40","editorOverviewRuler.border":"#E1E4E820","editorOverviewRuler.modifiedForeground":"#005CC5","editorOverviewRuler.addedForeground":"#28A745","editorOverviewRuler.deletedForeground":"#D73A49","peekView.border":"#0366D6","peekViewEditor.background":"#F6F8FA","peekViewResult.background":"#FAFBFC","peekViewTitle.background":"#F6F8FA","diffEditor.insertedTextBackground":"#28A74520","diffEditor.removedTextBackground":"#D73A4920"}};function ze(e){e.editor.defineTheme($e,Be)}function Ge(e){Ne(e),ze(e)}F();var Ue=[/\bdata-elb(?!-)\b/g,/\bdata-elbaction\b/g,/\bdata-elbactions\b/g,/\bdata-elbglobals\b/g,/\bdata-elbcontext\b/g,/\bdata-elblink\b/g,/\bdata-elb-[\w-]+\b/g];var He=[{type:"variable",regex:/\$var\.(\w*(?:\.[\w.]*)?)/g,className:"elb-ref-variable"},{type:"secret",regex:/\$secret\.(\w*)/g,className:"elb-ref-secret"},{type:"env",regex:/\$env\.(\w*)(?::[^"}\s]*)?/g,className:"elb-ref-env"},{type:"contract",regex:/\$contract\.(\w*(?:\.[\w.]*)?)/g,className:"elb-ref-contract"},{type:"store",regex:/\$store\.(\w*)/g,className:"elb-ref-store"},{type:"flow",regex:/\$flow\.(\w*(?:\.[\w.]*)?)/g,className:"elb-ref-flow"},{type:"code",regex:/\$code:/g,className:"elb-ref-code"}];function qe(e){const n=[];for(const t of He){const r=new RegExp(t.regex.source,t.regex.flags);let o;for(;null!==(o=r.exec(e));)n.push({type:t.type,name:"code"===t.type?"":o[1]||"",startIndex:o.index,endIndex:o.index+o[0].length})}return n}function Je(e){let n=[];function t(){const t=e.getModel();if(!t)return;const r=qe(t.getValue()).map(e=>{const n=t.getPositionAt(e.startIndex),r=t.getPositionAt(e.endIndex),o=He.find(n=>n.type===e.type);return{range:{startLineNumber:n.lineNumber,startColumn:n.column,endLineNumber:r.lineNumber,endColumn:r.column},options:{inlineClassName:o.className}}});n=e.deltaDecorations(n,r)}t();const r=e.onDidChangeModelContent(()=>t());return()=>{r.dispose(),e.deltaDecorations(n,[])}}function Ke(){if("undefined"==typeof document)return;if(document.getElementById("walkeros-ref-styles"))return;const e=document.createElement("style");e.id="walkeros-ref-styles",e.textContent="\n .monaco-editor .elb-ref-variable { color: #89ddff !important; font-style: italic; }\n .monaco-editor .elb-ref-secret { color: #ffcb6b !important; font-style: italic; }\n .monaco-editor .elb-ref-env { color: #ffcb6b !important; font-style: italic; }\n .monaco-editor .elb-ref-contract { color: #c3e88d !important; font-style: italic; }\n .monaco-editor .elb-ref-store { color: #89ddff !important; font-style: italic; }\n .monaco-editor .elb-ref-flow { color: #82aaff !important; font-style: italic; }\n .monaco-editor .elb-ref-code { color: #c084fc !important; }\n ",document.head.appendChild(e)}import{REF_ENV as Xe,REF_CONTRACT as Ye,REF_FLOW as Qe,REF_STORE as Ze,REF_SECRET as en}from"@walkeros/core";import{resolveContracts as nn}from"@walkeros/core";var tn="",rn={};function on(e){const n=e.properties;return n&&"object"==typeof n?Object.entries(n).map(([e,n])=>({key:e,type:"string"==typeof n?.type?n.type:void 0})):[]}function an(e,n){if(!e||0===Object.keys(e).length)return[];const t=function(e){const n=JSON.stringify(e);if(n!==tn)try{rn=nn(e),tn=n}catch{return{}}return rn}(e);if(0===Object.keys(t).length)return[];if(0===n.length)return Object.keys(t).map(e=>({key:e,detail:t[e].description||"contract"}));const[r,...o]=n,a=t[r];if(!a)return[];if(0===o.length){const e=[];return void 0!==a.tagging&&e.push({key:"tagging",type:"number"}),void 0!==a.description&&e.push({key:"description",type:"string"}),a.schema&&e.push({key:"schema",detail:"JSON Schema"}),a.events&&e.push({key:"events",detail:"entity map"}),e}const s=o[0];if("schema"===s){const e=a.schema;return e&&"object"==typeof e?function(e,n){let t=e;for(const e of n){const n=t[e];if(!n||"object"!=typeof n)return[];t=n}if(t.properties&&"object"==typeof t.properties)return on(t);return Object.keys(t).filter(e=>"__proto__"!==e).map(e=>({key:e}))}(e,o.slice(1)):[]}if("events"===s){if(!a.events)return[];if(1===o.length)return Object.keys(a.events).filter(e=>"*"!==e).map(e=>({key:e,detail:"entity"}));const e=o[1],n=a.events[e];if(!n)return[];if(2===o.length)return Object.keys(n).filter(e=>"*"!==e).map(e=>({key:e,detail:"action"}));const t=n[o[2]];return t&&"object"==typeof t?3===o.length?on(t):function(e,n){let t=e;for(const e of n){const n=t.properties;if(!n||!n[e])return[];t=n[e]}return on(t)}(t,o.slice(3)):[]}return[]}function sn(e){return e&&0!==Object.keys(e).length?Object.entries(e).map(([e,n])=>({label:`$var.${e}`,insertText:`$var.${e}`,detail:`= ${JSON.stringify(n)}`,documentation:`Variable reference. Resolves to \`${JSON.stringify(n)}\` at runtime.`,kind:"variable",sortText:"0_var_"+e})):[]}function ln(e){return e&&0!==e.length?e.map(e=>({label:`$secret.${e}`,insertText:`$secret.${e}`,detail:"(secret)",documentation:"Secret reference. Value is securely injected at runtime. Never stored in config.",kind:"secret",sortText:"0_secret_"+e})):[]}function cn(e){return e&&0!==e.length?e.map(e=>({label:`$store.${e}`,insertText:`$store.${e}`,detail:"(store)",documentation:"Store reference. Injected as store instance at runtime.",kind:"reference",sortText:"0_store_"+e})):[]}function dn(e){return e&&0!==e.length?e.map(e=>({label:`$flow.${e}`,insertText:`$flow.${e}`,detail:"(flow)",documentation:`Cross-flow reference. Resolves to the resolved Flow.Config of "${e}" at runtime. Append \`.url\`, \`.settings.<key>\`, or another path inside that flow's config.`,kind:"reference",sortText:"0_flow_"+e})):[]}function un(e){return e&&0!==e.length?e.map(e=>({label:`$env.${e}`,insertText:`$env.${e}`,detail:"(env var)",documentation:`Environment variable. Resolved from process.env at runtime. Add a literal default with $env.${e}:default.`,kind:"variable",sortText:"0_env_"+e})):[]}var pn=[{label:"data",insertText:"data",detail:"(event data)",kind:"property",sortText:"0_event_data"},{label:"globals",insertText:"globals",detail:"(global properties)",kind:"property",sortText:"0_event_globals"},{label:"user",insertText:"user",detail:"(user properties)",kind:"property",sortText:"0_event_user"},{label:"context",insertText:"context",detail:"(context data)",kind:"property",sortText:"0_event_context"},{label:"custom",insertText:"custom",detail:"(custom properties)",kind:"property",sortText:"0_event_custom"},{label:"consent",insertText:"consent",detail:"(consent state)",kind:"property",sortText:"0_event_consent"},{label:"nested",insertText:"nested",detail:"(nested entities)",kind:"property",sortText:"0_event_nested"},{label:"entity",insertText:"entity",detail:"(string)",kind:"property",sortText:"1_event_entity"},{label:"action",insertText:"action",detail:"(string)",kind:"property",sortText:"1_event_action"},{label:"name",insertText:"name",detail:"(string)",kind:"property",sortText:"1_event_name"},{label:"trigger",insertText:"trigger",detail:"(string)",kind:"property",sortText:"1_event_trigger"},{label:"timestamp",insertText:"timestamp",detail:"(number)",kind:"property",sortText:"1_event_timestamp"},{label:"timing",insertText:"timing",detail:"(number)",kind:"property",sortText:"1_event_timing"},{label:"id",insertText:"id",detail:"(string)",kind:"property",sortText:"1_event_id"},{label:"group",insertText:"group",detail:"(string)",kind:"property",sortText:"1_event_group"},{label:"count",insertText:"count",detail:"(number)",kind:"property",sortText:"1_event_count"},{label:"source",insertText:"source",detail:"(source info)",kind:"property",sortText:"1_event_source"},{label:"version",insertText:"version",detail:"(version info)",kind:"property",sortText:"1_event_version"}];function fn(e,n,t,r){if(!r)return pn;if(!e||0===Object.keys(e).length)return[];const o="data"===r;if(!o&&!new Set(["globals","context","custom","user","consent"]).has(r))return[];const a=[],s=new Set;for(const i of Object.keys(e)){const l=an(e,o?[i,"events",n,t]:[i,"schema","properties",r,"properties"]);for(const e of l)s.has(e.key)||(s.add(e.key),a.push({label:`${r}.${e.key}`,insertText:`${r}.${e.key}`,detail:e.type?`(${e.type})`:"(property)",documentation:`Event property from contract. Maps to event.${r}.${e.key}.`,kind:"property",sortText:`0_mapping_${e.key}`}))}return a}function gn(e,n){if(!e||0===Object.keys(e).length)return[];const t=an(e,n),r=n.length>0?`$contract.${n.join(".")}.`:"$contract.";return t.map(e=>({label:`${r}${e.key}`.replace(/\.$/,""),insertText:0===n.length?`$contract.${e.key}`:`$contract.${n.join(".")}.${e.key}`,detail:e.type?`(${e.type})`:e.detail?`(${e.detail})`:"(contract)",documentation:`Contract reference. Resolves to the ${e.key} ${e.detail||"value"} at runtime.`,kind:"property",sortText:"0_contract_"+n.concat(e.key).join("_")}))}function hn(e,n){const t=[];let r,o=0,a=!1,s=-1,i=!1;for(;o<e.length&&o<=n;){const n=e[o];if(i)i=!1,o++;else if("\\"===n&&a)i=!0,o++;else{if('"'===n)if(a){const n=e.substring(s,o);a=!1;let t=o+1;for(;t<e.length&&/\s/.test(e[t]);)t++;":"===e[t]&&(r=n)}else a=!0,s=o+1;else a||("{"===n?void 0!==r&&(t.push(r),r=void 0):"}"===n&&t.pop());o++}}return void 0!==r&&t.push(r),t}function mn(e,n=[]){const t=["var","env","secret"],r=n.includes("env"),o=n.includes("settings");r&&t.push("store");("source"===e||"destination"===e)&&(o||r)&&t.push("flow");const a=n.indexOf("validate");return a>=0&&"events"===n[a+1]&&n.length>=a+4&&t.push("contract"),t}function yn(e){const n=e.source.replace(/^\^/,"").replace(/\$$/,"").replace(/\(\.\+\)\?$/,"([\\w.]+)?");return new RegExp(n,"g")}var bn=Ye.source.replace(/^\^/,"").split(/\\\./,1)[0],vn=new RegExp(`${bn}\\.([a-zA-Z0-9_.]*)?$`);var wn=new Map,kn=[],xn=!1;function Tn(e,n){wn.set(e,n)}function Sn(e){wn.delete(e)}function Cn(e){xn||(xn=!0,kn.push(e.languages.registerCompletionItemProvider("json",{triggerCharacters:['"',".","$"],provideCompletionItems(n,t){const r=n.uri.toString(),o=wn.get(r);if(!o)return{suggestions:[]};const a=n.getLineContent(t.lineNumber).substring(0,t.column-1),s=n.getOffsetAt(t),i=n.getValue(),l=function(e,n){const t=hn(e,n);if(!t||0===t.length)return null;const r=t[t.length-1],o=t[t.length-2];return"next"===r||"before"===r?r:"number"!=typeof r||"next"!==o&&"before"!==o?null:o}(i,s),c=[],d=hn(i,s),u=mn(o.nodeType,d);if(a.includes("$var.")||a.endsWith('"$var')){if(!u.includes("var"))return{suggestions:[]};c.push(...sn(o.variables))}else if(a.includes("$secret.")||a.endsWith('"$secret')){if(!u.includes("secret"))return{suggestions:[]};c.push(...ln(o.secrets))}else if(a.includes("$store.")||a.endsWith('"$store')){if(!u.includes("store"))return{suggestions:[]};c.push(...cn(o.stores))}else if(a.includes("$flow.")||a.endsWith('"$flow')){if(!u.includes("flow"))return{suggestions:[]};c.push(...dn(o.flows))}else if(a.includes("$env.")||a.endsWith('"$env')){if(!u.includes("env"))return{suggestions:[]};c.push(...un(o.envNames))}else if((a.includes("$contract.")||a.endsWith('"$contract'))&&function(e,n){const t=e.getLineContent(n.lineNumber),r=n.column-1,o=t.substring(0,r),a=o.lastIndexOf('"');if(a<0)return!1;const s=o.substring(a+1);return/^\$contract(\.[a-zA-Z0-9_.]*)?$/.test(s)}(n,t)){if(!u.includes("contract"))return{suggestions:[]};const e=a.match(vn),n=e?.[1]||"",t=n?n.split(".").filter(Boolean):[];n&&!n.endsWith(".")&&t.length>0&&t.pop(),c.push(...gn(o.contractRaw,t))}else!function(e,n,t){const r=hn(e,n);return!(!r||0===r.length)&&r[r.length-1]===t}(i,s,"package")?l?c.push(...function(e,n){return e?(e.transformers||[]).map(e=>({label:e,insertText:e,detail:`transformer (${n} chain)`,documentation:`Reference to transformer step "${e}" in this flow config.`,kind:"reference",sortText:"0_step_"+e})):[]}(o.stepNames,l)):(a.endsWith('"$')||a.endsWith('"'))&&(u.includes("var")&&c.push(...sn(o.variables)),u.includes("secret")&&c.push(...ln(o.secrets)),u.includes("store")&&c.push(...cn(o.stores)),u.includes("flow")&&c.push(...dn(o.flows)),u.includes("env")&&c.push(...un(o.envNames)),u.includes("contract")&&c.push(...gn(o.contractRaw,[]))):c.push(...(p=o.packages,f=o.platform,p&&0!==p.length?(f?p.filter(e=>e.platform===f):p).map(e=>({label:e.package,insertText:e.package,detail:`${e.type} (${e.platform})`,documentation:`walkerOS ${e.type}: ${e.shortName}`,kind:"module",sortText:"1_pkg_"+e.shortName})):[]));var p,f;if(0===c.length&&o.contractRaw){const e=function(e){const n=e.indexOf("mapping");if(-1===n)return null;const t=e[n+1],r=e[n+2];return t&&r?{entity:t,action:r}:null}(hn(i,s));if(e){const n=a.match(/"([a-z_]*)\.?$/);if(n){const t=n[1],r=fn(o.contractRaw,e.entity,e.action,t);r.length>0&&c.push(...r)}}}const g=a.match(/\$(?:var|secret|env|code|contract|store|flow)[.:]?[\w.]*$/),h=g?null:a.match(/[a-z_][\w.]*$/i),m=n.getWordUntilPosition(t),y=g?t.column-g[0].length:h?t.column-h[0].length:m.startColumn,b={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:y,endColumn:t.column};return{suggestions:c.map(n=>({label:n.label,insertText:n.insertText,detail:n.detail,documentation:n.documentation,kind:En(e,n.kind),sortText:n.sortText,range:b}))}}})),kn.push(e.languages.registerHoverProvider("json",{provideHover(e,n){const t=e.uri.toString(),r=wn.get(t);if(!r)return null;const o=e.getLineContent(n.lineNumber),a=n.column-1;function s(e){const n=new RegExp(e.source,"g");let t;for(;null!==(t=n.exec(o));)if(a>=t.index&&a<=t.index+t[0].length)return t;return null}const i=s(/\$var\.([a-zA-Z_][a-zA-Z0-9_]*)(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*/g);if(i&&r.variables){const e=i[1],t=i[0];if(e in r.variables){const o=r.variables[e];return{range:{startLineNumber:n.lineNumber,startColumn:i.index+1,endLineNumber:n.lineNumber,endColumn:i.index+t.length+1},contents:[{value:`**Variable:** \`${t}\`\n\n**Value:** \`${JSON.stringify(o)}\`\n\n*Resolved at runtime via variable interpolation*`}]}}return{contents:[{value:`**Unknown variable** \`$var.${e}\`\n\nDefined variables: ${Object.keys(r.variables).join(", ")||"none"}`}]}}const l=s(yn(en));if(l){const e=l[1];return r.secrets?.includes(e)?{range:{startLineNumber:n.lineNumber,startColumn:l.index+1,endLineNumber:n.lineNumber,endColumn:l.index+l[0].length+1},contents:[{value:`**Secret:** \`$secret.${e}\`\n\n*Securely injected at runtime. Value not stored in config.*`}]}:{contents:[{value:`**Unknown secret** \`$secret.${e}\`\n\nAvailable secrets: ${r.secrets?.join(", ")||"none"}`}]}}const c=s(yn(Ze));if(c){const e=c[1];return r.stores?.includes(e)?{range:{startLineNumber:n.lineNumber,startColumn:c.index+1,endLineNumber:n.lineNumber,endColumn:c.index+c[0].length+1},contents:[{value:`**Store:** \`$store.${e}\`\n\n*Resolved to store instance at runtime.*`}]}:{contents:[{value:`**Unknown store** \`$store.${e}\`\n\nAvailable: ${r.stores?.join(", ")||"none"}`}]}}const d=s(yn(Qe));if(d&&r.flows){const e=d[1],t=d[2],o=r.flows.includes(e),a=o?`**Flow reference:** \`$flow.${e}${t?`.${t}`:""}\``:`**Unknown flow** \`$flow.${e}\``,s=o?t?`Resolves to \`flows.${e}.config.${t}\` at runtime.`:`Resolves to the full \`Flow.Config\` block of "${e}" at runtime.`:`Available: ${r.flows.join(", ")||"none"}`;return{range:{startLineNumber:n.lineNumber,startColumn:d.index+1,endLineNumber:n.lineNumber,endColumn:d.index+d[0].length+1},contents:[{value:`${a}\n\n${s}`}]}}const u=s(yn(Xe));if(u){const e=u[1];return r.envNames&&r.envNames.length>0?r.envNames.includes(e)?{range:{startLineNumber:n.lineNumber,startColumn:u.index+1,endLineNumber:n.lineNumber,endColumn:u.index+u[0].length+1},contents:[{value:`**Env var:** \`$env.${e}\`\n\n*Resolved from process.env at runtime. Append \`:default\` for a literal fallback.*`}]}:{contents:[{value:`**Unknown env var** \`$env.${e}\`\n\nKnown: ${r.envNames.join(", ")||"none"}`}]}:{range:{startLineNumber:n.lineNumber,startColumn:u.index+1,endLineNumber:n.lineNumber,endColumn:u.index+u[0].length+1},contents:[{value:`**Env var:** \`$env.${e}\`\n\n*Resolved from process.env at runtime.*`}]}}const p=s(yn(Ye));if(p&&r.contractRaw){const e=p[0],t=e.replace("$contract.","").split("."),r=t[0],o=1===t.length?`**Contract:** \`${e}\`\n\nNamed contract entry "${r}".`:`**Contract reference:** \`${e}\`\n\nResolves path \`${t.slice(1).join(".")}\` in contract "${r}".`;return{range:{startLineNumber:n.lineNumber,startColumn:p.index+1,endLineNumber:n.lineNumber,endColumn:p.index+p[0].length+1},contents:[{value:o}]}}return null}})))}function $n(){for(const e of kn)e.dispose();kn.length=0,xn=!1,wn.clear()}function En(e,n){switch(n){case"variable":return e.languages.CompletionItemKind.Variable;case"reference":return e.languages.CompletionItemKind.Reference;case"secret":return e.languages.CompletionItemKind.Constant;case"module":return e.languages.CompletionItemKind.Module;case"property":return e.languages.CompletionItemKind.Property;default:return e.languages.CompletionItemKind.Text}}import*as Pn from"prettier/standalone";import Rn from"prettier/plugins/babel";import _n from"prettier/plugins/estree";import On from"prettier/plugins/typescript";import Fn from"prettier/plugins/html";var In,jn=new Map,Mn=0;var Nn={typescript:"ts",javascript:"js",typescriptreact:"tsx",javascriptreact:"jsx",json:"json",html:"html",css:"css",markdown:"md"};function Dn(e="json"){return`inmemory://walkeros/model-${++Mn}.${Nn[e]??"txt"}`}function An(e,n){jn.set(e,{uri:`schema://walkeros/${e}`,fileMatch:[e],schema:n}),Vn()}function Ln(e){jn.delete(e),Vn()}function Vn(){In&&In.jsonDefaults.setDiagnosticsOptions({validate:!0,schemaValidation:"error",schemaRequest:"ignore",enableSchemaRequest:!1,schemas:Array.from(jn.values())})}import{useState as Wn,useRef as Bn,useCallback as zn}from"react";function Gn(e){if(!e||"object"!=typeof e)return!1;const n=e;return"cancelation"===n.type||!(void 0===n.cause||!Gn(n.cause))}import{jsx as Un}from"react/jsx-runtime";function Hn({code:e,language:n="javascript",onChange:t,disabled:r=!1,lineNumbers:o=!1,minimap:a=!1,folding:s=!1,wordWrap:i=!1,className:l,beforeMount:c,onMount:d,autoHeight:u,fontSize:p=13,packages:g,sticky:h=!0,ide:m=!1,isolateScroll:y=!1,jsonSchema:b,intellisenseContext:v,validate:w,onMarkerCounts:k}){const[x,T]=we(!1),[S,C]=we("vs-light"),$=ke([]),P=ke(null),R=ke(null),_=ke(null),O=J(),I=ke(null);O?.enabled&&null===I.current&&(I.current=O.getBoxId());const j=xe(e=>{O?.enabled&&null!==I.current&&O.registerBox(I.current,e)},[O]);ve(()=>()=>{O?.enabled&&null!==I.current&&O.unregisterBox(I.current)},[O]);const M="object"==typeof u?u:{},[N,D]=function({enabled:e=!1,minHeight:n=100,maxHeight:t=800,defaultHeight:r=400,onHeightChange:o}={}){const[a,s]=Wn(e?n:r),i=Bn(null),l=Bn(e?n:r),c=Bn(null),d=zn(()=>{if(e&&i.current)try{const e=i.current.getContentHeight(),r=Math.max(n,Math.min(t,e));if(r===l.current)return;l.current=r,s(r),o&&o(r+36+2)}catch(e){}},[e,n,t,o]);return[a,zn(n=>{if(c.current&&(clearTimeout(c.current),c.current=null),i.current=n,!e||!n)return s(r),void(l.current=r);setTimeout(()=>d(),50);const t=n.onDidContentSizeChange(()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{d(),c.current=null},150)});n.__heightDisposable=t},[e,r,d])]}({enabled:!!u||!!O?.enabled,minHeight:M.min??(O?.enabled?1:20),maxHeight:M.max??600,defaultHeight:O?.enabled?250:400,onHeightChange:j});ve(()=>{!function(){if("undefined"==typeof document)return;const e="elb-monaco-data-attribute-styles";if(document.getElementById(e))return;const n=document.createElement("style");n.id=e,n.textContent="\n .monaco-editor .elb-data-attribute {\n color: var(--color-highlight-primary, #01b5e2) !important;\n }\n ",document.head.appendChild(n)}()},[]);const A=xe(()=>{if("undefined"==typeof document)return null;if(_.current){const e=_.current.closest("[data-theme]");if(e)return e.getAttribute("data-theme")}return document.documentElement.getAttribute("data-theme")},[]);ve(()=>{T(!0)},[]),ve(()=>{if(!x)return;const e=()=>{const e=A(),n="dark"===e||null===e&&window.matchMedia("(prefers-color-scheme: dark)").matches;C(n?Ce:$e)};e();const n=new MutationObserver(()=>{e()});n.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});const t=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>{e()};return t.addEventListener("change",r),()=>{n.disconnect(),t.removeEventListener("change",r)}},[x,A]),ve(()=>{const e=R.current,n=_.current;if(!e||!n)return;const t=new ResizeObserver(()=>{requestAnimationFrame(()=>{e.layout()})});return t.observe(n),()=>{t.disconnect()}},[]);const L=ke(null);ke(v).current=v;const V=ke(w);V.current=w;const W=ke(k);W.current=k,L.current||(L.current=Dn(n)),ve(()=>{if(b&&L.current)return An(L.current,b),()=>{L.current&&Ln(L.current)}},[b]),ve(()=>{if(v&&L.current)return Tn(L.current,v),()=>{L.current&&Sn(L.current)}},[v]),ve(()=>{const n=R.current,t=n?.getModel();if(!n||!t)return;if(t.getValue()===e)return;const r=n.saveViewState();t.pushEditOperations([],[{range:t.getFullModelRange(),text:e}],()=>null),r&&n.restoreViewState(r)},[e]);const B=Te;ve(()=>()=>{for(const e of $.current)e();$.current=[]},[]);const z=u||O?.enabled?`${N}px`:"100%",G=`elb-code ${!!u||!!O?.enabled?"elb-code--auto-height":""} ${l||""}`.trim();return Un("div",{className:G,ref:_,children:Un(B,{height:z,language:n,defaultValue:e,onChange:e=>{t&&void 0!==e&&t(e)},beforeMount:async e=>{var t;if(P.current=e,function(e){In||(In=e.json,jn.size>0&&Vn())}(e),Ge(e),(t=e).languages.registerDocumentFormattingEditProvider("javascript",{async provideDocumentFormattingEdits(e,n){try{const t=e.getValue(),r=await Pn.format(t,{parser:"babel",plugins:[Rn,_n],tabWidth:n.tabSize,useTabs:!n.insertSpaces,semi:!0,singleQuote:!0,trailingComma:"all"});return[{range:e.getFullModelRange(),text:r}]}catch(e){return[]}}}),t.languages.registerDocumentFormattingEditProvider("typescript",{async provideDocumentFormattingEdits(e,n){try{const t=e.getValue(),r=await Pn.format(t,{parser:"typescript",plugins:[On,_n],tabWidth:n.tabSize,useTabs:!n.insertSpaces,semi:!0,singleQuote:!0,trailingComma:"all"});return[{range:e.getFullModelRange(),text:r}]}catch(e){return[]}}}),t.languages.registerDocumentFormattingEditProvider("json",{async provideDocumentFormattingEdits(e,n){try{const t=e.getValue(),r=JSON.parse(t),o=JSON.stringify(r,null,n.tabSize);return[{range:e.getFullModelRange(),text:o}]}catch(e){return[]}}}),t.languages.registerDocumentFormattingEditProvider("html",{async provideDocumentFormattingEdits(e,n){try{const t=e.getValue(),r=await Pn.format(t,{parser:"html",plugins:[Fn],tabWidth:n.tabSize,useTabs:!n.insertSpaces,htmlWhitespaceSensitivity:"css"});return[{range:e.getFullModelRange(),text:r}]}catch(e){return[]}}}),t.languages.registerDocumentFormattingEditProvider("css",{async provideDocumentFormattingEdits(e,n){try{const t=e.getValue(),r=await Pn.format(t,{parser:"css",plugins:[Fn],tabWidth:n.tabSize,useTabs:!n.insertSpaces});return[{range:e.getFullModelRange(),text:r}]}catch(e){return[]}}}),g&&g.length>0){E(e);const{loadPackageTypes:n}=await Promise.resolve().then(()=>(F(),f));for(const t of g)"@walkeros/core"!==t&&await n(e,{package:t}).catch(()=>{})}const r=A(),o="dark"===r||null===r&&window.matchMedia("(prefers-color-scheme: dark)").matches?Ce:$e;e.editor.setTheme(o),"json"===n&&Cn(e),c&&c(e)},onMount:e=>{if(R.current=e,(u||O?.enabled)&&D(e),"html"===n&&P.current&&$.current.push(function(e,n){const t=[],r=()=>{const r=e.getModel();if(!r)return;const o=r.getValue(),a=[];Ue.forEach(e=>{let t;for(;null!==(t=e.exec(o));){const e=r.getPositionAt(t.index),o=r.getPositionAt(t.index+t[0].length);a.push({range:new n.Range(e.lineNumber,e.column,o.lineNumber,o.column),options:{inlineClassName:"elb-data-attribute",inlineClassNameAffectsLetterSpacing:!0}})}});const s=e.deltaDecorations(t,a);t.length=0,t.push(...s)};r();const o=e.onDidChangeModelContent(()=>{r()});return()=>{o.dispose(),e.deltaDecorations(t,[])}}(e,P.current)),"json"===n&&(Ke(),$.current.push(Je(e))),V.current&&P.current){const n=P.current;let t;const r=()=>{const t=e.getModel();if(!t)return;const r=t.getValue(),o=V.current;if(!o)return;const a=o(r),s=[...a.errors,...a.warnings];n.editor.setModelMarkers(t,"validate",s.map(e=>({severity:"error"===e.severity?8:4,message:e.message,startLineNumber:e.line,startColumn:e.column,endLineNumber:e.endLine??e.line,endColumn:e.endColumn??e.column+1})))};r();const o=e.onDidChangeModelContent(()=>{clearTimeout(t),t=setTimeout(r,300)});$.current.push(()=>{clearTimeout(t),o.dispose()})}if(W.current&&P.current){const n=P.current,t=e.getModel(),r=!!V.current;if(t){const e=()=>{r&&n.editor.setModelMarkers(t,"json",[]);const e=n.editor.getModelMarkers({resource:t.uri});let o=0,a=0;const s=[];for(const n of e)8===n.severity?(o++,s.push({message:n.message,severity:"error",line:n.startLineNumber,column:n.startColumn})):4===n.severity&&(a++,s.push({message:n.message,severity:"warning",line:n.startLineNumber,column:n.startColumn}));W.current?.({errors:o,warnings:a,markers:s})},o=n.editor.onDidChangeMarkers(n=>{n.some(e=>e.toString()===t.uri.toString())&&e()});requestAnimationFrame(e),$.current.push(()=>{o.dispose()})}}requestAnimationFrame(()=>{e.layout()}),d&&d(e)},theme:S,path:L.current||void 0,options:{readOnly:r||!t,readOnlyMessage:{value:""},minimap:{enabled:a},fontSize:p,lineHeight:Math.round(1.5*p),padding:0,lineNumbers:o?"on":"off",lineNumbersMinChars:3,glyphMargin:!1,folding:s,lineDecorationsWidth:8,scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,detectIndentation:!1,trimAutoWhitespace:!1,wordWrap:i?"on":"off",fixedOverflowWidgets:!0,overviewRulerLanes:0,renderLineHighlight:"none",renderValidationDecorations:m||b?"editable":"off",hover:{enabled:m||!!b||!!v},"semanticHighlighting.enabled":m,showDeprecated:m,showUnused:m,"bracketPairColorization.enabled":!1,guides:{bracketPairs:!1,bracketPairsHorizontal:!1,highlightActiveBracketPair:!1,indentation:!1},scrollbar:{vertical:"auto",horizontal:"auto",alwaysConsumeMouseWheel:y},cursorBlinking:"blink",cursorStyle:"line",cursorWidth:2,cursorSmoothCaretAnimation:"off",selectionHighlight:!1,occurrencesHighlight:"off",selectOnLineNumbers:!1,wordBasedSuggestions:"off",quickSuggestions:!(!b&&!v)&&{strings:!0,other:!1,comments:!1},stickyScroll:{enabled:h}}})})}"undefined"!=typeof window&&window.addEventListener("unhandledrejection",e=>{Gn(e.reason)&&e.preventDefault()}),"undefined"!=typeof window&&Se.init().then(e=>{g(e),P(e)}).catch(e=>{console.warn("[walkerOS] Monaco loader.init() failed:",e)});import{Fragment as qn,jsx as Jn,jsxs as Kn}from"react/jsx-runtime";var Xn='<div data-elb="product" data-elbaction="click:add"><button data-elb-product="name:Example;price:9.99">Add to cart</button></div>';function Yn({html:e,css:n="",js:t="",elb:r,label:o="Preview",editable:a=!1,initialTab:s="preview",onHtmlChange:i,onCssChange:l,onJsChange:c,lineNumbers:d=!1,wordWrap:u=!1}){const p=e&&e.trim().length>0?e:Xn,[f,g]=Q(s),[h,m]=Q(new Set),y=ee(null),b=ee(void 0),v=ee(r),w=ee(e),k=ee(n),x=ee(h),T=ee(null),S=ee(!1);v.current=r,w.current=p,k.current=n,x.current=h;const C=ne(e=>{e.querySelectorAll("[data-elb]").forEach(e=>{const n=e.getAttribute("data-elb");if(!n)return;const t=`[data-elb-${n}]`;e.querySelectorAll(t).forEach(e=>{e.setAttribute("data-elbproperty","")})})},[]),$=ne(async({fireLoad:e})=>{const n=y.current;if(!n||!n.contentDocument)return;const t=n.contentDocument,r=Array.from(x.current).map(e=>`highlight-${e}`).join(" ");if(t.open(),t.write(`\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset="utf-8">\n <style>\n /* Reset */\n * { margin: 0; padding: 0; box-sizing: border-box; }\n body {\n padding: 1.5rem;\n background: #f9fafb;\n color: #111827;\n min-height: 100vh;\n }\n\n @media (prefers-color-scheme: dark) {\n body {\n background: #1f2937;\n color: #e5e7eb;\n }\n }\n\n /* User CSS */\n ${k.current}\n\n /* Highlight CSS - imported from highlight styles */\n :root {\n --highlight-globals: #4fc3f7cc;\n --highlight-context: #ffbd44cc;\n --highlight-entity: #00ca4ecc;\n --highlight-property: #ff605ccc;\n --highlight-action: #9900ffcc;\n }\n\n body.elb-highlight.highlight-globals [data-elbglobals] {\n box-shadow: 0 0 0 2px var(--highlight-globals);\n }\n\n body.elb-highlight.highlight-entity [data-elb] {\n box-shadow: 0 0 0 2px var(--highlight-entity);\n }\n\n body.elb-highlight.highlight-context [data-elbcontext] {\n box-shadow: 0 0 0 2px var(--highlight-context);\n }\n\n body.elb-highlight.highlight-property [data-elbproperty] {\n box-shadow: 0 0 0 2px var(--highlight-property);\n }\n\n body.elb-highlight.highlight-action [data-elbaction] {\n box-shadow: 0 0 0 2px var(--highlight-action);\n }\n\n /* Combined highlights */\n body.elb-highlight.highlight-entity.highlight-action [data-elb][data-elbaction] {\n box-shadow: 0 0 0 2px var(--highlight-action), 0 0 0 4px var(--highlight-entity);\n }\n\n body.elb-highlight.highlight-entity.highlight-context [data-elb][data-elbcontext] {\n box-shadow: 0 0 0 2px var(--highlight-entity), 0 0 0 4px var(--highlight-context);\n }\n\n body.elb-highlight.highlight-action.highlight-context [data-elbaction][data-elbcontext] {\n box-shadow: 0 0 0 2px var(--highlight-action), 0 0 0 4px var(--highlight-context);\n }\n </style>\n </head>\n <body class="elb-highlight ${r}">\n ${w.current}\n </body>\n </html>\n `),t.close(),C(t),T.current){try{await(T.current.instance.destroy?.(T.current.destroyContext))}catch{}T.current=null}if(v.current&&n.contentWindow&&n.contentDocument&&(await new Promise(e=>setTimeout(e,50)),n.contentWindow&&n.contentDocument&&v.current))try{const t=()=>({error:()=>{},warn:()=>{},info:()=>{},debug:()=>{},json:()=>{},throw:e=>{throw e instanceof Error?e:new Error(e)},scope:()=>t()}),r=t(),o=async()=>({ok:!0,destination:{}}),a={settings:{pageview:!1,prefix:"data-elb",elb:"elb",elbLayer:"elbLayer",scope:n.contentDocument.body}},s={elb:v.current,push:o,command:async()=>({ok:!0,destination:{}}),logger:r,window:n.contentWindow,document:n.contentDocument},i=await re({id:"preview",collector:{},logger:r,withScope:async(e,n,t)=>t({}),config:a,env:s});await(i.init?.()),!e&&S.current||(await(i.on?.("run")),S.current=!0),T.current={instance:i,destroyContext:{id:"preview",config:a,env:s,logger:r}}}catch{}},[C]);Z(()=>(b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{$({fireLoad:!1})},200),()=>{b.current&&clearTimeout(b.current),T.current&&(T.current.instance.destroy?.(T.current.destroyContext),T.current=null)}),[p,n,r,$]),Z(()=>{const e=y.current?.contentDocument;if(!e?.body)return;const n=Array.from(h).map(e=>`highlight-${e}`).join(" ");e.body.className=`elb-highlight ${n}`.trim()},[h]);const E=ne(()=>{b.current&&clearTimeout(b.current),$({fireLoad:!0})},[$]),P=!a||"preview"===f,R=te(()=>[{label:"Preview",value:"preview"},{label:"HTML",value:"html"},{label:"CSS",value:"css"},{label:"JS",value:"js"}],[]),_=Jn("button",{type:"button",className:"elb-explorer-btn",onClick:E,title:"Reload preview","aria-label":"Reload preview",children:Kn("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[Jn("polyline",{points:"23 4 23 10 17 10"}),Jn("polyline",{points:"1 20 1 14 7 14"}),Jn("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})}),O=Jn(be,{buttons:R.map(e=>({label:e.label,value:e.value,active:f===e.value})),onButtonClick:g,variant:"tabs"});return Kn(ue,{header:o,headerActions:a?Kn(qn,{children:[O,P?_:null]}):_,footer:P?Jn(ge,{highlights:h,onToggle:e=>{m(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t})}}):null,children:[Jn("div",{className:"elb-preview-content",style:P?void 0:{display:"none"},children:Jn("iframe",{ref:y,className:"elb-preview-iframe",title:"HTML Preview"})}),a&&"html"===f?Jn(Hn,{code:p,language:"html",onChange:i,disabled:!i,lineNumbers:d,wordWrap:u}):null,a&&"css"===f?Jn(Hn,{code:n,language:"css",onChange:l,disabled:!l,lineNumbers:d,wordWrap:u}):null,a&&"js"===f?Jn(Hn,{code:t,language:"javascript",onChange:c,disabled:!c,lineNumbers:d,wordWrap:u}):null]})}import{useState as Qn,useMemo as Zn}from"react";import{jsx as et}from"react/jsx-runtime";function nt({html:e,css:n,js:t,onHtmlChange:r,onCssChange:o,onJsChange:a,showPreview:s=!0,label:i="Code",className:l="",initialTab:c,lineNumbers:d=!1,wordWrap:u=!1}){const p=Zn(()=>{const r=[];return s&&void 0!==e&&r.push({label:"Preview",value:"preview"}),void 0!==e&&r.push({label:"HTML",value:"html"}),void 0!==n&&r.push({label:"CSS",value:"css"}),void 0!==t&&r.push({label:"JS",value:"js"}),r},[e,n,t,s]),[f,g]=Qn(()=>c&&p.some(e=>e.value===c)?c:p[0]?.value||"preview"),{content:h,language:m,onChange:y}=Zn(()=>{switch(f){case"html":return{content:e||"",language:"html",onChange:r};case"css":return{content:n||"",language:"css",onChange:o};case"js":return{content:t||"",language:"javascript",onChange:a};default:return{content:"",language:"text",onChange:void 0}}},[f,e,n,t,r,o,a]),b=Zn(()=>p.map(e=>({label:e.label,value:e.value,active:f===e.value})),[p,f]);return et(ue,{header:i,headerActions:p.length>1?et(be,{buttons:b,onButtonClick:g,variant:"tabs"}):null,className:l,children:"preview"===f?et(Yn,{html:e||"",css:n||""}):et(Hn,{code:h,language:m,onChange:y,disabled:!y,lineNumbers:d,wordWrap:u})})}import tt,{useState as rt,useCallback as ot,useRef as at,useEffect as st,useMemo as it}from"react";import{useMonaco as lt}from"@monaco-editor/react";import{Fragment as ct,jsx as dt,jsxs as ut}from"react/jsx-runtime";function pt({code:e,language:n="javascript",onChange:t,disabled:r=!1,autoHeight:o,label:a,header:s,showHeader:i=!0,tabs:l,activeTab:c,onTabChange:d,defaultTab:u,showTrafficLights:p=!1,showCopy:f=!0,showFormat:g=!1,showSettings:h=!1,onValidationIssues:m,footer:y,height:b,style:v,className:w,...k}){const{onMount:x,...T}=k,[S,C]=(lt(),rt(!1)),[$,E]=rt(!1),[P,R]=rt({lineNumbers:k.lineNumbers??!1,minimap:k.minimap??!1,wordWrap:k.wordWrap??!1,sticky:k.sticky??!0}),_=at(null),[O,F]=rt({errors:0,warnings:0}),[I,j]=rt([]),[M,N]=rt(null),D=at(null),A=at(null);st(()=>{if(!$&&!M)return;const e=e=>{$&&_.current&&!_.current.contains(e.target)&&E(!1),M&&D.current&&!D.current.contains(e.target)&&N(null)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[$,M]);const[L,V]=rt(c??u??l?.[0]?.id??""),W=c??L,B=ot(e=>{V(e),d?.(e)},[d]),z=l?.find(e=>e.id===W),G=z?.code??e??"",U=z?.language??n,H=s??a??"Code",q=ot(e=>{A.current=e,x?.(e)},[x]),J=ot(e=>{F({errors:e.errors,warnings:e.warnings}),j(e.markers),m?.({errors:e.errors,warnings:e.warnings})},[m]),K=ot((e,n)=>{const t=A.current;t&&(t.revealLineInCenter(e),t.setPosition({lineNumber:e,column:n}),t.focus(),N(null))},[]),X=it(()=>({lineNumbers:P.lineNumbers,minimap:P.minimap,wordWrap:P.wordWrap,sticky:P.sticky}),[P.lineNumbers,P.minimap,P.wordWrap,P.sticky]),Y=ut("div",{style:{display:"flex",gap:"4px",alignItems:"center"},children:[dt(ft,{markerCounts:O,markerDetails:I,openMarkerMenu:M,setOpenMarkerMenu:N,jumpToLine:K,markerMenuRef:D}),g&&!r&&"json"===U&&dt("button",{className:"elb-explorer-btn",onClick:()=>{if(t&&!r&&"json"===U)try{const e=JSON.parse(G),n=JSON.stringify(e,null,2);t(n)}catch(e){}},title:"Format JSON",children:ut("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[dt("line",{x1:"3",y1:"5",x2:"16",y2:"5"}),dt("line",{x1:"7",y1:"10",x2:"20",y2:"10"}),dt("line",{x1:"7",y1:"15",x2:"18",y2:"15"}),dt("line",{x1:"3",y1:"20",x2:"12",y2:"20"})]})}),f&&dt("button",{className:"elb-explorer-btn",onClick:async()=>{try{await navigator.clipboard.writeText(G),C(!0),setTimeout(()=>C(!1),2e3)}catch{}},title:S?"Copied!":"Copy to clipboard",children:S?dt("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:dt("polyline",{points:"20 6 9 17 4 12"})}):ut("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[dt("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),dt("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),h&&ut("div",{ref:_,style:{position:"relative"},children:[dt("button",{className:"elb-explorer-btn"+($?" active":""),onClick:()=>E(!$),title:"Editor settings",children:ut("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[dt("circle",{cx:"12",cy:"12",r:"3"}),dt("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})}),$&&ut("div",{className:"elb-codebox-settings",children:[ut("label",{className:"elb-codebox-settings-option",children:[dt("input",{type:"checkbox",checked:P.lineNumbers,onChange:()=>R(e=>({...e,lineNumbers:!e.lineNumbers}))}),"Line numbers"]}),ut("label",{className:"elb-codebox-settings-option",children:[dt("input",{type:"checkbox",checked:P.minimap,onChange:()=>R(e=>({...e,minimap:!e.minimap}))}),"Minimap"]}),ut("label",{className:"elb-codebox-settings-option",children:[dt("input",{type:"checkbox",checked:P.wordWrap,onChange:()=>R(e=>({...e,wordWrap:!e.wordWrap}))}),"Word wrap"]}),ut("label",{className:"elb-codebox-settings-option",children:[dt("input",{type:"checkbox",checked:P.sticky,onChange:()=>R(e=>({...e,sticky:!e.sticky}))}),"Sticky scroll"]})]})]})]}),Q=`${o?"elb-box--auto-height":""} ${w||""}`.trim(),Z=it(()=>l?.map(e=>({id:e.id,label:e.label,content:dt(Hn,{code:e.code,language:e.language??n,onChange:t,disabled:r,autoHeight:o,onMount:q,onMarkerCounts:J,...T,...X})})),[l,n,t,r,o,X,T,q,J]);return dt(ue,{header:H,headerActions:Y,showHeader:i,tabs:Z,defaultTab:u,activeTab:c,onTabChange:B,showTrafficLights:p,footer:y,height:b,style:v,className:Q,children:!l&&dt(Hn,{code:e??"",language:n,onChange:t,disabled:r,autoHeight:o,onMount:q,onMarkerCounts:J,...T,...X})})}var ft=tt.memo(function({markerCounts:e,markerDetails:n,openMarkerMenu:t,setOpenMarkerMenu:r,jumpToLine:o,markerMenuRef:a}){return ut(ct,{children:[e.errors>0&&ut("div",{ref:"error"===t?a:void 0,style:{position:"relative"},children:[ut("button",{className:"elb-codebox-marker-badge elb-codebox-marker-badge--error",onClick:()=>r("error"===t?null:"error"),children:[ut("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[dt("circle",{cx:"12",cy:"12",r:"10"}),dt("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),dt("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),dt("span",{children:e.errors})]}),"error"===t&&dt(gt,{markers:n.filter(e=>"error"===e.severity),onJump:o})]}),e.warnings>0&&ut("div",{ref:"warning"===t?a:void 0,style:{position:"relative"},children:[ut("button",{className:"elb-codebox-marker-badge elb-codebox-marker-badge--warning",onClick:()=>r("warning"===t?null:"warning"),children:[ut("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[dt("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),dt("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),dt("circle",{cx:"12",cy:"17",r:".5"})]}),dt("span",{children:e.warnings})]}),"warning"===t&&dt(gt,{markers:n.filter(e=>"warning"===e.severity),onJump:o})]})]})});function gt({markers:e,onJump:n}){return dt("div",{className:"elb-codebox-marker-menu",children:e.sort((e,n)=>e.line-n.line||e.column-n.column).map((e,t)=>ut("button",{className:"elb-codebox-marker-menu-item",onClick:()=>n(e.line,e.column),children:[ut("span",{className:"elb-codebox-marker-menu-line",children:["Ln ",e.line]}),dt("span",{className:"elb-codebox-marker-menu-msg",children:e.message})]},t))})}function ht(){return{type:"gtag",config:{},push(e,n){const{data:t,env:r}=n,o=`gtag('event', '${e.name}', ${JSON.stringify(t,null,2)});`;r.elb(o)}}}function mt(){return{type:"fbq",config:{},push(e,n){const{data:t,env:r}=n,o=`fbq('track', '${e.name}', ${JSON.stringify(t,null,2)});`;r.elb(o)}}}function yt(){return{type:"plausible",config:{},push(e,n){const{data:t,env:r}=n,o=`plausible('${e.name}', { props: ${JSON.stringify(t,null,2)} });`;r.elb(o)}}}import{jsx as bt,jsxs as vt}from"react/jsx-runtime";function wt({initialHtml:e='<div\n data-elb="product"\n data-elbaction="load:view"\n data-elbcontext="stage:inspire"\n class="product-card"\n>\n <figure class="product-figure">\n <div class="product-badge-container">\n <div data-elb-product="badge:delicious" class="product-badge">delicious</div>\n </div>\n </figure>\n <div class="product-body">\n <h3 data-elb-product="name:#innerText" class="product-title">\n Everyday Ruck Snack\n </h3>\n <div class="form-control">\n <label class="form-label">Taste</label>\n <select\n data-elb-product="taste:#value"\n class="form-select"\n >\n <option value="sweet">Sweet</option>\n <option value="spicy">Spicy</option>\n </select>\n </div>\n <p data-elb-product="price:2.50" class="product-price">\n € 2.50 <span data-elb-product="old_price:3.14" class="product-old-price">€ 3.14</span>\n </p>\n <div data-elbcontext="stage:hooked" class="product-actions">\n <button\n data-elbaction="click:save"\n class="btn btn-secondary"\n >\n Maybe later\n </button>\n <button\n data-elbaction="click:add"\n class="btn btn-primary"\n >\n Add to Cart\n </button>\n </div>\n </div>\n</div>\n<span data-elbglobals="language:en"></span>',initialCss:n="* {\n box-sizing: border-box;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n}\n\n.product-card {\n width: 100%;\n max-width: 400px;\n margin: 0 auto;\n background: #ffffff;\n border-radius: 16px;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n overflow: hidden;\n}\n\n.product-figure {\n position: relative;\n margin: 0;\n padding: 0;\n width: 100%;\n height: 160px;\n background:\n linear-gradient(135deg, rgba(243, 244, 246, 0.9) 0%, rgba(229, 231, 235, 0.9) 100%),\n repeating-linear-gradient(\n 45deg,\n #f9fafb,\n #f9fafb 10px,\n #f3f4f6 10px,\n #f3f4f6 20px\n );\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.product-figure::before {\n content: '🍟';\n font-size: 8rem;\n opacity: 0.8;\n}\n\n.product-badge-container {\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n}\n\n.product-badge {\n background: #01b5e2;\n color: white;\n padding: 0.25rem 0.75rem;\n border-radius: 9999px;\n font-size: 0.75rem;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.025em;\n}\n\n.product-body {\n padding: 1.5rem;\n}\n\n.product-title {\n font-size: 1.125rem;\n font-weight: 700;\n margin: 0 0 1rem 0;\n color: #111827;\n}\n\n.form-control {\n margin-bottom: 1rem;\n}\n\n.form-label {\n display: block;\n font-size: 0.875rem;\n font-weight: 500;\n color: #6b7280;\n margin-bottom: 0.5rem;\n}\n\n.form-select {\n width: 100%;\n padding: 0.5rem 0.75rem;\n border: 1px solid #d1d5db;\n border-radius: 8px;\n font-size: 0.875rem;\n color: #111827;\n background: white;\n cursor: pointer;\n transition: border-color 0.2s;\n}\n\n.form-select:hover {\n border-color: #9ca3af;\n}\n\n.form-select:focus {\n outline: none;\n border-color: #01b5e2;\n box-shadow: 0 0 0 3px rgba(1, 181, 226, 0.1);\n}\n\n.product-price {\n font-size: 1.25rem;\n font-weight: 700;\n color: #111827;\n margin: 0 0 1rem 0;\n}\n\n.product-old-price {\n font-size: 1rem;\n font-weight: 400;\n color: #9ca3af;\n text-decoration: line-through;\n margin-left: 0.5rem;\n}\n\n.product-actions {\n display: flex;\n justify-content: space-between;\n gap: 0.5rem;\n}\n\n.btn {\n flex: 1;\n padding: 0.75rem 1rem;\n border: none;\n border-radius: 8px;\n font-size: 0.875rem;\n font-weight: 600;\n cursor: pointer;\n transition: all 0.2s;\n text-align: center;\n}\n\n.btn:hover {\n transform: translateY(-1px);\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);\n}\n\n.btn:active {\n transform: translateY(0);\n}\n\n.btn-primary {\n background: #01b5e2;\n color: white;\n}\n\n.btn-primary:hover {\n background: #0195b8;\n}\n\n.btn-secondary {\n background: #ffffff;\n color: #01b5e2;\n border: 1px solid #01b5e2;\n}\n\n.btn-secondary:hover {\n background: #01b5e2;\n color: #ffffff;\n}",initialJs:t="",initialMapping:r='{\n "product": {\n "view": {\n "name": "view_item",\n "data": {\n "map": {\n "currency": { "value": "EUR" },\n "value": "data.price",\n "items": {\n "set": [\n {\n "map": {\n "item_name": "data.name",\n "item_variant": "data.taste",\n "price": "data.price",\n "quantity": { "value": 1 }\n }\n }\n ]\n }\n }\n }\n },\n "add": {\n "name": "add_to_cart",\n "data": {\n "map": {\n "currency": { "value": "EUR" },\n "value": "data.price",\n "items": {\n "set": [\n {\n "map": {\n "item_name": "data.name",\n "item_variant": "data.taste",\n "price": "data.price",\n "quantity": { "value": 1 }\n }\n }\n ]\n }\n }\n }\n },\n "save": {\n "name": "add_to_wishlist",\n "data": {\n "map": {\n "currency": { "value": "EUR" },\n "value": "data.price",\n "items": {\n "set": [\n {\n "map": {\n "item_name": "data.name",\n "item_variant": "data.taste",\n "price": "data.price",\n "quantity": { "value": 1 }\n }\n }\n ]\n }\n }\n }\n }\n }\n}',labelCode:o="Code",labelPreview:a="Preview",labelEvents:s="Events",labelMapping:i="Mapping",labelResult:l="Result",destination:c}){const d=D(()=>c??ht(),[c]),[u,p]=I(e),[f,g]=I(n),[h,m]=I(t),[y,b]=I(r),[v,w]=I("// Click elements in the preview to see events"),[k,x]=I("// Click elements in the preview to see function call"),T=M(null),S=M(null),C=M(null),[$,E]=I(!1);j(()=>{let e=!0;return(async()=>{try{const n=JSON.parse(r),{collector:t,elb:o}=await A({destinations:{rawCapture:{code:{type:"rawCapture",config:{},push:async n=>{e&&(C.current=n,w(JSON.stringify(n,null,2)))}}},gtag:{code:d,config:{mapping:n},env:{elb:n=>{e&&x(n)}}}},consent:{functional:!0,marketing:!0},user:{session:"playground"}});if(!e)return;T.current=t,S.current=o,E(!0)}catch{}})(),()=>{e=!1,T.current}},[r,d]);const P=N(e=>{b(e);const n=setTimeout(()=>{try{const n=JSON.parse(e);T.current?.destinations?.gtag?.config&&(T.current.destinations.gtag.config.mapping=n),C.current&&T.current&&T.current.push(C.current)}catch{}},500);return()=>clearTimeout(n)},[]);return vt(Y,{columns:5,rowHeight:600,children:[bt(nt,{label:o,html:u,css:f,js:h,onHtmlChange:p,onCssChange:g,onJsChange:m,showPreview:!1,initialTab:"html",lineNumbers:!1,wordWrap:!0}),bt(Yn,{label:a,html:u,css:f,elb:$?S.current??void 0:void 0}),bt(pt,{label:s,code:v,onChange:w,language:"json",wordWrap:!0}),bt(pt,{label:i,code:y,onChange:P,language:"json",wordWrap:!0,folding:!0,sticky:!0}),bt(pt,{label:l,code:k,language:"javascript",disabled:!0,wordWrap:!0})]})}import{useState as kt,useEffect as xt,useCallback as Tt}from"react";import{debounce as St,isString as Ct,tryCatchAsync as $t}from"@walkeros/core";import*as Et from"prettier/standalone";import Pt from"prettier/plugins/babel";import Rt from"prettier/plugins/estree";import _t from"prettier/plugins/typescript";import Ot from"prettier/plugins/html";async function Ft(e,n){try{let t;switch(n){case"javascript":case"js":{const n=e.trimStart().startsWith("{")&&e.includes("\n"),r=n?`(${e})`:e;t=await Et.format(r,{parser:"babel",plugins:[Pt,Rt],semi:!0,singleQuote:!0,trailingComma:"all"}),n&&(t=t.replace(/^\(/,"").replace(/\);?\s*$/,""));break}case"typescript":case"ts":case"tsx":t=await Et.format(e,{parser:"typescript",plugins:[_t,Rt],semi:!0,singleQuote:!0,trailingComma:"all"});break;case"json":const n=JSON.parse(e);t=JSON.stringify(n,null,2);break;case"html":t=await Et.format(e,{parser:"html",plugins:[Ot],htmlWhitespaceSensitivity:"css"});break;case"css":case"scss":t=await Et.format(e,{parser:"css",plugins:[Ot]});break;default:return e}return t.trim()}catch(n){return e}}import{jsx as It,jsxs as jt}from"react/jsx-runtime";function Mt(e,n={}){if(void 0===e)return"";const t=Ct(e)?e.trim():JSON.stringify(e,null,2);return n.quotes&&Ct(e)?`"${t}"`:t}function Nt({input:e,config:n,output:t="",options:r,fn:o,fnName:a,labelInput:s="Event",labelConfig:i="Config",labelOutput:l="Result",emptyText:c="No event yet.",disableInput:d=!1,disableConfig:u=!1,showQuotes:p=!0,className:f,language:g="json",format:h=!0,rowHeight:m,outputLanguage:y="json",configLanguage:b="json"}){const[v,w]=kt(Mt(e)),[k,x]=kt(Mt(n)),[T,S]=kt([Mt(t)]);xt(()=>{if(h&&e){Ft(Mt(e),g).then(w)}},[e,g,h]),xt(()=>{if(h&&n){Ft(Mt(n),g).then(x)}},[n,g,h]);const C=Tt((...e)=>{const n=e.map(e=>Mt(e,{quotes:p})).join(", ");S([a?`${a}(${n})`:n])},[a,p]),$=Tt(St(async(e,n,t)=>{o&&(S([]),await $t(o,e=>{S([`Error: ${String(e)}`])})(e,n,C,t))},500,!0),[o,C]);return xt(()=>{$(v,k,r||{})},[v,k,r,$]),jt(Y,{columns:3,className:f,rowHeight:m,children:[It(pt,{label:s,code:v,onChange:d?void 0:w,disabled:d,language:g,showFormat:!d&&"json"===g}),k&&It(pt,{label:i,code:k,onChange:u?void 0:x,disabled:u,language:b,showFormat:!u&&"json"===b}),It(pt,{label:l,code:T[0]||c,disabled:!0,language:y})]})}import{useState as Dt,useEffect as At}from"react";import{startFlow as Lt}from"@walkeros/collector";import{jsx as Vt}from"react/jsx-runtime";function Wt({event:e,mapping:n,destination:t,label:r="Result",wordWrap:o=!1}){const[a,s]=Dt("// Click elements in the preview to see function call");return At(()=>{(async()=>{try{const r=JSON.parse(e),o=JSON.parse(n),{collector:a}=await Lt({destinations:{demo:{code:t,config:{mapping:o},env:{elb:s}}}});await a.push(r)}catch(e){e instanceof Error?s(`// Error: ${e.message}`):s(`// Error: ${String(e)}`)}})()},[e,n,t]),Vt(pt,{code:a,language:"javascript",disabled:!0,label:r,wordWrap:o})}import{createElement as Bt,forwardRef as zt,useState as Gt,useEffect as Ut}from"react";var Ht=Object.freeze({left:0,top:0,width:16,height:16}),qt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Jt=Object.freeze({...Ht,...qt}),Kt=Object.freeze({...Jt,body:"",hidden:!1});function Xt(e,n){const t=function(e,n){const t={};!e.hFlip!=!n.hFlip&&(t.hFlip=!0),!e.vFlip!=!n.vFlip&&(t.vFlip=!0);const r=((e.rotate||0)+(n.rotate||0))%4;return r&&(t.rotate=r),t}(e,n);for(const r in Kt)r in qt?r in e&&!(r in t)&&(t[r]=qt[r]):r in n?t[r]=n[r]:r in e&&(t[r]=e[r]);return t}function Yt(e,n,t){const r=e.icons,o=e.aliases||Object.create(null);let a={};function s(e){a=Xt(r[e]||o[e],a)}return s(n),t.forEach(s),Xt(e,a)}function Qt(e,n){const t=[];if("object"!=typeof e||"object"!=typeof e.icons)return t;e.not_found instanceof Array&&e.not_found.forEach(e=>{n(e,null),t.push(e)});const r=function(e){const n=e.icons,t=e.aliases||Object.create(null),r=Object.create(null);return Object.keys(n).concat(Object.keys(t)).forEach(function e(o){if(n[o])return r[o]=[];if(!(o in r)){r[o]=null;const n=t[o]&&t[o].parent,a=n&&e(n);a&&(r[o]=[n].concat(a))}return r[o]}),r}(e);for(const o in r){const a=r[o];a&&(n(o,Yt(e,o,a)),t.push(o))}return t}var Zt={provider:"",aliases:{},not_found:{},...Ht};function er(e,n){for(const t in n)if(t in e&&typeof e[t]!=typeof n[t])return!1;return!0}function nr(e){if("object"!=typeof e||null===e)return null;const n=e;if("string"!=typeof n.prefix||!e.icons||"object"!=typeof e.icons)return null;if(!er(e,Zt))return null;const t=n.icons;for(const e in t){const n=t[e];if(!e||"string"!=typeof n.body||!er(n,Kt))return null}const r=n.aliases||Object.create(null);for(const e in r){const n=r[e],o=n.parent;if(!e||"string"!=typeof o||!t[o]&&!r[o]||!er(n,Kt))return null}return n}var tr=Object.create(null);function rr(e,n){const t=tr[e]||(tr[e]=Object.create(null));return t[n]||(t[n]=function(e,n){return{provider:e,prefix:n,icons:Object.create(null),missing:new Set}}(e,n))}function or(e,n){return nr(n)?Qt(n,(n,t)=>{t?e.icons[n]=t:e.missing.add(n)}):[]}var ar=/^[a-z0-9]+(-[a-z0-9]+)*$/,sr=(e,n,t,r="")=>{const o=e.split(":");if("@"===e.slice(0,1)){if(o.length<2||o.length>3)return null;r=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const e=o.pop(),t=o.pop(),a={provider:o.length>0?o[0]:r,prefix:t,name:e};return n&&!ir(a)?null:a}const a=o[0],s=a.split("-");if(s.length>1){const e={provider:r,prefix:s.shift(),name:s.join("-")};return n&&!ir(e)?null:e}if(t&&""===r){const e={provider:r,prefix:"",name:a};return n&&!ir(e,t)?null:e}return null},ir=(e,n)=>!!e&&!(!(n&&""===e.prefix||e.prefix)||!e.name),lr=!1;function cr(e){return"boolean"==typeof e&&(lr=e),lr}function dr(e){const n="string"==typeof e?sr(e,!0,lr):e;if(n){const e=rr(n.provider,n.prefix),t=n.name;return e.icons[t]||(e.missing.has(t)?null:void 0)}}function ur(e,n){const t=sr(e,!0,lr);if(!t)return!1;const r=rr(t.provider,t.prefix);return n?function(e,n,t){try{if("string"==typeof t.body)return e.icons[n]={...t},!0}catch(e){}return!1}(r,t.name,n):(r.missing.add(t.name),!0)}var pr=Object.freeze({width:null,height:null}),fr=Object.freeze({...pr,...qt}),gr=/(-?[0-9.]*[0-9]+[0-9.]*)/g,hr=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function mr(e,n,t){if(1===n)return e;if(t=t||100,"number"==typeof e)return Math.ceil(e*n*t)/t;if("string"!=typeof e)return e;const r=e.split(gr);if(null===r||!r.length)return e;const o=[];let a=r.shift(),s=hr.test(a);for(;;){if(s){const e=parseFloat(a);isNaN(e)?o.push(a):o.push(Math.ceil(e*n*t)/t)}else o.push(a);if(a=r.shift(),void 0===a)return o.join("");s=!s}}var yr=/\sid="(\S+)"/g,br="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16),vr=0;function wr(e,n=br){const t=[];let r;for(;r=yr.exec(e);)t.push(r[1]);if(!t.length)return e;const o="suffix"+(16777216*Math.random()|Date.now()).toString(16);return t.forEach(t=>{const r="function"==typeof n?n(t):n+(vr++).toString(),a=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+r+o+"$3")}),e=e.replace(new RegExp(o,"g"),"")}var kr=Object.create(null);function xr(e){return kr[e]||kr[""]}function Tr(e){let n;if("string"==typeof e.resources)n=[e.resources];else if(n=e.resources,!(n instanceof Array&&n.length))return null;return{resources:n,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:!0===e.random,index:e.index||0,dataAfterTimeout:!1!==e.dataAfterTimeout}}for(var Sr=Object.create(null),Cr=["https://api.simplesvg.com","https://api.unisvg.com"],$r=[];Cr.length>0;)1===Cr.length||Math.random()>.5?$r.push(Cr.shift()):$r.push(Cr.pop());function Er(e,n){const t=Tr(n);return null!==t&&(Sr[e]=t,!0)}function Pr(e){return Sr[e]}Sr[""]=Tr({resources:["https://api.iconify.design"].concat($r)});var Rr=(()=>{let e;try{if(e=fetch,"function"==typeof e)return e}catch(e){}})();var _r={prepare:(e,n,t)=>{const r=[],o=function(e,n){const t=Pr(e);if(!t)return 0;let r;if(t.maxURL){let e=0;t.resources.forEach(n=>{const t=n;e=Math.max(e,t.length)});const o=n+".json?icons=";r=t.maxURL-e-t.path.length-o.length}else r=0;return r}(e,n),a="icons";let s={type:a,provider:e,prefix:n,icons:[]},i=0;return t.forEach((t,l)=>{i+=t.length+1,i>=o&&l>0&&(r.push(s),s={type:a,provider:e,prefix:n,icons:[]},i=t.length),s.icons.push(t)}),r.push(s),r},send:(e,n,t)=>{if(!Rr)return void t("abort",424);let r=function(e){if("string"==typeof e){const n=Pr(e);if(n)return n.path}return"/"}(n.provider);switch(n.type){case"icons":{const e=n.prefix,t=n.icons.join(",");r+=e+".json?"+new URLSearchParams({icons:t}).toString();break}case"custom":{const e=n.uri;r+="/"===e.slice(0,1)?e.slice(1):e;break}default:return void t("abort",400)}let o=503;Rr(e+r).then(e=>{const n=e.status;if(200===n)return o=501,e.json();setTimeout(()=>{t(function(e){return 404===e}(n)?"abort":"next",n)})}).then(e=>{"object"==typeof e&&null!==e?setTimeout(()=>{t("success",e)}):setTimeout(()=>{404===e?t("abort",e):t("next",o)})}).catch(()=>{t("next",o)})}};function Or(e,n){e.forEach(e=>{const t=e.loaderCallbacks;t&&(e.loaderCallbacks=t.filter(e=>e.id!==n))})}var Fr=0;var Ir={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function jr(e,n,t,r){const o=e.resources.length,a=e.random?Math.floor(Math.random()*o):e.index;let s;if(e.random){let n=e.resources.slice(0);for(s=[];n.length>1;){const e=Math.floor(Math.random()*n.length);s.push(n[e]),n=n.slice(0,e).concat(n.slice(e+1))}s=s.concat(n)}else s=e.resources.slice(a).concat(e.resources.slice(0,a));const i=Date.now();let l,c="pending",d=0,u=null,p=[],f=[];function g(){u&&(clearTimeout(u),u=null)}function h(){"pending"===c&&(c="aborted"),g(),p.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),p=[]}function m(e,n){n&&(f=[]),"function"==typeof e&&f.push(e)}function y(){c="failed",f.forEach(e=>{e(void 0,l)})}function b(){p.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),p=[]}function v(){if("pending"!==c)return;g();const r=s.shift();if(void 0===r)return p.length?void(u=setTimeout(()=>{g(),"pending"===c&&(b(),y())},e.timeout)):void y();const o={status:"pending",resource:r,callback:(n,t)=>{!function(n,t,r){const o="success"!==t;switch(p=p.filter(e=>e!==n),c){case"pending":break;case"failed":if(o||!e.dataAfterTimeout)return;break;default:return}if("abort"===t)return l=r,void y();if(o)return l=r,void(p.length||(s.length?v():y()));if(g(),b(),!e.random){const t=e.resources.indexOf(n.resource);-1!==t&&t!==e.index&&(e.index=t)}c="completed",f.forEach(e=>{e(r)})}(o,n,t)}};p.push(o),d++,u=setTimeout(v,e.rotate),t(r,n,o.callback)}return"function"==typeof r&&f.push(r),setTimeout(v),function(){return{startTime:i,payload:n,status:c,queriesSent:d,queriesPending:p.length,subscribe:m,abort:h}}}function Mr(e){const n={...Ir,...e};let t=[];function r(){t=t.filter(e=>"pending"===e().status)}return{query:function(e,o,a){const s=jr(n,e,o,(e,n)=>{r(),a&&a(e,n)});return t.push(s),s},find:function(e){return t.find(n=>e(n))||null},setIndex:e=>{n.index=e},getIndex:()=>n.index,cleanup:r}}function Nr(){}var Dr=Object.create(null);function Ar(e,n,t){let r,o;if("string"==typeof e){const n=xr(e);if(!n)return t(void 0,424),Nr;o=n.send;const a=function(e){if(!Dr[e]){const n=Pr(e);if(!n)return;const t={config:n,redundancy:Mr(n)};Dr[e]=t}return Dr[e]}(e);a&&(r=a.redundancy)}else{const n=Tr(e);if(n){r=Mr(n);const t=xr(e.resources?e.resources[0]:"");t&&(o=t.send)}}return r&&o?r.query(n,o,t)().abort:(t(void 0,424),Nr)}function Lr(){}function Vr(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,function(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const n=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!n.length)return;let t=!1;const r=e.provider,o=e.prefix;n.forEach(n=>{const a=n.icons,s=a.pending.length;a.pending=a.pending.filter(n=>{if(n.prefix!==o)return!0;const s=n.name;if(e.icons[s])a.loaded.push({provider:r,prefix:o,name:s});else{if(!e.missing.has(s))return t=!0,!0;a.missing.push({provider:r,prefix:o,name:s})}return!1}),a.pending.length!==s&&(t||Or([e],n.id),n.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),n.abort))})}))}(e)}))}function Wr(e,n,t){function r(){const t=e.pendingIcons;n.forEach(n=>{t&&t.delete(n),e.icons[n]||e.missing.add(n)})}if(t&&"object"==typeof t)try{if(!or(e,t).length)return void r()}catch(e){console.error(e)}r(),Vr(e)}function Br(e,n){e instanceof Promise?e.then(e=>{n(e)}).catch(()=>{n(null)}):n(e)}function zr(e,n){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(n).sort():e.iconsToLoad=n,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:n,prefix:t}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;const o=e.loadIcon;if(e.loadIcons&&(r.length>1||!o))return void Br(e.loadIcons(r,t,n),n=>{Wr(e,r,n)});if(o)return void r.forEach(r=>{Br(o(r,t,n),n=>{Wr(e,[r],n?{prefix:t,icons:{[r]:n}}:null)})});const{valid:a,invalid:s}=function(e){const n=[],t=[];return e.forEach(e=>{(e.match(ar)?n:t).push(e)}),{valid:n,invalid:t}}(r);if(s.length&&Wr(e,s,null),!a.length)return;const i=t.match(ar)?xr(n):null;if(!i)return void Wr(e,a,null);i.prepare(n,t,a).forEach(t=>{Ar(n,t,n=>{Wr(e,t.icons,n)})})}))}var Gr=(e,n)=>{const t=function(e){const n={loaded:[],missing:[],pending:[]},t=Object.create(null);e.sort((e,n)=>e.provider!==n.provider?e.provider.localeCompare(n.provider):e.prefix!==n.prefix?e.prefix.localeCompare(n.prefix):e.name.localeCompare(n.name));let r={provider:"",prefix:"",name:""};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;const o=e.provider,a=e.prefix,s=e.name,i=t[o]||(t[o]=Object.create(null)),l=i[a]||(i[a]=rr(o,a));let c;c=s in l.icons?n.loaded:""===a||l.missing.has(s)?n.missing:n.pending;const d={provider:o,prefix:a,name:s};c.push(d)}),n}(function(e,n=!0,t=!1){const r=[];return e.forEach(e=>{const o="string"==typeof e?sr(e,n,t):e;o&&r.push(o)}),r}(e,!0,cr()));if(!t.pending.length){let e=!0;return n&&setTimeout(()=>{e&&n(t.loaded,t.missing,t.pending,Lr)}),()=>{e=!1}}const r=Object.create(null),o=[];let a,s;return t.pending.forEach(e=>{const{provider:n,prefix:t}=e;if(t===s&&n===a)return;a=n,s=t,o.push(rr(n,t));const i=r[n]||(r[n]=Object.create(null));i[t]||(i[t]=[])}),t.pending.forEach(e=>{const{provider:n,prefix:t,name:o}=e,a=rr(n,t),s=a.pendingIcons||(a.pendingIcons=new Set);s.has(o)||(s.add(o),r[n][t].push(o))}),o.forEach(e=>{const n=r[e.provider][e.prefix];n.length&&zr(e,n)}),n?function(e,n,t){const r=Fr++,o=Or.bind(null,t,r);if(!n.pending.length)return o;const a={id:r,icons:n,callback:e,abort:o};return t.forEach(e=>{(e.loaderCallbacks||(e.loaderCallbacks=[])).push(a)}),o}(n,t,o):Lr};var Ur,Hr=/[\s,]+/;function qr(e,n){n.split(Hr).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}function Jr(e,n=0){const t=e.replace(/^-?[0-9.]*/,"");function r(e){for(;e<0;)e+=4;return e%4}if(""===t){const n=parseInt(e);return isNaN(n)?0:r(n)}if(t!==e){let n=0;switch(t){case"%":n=25;break;case"deg":n=90}if(n){let o=parseFloat(e.slice(0,e.length-t.length));return isNaN(o)?0:(o/=n,o%1==0?r(o):0)}}return n}function Kr(e){return void 0===Ur&&function(){try{Ur=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch(e){Ur=null}}(),Ur?Ur.createHTML(e):e}var Xr={...fr,inline:!1},Yr={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Qr={display:"inline-block"},Zr={backgroundColor:"currentColor"},eo={backgroundColor:"transparent"},no={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},to={WebkitMask:Zr,mask:Zr,background:eo};for(const e in to){const n=to[e];for(const t in no)n[e+t]=no[t]}var ro={...Xr,inline:!0};function oo(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}var ao,so=(e,n,t)=>{const r=n.inline?ro:Xr,o=function(e,n){const t={...e};for(const e in n){const r=n[e],o=typeof r;e in pr?(null===r||r&&("string"===o||"number"===o))&&(t[e]=r):o===typeof t[e]&&(t[e]="rotate"===e?r%4:r)}return t}(r,n),a=n.mode||"svg",s={},i=n.style||{},l={..."svg"===a?Yr:{}};if(t){const e=sr(t,!1,!0);if(e){const n=["iconify"],t=["provider","prefix"];for(const r of t)e[r]&&n.push("iconify--"+e[r]);l.className=n.join(" ")}}for(let e in n){const t=n[e];if(void 0!==t)switch(e){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":case"fallback":break;case"_ref":l.ref=t;break;case"className":l[e]=(l[e]?l[e]+" ":"")+t;break;case"inline":case"hFlip":case"vFlip":o[e]=!0===t||"true"===t||1===t;break;case"flip":"string"==typeof t&&qr(o,t);break;case"color":s.color=t;break;case"rotate":"string"==typeof t?o[e]=Jr(t):"number"==typeof t&&(o[e]=t);break;case"ariaHidden":case"aria-hidden":!0!==t&&"true"!==t&&delete l["aria-hidden"];break;default:void 0===r[e]&&(l[e]=t)}}const c=function(e,n){const t={...Jt,...e},r={...fr,...n},o={left:t.left,top:t.top,width:t.width,height:t.height};let a=t.body;[t,r].forEach(e=>{const n=[],t=e.hFlip,r=e.vFlip;let s,i=e.rotate;switch(t?r?i+=2:(n.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),n.push("scale(-1 1)"),o.top=o.left=0):r&&(n.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),n.push("scale(1 -1)"),o.top=o.left=0),i<0&&(i-=4*Math.floor(i/4)),i%=4,i){case 1:s=o.height/2+o.top,n.unshift("rotate(90 "+s.toString()+" "+s.toString()+")");break;case 2:n.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:s=o.width/2+o.left,n.unshift("rotate(-90 "+s.toString()+" "+s.toString()+")")}i%2==1&&(o.left!==o.top&&(s=o.left,o.left=o.top,o.top=s),o.width!==o.height&&(s=o.width,o.width=o.height,o.height=s)),n.length&&(a=function(e,n,t){const r=function(e,n="defs"){let t="";const r=e.indexOf("<"+n);for(;r>=0;){const o=e.indexOf(">",r),a=e.indexOf("</"+n);if(-1===o||-1===a)break;const s=e.indexOf(">",a);if(-1===s)break;t+=e.slice(o+1,a).trim(),e=e.slice(0,r).trim()+e.slice(s+1)}return{defs:t,content:e}}(e);return o=r.defs,a=n+r.content+t,o?"<defs>"+o+"</defs>"+a:a;var o,a}(a,'<g transform="'+n.join(" ")+'">',"</g>"))});const s=r.width,i=r.height,l=o.width,c=o.height;let d,u;null===s?(u=null===i?"1em":"auto"===i?c:i,d=mr(u,l/c)):(d="auto"===s?l:s,u=null===i?mr(d,c/l):"auto"===i?c:i);const p={},f=(e,n)=>{(e=>"unset"===e||"undefined"===e||"none"===e)(n)||(p[e]=n.toString())};f("width",d),f("height",u);const g=[o.left,o.top,l,c];return p.viewBox=g.join(" "),{attributes:p,viewBox:g,body:a}}(e,o),d=c.attributes;if(o.inline&&(s.verticalAlign="-0.125em"),"svg"===a){l.style={...s,...i},Object.assign(l,d);let e=0,t=n.id;return"string"==typeof t&&(t=t.replace(/-/g,"_")),l.dangerouslySetInnerHTML={__html:Kr(wr(c.body,t?()=>t+"ID"+e++:"iconifyReact"))},Bt("svg",l)}const{body:u,width:p,height:f}=e,g="mask"===a||"bg"!==a&&-1!==u.indexOf("currentColor"),h=function(e,n){let t=-1===e.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const e in n)t+=" "+e+'="'+n[e]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+t+">"+e+"</svg>"}(u,{...d,width:p+"",height:f+""});var m;return l.style={...s,"--svg":(m=h,'url("'+function(e){return"data:image/svg+xml,"+function(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(e)}(m)+'")'),width:oo(d.width),height:oo(d.height),...Qr,...g?Zr:eo,...i},Bt("span",l)};if(cr(!0),ao=_r,kr[""]=ao,"undefined"!=typeof document&&"undefined"!=typeof window){const e=window;if(void 0!==e.IconifyPreload){const n=e.IconifyPreload,t="Invalid IconifyPreload syntax.";"object"==typeof n&&null!==n&&(n instanceof Array?n:[n]).forEach(e=>{try{("object"!=typeof e||null===e||e instanceof Array||"object"!=typeof e.icons||"string"!=typeof e.prefix||!function(e,n){if("object"!=typeof e)return!1;if("string"!=typeof n&&(n=e.provider||""),lr&&!n&&!e.prefix){let n=!1;return nr(e)&&(e.prefix="",Qt(e,(e,t)=>{ur(e,t)&&(n=!0)})),n}const t=e.prefix;return!!ir({prefix:t,name:"a"})&&!!or(rr(n,t),e)}(e))&&console.error(t)}catch(e){console.error(t)}})}if(void 0!==e.IconifyProviders){const n=e.IconifyProviders;if("object"==typeof n&&null!==n)for(let e in n){const t="IconifyProviders["+e+"] is invalid.";try{const r=n[e];if("object"!=typeof r||!r||void 0===r.resources)continue;Er(e,r)||console.error(t)}catch(e){console.error(t)}}}}function io(e){const[n,t]=Gt(!!e.ssr),[r,o]=Gt({});const[a,s]=Gt(function(n){if(n){const n=e.icon;if("object"==typeof n)return{name:"",data:n};const t=dr(n);if(t)return{name:n,data:t}}return{name:""}}(!!e.ssr));function i(){const e=r.callback;e&&(e(),o({}))}function l(e){if(JSON.stringify(a)!==JSON.stringify(e))return i(),s(e),!0}function c(){var n;const t=e.icon;if("object"==typeof t)return void l({name:"",data:t});const r=dr(t);if(l({name:t,data:r}))if(void 0===r){const e=Gr([t],c);o({callback:e})}else r&&(null===(n=e.onLoad)||void 0===n||n.call(e,t))}Ut(()=>(t(!0),i),[]),Ut(()=>{n&&c()},[e.icon,n]);const{name:d,data:u}=a;return u?so({...Jt,...u},e,d):e.children?e.children:e.fallback?e.fallback:Bt("span",{})}var lo=zt((e,n)=>io({...e,_ref:n}));zt((e,n)=>io({inline:!0,...e,_ref:n}));function co(e){var n,t,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(t=co(e[n]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}var uo=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),po="-",fo=[],go=e=>{const n=yo(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return mo(e);const t=e.split(po),r=""===t[0]&&t.length>1?1:0;return ho(t,r,n)},getConflictingClassGroupIds:(e,n)=>{if(n){const n=r[e],o=t[e];return n?o?((e,n)=>{const t=new Array(e.length+n.length);for(let n=0;n<e.length;n++)t[n]=e[n];for(let r=0;r<n.length;r++)t[e.length+r]=n[r];return t})(o,n):n:o||fo}return t[e]||fo}}},ho=(e,n,t)=>{if(0===e.length-n)return t.classGroupId;const r=e[n],o=t.nextPart.get(r);if(o){const t=ho(e,n+1,o);if(t)return t}const a=t.validators;if(null===a)return;const s=0===n?e.join(po):e.slice(n).join(po),i=a.length;for(let e=0;e<i;e++){const n=a[e];if(n.validator(s))return n.classGroupId}},mo=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const n=e.slice(1,-1),t=n.indexOf(":"),r=n.slice(0,t);return r?"arbitrary.."+r:void 0})(),yo=e=>{const{theme:n,classGroups:t}=e;return bo(t,n)},bo=(e,n)=>{const t=uo();for(const r in e){const o=e[r];vo(o,t,r,n)}return t},vo=(e,n,t,r)=>{const o=e.length;for(let a=0;a<o;a++){const o=e[a];wo(o,n,t,r)}},wo=(e,n,t,r)=>{"string"!=typeof e?"function"!=typeof e?To(e,n,t,r):xo(e,n,t,r):ko(e,n,t)},ko=(e,n,t)=>{(""===e?n:So(n,e)).classGroupId=t},xo=(e,n,t,r)=>{Co(e)?vo(e(r),n,t,r):(null===n.validators&&(n.validators=[]),n.validators.push(((e,n)=>({classGroupId:e,validator:n}))(t,e)))},To=(e,n,t,r)=>{const o=Object.entries(e),a=o.length;for(let e=0;e<a;e++){const[a,s]=o[e];vo(s,So(n,a),t,r)}},So=(e,n)=>{let t=e;const r=n.split(po),o=r.length;for(let e=0;e<o;e++){const n=r[e];let o=t.nextPart.get(n);o||(o=uo(),t.nextPart.set(n,o)),t=o}return t},Co=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,$o=e=>{if(e<1)return{get:()=>{},set:()=>{}};let n=0,t=Object.create(null),r=Object.create(null);const o=(o,a)=>{t[o]=a,n++,n>e&&(n=0,r=t,t=Object.create(null))};return{get(e){let n=t[e];return void 0!==n?n:void 0!==(n=r[e])?(o(e,n),n):void 0},set(e,n){e in t?t[e]=n:o(e,n)}}},Eo=[],Po=(e,n,t,r,o)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:o}),Ro=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=e=>{const n=[];let t,r=0,o=0,a=0;const s=e.length;for(let i=0;i<s;i++){const s=e[i];if(0===r&&0===o){if(":"===s){n.push(e.slice(a,i)),a=i+1;continue}if("/"===s){t=i;continue}}"["===s?r++:"]"===s?r--:"("===s?o++:")"===s&&o--}const i=0===n.length?e:e.slice(a);let l=i,c=!1;i.endsWith("!")?(l=i.slice(0,-1),c=!0):i.startsWith("!")&&(l=i.slice(1),c=!0);return Po(n,c,l,t&&t>a?t-a:void 0)};if(n){const e=n+":",t=r;r=n=>n.startsWith(e)?t(n.slice(e.length)):Po(Eo,!1,n,void 0,!0)}if(t){const e=r;r=n=>t({className:n,parseClassName:e})}return r},_o=e=>{const n=new Map;return e.orderSensitiveModifiers.forEach((e,t)=>{n.set(e,1e6+t)}),e=>{const t=[];let r=[];for(let o=0;o<e.length;o++){const a=e[o],s="["===a[0],i=n.has(a);s||i?(r.length>0&&(r.sort(),t.push(...r),r=[]),t.push(a)):r.push(a)}return r.length>0&&(r.sort(),t.push(...r)),t}},Oo=e=>{const n=Object.create(null),t=e.postfixLookupClassGroups;if(t)for(let e=0;e<t.length;e++)n[t[e]]=!0;return n},Fo=/\s+/,Io=e=>{if("string"==typeof e)return e;let n,t="";for(let r=0;r<e.length;r++)e[r]&&(n=Io(e[r]))&&(t&&(t+=" "),t+=n);return t},jo=[],Mo=e=>{const n=n=>n[e]||jo;return n.isThemeGetter=!0,n},No=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Do=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ao=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Lo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Vo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Wo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Bo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Go=e=>Ao.test(e),Uo=e=>!!e&&!Number.isNaN(Number(e)),Ho=e=>!!e&&Number.isInteger(Number(e)),qo=e=>e.endsWith("%")&&Uo(e.slice(0,-1)),Jo=e=>Lo.test(e),Ko=()=>!0,Xo=e=>Vo.test(e)&&!Wo.test(e),Yo=()=>!1,Qo=e=>Bo.test(e),Zo=e=>zo.test(e),ea=e=>!ra(e)&&!ua(e),na=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),ta=e=>va(e,Ta,Yo),ra=e=>No.test(e),oa=e=>va(e,Sa,Xo),aa=e=>va(e,Ca,Uo),sa=e=>va(e,Ea,Ko),ia=e=>va(e,$a,Yo),la=e=>va(e,ka,Yo),ca=e=>va(e,xa,Zo),da=e=>va(e,Pa,Qo),ua=e=>Do.test(e),pa=e=>wa(e,Sa),fa=e=>wa(e,$a),ga=e=>wa(e,ka),ha=e=>wa(e,Ta),ma=e=>wa(e,xa),ya=e=>wa(e,Pa,!0),ba=e=>wa(e,Ea,!0),va=(e,n,t)=>{const r=No.exec(e);return!!r&&(r[1]?n(r[1]):t(r[2]))},wa=(e,n,t=!1)=>{const r=Do.exec(e);return!!r&&(r[1]?n(r[1]):t)},ka=e=>"position"===e||"percentage"===e,xa=e=>"image"===e||"url"===e,Ta=e=>"length"===e||"size"===e||"bg-size"===e,Sa=e=>"length"===e,Ca=e=>"number"===e,$a=e=>"family-name"===e,Ea=e=>"number"===e||"weight"===e,Pa=e=>"shadow"===e,Ra=((e,...n)=>{let t,r,o,a;const s=e=>{const n=r(e);if(n)return n;const a=((e,n)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:a,postfixLookupClassGroupIds:s}=n,i=[],l=e.trim().split(Fo);let c="";for(let e=l.length-1;e>=0;e-=1){const n=l[e],{isExternal:d,modifiers:u,hasImportantModifier:p,baseClassName:f,maybePostfixModifierPosition:g}=t(n);if(d){c=n+(c.length>0?" "+c:c);continue}let h,m=!!g;if(m){h=r(f.substring(0,g));const e=h&&s[h]?r(f):void 0;e&&e!==h&&(h=e,m=!1)}else h=r(f);if(!h){if(!m){c=n+(c.length>0?" "+c:c);continue}if(h=r(f),!h){c=n+(c.length>0?" "+c:c);continue}m=!1}const y=0===u.length?"":1===u.length?u[0]:a(u).join(":"),b=p?y+"!":y,v=b+h;if(i.indexOf(v)>-1)continue;i.push(v);const w=o(h,m);for(let e=0;e<w.length;++e){const n=w[e];i.push(b+n)}c=n+(c.length>0?" "+c:c)}return c})(e,t);return o(e,a),a};return a=i=>{const l=n.reduce((e,n)=>n(e),e());return t=(e=>({cache:$o(e.cacheSize),parseClassName:Ro(e),sortModifiers:_o(e),postfixLookupClassGroupIds:Oo(e),...go(e)}))(l),r=t.cache.get,o=t.cache.set,a=s,s(i)},(...e)=>a(((...e)=>{let n,t,r=0,o="";for(;r<e.length;)(n=e[r++])&&(t=Io(n))&&(o&&(o+=" "),o+=t);return o})(...e))})(()=>{const e=Mo("color"),n=Mo("font"),t=Mo("text"),r=Mo("font-weight"),o=Mo("tracking"),a=Mo("leading"),s=Mo("breakpoint"),i=Mo("container"),l=Mo("spacing"),c=Mo("radius"),d=Mo("shadow"),u=Mo("inset-shadow"),p=Mo("text-shadow"),f=Mo("drop-shadow"),g=Mo("blur"),h=Mo("perspective"),m=Mo("aspect"),y=Mo("ease"),b=Mo("animate"),v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ua,ra],w=()=>[ua,ra,l],k=()=>[Go,"full","auto",...w()],x=()=>[Ho,"none","subgrid",ua,ra],T=()=>["auto",{span:["full",Ho,ua,ra]},Ho,ua,ra],S=()=>[Ho,"auto",ua,ra],C=()=>["auto","min","max","fr",ua,ra],$=()=>["auto",...w()],E=()=>[Go,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],P=()=>[Go,"screen","full","dvw","lvw","svw","min","max","fit",...w()],R=()=>[Go,"screen","full","lh","dvh","lvh","svh","min","max","fit",...w()],_=()=>[e,ua,ra],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ga,la,{position:[ua,ra]}],F=()=>["auto","cover","contain",ha,ta,{size:[ua,ra]}],I=()=>[qo,pa,oa],j=()=>["","none","full",c,ua,ra],M=()=>["",Uo,pa,oa],N=()=>[Uo,qo,ga,la],D=()=>["","none",g,ua,ra],A=()=>["none",Uo,ua,ra],L=()=>["none",Uo,ua,ra],V=()=>[Uo,ua,ra],W=()=>[Go,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Jo],breakpoint:[Jo],color:[Ko],container:[Jo],"drop-shadow":[Jo],ease:["in","out","in-out"],font:[ea],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Jo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Jo],shadow:[Jo],spacing:["px",Uo],text:[Jo],"text-shadow":[Jo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Go,ra,ua,m]}],container:["container"],"container-type":[{"@container":["","normal","size",ua,ra]}],"container-named":[na],columns:[{columns:[Uo,ra,ua,i]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:v()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:k()}],"inset-x":[{"inset-x":k()}],"inset-y":[{"inset-y":k()}],start:[{"inset-s":k(),start:k()}],end:[{"inset-e":k(),end:k()}],"inset-bs":[{"inset-bs":k()}],"inset-be":[{"inset-be":k()}],top:[{top:k()}],right:[{right:k()}],bottom:[{bottom:k()}],left:[{left:k()}],visibility:["visible","invisible","collapse"],z:[{z:[Ho,"auto",ua,ra]}],basis:[{basis:[Go,"full","auto",i,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Uo,Go,"auto","initial","none",ra]}],grow:[{grow:["",Uo,ua,ra]}],shrink:[{shrink:["",Uo,ua,ra]}],order:[{order:[Ho,"first","last","none",ua,ra]}],"grid-cols":[{"grid-cols":x()}],"col-start-end":[{col:T()}],"col-start":[{"col-start":S()}],"col-end":[{"col-end":S()}],"grid-rows":[{"grid-rows":x()}],"row-start-end":[{row:T()}],"row-start":[{"row-start":S()}],"row-end":[{"row-end":S()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mbs:[{mbs:$()}],mbe:[{mbe:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:E()}],"inline-size":[{inline:["auto",...P()]}],"min-inline-size":[{"min-inline":["auto",...P()]}],"max-inline-size":[{"max-inline":["none",...P()]}],"block-size":[{block:["auto",...R()]}],"min-block-size":[{"min-block":["auto",...R()]}],"max-block-size":[{"max-block":["none",...R()]}],w:[{w:[i,"screen",...E()]}],"min-w":[{"min-w":[i,"screen","none",...E()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[s]},...E()]}],h:[{h:["screen","lh",...E()]}],"min-h":[{"min-h":["screen","lh","none",...E()]}],"max-h":[{"max-h":["screen","lh",...E()]}],"font-size":[{text:["base",t,pa,oa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ba,sa]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qo,ra]}],"font-family":[{font:[fa,ia,n]}],"font-features":[{"font-features":[ra]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ua,ra]}],"line-clamp":[{"line-clamp":[Uo,"none",ua,aa]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":["none",ua,ra]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ua,ra]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:_()}],"text-color":[{text:_()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Uo,"from-font","auto",ua,oa]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[Uo,"auto",ua,ra]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"tab-size":[{tab:[Ho,ua,ra]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ua,ra]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ua,ra]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:O()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ho,ua,ra],radial:["",ua,ra],conic:[Ho,ua,ra]},ma,ca]}],"bg-color":[{bg:_()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:_()}],"gradient-via":[{via:_()}],"gradient-to":[{to:_()}],rounded:[{rounded:j()}],"rounded-s":[{"rounded-s":j()}],"rounded-e":[{"rounded-e":j()}],"rounded-t":[{"rounded-t":j()}],"rounded-r":[{"rounded-r":j()}],"rounded-b":[{"rounded-b":j()}],"rounded-l":[{"rounded-l":j()}],"rounded-ss":[{"rounded-ss":j()}],"rounded-se":[{"rounded-se":j()}],"rounded-ee":[{"rounded-ee":j()}],"rounded-es":[{"rounded-es":j()}],"rounded-tl":[{"rounded-tl":j()}],"rounded-tr":[{"rounded-tr":j()}],"rounded-br":[{"rounded-br":j()}],"rounded-bl":[{"rounded-bl":j()}],"border-w":[{border:M()}],"border-w-x":[{"border-x":M()}],"border-w-y":[{"border-y":M()}],"border-w-s":[{"border-s":M()}],"border-w-e":[{"border-e":M()}],"border-w-bs":[{"border-bs":M()}],"border-w-be":[{"border-be":M()}],"border-w-t":[{"border-t":M()}],"border-w-r":[{"border-r":M()}],"border-w-b":[{"border-b":M()}],"border-w-l":[{"border-l":M()}],"divide-x":[{"divide-x":M()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":M()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:_()}],"border-color-x":[{"border-x":_()}],"border-color-y":[{"border-y":_()}],"border-color-s":[{"border-s":_()}],"border-color-e":[{"border-e":_()}],"border-color-bs":[{"border-bs":_()}],"border-color-be":[{"border-be":_()}],"border-color-t":[{"border-t":_()}],"border-color-r":[{"border-r":_()}],"border-color-b":[{"border-b":_()}],"border-color-l":[{"border-l":_()}],"divide-color":[{divide:_()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Uo,ua,ra]}],"outline-w":[{outline:["",Uo,pa,oa]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",d,ya,da]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",u,ya,da]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[Uo,oa]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":M()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",p,ya,da]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[Uo,ua,ra]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Uo]}],"mask-image-linear-from-pos":[{"mask-linear-from":N()}],"mask-image-linear-to-pos":[{"mask-linear-to":N()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":N()}],"mask-image-t-to-pos":[{"mask-t-to":N()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":N()}],"mask-image-r-to-pos":[{"mask-r-to":N()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":N()}],"mask-image-b-to-pos":[{"mask-b-to":N()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":N()}],"mask-image-l-to-pos":[{"mask-l-to":N()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":N()}],"mask-image-x-to-pos":[{"mask-x-to":N()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":N()}],"mask-image-y-to-pos":[{"mask-y-to":N()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[ua,ra]}],"mask-image-radial-from-pos":[{"mask-radial-from":N()}],"mask-image-radial-to-pos":[{"mask-radial-to":N()}],"mask-image-radial-from-color":[{"mask-radial-from":_()}],"mask-image-radial-to-color":[{"mask-radial-to":_()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Uo]}],"mask-image-conic-from-pos":[{"mask-conic-from":N()}],"mask-image-conic-to-pos":[{"mask-conic-to":N()}],"mask-image-conic-from-color":[{"mask-conic-from":_()}],"mask-image-conic-to-color":[{"mask-conic-to":_()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:O()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ua,ra]}],filter:[{filter:["","none",ua,ra]}],blur:[{blur:D()}],brightness:[{brightness:[Uo,ua,ra]}],contrast:[{contrast:[Uo,ua,ra]}],"drop-shadow":[{"drop-shadow":["","none",f,ya,da]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",Uo,ua,ra]}],"hue-rotate":[{"hue-rotate":[Uo,ua,ra]}],invert:[{invert:["",Uo,ua,ra]}],saturate:[{saturate:[Uo,ua,ra]}],sepia:[{sepia:["",Uo,ua,ra]}],"backdrop-filter":[{"backdrop-filter":["","none",ua,ra]}],"backdrop-blur":[{"backdrop-blur":D()}],"backdrop-brightness":[{"backdrop-brightness":[Uo,ua,ra]}],"backdrop-contrast":[{"backdrop-contrast":[Uo,ua,ra]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Uo,ua,ra]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Uo,ua,ra]}],"backdrop-invert":[{"backdrop-invert":["",Uo,ua,ra]}],"backdrop-opacity":[{"backdrop-opacity":[Uo,ua,ra]}],"backdrop-saturate":[{"backdrop-saturate":[Uo,ua,ra]}],"backdrop-sepia":[{"backdrop-sepia":["",Uo,ua,ra]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ua,ra]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Uo,"initial",ua,ra]}],ease:[{ease:["linear","initial",y,ua,ra]}],delay:[{delay:[Uo,ua,ra]}],animate:[{animate:["none",b,ua,ra]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[h,ua,ra]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:A()}],"rotate-x":[{"rotate-x":A()}],"rotate-y":[{"rotate-y":A()}],"rotate-z":[{"rotate-z":A()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:V()}],"skew-x":[{"skew-x":V()}],"skew-y":[{"skew-y":V()}],transform:[{transform:[ua,ra,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:W()}],"translate-x":[{"translate-x":W()}],"translate-y":[{"translate-y":W()}],"translate-z":[{"translate-z":W()}],"translate-none":["translate-none"],zoom:[{zoom:[Ho,ua,ra]}],accent:[{accent:_()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:_()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ua,ra]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":_()}],"scrollbar-track-color":[{"scrollbar-track":_()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ua,ra]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[Uo,pa,oa,aa]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function _a(...e){return Ra(function(){for(var e,n,t=0,r="",o=arguments.length;t<o;t++)(e=arguments[t])&&(n=co(e))&&(r&&(r+=" "),r+=n);return r}(e))}import{Fragment as Oa,jsx as Fa,jsxs as Ia}from"react/jsx-runtime";function ja({sources:e,center:n,centerTitle:t,destinations:r,arrowRight:o=Fa(lo,{icon:"mdi:arrow-right"}),arrowDown:a=Fa(lo,{icon:"mdi:arrow-down"}),className:s}){return Fa("div",{className:_a("elb-architecture-flow",s),children:Ia("div",{className:"elb-architecture-flow__grid",children:[Fa("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--desktop",children:e.title}),Fa("div",{className:"elb-architecture-flow__spacer"}),Fa("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--desktop",children:t}),Fa("div",{className:"elb-architecture-flow__spacer"}),Fa("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--desktop",children:r.title}),Ia("div",{className:"elb-architecture-flow__column",children:[Fa("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--mobile",children:e.title}),Fa("div",{className:"elb-architecture-flow__sections",children:e.sections.map(e=>Fa(Ma,{section:e},e.title))})]}),Fa("div",{className:"elb-architecture-flow__arrow elb-architecture-flow__arrow--desktop",children:o}),Fa("div",{className:"elb-architecture-flow__arrow elb-architecture-flow__arrow--mobile",children:a}),Ia("div",{className:"elb-architecture-flow__center",children:[Fa("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--mobile",children:t}),Fa("div",{className:"elb-architecture-flow__center-content",children:n})]}),Fa("div",{className:"elb-architecture-flow__arrow elb-architecture-flow__arrow--desktop",children:o}),Fa("div",{className:"elb-architecture-flow__arrow elb-architecture-flow__arrow--mobile",children:a}),Ia("div",{className:"elb-architecture-flow__column",children:[Fa("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--mobile",children:r.title}),Fa("div",{className:"elb-architecture-flow__sections",children:r.sections.map(e=>Fa(Ma,{section:e},e.title))})]})]})})}function Ma({section:e}){return Ia("div",{className:"elb-architecture-flow__section",children:[Fa("span",{className:"elb-architecture-flow__section-title",children:e.title}),Ia("div",{className:"elb-architecture-flow__items",children:[e.items.map(e=>{const n=Ia(Oa,{children:[Fa("span",{className:"elb-architecture-flow__item-icon",children:e.icon}),Fa("span",{className:"elb-architecture-flow__item-label",children:e.label})]});return e.link?Fa("a",{href:e.link,className:"elb-architecture-flow__item elb-architecture-flow__item--link",children:n},e.label):Fa("div",{className:"elb-architecture-flow__item",children:n},e.label)}),e.moreLink?Fa("a",{href:e.moreLink,className:"elb-architecture-flow__more elb-architecture-flow__more--link",children:"and more…"}):Fa("span",{className:"elb-architecture-flow__more",children:"and more…"})]})]})}import{useCallback as Na,useEffect as Da,useRef as Aa,useState as La}from"react";import{useCallback as Va,useEffect as Wa,useMemo as Ba,useRef as za,useState as Ga}from"react";import{DiffEditor as Ua}from"@monaco-editor/react";import{jsx as Ha}from"react/jsx-runtime";var qa={readOnly:!0,domReadOnly:!0,originalEditable:!1,renderIndicators:!0,renderMarginRevertIcon:!1,renderGutterMenu:!1,ignoreTrimWhitespace:!1,diffAlgorithm:"advanced",experimental:{showMoves:!0,useTrueInlineView:!0},hideUnchangedRegions:{enabled:!0,revealLineCount:20,minimumLineCount:3,contextLineCount:3},useInlineViewWhenSpaceIsLimited:!0,renderSideBySideInlineBreakpoint:720,fixedOverflowWidgets:!0,automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,lineNumbers:"on",lineNumbersMinChars:3,glyphMargin:!1,lineDecorationsWidth:8,fontSize:13,wordWrap:"off",diffWordWrap:"inherit",renderLineHighlight:"none",overviewRulerLanes:0,scrollbar:{vertical:"auto",horizontal:"auto",alwaysConsumeMouseWheel:!1}};function Ja({original:e,modified:n,language:t="json",height:r="100%",renderSideBySide:o=!0,onSummaryChange:a,beforeMount:s,onMount:i,className:l}){const c=za(null),d=za(null),u=za([]),p=za(a);p.current=a;const[f,g]=Ga($e);Wa(()=>{const e=()=>{const e=function(e){if("undefined"==typeof document)return null;if(e){const n=e.closest("[data-theme]");if(n)return n.getAttribute("data-theme")}return document.documentElement.getAttribute("data-theme")}(c.current),n="dark"===e||null===e&&window.matchMedia("(prefers-color-scheme: dark)").matches;g(n?Ce:$e)};e();const n=new MutationObserver(e);n.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});const t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>{n.disconnect(),t.removeEventListener("change",e)}},[]),Wa(()=>{d.current?.updateOptions({renderSideBySide:o})},[o]);const h=Va(e=>{Ge(e),s?.(e)},[s]),m=Va((e,n)=>{d.current=e,u.current.push(Je(e.getOriginalEditor())),u.current.push(Je(e.getModifiedEditor()));const t=e.onDidUpdateDiff(()=>{const n=e.getLineChanges()??[];let t=0,r=0,o=0;for(const e of n)0===e.originalEndLineNumber?t++:0===e.modifiedEndLineNumber?r++:o++;p.current?.({added:t,deleted:r,modified:o})});u.current.push(()=>t.dispose()),i?.(e)},[i]);Wa(()=>()=>{for(const e of u.current)try{e()}catch{}u.current=[]},[]);const y=Ba(()=>({...qa,renderSideBySide:o}),[o]);return Ha("div",{ref:c,className:l,style:{height:"100%",width:"100%"},children:Ha(Ua,{language:t,original:e,modified:n,theme:f,height:r,options:y,beforeMount:h,onMount:m})})}import{jsx as Ka,jsxs as Xa}from"react/jsx-runtime";var Ya={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};function Qa({summary:e}){return Xa("div",{className:"flex items-center gap-1.5 text-xs font-medium tabular-nums",children:[Xa("span",{className:"text-green-600 dark:text-green-400",children:["+",e.added]}),Xa("span",{className:"text-red-600 dark:text-red-400",children:["-",e.deleted]}),Xa("span",{className:"text-zinc-500 dark:text-zinc-400",children:["~",e.modified]})]})}function Za({view:e,onChange:n}){const t="px-2 py-0.5 text-xs font-medium rounded transition-colors cursor-pointer select-none",r="bg-zinc-200 text-zinc-900 dark:bg-zinc-700 dark:text-zinc-100",o="text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200";return Xa("div",{className:"flex rounded bg-zinc-100 p-0.5 dark:bg-zinc-800","aria-label":"Diff view mode",children:[Ka("button",{type:"button",className:`${t} ${"split"===e?r:o}`,"aria-pressed":"split"===e,onClick:()=>n("split"),children:"Split"}),Ka("button",{type:"button",className:`${t} ${"inline"===e?r:o}`,"aria-pressed":"inline"===e,onClick:()=>n("inline"),children:"Inline"})]})}function es({value:e}){const[n,t]=La("idle"),r=Aa(null);Da(()=>()=>{null!==r.current&&window.clearTimeout(r.current)},[]);const o="copied"===n?"Copied!":"failed"===n?"Copy failed":"Copy modified to clipboard";return Xa("button",{type:"button",className:"elb-explorer-btn",onClick:async()=>{try{await navigator.clipboard.writeText(e),t("copied")}catch{t("failed")}null!==r.current&&window.clearTimeout(r.current),r.current=window.setTimeout(()=>t("idle"),2e3)},title:o,"aria-label":"Copy modified content",children:[Ka("span",{className:"sr-only","aria-live":"polite",children:"idle"!==n?o:""}),"copied"===n?Ka("svg",{...Ya,children:Ka("polyline",{points:"20 6 9 17 4 12"})}):Xa("svg",{...Ya,children:[Ka("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),Ka("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})]})}function ns({original:e,modified:n,language:t="json",label:r,header:o,showHeader:a=!0,showTrafficLights:s=!1,showCopy:i=!0,showViewToggle:l=!0,showSummary:c=!1,defaultView:d="split",footer:u,height:p,style:f,className:g,onMount:h}){const[m,y]=La(d),[b,v]=La({added:0,deleted:0,modified:0}),w=Na(e=>v(e),[]);return Ka(ue,{header:o??r??"Diff",headerActions:Xa("div",{className:"flex items-center gap-2",children:[c&&Ka(Qa,{summary:b}),l&&Ka(Za,{view:m,onChange:y}),i&&Ka(es,{value:n})]}),showHeader:a,showTrafficLights:s,footer:u,height:p,style:f,className:g,children:Ka(Ja,{original:e,modified:n,language:t,renderSideBySide:"split"===m,onSummaryChange:w,onMount:h})})}import{useState as ts,useCallback as rs}from"react";import{createHighlighterCoreSync as os}from"shiki/core";import{createJavaScriptRegexEngine as as}from"shiki/engine/javascript";import ss from"shiki/langs/json.mjs";import is from"shiki/langs/javascript.mjs";import ls from"shiki/langs/typescript.mjs";import cs from"shiki/langs/tsx.mjs";import ds from"shiki/langs/bash.mjs";import us from"shiki/langs/html.mjs";import ps from"shiki/langs/css.mjs";function fs(e){if(e)return e.startsWith("#")?e:`#${e}`}function gs(e,n){const t=e.rules.map(e=>{const n={},t=fs(e.foreground);return t&&(n.foreground=t),e.fontStyle&&(n.fontStyle=e.fontStyle),{scope:e.token,settings:n}}),r=function(e){if(!e)return{};const n={};for(const[t,r]of Object.entries(e)){const e=fs(r);e&&(n[t]=e)}return n}(e.colors),o=!(a=r["editor.background"])||"#00000000"===a||/^#[0-9a-f]{6}00$/i.test(a)?n.defaultBackground??("dark"===n.type?"#292d3e":"#ffffff"):r["editor.background"];var a;const s=r["editor.foreground"]??n.defaultForeground??("dark"===n.type?"#bfc7d5":"#24292E"),i=[{settings:{foreground:s,background:o}},...t];return{name:n.name,type:n.type,bg:o,fg:s,colors:{...r,"editor.background":o,"editor.foreground":s},settings:i,tokenColors:t}}import{jsx as hs}from"react/jsx-runtime";var ms=["json","javascript","typescript","tsx","bash","html","css"],ys=gs(Be,{name:$e,type:"light",defaultBackground:"#ffffff",defaultForeground:"#24292E"}),bs=gs(Me,{name:Ce,type:"dark",defaultBackground:"#292d3e",defaultForeground:"#bfc7d5"}),vs=null;function ws(e){return e?ms.includes(e)?e:"text":"json"}function ks({code:e,language:n,className:t}){const r=(vs||(vs=os({themes:[ys,bs],langs:[ss,is,ls,cs,ds,us,ps],engine:as()})),vs).codeToHtml(e,{lang:ws(n),themes:{light:$e,dark:Ce},defaultColor:"light"});return hs("div",{className:"elb-code-static"+(t?` ${t}`:""),dangerouslySetInnerHTML:{__html:r}})}import{jsx as xs,jsxs as Ts}from"react/jsx-runtime";function Ss({code:e,language:n="javascript",tabs:t,activeTab:r,onTabChange:o,defaultTab:a,label:s,header:i,showHeader:l=!0,showTrafficLights:c=!1,showCopy:d=!0,footer:u,height:p,className:f,style:g}){const[h,m]=ts(!1),[y,b]=ts(r??a??t?.[0]?.id??""),v=r??y,w=rs(e=>{b(e),o?.(e)},[o]),k=t?.find(e=>e.id===v),x=k?.code??e??"",T=k?.language??n,S=i??s??"Code",C=d?xs("div",{style:{display:"flex",gap:"4px",alignItems:"center"},children:xs("button",{className:"elb-explorer-btn",onClick:async()=>{try{await navigator.clipboard.writeText(x),m(!0),setTimeout(()=>m(!1),2e3)}catch{}},title:h?"Copied!":"Copy to clipboard",children:h?xs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:xs("polyline",{points:"20 6 9 17 4 12"})}):Ts("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[xs("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),xs("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})}):void 0,$=t?.map(e=>({id:e.id,label:e.label,content:xs(ks,{code:e.code,language:e.language??n})}));return xs(ue,{header:S,headerActions:C,showHeader:l,tabs:$,defaultTab:a,activeTab:r,onTabChange:w,showTrafficLights:c,footer:u,height:p,style:g,className:f,children:!t&&xs(ks,{code:e??"",language:T})})}import{jsx as Cs}from"react/jsx-runtime";function $s({code:e,language:n="javascript",className:t}){const r=`elb-code-snippet ${t||""}`.trim();return Cs(Ss,{code:e,language:n,className:r,showHeader:!1,showCopy:!0})}import Es,{useEffect as Ps,useRef as Rs}from"react";import _s from"roughjs";import{Fragment as Os,jsx as Fs,jsxs as Is}from"react/jsx-runtime";function js({x:e,y:n,width:t,height:r,fill:o,stroke:a}){const s=Rs(null);return Ps(()=>{if(!s.current)return;const i=s.current.ownerSVGElement;if(!i)return;s.current.replaceChildren();const l=_s.svg(i),c=`M ${e+8} ${n}\n L ${e+t-8} ${n}\n Q ${e+t} ${n} ${e+t} ${n+8}\n L ${e+t} ${n+r-8}\n Q ${e+t} ${n+r} ${e+t-8} ${n+r}\n L ${e+8} ${n+r}\n Q ${e} ${n+r} ${e} ${n+r-8}\n L ${e} ${n+8}\n Q ${e} ${n} ${e+8} ${n}\n Z`,d=l.path(c,{fill:o,fillStyle:"solid",stroke:a,strokeWidth:1.5,roughness:1.2,bowing:1});return s.current.appendChild(d),()=>{s.current?.replaceChildren()}},[e,n,t,r,o,a]),Fs("g",{ref:s})}function Ms({cx:e,cy:n,diameter:t,fill:r,stroke:o}){const a=Rs(null);return Ps(()=>{if(!a.current)return;const s=a.current.ownerSVGElement;if(!s)return;a.current.replaceChildren();const i=_s.svg(s).circle(e,n,t,{fill:r,fillStyle:"solid",stroke:o,strokeWidth:1.5,roughness:.8});return a.current.appendChild(i),()=>{a.current?.replaceChildren()}},[e,n,t,r,o]),Fs("g",{ref:a})}function Ns({x:e,y:n,text:t}){return Is("g",{children:[Fs(Ms,{cx:e,cy:n,diameter:Gs,fill:"var(--flow-marker-fill, #dc2626)",stroke:"var(--flow-marker-stroke, #991b1b)"}),Fs("text",{x:e,y:n,textAnchor:"middle",dominantBaseline:"central",fill:"var(--flow-marker-text, #ffffff)",fontSize:10,fontWeight:600,fontFamily:"system-ui, -apple-system, sans-serif",children:t})]})}function Ds({fromX:e,fromY:n,toX:t,toY:r,stroke:o,arrowSize:a=8,centerY:s}){const i=Rs(null);return Ps(()=>{if(!i.current)return;const l=i.current.ownerSVGElement;if(!l)return;i.current.replaceChildren();const c=_s.svg(l),d=o,u=t-e,p=r-n,f=Math.sqrt(u*u+p*p),g=(e+t)/2,h=(n+r)/2;let m,y;if(Math.abs(p)<2)m=g,y=h-Math.min(.08*f,12);else if(void 0!==s){const t=Math.abs(n-s),o=Math.abs(r-s);m=e+.5*u,y=t>=o?n<s?h-.3*Math.abs(p):h+.3*Math.abs(p):r<s?h-.3*Math.abs(p):h+.3*Math.abs(p)}else m=e+.5*u,y=p>0?n-.3*Math.abs(p):n+.3*Math.abs(p);const b=t-m,v=r-y,w=Math.atan2(v,b),k=t-Math.cos(w)*a,x=r-Math.sin(w)*a,T=`M ${e} ${n} Q ${m} ${y} ${k} ${x}`,S=c.path(T,{stroke:d,strokeWidth:1.5,roughness:.8,fill:"none"});i.current.appendChild(S);const C=Math.PI/6,$=k-8*Math.cos(w-C),E=x-8*Math.sin(w-C),P=c.line(k,x,$,E,{stroke:d,strokeWidth:1.5,roughness:.5});i.current.appendChild(P);const R=k-8*Math.cos(w+C),_=x-8*Math.sin(w+C),O=c.line(k,x,R,_,{stroke:d,strokeWidth:1.5,roughness:.5});return i.current.appendChild(O),()=>{i.current?.replaceChildren()}},[e,n,t,r,o,a,s]),Fs("g",{ref:i})}var As={labelSize:13,labelWeight:"600",textSize:12,textWeight:"normal",boxHeight:50,descriptionSize:13},Ls=120,Vs=50;function Ws(e,n){if(!e||!n)return[];const t=[],r=new Set;let o=n;for(;o;){if(r.has(o))throw new Error(`FlowMap: Circular reference detected in transformer chain at "${o}"`);const n=e[o];if(!n)throw new Error(`FlowMap: Invalid transformer reference "${o}". Available transformers: ${Object.keys(e).join(", ")||"none"}`);r.add(o),t.push({name:o,config:n}),o=n.next}return t}function Bs(e,n){if(!e)return[];const t=new Set;for(const r of n){if(!r||!e[r])continue;Ws(e,r).forEach(e=>t.add(e.name))}if(0===t.size)return[];const r=new Set;for(const n of t){const o=e[n]?.next;o&&t.has(o)&&r.add(o)}let o;for(const e of t)if(!r.has(e)){o=e;break}return o||(o=[...t][0]),Ws(e,o)}function zs(e,n){if(!e)return n.length;const t=n.findIndex(n=>n.name===e);return t>=0?t:n.length}var Gs=16;function Us({stageBefore:e,sources:n,preTransformers:t,collector:r,postTransformers:o,destinations:a,stageAfter:s,title:i,layout:l=As,boxHeight:c,descriptionHeight:d,markers:u,className:p,withReturn:f}){const g=Object.entries(n??{default:{}}),h=Object.entries(a??{default:{}}),m=g.map(([,e])=>e.next),y=Bs(t,m),b=h.map(([,e])=>e.before),v=Bs(o,b),w=[...g].sort(([,e],[,n])=>zs(e.next,y)-zs(n.next,y)),k=[...h].sort(([,e],[,n])=>zs(e.before,v)-zs(n.before,v)),x=Rs(null),T=e?.description||g.some(([,e])=>e.description)||y.some(e=>e.config.description)||r?.description||v.some(e=>e.config.description)||h.some(([,e])=>e.description)||s?.description||h.some(([,e])=>e.after?.description),S=!1!==e?.link||g.some(([,e])=>!1!==e.link)||y.some(e=>!1!==e.config.link)||!1!==r?.link||v.some(e=>!1!==e.config.link)||h.some(([,e])=>!1!==e.link)||!1!==s?.link||h.some(([,e])=>!1!==e.after?.link),C=["stage-before","stage-before-right","source","source-left","source-right","collector","collector-left","collector-right","destination","destination-left","destination-right","stage-after","stage-after-left"],$=u?.some(e=>{return n=e.position,!!C.includes(n)||/^(source|destination|pre|post)-[^-]+(-left|-right)?$/.test(n);var n})??!1?Gs/2+4:0,E=u?.filter(e=>e.text)??[],P=E.reduce((e,n)=>e+(n.text?.length??0),0),R=Math.max(1,Math.ceil(P/70)),_=E.length>0?18*R+8:0,O=c??l.boxHeight,F=d??30,I=T||S?F+10:0,j=Math.max(g.length,h.length,1),M=O*j+12*(j-1),N=s||h.some(([,e])=>e.after),D=function(e,n,t){return(n?0:25)+Ls*e+Vs*(e-1)+(t?0:25)}(1+(e?1:0)+y.length+1+v.length+1+(N?1:0),!!e,!!N),A=16+M+I+$+_,L=i?A+30:A,V=8+(i?30:0)+$,W=V+M/2,B=(e,n)=>W-(O*n+12*(n-1))/2+e*(O+12);let z=e?0:25;const G={},U=[],H=[];e&&(G.before={x:z,y:W-O/2,width:Ls,height:O},z+=170);const q=z;w.forEach(([e],n)=>{const t={x:q,y:B(n,w.length),width:Ls,height:O};U.push({name:e,pos:t}),G[`source-${e}`]=t}),U.length>0&&(G.source=U[0].pos),z+=170;const J=[],K=new Map;w.forEach(([e,n])=>{const t=n.next;if(t){const n=K.get(t)??[];n.push(e),K.set(t,n)}}),y.forEach(({name:e,config:n})=>{if(n.next){K.get(e);const t=K.get(n.next)??[];K.set(n.next,[...new Set([...t,`chain:${e}`])])}}),y.forEach(({name:e})=>{const n=K.get(e)??[],t=n.filter(e=>!e.startsWith("chain:")),r=n.some(e=>e.startsWith("chain:"));let o;if(1!==t.length||r)o=W-O/2;else{const e=G[`source-${t[0]}`];o=e?e.y:W-O/2}const a={x:z,y:o,width:Ls,height:O};J.push({name:e,pos:a}),G[`pre-${e}`]=a,z+=170}),G.collector={x:z,y:W-O/2,width:Ls,height:O},z+=170;const X=[],Y=new Map;k.forEach(([e,n])=>{const t=n.before;if(t){const n=Y.get(t)??[];n.push(e),Y.set(t,n)}});for(let e=v.length-1;e>=0;e--){const{name:n,config:t}=v[e];if(t.next){Y.get(t.next);const e=Y.get(n)??[];Y.set(n,[...new Set([...e,`chain:${t.next}`])])}}const Q=z+170*v.length;k.forEach(([e],n)=>{const t={x:Q,y:B(n,k.length),width:Ls,height:O};H.push({name:e,pos:t}),G[`destination-${e}`]=t}),H.length>0&&(G.destination=H[0].pos),v.forEach(({name:e})=>{const n=Y.get(e)??[],t=n.filter(e=>!e.startsWith("chain:")),r=n.some(e=>e.startsWith("chain:"));let o;if(1!==t.length||r)if(t.length>1&&!r){const e=t.map(e=>G[`destination-${e}`]?.y).filter(e=>void 0!==e);if(e.length>0){o=e.reduce((e,n)=>e+n,0)/e.length}else o=W-O/2}else o=W-O/2;else{const e=G[`destination-${t[0]}`];o=e?e.y:W-O/2}const a={x:z,y:o,width:Ls,height:O};X.push({name:e,pos:a}),G[`post-${e}`]=a,z+=170});const Z=[];if(N){const e=z+Ls+Vs;k.forEach(([n,t],r)=>{const o=t.after??s;if(o){const t={x:e,y:B(r,k.length),width:Ls,height:O};Z.push({name:n,pos:t,config:o}),G[`after-${n}`]=t}}),Z.length>0&&(G.after=Z[0].pos)}const ee=W,ne=[...e?[{key:"before",config:e,fillVar:"--flow-before-fill",strokeVar:"--flow-before-stroke",defaultLabel:"Before",defaultLink:void 0}]:[],...w.map(([e,n])=>({key:`source-${e}`,config:n,fillVar:"--flow-source-fill",strokeVar:"--flow-source-stroke",defaultLabel:"Source",defaultLink:"/docs/sources"})),...y.map(({name:e,config:n})=>({key:`pre-${e}`,config:n,fillVar:"--flow-transformer-fill",strokeVar:"--flow-transformer-stroke",defaultLabel:e.charAt(0).toUpperCase()+e.slice(1),defaultLink:"/docs/transformers"})),{key:"collector",config:r,fillVar:"--flow-collector-fill",strokeVar:"--flow-collector-stroke",defaultLabel:"Collector",defaultLink:"/docs/collectors"},...v.map(({name:e,config:n})=>({key:`post-${e}`,config:n,fillVar:"--flow-transformer-fill",strokeVar:"--flow-transformer-stroke",defaultLabel:e.charAt(0).toUpperCase()+e.slice(1),defaultLink:"/docs/transformers"})),...k.map(([e,n])=>({key:`destination-${e}`,config:n,fillVar:"--flow-destination-fill",strokeVar:"--flow-destination-stroke",defaultLabel:"Destination",defaultLink:"/docs/destinations"})),...Z.map(({name:e,config:n})=>({key:`after-${e}`,config:n,fillVar:"--flow-after-fill",strokeVar:"--flow-after-stroke",defaultLabel:"External",defaultLink:void 0}))];return Fs("div",{ref:x,className:`elb-explorer elb-flow-map ${p||""}`,style:{width:"100%",maxWidth:D},children:Is("svg",{viewBox:`0 0 ${D} ${L}`,style:{width:"100%",height:"auto",display:"block"},children:[i&&Fs("text",{x:D/2,y:18,textAnchor:"middle",dominantBaseline:"middle",fill:"var(--color-text, #f3f4f6)",fontSize:14,fontWeight:600,fontFamily:"system-ui, -apple-system, sans-serif",children:i}),(()=>{const r=G.collector,s=r.y+O/2;return Is(Os,{children:[!e&&1===g.length&&Fs(Ds,{fromX:0,fromY:ee,toX:G.source.x,toY:ee,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),e&&Fs(Ds,{fromX:G.before.x+Ls,fromY:ee,toX:G.source.x,toY:G.source.y+O/2,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),(()=>{const e=new Map;return U.forEach(({name:t,pos:r},o)=>{const a=n?.[t]??{},s=a.next?`pre-${a.next}`:y.length>0?`pre-${y[0].name}`:"collector",i=e.get(s)??[];i.push({name:t,pos:r,sortIndex:o}),e.set(s,i)}),U.map(({name:o,pos:a})=>{const s=n?.[o]??{},i=((e,n)=>n.next&&t?.[n.next]?G[`pre-${n.next}`]:y.length>0?G[`pre-${y[0].name}`]:r)(0,s),l=a.y+O/2,c=i.y+O/2,d=s.next?`pre-${s.next}`:y.length>0?`pre-${y[0].name}`:"collector",u=e.get(d)??[],p=((e,n,t)=>{if(n<=1)return t;const r=Math.min(.6*O,12*(n-1));return t-r/2+e*(r/(n-1))})(u.findIndex(e=>e.name===o),u.length,c),g=f?6:0;return Is(Es.Fragment,{children:[Fs(Ds,{fromX:a.x+Ls,fromY:l-g,toX:i.x,toY:p-g,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),f&&Fs(Ds,{fromX:i.x,fromY:p+g,toX:a.x+Ls,toY:l+g,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]},`source-${o}-arrows`)})})(),J.map(({name:e,pos:n},o)=>{const a=t?.[e]??{};let s;s=a.next&&t?.[a.next]?G[`pre-${a.next}`]:r;const i=n.y+O/2,l=s.y+O/2,c=f?6:0;return Is(Es.Fragment,{children:[Fs(Ds,{fromX:n.x+Ls,fromY:i-c,toX:s.x,toY:l-c,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),f&&Fs(Ds,{fromX:s.x,fromY:l+c,toX:n.x+Ls,toY:i+c,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]},`pre-${e}-chain`)}),H.map(({name:e,pos:n})=>{const t=((e,n)=>n.before&&o?.[n.before]?G[`post-${n.before}`]:r)(0,a?.[e]??{}),s=n.y+O/2,i=t.y+O/2,l=f?6:0;return Is(Es.Fragment,{children:[Fs(Ds,{fromX:t.x+Ls,fromY:i-l,toX:n.x,toY:s-l,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),f&&Fs(Ds,{fromX:n.x,fromY:s+l,toX:t.x+Ls,toY:i+l,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]},`destination-${e}-arrows`)}),X.slice(0,-1).map(({name:e,pos:n},t)=>{const r=X[t+1];if(!r)return null;const o=r.pos,a=n.y+O/2,s=o.y+O/2,i=f?6:0;return Is(Es.Fragment,{children:[Fs(Ds,{fromX:n.x+Ls,fromY:a-i,toX:o.x,toY:s-i,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),f&&Fs(Ds,{fromX:o.x,fromY:s+i,toX:n.x+Ls,toY:a+i,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]},`post-${e}-chain`)}),v.length>0&&(()=>{const e=G[`post-${v[0].name}`],n=s,t=e.y+O/2,o=f?6:0;return Is(Os,{children:[Fs(Ds,{fromX:r.x+Ls,fromY:n-o,toX:e.x,toY:t-o,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),f&&Fs(Ds,{fromX:e.x,fromY:t+o,toX:r.x+Ls,toY:n+o,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]})})(),Z.map(({name:e,pos:n})=>{const t=G[`destination-${e}`];if(!t)return null;const r=t.y+O/2,o=n.y+O/2;return Fs(Ds,{fromX:t.x+Ls,fromY:r,toX:n.x,toY:o,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee},`dest-${e}-after`)}),!N&&1===h.length&&Fs(Ds,{fromX:G.destination.x+Ls,fromY:ee,toX:D,toY:ee,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]})})(),ne.map(({key:e,config:n,fillVar:t,strokeVar:r,defaultLabel:o,defaultLink:a})=>{const s=G[e],i=n?.icon,c=n?.label||o,d=n?.text,u=n?.description,p=n?.link,f=!1!==n?.highlight,g=d?s.y+.28*s.height:s.y+s.height/2,h=!1===p?null:"string"==typeof p?p:a,m=Is(Os,{children:[Fs(js,{x:s.x,y:s.y,width:s.width,height:s.height,fill:`var(${t}, #6b7280)`,stroke:f?`var(${r}, #6b7280)`:"var(--flow-edge-stroke, #9ca3af)"}),Fs("foreignObject",{x:s.x+4,y:g-l.labelSize/2-2,width:s.width-8,height:l.labelSize+4,children:Is("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px",height:"100%",fontSize:l.labelSize,fontWeight:l.labelWeight,fontFamily:"system-ui, -apple-system, sans-serif",color:"var(--color-text)"},children:[i&&Fs(lo,{icon:i,width:14,height:14}),Fs("span",{children:c})]})}),d&&Fs("foreignObject",{x:s.x+4,y:s.y+.34*s.height,width:s.width-8,height:.62*s.height,children:Fs("div",{style:{fontSize:l.textSize,fontWeight:l.textWeight,color:"var(--color-text)",textAlign:"center",fontFamily:"system-ui, -apple-system, sans-serif",lineHeight:1.3,height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:d})}),u&&Fs("foreignObject",{x:s.x,y:s.y+s.height+8,width:Ls,height:F,children:Fs("div",{style:{fontSize:l.descriptionSize,color:"var(--color-text-muted)",textAlign:"center",fontFamily:"system-ui, -apple-system, sans-serif",lineHeight:1.3},children:u})})]});return h?Fs("a",{href:h,style:{cursor:"pointer",textDecoration:"none"},children:m},e):Fs("g",{children:m},e)}),u?.map((e,n)=>{const t=function(e,n,t,r){const o=n.source,a=n.collector,s=n.destination,i=n.before,l=n.after,c=(e,n)=>e?"-left"===n?{x:e.x+4,y:e.y-4}:{x:e.x+e.width-4,y:e.y-4}:null,d=e=>{if(!e)return null;const n=e.y+e.height/2;return{x:e.x+e.width+25-6,y:n+Gs/2+4}};switch(e){case"stage-before":case"stage-before-right":return c(i);case"source":case"source-right":return c(o);case"source-left":return c(o,"-left");case"collector":case"collector-right":return c(a);case"collector-left":return c(a,"-left");case"destination":case"destination-right":return c(s);case"destination-left":return c(s,"-left");case"stage-after":case"stage-after-left":return c(l,"-left");case"incoming":return{x:12.5,y:t+Gs/2+8};case"outgoing":return{x:r-12.5,y:t+Gs/2+8};case"before-source":return d(i);case"source-collector":return d(o);case"collector-destination":case"collector-post":return d(a);case"destination-after":return d(s);case"pre-collector":const u=Object.keys(n).filter(e=>e.startsWith("pre-"));return 0===u.length?null:d(n[u[u.length-1]]);default:{const t=e.match(/^source-([^-]+)(-left|-right)?$/);if(t){const e=t[1],r=t[2];return c(n[`source-${e}`],r)}const r=e.match(/^destination-([^-]+)(-left|-right)?$/);if(r){const e=r[1],t=r[2];return c(n[`destination-${e}`],t)}const o=e.match(/^pre-([^-]+)(-left|-right)?$/);if(o){const e=o[1],t=o[2];return"collector"===e?null:c(n[`pre-${e}`],t)}const s=e.match(/^post-([^-]+)(-left|-right)?$/);if(s){const e=s[1],t=s[2];return c(n[`post-${e}`],t)}const i=e.match(/^source-([^-]+)-pre$/);if(i)return d(n[`source-${i[1]}`]);const l=e.match(/^source-([^-]+)-collector$/);if(l)return d(n[`source-${l[1]}`]);const u=e.match(/^pre-([^-]+)-next$/);if(u)return d(n[`pre-${u[1]}`]);const p=e.match(/^post-([^-]+)-next$/);if(p)return d(n[`post-${p[1]}`]);const f=e.match(/^post-destination-([^-]+)$/);if(f){f[1];const e=Object.keys(n).filter(e=>e.startsWith("post-"));return 0===e.length?d(a):d(n[e[e.length-1]])}return null}}}(e.position,G,ee,D);if(!t)return null;const r=e.id??String(n+1);return Fs(Ns,{x:t.x,y:t.y,text:r},`marker-${n}`)}),E.length>0&&Fs("foreignObject",{x:8,y:V+M+I+4,width:D-16,height:18*R,children:Fs("div",{style:{fontSize:11,fontFamily:"system-ui, -apple-system, sans-serif",color:"var(--color-text-muted)",lineHeight:1.6},children:E.map((e,n)=>{const t=e.id??String((u?.indexOf(e)??n)+1);return Is("span",{children:[Fs("span",{style:{width:12,height:12,borderRadius:"50%",background:"var(--flow-marker-fill, #dc2626)",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:8,fontWeight:600,color:"var(--flow-marker-text, #ffffff)",verticalAlign:"middle",marginRight:4,position:"relative",top:-1},children:t}),Fs("span",{style:{marginRight:10},children:e.text})]},`legend-${n}`)})})})]})})}import{useState as Hs}from"react";import{jsx as qs,jsxs as Js}from"react/jsx-runtime";var Ks={"Mapping.Value":"/docs/mapping/value","Mapping.Rule":"/docs/mapping/rule","WalkerOS.Consent":"/docs/guides/consent"};function Xs(e,n){if(!e.startsWith("#/"))return;const t=e.slice(2).split("/");let r=n;for(const e of t){if(!r||"object"!=typeof r||!(e in r))return;r=r[e]}return r}function Ys(e,n){const t=e=>{const t=Xs(e,n),r=(o=t,a=function(e){const n=e.lastIndexOf("/");return n>=0?e.slice(n+1):e}(e),o&&"string"==typeof o.title?o.title:a);var o,a;return{title:r,href:Ks[r]}};if("string"==typeof e.$ref){const n=t(e.$ref);return{type:n.title,typeRefs:[n]}}if(Array.isArray(e.allOf)){const n=e.allOf,r=n.map(e=>"string"==typeof e.$ref?e.$ref:void 0).filter(e=>!!e);if(1===r.length&&1===n.length){const e=t(r[0]);return{type:e.title,typeRefs:[e]}}}if(Array.isArray(e.anyOf)){const n=e.anyOf,r=[];let o,a;for(const e of n)"string"==typeof e.$ref?(a=e.$ref,r.push(a)):"array"===e.type&&e.items&&"string"==typeof e.items.$ref&&(o=e.items.$ref,r.push(o));if(2===n.length&&a&&o&&a===o){const e=t(a);return{type:`${e.title} | ${e.title}[]`,typeRefs:[e]}}if(r.length>0&&r.length===n.length){const e=r.map(t);return{type:e.map(e=>e.title).join(" | "),typeRefs:e}}}if("array"===e.type&&e.items&&"string"==typeof e.items.$ref){const n=t(e.items.$ref);return{type:`${n.title}[]`,typeRefs:[n]}}if("object"===e.type&&e.additionalProperties&&"string"==typeof e.additionalProperties.$ref){const n=t(e.additionalProperties.$ref);return{type:`Record<string, ${n.title}>`,typeRefs:[n]}}}function Qs(e){const n=e;let t=e;if(Array.isArray(t.allOf)&&1===t.allOf.length&&"string"==typeof t.allOf[0].$ref){const e=Xs(t.allOf[0].$ref,n);e&&(t=e)}const r=[];return Zs(t,n,0,"",r),r}function Zs(e,n,t,r,o){const a=e.required||[];if(e.properties)for(const[s,i]of Object.entries(e.properties)){const e=i,l=r?`${r}.${s}`:s,c=Ys(e,n);let d,u;if(c)d=c.type,u=c.typeRefs;else{if(d=e.type||"any",e.enum&&(d=e.enum.map(e=>`'${e}'`).join(" | ")),"array"===d&&e.items){const n=e.items;d=n.enum?`Array<${n.enum.map(e=>`'${e}'`).join(" | ")}>`:`Array<${n.type||"any"}>`}if("object"===d&&e.additionalProperties){d=`Record<string, ${e.additionalProperties.type||"any"}>`}if(e.anyOf||e.oneOf){d=(e.anyOf||e.oneOf).map(e=>e.type||"any").join(" | ")}}let p,f=e.description||"";const g=f.match(/\(like\s+(.+?)\)$/);g&&(p=g[1],f=f.replace(/\s*\(like\s+.+?\)$/,"")),"any"===d&&f.toLowerCase().includes("function")&&(d="function");const h=!c&&"object"===e.type&&e.properties&&"object"==typeof e.properties;h&&"string"==typeof e.title&&(d=e.title),o.push({name:l,type:d,typeRefs:u,description:f,required:a.includes(s),default:void 0!==e.default?String(e.default):void 0,example:p,depth:t}),h&&Zs(e,n,t+1,l,o)}}function ei({property:e,isOpen:n,onClose:t}){if(!n||!e)return null;return qs("div",{className:"elb-property-table__modal-backdrop",onClick:e=>{e.target===e.currentTarget&&t()},children:Js("div",{className:"elb-property-table__modal-content",children:[Js("div",{className:"elb-property-table__modal-header",children:[Js("h3",{className:"elb-property-table__modal-title",children:[qs("code",{className:"elb-property-table__modal-property-name",children:e.name}),e.required&&qs("span",{className:"elb-property-table__required-icon",children:"*"})]}),qs("button",{className:"elb-property-table__close-button",onClick:t,"aria-label":"Close",children:Js("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[qs("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),qs("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),Js("div",{className:"elb-property-table__modal-body",children:[Js("div",{className:"elb-property-table__modal-row",children:[qs("span",{className:"elb-property-table__modal-label",children:"Type:"}),qs("code",{className:"elb-property-table__modal-type elb-property-table__modal-type--wrap",children:e.type})]}),e.description&&Js("div",{className:"elb-property-table__modal-row",children:[qs("span",{className:"elb-property-table__modal-label",children:"Description:"}),qs("p",{className:"elb-property-table__modal-description",children:e.description})]}),e.default&&Js("div",{className:"elb-property-table__modal-row",children:[qs("span",{className:"elb-property-table__modal-label",children:"Default:"}),qs("code",{className:"elb-property-table__modal-default",children:e.default})]}),e.example&&Js("div",{className:"elb-property-table__modal-row",children:[qs("span",{className:"elb-property-table__modal-label",children:"Example:"}),qs("code",{className:"elb-property-table__modal-example",children:e.example})]})]})]})})}function ni(e,n){const t=Array.from(new Set(n.map(e=>e.title)));if(0===t.length)return e;t.sort((e,n)=>n.length-e.length);const r=t.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),o=new RegExp(`(${r.join("|")})`,"g"),a={};for(const e of n)a[e.title]=e.href;return e.split(o).map((e,n)=>{if(t.includes(e)){const t=a[e];return t?qs("a",{href:t,className:"elb-property-table__type-link",children:e},n):qs("span",{children:e},n)}return qs("span",{children:e},n)})}function ti({schema:e,className:n,emptyMessage:t}){const[r,o]=Hs(null),[a,s]=Hs(!1),[i,l]=Hs(new Set),c=Qs(e),d=new Set;for(const e of c){const n=e.name.lastIndexOf(".");n>0&&d.add(e.name.slice(0,n))}const u=function(e,n){return 0===n.size?e:e.filter(e=>{const t=e.name.split(".");for(let e=1;e<t.length;e++)if(n.has(t.slice(0,e).join(".")))return!1;return!0})}(c,i);if(0===c.length)return qs("div",{className:`elb-explorer elb-property-table__empty ${n||""}`,role:"note",children:t??"No specific properties available."});const p=c.some(e=>e.required),f=e=>e.length<=30?e:e.slice(0,30),g=e=>{o(e),s(!0)};return Js("div",{className:`elb-explorer ${n||""}`,children:[qs("div",{className:"elb-property-table__container",children:Js("table",{className:"elb-property-table",children:[qs("thead",{children:Js("tr",{children:[qs("th",{children:"Property"}),qs("th",{children:"Type"}),qs("th",{children:"Description"}),qs("th",{children:"More"})]})}),qs("tbody",{children:u.map((e,n)=>{const t=d.has(e.name),r=i.has(e.name),o=e.depth>0?e.name.slice(e.name.lastIndexOf(".")+1):e.name;return Js("tr",{className:e.depth>0?"elb-property-table__row--nested":void 0,children:[Js("td",{className:"elb-property-table__property-cell","data-label":"Property",style:e.depth>0?{paddingLeft:.75+1.25*e.depth+"rem"}:void 0,children:[t&&qs("button",{type:"button",className:"elb-property-table__group-toggle",onClick:()=>{return n=e.name,void l(e=>{const t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t});var n},"aria-expanded":!r,"aria-label":`${r?"Expand":"Collapse"} ${o}`,children:qs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{transform:r?"rotate(-90deg)":"rotate(0deg)",transition:"transform 0.15s ease"},children:qs("polyline",{points:"6 9 12 15 18 9"})})}),Js("code",{className:"elb-property-table__property-name",children:[o,e.required&&qs("span",{className:"elb-property-table__required-icon",children:"*"})]})]}),qs("td",{className:"elb-property-table__type-cell","data-label":"Type",children:e.typeRefs&&e.typeRefs.length>0?qs("code",{className:"elb-property-table__property-type",children:ni(e.type,e.typeRefs)}):(a=e.type,a.length>30?qs("button",{className:"elb-property-table__type-button",onClick:()=>g(e),"aria-label":`View full type for ${e.name}`,children:qs("code",{className:"elb-property-table__property-type elb-property-table__property-type--truncated",children:f(e.type)})}):qs("code",{className:"elb-property-table__property-type",children:e.type}))}),qs("td",{className:"elb-property-table__description","data-label":"Description",children:e.description}),qs("td",{className:"elb-property-table__action-cell","data-label":"More",children:qs("button",{className:"elb-property-table__more-button",onClick:()=>g(e),"aria-label":`More info about ${e.name}`,children:Js("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[qs("circle",{cx:"12",cy:"12",r:"10"}),qs("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),qs("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})})})]},e.name||n);var a})})]})}),p&&Js("div",{className:"elb-property-table__required-notice",children:[qs("span",{className:"elb-property-table__required-icon",children:"*"})," Required fields"]}),qs(ei,{property:r,isOpen:a,onClose:()=>{s(!1),o(null)}})]})}import{jsx as ri,jsxs as oi}from"react/jsx-runtime";function ai({trigger:e,isOpen:n,onToggle:t,children:r,align:o="left",ariaLabel:a,className:s=""}){return oi("div",{className:`elb-dropdown ${s}`.trim(),children:[ri("div",{className:"elb-dropdown__trigger",onClick:t,role:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":n,"aria-label":a,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t())},children:e}),n&&ri("div",{className:`elb-dropdown__panel elb-dropdown__panel--${o}`,role:"menu",children:r})]})}function si({children:e,onClick:n,disabled:t=!1,variant:r="default",className:o=""}){return ri("button",{type:"button",role:"menuitem",className:`elb-dropdown__item elb-dropdown__item--${r} ${t?"elb-dropdown__item--disabled":""} ${o}`.trim(),onClick:n,disabled:t,children:e})}function ii({className:e=""}){return ri("div",{className:`elb-dropdown__divider ${e}`.trim(),role:"separator"})}import{jsx as li}from"react/jsx-runtime";function ci({children:e,className:n=""}){return li("div",{className:`elb-explorer-footer ${n}`,children:e})}import{jsx as di}from"react/jsx-runtime";function ui({variant:e="default",size:n="md",href:t,onClick:r,children:o,className:a="",disabled:s=!1}){const i="elb-button-link",l=`${i} ${i}-${e} ${i}-${n} ${a}`.trim();return t&&!s?di("a",{href:t,className:l,children:o}):di("button",{type:"button",className:l,onClick:r,disabled:s,children:o})}import{jsx as pi}from"react/jsx-runtime";function fi({size:e="md",className:n=""}){return pi("span",{className:`elb-spinner elb-spinner--${e} ${n}`.trim(),role:"status","aria-label":"Loading"})}ur("walkeros:piwik-pro",{body:'<g fill="none" fill-rule="evenodd"><path fill="#231F20" d="M0 0h90v90H0z"/><path d="M50.792 57.21v.044H37.99v8.675c0 3.38-2.652 6.07-6.006 6.07a5.917 5.917 0 0 1-4.243-1.77 6.073 6.073 0 0 1-1.74-4.3v-38.88C26 23.67 28.65 21 31.983 21H50.79v.022c9.58.4 17.209 8.341 17.209 18.104 0 9.764-7.628 17.704-17.209 18.083h.001Zm-2.148-25.29H37.99v14.57h10.872c3.88-.112 6.993-3.337 6.993-7.274a7.347 7.347 0 0 0-2.114-5.16 7.16 7.16 0 0 0-5.098-2.134Z" fill="#FFF" fill-rule="nonzero"/></g>',width:90,height:90}),ur("walkeros:snowplow",{body:'<path d="M328.55 135.473L259.662 14.399a31.246 31.246 0 0 0-10.654-10.224 30.715 30.715 0 0 0-14.09-4.123h-51.362c-.47-.07-.948-.07-1.419 0H97.061a30.545 30.545 0 0 0-14.086 4.136A31.074 31.074 0 0 0 72.36 14.45L3.45 135.473A32.012 32.012 0 0 0 0 149.939c0 5.031 1.183 9.99 3.45 14.465L72.38 285.539a31.203 31.203 0 0 0 10.607 10.279A30.68 30.68 0 0 0 97.06 300h137.857a30.669 30.669 0 0 0 14.087-4.178 31.19 31.19 0 0 0 10.616-10.283l68.929-121.135a32.018 32.018 0 0 0 3.45-14.465c0-5.032-1.183-9.991-3.45-14.466zM251.086 19.439l25.159 44.225-44.074 76.53-28.848-50.129a4.973 4.973 0 0 0-1.804-1.814 4.884 4.884 0 0 0-2.454-.665h-57.261l43.851-77.506h49.263a21.061 21.061 0 0 1 9.12 2.79 21.41 21.41 0 0 1 7.008 6.548l.04.021zm-81.954 125.887l-27.47-47.722h54.585l27.491 47.712-54.606.01zm-8.971 4.844l-27.155 47.197-27.258-47.423l27.146-47.198 27.267 47.424zm8.687 5.245h54.302l-26.974 46.91h-54.514l27.186-46.91zM80.985 19.439a21.263 21.263 0 0 1 6.988-6.505 20.922 20.922 0 0 1 9.088-2.751h77.129l-43.8 77.403H42.202L80.985 19.44zM12.056 140.512l24.399-42.908h87.924l-28.686 49.789a5.065 5.065 0 0 0 0 5.071l28.686 49.85H36.455l-24.43-42.867a22.01 22.01 0 0 1-2.13-9.452c0-3.273.729-6.504 2.13-9.452l.031-.031zm85.005 149.419a21.067 21.067 0 0 1-9.136-2.841 21.415 21.415 0 0 1-6.99-6.611l-38.803-68.137h87.924l44.236 77.589h-77.23zm153.974-9.452a21.41 21.41 0 0 1-6.986 6.609 21.071 21.071 0 0 1-9.131 2.843h-49.152l-44.246-77.62h57.474c.861 0 1.707-.229 2.454-.664a4.973 4.973 0 0 0 1.804-1.814l28.625-49.697 44.013 76.705-24.855 43.638zm68.929-121.135l-38.336 67.428-43.851-76.468 44.205-76.664 38.053 66.852a22.014 22.014 0 0 1 2.131 9.452c0 3.273-.729 6.504-2.131 9.452" fill="#9E62DD"/>',width:332,height:300});import gi from"react";var hi={},mi=gi.createContext(hi);function yi(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(hi):e.components||hi:function(e){const n=gi.useContext(mi);return gi.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}(e.components),gi.createElement(mi.Provider,{value:n},e.children)}import{Children as bi}from"react";import{jsx as vi}from"react/jsx-runtime";var wi=({className:e,children:n})=>{const t=bi.toArray(n),r="string"==typeof e,o=t.some(e=>"string"==typeof e&&e.match(/[\n\r]/g));if(!r||!o)return vi("code",{className:"elb-code-inline",children:n});const a=e.replace(/^language-/,""),s={js:"javascript",ts:"typescript",jsx:"javascript",tsx:"typescript",bash:"shell",sh:"shell",yml:"yaml",md:"markdown"}[a]||a,i=t.map(e=>"string"==typeof e?e:"").join("").trim();return vi(pt,{code:i,language:s,disabled:!0,showCopy:!0,showHeader:!1,autoHeight:{min:100,max:600}})};import{jsx as ki}from"react/jsx-runtime";var xi=({children:e})=>ki(yi,{components:{code:wi,CodeBox:pt,PropertyTable:ti},children:e});import{useState as Ti,useRef as Si,useEffect as Ci,useCallback as $i}from"react";function Ei(){const[e,n]=Ti(!1),t=Si(null),r=$i(()=>{n(e=>!e)},[]),o=$i(()=>{n(!0)},[]),a=$i(()=>{n(!1)},[]);return Ci(()=>{if(e)return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r);function r(e){t.current&&!t.current.contains(e.target)&&n(!1)}},[e]),Ci(()=>{if(e)return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t);function t(e){"Escape"===e.key&&n(!1)}},[e]),{isOpen:e,toggle:r,open:o,close:a,containerRef:t}}function Pi(e,n){const t=JSON.parse(JSON.stringify(e));for(const[e,r]of Object.entries(n)){const n=""===e?t:Ri(t,e);n&&"object"==typeof n&&Object.assign(n,r)}return t}function Ri(e,n){const t=n.split(".");let r=e;for(const e of t){if(!r||"object"!=typeof r||!(e in r))return;r=r[e]}return r}function _i(e){const n=JSON.parse(JSON.stringify(e)),t=n.definitions?.FlowJson,r=n.definitions?.Flow,o=n.definitions?.FlowConfig;if(!t?.properties)return n;const a=t.properties,s=r?.properties,i=o?.properties;return a.version&&(a.version.markdownDescription='Schema version number. Use `4` for the current format.\n\n```json\n"version": 4\n```'),a.$schema&&(a.$schema.markdownDescription='JSON Schema URI for IDE validation.\n\n```json\n"$schema": "https://walkeros.io/schema/flow/v4.json"\n```'),a.include&&(a.include.markdownDescription='Folders to include in the bundle output.\n\n```json\n"include": ["./src", "./lib"]\n```'),a.variables&&(a.variables.markdownDescription='Reusable values referenced via `$var.name` (with optional deep paths).\n\nWhole-string references preserve native type (objects/arrays/scalars).\nInline interpolation requires scalars.\n\n```json\n"variables": {\n "apiKey": "G-XXXXXXXXXX",\n "debug": false,\n "mapping": {\n "map": { "id": "data.id" }\n }\n}\n```\n\nReference scalars or structures: `"$var.apiKey"`, `"$var.mapping"`, `"$var.mapping.map.id"`.',a.variables.defaultSnippets=[{label:"Add scalar variable",description:"String/number/boolean variable",body:{"${1:name}":"${2:value}"}},{label:"Add structural variable",description:"Reusable mapping or object fragment",body:{"${1:name}":{"${2:key}":"${3:value}"}}}]),a.flows&&(a.flows.markdownDescription='Flow configurations keyed by name. Each flow defines a complete event pipeline.\n\n```json\n"flows": {\n "myFlow": {\n "config": { "platform": "web" },\n "sources": { ... },\n "destinations": { ... }\n }\n}\n```',a.flows.defaultSnippets=[{label:"Web flow (basic)",description:"Minimal web flow with browser source",body:{"${1:myFlow}":{config:{platform:"web"},sources:{browser:{package:"@walkeros/web-source-browser"}},destinations:{}}}},{label:"Server flow (basic)",description:"Minimal server flow with Express source",body:{"${1:myFlow}":{config:{platform:"server"},sources:{express:{package:"@walkeros/server-source-express"}},destinations:{}}}},{label:"Web + GA4 flow",description:"Web flow with browser source and GA4 destination",body:{"${1:myFlow}":{config:{platform:"web"},sources:{browser:{package:"@walkeros/web-source-browser"}},destinations:{ga4:{package:"@walkeros/web-destination-gtag",config:{measurementId:"$var.${2:measurementId}"}}}}}}]),s&&(s.config&&(s.config.markdownDescription='Per-flow configuration: platform identity, optional public URL, free-form settings, bundle.\n\n```json\n"config": {\n "platform": "web",\n "settings": {\n "windowCollector": "collector"\n }\n}\n```',s.config.defaultSnippets=[{label:"Web platform config",description:"Browser-based flow configuration",body:{platform:"web"}},{label:"Server platform config",description:"Node.js flow configuration",body:{platform:"server"}}]),s.sources&&(s.sources.markdownDescription='Source configurations for data capture, keyed by step name.\n\n```json\n"sources": {\n "browser": { "package": "@walkeros/web-source-browser" }\n}\n```',s.sources.defaultSnippets=[{label:"Add web source",description:"Browser source for web tracking",body:{"${1:browser}":{package:"@walkeros/web-source-browser"}}},{label:"Add server source",description:"Express source for server tracking",body:{"${1:express}":{package:"@walkeros/server-source-express"}}}]),s.destinations&&(s.destinations.markdownDescription='Destination configurations for data output, keyed by step name.\n\n```json\n"destinations": {\n "ga4": {\n "package": "@walkeros/web-destination-ga4",\n "config": { "measurementId": "$var.trackingId" }\n }\n}\n```',s.destinations.defaultSnippets=[{label:"Add GA4 destination",description:"Google Analytics 4 destination",body:{"${1:ga4}":{package:"@walkeros/web-destination-gtag",config:{measurementId:"$var.${2:measurementId}"}}}},{label:"Add custom destination",description:"Custom destination with inline code",body:{"${1:custom}":{code:{push:"$code:(event) => { ${2:// handle event} }"}}}}]),s.transformers&&(s.transformers.markdownDescription='Transformer configurations for event transformation, keyed by step name.\n\n```json\n"transformers": {\n "validator": {\n "code": { "push": "$code:(event) => event" }\n }\n}\n```',s.transformers.defaultSnippets=[{label:"Add transformer",description:"Inline transformer with code",body:{"${1:transformer}":{code:{push:"$code:(event) => { ${2:return event;} }"}}}}])),i&&(i.platform&&(i.platform.markdownDescription='Platform identity for this flow.\n\n- `web` builds to IIFE format, ES2020 target, browser platform.\n- `server` builds to ESM format, Node18 target, node platform.\n\n```json\n"platform": "web"\n```'),i.url&&(i.url.markdownDescription='Public URL where this flow is reachable. Used for cross-flow `$flow.X.url` references.\n\n```json\n"url": "https://collect.example.com"\n```'),i.settings&&(i.settings.markdownDescription='Free-form key-value settings consumed by the platform runtime.\n\nFor web: typical keys include `windowCollector`. The `windowElb` key is deprecated — set the browser source\'s `config.settings.elb` instead.\n\n```json\n"settings": {\n "windowCollector": "collector"\n}\n```'),i.bundle&&(i.bundle.markdownDescription='Bundle configuration: NPM packages to include and transitive dependency overrides.\n\n```json\n"bundle": {\n "packages": {\n "@walkeros/web-source-browser": { "version": "^2.0.0" }\n }\n}\n```')),n}function Oi(){return{type:"object",markdownDescription:'walkerOS Data Contract. Defines entity→action schemas for event validation.\n\n```json\n{\n "$tagging": 1,\n "page": {\n "view": {\n "type": "object",\n "properties": {\n "title": { "type": "string" }\n }\n }\n }\n}\n```',properties:{$tagging:{type:"number",markdownDescription:'Contract version number. Increment when making breaking changes.\n\n```json\n"$tagging": 1\n```'}},additionalProperties:{type:"object",markdownDescription:"Entity name. Contains action→schema mappings.",additionalProperties:{type:"object",markdownDescription:'Action schema (JSON Schema). Defines valid event data for this entity+action.\n\n```json\n{\n "type": "object",\n "properties": {\n "name": { "type": "string" },\n "price": { "type": "number" }\n },\n "required": ["name"]\n}\n```',defaultSnippets:[{label:"Object schema",description:"Schema with typed properties",body:{type:"object",properties:{"${1:name}":{type:"${2:string}"}}}}]},defaultSnippets:[{label:"Add action",description:"Action with event data schema",body:{"${1:action}":{type:"object",properties:{"${2:property}":{type:"${3:string}"}}}}}]},defaultSnippets:[{label:"Entity with action",description:"New entity with one action and properties",body:{"${1:entity}":{"${2:action}":{type:"object",properties:{"${3:property}":{type:"${4:string}"}}}}}}]}}function Fi(){return{type:"object",markdownDescription:'Flow variables for `$var.name` interpolation. Values must be string, number, or boolean.\n\n```json\n{\n "measurementId": "G-XXXXXXXXXX",\n "debug": false,\n "batchSize": 10\n}\n```\n\nReference in any config value: `"$var.measurementId"`',additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"}]},defaultSnippets:[{label:"Add string variable",body:{"${1:name}":"${2:value}"}},{label:"Add boolean variable",body:{"${1:name}":"${2|true,false|}"}},{label:"Add number variable",body:{"${1:name}":0}}]}}F();import{REF_ENV as Ii,REF_FLOW as ji,REF_STORE as Mi,REF_SECRET as Ni}from"@walkeros/core";function Di(e){const n=e.source.replace(/^\^/,"").replace(/\$$/,"").replace(/\(\.\+\)\?$/,"([\\w.]+)?");return new RegExp(n,"g")}function Ai(e,n){const t=[];if(n.variables){const r=/\$var\.([a-zA-Z_][a-zA-Z0-9_]*)(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*/g;let o;for(;null!==(o=r.exec(e));){const e=o[1];e in n.variables||t.push({message:`Unknown variable "$var.${e}". Defined variables: ${Object.keys(n.variables).join(", ")||"none"}`,severity:"warning",startIndex:o.index,endIndex:o.index+o[0].length})}}if(n.secrets){const r=Di(Ni);let o;for(;null!==(o=r.exec(e));)n.secrets.includes(o[1])||t.push({message:`Unknown secret "$secret.${o[1]}". Available: ${n.secrets.join(", ")||"none"}`,severity:"warning",startIndex:o.index,endIndex:o.index+o[0].length})}if(n.stores){const r=Di(Mi);let o;for(;null!==(o=r.exec(e));)n.stores.includes(o[1])||t.push({message:`Unknown store "$store.${o[1]}". Available: ${n.stores.join(", ")||"none"}`,severity:"warning",startIndex:o.index,endIndex:o.index+o[0].length})}if(n.flows){const r=Di(ji);let o;for(;null!==(o=r.exec(e));)n.flows.includes(o[1])||t.push({message:`Unknown flow "$flow.${o[1]}". Available: ${n.flows.join(", ")||"none"}`,severity:"warning",startIndex:o.index,endIndex:o.index+o[0].length})}if(n.envNames){const r=Di(Ii);let o;for(;null!==(o=r.exec(e));)n.envNames.includes(o[1])||t.push({message:`Unknown env var "$env.${o[1]}". Known: ${n.envNames.join(", ")||"none"}`,severity:"warning",startIndex:o.index,endIndex:o.index+o[0].length})}return t.push(...function(e,n){const t=[];if(!n)return t;const r=n;let o;try{o=JSON.parse(e)}catch{return t}function a(e){if("string"==typeof e)return[e];if(Array.isArray(e)){const n=[];for(const t of e)"string"==typeof t?n.push(t):t&&"object"==typeof t&&"next"in t&&n.push(...a(t.next));return n}return[]}function s(e,n){if(e&&"object"==typeof e)if(Array.isArray(e))e.forEach((e,t)=>s(e,[...n,t]));else for(const[o,i]of Object.entries(e)){const e=[...n,o];if("next"!==o&&"before"!==o)s(i,e);else for(const n of a(i))r.includes(n)||t.push({message:`Unknown transformer "${n}" in ${e.join(".")}. Available: ${r.join(", ")||"none"}`,severity:"warning",startIndex:0,endIndex:0})}}return s(o,[]),t}(e,n.stepNames?.transformers)),t}function Li(e){let n;try{n=JSON.parse(e)}catch{return{}}if(!(Vi(t=n)&&"version"in t&&"flows"in t&&Vi(t.flows)))return{};var t;const r={},o=[],a=[],s=[],i=[],l=[],c=[],d={};let u;Wi(r,n.variables),Bi(c,n.contract),Vi(n.contract)&&Object.assign(d,n.contract);for(const e of Object.values(n.flows))if(Vi(e)){if(!u&&Vi(e.config)){const n=e.config.platform;"web"!==n&&"server"!==n||(u=n)}if(Wi(r,e.variables),Bi(c,e.contract),Vi(e.contract)&&Object.assign(d,e.contract),Vi(e.sources))for(const[n,t]of Object.entries(e.sources))o.push(n),Vi(t)&&(Wi(r,t.variables),"string"==typeof t.package&&l.push({package:t.package,shortName:n,type:"source",platform:u||"web"}));if(Vi(e.destinations))for(const[n,t]of Object.entries(e.destinations))a.push(n),Vi(t)&&(Wi(r,t.variables),"string"==typeof t.package&&l.push({package:t.package,shortName:n,type:"destination",platform:u||"web"}));if(Vi(e.transformers))for(const[n,t]of Object.entries(e.transformers))s.push(n),Vi(t)&&(Wi(r,t.variables),"string"==typeof t.package&&l.push({package:t.package,shortName:n,type:"transformer",platform:u||"web"}));if(Vi(e.stores))for(const[n,t]of Object.entries(e.stores))i.push(n),Vi(t)&&Wi(r,t.variables)}const p={variables:r,stepNames:{sources:o,destinations:a,transformers:s}};return u&&(p.platform=u),l.length>0&&(p.packages=l),c.length>0&&(p.contract=c),Object.keys(d).length>0&&(p.contractRaw=d),i.length>0&&(p.stores=i),p}function Vi(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Wi(e,n){if(Vi(n))for(const[t,r]of Object.entries(n))e[t]=r}function Bi(e,n){if(Vi(n))for(const[t,r]of Object.entries(n)){if(t.startsWith("$")||!Vi(r))continue;const n=e.find(e=>e.entity===t),o=Object.keys(r);if(n)for(const e of o)n.actions.includes(e)||n.actions.push(e);else e.push({entity:t,actions:o})}}export{ja as ArchitectureFlow,ue as Box,nt as BrowserBox,me as Button,be as ButtonGroup,ui as ButtonLink,Hn as Code,pt as CodeBox,Ja as CodeDiff,ns as CodeDiffBox,$s as CodeSnippet,ks as CodeStatic,Ss as CodeView,Wt as CollectorBox,Xn as DEFAULT_FALLBACK_HTML,ai as Dropdown,ii as DropdownDivider,si as DropdownItem,Us as FlowMap,ci as Footer,Y as Grid,ie as Header,lo as Icon,Nt as LiveCode,wi as MDXCode,xi as MDXProvider,Yn as Preview,wt as PromotionPlayground,ti as PropertyTable,He as REFERENCE_PATTERNS,fi as Spinner,mn as allowedRefKinds,Je as applyWalkerOSDecorations,_a as cn,mt as createFbqDestination,ht as createGtagDestination,yt as createPlausibleDestination,$n as disposeWalkerOSProviders,_i as enrichFlowConfigSchema,Pi as enrichSchema,Li as extractFlowIntelliSenseContext,qe as findWalkerOSReferences,Dn as generateModelPath,gn as getContractCompletions,Oi as getEnrichedContractSchema,un as getEnvCompletions,dn as getFlowCompletions,hn as getJsonPathAtOffset,fn as getMappingPathCompletions,ln as getSecretCompletions,cn as getStoreCompletions,sn as getVariableCompletions,Fi as getVariablesSchema,R as initializeMonacoTypes,Gn as isMonacoCancellation,Be as lighthouseTheme,x as loadPackageTypes,b as loadTypeLibraryFromURL,Me as palenightTheme,Ge as registerAllThemes,An as registerJsonSchema,ze as registerLighthouseTheme,Ne as registerPalenightTheme,Ke as registerWalkerOSDecorationStyles,Cn as registerWalkerOSProviders,E as registerWalkerOSTypes,Sn as removeIntelliSenseContext,k as resolveTypesUrl,Tn as setIntelliSenseContext,w as setPackageTypesBaseUrl,Ln as unregisterJsonSchema,Ei as useDropdown,Ai as validateWalkerOSReferences};//# sourceMappingURL=index.mjs.map
|