@walkeros/explorer 4.0.0 → 4.0.1-next-1778183328892

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/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var e,n,t,r=Object.create,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=(e,n)=>function(){return e&&(n=(0,e[i(e)[0]])(e=0)),n},d=(e,n)=>{for(var t in n)o(e,t,{get:n[t],enumerable:!0})},u=(e,n,t,r)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let s of i(n))l.call(e,s)||s===t||o(e,s,{get:()=>n[s],enumerable:!(r=a(n,s))||r.enumerable});return e},p=(e,n,t)=>(t=null!=e?r(s(e)):{},u(!n&&e&&e.__esModule?t:o(t,"default",{value:e,enumerable:!0}),e));var f,g,m,h,y,b=c({"src/utils/monaco-context-types.ts"(){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"}}),v=c({"walkeros-types:virtual:walkeros-core-types"(){f="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 batch?: number;\n batchFn?: (destination: Instance$5, collector: Instance$6) => void;\n batched?: Batch<Settings>;\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}\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$4;\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_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_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 CacheRule {\n match: MatchExpression | '*';\n key: string[];\n ttl: number;\n update?: Record<string, Value>;\n}\ninterface Cache {\n full?: boolean;\n store?: string;\n rules: CacheRule[];\n}\n\ntype cache_Cache = Cache;\ntype cache_CacheRule = CacheRule;\ndeclare namespace cache {\n export type { cache_Cache as Cache, cache_CacheRule as CacheRule };\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}\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 * 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$4;\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}\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}\ninterface Sources {\n [id: string]: Instance$2;\n}\ninterface Destinations$1 {\n [id: string]: Instance$5;\n}\ninterface Transformers$1 {\n [id: string]: Instance$3;\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', destination: Init$3<T> | Instance$5<T>, config?: Config$5<T>): Promise<PushResult>;\n <K extends keyof Functions>(command: 'hook', name: K, hookFn: Functions[K]): Promise<PushResult>;\n (command: 'on', type: Types$3, rules: SingleOrArray<Subscription>): 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, options?: unknown): Promise<PushResult>;\n}\ninterface Instance$6 {\n push: PushFn$1;\n command: CommandFn;\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 logger: Instance$4;\n on: OnConfig;\n queue: Events;\n round: number;\n session: undefined | SessionData;\n status: Status;\n timing: number;\n user: User;\n pending: {\n sources: InitSources;\n destinations: InitDestinations;\n };\n}\n\ntype collector_CommandFn = CommandFn;\ntype collector_CommandType = CommandType;\ntype collector_DestinationStatus = DestinationStatus;\ntype collector_InitConfig = InitConfig;\ntype collector_PushOptions = PushOptions;\ntype collector_SessionData = SessionData;\ntype collector_SourceStatus = SourceStatus;\ntype collector_Sources = Sources;\ntype collector_Status = Status;\ndeclare namespace collector {\n export type { collector_CommandFn as CommandFn, collector_CommandType as CommandType, Config$6 as Config, collector_DestinationStatus as DestinationStatus, Destinations$1 as Destinations, collector_InitConfig as InitConfig, Instance$6 as Instance, PushFn$1 as PushFn, collector_PushOptions as PushOptions, collector_SessionData as SessionData, collector_SourceStatus as SourceStatus, collector_Sources as Sources, collector_Status as Status, Stores$1 as Stores, Transformers$1 as Transformers };\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$4;\n config: C;\n env: E;\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 * Context provided to the destroy() lifecycle method.\n *\n * A subset of the init context — config, env, logger, and id.\n * Does NOT include collector or event data. Destroy should only\n * clean up resources, not interact with the event pipeline.\n */\ninterface DestroyContext<C = unknown, E = unknown> {\n /** Step instance ID. */\n id: string;\n /** Step configuration (contains settings with SDK clients, etc.). */\n config: C;\n /** Runtime environment/dependencies (DB clients, auth clients, etc.). */\n env: E;\n /** Scoped logger for this step instance. */\n logger: Instance$4;\n}\n/**\n * Destroy function signature for step lifecycle cleanup.\n *\n * Implementations should be idempotent — calling destroy() twice must not throw.\n * Used for closing connections, clearing timers, releasing SDK clients.\n */\ntype DestroyFn<C = unknown, E = unknown> = (context: DestroyContext<C, E>) => PromiseOrValue<void>;\n\ntype lifecycle_DestroyContext<C = unknown, E = unknown> = DestroyContext<C, E>;\ntype lifecycle_DestroyFn<C = unknown, E = unknown> = DestroyFn<C, E>;\ndeclare namespace lifecycle {\n export type { lifecycle_DestroyContext as DestroyContext, lifecycle_DestroyFn as DestroyFn };\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 * Type bundle for destination generics.\n * Groups Settings, InitSettings, Mapping, and Env into a single type parameter.\n */\ninterface Types$4<S = unknown, M = unknown, E = BaseEnv$3, I = S> {\n settings: S;\n initSettings: I;\n mapping: M;\n env: E;\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};\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'];\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$3;\n data?: unknown;\n }>;\n dlq?: DLQ;\n batches?: BatchRegistry<Mapping$1<T>>;\n type?: string;\n env?: 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 /** 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$4;\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 /** Transformer chain to run after collector processing but before this destination. */\n before?: Next;\n /** Transformer chain to run after destination push completes. Push response available at ingest._response. */\n next?: Next;\n /** Cache configuration for deduplication (step-level: skip push on HIT). */\n cache?: Cache;\n /** Completely skip this destination — no init, no push, no queuing. */\n disabled?: boolean;\n /** Return this value instead of calling push(). Uses !== undefined check to support falsy values. */\n mock?: unknown;\n}\ntype PartialConfig$1<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>>>;\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?: Next;\n next?: Next;\n cache?: Cache;\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>;\ntype PushBatchFn<T extends TypesGeneric$3 = Types$4> = (batch: Batch<Mapping$1<T>>, context: PushBatchContext<T>) => void;\ntype PushEvent<Mapping = unknown> = {\n event: Event;\n mapping?: Rule<Mapping>;\n};\ntype PushEvents<Mapping = unknown> = Array<PushEvent<Mapping>>;\ninterface Batch<Mapping> {\n key: string;\n events: Events;\n data: Array<Data>;\n mapping?: Rule<Mapping>;\n}\ninterface BatchRegistry<Mapping> {\n [mappingKey: string]: {\n batched: Batch<Mapping>;\n batchFn: () => 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\ntype destination_Batch<Mapping> = Batch<Mapping>;\ntype destination_BatchRegistry<Mapping> = BatchRegistry<Mapping>;\ntype destination_DLQ = DLQ;\ntype destination_Data = Data;\ntype destination_Destinations = Destinations;\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 namespace destination {\n export type { BaseEnv$3 as BaseEnv, destination_Batch as Batch, destination_BatchRegistry as BatchRegistry, Code$1 as Code, Config$5 as Config, Context$5 as Context, destination_DLQ as DLQ, destination_Data as Data, destination_Destinations as Destinations, Env$3 as Env, Init$3 as Init, destination_InitDestinations as InitDestinations, InitFn$2 as InitFn, InitSettings$3 as InitSettings, Instance$5 as Instance, Mapping$1 as Mapping, PartialConfig$1 as PartialConfig, destination_Policy as Policy, Push$1 as Push, destination_PushBatchContext as PushBatchContext, destination_PushBatchFn as PushBatchFn, destination_PushContext as PushContext, destination_PushEvent as PushEvent, destination_PushEvents as PushEvents, destination_PushFn as PushFn, destination_Ref as Ref, Settings$3 as Settings, Types$4 as Types, TypesGeneric$3 as TypesGeneric, TypesOf$3 as TypesOf };\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', destination: Init$3<T> | Instance$5<T>, config?: Config$5<T>): R;\n <K extends keyof Functions>(event: 'walker hook', name: K, hookFn: Functions[K]): R;\n (event: 'walker on', type: Types$3, rules: SingleOrArray<Subscription>): 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 * 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/definitions cascade: source/destination > flow > root config.\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 /**\n * Flow-level definitions.\n * Extend root definitions; overridden by source/destination definitions.\n */\n definitions?: Flow.Definitions;\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 * Reusable configuration definitions.\n * Syntax: $def.name\n */\n definitions?: Definitions;\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`, `windowElb`.\n * For server: reserved for future server-specific options.\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 overrides.\n * Consumed by the CLI bundler at build time.\n */\n bundle?: Bundle;\n }\n /** Primitive value types for variables. */\n type Primitive = string | number | boolean;\n /**\n * Variables record type for interpolation.\n * Used at root, flow, source, destination, transformer, and store levels.\n */\n type Variables = Record<string, Primitive>;\n /**\n * Definitions record type for reusable configurations.\n * Used at root, flow, source, destination, transformer, and store levels.\n */\n type Definitions = 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 and\n * transitive dependency overrides. Consumed by the CLI bundler.\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 → 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 /**\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 * Resolved import variable name (string) or inline code definition (Code).\n *\n * - String: auto-resolved from packages[package].imports[0] during getFlowSettings(),\n * or provided explicitly for advanced use cases.\n * - Code: object with type, push, and optional init for inline code definition.\n */\n code?: string | Code;\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?: string | string[];\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?: string | string[];\n /** Cache configuration for this source. */\n cache?: Cache;\n /**\n * Source-level variables (highest priority in cascade).\n * Overrides flow and root variables.\n */\n variables?: Variables;\n /**\n * Source-level definitions (highest priority in cascade).\n * Overrides flow and root definitions.\n */\n definitions?: Definitions;\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 /** Resolved import variable name (string) or inline code definition (Code). */\n code?: string | Code;\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?: string | string[];\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?: string | string[];\n /** Cache configuration for this destination. */\n cache?: Cache;\n /** Destination-level variables (highest priority in cascade). */\n variables?: Variables;\n /** Destination-level definitions (highest priority in cascade). */\n definitions?: Definitions;\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 /** Resolved import variable name (string) or inline code definition (Code). */\n code?: string | Code;\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?: string | string[];\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?: string | string[];\n /** Cache configuration for this transformer. */\n cache?: Cache;\n /** Transformer-level variables (highest priority in cascade). */\n variables?: Variables;\n /** Transformer-level definitions (highest priority in cascade). */\n definitions?: Definitions;\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 /** Resolved import variable name (string) or inline code definition (Code). */\n code?: string | Code;\n /** Store-specific configuration. */\n config?: unknown;\n /** Store environment configuration. */\n env?: unknown;\n /** Store-level variables (highest priority in cascade). */\n variables?: Variables;\n /** Store-level definitions (highest priority in cascade). */\n definitions?: Definitions;\n /**\n * Named examples for testing and documentation.\n * Stripped during flow resolution.\n */\n examples?: StepExamples;\n }\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\": { \"extends\": \"default\", \"events\": { ... } },\n * \"server\": { \"extends\": \"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 `extends` to inherit from another named contract (additive merge).\n */\n interface ContractRule {\n /** Inherit from another named contract (additive merge). */\n extends?: string;\n /** Tagging level (used by validators / runtime tagging policy). */\n tagging?: number;\n /** Human-readable description of the contract. */\n description?: string;\n /** JSON Schema for event.globals. */\n globals?: ContractSchema;\n /** JSON Schema for event.context. */\n context?: ContractSchema;\n /** JSON Schema for event.custom. */\n custom?: ContractSchema;\n /** JSON Schema for event.user. */\n user?: ContractSchema;\n /** JSON Schema for event.consent. */\n consent?: ContractSchema;\n /** Entity-action event schemas. */\n events?: ContractEvents;\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$4 {\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$4;\n}\n/**\n * Logger configuration options\n */\ninterface Config$4 {\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$4) => Instance$4;\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$4 as Config, type logger_DefaultHandler as DefaultHandler, type logger_ErrorContext as ErrorContext, type logger_Factory as Factory, type logger_Handler as Handler, type Instance$4 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$3 = {\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$3 = keyof Config$3 | (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$4 {\n collector: Instance$6;\n logger: Instance$4;\n}\n/** Unified subscription callback shape. */\ntype Fn$2<TData = unknown> = (data: TData, context: Context$4) => PromiseOrValue<void>;\n/** Typed-data variants for readability and IntelliSense. All reduce to Fn<TData>. */\ntype ConsentFn = Fn$2<Consent>;\ntype GenericFn = Fn$2<unknown>;\ntype ReadyFn = Fn$2<void>;\ntype RunFn = Fn$2<void>;\ntype SessionFn = Fn$2<SessionData | undefined>;\ntype UserFn = Fn$2<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$3, context: Context$5<T>) => PromiseOrValue<void>;\ntype OnFnRuntime = (type: Types$3, 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$3 as Config, on_ConsentFn as ConsentFn, on_ConsentRule as ConsentRule, Context$4 as Context, on_EventData as EventData, on_EventDataMap as EventDataMap, Fn$2 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$3 as Types, on_UserFn as UserFn };\n}\n\ninterface NextRule {\n match: MatchExpression | '*';\n next: Next;\n}\ntype Next = string | string[] | NextRule[];\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$2<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$2> = T['settings'];\ntype InitSettings$2<T extends TypesGeneric$2 = Types$2> = T['initSettings'];\ntype Env$2<T extends TypesGeneric$2 = Types$2> = T['env'];\n/**\n * Inference helper: Extract Types from Instance.\n */\ntype TypesOf$2<I> = I extends Instance$3<infer T> ? T : never;\n/**\n * Transformer configuration.\n */\ninterface Config$2<T extends TypesGeneric$2 = Types$2> {\n settings?: InitSettings$2<T>;\n env?: Env$2<T>;\n id?: string;\n logger?: Config$4;\n before?: Next;\n next?: Next;\n cache?: Cache;\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/**\n * Context provided to transformer functions.\n * Extends base context with transformer-specific properties.\n */\ninterface Context$3<T extends TypesGeneric$2 = Types$2> extends Base<Config$2<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?: Next;\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 */\ninterface ChainResult {\n event: DeepPartialEvent | DeepPartialEvent[] | null;\n respond?: RespondFn;\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$1<T extends TypesGeneric$2 = Types$2, E = DeepPartialEvent> = (event: E, context: Context$3<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$2> = (context: Context$3<T>) => PromiseOrValue<void | false | Config$2<T>>;\n/**\n * Transformer instance returned by Init function.\n */\ninterface Instance$3<T extends TypesGeneric$2 = Types$2> {\n type: string;\n config: Config$2<T>;\n push: Fn$1<T>;\n init?: InitFn$1<T>;\n destroy?: DestroyFn<Config$2<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$2> = (context: Context$3<Types$2<Partial<Settings$2<T>>, Env$2<T>, InitSettings$2<T>>>) => Instance$3<T> | Promise<Instance$3<T>>;\n/**\n * Configuration for initializing a transformer.\n * Used in collector registration.\n */\ntype InitTransformer<T extends TypesGeneric$2 = Types$2> = {\n code: Init$2<T>;\n config?: Partial<Config$2<T>>;\n env?: Partial<Env$2<T>>;\n before?: Next;\n next?: Next;\n cache?: Cache;\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$3;\n}\n\ntype transformer_ChainResult = ChainResult;\ntype transformer_InitTransformer<T extends TypesGeneric$2 = Types$2> = InitTransformer<T>;\ntype transformer_InitTransformers = InitTransformers;\ntype transformer_Next = Next;\ntype transformer_NextRule = NextRule;\ntype transformer_Transformers = Transformers;\ndeclare namespace transformer {\n export type { BaseEnv$2 as BaseEnv, transformer_ChainResult as ChainResult, Config$2 as Config, Context$3 as Context, Env$2 as Env, Fn$1 as Fn, Init$2 as Init, InitFn$1 as InitFn, InitSettings$2 as InitSettings, transformer_InitTransformer as InitTransformer, transformer_InitTransformers as InitTransformers, Instance$3 as Instance, transformer_Next as Next, transformer_NextRule as NextRule, Result$1 as Result, Settings$2 as Settings, transformer_Transformers as Transformers, Types$2 as Types, TypesGeneric$2 as TypesGeneric, TypesOf$2 as TypesOf };\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$4;\n}\n/**\n * Type bundle for source generics.\n * Groups Settings, Mapping, Push, Env, and InitSettings 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 */\ninterface Types$1<S = unknown, M = unknown, P = Fn$3, E = BaseEnv$1, I = S> {\n settings: S;\n initSettings: I;\n mapping: M;\n push: P;\n env: E;\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};\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'];\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 /** 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$4;\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 * 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}\ntype PartialConfig<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>>>;\ninterface Instance$2<T extends TypesGeneric$1 = Types$1> {\n type: string;\n config: Config$1<T>;\n push: Push<T>;\n destroy?: DestroyFn<Config$1<T>, Env$1<T>>;\n on?(event: Types$3, context?: unknown): void | boolean | Promise<void | boolean>;\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 * Sets ingest metadata for the current request.\n * Extracts values from the raw request using config.ingest mapping.\n * The extracted data is passed through to transformers and destinations.\n *\n * @param value - Raw request object (Express req, Lambda event, etc.)\n */\n setIngest: (value: unknown) => Promise<void>;\n /** Sets respond function for the current request. Called by source per-request. */\n setRespond: (fn: RespondFn | undefined) => void;\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?: Next;\n before?: Next;\n cache?: Cache;\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\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_PartialConfig<T extends TypesGeneric$1 = Types$1> = PartialConfig<T>;\ntype source_Push<T extends TypesGeneric$1 = Types$1> = Push<T>;\ntype source_Renderer = Renderer;\ndeclare namespace source {\n export type { BaseEnv$1 as BaseEnv, Config$1 as Config, Context$1 as Context, Env$1 as Env, Init$1 as Init, InitSettings$1 as InitSettings, source_InitSource as InitSource, source_InitSources as InitSources, Instance$2 as Instance, source_Mapping as Mapping, source_PartialConfig as PartialConfig, source_Push as Push, source_Renderer as Renderer, Settings$1 as Settings, Types$1 as Types, TypesGeneric$1 as TypesGeneric, TypesOf$1 as TypesOf };\n}\n\ninterface BaseEnv {\n [key: string]: unknown;\n}\ninterface Types<S = unknown, E = BaseEnv, I = S> {\n settings: S;\n initSettings: I;\n env: E;\n}\ntype TypesGeneric = {\n settings: any;\n initSettings: any;\n env: 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 TypesOf<I> = I extends Instance$1<infer T> ? T : never;\ninterface Config<T extends TypesGeneric = Types> {\n settings?: InitSettings<T>;\n env?: Env<T>;\n id?: string;\n logger?: Config$4;\n}\ninterface Context<T extends TypesGeneric = Types> extends Base<Config<T>, Env<T>> {\n id: string;\n}\ntype GetFn<T = unknown> = (key: string) => T | undefined | Promise<T | undefined>;\ntype SetFn<T = unknown> = (key: string, value: T, ttl?: 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 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\ntype store_BaseEnv = BaseEnv;\ntype store_Config<T extends TypesGeneric = Types> = Config<T>;\ntype store_Context<T extends TypesGeneric = Types> = Context<T>;\ntype store_DeleteFn = DeleteFn;\ntype store_Env<T extends TypesGeneric = Types> = Env<T>;\ntype store_GetFn<T = unknown> = 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_SetFn<T = unknown> = SetFn<T>;\ntype store_Settings<T extends TypesGeneric = Types> = Settings<T>;\ntype store_Stores = Stores;\ntype store_Types<S = unknown, E = BaseEnv, I = S> = Types<S, E, I>;\ntype store_TypesGeneric = TypesGeneric;\ntype store_TypesOf<I> = TypesOf<I>;\ndeclare namespace store {\n export type { store_BaseEnv as BaseEnv, store_Config as Config, store_Context as Context, store_DeleteFn as DeleteFn, store_Env as Env, store_GetFn as GetFn, store_Init as Init, store_InitFn as InitFn, store_InitSettings as InitSettings, store_InitStore as InitStore, store_InitStores as InitStores, Instance$1 as Instance, store_SetFn as SetFn, store_Settings as Settings, store_Stores as Stores, store_Types as Types, store_TypesGeneric as TypesGeneric, store_TypesOf as TypesOf };\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}\ninterface Source extends Properties {\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 per run (was: event.count). */\n count?: number;\n /** W3C traceparent full string; set when the emission is part of a chained trace. */\n trace?: string;\n /** Walker-controlled standard suggestions (sources may set). */\n url?: string;\n referrer?: string;\n tool?: string;\n command?: string;\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_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_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, and destination.\n */\ninterface Result {\n /** Which step type was simulated */\n step: 'source' | 'transformer' | 'destination';\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 * - 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 /** 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 * 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: Next): 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:\";\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`/`$def`/`$contract` already resolved) as `unknown` so\n * that {@link walkPath} can traverse it. Returns `undefined` if the flow\n * does 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 * 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. `$def` / `$contract` resolve 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`/`$def`/`$contract`\n * references resolved first), then the deep path is walked. Cycles are\n * detected via a 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, $def, $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\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 * @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\n/**\n * Generates a random string of a given length.\n *\n * @param length - The length of the random string.\n * @param charset - Optional custom charset. Defaults to base-36 (0-9a-z).\n * @returns The random string.\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\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 * 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 * @template P, R\n * @param fn The function to debounce.\n * @param wait The number of milliseconds to delay.\n * @param immediate Trigger the function on the leading edge, instead of the trailing.\n * @returns The new debounced function.\n */\ndeclare function debounce<P extends unknown[], R>(fn: (...args: P) => R, wait?: number, immediate?: boolean): (...args: P) => Promise<R>;\ndeclare function throttle<P extends unknown[], R>(fn: (...args: P) => R | undefined, delay?: number): (...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$4): Instance$4;\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 * 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$2>(overrides?: Partial<Omit<Context$3<T>, 'config' | 'ingest'> & {\n config?: Config$2<T> | Config$5<TypesGeneric$3>;\n ingest?: Ingest | (Record<string, unknown> & {\n _meta: Ingest['_meta'];\n });\n data?: unknown;\n rule?: unknown;\n}>): Context$3<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$4 {\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 * 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 * 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 * @template P, R\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.\n */\ndeclare function useHooks<P extends unknown[], R>(fn: (...args: P) => R, name: string, hooks: Functions, logger?: Instance$4): (...args: P) => R;\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/**\n * Resolve all named contracts: process extends 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 */\ndeclare function resolveContracts(contracts: Flow.Contract): 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\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 | '*'): CompiledMatcher;\n\ninterface CompiledRoute {\n match: CompiledMatcher;\n next: CompiledNext;\n}\ntype CompiledNext = {\n type: 'static';\n value: string;\n} | {\n type: 'chain';\n value: string[];\n} | {\n type: 'routes';\n routes: CompiledRoute[];\n};\ndeclare function isRouteArray(next: Next): next is NextRule[];\ndeclare function compileNext(next: Next | undefined): CompiledNext | undefined;\ndeclare function resolveNext(compiled: CompiledNext | undefined, context?: Record<string, unknown>): string | string[] | undefined;\n\ninterface CompiledCacheRule {\n match: CompiledMatcher;\n key: string[];\n ttl: number;\n update?: CacheRule['update'];\n}\ninterface CompiledCache {\n full: boolean;\n storeId?: string;\n rules: CompiledCacheRule[];\n}\ninterface CacheResult {\n status: 'HIT' | 'MISS';\n key: string;\n value?: unknown;\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): CompiledCache;\ndeclare function checkCache(compiled: CompiledCache, store: Instance$1, context: Record<string, unknown>, namespace: string): 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\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: RegExp;\ndeclare const REF_DEF: 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\nexport { cache as Cache, type CacheResult, type ClickIdEntry, collector as Collector, type CompiledCache, type CompiledNext, type CompiledRoute, Const, context as Context, destination as Destination, ENV_MARKER_PREFIX, elb as Elb, type ExampleSummary, Flow, type FlowConfigResolver, hint as Hint, hooks as Hooks, type Ingest, type IngestMeta, Level, lifecycle as Lifecycle, logger as Logger, mapping as Mapping, type MarketingParameters, matcher as Matcher, type MockLogger, on as On, REF_CODE_PREFIX, REF_CONTRACT, REF_DEF, REF_ENV, REF_FLOW, REF_SECRET, REF_STORE, REF_VAR, request as Request, type ResolveOptions, type RespondFn, type RespondOptions, type SendDataValue, type SendHeaders, type SendResponse, simulation as Simulation, source as Source, type StorageType, store as Store, transformer as Transformer, trigger as Trigger, walkeros as WalkerOS, type WalkerOSPackage, type WalkerOSPackageInfo, type WalkerOSPackageMeta, anonymizeIP, applyUpdate, assign, branch, buildCacheContext, castToProperty, castValue, checkCache, clone, compileCache, compileMatcher, compileNext, createDestination, createEvent, createIngest, createLogger, createMockContext, createMockLogger, createRespond, debounce, deepMerge, defaultClickIds, fetchPackage, fetchPackageSchema, filterValues, flattenIncludeSections, formatOut, getBrowser, getBrowserVersion, getByPath, getDeviceType, getEvent, getFlowSettings, getGrantedConsent, getHeaders, getId, getMappingEvent, getMappingValue, getMarketingParameters, getOS, getOSVersion, getPlatform, getSpanId, isArguments, isArray, isBoolean, isCommand, isDefined, isElementOrDocument, isFunction, isNumber, isObject, isPropertyType, isRouteArray, isSameType, isString, mcpError, mcpResult, mergeContractSchemas, mockEnv, packageNameToVariable, parseUserAgent, processEventMapping, requestToData, requestToParameter, resolveContracts, resolveNext, setByPath, storeCache, throttle, throwError, transformData, traverseEnv, trim, tryCatch, tryCatchAsync, useHooks, walkPath, wrapCondition, wrapFn, wrapValidate };\n"}}),x={};function w(e){m.has(e)||(m.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 k(e,n,t){if(g.has(n))return!1;const r=e.languages.typescript.javascriptDefaults.addExtraLib(t,n),o=e.languages.typescript.typescriptDefaults.addExtraLib(t,n);return g.set(n,{uri:n,content:t,disposable:{dispose:()=>{r.dispose(),o.dispose()}}}),!0}function T(e){const n=g.get(e);return!!n&&(n.disposable?.dispose(),g.delete(e),!0)}function C(e,n,t){T(n),k(e,n,t)}async function $(e,n,t){try{const r=await fetch(n);if(!r.ok)return!1;const o=await r.text();return k(e,t||`file:///${n}`,o)}catch{return!1}}function S(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 E(e){y=e}function j(e,n){return y?`${y}/${encodeURIComponent(e)}/types?version=${encodeURIComponent(n)}`:`https://cdn.jsdelivr.net/npm/${e}@${n}/dist/index.d.ts`}async function P(e,n){const{package:t,version:r="latest"}=n,o=`file:///node_modules/${t}/index.d.ts`;if(g.has(o))return!0;const a=j(t,r);try{const n=await fetch(a);if(!n.ok)return!1;let r=await n.text();r=S(r);const i=`declare module '${t}' {\n${r}\n}`;return k(e,o,i)}catch{return!1}}function _(e){const n="file:///node_modules/@walkeros/core/index.d.ts";if(g.has(n))return!0;return k(e,n,`declare module '@walkeros/core' {\n${S(f)}\n}`)}function R(r,o){C(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 F(e,n,t){C(e,`file:///destinations/${n}.d.ts`,t)}function I(e){T(`file:///destinations/${e}.d.ts`)}function O(e){w(e),_(e),N(e)}function N(e){if(h.has(e))return;h.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 D(e){w(e),_(e),R(e,{type:"condition"})}function M(){return Array.from(g.keys())}function A(){for(const e of g.values())e.disposable?.dispose();g.clear()}d(x,{addDestinationType:()=>F,addFunctionContextTypes:()=>R,addTypeLibrary:()=>k,clearAllTypeLibraries:()=>A,configureMonacoTypeScript:()=>w,getLoadedTypeLibraries:()=>M,initializeMonacoTypes:()=>D,loadPackageTypes:()=>P,loadTypeLibraryFromURL:()=>$,loadWalkerOSCoreTypes:()=>_,registerWalkerOSAmbients:()=>N,registerWalkerOSTypes:()=>O,removeDestinationType:()=>I,removeTypeLibrary:()=>T,resolveTypesUrl:()=>j,setPackageTypesBaseUrl:()=>E,updateTypeLibrary:()=>C});var L,W=c({"src/utils/monaco-types.ts"(){b(),v(),g=new Map,m=new WeakSet,h=new WeakSet}}),V={};d(V,{ArchitectureFlow:()=>Uo,Box:()=>re,BrowserBox:()=>In,Button:()=>ue,ButtonGroup:()=>fe,ButtonLink:()=>li,Code:()=>Rn,CodeBox:()=>Mn,CodeDiff:()=>ea,CodeDiffBox:()=>ia,CodeSnippet:()=>ca,CodeStatic:()=>ti,CodeView:()=>oi,CollectorBox:()=>st,Dropdown:()=>Va,DropdownDivider:()=>za,DropdownItem:()=>Ba,FlowMap:()=>Ra,Footer:()=>ii,Grid:()=>X,Header:()=>ee,Icon:()=>$r,LiveCode:()=>rt,MDXCode:()=>yi,MDXProvider:()=>vi,Preview:()=>le,PromotionPlayground:()=>Gn,PropertyTable:()=>La,REFERENCE_PATTERNS:()=>Me,Spinner:()=>di,applyWalkerOSDecorations:()=>Le,cn:()=>Ho,createFbqDestination:()=>Wn,createGtagDestination:()=>Ln,createPlausibleDestination:()=>Vn,disposeWalkerOSProviders:()=>fn,enrichFlowConfigSchema:()=>Ci,enrichSchema:()=>ki,extractFlowIntelliSenseContext:()=>_i,findWalkerOSReferences:()=>Ae,generateModelPath:()=>Cn,getEnrichedContractSchema:()=>$i,getVariablesSchema:()=>Si,initializeMonacoTypes:()=>D,isMonacoCancellation:()=>Pn,lighthouseTheme:()=>Ie,loadPackageTypes:()=>P,loadTypeLibraryFromURL:()=>$,palenightTheme:()=>Se,registerAllThemes:()=>Ne,registerJsonSchema:()=>$n,registerLighthouseTheme:()=>Oe,registerPalenightTheme:()=>Ee,registerWalkerOSDecorationStyles:()=>We,registerWalkerOSProviders:()=>pn,registerWalkerOSTypes:()=>O,removeIntelliSenseContext:()=>un,resolveTypesUrl:()=>j,setIntelliSenseContext:()=>dn,setPackageTypesBaseUrl:()=>E,unregisterJsonSchema:()=>Sn,useDropdown:()=>wi,validateWalkerOSReferences:()=>Pi}),module.exports=(L=V,u(o({},"__esModule",{value:!0}),L));var B=require("react"),z=require("@walkeros/collector"),q=require("react"),H=require("react"),G=(0,H.createContext)(null);function U(){return(0,H.useContext)(G)}var J=require("react/jsx-runtime");function X({children:e,columns:n,minBoxWidth:t,gap:r,rowHeight:o="equal",maxRowHeight:a,showScrollButtons:i=!0,className:s=""}){const l=(0,q.useRef)(null),[c,d]=(0,q.useState)(!1),[u,p]=(0,q.useState)(!1),[f,g]=(0,q.useState)(new Map),m=(0,q.useRef)(0),h=(0,q.useCallback)(()=>m.current++,[]),y=(0,q.useCallback)((e,n)=>{g(t=>{const r=new Map(t);return r.set(e,n),r})},[]),b=(0,q.useCallback)(e=>{g(n=>{const t=new Map(n);return t.delete(e),t})},[]),v=(0,q.useMemo)(()=>"synced"!==o||0===f.size?null:Math.min(600,Math.max(...Array.from(f.values()))),[f,o]),x=(0,q.useMemo)(()=>({registerBox:y,unregisterBox:b,getBoxId:h,syncedHeight:v,enabled:"synced"===o}),[y,b,h,v,o]),w=["elb-explorer-grid"],k={};"auto"===o?w.push("elb-explorer-grid--row-auto"):"equal"===o?w.push("elb-explorer-grid--row-equal"):"synced"===o?w.push("elb-explorer-grid--row-synced"):"number"==typeof o&&(k["--grid-row-min-height"]=`${o}px`,k["--grid-row-max-height"]=`${o}px`),s&&w.push(s),void 0!==r&&(k.gap="number"==typeof r?`${r}px`:r),void 0!==t&&(k["--grid-min-box-width"]="number"==typeof t?`${t}px`:t),void 0!==a&&(k["--grid-row-max-height"]="none"===a?"none":"number"==typeof a?`${a}px`:a);const T=(0,q.useCallback)(()=>{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(0,q.useEffect)(()=>{const e=l.current;if(e&&i)return T(),e.addEventListener("scroll",T),window.addEventListener("resize",T),()=>{e.removeEventListener("scroll",T),window.removeEventListener("resize",T)}},[T,i]),(0,J.jsx)(G.Provider,{value:x,children:(0,J.jsxs)("div",{className:"elb-explorer elb-explorer-grid-wrapper",children:[i&&c&&(0,J.jsx)("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:"‹"}),(0,J.jsx)("div",{ref:l,className:w.join(" "),style:k,children:e}),i&&u&&(0,J.jsx)("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:"›"})]})})}var Y=require("react"),K=require("@walkeros/web-source-browser"),Q=require("react"),Z=require("react/jsx-runtime");function ee({label:e,children:n}){return(0,Z.jsxs)("div",{className:"elb-explorer-header",children:[(0,Z.jsx)("span",{className:"elb-explorer-label",children:e}),n]})}var ne=require("react/jsx-runtime");function te(){return(0,ne.jsxs)("div",{className:"elb-explorer-traffic-lights",children:[(0,ne.jsx)("span",{className:"elb-explorer-traffic-light elb-explorer-traffic-light--red"}),(0,ne.jsx)("span",{className:"elb-explorer-traffic-light elb-explorer-traffic-light--yellow"}),(0,ne.jsx)("span",{className:"elb-explorer-traffic-light elb-explorer-traffic-light--green"})]})}function re({header:e,headerActions:n,footer:t,children:r,className:o="",style:a,height:i,minHeight:s,maxHeight:l,tiny:c=!1,resizable:d=!1,showHeader:u=!0,tabs:p,activeTab:f,onTabChange:g,defaultTab:m,showTrafficLights:h=!1}){const y=U(),[b,v]=(0,Q.useState)(m||(p?.[0]?.id??"")),x=void 0!==f,w=x?f:b,k={...a};void 0!==i?k.height="number"==typeof i?`${i}px`:i:y?.syncedHeight&&(k.height=`${y.syncedHeight}px`),c?(k.height="auto",k.minHeight=void 0!==s?"number"==typeof s?`${s}px`:s:"100px"):void 0!==s&&(k.minHeight="number"==typeof s?`${s}px`:s),void 0!==l&&(k.maxHeight="number"==typeof l?`${l}px`:l),d&&(k.resize="vertical",k.overflow="auto");const T=!!y?.enabled?"elb-box--auto-height":"",C=p?.find(e=>e.id===w)?.content,$=C??r,S=p&&p.length>0,E=u&&e&&!S;return(0,ne.jsxs)("div",{className:`elb-explorer elb-explorer-box ${T} ${o}`.trim(),style:k,children:[S&&(0,ne.jsxs)("div",{className:"elb-explorer-tabs",children:[h&&(0,ne.jsx)(te,{}),p.map(e=>(0,ne.jsx)("button",{type:"button",className:"elb-explorer-tab "+(w===e.id?"elb-explorer-tab--active":""),onClick:()=>{return n=e.id,g&&g(n),void(x||v(n));var n},children:e.label},e.id)),n&&(0,ne.jsx)("div",{className:"elb-explorer-tab-actions",children:n})]}),E&&(0,ne.jsx)(ee,{label:e,children:n}),(0,ne.jsx)("div",{className:"elb-explorer-content",children:$}),t&&(0,ne.jsx)("div",{className:"elb-explorer-footer",children:t})]})}var oe=require("react/jsx-runtime"),ae=[{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 ie({highlights:e,onToggle:n,buttons:t=ae}){return(0,oe.jsx)("div",{className:"elb-preview-footer",children:t.map(t=>(0,oe.jsx)("button",{className:`elb-preview-btn ${e.has(t.type)?t.highlightClass:""}`,onClick:()=>n(t.type),type:"button",children:t.label},t.type))})}var se=require("react/jsx-runtime");function le({html:e,css:n="",elb:t,label:r="Preview"}){const[o,a]=(0,Y.useState)(new Set),i=(0,Y.useRef)(null),s=(0,Y.useRef)(void 0),l=(0,Y.useRef)(t),c=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{l.current=t},[t]);const d=(0,Y.useCallback)(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","")})})},[]);return(0,Y.useEffect)(()=>(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{const t=i.current;if(!t||!t.contentDocument)return;const r=t.contentDocument,a=Array.from(o).map(e=>`highlight-${e}`).join(" ");r.open(),r.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 ${n}\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-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 ${a}">\n ${e}\n </body>\n </html>\n `),r.close(),d(r),l.current&&t.contentWindow&&t.contentDocument&&setTimeout(async()=>{if(c.current)try{await(c.current.instance.destroy?.(c.current.destroyContext))}catch{}try{if(!t.contentWindow||!t.contentDocument||!l.current)return;const e=()=>({error:()=>{},warn:()=>{},info:()=>{},debug:()=>{},json:()=>{},throw:e=>{throw e instanceof Error?e:new Error(e)},scope:()=>e()}),n=e(),r=async()=>({ok:!0,destination:{}}),o={settings:{pageview:!1,prefix:"data-elb",elb:"elb",elbLayer:"elbLayer",scope:t.contentDocument.body}},a={elb:l.current,push:r,command:async()=>({ok:!0,destination:{}}),logger:n,window:t.contentWindow,document:t.contentDocument},i=await(0,K.sourceBrowser)({id:"preview",collector:{},logger:n,setIngest:async()=>{},setRespond:()=>{},config:o,env:a});c.current={instance:i,destroyContext:{id:"preview",config:o,env:a,logger:n}}}catch{}},50)},200),()=>{s.current&&clearTimeout(s.current),c.current&&c.current.instance.destroy?.(c.current.destroyContext)}),[e,n,o,d,t]),(0,se.jsx)(re,{header:r,footer:(0,se.jsx)(ie,{highlights:o,onToggle:e=>{a(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t})}}),children:(0,se.jsx)("div",{className:"elb-preview-content",children:(0,se.jsx)("iframe",{ref:i,className:"elb-preview-iframe",title:"HTML Preview"})})})}var ce=require("react"),de=require("react/jsx-runtime");function ue({active:e=!1,onClick:n,children:t,className:r=""}){return(0,de.jsx)("button",{className:`elb-explorer-btn ${e?"active":""} ${r}`,onClick:n,type:"button",children:t})}var pe=require("react/jsx-runtime");function fe({buttons:e,onButtonClick:n,className:t=""}){return(0,pe.jsx)("div",{className:`elb-explorer-button-group ${t}`,children:e.map(e=>(0,pe.jsx)(ue,{active:e.active,onClick:()=>n(e.value),children:e.label},e.value))})}var ge=require("react"),me=require("@monaco-editor/react"),he="elbTheme-dark",ye="elbTheme-light";function be(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 ve="697098",xe="c3e88d",we="f78c6c",ke="c084fc",Te="82aaff",Ce="ffcb6b",$e="bfc7d5",Se={base:"vs-dark",inherit:!0,rules:be([{foreground:ve,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:xe,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:we,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:ke,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:ke,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:Te,scopes:["function","identifier.function","support.function","entity.name.function","meta.function-call","meta.function-call.entity.name.function","variable.function"]},{foreground:Ce,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:$e,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:Te,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:xe,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:ke,fontStyle:"italic",scopes:["meta.tag.sgml.doctype"]},{fontStyle:"bold",scopes:["markup.bold"]},{fontStyle:"italic",scopes:["markup.italic"]},{foreground:ke,fontStyle:"bold",scopes:["markup.heading"]},{foreground:xe,scopes:["markup.raw"]},{foreground:ve,fontStyle:"italic",scopes:["markup.quote"]},{foreground:$e,scopes:["markup.list"]},{foreground:$e,scopes:["entity.name.tag.html","tag.html","entity.other.attribute-name.html","attribute.name.html"]},{foreground:"ff5572",scopes:["entity.name.tag.css"]},{foreground:Ce,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:we,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 Ee(e){e.editor.defineTheme(he,Se)}var je="6A737D",Pe="22863A",_e="6F42C1",Re="005CC5",Fe="24292E",Ie={base:"vs",inherit:!0,rules:be([{foreground:je,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:Pe,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:_e,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:_e,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:Re,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:Fe,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:Re,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:Fe,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:Pe,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:je,fontStyle:"italic",scopes:["meta.tag.sgml.doctype"]},{fontStyle:"bold",scopes:["markup.bold"]},{fontStyle:"italic",scopes:["markup.italic"]},{foreground:_e,fontStyle:"bold",scopes:["markup.heading"]},{foreground:Pe,scopes:["markup.raw"]},{foreground:je,fontStyle:"italic",scopes:["markup.quote"]},{foreground:Fe,scopes:["markup.list"]},{foreground:Fe,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 Oe(e){e.editor.defineTheme(ye,Ie)}function Ne(e){Ee(e),Oe(e)}W();var De=[/\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 Me=[{type:"variable",regex:/\$var\.(\w*)/g,className:"elb-ref-variable"},{type:"definition",regex:/\$def\.(\w*(?:\.[\w.]*)?)/g,className:"elb-ref-definition"},{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 Ae(e){const n=[];for(const t of Me){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 Le(e){let n=[];function t(){const t=e.getModel();if(!t)return;const r=Ae(t.getValue()).map(e=>{const n=t.getPositionAt(e.startIndex),r=t.getPositionAt(e.endIndex),o=Me.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 We(){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-definition { color: #c3e88d !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)}var Ve=require("@walkeros/core"),Be=require("@walkeros/core"),ze="",qe={};function He(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 Ge(e,n){if(!e||0===Object.keys(e).length)return[];const t=function(e){const n=JSON.stringify(e);if(n!==ze)try{qe=(0,Be.resolveContracts)(e),ze=n}catch{return{}}return qe}(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=[];void 0!==a.tagging&&e.push({key:"tagging",type:"number"}),void 0!==a.description&&e.push({key:"description",type:"string"});for(const n of["globals","context","custom","user","consent"])a[n]&&e.push({key:n,detail:"schema"});return a.events&&e.push({key:"events",detail:"entity map"}),e}const i=o[0];if(["globals","context","custom","user","consent"].includes(i)){const e=a[i];return e&&"object"==typeof e?1===o.length?He(e):Ue(e,o.slice(1)):[]}if("events"===i){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?He(t):Ue(t,o.slice(3)):[]}return[]}function Ue(e,n){let t=e;for(const e of n){const n=t.properties;if(!n||!n[e])return[];t=n[e]}return He(t)}function Je(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 Xe(e){return e&&0!==Object.keys(e).length?Object.keys(e).map(e=>({label:`$def.${e}`,insertText:`$def.${e}`,detail:"(definition)",documentation:`Definition reference. Injects the reusable config fragment "${e}" at runtime.`,kind:"reference",sortText:"0_def_"+e})):[]}function Ye(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 Ke(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 Qe(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 Ze(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 en=[{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 nn(e,n){if(!e||0===Object.keys(e).length)return[];const t=Ge(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 tn(e,n){const t=[];let r,o=0,a=!1,i=-1,s=!1;for(;o<e.length&&o<=n;){const n=e[o];if(s)s=!1,o++;else if("\\"===n&&a)s=!0,o++;else{if('"'===n)if(a){const n=e.substring(i,o);a=!1;let t=o+1;for(;t<e.length&&/\s/.test(e[t]);)t++;":"===e[t]&&(r=n)}else a=!0,i=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 rn(e){const n=e.source.replace(/^\^/,"").replace(/\$$/,"").replace(/\(\.\+\)\?$/,"([\\w.]+)?");return new RegExp(n,"g")}var on=Ve.REF_CONTRACT.source.replace(/^\^/,"").split(/\\\./,1)[0],an=new RegExp(`${on}\\.([a-zA-Z0-9_.]*)?$`);var sn=new Map,ln=[],cn=!1;function dn(e,n){sn.set(e,n)}function un(e){sn.delete(e)}function pn(e){cn||(cn=!0,ln.push(e.languages.registerCompletionItemProvider("json",{triggerCharacters:['"',".","$"],provideCompletionItems(n,t){const r=n.uri.toString(),o=sn.get(r);if(!o)return{suggestions:[]};const a=n.getLineContent(t.lineNumber).substring(0,t.column-1),i=n.getOffsetAt(t),s=n.getValue(),l=function(e,n){const t=tn(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}(s,i),c=[];if(a.includes("$var.")||a.endsWith('"$var'))c.push(...Je(o.variables));else if(a.includes("$def.")||a.endsWith('"$def'))c.push(...Xe(o.definitions));else if(a.includes("$secret.")||a.endsWith('"$secret'))c.push(...Ye(o.secrets));else if(a.includes("$store.")||a.endsWith('"$store'))c.push(...Ke(o.stores));else if(a.includes("$flow.")||a.endsWith('"$flow'))c.push(...Qe(o.flows));else if(a.includes("$env.")||a.endsWith('"$env'))c.push(...Ze(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 i=o.substring(a+1);return/^\$contract(\.[a-zA-Z0-9_.]*)?$/.test(i)}(n,t)){const e=a.match(an),n=e?.[1]||"",t=n?n.split(".").filter(Boolean):[];n&&!n.endsWith(".")&&t.length>0&&t.pop(),c.push(...nn(o.contractRaw,t))}else!function(e,n,t){const r=tn(e,n);return!(!r||0===r.length)&&r[r.length-1]===t}(s,i,"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('"'))&&(c.push(...Je(o.variables)),c.push(...Xe(o.definitions)),c.push(...Ye(o.secrets)),c.push(...Ke(o.stores)),c.push(...Qe(o.flows)),c.push(...Ze(o.envNames)),c.push(...nn(o.contractRaw,[]))):c.push(...(d=o.packages,u=o.platform,d&&0!==d.length?(u?d.filter(e=>e.platform===u):d).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 d,u;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}(tn(s,i));if(e){const n=a.match(/"([a-z_]*)\.?$/);if(n){const t=n[1],r=function(e,n,t,r){if(!r)return en;if(!e||0===Object.keys(e).length)return[];const o={data:"events",globals:"globals",context:"context",custom:"custom",user:"user",consent:"consent"}[r];if(!o)return[];const a=[],i=new Set;for(const s of Object.keys(e)){const l=Ge(e,"events"===o?[s,"events",n,t]:[s,o]);for(const e of l)i.has(e.key)||(i.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}(o.contractRaw,e.entity,e.action,t);r.length>0&&c.push(...r)}}}const p=a.match(/\$(?:var|def|secret|env|code|contract|store|flow)[.:]?[\w.]*$/),f=p?null:a.match(/[a-z_][\w.]*$/i),g=n.getWordUntilPosition(t),m=p?t.column-p[0].length:f?t.column-f[0].length:g.startColumn,h={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:m,endColumn:t.column};return{suggestions:c.map(n=>({label:n.label,insertText:n.insertText,detail:n.detail,documentation:n.documentation,kind:gn(e,n.kind),sortText:n.sortText,range:h}))}}})),ln.push(e.languages.registerHoverProvider("json",{provideHover(e,n){const t=e.uri.toString(),r=sn.get(t);if(!r)return null;const o=e.getLineContent(n.lineNumber),a=n.column-1;function i(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 s=i(rn(Ve.REF_VAR));if(s&&r.variables){const e=s[1];if(e in r.variables){const t=r.variables[e];return{range:{startLineNumber:n.lineNumber,startColumn:s.index+1,endLineNumber:n.lineNumber,endColumn:s.index+s[0].length+1},contents:[{value:`**Variable:** \`$var.${e}\`\n\n**Value:** \`${JSON.stringify(t)}\`\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=i(rn(Ve.REF_DEF));if(l&&r.definitions){const e=l[1];return e in r.definitions?{range:{startLineNumber:n.lineNumber,startColumn:l.index+1,endLineNumber:n.lineNumber,endColumn:l.index+l[0].length+1},contents:[{value:`**Definition:** \`$def.${e}\`\n\n*Injects reusable config fragment at runtime*`}]}:{contents:[{value:`**Unknown definition** \`$def.${e}\`\n\nDefined: ${Object.keys(r.definitions).join(", ")||"none"}`}]}}const c=i(rn(Ve.REF_SECRET));if(c){const e=c[1];return r.secrets?.includes(e)?{range:{startLineNumber:n.lineNumber,startColumn:c.index+1,endLineNumber:n.lineNumber,endColumn:c.index+c[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 d=i(rn(Ve.REF_STORE));if(d){const e=d[1];return r.stores?.includes(e)?{range:{startLineNumber:n.lineNumber,startColumn:d.index+1,endLineNumber:n.lineNumber,endColumn:d.index+d[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 u=i(rn(Ve.REF_FLOW));if(u&&r.flows){const e=u[1],t=u[2],o=r.flows.includes(e),a=o?`**Flow reference:** \`$flow.${e}${t?`.${t}`:""}\``:`**Unknown flow** \`$flow.${e}\``,i=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:u.index+1,endLineNumber:n.lineNumber,endColumn:u.index+u[0].length+1},contents:[{value:`${a}\n\n${i}`}]}}const p=i(rn(Ve.REF_ENV));if(p){const e=p[1];return r.envNames&&r.envNames.length>0?r.envNames.includes(e)?{range:{startLineNumber:n.lineNumber,startColumn:p.index+1,endLineNumber:n.lineNumber,endColumn:p.index+p[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:p.index+1,endLineNumber:n.lineNumber,endColumn:p.index+p[0].length+1},contents:[{value:`**Env var:** \`$env.${e}\`\n\n*Resolved from process.env at runtime.*`}]}}const f=i(rn(Ve.REF_CONTRACT));if(f&&r.contractRaw){const e=f[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:f.index+1,endLineNumber:n.lineNumber,endColumn:f.index+f[0].length+1},contents:[{value:o}]}}return null}})))}function fn(){for(const e of ln)e.dispose();ln.length=0,cn=!1,sn.clear()}function gn(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}}var mn=p(require("prettier/standalone"),1),hn=p(require("prettier/plugins/babel"),1),yn=p(require("prettier/plugins/estree"),1),bn=p(require("prettier/plugins/typescript"),1),vn=p(require("prettier/plugins/html"),1);var xn,wn=new Map,kn=0;var Tn={typescript:"ts",javascript:"js",typescriptreact:"tsx",javascriptreact:"jsx",json:"json",html:"html",css:"css",markdown:"md"};function Cn(e="json"){const n=Tn[e]??"txt";return`inmemory://walkeros/model-${++kn}.${n}`}function $n(e,n){wn.set(e,{uri:`schema://walkeros/${e}`,fileMatch:[e],schema:n}),En()}function Sn(e){wn.delete(e),En()}function En(){xn&&xn.jsonDefaults.setDiagnosticsOptions({validate:!0,schemaValidation:"error",schemaRequest:"ignore",enableSchemaRequest:!1,schemas:Array.from(wn.values())})}var jn=require("react");function Pn(e){if(!e||"object"!=typeof e)return!1;const n=e;return"cancelation"===n.type||!(void 0===n.cause||!Pn(n.cause))}var _n=require("react/jsx-runtime");function Rn({code:e,language:n="javascript",onChange:t,disabled:r=!1,lineNumbers:o=!1,minimap:a=!1,folding:i=!1,wordWrap:s=!1,className:l,beforeMount:c,onMount:d,autoHeight:u,fontSize:p=13,packages:f,sticky:g=!0,ide:m=!1,jsonSchema:h,intellisenseContext:y,validate:b,onMarkerCounts:v}){const[w,k]=(0,ge.useState)(!1),[T,C]=(0,ge.useState)("vs-light"),$=(0,ge.useRef)([]),S=(0,ge.useRef)(null),E=(0,ge.useRef)(null),j=(0,ge.useRef)(null),P=U(),_=(0,ge.useRef)(null);P?.enabled&&null===_.current&&(_.current=P.getBoxId());const R=(0,ge.useCallback)(e=>{P?.enabled&&null!==_.current&&P.registerBox(_.current,e)},[P]);(0,ge.useEffect)(()=>()=>{P?.enabled&&null!==_.current&&P.unregisterBox(_.current)},[P]);const F="object"==typeof u?u:{},[I,N]=function({enabled:e=!1,minHeight:n=100,maxHeight:t=800,defaultHeight:r=400,onHeightChange:o}={}){const[a,i]=(0,jn.useState)(e?n:r),s=(0,jn.useRef)(null),l=(0,jn.useRef)(e?n:r),c=(0,jn.useRef)(null),d=(0,jn.useCallback)(()=>{if(e&&s.current)try{const e=s.current.getContentHeight(),r=Math.max(n,Math.min(t,e));if(r===l.current)return;l.current=r,i(r),o&&o(r+36+2)}catch(e){}},[e,n,t,o]);return[a,(0,jn.useCallback)(n=>{if(c.current&&(clearTimeout(c.current),c.current=null),s.current=n,!e||!n)return i(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||!!P?.enabled,minHeight:F.min??(P?.enabled?1:20),maxHeight:F.max??600,defaultHeight:P?.enabled?250:400,onHeightChange:R});(0,ge.useEffect)(()=>{!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 D=(0,ge.useCallback)(()=>{if("undefined"==typeof document)return null;if(j.current){const e=j.current.closest("[data-theme]");if(e)return e.getAttribute("data-theme")}return document.documentElement.getAttribute("data-theme")},[]);(0,ge.useEffect)(()=>{k(!0)},[]),(0,ge.useEffect)(()=>{if(!w)return;const e=()=>{const e=D(),n="dark"===e||null===e&&window.matchMedia("(prefers-color-scheme: dark)").matches;C(n?he:ye)};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)}},[w,D]),(0,ge.useEffect)(()=>{const e=E.current,n=j.current;if(!e||!n)return;const t=new ResizeObserver(()=>{requestAnimationFrame(()=>{e.layout()})});return t.observe(n),()=>{t.disconnect()}},[]);const M=(0,ge.useRef)(null);(0,ge.useRef)(y).current=y;const A=(0,ge.useRef)(b);A.current=b;const L=(0,ge.useRef)(v);L.current=v,M.current||(M.current=Cn(n)),(0,ge.useEffect)(()=>{if(h&&M.current)return $n(M.current,h),()=>{M.current&&Sn(M.current)}},[h]),(0,ge.useEffect)(()=>{if(y&&M.current)return dn(M.current,y),()=>{M.current&&un(M.current)}},[y]);const V=me.Editor;(0,ge.useEffect)(()=>()=>{for(const e of $.current)e();$.current=[]},[]);const B=u||P?.enabled?`${I}px`:"100%",z=`elb-code ${!!u||!!P?.enabled?"elb-code--auto-height":""} ${l||""}`.trim();return(0,_n.jsx)("div",{className:z,ref:j,children:(0,_n.jsx)(V,{height:B,language:n,value:e,onChange:e=>{t&&void 0!==e&&t(e)},beforeMount:async e=>{var t;if(S.current=e,function(e){xn||(xn=e.json,wn.size>0&&En())}(e),Ne(e),(t=e).languages.registerDocumentFormattingEditProvider("javascript",{async provideDocumentFormattingEdits(e,n){try{const t=e.getValue(),r=await mn.format(t,{parser:"babel",plugins:[hn.default,yn.default],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 mn.format(t,{parser:"typescript",plugins:[bn.default,yn.default],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 mn.format(t,{parser:"html",plugins:[vn.default],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 mn.format(t,{parser:"css",plugins:[vn.default],tabWidth:n.tabSize,useTabs:!n.insertSpaces});return[{range:e.getFullModelRange(),text:r}]}catch(e){return[]}}}),f&&f.length>0){O(e);const{loadPackageTypes:n}=await Promise.resolve().then(()=>(W(),x));for(const t of f)"@walkeros/core"!==t&&await n(e,{package:t}).catch(()=>{})}const r=D(),o="dark"===r||null===r&&window.matchMedia("(prefers-color-scheme: dark)").matches?he:ye;e.editor.setTheme(o),"json"===n&&pn(e),c&&c(e)},onMount:e=>{if(E.current=e,(u||P?.enabled)&&N(e),"html"===n&&S.current&&$.current.push(function(e,n){const t=[],r=()=>{const r=e.getModel();if(!r)return;const o=r.getValue(),a=[];De.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 i=e.deltaDecorations(t,a);t.length=0,t.push(...i)};r();const o=e.onDidChangeModelContent(()=>{r()});return()=>{o.dispose(),e.deltaDecorations(t,[])}}(e,S.current)),"json"===n&&(We(),$.current.push(Le(e))),A.current&&S.current){const n=S.current;let t;const r=()=>{const t=e.getModel();if(!t)return;const r=t.getValue(),o=A.current;if(!o)return;const a=o(r),i=[...a.errors,...a.warnings];n.editor.setModelMarkers(t,"validate",i.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(L.current&&S.current){const n=S.current,t=e.getModel(),r=!!A.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 i=[];for(const n of e)8===n.severity?(o++,i.push({message:n.message,severity:"error",line:n.startLineNumber,column:n.startColumn})):4===n.severity&&(a++,i.push({message:n.message,severity:"warning",line:n.startLineNumber,column:n.startColumn}));L.current?.({errors:o,warnings:a,markers:i})},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:T,path:M.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:i,lineDecorationsWidth:8,scrollBeyondLastLine:!1,automaticLayout:!0,tabSize:2,detectIndentation:!1,trimAutoWhitespace:!1,wordWrap:s?"on":"off",fixedOverflowWidgets:!0,overviewRulerLanes:0,renderLineHighlight:"none",renderValidationDecorations:m||h?"editable":"off",hover:{enabled:m||!!h||!!y},"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:!1},cursorBlinking:"blink",cursorStyle:"line",cursorWidth:2,cursorSmoothCaretAnimation:"off",selectionHighlight:!1,occurrencesHighlight:"off",selectOnLineNumbers:!1,wordBasedSuggestions:"off",quickSuggestions:!(!h&&!y)&&{strings:!0,other:!0,comments:!1},stickyScroll:{enabled:g}}})})}"undefined"!=typeof window&&window.addEventListener("unhandledrejection",e=>{Pn(e.reason)&&e.preventDefault()}),"undefined"!=typeof window&&me.loader.init().then(e=>{w(e),N(e)}).catch(e=>{console.warn("[walkerOS] Monaco loader.init() failed:",e)});var Fn=require("react/jsx-runtime");function In({html:e,css:n,js:t,onHtmlChange:r,onCssChange:o,onJsChange:a,showPreview:i=!0,label:s="Code",className:l="",initialTab:c,lineNumbers:d=!1,wordWrap:u=!1}){const p=(0,ce.useMemo)(()=>{const r=[];return i&&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,i]),[f,g]=(0,ce.useState)(()=>c&&p.some(e=>e.value===c)?c:p[0]?.value||"preview"),{content:m,language:h,onChange:y}=(0,ce.useMemo)(()=>{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=(0,ce.useMemo)(()=>p.map(e=>({label:e.label,value:e.value,active:f===e.value})),[p,f]);return(0,Fn.jsx)(re,{header:s,headerActions:p.length>1?(0,Fn.jsx)(fe,{buttons:b,onButtonClick:g}):null,className:l,children:"preview"===f?(0,Fn.jsx)(le,{html:e||"",css:n||""}):(0,Fn.jsx)(Rn,{code:m,language:h,onChange:y,disabled:!y,lineNumbers:d,wordWrap:u})})}var On=require("react"),Nn=require("@monaco-editor/react"),Dn=require("react/jsx-runtime");function Mn({code:e,language:n="javascript",onChange:t,disabled:r=!1,autoHeight:o,label:a,header:i,showHeader:s=!0,tabs:l,activeTab:c,onTabChange:d,defaultTab:u,showTrafficLights:p=!1,showCopy:f=!0,showFormat:g=!1,showSettings:m=!1,onValidationIssues:h,footer:y,height:b,style:v,className:x,...w}){const{onMount:k,...T}=w,[C,$]=((0,Nn.useMonaco)(),(0,On.useState)(!1)),[S,E]=(0,On.useState)(!1),[j,P]=(0,On.useState)({lineNumbers:w.lineNumbers??!1,minimap:w.minimap??!1,wordWrap:w.wordWrap??!1,sticky:w.sticky??!0}),_=(0,On.useRef)(null),[R,F]=(0,On.useState)({errors:0,warnings:0}),[I,O]=(0,On.useState)([]),[N,D]=(0,On.useState)(null),M=(0,On.useRef)(null),A=(0,On.useRef)(null);(0,On.useEffect)(()=>{if(!S&&!N)return;const e=e=>{S&&_.current&&!_.current.contains(e.target)&&E(!1),N&&M.current&&!M.current.contains(e.target)&&D(null)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[S,N]);const[L,W]=(0,On.useState)(c??u??l?.[0]?.id??""),V=c??L,B=(0,On.useCallback)(e=>{W(e),d?.(e)},[d]),z=l?.find(e=>e.id===V),q=z?.code??e??"",H=z?.language??n,G=i??a??"Code",U=(0,On.useCallback)(e=>{A.current=e,k?.(e)},[k]),J=(0,On.useCallback)(e=>{F({errors:e.errors,warnings:e.warnings}),O(e.markers),h?.({errors:e.errors,warnings:e.warnings})},[h]),X=(0,On.useCallback)((e,n)=>{const t=A.current;t&&(t.revealLineInCenter(e),t.setPosition({lineNumber:e,column:n}),t.focus(),D(null))},[]),Y={lineNumbers:j.lineNumbers,minimap:j.minimap,wordWrap:j.wordWrap,sticky:j.sticky},K=(0,Dn.jsxs)("div",{style:{display:"flex",gap:"4px",alignItems:"center"},children:[R.errors>0&&(0,Dn.jsxs)("div",{ref:"error"===N?M:void 0,style:{position:"relative"},children:[(0,Dn.jsxs)("button",{className:"elb-codebox-marker-badge elb-codebox-marker-badge--error",onClick:()=>D("error"===N?null:"error"),children:[(0,Dn.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,Dn.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Dn.jsx)("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),(0,Dn.jsx)("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),(0,Dn.jsx)("span",{children:R.errors})]}),"error"===N&&(0,Dn.jsx)(An,{markers:I.filter(e=>"error"===e.severity),onJump:X})]}),R.warnings>0&&(0,Dn.jsxs)("div",{ref:"warning"===N?M:void 0,style:{position:"relative"},children:[(0,Dn.jsxs)("button",{className:"elb-codebox-marker-badge elb-codebox-marker-badge--warning",onClick:()=>D("warning"===N?null:"warning"),children:[(0,Dn.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Dn.jsx)("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"}),(0,Dn.jsx)("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),(0,Dn.jsx)("circle",{cx:"12",cy:"17",r:".5"})]}),(0,Dn.jsx)("span",{children:R.warnings})]}),"warning"===N&&(0,Dn.jsx)(An,{markers:I.filter(e=>"warning"===e.severity),onJump:X})]}),g&&!r&&"json"===H&&(0,Dn.jsx)("button",{className:"elb-explorer-btn",onClick:()=>{if(t&&!r&&"json"===H)try{const e=JSON.parse(q),n=JSON.stringify(e,null,2);t(n)}catch(e){}},title:"Format JSON",children:(0,Dn.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Dn.jsx)("line",{x1:"3",y1:"5",x2:"16",y2:"5"}),(0,Dn.jsx)("line",{x1:"7",y1:"10",x2:"20",y2:"10"}),(0,Dn.jsx)("line",{x1:"7",y1:"15",x2:"18",y2:"15"}),(0,Dn.jsx)("line",{x1:"3",y1:"20",x2:"12",y2:"20"})]})}),f&&(0,Dn.jsx)("button",{className:"elb-explorer-btn",onClick:async()=>{try{await navigator.clipboard.writeText(q),$(!0),setTimeout(()=>$(!1),2e3)}catch{}},title:C?"Copied!":"Copy to clipboard",children:C?(0,Dn.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,Dn.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,Dn.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Dn.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,Dn.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),m&&(0,Dn.jsxs)("div",{ref:_,style:{position:"relative"},children:[(0,Dn.jsx)("button",{className:"elb-explorer-btn"+(S?" active":""),onClick:()=>E(!S),title:"Editor settings",children:(0,Dn.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Dn.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,Dn.jsx)("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"})]})}),S&&(0,Dn.jsxs)("div",{className:"elb-codebox-settings",children:[(0,Dn.jsxs)("label",{className:"elb-codebox-settings-option",children:[(0,Dn.jsx)("input",{type:"checkbox",checked:j.lineNumbers,onChange:()=>P(e=>({...e,lineNumbers:!e.lineNumbers}))}),"Line numbers"]}),(0,Dn.jsxs)("label",{className:"elb-codebox-settings-option",children:[(0,Dn.jsx)("input",{type:"checkbox",checked:j.minimap,onChange:()=>P(e=>({...e,minimap:!e.minimap}))}),"Minimap"]}),(0,Dn.jsxs)("label",{className:"elb-codebox-settings-option",children:[(0,Dn.jsx)("input",{type:"checkbox",checked:j.wordWrap,onChange:()=>P(e=>({...e,wordWrap:!e.wordWrap}))}),"Word wrap"]}),(0,Dn.jsxs)("label",{className:"elb-codebox-settings-option",children:[(0,Dn.jsx)("input",{type:"checkbox",checked:j.sticky,onChange:()=>P(e=>({...e,sticky:!e.sticky}))}),"Sticky scroll"]})]})]})]}),Q=`${o?"elb-box--auto-height":""} ${x||""}`.trim(),Z=l?.map(e=>({id:e.id,label:e.label,content:(0,Dn.jsx)(Rn,{code:e.code,language:e.language??n,onChange:t,disabled:r,autoHeight:o,onMount:U,onMarkerCounts:J,...T,...Y})}));return(0,Dn.jsx)(re,{header:G,headerActions:K,showHeader:s,tabs:Z,defaultTab:u,activeTab:c,onTabChange:B,showTrafficLights:p,footer:y,height:b,style:v,className:Q,children:!l&&(0,Dn.jsx)(Rn,{code:e??"",language:n,onChange:t,disabled:r,autoHeight:o,onMount:U,onMarkerCounts:J,...T,...Y})})}function An({markers:e,onJump:n}){return(0,Dn.jsx)("div",{className:"elb-codebox-marker-menu",children:e.sort((e,n)=>e.line-n.line||e.column-n.column).map((e,t)=>(0,Dn.jsxs)("button",{className:"elb-codebox-marker-menu-item",onClick:()=>n(e.line,e.column),children:[(0,Dn.jsxs)("span",{className:"elb-codebox-marker-menu-line",children:["Ln ",e.line]}),(0,Dn.jsx)("span",{className:"elb-codebox-marker-menu-msg",children:e.message})]},t))})}function Ln(){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 Wn(){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 Vn(){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)}}}var Bn=require("react/jsx-runtime"),zn='<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>',qn="* {\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}",Hn='{\n "product": {\n "view": {\n "name": "view_item",\n "data": {\n "map": {\n "event": "name",\n "price": "data.price",\n "stage": "context.stage.0"\n }\n }\n },\n "add": {\n "name": "add_to_cart",\n "data": {\n "map": {\n "event": "event",\n "price": "data.price",\n "user": {\n "consent": { "marketing": true },\n "key": "user.session"\n },\n "isSale": {\n "fn": "(e) => !!e.data.old_price"\n }\n }\n }\n },\n "save": {\n "data": {\n "map": {\n "event": "event",\n "data": "data"\n }\n }\n }\n }\n}';function Gn({initialHtml:e=zn,initialCss:n=qn,initialJs:t="",initialMapping:r=Hn,labelCode:o="Code",labelPreview:a="Preview",labelEvents:i="Events",labelMapping:s="Mapping",labelResult:l="Result",destination:c}){const d=(0,B.useMemo)(()=>c??Ln(),[c]),[u,p]=(0,B.useState)(e),[f,g]=(0,B.useState)(n),[m,h]=(0,B.useState)(t),[y,b]=(0,B.useState)(r),[v,x]=(0,B.useState)("// Click elements in the preview to see events"),[w,k]=(0,B.useState)("// Click elements in the preview to see function call"),T=(0,B.useRef)(null),C=(0,B.useRef)(null),$=(0,B.useRef)(null),[S,E]=(0,B.useState)(!1);(0,B.useEffect)(()=>{let e=!0;return(async()=>{try{const n=JSON.parse(r),{collector:t,elb:o}=await(0,z.startFlow)({destinations:{rawCapture:{code:{type:"rawCapture",config:{},push:async n=>{e&&($.current=n,x(JSON.stringify(n,null,2)))}}},gtag:{code:d,config:{mapping:n},env:{elb:n=>{e&&k(n)}}}},consent:{functional:!0,marketing:!0},user:{session:"playground"}});if(!e)return;T.current=t,C.current=o,E(!0)}catch{}})(),()=>{e=!1,T.current}},[r,d]);const j=(0,B.useCallback)(e=>{b(e);const n=setTimeout(()=>{try{const n=JSON.parse(e);T.current?.destinations?.gtag?.config&&(T.current.destinations.gtag.config.mapping=n),$.current&&T.current&&T.current.push($.current)}catch{}},500);return()=>clearTimeout(n)},[]);return(0,Bn.jsxs)(X,{columns:5,rowHeight:600,children:[(0,Bn.jsx)(In,{label:o,html:u,css:f,js:m,onHtmlChange:p,onCssChange:g,onJsChange:h,showPreview:!1,initialTab:"html",lineNumbers:!1,wordWrap:!0}),(0,Bn.jsx)(le,{label:a,html:u,css:f,elb:S?C.current??void 0:void 0}),(0,Bn.jsx)(Mn,{label:i,code:v,onChange:x,language:"json",wordWrap:!0}),(0,Bn.jsx)(Mn,{label:s,code:y,onChange:j,language:"json",wordWrap:!0}),(0,Bn.jsx)(Mn,{label:l,code:w,language:"javascript",disabled:!0,wordWrap:!0})]})}var Un=require("react"),Jn=require("@walkeros/core"),Xn=p(require("prettier/standalone"),1),Yn=p(require("prettier/plugins/babel"),1),Kn=p(require("prettier/plugins/estree"),1),Qn=p(require("prettier/plugins/typescript"),1),Zn=p(require("prettier/plugins/html"),1);async function et(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 Xn.format(r,{parser:"babel",plugins:[Yn.default,Kn.default],semi:!0,singleQuote:!0,trailingComma:"all"}),n&&(t=t.replace(/^\(/,"").replace(/\);?\s*$/,""));break}case"typescript":case"ts":case"tsx":t=await Xn.format(e,{parser:"typescript",plugins:[Qn.default,Kn.default],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 Xn.format(e,{parser:"html",plugins:[Zn.default],htmlWhitespaceSensitivity:"css"});break;case"css":case"scss":t=await Xn.format(e,{parser:"css",plugins:[Zn.default]});break;default:return e}return t.trim()}catch(n){return e}}var nt=require("react/jsx-runtime");function tt(e,n={}){if(void 0===e)return"";const t=(0,Jn.isString)(e)?e.trim():JSON.stringify(e,null,2);return n.quotes&&(0,Jn.isString)(e)?`"${t}"`:t}function rt({input:e,config:n,output:t="",options:r,fn:o,fnName:a,labelInput:i="Event",labelConfig:s="Config",labelOutput:l="Result",emptyText:c="No event yet.",disableInput:d=!1,disableConfig:u=!1,showQuotes:p=!0,className:f,language:g="json",format:m=!0,rowHeight:h,outputLanguage:y="json",configLanguage:b="json"}){const[v,x]=(0,Un.useState)(tt(e)),[w,k]=(0,Un.useState)(tt(n)),[T,C]=(0,Un.useState)([tt(t)]);(0,Un.useEffect)(()=>{if(m&&e){et(tt(e),g).then(x)}},[e,g,m]),(0,Un.useEffect)(()=>{if(m&&n){et(tt(n),g).then(k)}},[n,g,m]);const $=(0,Un.useCallback)((...e)=>{const n=e.map(e=>tt(e,{quotes:p})).join(", ");C([a?`${a}(${n})`:n])},[a,p]),S=(0,Un.useCallback)((0,Jn.debounce)(async(e,n,t)=>{o&&(C([]),await(0,Jn.tryCatchAsync)(o,e=>{C([`Error: ${String(e)}`])})(e,n,$,t))},500,!0),[o,$]);return(0,Un.useEffect)(()=>{S(v,w,r||{})},[v,w,r,S]),(0,nt.jsxs)(X,{columns:3,className:f,rowHeight:h,children:[(0,nt.jsx)(Mn,{label:i,code:v,onChange:d?void 0:x,disabled:d,language:g,showFormat:!d&&"json"===g}),w&&(0,nt.jsx)(Mn,{label:s,code:w,onChange:u?void 0:k,disabled:u,language:b,showFormat:!u&&"json"===b}),(0,nt.jsx)(Mn,{label:l,code:T[0]||c,disabled:!0,language:y})]})}var ot=require("react"),at=require("@walkeros/collector"),it=require("react/jsx-runtime");function st({event:e,mapping:n,destination:t,label:r="Result",wordWrap:o=!1}){const[a,i]=(0,ot.useState)("// Click elements in the preview to see function call");return(0,ot.useEffect)(()=>{(async()=>{try{const r=JSON.parse(e),o=JSON.parse(n),{collector:a}=await(0,at.startFlow)({destinations:{demo:{code:t,config:{mapping:o},env:{elb:i}}}});await a.push(r)}catch(e){e instanceof Error?i(`// Error: ${e.message}`):i(`// Error: ${String(e)}`)}})()},[e,n,t]),(0,it.jsx)(Mn,{code:a,language:"javascript",disabled:!0,label:r,wordWrap:o})}var lt=require("react");var ct=Object.freeze({left:0,top:0,width:16,height:16}),dt=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ut=Object.freeze({...ct,...dt}),pt=Object.freeze({...ut,body:"",hidden:!1});function ft(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 pt)r in dt?r in e&&!(r in t)&&(t[r]=dt[r]):r in n?t[r]=n[r]:r in e&&(t[r]=e[r]);return t}function gt(e,n,t){const r=e.icons,o=e.aliases||Object.create(null);let a={};function i(e){a=ft(r[e]||o[e],a)}return i(n),t.forEach(i),ft(e,a)}function mt(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,gt(e,o,a)),t.push(o))}return t}var ht={provider:"",aliases:{},not_found:{},...ct};function yt(e,n){for(const t in n)if(t in e&&typeof e[t]!=typeof n[t])return!1;return!0}function bt(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(!yt(e,ht))return null;const t=n.icons;for(const e in t){const n=t[e];if(!e||"string"!=typeof n.body||!yt(n,pt))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]||!yt(n,pt))return null}return n}var vt=Object.create(null);function xt(e,n){const t=vt[e]||(vt[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 wt(e,n){return bt(n)?mt(n,(n,t)=>{t?e.icons[n]=t:e.missing.add(n)}):[]}var kt=/^[a-z0-9]+(-[a-z0-9]+)*$/,Tt=(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&&!Ct(a)?null:a}const a=o[0],i=a.split("-");if(i.length>1){const e={provider:r,prefix:i.shift(),name:i.join("-")};return n&&!Ct(e)?null:e}if(t&&""===r){const e={provider:r,prefix:"",name:a};return n&&!Ct(e,t)?null:e}return null},Ct=(e,n)=>!!e&&!(!(n&&""===e.prefix||e.prefix)||!e.name),$t=!1;function St(e){return"boolean"==typeof e&&($t=e),$t}function Et(e){const n="string"==typeof e?Tt(e,!0,$t):e;if(n){const e=xt(n.provider,n.prefix),t=n.name;return e.icons[t]||(e.missing.has(t)?null:void 0)}}function jt(e,n){const t=Tt(e,!0,$t);if(!t)return!1;const r=xt(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 Pt=Object.freeze({width:null,height:null}),_t=Object.freeze({...Pt,...dt}),Rt=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Ft=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function It(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(Rt);if(null===r||!r.length)return e;const o=[];let a=r.shift(),i=Ft.test(a);for(;;){if(i){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("");i=!i}}var Ot=/\sid="(\S+)"/g,Nt="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16),Dt=0;function Mt(e,n=Nt){const t=[];let r;for(;r=Ot.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+(Dt++).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 At=Object.create(null);function Lt(e){return At[e]||At[""]}function Wt(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 Vt=Object.create(null),Bt=["https://api.simplesvg.com","https://api.unisvg.com"],zt=[];Bt.length>0;)1===Bt.length||Math.random()>.5?zt.push(Bt.shift()):zt.push(Bt.pop());function qt(e,n){const t=Wt(n);return null!==t&&(Vt[e]=t,!0)}function Ht(e){return Vt[e]}Vt[""]=Wt({resources:["https://api.iconify.design"].concat(zt)});var Gt=(()=>{let e;try{if(e=fetch,"function"==typeof e)return e}catch(e){}})();var Ut={prepare:(e,n,t)=>{const r=[],o=function(e,n){const t=Ht(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 i={type:a,provider:e,prefix:n,icons:[]},s=0;return t.forEach((t,l)=>{s+=t.length+1,s>=o&&l>0&&(r.push(i),i={type:a,provider:e,prefix:n,icons:[]},s=t.length),i.icons.push(t)}),r.push(i),r},send:(e,n,t)=>{if(!Gt)return void t("abort",424);let r=function(e){if("string"==typeof e){const n=Ht(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;Gt(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 Jt(e,n){e.forEach(e=>{const t=e.loaderCallbacks;t&&(e.loaderCallbacks=t.filter(e=>e.id!==n))})}var Xt=0;var Yt={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Kt(e,n,t,r){const o=e.resources.length,a=e.random?Math.floor(Math.random()*o):e.index;let i;if(e.random){let n=e.resources.slice(0);for(i=[];n.length>1;){const e=Math.floor(Math.random()*n.length);i.push(n[e]),n=n.slice(0,e).concat(n.slice(e+1))}i=i.concat(n)}else i=e.resources.slice(a).concat(e.resources.slice(0,a));const s=Date.now();let l,c="pending",d=0,u=null,p=[],f=[];function g(){u&&(clearTimeout(u),u=null)}function m(){"pending"===c&&(c="aborted"),g(),p.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),p=[]}function h(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=i.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||(i.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:s,payload:n,status:c,queriesSent:d,queriesPending:p.length,subscribe:h,abort:m}}}function Qt(e){const n={...Yt,...e};let t=[];function r(){t=t.filter(e=>"pending"===e().status)}return{query:function(e,o,a){const i=Kt(n,e,o,(e,n)=>{r(),a&&a(e,n)});return t.push(i),i},find:function(e){return t.find(n=>e(n))||null},setIndex:e=>{n.index=e},getIndex:()=>n.index,cleanup:r}}function Zt(){}var er=Object.create(null);function nr(e,n,t){let r,o;if("string"==typeof e){const n=Lt(e);if(!n)return t(void 0,424),Zt;o=n.send;const a=function(e){if(!er[e]){const n=Ht(e);if(!n)return;const t={config:n,redundancy:Qt(n)};er[e]=t}return er[e]}(e);a&&(r=a.redundancy)}else{const n=Wt(e);if(n){r=Qt(n);const t=Lt(e.resources?e.resources[0]:"");t&&(o=t.send)}}return r&&o?r.query(n,o,t)().abort:(t(void 0,424),Zt)}function tr(){}function rr(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,i=a.pending.length;a.pending=a.pending.filter(n=>{if(n.prefix!==o)return!0;const i=n.name;if(e.icons[i])a.loaded.push({provider:r,prefix:o,name:i});else{if(!e.missing.has(i))return t=!0,!0;a.missing.push({provider:r,prefix:o,name:i})}return!1}),a.pending.length!==i&&(t||Jt([e],n.id),n.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),n.abort))})}))}(e)}))}function or(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(!wt(e,t).length)return void r()}catch(e){console.error(e)}r(),rr(e)}function ar(e,n){e instanceof Promise?e.then(e=>{n(e)}).catch(()=>{n(null)}):n(e)}function ir(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 ar(e.loadIcons(r,t,n),n=>{or(e,r,n)});if(o)return void r.forEach(r=>{ar(o(r,t,n),n=>{or(e,[r],n?{prefix:t,icons:{[r]:n}}:null)})});const{valid:a,invalid:i}=function(e){const n=[],t=[];return e.forEach(e=>{(e.match(kt)?n:t).push(e)}),{valid:n,invalid:t}}(r);if(i.length&&or(e,i,null),!a.length)return;const s=t.match(kt)?Lt(n):null;if(!s)return void or(e,a,null);s.prepare(n,t,a).forEach(t=>{nr(n,t,n=>{or(e,t.icons,n)})})}))}var sr=(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,i=e.name,s=t[o]||(t[o]=Object.create(null)),l=s[a]||(s[a]=xt(o,a));let c;c=i in l.icons?n.loaded:""===a||l.missing.has(i)?n.missing:n.pending;const d={provider:o,prefix:a,name:i};c.push(d)}),n}(function(e,n=!0,t=!1){const r=[];return e.forEach(e=>{const o="string"==typeof e?Tt(e,n,t):e;o&&r.push(o)}),r}(e,!0,St()));if(!t.pending.length){let e=!0;return n&&setTimeout(()=>{e&&n(t.loaded,t.missing,t.pending,tr)}),()=>{e=!1}}const r=Object.create(null),o=[];let a,i;return t.pending.forEach(e=>{const{provider:n,prefix:t}=e;if(t===i&&n===a)return;a=n,i=t,o.push(xt(n,t));const s=r[n]||(r[n]=Object.create(null));s[t]||(s[t]=[])}),t.pending.forEach(e=>{const{provider:n,prefix:t,name:o}=e,a=xt(n,t),i=a.pendingIcons||(a.pendingIcons=new Set);i.has(o)||(i.add(o),r[n][t].push(o))}),o.forEach(e=>{const n=r[e.provider][e.prefix];n.length&&ir(e,n)}),n?function(e,n,t){const r=Xt++,o=Jt.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):tr};var lr,cr=/[\s,]+/;function dr(e,n){n.split(cr).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}function ur(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 pr(e){return void 0===lr&&function(){try{lr=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch(e){lr=null}}(),lr?lr.createHTML(e):e}var fr={..._t,inline:!1},gr={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},mr={display:"inline-block"},hr={backgroundColor:"currentColor"},yr={backgroundColor:"transparent"},br={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},vr={WebkitMask:hr,mask:hr,background:yr};for(const e in vr){const n=vr[e];for(const t in br)n[e+t]=br[t]}var xr={...fr,inline:!0};function wr(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}var kr,Tr=(e,n,t)=>{const r=n.inline?xr:fr,o=function(e,n){const t={...e};for(const e in n){const r=n[e],o=typeof r;e in Pt?(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",i={},s=n.style||{},l={..."svg"===a?gr:{}};if(t){const e=Tt(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&&dr(o,t);break;case"color":i.color=t;break;case"rotate":"string"==typeof t?o[e]=ur(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={...ut,...e},r={..._t,...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 i,s=e.rotate;switch(t?r?s+=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),s<0&&(s-=4*Math.floor(s/4)),s%=4,s){case 1:i=o.height/2+o.top,n.unshift("rotate(90 "+i.toString()+" "+i.toString()+")");break;case 2:n.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:i=o.width/2+o.left,n.unshift("rotate(-90 "+i.toString()+" "+i.toString()+")")}s%2==1&&(o.left!==o.top&&(i=o.left,o.left=o.top,o.top=i),o.width!==o.height&&(i=o.width,o.width=o.height,o.height=i)),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 i=e.indexOf(">",a);if(-1===i)break;t+=e.slice(o+1,a).trim(),e=e.slice(0,r).trim()+e.slice(i+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 i=r.width,s=r.height,l=o.width,c=o.height;let d,u;null===i?(u=null===s?"1em":"auto"===s?c:s,d=It(u,l/c)):(d="auto"===i?l:i,u=null===s?It(d,c/l):"auto"===s?c:s);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&&(i.verticalAlign="-0.125em"),"svg"===a){l.style={...i,...s},Object.assign(l,d);let e=0,t=n.id;return"string"==typeof t&&(t=t.replace(/-/g,"_")),l.dangerouslySetInnerHTML={__html:pr(Mt(c.body,t?()=>t+"ID"+e++:"iconifyReact"))},(0,lt.createElement)("svg",l)}const{body:u,width:p,height:f}=e,g="mask"===a||"bg"!==a&&-1!==u.indexOf("currentColor"),m=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 h;return l.style={...i,"--svg":(h=m,'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)}(h)+'")'),width:wr(d.width),height:wr(d.height),...mr,...g?hr:yr,...s},(0,lt.createElement)("span",l)};if(St(!0),kr=Ut,At[""]=kr,"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||""),$t&&!n&&!e.prefix){let n=!1;return bt(e)&&(e.prefix="",mt(e,(e,t)=>{jt(e,t)&&(n=!0)})),n}const t=e.prefix;return!!Ct({prefix:t,name:"a"})&&!!wt(xt(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;qt(e,r)||console.error(t)}catch(e){console.error(t)}}}}function Cr(e){const[n,t]=(0,lt.useState)(!!e.ssr),[r,o]=(0,lt.useState)({});const[a,i]=(0,lt.useState)(function(n){if(n){const n=e.icon;if("object"==typeof n)return{name:"",data:n};const t=Et(n);if(t)return{name:n,data:t}}return{name:""}}(!!e.ssr));function s(){const e=r.callback;e&&(e(),o({}))}function l(e){if(JSON.stringify(a)!==JSON.stringify(e))return s(),i(e),!0}function c(){var n;const t=e.icon;if("object"==typeof t)return void l({name:"",data:t});const r=Et(t);if(l({name:t,data:r}))if(void 0===r){const e=sr([t],c);o({callback:e})}else r&&(null===(n=e.onLoad)||void 0===n||n.call(e,t))}(0,lt.useEffect)(()=>(t(!0),s),[]),(0,lt.useEffect)(()=>{n&&c()},[e.icon,n]);const{name:d,data:u}=a;return u?Tr({...ut,...u},e,d):e.children?e.children:e.fallback?e.fallback:(0,lt.createElement)("span",{})}var $r=(0,lt.forwardRef)((e,n)=>Cr({...e,_ref:n}));(0,lt.forwardRef)((e,n)=>Cr({inline:!0,...e,_ref:n}));function Sr(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=Sr(e[n]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}var Er=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),jr="-",Pr=[],_r=e=>{const n=Ir(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return Fr(e);const t=e.split(jr),r=""===t[0]&&t.length>1?1:0;return Rr(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||Pr}return t[e]||Pr}}},Rr=(e,n,t)=>{if(0===e.length-n)return t.classGroupId;const r=e[n],o=t.nextPart.get(r);if(o){const t=Rr(e,n+1,o);if(t)return t}const a=t.validators;if(null===a)return;const i=0===n?e.join(jr):e.slice(n).join(jr),s=a.length;for(let e=0;e<s;e++){const n=a[e];if(n.validator(i))return n.classGroupId}},Fr=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})(),Ir=e=>{const{theme:n,classGroups:t}=e;return Or(t,n)},Or=(e,n)=>{const t=Er();for(const r in e){const o=e[r];Nr(o,t,r,n)}return t},Nr=(e,n,t,r)=>{const o=e.length;for(let a=0;a<o;a++){const o=e[a];Dr(o,n,t,r)}},Dr=(e,n,t,r)=>{"string"!=typeof e?"function"!=typeof e?Lr(e,n,t,r):Ar(e,n,t,r):Mr(e,n,t)},Mr=(e,n,t)=>{(""===e?n:Wr(n,e)).classGroupId=t},Ar=(e,n,t,r)=>{Vr(e)?Nr(e(r),n,t,r):(null===n.validators&&(n.validators=[]),n.validators.push(((e,n)=>({classGroupId:e,validator:n}))(t,e)))},Lr=(e,n,t,r)=>{const o=Object.entries(e),a=o.length;for(let e=0;e<a;e++){const[a,i]=o[e];Nr(i,Wr(n,a),t,r)}},Wr=(e,n)=>{let t=e;const r=n.split(jr),o=r.length;for(let e=0;e<o;e++){const n=r[e];let o=t.nextPart.get(n);o||(o=Er(),t.nextPart.set(n,o)),t=o}return t},Vr=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,Br=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)}}},zr=[],qr=(e,n,t,r,o)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:o}),Hr=e=>{const{prefix:n,experimentalParseClassName:t}=e;let r=e=>{const n=[];let t,r=0,o=0,a=0;const i=e.length;for(let s=0;s<i;s++){const i=e[s];if(0===r&&0===o){if(":"===i){n.push(e.slice(a,s)),a=s+1;continue}if("/"===i){t=s;continue}}"["===i?r++:"]"===i?r--:"("===i?o++:")"===i&&o--}const s=0===n.length?e:e.slice(a);let l=s,c=!1;s.endsWith("!")?(l=s.slice(0,-1),c=!0):s.startsWith("!")&&(l=s.slice(1),c=!0);return qr(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)):qr(zr,!1,n,void 0,!0)}if(t){const e=r;r=n=>t({className:n,parseClassName:e})}return r},Gr=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],i="["===a[0],s=n.has(a);i||s?(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}},Ur=/\s+/,Jr=e=>{if("string"==typeof e)return e;let n,t="";for(let r=0;r<e.length;r++)e[r]&&(n=Jr(e[r]))&&(t&&(t+=" "),t+=n);return t},Xr=[],Yr=e=>{const n=n=>n[e]||Xr;return n.isThemeGetter=!0,n},Kr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Zr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,eo=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,no=/\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$/,to=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ro=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ao=e=>Zr.test(e),io=e=>!!e&&!Number.isNaN(Number(e)),so=e=>!!e&&Number.isInteger(Number(e)),lo=e=>e.endsWith("%")&&io(e.slice(0,-1)),co=e=>eo.test(e),uo=()=>!0,po=e=>no.test(e)&&!to.test(e),fo=()=>!1,go=e=>ro.test(e),mo=e=>oo.test(e),ho=e=>!bo(e)&&!So(e),yo=e=>Oo(e,Ao,fo),bo=e=>Kr.test(e),vo=e=>Oo(e,Lo,po),xo=e=>Oo(e,Wo,io),wo=e=>Oo(e,Bo,uo),ko=e=>Oo(e,Vo,fo),To=e=>Oo(e,Do,fo),Co=e=>Oo(e,Mo,mo),$o=e=>Oo(e,zo,go),So=e=>Qr.test(e),Eo=e=>No(e,Lo),jo=e=>No(e,Vo),Po=e=>No(e,Do),_o=e=>No(e,Ao),Ro=e=>No(e,Mo),Fo=e=>No(e,zo,!0),Io=e=>No(e,Bo,!0),Oo=(e,n,t)=>{const r=Kr.exec(e);return!!r&&(r[1]?n(r[1]):t(r[2]))},No=(e,n,t=!1)=>{const r=Qr.exec(e);return!!r&&(r[1]?n(r[1]):t)},Do=e=>"position"===e||"percentage"===e,Mo=e=>"image"===e||"url"===e,Ao=e=>"length"===e||"size"===e||"bg-size"===e,Lo=e=>"length"===e,Wo=e=>"number"===e,Vo=e=>"family-name"===e,Bo=e=>"number"===e||"weight"===e,zo=e=>"shadow"===e,qo=((e,...n)=>{let t,r,o,a;const i=e=>{const n=r(e);if(n)return n;const a=((e,n)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:a}=n,i=[],s=e.trim().split(Ur);let l="";for(let e=s.length-1;e>=0;e-=1){const n=s[e],{isExternal:c,modifiers:d,hasImportantModifier:u,baseClassName:p,maybePostfixModifierPosition:f}=t(n);if(c){l=n+(l.length>0?" "+l:l);continue}let g=!!f,m=r(g?p.substring(0,f):p);if(!m){if(!g){l=n+(l.length>0?" "+l:l);continue}if(m=r(p),!m){l=n+(l.length>0?" "+l:l);continue}g=!1}const h=0===d.length?"":1===d.length?d[0]:a(d).join(":"),y=u?h+"!":h,b=y+m;if(i.indexOf(b)>-1)continue;i.push(b);const v=o(m,g);for(let e=0;e<v.length;++e){const n=v[e];i.push(y+n)}l=n+(l.length>0?" "+l:l)}return l})(e,t);return o(e,a),a};return a=s=>{const l=n.reduce((e,n)=>n(e),e());return t=(e=>({cache:Br(e.cacheSize),parseClassName:Hr(e),sortModifiers:Gr(e),..._r(e)}))(l),r=t.cache.get,o=t.cache.set,a=i,i(s)},(...e)=>a(((...e)=>{let n,t,r=0,o="";for(;r<e.length;)(n=e[r++])&&(t=Jr(n))&&(o&&(o+=" "),o+=t);return o})(...e))})(()=>{const e=Yr("color"),n=Yr("font"),t=Yr("text"),r=Yr("font-weight"),o=Yr("tracking"),a=Yr("leading"),i=Yr("breakpoint"),s=Yr("container"),l=Yr("spacing"),c=Yr("radius"),d=Yr("shadow"),u=Yr("inset-shadow"),p=Yr("text-shadow"),f=Yr("drop-shadow"),g=Yr("blur"),m=Yr("perspective"),h=Yr("aspect"),y=Yr("ease"),b=Yr("animate"),v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",So,bo],x=()=>[So,bo,l],w=()=>[ao,"full","auto",...x()],k=()=>[so,"none","subgrid",So,bo],T=()=>["auto",{span:["full",so,So,bo]},so,So,bo],C=()=>[so,"auto",So,bo],$=()=>["auto","min","max","fr",So,bo],S=()=>["auto",...x()],E=()=>[ao,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],j=()=>[ao,"screen","full","dvw","lvw","svw","min","max","fit",...x()],P=()=>[ao,"screen","full","lh","dvh","lvh","svh","min","max","fit",...x()],_=()=>[e,So,bo],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Po,To,{position:[So,bo]}],F=()=>["auto","cover","contain",_o,yo,{size:[So,bo]}],I=()=>[lo,Eo,vo],O=()=>["","none","full",c,So,bo],N=()=>["",io,Eo,vo],D=()=>[io,lo,Po,To],M=()=>["","none",g,So,bo],A=()=>["none",io,So,bo],L=()=>["none",io,So,bo],W=()=>[io,So,bo],V=()=>[ao,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[co],breakpoint:[co],color:[uo],container:[co],"drop-shadow":[co],ease:["in","out","in-out"],font:[ho],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[co],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[co],shadow:[co],spacing:["px",io],text:[co],"text-shadow":[co],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ao,bo,So,h]}],container:["container"],columns:[{columns:[io,bo,So,s]}],"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:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[so,"auto",So,bo]}],basis:[{basis:[ao,"full","auto",s,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[io,ao,"auto","initial","none",bo]}],grow:[{grow:["",io,So,bo]}],shrink:[{shrink:["",io,So,bo]}],order:[{order:[so,"first","last","none",So,bo]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:T()}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:T()}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"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:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pbs:[{pbs:x()}],pbe:[{pbe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:S()}],mx:[{mx:S()}],my:[{my:S()}],ms:[{ms:S()}],me:[{me:S()}],mbs:[{mbs:S()}],mbe:[{mbe:S()}],mt:[{mt:S()}],mr:[{mr:S()}],mb:[{mb:S()}],ml:[{ml:S()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:E()}],"inline-size":[{inline:["auto",...j()]}],"min-inline-size":[{"min-inline":["auto",...j()]}],"max-inline-size":[{"max-inline":["none",...j()]}],"block-size":[{block:["auto",...P()]}],"min-block-size":[{"min-block":["auto",...P()]}],"max-block-size":[{"max-block":["none",...P()]}],w:[{w:[s,"screen",...E()]}],"min-w":[{"min-w":[s,"screen","none",...E()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[i]},...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,Eo,vo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Io,wo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lo,bo]}],"font-family":[{font:[jo,ko,n]}],"font-features":[{"font-features":[bo]}],"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,So,bo]}],"line-clamp":[{"line-clamp":[io,"none",So,xo]}],leading:[{leading:[a,...x()]}],"list-image":[{"list-image":["none",So,bo]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",So,bo]}],"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:[io,"from-font","auto",So,vo]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[io,"auto",So,bo]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",So,bo]}],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",So,bo]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"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"]},so,So,bo],radial:["",So,bo],conic:[so,So,bo]},Ro,Co]}],"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:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:N()}],"border-w-x":[{"border-x":N()}],"border-w-y":[{"border-y":N()}],"border-w-s":[{"border-s":N()}],"border-w-e":[{"border-e":N()}],"border-w-bs":[{"border-bs":N()}],"border-w-be":[{"border-be":N()}],"border-w-t":[{"border-t":N()}],"border-w-r":[{"border-r":N()}],"border-w-b":[{"border-b":N()}],"border-w-l":[{"border-l":N()}],"divide-x":[{"divide-x":N()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":N()}],"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":[io,So,bo]}],"outline-w":[{outline:["",io,Eo,vo]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",d,Fo,$o]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",u,Fo,$o]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[io,vo]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":N()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",p,Fo,$o]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[io,So,bo]}],"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":[io]}],"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":[So,bo]}],"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":[io]}],"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:R()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",So,bo]}],filter:[{filter:["","none",So,bo]}],blur:[{blur:M()}],brightness:[{brightness:[io,So,bo]}],contrast:[{contrast:[io,So,bo]}],"drop-shadow":[{"drop-shadow":["","none",f,Fo,$o]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",io,So,bo]}],"hue-rotate":[{"hue-rotate":[io,So,bo]}],invert:[{invert:["",io,So,bo]}],saturate:[{saturate:[io,So,bo]}],sepia:[{sepia:["",io,So,bo]}],"backdrop-filter":[{"backdrop-filter":["","none",So,bo]}],"backdrop-blur":[{"backdrop-blur":M()}],"backdrop-brightness":[{"backdrop-brightness":[io,So,bo]}],"backdrop-contrast":[{"backdrop-contrast":[io,So,bo]}],"backdrop-grayscale":[{"backdrop-grayscale":["",io,So,bo]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[io,So,bo]}],"backdrop-invert":[{"backdrop-invert":["",io,So,bo]}],"backdrop-opacity":[{"backdrop-opacity":[io,So,bo]}],"backdrop-saturate":[{"backdrop-saturate":[io,So,bo]}],"backdrop-sepia":[{"backdrop-sepia":["",io,So,bo]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",So,bo]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[io,"initial",So,bo]}],ease:[{ease:["linear","initial",y,So,bo]}],delay:[{delay:[io,So,bo]}],animate:[{animate:["none",b,So,bo]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,So,bo]}],"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:W()}],"skew-x":[{"skew-x":W()}],"skew-y":[{"skew-y":W()}],transform:[{transform:[So,bo,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:V()}],"translate-x":[{"translate-x":V()}],"translate-y":[{"translate-y":V()}],"translate-z":[{"translate-z":V()}],"translate-none":["translate-none"],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",So,bo]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mbs":[{"scroll-mbs":x()}],"scroll-mbe":[{"scroll-mbe":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pbs":[{"scroll-pbs":x()}],"scroll-pbe":[{"scroll-pbe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"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",So,bo]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[io,Eo,vo,xo]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Ho(...e){return qo(function(){for(var e,n,t=0,r="",o=arguments.length;t<o;t++)(e=arguments[t])&&(n=Sr(e))&&(r&&(r+=" "),r+=n);return r}(e))}var Go=require("react/jsx-runtime");function Uo({sources:e,center:n,centerTitle:t,destinations:r,arrowRight:o=(0,Go.jsx)($r,{icon:"mdi:arrow-right"}),arrowDown:a=(0,Go.jsx)($r,{icon:"mdi:arrow-down"}),className:i}){return(0,Go.jsx)("div",{className:Ho("elb-architecture-flow",i),children:(0,Go.jsxs)("div",{className:"elb-architecture-flow__grid",children:[(0,Go.jsx)("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--desktop",children:e.title}),(0,Go.jsx)("div",{className:"elb-architecture-flow__spacer"}),(0,Go.jsx)("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--desktop",children:t}),(0,Go.jsx)("div",{className:"elb-architecture-flow__spacer"}),(0,Go.jsx)("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--desktop",children:r.title}),(0,Go.jsxs)("div",{className:"elb-architecture-flow__column",children:[(0,Go.jsx)("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--mobile",children:e.title}),(0,Go.jsx)("div",{className:"elb-architecture-flow__sections",children:e.sections.map(e=>(0,Go.jsx)(Jo,{section:e},e.title))})]}),(0,Go.jsx)("div",{className:"elb-architecture-flow__arrow elb-architecture-flow__arrow--desktop",children:o}),(0,Go.jsx)("div",{className:"elb-architecture-flow__arrow elb-architecture-flow__arrow--mobile",children:a}),(0,Go.jsxs)("div",{className:"elb-architecture-flow__center",children:[(0,Go.jsx)("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--mobile",children:t}),(0,Go.jsx)("div",{className:"elb-architecture-flow__center-content",children:n})]}),(0,Go.jsx)("div",{className:"elb-architecture-flow__arrow elb-architecture-flow__arrow--desktop",children:o}),(0,Go.jsx)("div",{className:"elb-architecture-flow__arrow elb-architecture-flow__arrow--mobile",children:a}),(0,Go.jsxs)("div",{className:"elb-architecture-flow__column",children:[(0,Go.jsx)("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--mobile",children:r.title}),(0,Go.jsx)("div",{className:"elb-architecture-flow__sections",children:r.sections.map(e=>(0,Go.jsx)(Jo,{section:e},e.title))})]})]})})}function Jo({section:e}){return(0,Go.jsxs)("div",{className:"elb-architecture-flow__section",children:[(0,Go.jsx)("span",{className:"elb-architecture-flow__section-title",children:e.title}),(0,Go.jsxs)("div",{className:"elb-architecture-flow__items",children:[e.items.map(e=>{const n=(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)("span",{className:"elb-architecture-flow__item-icon",children:e.icon}),(0,Go.jsx)("span",{className:"elb-architecture-flow__item-label",children:e.label})]});return e.link?(0,Go.jsx)("a",{href:e.link,className:"elb-architecture-flow__item elb-architecture-flow__item--link",children:n},e.label):(0,Go.jsx)("div",{className:"elb-architecture-flow__item",children:n},e.label)}),e.moreLink?(0,Go.jsx)("a",{href:e.moreLink,className:"elb-architecture-flow__more elb-architecture-flow__more--link",children:"and more…"}):(0,Go.jsx)("span",{className:"elb-architecture-flow__more",children:"and more…"})]})]})}var Xo=require("react"),Yo=require("react"),Ko=require("@monaco-editor/react"),Qo=require("react/jsx-runtime"),Zo={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 ea({original:e,modified:n,language:t="json",height:r="100%",renderSideBySide:o=!0,onSummaryChange:a,beforeMount:i,onMount:s,className:l}){const c=(0,Yo.useRef)(null),d=(0,Yo.useRef)(null),u=(0,Yo.useRef)([]),p=(0,Yo.useRef)(a);p.current=a;const[f,g]=(0,Yo.useState)(ye);(0,Yo.useEffect)(()=>{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?he:ye)};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)}},[]),(0,Yo.useEffect)(()=>{d.current?.updateOptions({renderSideBySide:o})},[o]);const m=(0,Yo.useCallback)(e=>{Ne(e),i?.(e)},[i]),h=(0,Yo.useCallback)((e,n)=>{d.current=e,u.current.push(Le(e.getOriginalEditor())),u.current.push(Le(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()),s?.(e)},[s]);(0,Yo.useEffect)(()=>()=>{for(const e of u.current)try{e()}catch{}u.current=[]},[]);const y=(0,Yo.useMemo)(()=>({...Zo,renderSideBySide:o}),[o]);return(0,Qo.jsx)("div",{ref:c,className:l,style:{height:"100%",width:"100%"},children:(0,Qo.jsx)(Ko.DiffEditor,{language:t,original:e,modified:n,theme:f,height:r,options:y,beforeMount:m,onMount:h})})}var na=require("react/jsx-runtime"),ta={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};function ra({summary:e}){return(0,na.jsxs)("div",{className:"flex items-center gap-1.5 text-xs font-medium tabular-nums",children:[(0,na.jsxs)("span",{className:"text-green-600 dark:text-green-400",children:["+",e.added]}),(0,na.jsxs)("span",{className:"text-red-600 dark:text-red-400",children:["-",e.deleted]}),(0,na.jsxs)("span",{className:"text-zinc-500 dark:text-zinc-400",children:["~",e.modified]})]})}function oa({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(0,na.jsxs)("div",{className:"flex rounded bg-zinc-100 p-0.5 dark:bg-zinc-800","aria-label":"Diff view mode",children:[(0,na.jsx)("button",{type:"button",className:`${t} ${"split"===e?r:o}`,"aria-pressed":"split"===e,onClick:()=>n("split"),children:"Split"}),(0,na.jsx)("button",{type:"button",className:`${t} ${"inline"===e?r:o}`,"aria-pressed":"inline"===e,onClick:()=>n("inline"),children:"Inline"})]})}function aa({value:e}){const[n,t]=(0,Xo.useState)("idle"),r=(0,Xo.useRef)(null);(0,Xo.useEffect)(()=>()=>{null!==r.current&&window.clearTimeout(r.current)},[]);const o="copied"===n?"Copied!":"failed"===n?"Copy failed":"Copy modified to clipboard";return(0,na.jsxs)("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:[(0,na.jsx)("span",{className:"sr-only","aria-live":"polite",children:"idle"!==n?o:""}),"copied"===n?(0,na.jsx)("svg",{...ta,children:(0,na.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,na.jsxs)("svg",{...ta,children:[(0,na.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,na.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})]})}function ia({original:e,modified:n,language:t="json",label:r,header:o,showHeader:a=!0,showTrafficLights:i=!1,showCopy:s=!0,showViewToggle:l=!0,showSummary:c=!1,defaultView:d="split",footer:u,height:p,style:f,className:g,onMount:m}){const[h,y]=(0,Xo.useState)(d),[b,v]=(0,Xo.useState)({added:0,deleted:0,modified:0}),x=(0,Xo.useCallback)(e=>v(e),[]),w=o??r??"Diff",k=(0,na.jsxs)("div",{className:"flex items-center gap-2",children:[c&&(0,na.jsx)(ra,{summary:b}),l&&(0,na.jsx)(oa,{view:h,onChange:y}),s&&(0,na.jsx)(aa,{value:n})]});return(0,na.jsx)(re,{header:w,headerActions:k,showHeader:a,showTrafficLights:i,footer:u,height:p,style:f,className:g,children:(0,na.jsx)(ea,{original:e,modified:n,language:t,renderSideBySide:"split"===h,onSummaryChange:x,onMount:m})})}var sa=require("react"),la=require("react/jsx-runtime");function ca(e){const{code:n,language:t="javascript",className:r,disabled:o=!0,showCopy:a=!0,autoHeight:i={min:20,max:600},fontSize:s=15,format:l=!0,...c}=e,d=`elb-code-snippet ${r||""}`.trim(),[u,p]=(0,sa.useState)(n);return(0,sa.useEffect)(()=>{l&&n?et(n,t).then(p):p(n)},[n,t,l]),(0,la.jsx)(Mn,{...c,code:u,language:t,className:d,showHeader:!1,disabled:o,showCopy:a,autoHeight:i,fontSize:s})}var da=p(require("react"),1),ua=p(require("roughjs"),1),pa=require("react/jsx-runtime");function fa({x:e,y:n,width:t,height:r,fill:o,stroke:a}){const i=(0,da.useRef)(null);return(0,da.useEffect)(()=>{if(!i.current)return;const s=i.current.ownerSVGElement;if(!s)return;i.current.replaceChildren();const l=ua.default.svg(s),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 i.current.appendChild(d),()=>{i.current?.replaceChildren()}},[e,n,t,r,o,a]),(0,pa.jsx)("g",{ref:i})}function ga({cx:e,cy:n,diameter:t,fill:r,stroke:o}){const a=(0,da.useRef)(null);return(0,da.useEffect)(()=>{if(!a.current)return;const i=a.current.ownerSVGElement;if(!i)return;a.current.replaceChildren();const s=ua.default.svg(i).circle(e,n,t,{fill:r,fillStyle:"solid",stroke:o,strokeWidth:1.5,roughness:.8});return a.current.appendChild(s),()=>{a.current?.replaceChildren()}},[e,n,t,r,o]),(0,pa.jsx)("g",{ref:a})}function ma({x:e,y:n,text:t}){return(0,pa.jsxs)("g",{children:[(0,pa.jsx)(ga,{cx:e,cy:n,diameter:Pa,fill:"var(--flow-marker-fill, #dc2626)",stroke:"var(--flow-marker-stroke, #991b1b)"}),(0,pa.jsx)("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 ha({fromX:e,fromY:n,toX:t,toY:r,stroke:o,arrowSize:a=8,centerY:i}){const s=(0,da.useRef)(null);return(0,da.useEffect)(()=>{if(!s.current)return;const l=s.current.ownerSVGElement;if(!l)return;s.current.replaceChildren();const c=ua.default.svg(l),d=o,u=t-e,p=r-n,f=Math.sqrt(u*u+p*p),g=(e+t)/2,m=(n+r)/2;let h,y;if(Math.abs(p)<2)h=g,y=m-Math.min(.08*f,12);else if(void 0!==i){const t=Math.abs(n-i),o=Math.abs(r-i);h=e+.5*u,y=t>=o?n<i?m-.3*Math.abs(p):m+.3*Math.abs(p):r<i?m-.3*Math.abs(p):m+.3*Math.abs(p)}else h=e+.5*u,y=p>0?n-.3*Math.abs(p):n+.3*Math.abs(p);const b=t-h,v=r-y,x=Math.atan2(v,b),w=t-Math.cos(x)*a,k=r-Math.sin(x)*a,T=`M ${e} ${n} Q ${h} ${y} ${w} ${k}`,C=c.path(T,{stroke:d,strokeWidth:1.5,roughness:.8,fill:"none"});s.current.appendChild(C);const $=Math.PI/6,S=w-8*Math.cos(x-$),E=k-8*Math.sin(x-$),j=c.line(w,k,S,E,{stroke:d,strokeWidth:1.5,roughness:.5});s.current.appendChild(j);const P=w-8*Math.cos(x+$),_=k-8*Math.sin(x+$),R=c.line(w,k,P,_,{stroke:d,strokeWidth:1.5,roughness:.5});return s.current.appendChild(R),()=>{s.current?.replaceChildren()}},[e,n,t,r,o,a,i]),(0,pa.jsx)("g",{ref:s})}var ya={labelSize:13,labelWeight:"600",textSize:12,textWeight:"normal",boxHeight:50,descriptionSize:13},ba=120,va=50,xa=12,wa=8,ka=8,Ta=25,Ca=30,$a=6;function Sa(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 Ea(e,n){if(!e)return[];const t=new Set;for(const r of n){if(!r||!e[r])continue;Sa(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]),Sa(e,o)}function ja(e,n){if(!e)return n.length;const t=n.findIndex(n=>n.name===e);return t>=0?t:n.length}var Pa=16,_a=4;function Ra({stageBefore:e,sources:n,preTransformers:t,collector:r,postTransformers:o,destinations:a,stageAfter:i,title:s,layout:l=ya,boxHeight:c,descriptionHeight:d,markers:u,className:p,withReturn:f}){const g=Object.entries(n??{default:{}}),m=Object.entries(a??{default:{}}),h=g.map(([,e])=>e.next),y=Ea(t,h),b=m.map(([,e])=>e.before),v=Ea(o,b),x=[...g].sort(([,e],[,n])=>ja(e.next,y)-ja(n.next,y)),w=[...m].sort(([,e],[,n])=>ja(e.before,v)-ja(n.before,v)),k=(0,da.useRef)(null),T=e?.description||g.some(([,e])=>e.description)||y.some(e=>e.config.description)||r?.description||v.some(e=>e.config.description)||m.some(([,e])=>e.description)||i?.description||m.some(([,e])=>e.after?.description),C=!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)||m.some(([,e])=>!1!==e.link)||!1!==i?.link||m.some(([,e])=>!1!==e.after?.link),$=["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"],S=u?.some(e=>{return n=e.position,!!$.includes(n)||/^(source|destination|pre|post)-[^-]+(-left|-right)?$/.test(n);var n})??!1?Pa/2+_a:0,E=u?.filter(e=>e.text)??[],j=E.reduce((e,n)=>e+(n.text?.length??0),0),P=Math.max(1,Math.ceil(j/70)),_=E.length>0?18*P+8:0,R=c??l.boxHeight,F=d??30,I=T||C?F+10:0,O=Math.max(g.length,m.length,1),N=R*O+xa*(O-1),D=i||m.some(([,e])=>e.after),M=function(e,n,t){return(n?0:Ta)+ba*e+va*(e-1)+(t?0:Ta)}(1+(e?1:0)+y.length+1+v.length+1+(D?1:0),!!e,!!D),A=2*ka+N+I+S+_,L=s?A+Ca:A,W=(s?Ca:0)+ka+S,V=W+N/2,B=(e,n)=>V-(R*n+xa*(n-1))/2+e*(R+xa);let z=e?0:Ta;const q={},H=[],G=[];e&&(q.before={x:z,y:V-R/2,width:ba,height:R},z+=ba+va);const U=z;x.forEach(([e],n)=>{const t={x:U,y:B(n,x.length),width:ba,height:R};H.push({name:e,pos:t}),q[`source-${e}`]=t}),H.length>0&&(q.source=H[0].pos),z+=ba+va;const J=[],X=new Map;x.forEach(([e,n])=>{const t=n.next;if(t){const n=X.get(t)??[];n.push(e),X.set(t,n)}}),y.forEach(({name:e,config:n})=>{if(n.next){X.get(e);const t=X.get(n.next)??[];X.set(n.next,[...new Set([...t,`chain:${e}`])])}}),y.forEach(({name:e})=>{const n=X.get(e)??[],t=n.filter(e=>!e.startsWith("chain:")),r=n.some(e=>e.startsWith("chain:"));let o;if(1!==t.length||r)o=V-R/2;else{const e=q[`source-${t[0]}`];o=e?e.y:V-R/2}const a={x:z,y:o,width:ba,height:R};J.push({name:e,pos:a}),q[`pre-${e}`]=a,z+=ba+va}),q.collector={x:z,y:V-R/2,width:ba,height:R},z+=ba+va;const Y=[],K=new Map;w.forEach(([e,n])=>{const t=n.before;if(t){const n=K.get(t)??[];n.push(e),K.set(t,n)}});for(let e=v.length-1;e>=0;e--){const{name:n,config:t}=v[e];if(t.next){K.get(t.next);const e=K.get(n)??[];K.set(n,[...new Set([...e,`chain:${t.next}`])])}}const Q=z+v.length*(ba+va);w.forEach(([e],n)=>{const t={x:Q,y:B(n,w.length),width:ba,height:R};G.push({name:e,pos:t}),q[`destination-${e}`]=t}),G.length>0&&(q.destination=G[0].pos),v.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)if(t.length>1&&!r){const e=t.map(e=>q[`destination-${e}`]?.y).filter(e=>void 0!==e);if(e.length>0){o=e.reduce((e,n)=>e+n,0)/e.length}else o=V-R/2}else o=V-R/2;else{const e=q[`destination-${t[0]}`];o=e?e.y:V-R/2}const a={x:z,y:o,width:ba,height:R};Y.push({name:e,pos:a}),q[`post-${e}`]=a,z+=ba+va});const Z=[];if(D){const e=z+ba+va;w.forEach(([n,t],r)=>{const o=t.after??i;if(o){const t={x:e,y:B(r,w.length),width:ba,height:R};Z.push({name:n,pos:t,config:o}),q[`after-${n}`]=t}}),Z.length>0&&(q.after=Z[0].pos)}const ee=V,ne=[...e?[{key:"before",config:e,fillVar:"--flow-before-fill",strokeVar:"--flow-before-stroke",defaultLabel:"Before",defaultLink:void 0}]:[],...x.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"})),...w.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(0,pa.jsx)("div",{ref:k,className:`elb-explorer elb-flow-map ${p||""}`,style:{width:"100%",maxWidth:M},children:(0,pa.jsxs)("svg",{viewBox:`0 0 ${M} ${L}`,style:{width:"100%",height:"auto",display:"block"},children:[s&&(0,pa.jsx)("text",{x:M/2,y:18,textAnchor:"middle",dominantBaseline:"middle",fill:"var(--color-text, #f3f4f6)",fontSize:14,fontWeight:600,fontFamily:"system-ui, -apple-system, sans-serif",children:s}),(()=>{const r=q.collector,i=r.y+R/2;return(0,pa.jsxs)(pa.Fragment,{children:[!e&&1===g.length&&(0,pa.jsx)(ha,{fromX:0,fromY:ee,toX:q.source.x,toY:ee,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),e&&(0,pa.jsx)(ha,{fromX:q.before.x+ba,fromY:ee,toX:q.source.x,toY:q.source.y+R/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]??{},i=a.next?`pre-${a.next}`:y.length>0?`pre-${y[0].name}`:"collector",s=e.get(i)??[];s.push({name:t,pos:r,sortIndex:o}),e.set(i,s)}),H.map(({name:o,pos:a})=>{const i=n?.[o]??{},s=((e,n)=>n.next&&t?.[n.next]?q[`pre-${n.next}`]:y.length>0?q[`pre-${y[0].name}`]:r)(0,i),l=a.y+R/2,c=s.y+R/2,d=i.next?`pre-${i.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*R,12*(n-1));return t-r/2+e*(r/(n-1))})(u.findIndex(e=>e.name===o),u.length,c),g=f?$a:0;return(0,pa.jsxs)(da.default.Fragment,{children:[(0,pa.jsx)(ha,{fromX:a.x+ba,fromY:l-g,toX:s.x,toY:p-g,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),f&&(0,pa.jsx)(ha,{fromX:s.x,fromY:p+g,toX:a.x+ba,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 i;i=a.next&&t?.[a.next]?q[`pre-${a.next}`]:r;const s=n.y+R/2,l=i.y+R/2,c=f?$a:0;return(0,pa.jsxs)(da.default.Fragment,{children:[(0,pa.jsx)(ha,{fromX:n.x+ba,fromY:s-c,toX:i.x,toY:l-c,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),f&&(0,pa.jsx)(ha,{fromX:i.x,fromY:l+c,toX:n.x+ba,toY:s+c,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]},`pre-${e}-chain`)}),G.map(({name:e,pos:n})=>{const t=((e,n)=>n.before&&o?.[n.before]?q[`post-${n.before}`]:r)(0,a?.[e]??{}),i=n.y+R/2,s=t.y+R/2,l=f?$a:0;return(0,pa.jsxs)(da.default.Fragment,{children:[(0,pa.jsx)(ha,{fromX:t.x+ba,fromY:s-l,toX:n.x,toY:i-l,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),f&&(0,pa.jsx)(ha,{fromX:n.x,fromY:i+l,toX:t.x+ba,toY:s+l,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]},`destination-${e}-arrows`)}),Y.slice(0,-1).map(({name:e,pos:n},t)=>{const r=Y[t+1];if(!r)return null;const o=r.pos,a=n.y+R/2,i=o.y+R/2,s=f?$a:0;return(0,pa.jsxs)(da.default.Fragment,{children:[(0,pa.jsx)(ha,{fromX:n.x+ba,fromY:a-s,toX:o.x,toY:i-s,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),f&&(0,pa.jsx)(ha,{fromX:o.x,fromY:i+s,toX:n.x+ba,toY:a+s,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]},`post-${e}-chain`)}),v.length>0&&(()=>{const e=q[`post-${v[0].name}`],n=i,t=e.y+R/2,o=f?$a:0;return(0,pa.jsxs)(pa.Fragment,{children:[(0,pa.jsx)(ha,{fromX:r.x+ba,fromY:n-o,toX:e.x,toY:t-o,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),f&&(0,pa.jsx)(ha,{fromX:e.x,fromY:t+o,toX:r.x+ba,toY:n+o,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]})})(),Z.map(({name:e,pos:n})=>{const t=q[`destination-${e}`];if(!t)return null;const r=t.y+R/2,o=n.y+R/2;return(0,pa.jsx)(ha,{fromX:t.x+ba,fromY:r,toX:n.x,toY:o,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee},`dest-${e}-after`)}),!D&&1===m.length&&(0,pa.jsx)(ha,{fromX:q.destination.x+ba,fromY:ee,toX:M,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 i=q[e],s=n?.icon,c=n?.label||o,d=n?.text,u=n?.description,p=n?.link,f=!1!==n?.highlight,g=d?i.y+.28*i.height:i.y+i.height/2,m=!1===p?null:"string"==typeof p?p:a,h=(0,pa.jsxs)(pa.Fragment,{children:[(0,pa.jsx)(fa,{x:i.x,y:i.y,width:i.width,height:i.height,fill:`var(${t}, #6b7280)`,stroke:f?`var(${r}, #6b7280)`:"var(--flow-edge-stroke, #9ca3af)"}),(0,pa.jsx)("foreignObject",{x:i.x+4,y:g-l.labelSize/2-2,width:i.width-8,height:l.labelSize+4,children:(0,pa.jsxs)("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:[s&&(0,pa.jsx)($r,{icon:s,width:14,height:14}),(0,pa.jsx)("span",{children:c})]})}),d&&(0,pa.jsx)("foreignObject",{x:i.x+4,y:i.y+.34*i.height,width:i.width-8,height:.62*i.height,children:(0,pa.jsx)("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&&(0,pa.jsx)("foreignObject",{x:i.x,y:i.y+i.height+8,width:ba,height:F,children:(0,pa.jsx)("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 m?(0,pa.jsx)("a",{href:m,style:{cursor:"pointer",textDecoration:"none"},children:h},e):(0,pa.jsx)("g",{children:h},e)}),u?.map((e,n)=>{const t=function(e,n,t,r){const o=n.source,a=n.collector,i=n.destination,s=n.before,l=n.after,c=(e,n)=>e?"-left"===n?{x:e.x+_a,y:e.y-_a}:{x:e.x+e.width-_a,y:e.y-_a}:null,d=e=>{if(!e)return null;const n=e.y+e.height/2;return{x:e.x+e.width+va/2-6,y:n+Pa/2+4}};switch(e){case"stage-before":case"stage-before-right":return c(s);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(i);case"destination-left":return c(i,"-left");case"stage-after":case"stage-after-left":return c(l,"-left");case"incoming":return{x:Ta/2,y:t+Pa/2+8};case"outgoing":return{x:r-Ta/2,y:t+Pa/2+8};case"before-source":return d(s);case"source-collector":return d(o);case"collector-destination":case"collector-post":return d(a);case"destination-after":return d(i);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 i=e.match(/^post-([^-]+)(-left|-right)?$/);if(i){const e=i[1],t=i[2];return c(n[`post-${e}`],t)}const s=e.match(/^source-([^-]+)-pre$/);if(s)return d(n[`source-${s[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,q,ee,M);if(!t)return null;const r=e.id??String(n+1);return(0,pa.jsx)(ma,{x:t.x,y:t.y,text:r},`marker-${n}`)}),E.length>0&&(0,pa.jsx)("foreignObject",{x:wa,y:W+N+I+4,width:M-2*wa,height:18*P,children:(0,pa.jsx)("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(0,pa.jsxs)("span",{children:[(0,pa.jsx)("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}),(0,pa.jsx)("span",{style:{marginRight:10},children:e.text})]},`legend-${n}`)})})})]})})}var Fa=require("react"),Ia=require("react/jsx-runtime"),Oa={"Mapping.Value":"/docs/mapping/value","Mapping.Rule":"/docs/mapping/rule","WalkerOS.Consent":"/docs/guides/consent"};function Na(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 Da(e,n){const t=e=>{const t=Na(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:Oa[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 Ma({property:e,isOpen:n,onClose:t}){if(!n||!e)return null;return(0,Ia.jsx)("div",{className:"elb-property-table__modal-backdrop",onClick:e=>{e.target===e.currentTarget&&t()},children:(0,Ia.jsxs)("div",{className:"elb-property-table__modal-content",children:[(0,Ia.jsxs)("div",{className:"elb-property-table__modal-header",children:[(0,Ia.jsxs)("h3",{className:"elb-property-table__modal-title",children:[(0,Ia.jsx)("code",{className:"elb-property-table__modal-property-name",children:e.name}),e.required&&(0,Ia.jsx)("span",{className:"elb-property-table__required-icon",children:"*"})]}),(0,Ia.jsx)("button",{className:"elb-property-table__close-button",onClick:t,"aria-label":"Close",children:(0,Ia.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ia.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,Ia.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),(0,Ia.jsxs)("div",{className:"elb-property-table__modal-body",children:[(0,Ia.jsxs)("div",{className:"elb-property-table__modal-row",children:[(0,Ia.jsx)("span",{className:"elb-property-table__modal-label",children:"Type:"}),(0,Ia.jsx)("code",{className:"elb-property-table__modal-type elb-property-table__modal-type--wrap",children:e.type})]}),e.description&&(0,Ia.jsxs)("div",{className:"elb-property-table__modal-row",children:[(0,Ia.jsx)("span",{className:"elb-property-table__modal-label",children:"Description:"}),(0,Ia.jsx)("p",{className:"elb-property-table__modal-description",children:e.description})]}),e.default&&(0,Ia.jsxs)("div",{className:"elb-property-table__modal-row",children:[(0,Ia.jsx)("span",{className:"elb-property-table__modal-label",children:"Default:"}),(0,Ia.jsx)("code",{className:"elb-property-table__modal-default",children:e.default})]}),e.example&&(0,Ia.jsxs)("div",{className:"elb-property-table__modal-row",children:[(0,Ia.jsx)("span",{className:"elb-property-table__modal-label",children:"Example:"}),(0,Ia.jsx)("code",{className:"elb-property-table__modal-example",children:e.example})]})]})]})})}function Aa(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?(0,Ia.jsx)("a",{href:t,className:"elb-property-table__type-link",children:e},n):(0,Ia.jsx)("span",{children:e},n)}return(0,Ia.jsx)("span",{children:e},n)})}function La({schema:e,className:n,emptyMessage:t}){const[r,o]=(0,Fa.useState)(null),[a,i]=(0,Fa.useState)(!1),s=function(e){const n=[],t=e;let r=e;if(Array.isArray(r.allOf)&&1===r.allOf.length&&"string"==typeof r.allOf[0].$ref){const e=Na(r.allOf[0].$ref,t);e&&(r=e)}const o=r.required||[];if(!r.properties)return n;for(const[e,a]of Object.entries(r.properties)){const r=a,i=Da(r,t);let s,l;if(i)s=i.type,l=i.typeRefs;else{if(s=r.type||"any",r.enum&&(s=r.enum.map(e=>`'${e}'`).join(" | ")),"array"===s&&r.items){const e=r.items;s=e.enum?`Array<${e.enum.map(e=>`'${e}'`).join(" | ")}>`:`Array<${e.type||"any"}>`}"object"===s&&r.additionalProperties&&(s=`Record<string, ${r.additionalProperties.type||"any"}>`),(r.anyOf||r.oneOf)&&(s=(r.anyOf||r.oneOf).map(e=>e.type||"any").join(" | "))}let c,d=r.description||"";const u=d.match(/\(like\s+(.+?)\)$/);u&&(c=u[1],d=d.replace(/\s*\(like\s+.+?\)$/,"")),"any"===s&&d.toLowerCase().includes("function")&&(s="function"),n.push({name:e,type:s,typeRefs:l,description:d,required:o.includes(e),default:void 0!==r.default?String(r.default):void 0,example:c})}return n}(e);if(0===s.length)return(0,Ia.jsx)("div",{className:`elb-explorer elb-property-table__empty ${n||""}`,role:"note",children:t??"No specific properties available."});const l=s.some(e=>e.required),c=e=>e.length<=30?e:e.slice(0,30),d=e=>{o(e),i(!0)};return(0,Ia.jsxs)("div",{className:`elb-explorer ${n||""}`,children:[(0,Ia.jsx)("div",{className:"elb-property-table__container",children:(0,Ia.jsxs)("table",{className:"elb-property-table",children:[(0,Ia.jsx)("thead",{children:(0,Ia.jsxs)("tr",{children:[(0,Ia.jsx)("th",{children:"Property"}),(0,Ia.jsx)("th",{children:"Type"}),(0,Ia.jsx)("th",{children:"Description"}),(0,Ia.jsx)("th",{children:"More"})]})}),(0,Ia.jsx)("tbody",{children:s.map((e,n)=>{return(0,Ia.jsxs)("tr",{children:[(0,Ia.jsx)("td",{className:"elb-property-table__property-cell","data-label":"Property",children:(0,Ia.jsxs)("code",{className:"elb-property-table__property-name",children:[e.name,e.required&&(0,Ia.jsx)("span",{className:"elb-property-table__required-icon",children:"*"})]})}),(0,Ia.jsx)("td",{className:"elb-property-table__type-cell","data-label":"Type",children:e.typeRefs&&e.typeRefs.length>0?(0,Ia.jsx)("code",{className:"elb-property-table__property-type",children:Aa(e.type,e.typeRefs)}):(t=e.type,t.length>30?(0,Ia.jsx)("button",{className:"elb-property-table__type-button",onClick:()=>d(e),"aria-label":`View full type for ${e.name}`,children:(0,Ia.jsx)("code",{className:"elb-property-table__property-type elb-property-table__property-type--truncated",children:c(e.type)})}):(0,Ia.jsx)("code",{className:"elb-property-table__property-type",children:e.type}))}),(0,Ia.jsx)("td",{className:"elb-property-table__description","data-label":"Description",children:e.description}),(0,Ia.jsx)("td",{className:"elb-property-table__action-cell","data-label":"More",children:(0,Ia.jsx)("button",{className:"elb-property-table__more-button",onClick:()=>d(e),"aria-label":`More info about ${e.name}`,children:(0,Ia.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Ia.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Ia.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,Ia.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})})})]},n);var t})})]})}),l&&(0,Ia.jsxs)("div",{className:"elb-property-table__required-notice",children:[(0,Ia.jsx)("span",{className:"elb-property-table__required-icon",children:"*"})," Required fields"]}),(0,Ia.jsx)(Ma,{property:r,isOpen:a,onClose:()=>{i(!1),o(null)}})]})}var Wa=require("react/jsx-runtime");function Va({trigger:e,isOpen:n,onToggle:t,children:r,align:o="left",ariaLabel:a,className:i=""}){return(0,Wa.jsxs)("div",{className:`elb-dropdown ${i}`.trim(),children:[(0,Wa.jsx)("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&&(0,Wa.jsx)("div",{className:`elb-dropdown__panel elb-dropdown__panel--${o}`,role:"menu",children:r})]})}function Ba({children:e,onClick:n,disabled:t=!1,variant:r="default",className:o=""}){return(0,Wa.jsx)("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 za({className:e=""}){return(0,Wa.jsx)("div",{className:`elb-dropdown__divider ${e}`.trim(),role:"separator"})}var qa=require("react"),Ha=require("react"),Ga=require("shiki");function Ua(e){if(e)return e.startsWith("#")?e:`#${e}`}function Ja(e,n){const t=e.rules.map(e=>{const n={},t=Ua(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=Ua(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 i=r["editor.foreground"]??n.defaultForeground??("dark"===n.type?"#bfc7d5":"#24292E"),s=[{settings:{foreground:i,background:o}},...t];return{name:n.name,type:n.type,bg:o,fg:i,colors:{...r,"editor.background":o,"editor.foreground":i},settings:s,tokenColors:t}}var Xa=require("react/jsx-runtime"),Ya=["json","javascript","typescript","tsx","jsx","bash","html","css","markdown"],Ka=Ja(Ie,{name:ye,type:"light",defaultBackground:"#ffffff",defaultForeground:"#24292E"}),Qa=Ja(Se,{name:he,type:"dark",defaultBackground:"#292d3e",defaultForeground:"#bfc7d5"}),Za=null;function ei(){if("undefined"==typeof document)return"dark";const e=document.documentElement;return"dark"===e.dataset.theme||e.classList.contains("dark")?"dark":"light"}function ni(e){return e?Ya.includes(e)?e:"text":"json"}function ti({code:e,language:n,className:t,theme:r}){const[o,a]=(0,Ha.useState)(""),[i,s]=(0,Ha.useState)(r??ei());(0,Ha.useEffect)(()=>{if(r)return void s(r);s(ei());const e=new MutationObserver(()=>s(ei()));return e.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),()=>e.disconnect()},[r]),(0,Ha.useEffect)(()=>{let t=!1;return(Za||(Za=(0,Ga.createHighlighter)({themes:[Ka,Qa],langs:[...Ya]})),Za).then(r=>{if(t)return;const o=r.codeToHtml(e,{lang:ni(n),theme:"dark"===i?he:ye});a(o)}),()=>{t=!0}},[e,n,i]);const l="elb-code-static"+(t?` ${t}`:"");return(0,Xa.jsx)("div",{className:l,dangerouslySetInnerHTML:{__html:o}})}var ri=require("react/jsx-runtime");function oi({code:e,language:n="javascript",tabs:t,activeTab:r,onTabChange:o,defaultTab:a,label:i,header:s,showHeader:l=!0,showTrafficLights:c=!1,showCopy:d=!0,footer:u,height:p,className:f,style:g}){const[m,h]=(0,qa.useState)(!1),[y,b]=(0,qa.useState)(r??a??t?.[0]?.id??""),v=r??y,x=(0,qa.useCallback)(e=>{b(e),o?.(e)},[o]),w=t?.find(e=>e.id===v),k=w?.code??e??"",T=w?.language??n,C=s??i??"Code",$=d?(0,ri.jsx)("div",{style:{display:"flex",gap:"4px",alignItems:"center"},children:(0,ri.jsx)("button",{className:"elb-explorer-btn",onClick:async()=>{try{await navigator.clipboard.writeText(k),h(!0),setTimeout(()=>h(!1),2e3)}catch{}},title:m?"Copied!":"Copy to clipboard",children:m?(0,ri.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,ri.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,ri.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ri.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,ri.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})}):void 0,S=t?.map(e=>({id:e.id,label:e.label,content:(0,ri.jsx)(ti,{code:e.code,language:e.language??n})}));return(0,ri.jsx)(re,{header:C,headerActions:$,showHeader:l,tabs:S,defaultTab:a,activeTab:r,onTabChange:x,showTrafficLights:c,footer:u,height:p,style:g,className:f,children:!t&&(0,ri.jsx)(ti,{code:e??"",language:T})})}var ai=require("react/jsx-runtime");function ii({children:e,className:n=""}){return(0,ai.jsx)("div",{className:`elb-explorer-footer ${n}`,children:e})}var si=require("react/jsx-runtime");function li({variant:e="default",size:n="md",href:t,onClick:r,children:o,className:a="",disabled:i=!1}){const s="elb-button-link",l=`${s} ${s}-${e} ${s}-${n} ${a}`.trim();return t&&!i?(0,si.jsx)("a",{href:t,className:l,children:o}):(0,si.jsx)("button",{type:"button",className:l,onClick:r,disabled:i,children:o})}var ci=require("react/jsx-runtime");function di({size:e="md",className:n=""}){return(0,ci.jsx)("span",{className:`elb-spinner elb-spinner--${e} ${n}`.trim(),role:"status","aria-label":"Loading"})}jt("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}),jt("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});var ui=p(require("react"),1),pi={},fi=ui.default.createContext(pi);function gi(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(pi):e.components||pi:function(e){const n=ui.default.useContext(fi);return ui.default.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}(e.components),ui.default.createElement(fi.Provider,{value:n},e.children)}var mi=require("react"),hi=require("react/jsx-runtime"),yi=({className:e,children:n})=>{const t=mi.Children.toArray(n),r="string"==typeof e,o=t.some(e=>"string"==typeof e&&e.match(/[\n\r]/g));if(!r||!o)return(0,hi.jsx)("code",{className:"elb-code-inline",children:n});const a=e.replace(/^language-/,""),i={js:"javascript",ts:"typescript",jsx:"javascript",tsx:"typescript",bash:"shell",sh:"shell",yml:"yaml",md:"markdown"}[a]||a,s=t.map(e=>"string"==typeof e?e:"").join("").trim();return(0,hi.jsx)(Mn,{code:s,language:i,disabled:!0,showCopy:!0,showHeader:!1,autoHeight:{min:100,max:600}})},bi=require("react/jsx-runtime"),vi=({children:e})=>{const n={code:yi,CodeBox:Mn,PropertyTable:La};return(0,bi.jsx)(gi,{components:n,children:e})},xi=require("react");function wi(){const[e,n]=(0,xi.useState)(!1),t=(0,xi.useRef)(null),r=(0,xi.useCallback)(()=>{n(e=>!e)},[]),o=(0,xi.useCallback)(()=>{n(!0)},[]),a=(0,xi.useCallback)(()=>{n(!1)},[]);return(0,xi.useEffect)(()=>{if(e)return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r);function r(e){t.current&&!t.current.contains(e.target)&&n(!1)}},[e]),(0,xi.useEffect)(()=>{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 ki(e,n){const t=JSON.parse(JSON.stringify(e));for(const[e,r]of Object.entries(n)){const n=""===e?t:Ti(t,e);n&&"object"==typeof n&&Object.assign(n,r)}return t}function Ti(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 Ci(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,i=r?.properties,s=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='Shared variables for `$var.name` interpolation across all flows.\n\n```json\n"variables": {\n "measurementId": "G-XXXXXXXXXX",\n "debug": false\n}\n```\n\nReference in any config value: `"$var.measurementId"`',a.variables.defaultSnippets=[{label:"Add variable",description:"New key-value variable",body:{"${1:name}":"${2:value}"}}]),a.definitions&&(a.definitions.markdownDescription='Reusable configuration fragments for `$def.name` references.\n\n```json\n"definitions": {\n "gaConfig": {\n "measurementId": "$var.trackingId"\n }\n}\n```\n\nReference in any config: `"$def.gaConfig"`',a.definitions.defaultSnippets=[{label:"Add definition",description:"New reusable config 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}"}}}}}}]),i&&(i.config&&(i.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```',i.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"}}]),i.sources&&(i.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```',i.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"}}}]),i.destinations&&(i.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```',i.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} }"}}}}]),i.transformers&&(i.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```',i.transformers.defaultSnippets=[{label:"Add transformer",description:"Inline transformer with code",body:{"${1:transformer}":{code:{push:"$code:(event) => { ${2:return event;} }"}}}}])),s&&(s.platform&&(s.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```'),s.url&&(s.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```'),s.settings&&(s.settings.markdownDescription='Free-form key-value settings consumed by the platform runtime.\n\nFor web: typical keys include `windowCollector`, `windowElb`.\n\n```json\n"settings": {\n "windowCollector": "collector",\n "windowElb": "elb"\n}\n```'),s.bundle&&(s.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 $i(){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 Si(){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}}]}}W();var Ei=require("@walkeros/core");function ji(e){const n=e.source.replace(/^\^/,"").replace(/\$$/,"").replace(/\(\.\+\)\?$/,"([\\w.]+)?");return new RegExp(n,"g")}function Pi(e,n){const t=[];if(n.variables){const r=ji(Ei.REF_VAR);let o;for(;null!==(o=r.exec(e));)o[1]in n.variables||t.push({message:`Unknown variable "$var.${o[1]}". Defined variables: ${Object.keys(n.variables).join(", ")||"none"}`,severity:"warning",startIndex:o.index,endIndex:o.index+o[0].length})}if(n.definitions){const r=ji(Ei.REF_DEF);let o;for(;null!==(o=r.exec(e));)o[1]in n.definitions||t.push({message:`Unknown definition "$def.${o[1]}". Defined: ${Object.keys(n.definitions).join(", ")||"none"}`,severity:"warning",startIndex:o.index,endIndex:o.index+o[0].length})}if(n.secrets){const r=ji(Ei.REF_SECRET);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=ji(Ei.REF_STORE);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=ji(Ei.REF_FLOW);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=ji(Ei.REF_ENV);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 i(e,n){if(e&&"object"==typeof e)if(Array.isArray(e))e.forEach((e,t)=>i(e,[...n,t]));else for(const[o,s]of Object.entries(e)){const e=[...n,o];if("next"!==o&&"before"!==o)i(s,e);else for(const n of a(s))r.includes(n)||t.push({message:`Unknown transformer "${n}" in ${e.join(".")}. Available: ${r.join(", ")||"none"}`,severity:"warning",startIndex:0,endIndex:0})}}return i(o,[]),t}(e,n.stepNames?.transformers)),t}function _i(e){let n;try{n=JSON.parse(e)}catch{return{}}if(!(Ri(t=n)&&"version"in t&&"flows"in t&&Ri(t.flows)))return{};var t;const r={},o={},a=[],i=[],s=[],l=[],c=[],d=[],u={};let p;Ii(r,n.variables),Oi(o,n.definitions),Ni(d,n.contract),Ri(n.contract)&&Object.assign(u,n.contract);for(const e of Object.values(n.flows))if(Ri(e)){if(!p&&Ri(e.config)){const n=e.config.platform;"web"!==n&&"server"!==n||(p=n)}if(Ii(r,e.variables),Oi(o,e.definitions),Ni(d,e.contract),Ri(e.contract)&&Object.assign(u,e.contract),Ri(e.sources))for(const[n,t]of Object.entries(e.sources))a.push(n),Ri(t)&&(Ii(r,t.variables),Oi(o,t.definitions),"string"==typeof t.package&&c.push({package:t.package,shortName:n,type:"source",platform:p||"web"}));if(Ri(e.destinations))for(const[n,t]of Object.entries(e.destinations))i.push(n),Ri(t)&&(Ii(r,t.variables),Oi(o,t.definitions),"string"==typeof t.package&&c.push({package:t.package,shortName:n,type:"destination",platform:p||"web"}));if(Ri(e.transformers))for(const[n,t]of Object.entries(e.transformers))s.push(n),Ri(t)&&(Ii(r,t.variables),Oi(o,t.definitions),"string"==typeof t.package&&c.push({package:t.package,shortName:n,type:"transformer",platform:p||"web"}));if(Ri(e.stores))for(const[n,t]of Object.entries(e.stores))l.push(n),Ri(t)&&(Ii(r,t.variables),Oi(o,t.definitions))}const f={variables:r,definitions:o,stepNames:{sources:a,destinations:i,transformers:s}};return p&&(f.platform=p),c.length>0&&(f.packages=c),d.length>0&&(f.contract=d),Object.keys(u).length>0&&(f.contractRaw=u),l.length>0&&(f.stores=l),f}function Ri(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Fi(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e}function Ii(e,n){if(Ri(n))for(const[t,r]of Object.entries(n))Fi(r)&&(e[t]=r)}function Oi(e,n){if(Ri(n))for(const[t,r]of Object.entries(n))e[t]=r}function Ni(e,n){if(Ri(n))for(const[t,r]of Object.entries(n)){if(t.startsWith("$")||!Ri(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})}}//# sourceMappingURL=index.js.map
1
+ "use strict";var e,n,t,r=Object.create,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,i=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=(e,n)=>function(){return e&&(n=(0,e[s(e)[0]])(e=0)),n},u=(e,n)=>{for(var t in n)o(e,t,{get:n[t],enumerable:!0})},d=(e,n,t,r)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let i of s(n))l.call(e,i)||i===t||o(e,i,{get:()=>n[i],enumerable:!(r=a(n,i))||r.enumerable});return e},p=(e,n,t)=>(t=null!=e?r(i(e)):{},d(!n&&e&&e.__esModule?t:o(t,"default",{value:e,enumerable:!0}),e));var g,f,m,h,y,b=c({"src/utils/monaco-context-types.ts"(){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"}}),v=c({"walkeros-types:virtual:walkeros-core-types"(){g="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 batch?: number;\n batchFn?: (destination: Instance$5, collector: Instance$6) => void;\n batched?: Batch<Settings>;\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}\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$4;\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_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_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 CacheRule {\n match: MatchExpression | '*';\n key: string[];\n ttl: number;\n update?: Record<string, Value>;\n}\ninterface Cache {\n full?: boolean;\n store?: string;\n rules: CacheRule[];\n}\n\ntype cache_Cache = Cache;\ntype cache_CacheRule = CacheRule;\ndeclare namespace cache {\n export type { cache_Cache as Cache, cache_CacheRule as CacheRule };\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}\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 * 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$4;\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}\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}\ninterface Sources {\n [id: string]: Instance$2;\n}\ninterface Destinations$1 {\n [id: string]: Instance$5;\n}\ninterface Transformers$1 {\n [id: string]: Instance$3;\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', destination: Init$3<T> | Instance$5<T>, config?: Config$5<T>): Promise<PushResult>;\n <K extends keyof Functions>(command: 'hook', name: K, hookFn: Functions[K]): Promise<PushResult>;\n (command: 'on', type: Types$3, rules: SingleOrArray<Subscription>): 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, options?: unknown): Promise<PushResult>;\n}\ninterface Instance$6 {\n push: PushFn$1;\n command: CommandFn;\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 logger: Instance$4;\n on: OnConfig;\n queue: Events;\n round: number;\n session: undefined | SessionData;\n status: Status;\n timing: number;\n user: User;\n pending: {\n destinations: InitDestinations;\n };\n}\n\ntype collector_CommandFn = CommandFn;\ntype collector_CommandType = CommandType;\ntype collector_DestinationStatus = DestinationStatus;\ntype collector_InitConfig = InitConfig;\ntype collector_PushOptions = PushOptions;\ntype collector_SessionData = SessionData;\ntype collector_SourceStatus = SourceStatus;\ntype collector_Sources = Sources;\ntype collector_Status = Status;\ndeclare namespace collector {\n export type { collector_CommandFn as CommandFn, collector_CommandType as CommandType, Config$6 as Config, collector_DestinationStatus as DestinationStatus, Destinations$1 as Destinations, collector_InitConfig as InitConfig, Instance$6 as Instance, PushFn$1 as PushFn, collector_PushOptions as PushOptions, collector_SessionData as SessionData, collector_SourceStatus as SourceStatus, collector_Sources as Sources, collector_Status as Status, Stores$1 as Stores, Transformers$1 as Transformers };\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$4;\n config: C;\n env: E;\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 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$4;\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 * 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> {\n settings: S;\n initSettings: I;\n mapping: M;\n env: E;\n setup: U;\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};\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'];\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$3;\n data?: unknown;\n }>;\n dlq?: DLQ;\n batches?: BatchRegistry<Mapping$1<T>>;\n type?: 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 /** 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$4;\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 `walker 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?: Next;\n /** Transformer chain to run after destination push completes. Push response available at ingest._response. */\n next?: Next;\n /** Cache configuration for deduplication (step-level: skip push on HIT). */\n cache?: Cache;\n /** Completely skip this destination — no init, no push, no queuing. */\n disabled?: boolean;\n /** Return this value instead of calling push(). Uses !== undefined check to support falsy values. */\n mock?: unknown;\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>>>;\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?: Next;\n next?: Next;\n cache?: Cache;\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>;\ntype PushBatchFn<T extends TypesGeneric$3 = Types$4> = (batch: Batch<Mapping$1<T>>, context: PushBatchContext<T>) => void;\ntype PushEvent<Mapping = unknown> = {\n event: Event;\n mapping?: Rule<Mapping>;\n};\ntype PushEvents<Mapping = unknown> = Array<PushEvent<Mapping>>;\ninterface Batch<Mapping> {\n key: string;\n events: Events;\n data: Array<Data>;\n mapping?: Rule<Mapping>;\n}\ninterface BatchRegistry<Mapping> {\n [mappingKey: string]: {\n batched: Batch<Mapping>;\n batchFn: () => 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\ntype destination_Batch<Mapping> = Batch<Mapping>;\ntype destination_BatchRegistry<Mapping> = BatchRegistry<Mapping>;\ntype destination_DLQ = DLQ;\ntype destination_Data = Data;\ntype destination_Destinations = Destinations;\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 namespace destination {\n export type { BaseEnv$3 as BaseEnv, destination_Batch as Batch, destination_BatchRegistry as BatchRegistry, Code$1 as Code, Config$5 as Config, Context$5 as Context, destination_DLQ as DLQ, destination_Data as Data, destination_Destinations as Destinations, Env$3 as Env, Init$3 as Init, destination_InitDestinations as InitDestinations, InitFn$2 as InitFn, InitSettings$3 as InitSettings, Instance$5 as Instance, Mapping$1 as Mapping, PartialConfig$2 as PartialConfig, destination_Policy as Policy, Push$1 as Push, destination_PushBatchContext as PushBatchContext, destination_PushBatchFn as PushBatchFn, destination_PushContext as PushContext, destination_PushEvent as PushEvent, destination_PushEvents as PushEvents, destination_PushFn as PushFn, destination_Ref as Ref, Settings$3 as Settings, SetupOptions$2 as SetupOptions, Types$4 as Types, TypesGeneric$3 as TypesGeneric, TypesOf$3 as TypesOf };\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', destination: Init$3<T> | Instance$5<T>, config?: Config$5<T>): R;\n <K extends keyof Functions>(event: 'walker hook', name: K, hookFn: Functions[K]): R;\n (event: 'walker on', type: Types$3, rules: SingleOrArray<Subscription>): 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 * 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`, `windowElb`.\n * For server: reserved for future server-specific options.\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 /**\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 * Resolved import variable name (string) or inline code definition (Code).\n *\n * - String: auto-resolved from packages[package].imports[0] during getFlowSettings(),\n * or provided explicitly for advanced use cases.\n * - Code: object with type, push, and optional init for inline code definition.\n */\n code?: string | Code;\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?: string | string[];\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?: string | string[];\n /** Cache configuration for this source. */\n cache?: Cache;\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 /** Resolved import variable name (string) or inline code definition (Code). */\n code?: string | Code;\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?: string | string[];\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?: string | string[];\n /** Cache configuration for this destination. */\n cache?: Cache;\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 /** Resolved import variable name (string) or inline code definition (Code). */\n code?: string | Code;\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?: string | string[];\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?: string | string[];\n /** Cache configuration for this transformer. */\n cache?: Cache;\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 /** Resolved import variable name (string) or inline code definition (Code). */\n code?: string | Code;\n /** Store-specific configuration. */\n config?: unknown;\n /** Store environment configuration. */\n env?: unknown;\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 * 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\": { \"extends\": \"default\", \"events\": { ... } },\n * \"server\": { \"extends\": \"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 `extends` to inherit from another named contract (additive merge).\n */\n interface ContractRule {\n /** Inherit from another named contract (additive merge). */\n extends?: string;\n /** Tagging level (used by validators / runtime tagging policy). */\n tagging?: number;\n /** Human-readable description of the contract. */\n description?: string;\n /** JSON Schema for event.globals. */\n globals?: ContractSchema;\n /** JSON Schema for event.context. */\n context?: ContractSchema;\n /** JSON Schema for event.custom. */\n custom?: ContractSchema;\n /** JSON Schema for event.user. */\n user?: ContractSchema;\n /** JSON Schema for event.consent. */\n consent?: ContractSchema;\n /** Entity-action event schemas. */\n events?: ContractEvents;\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$4 {\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$4;\n}\n/**\n * Logger configuration options\n */\ninterface Config$4 {\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$4) => Instance$4;\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$4 as Config, type logger_DefaultHandler as DefaultHandler, type logger_ErrorContext as ErrorContext, type logger_Factory as Factory, type logger_Handler as Handler, type Instance$4 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$3 = {\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$3 = keyof Config$3 | (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$4 {\n collector: Instance$6;\n logger: Instance$4;\n}\n/** Unified subscription callback shape. */\ntype Fn$2<TData = unknown> = (data: TData, context: Context$4) => PromiseOrValue<void>;\n/** Typed-data variants for readability and IntelliSense. All reduce to Fn<TData>. */\ntype ConsentFn = Fn$2<Consent>;\ntype GenericFn = Fn$2<unknown>;\ntype ReadyFn = Fn$2<void>;\ntype RunFn = Fn$2<void>;\ntype SessionFn = Fn$2<SessionData | undefined>;\ntype UserFn = Fn$2<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$3, context: Context$5<T>) => PromiseOrValue<void>;\ntype OnFnRuntime = (type: Types$3, 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$3 as Config, on_ConsentFn as ConsentFn, on_ConsentRule as ConsentRule, Context$4 as Context, on_EventData as EventData, on_EventDataMap as EventDataMap, Fn$2 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$3 as Types, on_UserFn as UserFn };\n}\n\ninterface NextRule {\n match: MatchExpression | '*';\n next: Next;\n}\ntype Next = string | string[] | NextRule[];\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$2<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$2> = T['settings'];\ntype InitSettings$2<T extends TypesGeneric$2 = Types$2> = T['initSettings'];\ntype Env$2<T extends TypesGeneric$2 = Types$2> = T['env'];\n/**\n * Inference helper: Extract Types from Instance.\n */\ntype TypesOf$2<I> = I extends Instance$3<infer T> ? T : never;\n/**\n * Transformer configuration.\n */\ninterface Config$2<T extends TypesGeneric$2 = Types$2> {\n settings?: InitSettings$2<T>;\n env?: Env$2<T>;\n id?: string;\n logger?: Config$4;\n before?: Next;\n next?: Next;\n cache?: Cache;\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/**\n * Context provided to transformer functions.\n * Extends base context with transformer-specific properties.\n */\ninterface Context$3<T extends TypesGeneric$2 = Types$2> extends Base<Config$2<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?: Next;\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 */\ninterface ChainResult {\n event: DeepPartialEvent | DeepPartialEvent[] | null;\n respond?: RespondFn;\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$1<T extends TypesGeneric$2 = Types$2, E = DeepPartialEvent> = (event: E, context: Context$3<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$2> = (context: Context$3<T>) => PromiseOrValue<void | false | Config$2<T>>;\n/**\n * Transformer instance returned by Init function.\n */\ninterface Instance$3<T extends TypesGeneric$2 = Types$2> {\n type: string;\n config: Config$2<T>;\n push: Fn$1<T>;\n init?: InitFn$1<T>;\n destroy?: DestroyFn<Config$2<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$2> = (context: Context$3<Types$2<Partial<Settings$2<T>>, Env$2<T>, InitSettings$2<T>>>) => Instance$3<T> | Promise<Instance$3<T>>;\n/**\n * Configuration for initializing a transformer.\n * Used in collector registration.\n */\ntype InitTransformer<T extends TypesGeneric$2 = Types$2> = {\n code: Init$2<T>;\n config?: Partial<Config$2<T>>;\n env?: Partial<Env$2<T>>;\n before?: Next;\n next?: Next;\n cache?: Cache;\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$3;\n}\n\ntype transformer_ChainResult = ChainResult;\ntype transformer_InitTransformer<T extends TypesGeneric$2 = Types$2> = InitTransformer<T>;\ntype transformer_InitTransformers = InitTransformers;\ntype transformer_Next = Next;\ntype transformer_NextRule = NextRule;\ntype transformer_Transformers = Transformers;\ndeclare namespace transformer {\n export type { BaseEnv$2 as BaseEnv, transformer_ChainResult as ChainResult, Config$2 as Config, Context$3 as Context, Env$2 as Env, Fn$1 as Fn, Init$2 as Init, InitFn$1 as InitFn, InitSettings$2 as InitSettings, transformer_InitTransformer as InitTransformer, transformer_InitTransformers as InitTransformers, Instance$3 as Instance, transformer_Next as Next, transformer_NextRule as NextRule, Result$1 as Result, Settings$2 as Settings, transformer_Transformers as Transformers, Types$2 as Types, TypesGeneric$2 as TypesGeneric, TypesOf$2 as TypesOf };\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$4;\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 `walker setup`)\n */\ninterface Types$1<S = unknown, M = unknown, P = Fn$3, E = BaseEnv$1, I = S, U = unknown> {\n settings: S;\n initSettings: I;\n mapping: M;\n push: P;\n env: E;\n setup: U;\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};\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'];\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 /** 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$4;\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 `walker 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}\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>>>;\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$3, 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$3;\n data: unknown;\n }>;\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 * Sets ingest metadata for the current request.\n * Extracts values from the raw request using config.ingest mapping.\n * The extracted data is passed through to transformers and destinations.\n *\n * @param value - Raw request object (Express req, Lambda event, etc.)\n */\n setIngest: (value: unknown) => Promise<void>;\n /** Sets respond function for the current request. Called by source per-request. */\n setRespond: (fn: RespondFn | undefined) => void;\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?: Next;\n before?: Next;\n cache?: Cache;\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\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;\ndeclare namespace source {\n export type { BaseEnv$1 as BaseEnv, Config$1 as Config, Context$1 as Context, Env$1 as Env, Init$1 as Init, InitSettings$1 as InitSettings, source_InitSource as InitSource, source_InitSources as InitSources, Instance$2 as Instance, source_Mapping as Mapping, PartialConfig$1 as PartialConfig, source_Push as Push, source_Renderer as Renderer, Settings$1 as Settings, SetupOptions$1 as SetupOptions, Types$1 as Types, TypesGeneric$1 as TypesGeneric, TypesOf$1 as TypesOf };\n}\n\ninterface BaseEnv {\n [key: string]: unknown;\n}\ninterface Types<S = unknown, E = BaseEnv, I = S, U = unknown> {\n settings: S;\n initSettings: I;\n env: E;\n setup: U;\n}\ntype TypesGeneric = {\n settings: any;\n initSettings: any;\n env: any;\n setup: 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 TypesOf<I> = I extends Instance$1<infer T> ? T : never;\ninterface Config<T extends TypesGeneric = Types> {\n settings?: InitSettings<T>;\n env?: Env<T>;\n id?: string;\n logger?: Config$4;\n /**\n * Provisioning options for `walker setup`. `boolean | object`.\n * Triggered only by explicit CLI invocation; never automatic.\n */\n setup?: boolean | SetupOptions<T>;\n}\ntype PartialConfig<T extends TypesGeneric = Types> = Config<Types<Partial<Settings<T>> | Settings<T>, Env<T>, InitSettings<T>, SetupOptions<T>>>;\ninterface Context<T extends TypesGeneric = Types> extends Base<Config<T>, Env<T>> {\n id: string;\n}\ntype GetFn<T = unknown> = (key: string) => T | undefined | Promise<T | undefined>;\ntype SetFn<T = unknown> = (key: string, value: T, ttl?: 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\ntype store_BaseEnv = BaseEnv;\ntype store_Config<T extends TypesGeneric = Types> = Config<T>;\ntype store_Context<T extends TypesGeneric = Types> = Context<T>;\ntype store_DeleteFn = DeleteFn;\ntype store_Env<T extends TypesGeneric = Types> = Env<T>;\ntype store_GetFn<T = unknown> = 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 = unknown> = SetFn<T>;\ntype store_Settings<T extends TypesGeneric = Types> = Settings<T>;\ntype store_SetupOptions<T extends TypesGeneric = Types> = SetupOptions<T>;\ntype store_Stores = Stores;\ntype store_Types<S = unknown, E = BaseEnv, I = S, U = unknown> = Types<S, E, I, U>;\ntype store_TypesGeneric = TypesGeneric;\ntype store_TypesOf<I> = TypesOf<I>;\ndeclare namespace store {\n export type { store_BaseEnv as BaseEnv, store_Config as Config, store_Context as Context, store_DeleteFn as DeleteFn, store_Env as Env, store_GetFn as GetFn, store_Init as Init, store_InitFn as InitFn, store_InitSettings as InitSettings, store_InitStore as InitStore, store_InitStores as InitStores, Instance$1 as Instance, store_PartialConfig as PartialConfig, store_SetFn as SetFn, store_Settings as Settings, store_SetupOptions as SetupOptions, store_Stores as Stores, store_Types as Types, store_TypesGeneric as TypesGeneric, store_TypesOf as TypesOf };\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}\ninterface Source extends Properties {\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 per run (was: event.count). */\n count?: number;\n /** W3C traceparent full string; set when the emission is part of a chained trace. */\n trace?: string;\n /** Walker-controlled standard suggestions (sources may set). */\n url?: string;\n referrer?: string;\n tool?: string;\n command?: string;\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_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_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, and destination.\n */\ninterface Result {\n /** Which step type was simulated */\n step: 'source' | 'transformer' | 'destination';\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 * - 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 /** 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 * 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: Next): 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:\";\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\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 * @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\n/**\n * Generates a random string of a given length.\n *\n * @param length - The length of the random string.\n * @param charset - Optional custom charset. Defaults to base-36 (0-9a-z).\n * @returns The random string.\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\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 * 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 * @template P, R\n * @param fn The function to debounce.\n * @param wait The number of milliseconds to delay.\n * @param immediate Trigger the function on the leading edge, instead of the trailing.\n * @returns The new debounced function.\n */\ndeclare function debounce<P extends unknown[], R>(fn: (...args: P) => R, wait?: number, immediate?: boolean): (...args: P) => Promise<R>;\ndeclare function throttle<P extends unknown[], R>(fn: (...args: P) => R | undefined, delay?: number): (...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$4): Instance$4;\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 * 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$2>(overrides?: Partial<Omit<Context$3<T>, 'config' | 'ingest'> & {\n config?: Config$2<T> | Config$5<TypesGeneric$3>;\n ingest?: Ingest | (Record<string, unknown> & {\n _meta: Ingest['_meta'];\n });\n data?: unknown;\n rule?: unknown;\n}>): Context$3<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$4 {\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 * 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 * @template P, R\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.\n */\ndeclare function useHooks<P extends unknown[], R>(fn: (...args: P) => R, name: string, hooks: Functions, logger?: Instance$4): (...args: P) => R;\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/**\n * Resolve all named contracts: process extends 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 */\ndeclare function resolveContracts(contracts: Flow.Contract): 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\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 | '*'): CompiledMatcher;\n\ninterface CompiledRoute {\n match: CompiledMatcher;\n next: CompiledNext;\n}\ntype CompiledNext = {\n type: 'static';\n value: string;\n} | {\n type: 'chain';\n value: string[];\n} | {\n type: 'routes';\n routes: CompiledRoute[];\n};\ndeclare function isRouteArray(next: Next): next is NextRule[];\ndeclare function compileNext(next: Next | undefined): CompiledNext | undefined;\ndeclare function resolveNext(compiled: CompiledNext | undefined, context?: Record<string, unknown>): string | string[] | undefined;\n\ninterface CompiledCacheRule {\n match: CompiledMatcher;\n key: string[];\n ttl: number;\n update?: CacheRule['update'];\n}\ninterface CompiledCache {\n full: boolean;\n storeId?: string;\n rules: CompiledCacheRule[];\n}\ninterface CacheResult {\n status: 'HIT' | 'MISS';\n key: string;\n value?: unknown;\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): CompiledCache;\ndeclare function checkCache(compiled: CompiledCache, store: Instance$1, context: Record<string, unknown>, namespace: string): 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\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\nexport { cache as Cache, type CacheResult, type ClickIdEntry, collector as Collector, type CompiledCache, type CompiledNext, type CompiledRoute, Const, context as Context, destination as Destination, type DestroyContext, type DestroyFn, ENV_MARKER_PREFIX, elb as Elb, type ExampleSummary, Flow, type FlowConfigResolver, hint as Hint, hooks as Hooks, type Ingest, type IngestMeta, Level, lifecycle as Lifecycle, type LifecycleContext, logger as Logger, mapping as Mapping, type MarketingParameters, matcher as Matcher, type MockLogger, on as On, REF_CODE_PREFIX, REF_CONTRACT, REF_ENV, REF_FLOW, REF_SECRET, REF_STORE, REF_VAR_FULL, REF_VAR_INLINE, request as Request, type ResolveOptions, type RespondFn, type RespondOptions, type SendDataValue, type SendHeaders, type SendResponse, type SetupFn, simulation as Simulation, source as Source, type StorageType, store as Store, transformer as Transformer, trigger as Trigger, walkeros as WalkerOS, type WalkerOSPackage, type WalkerOSPackageInfo, type WalkerOSPackageMeta, anonymizeIP, applyUpdate, assign, branch, buildCacheContext, castToProperty, castValue, checkCache, clone, compileCache, compileMatcher, compileNext, createDestination, createEvent, createIngest, createLogger, createMockContext, createMockLogger, createRespond, debounce, deepMerge, defaultClickIds, fetchPackage, fetchPackageSchema, filterValues, flattenIncludeSections, formatOut, getBrowser, getBrowserVersion, getByPath, getDeviceType, getEvent, getFlowSettings, getGrantedConsent, getHeaders, getId, getMappingEvent, getMappingValue, getMarketingParameters, getOS, getOSVersion, getPlatform, getSpanId, isArguments, isArray, isBoolean, isCommand, isDefined, isElementOrDocument, isFunction, isNumber, isObject, isPropertyType, isRouteArray, isSameType, isString, mcpError, mcpResult, mergeContractSchemas, mockEnv, packageNameToVariable, parseUserAgent, processEventMapping, requestToData, requestToParameter, resolveContracts, resolveNext, resolveSetup, setByPath, storeCache, throttle, throwError, transformData, traverseEnv, trim, tryCatch, tryCatchAsync, useHooks, walkPath, wrapCondition, wrapFn, wrapValidate };\n"}}),x={};function w(e){m.has(e)||(m.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 k(e,n,t){if(f.has(n))return!1;const r=e.languages.typescript.javascriptDefaults.addExtraLib(t,n),o=e.languages.typescript.typescriptDefaults.addExtraLib(t,n);return f.set(n,{uri:n,content:t,disposable:{dispose:()=>{r.dispose(),o.dispose()}}}),!0}function T(e){const n=f.get(e);return!!n&&(n.disposable?.dispose(),f.delete(e),!0)}function C(e,n,t){T(n),k(e,n,t)}async function S(e,n,t){try{const r=await fetch(n);if(!r.ok)return!1;const o=await r.text();return k(e,t||`file:///${n}`,o)}catch{return!1}}function $(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 E(e){y=e}function j(e,n){return y?`${y}/${encodeURIComponent(e)}/types?version=${encodeURIComponent(n)}`:`https://cdn.jsdelivr.net/npm/${e}@${n}/dist/index.d.ts`}async function P(e,n){const{package:t,version:r="latest"}=n,o=`file:///node_modules/${t}/index.d.ts`;if(f.has(o))return!0;const a=j(t,r);try{const n=await fetch(a);if(!n.ok)return!1;let r=await n.text();r=$(r);const s=`declare module '${t}' {\n${r}\n}`;return k(e,o,s)}catch{return!1}}function _(e){const n="file:///node_modules/@walkeros/core/index.d.ts";if(f.has(n))return!0;return k(e,n,`declare module '@walkeros/core' {\n${$(g)}\n}`)}function R(r,o){C(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 F(e,n,t){C(e,`file:///destinations/${n}.d.ts`,t)}function I(e){T(`file:///destinations/${e}.d.ts`)}function O(e){w(e),_(e),N(e)}function N(e){if(h.has(e))return;h.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 M(e){w(e),_(e),R(e,{type:"condition"})}function D(){return Array.from(f.keys())}function L(){for(const e of f.values())e.disposable?.dispose();f.clear()}u(x,{addDestinationType:()=>F,addFunctionContextTypes:()=>R,addTypeLibrary:()=>k,clearAllTypeLibraries:()=>L,configureMonacoTypeScript:()=>w,getLoadedTypeLibraries:()=>D,initializeMonacoTypes:()=>M,loadPackageTypes:()=>P,loadTypeLibraryFromURL:()=>S,loadWalkerOSCoreTypes:()=>_,registerWalkerOSAmbients:()=>N,registerWalkerOSTypes:()=>O,removeDestinationType:()=>I,removeTypeLibrary:()=>T,resolveTypesUrl:()=>j,setPackageTypesBaseUrl:()=>E,updateTypeLibrary:()=>C});var A,W=c({"src/utils/monaco-types.ts"(){b(),v(),f=new Map,m=new WeakSet,h=new WeakSet}}),V={};u(V,{ArchitectureFlow:()=>Ho,Box:()=>re,BrowserBox:()=>Fn,Button:()=>de,ButtonGroup:()=>ge,ButtonLink:()=>is,Code:()=>_n,CodeBox:()=>Mn,CodeDiff:()=>Zo,CodeDiffBox:()=>aa,CodeSnippet:()=>la,CodeStatic:()=>ns,CodeView:()=>rs,CollectorBox:()=>st,Dropdown:()=>Wa,DropdownDivider:()=>Ba,DropdownItem:()=>Va,FlowMap:()=>_a,Footer:()=>as,Grid:()=>X,Header:()=>ee,Icon:()=>Cr,LiveCode:()=>tt,MDXCode:()=>hs,MDXProvider:()=>bs,Preview:()=>le,PromotionPlayground:()=>Gn,PropertyTable:()=>La,REFERENCE_PATTERNS:()=>De,Spinner:()=>cs,applyWalkerOSDecorations:()=>Ae,cn:()=>qo,createFbqDestination:()=>An,createGtagDestination:()=>Ln,createPlausibleDestination:()=>Wn,disposeWalkerOSProviders:()=>pn,enrichFlowConfigSchema:()=>Ts,enrichSchema:()=>ws,extractFlowIntelliSenseContext:()=>Ps,findWalkerOSReferences:()=>Le,generateModelPath:()=>Tn,getEnrichedContractSchema:()=>Cs,getVariablesSchema:()=>Ss,initializeMonacoTypes:()=>M,isMonacoCancellation:()=>jn,lighthouseTheme:()=>Ie,loadPackageTypes:()=>P,loadTypeLibraryFromURL:()=>S,palenightTheme:()=>$e,registerAllThemes:()=>Ne,registerJsonSchema:()=>Cn,registerLighthouseTheme:()=>Oe,registerPalenightTheme:()=>Ee,registerWalkerOSDecorationStyles:()=>We,registerWalkerOSProviders:()=>dn,registerWalkerOSTypes:()=>O,removeIntelliSenseContext:()=>un,resolveTypesUrl:()=>j,setIntelliSenseContext:()=>cn,setPackageTypesBaseUrl:()=>E,unregisterJsonSchema:()=>Sn,useDropdown:()=>xs,validateWalkerOSReferences:()=>js}),module.exports=(A=V,d(o({},"__esModule",{value:!0}),A));var B=require("react"),z=require("@walkeros/collector"),q=require("react"),G=require("react"),H=(0,G.createContext)(null);function U(){return(0,G.useContext)(H)}var J=require("react/jsx-runtime");function X({children:e,columns:n,minBoxWidth:t,gap:r,rowHeight:o="equal",maxRowHeight:a,showScrollButtons:s=!0,className:i=""}){const l=(0,q.useRef)(null),[c,u]=(0,q.useState)(!1),[d,p]=(0,q.useState)(!1),[g,f]=(0,q.useState)(new Map),m=(0,q.useRef)(0),h=(0,q.useCallback)(()=>m.current++,[]),y=(0,q.useCallback)((e,n)=>{f(t=>{const r=new Map(t);return r.set(e,n),r})},[]),b=(0,q.useCallback)(e=>{f(n=>{const t=new Map(n);return t.delete(e),t})},[]),v=(0,q.useMemo)(()=>"synced"!==o||0===g.size?null:Math.min(600,Math.max(...Array.from(g.values()))),[g,o]),x=(0,q.useMemo)(()=>({registerBox:y,unregisterBox:b,getBoxId:h,syncedHeight:v,enabled:"synced"===o}),[y,b,h,v,o]),w=["elb-explorer-grid"],k={};"auto"===o?w.push("elb-explorer-grid--row-auto"):"equal"===o?w.push("elb-explorer-grid--row-equal"):"synced"===o?w.push("elb-explorer-grid--row-synced"):"number"==typeof o&&(k["--grid-row-min-height"]=`${o}px`,k["--grid-row-max-height"]=`${o}px`),i&&w.push(i),void 0!==r&&(k.gap="number"==typeof r?`${r}px`:r),void 0!==t&&(k["--grid-min-box-width"]="number"==typeof t?`${t}px`:t),void 0!==a&&(k["--grid-row-max-height"]="none"===a?"none":"number"==typeof a?`${a}px`:a);const T=(0,q.useCallback)(()=>{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;u(n&&!t),p(n&&!r)},[]);return(0,q.useEffect)(()=>{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]),(0,J.jsx)(H.Provider,{value:x,children:(0,J.jsxs)("div",{className:"elb-explorer elb-explorer-grid-wrapper",children:[s&&c&&(0,J.jsx)("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:"‹"}),(0,J.jsx)("div",{ref:l,className:w.join(" "),style:k,children:e}),s&&d&&(0,J.jsx)("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:"›"})]})})}var Y=require("react"),K=require("@walkeros/web-source-browser"),Q=require("react"),Z=require("react/jsx-runtime");function ee({label:e,children:n}){return(0,Z.jsxs)("div",{className:"elb-explorer-header",children:[(0,Z.jsx)("span",{className:"elb-explorer-label",children:e}),n]})}var ne=require("react/jsx-runtime");function te(){return(0,ne.jsxs)("div",{className:"elb-explorer-traffic-lights",children:[(0,ne.jsx)("span",{className:"elb-explorer-traffic-light elb-explorer-traffic-light--red"}),(0,ne.jsx)("span",{className:"elb-explorer-traffic-light elb-explorer-traffic-light--yellow"}),(0,ne.jsx)("span",{className:"elb-explorer-traffic-light elb-explorer-traffic-light--green"})]})}function re({header:e,headerActions:n,footer:t,children:r,className:o="",style:a,height:s,minHeight:i,maxHeight:l,tiny:c=!1,resizable:u=!1,showHeader:d=!0,tabs:p,activeTab:g,onTabChange:f,defaultTab:m,showTrafficLights:h=!1}){const y=U(),[b,v]=(0,Q.useState)(m||(p?.[0]?.id??"")),x=void 0!==g,w=x?g:b,k={...a};void 0!==s?k.height="number"==typeof s?`${s}px`:s:y?.syncedHeight&&(k.height=`${y.syncedHeight}px`),c?(k.height="auto",k.minHeight=void 0!==i?"number"==typeof i?`${i}px`:i:"100px"):void 0!==i&&(k.minHeight="number"==typeof i?`${i}px`:i),void 0!==l&&(k.maxHeight="number"==typeof l?`${l}px`:l),u&&(k.resize="vertical",k.overflow="auto");const T=!!y?.enabled?"elb-box--auto-height":"",C=p?.find(e=>e.id===w)?.content,S=C??r,$=p&&p.length>0,E=d&&e&&!$;return(0,ne.jsxs)("div",{className:`elb-explorer elb-explorer-box ${T} ${o}`.trim(),style:k,children:[$&&(0,ne.jsxs)("div",{className:"elb-explorer-tabs",children:[h&&(0,ne.jsx)(te,{}),p.map(e=>(0,ne.jsx)("button",{type:"button",className:"elb-explorer-tab "+(w===e.id?"elb-explorer-tab--active":""),onClick:()=>{return n=e.id,f&&f(n),void(x||v(n));var n},children:e.label},e.id)),n&&(0,ne.jsx)("div",{className:"elb-explorer-tab-actions",children:n})]}),E&&(0,ne.jsx)(ee,{label:e,children:n}),(0,ne.jsx)("div",{className:"elb-explorer-content",children:S}),t&&(0,ne.jsx)("div",{className:"elb-explorer-footer",children:t})]})}var oe=require("react/jsx-runtime"),ae=[{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 se({highlights:e,onToggle:n,buttons:t=ae}){return(0,oe.jsx)("div",{className:"elb-preview-footer",children:t.map(t=>(0,oe.jsx)("button",{className:`elb-preview-btn ${e.has(t.type)?t.highlightClass:""}`,onClick:()=>n(t.type),type:"button",children:t.label},t.type))})}var ie=require("react/jsx-runtime");function le({html:e,css:n="",elb:t,label:r="Preview"}){const[o,a]=(0,Y.useState)(new Set),s=(0,Y.useRef)(null),i=(0,Y.useRef)(void 0),l=(0,Y.useRef)(t),c=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{l.current=t},[t]);const u=(0,Y.useCallback)(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","")})})},[]);return(0,Y.useEffect)(()=>(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{const t=s.current;if(!t||!t.contentDocument)return;const r=t.contentDocument,a=Array.from(o).map(e=>`highlight-${e}`).join(" ");r.open(),r.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 ${n}\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-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 ${a}">\n ${e}\n </body>\n </html>\n `),r.close(),u(r),l.current&&t.contentWindow&&t.contentDocument&&setTimeout(async()=>{if(c.current)try{await(c.current.instance.destroy?.(c.current.destroyContext))}catch{}try{if(!t.contentWindow||!t.contentDocument||!l.current)return;const e=()=>({error:()=>{},warn:()=>{},info:()=>{},debug:()=>{},json:()=>{},throw:e=>{throw e instanceof Error?e:new Error(e)},scope:()=>e()}),n=e(),r=async()=>({ok:!0,destination:{}}),o={settings:{pageview:!1,prefix:"data-elb",elb:"elb",elbLayer:"elbLayer",scope:t.contentDocument.body}},a={elb:l.current,push:r,command:async()=>({ok:!0,destination:{}}),logger:n,window:t.contentWindow,document:t.contentDocument},s=await(0,K.sourceBrowser)({id:"preview",collector:{},logger:n,setIngest:async()=>{},setRespond:()=>{},config:o,env:a});c.current={instance:s,destroyContext:{id:"preview",config:o,env:a,logger:n}}}catch{}},50)},200),()=>{i.current&&clearTimeout(i.current),c.current&&c.current.instance.destroy?.(c.current.destroyContext)}),[e,n,o,u,t]),(0,ie.jsx)(re,{header:r,footer:(0,ie.jsx)(se,{highlights:o,onToggle:e=>{a(n=>{const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t})}}),children:(0,ie.jsx)("div",{className:"elb-preview-content",children:(0,ie.jsx)("iframe",{ref:s,className:"elb-preview-iframe",title:"HTML Preview"})})})}var ce=require("react"),ue=require("react/jsx-runtime");function de({active:e=!1,onClick:n,children:t,className:r=""}){return(0,ue.jsx)("button",{className:`elb-explorer-btn ${e?"active":""} ${r}`,onClick:n,type:"button",children:t})}var pe=require("react/jsx-runtime");function ge({buttons:e,onButtonClick:n,className:t=""}){return(0,pe.jsx)("div",{className:`elb-explorer-button-group ${t}`,children:e.map(e=>(0,pe.jsx)(de,{active:e.active,onClick:()=>n(e.value),children:e.label},e.value))})}var fe=require("react"),me=require("@monaco-editor/react"),he="elbTheme-dark",ye="elbTheme-light";function be(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 ve="697098",xe="c3e88d",we="f78c6c",ke="c084fc",Te="82aaff",Ce="ffcb6b",Se="bfc7d5",$e={base:"vs-dark",inherit:!0,rules:be([{foreground:ve,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:xe,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:we,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:ke,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:ke,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:Te,scopes:["function","identifier.function","support.function","entity.name.function","meta.function-call","meta.function-call.entity.name.function","variable.function"]},{foreground:Ce,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:Se,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:Te,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:xe,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:ke,fontStyle:"italic",scopes:["meta.tag.sgml.doctype"]},{fontStyle:"bold",scopes:["markup.bold"]},{fontStyle:"italic",scopes:["markup.italic"]},{foreground:ke,fontStyle:"bold",scopes:["markup.heading"]},{foreground:xe,scopes:["markup.raw"]},{foreground:ve,fontStyle:"italic",scopes:["markup.quote"]},{foreground:Se,scopes:["markup.list"]},{foreground:Se,scopes:["entity.name.tag.html","tag.html","entity.other.attribute-name.html","attribute.name.html"]},{foreground:"ff5572",scopes:["entity.name.tag.css"]},{foreground:Ce,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:we,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 Ee(e){e.editor.defineTheme(he,$e)}var je="6A737D",Pe="22863A",_e="6F42C1",Re="005CC5",Fe="24292E",Ie={base:"vs",inherit:!0,rules:be([{foreground:je,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:Pe,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:_e,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:_e,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:Re,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:Fe,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:Re,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:Fe,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:Pe,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:je,fontStyle:"italic",scopes:["meta.tag.sgml.doctype"]},{fontStyle:"bold",scopes:["markup.bold"]},{fontStyle:"italic",scopes:["markup.italic"]},{foreground:_e,fontStyle:"bold",scopes:["markup.heading"]},{foreground:Pe,scopes:["markup.raw"]},{foreground:je,fontStyle:"italic",scopes:["markup.quote"]},{foreground:Fe,scopes:["markup.list"]},{foreground:Fe,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 Oe(e){e.editor.defineTheme(ye,Ie)}function Ne(e){Ee(e),Oe(e)}W();var Me=[/\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 De=[{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 Le(e){const n=[];for(const t of De){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 Ae(e){let n=[];function t(){const t=e.getModel();if(!t)return;const r=Le(t.getValue()).map(e=>{const n=t.getPositionAt(e.startIndex),r=t.getPositionAt(e.endIndex),o=De.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 We(){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)}var Ve=require("@walkeros/core"),Be=require("@walkeros/core"),ze="",qe={};function Ge(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 He(e,n){if(!e||0===Object.keys(e).length)return[];const t=function(e){const n=JSON.stringify(e);if(n!==ze)try{qe=(0,Be.resolveContracts)(e),ze=n}catch{return{}}return qe}(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=[];void 0!==a.tagging&&e.push({key:"tagging",type:"number"}),void 0!==a.description&&e.push({key:"description",type:"string"});for(const n of["globals","context","custom","user","consent"])a[n]&&e.push({key:n,detail:"schema"});return a.events&&e.push({key:"events",detail:"entity map"}),e}const s=o[0];if(["globals","context","custom","user","consent"].includes(s)){const e=a[s];return e&&"object"==typeof e?1===o.length?Ge(e):Ue(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?Ge(t):Ue(t,o.slice(3)):[]}return[]}function Ue(e,n){let t=e;for(const e of n){const n=t.properties;if(!n||!n[e])return[];t=n[e]}return Ge(t)}function Je(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 Xe(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 Ye(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 Ke(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 Qe(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 Ze=[{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 en(e,n){if(!e||0===Object.keys(e).length)return[];const t=He(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 nn(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 tn(e){const n=e.source.replace(/^\^/,"").replace(/\$$/,"").replace(/\(\.\+\)\?$/,"([\\w.]+)?");return new RegExp(n,"g")}var rn=Ve.REF_CONTRACT.source.replace(/^\^/,"").split(/\\\./,1)[0],on=new RegExp(`${rn}\\.([a-zA-Z0-9_.]*)?$`);var an=new Map,sn=[],ln=!1;function cn(e,n){an.set(e,n)}function un(e){an.delete(e)}function dn(e){ln||(ln=!0,sn.push(e.languages.registerCompletionItemProvider("json",{triggerCharacters:['"',".","$"],provideCompletionItems(n,t){const r=n.uri.toString(),o=an.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=nn(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=[];if(a.includes("$var.")||a.endsWith('"$var'))c.push(...Je(o.variables));else if(a.includes("$secret.")||a.endsWith('"$secret'))c.push(...Xe(o.secrets));else if(a.includes("$store.")||a.endsWith('"$store'))c.push(...Ye(o.stores));else if(a.includes("$flow.")||a.endsWith('"$flow'))c.push(...Ke(o.flows));else if(a.includes("$env.")||a.endsWith('"$env'))c.push(...Qe(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)){const e=a.match(on),n=e?.[1]||"",t=n?n.split(".").filter(Boolean):[];n&&!n.endsWith(".")&&t.length>0&&t.pop(),c.push(...en(o.contractRaw,t))}else!function(e,n,t){const r=nn(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('"'))&&(c.push(...Je(o.variables)),c.push(...Xe(o.secrets)),c.push(...Ye(o.stores)),c.push(...Ke(o.flows)),c.push(...Qe(o.envNames)),c.push(...en(o.contractRaw,[]))):c.push(...(u=o.packages,d=o.platform,u&&0!==u.length?(d?u.filter(e=>e.platform===d):u).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 u,d;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}(nn(i,s));if(e){const n=a.match(/"([a-z_]*)\.?$/);if(n){const t=n[1],r=function(e,n,t,r){if(!r)return Ze;if(!e||0===Object.keys(e).length)return[];const o={data:"events",globals:"globals",context:"context",custom:"custom",user:"user",consent:"consent"}[r];if(!o)return[];const a=[],s=new Set;for(const i of Object.keys(e)){const l=He(e,"events"===o?[i,"events",n,t]:[i,o]);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}(o.contractRaw,e.entity,e.action,t);r.length>0&&c.push(...r)}}}const p=a.match(/\$(?:var|secret|env|code|contract|store|flow)[.:]?[\w.]*$/),g=p?null:a.match(/[a-z_][\w.]*$/i),f=n.getWordUntilPosition(t),m=p?t.column-p[0].length:g?t.column-g[0].length:f.startColumn,h={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:m,endColumn:t.column};return{suggestions:c.map(n=>({label:n.label,insertText:n.insertText,detail:n.detail,documentation:n.documentation,kind:gn(e,n.kind),sortText:n.sortText,range:h}))}}})),sn.push(e.languages.registerHoverProvider("json",{provideHover(e,n){const t=e.uri.toString(),r=an.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(tn(Ve.REF_SECRET));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(tn(Ve.REF_STORE));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 u=s(tn(Ve.REF_FLOW));if(u&&r.flows){const e=u[1],t=u[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:u.index+1,endLineNumber:n.lineNumber,endColumn:u.index+u[0].length+1},contents:[{value:`${a}\n\n${s}`}]}}const d=s(tn(Ve.REF_ENV));if(d){const e=d[1];return r.envNames&&r.envNames.length>0?r.envNames.includes(e)?{range:{startLineNumber:n.lineNumber,startColumn:d.index+1,endLineNumber:n.lineNumber,endColumn:d.index+d[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:d.index+1,endLineNumber:n.lineNumber,endColumn:d.index+d[0].length+1},contents:[{value:`**Env var:** \`$env.${e}\`\n\n*Resolved from process.env at runtime.*`}]}}const p=s(tn(Ve.REF_CONTRACT));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 pn(){for(const e of sn)e.dispose();sn.length=0,ln=!1,an.clear()}function gn(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}}var fn=p(require("prettier/standalone"),1),mn=p(require("prettier/plugins/babel"),1),hn=p(require("prettier/plugins/estree"),1),yn=p(require("prettier/plugins/typescript"),1),bn=p(require("prettier/plugins/html"),1);var vn,xn=new Map,wn=0;var kn={typescript:"ts",javascript:"js",typescriptreact:"tsx",javascriptreact:"jsx",json:"json",html:"html",css:"css",markdown:"md"};function Tn(e="json"){const n=kn[e]??"txt";return`inmemory://walkeros/model-${++wn}.${n}`}function Cn(e,n){xn.set(e,{uri:`schema://walkeros/${e}`,fileMatch:[e],schema:n}),$n()}function Sn(e){xn.delete(e),$n()}function $n(){vn&&vn.jsonDefaults.setDiagnosticsOptions({validate:!0,schemaValidation:"error",schemaRequest:"ignore",enableSchemaRequest:!1,schemas:Array.from(xn.values())})}var En=require("react");function jn(e){if(!e||"object"!=typeof e)return!1;const n=e;return"cancelation"===n.type||!(void 0===n.cause||!jn(n.cause))}var Pn=require("react/jsx-runtime");function _n({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:u,autoHeight:d,fontSize:p=13,packages:g,sticky:f=!0,ide:m=!1,jsonSchema:h,intellisenseContext:y,validate:b,onMarkerCounts:v}){const[w,k]=(0,fe.useState)(!1),[T,C]=(0,fe.useState)("vs-light"),S=(0,fe.useRef)([]),$=(0,fe.useRef)(null),E=(0,fe.useRef)(null),j=(0,fe.useRef)(null),P=U(),_=(0,fe.useRef)(null);P?.enabled&&null===_.current&&(_.current=P.getBoxId());const R=(0,fe.useCallback)(e=>{P?.enabled&&null!==_.current&&P.registerBox(_.current,e)},[P]);(0,fe.useEffect)(()=>()=>{P?.enabled&&null!==_.current&&P.unregisterBox(_.current)},[P]);const F="object"==typeof d?d:{},[I,N]=function({enabled:e=!1,minHeight:n=100,maxHeight:t=800,defaultHeight:r=400,onHeightChange:o}={}){const[a,s]=(0,En.useState)(e?n:r),i=(0,En.useRef)(null),l=(0,En.useRef)(e?n:r),c=(0,En.useRef)(null),u=(0,En.useCallback)(()=>{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,(0,En.useCallback)(n=>{if(c.current&&(clearTimeout(c.current),c.current=null),i.current=n,!e||!n)return s(r),void(l.current=r);setTimeout(()=>u(),50);const t=n.onDidContentSizeChange(()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{u(),c.current=null},150)});n.__heightDisposable=t},[e,r,u])]}({enabled:!!d||!!P?.enabled,minHeight:F.min??(P?.enabled?1:20),maxHeight:F.max??600,defaultHeight:P?.enabled?250:400,onHeightChange:R});(0,fe.useEffect)(()=>{!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 M=(0,fe.useCallback)(()=>{if("undefined"==typeof document)return null;if(j.current){const e=j.current.closest("[data-theme]");if(e)return e.getAttribute("data-theme")}return document.documentElement.getAttribute("data-theme")},[]);(0,fe.useEffect)(()=>{k(!0)},[]),(0,fe.useEffect)(()=>{if(!w)return;const e=()=>{const e=M(),n="dark"===e||null===e&&window.matchMedia("(prefers-color-scheme: dark)").matches;C(n?he:ye)};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)}},[w,M]),(0,fe.useEffect)(()=>{const e=E.current,n=j.current;if(!e||!n)return;const t=new ResizeObserver(()=>{requestAnimationFrame(()=>{e.layout()})});return t.observe(n),()=>{t.disconnect()}},[]);const D=(0,fe.useRef)(null);(0,fe.useRef)(y).current=y;const L=(0,fe.useRef)(b);L.current=b;const A=(0,fe.useRef)(v);A.current=v,D.current||(D.current=Tn(n)),(0,fe.useEffect)(()=>{if(h&&D.current)return Cn(D.current,h),()=>{D.current&&Sn(D.current)}},[h]),(0,fe.useEffect)(()=>{if(y&&D.current)return cn(D.current,y),()=>{D.current&&un(D.current)}},[y]);const V=me.Editor;(0,fe.useEffect)(()=>()=>{for(const e of S.current)e();S.current=[]},[]);const B=d||P?.enabled?`${I}px`:"100%",z=`elb-code ${!!d||!!P?.enabled?"elb-code--auto-height":""} ${l||""}`.trim();return(0,Pn.jsx)("div",{className:z,ref:j,children:(0,Pn.jsx)(V,{height:B,language:n,value:e,onChange:e=>{t&&void 0!==e&&t(e)},beforeMount:async e=>{var t;if($.current=e,function(e){vn||(vn=e.json,xn.size>0&&$n())}(e),Ne(e),(t=e).languages.registerDocumentFormattingEditProvider("javascript",{async provideDocumentFormattingEdits(e,n){try{const t=e.getValue(),r=await fn.format(t,{parser:"babel",plugins:[mn.default,hn.default],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 fn.format(t,{parser:"typescript",plugins:[yn.default,hn.default],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 fn.format(t,{parser:"html",plugins:[bn.default],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 fn.format(t,{parser:"css",plugins:[bn.default],tabWidth:n.tabSize,useTabs:!n.insertSpaces});return[{range:e.getFullModelRange(),text:r}]}catch(e){return[]}}}),g&&g.length>0){O(e);const{loadPackageTypes:n}=await Promise.resolve().then(()=>(W(),x));for(const t of g)"@walkeros/core"!==t&&await n(e,{package:t}).catch(()=>{})}const r=M(),o="dark"===r||null===r&&window.matchMedia("(prefers-color-scheme: dark)").matches?he:ye;e.editor.setTheme(o),"json"===n&&dn(e),c&&c(e)},onMount:e=>{if(E.current=e,(d||P?.enabled)&&N(e),"html"===n&&$.current&&S.current.push(function(e,n){const t=[],r=()=>{const r=e.getModel();if(!r)return;const o=r.getValue(),a=[];Me.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,$.current)),"json"===n&&(We(),S.current.push(Ae(e))),L.current&&$.current){const n=$.current;let t;const r=()=>{const t=e.getModel();if(!t)return;const r=t.getValue(),o=L.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)});S.current.push(()=>{clearTimeout(t),o.dispose()})}if(A.current&&$.current){const n=$.current,t=e.getModel(),r=!!L.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}));A.current?.({errors:o,warnings:a,markers:s})},o=n.editor.onDidChangeMarkers(n=>{n.some(e=>e.toString()===t.uri.toString())&&e()});requestAnimationFrame(e),S.current.push(()=>{o.dispose()})}}requestAnimationFrame(()=>{e.layout()}),u&&u(e)},theme:T,path:D.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||h?"editable":"off",hover:{enabled:m||!!h||!!y},"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:!1},cursorBlinking:"blink",cursorStyle:"line",cursorWidth:2,cursorSmoothCaretAnimation:"off",selectionHighlight:!1,occurrencesHighlight:"off",selectOnLineNumbers:!1,wordBasedSuggestions:"off",quickSuggestions:!(!h&&!y)&&{strings:!0,other:!0,comments:!1},stickyScroll:{enabled:f}}})})}"undefined"!=typeof window&&window.addEventListener("unhandledrejection",e=>{jn(e.reason)&&e.preventDefault()}),"undefined"!=typeof window&&me.loader.init().then(e=>{w(e),N(e)}).catch(e=>{console.warn("[walkerOS] Monaco loader.init() failed:",e)});var Rn=require("react/jsx-runtime");function Fn({html:e,css:n,js:t,onHtmlChange:r,onCssChange:o,onJsChange:a,showPreview:s=!0,label:i="Code",className:l="",initialTab:c,lineNumbers:u=!1,wordWrap:d=!1}){const p=(0,ce.useMemo)(()=>{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]),[g,f]=(0,ce.useState)(()=>c&&p.some(e=>e.value===c)?c:p[0]?.value||"preview"),{content:m,language:h,onChange:y}=(0,ce.useMemo)(()=>{switch(g){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}}},[g,e,n,t,r,o,a]),b=(0,ce.useMemo)(()=>p.map(e=>({label:e.label,value:e.value,active:g===e.value})),[p,g]);return(0,Rn.jsx)(re,{header:i,headerActions:p.length>1?(0,Rn.jsx)(ge,{buttons:b,onButtonClick:f}):null,className:l,children:"preview"===g?(0,Rn.jsx)(le,{html:e||"",css:n||""}):(0,Rn.jsx)(_n,{code:m,language:h,onChange:y,disabled:!y,lineNumbers:u,wordWrap:d})})}var In=require("react"),On=require("@monaco-editor/react"),Nn=require("react/jsx-runtime");function Mn({code:e,language:n="javascript",onChange:t,disabled:r=!1,autoHeight:o,label:a,header:s,showHeader:i=!0,tabs:l,activeTab:c,onTabChange:u,defaultTab:d,showTrafficLights:p=!1,showCopy:g=!0,showFormat:f=!1,showSettings:m=!1,onValidationIssues:h,footer:y,height:b,style:v,className:x,...w}){const{onMount:k,...T}=w,[C,S]=((0,On.useMonaco)(),(0,In.useState)(!1)),[$,E]=(0,In.useState)(!1),[j,P]=(0,In.useState)({lineNumbers:w.lineNumbers??!1,minimap:w.minimap??!1,wordWrap:w.wordWrap??!1,sticky:w.sticky??!0}),_=(0,In.useRef)(null),[R,F]=(0,In.useState)({errors:0,warnings:0}),[I,O]=(0,In.useState)([]),[N,M]=(0,In.useState)(null),D=(0,In.useRef)(null),L=(0,In.useRef)(null);(0,In.useEffect)(()=>{if(!$&&!N)return;const e=e=>{$&&_.current&&!_.current.contains(e.target)&&E(!1),N&&D.current&&!D.current.contains(e.target)&&M(null)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[$,N]);const[A,W]=(0,In.useState)(c??d??l?.[0]?.id??""),V=c??A,B=(0,In.useCallback)(e=>{W(e),u?.(e)},[u]),z=l?.find(e=>e.id===V),q=z?.code??e??"",G=z?.language??n,H=s??a??"Code",U=(0,In.useCallback)(e=>{L.current=e,k?.(e)},[k]),J=(0,In.useCallback)(e=>{F({errors:e.errors,warnings:e.warnings}),O(e.markers),h?.({errors:e.errors,warnings:e.warnings})},[h]),X=(0,In.useCallback)((e,n)=>{const t=L.current;t&&(t.revealLineInCenter(e),t.setPosition({lineNumber:e,column:n}),t.focus(),M(null))},[]),Y={lineNumbers:j.lineNumbers,minimap:j.minimap,wordWrap:j.wordWrap,sticky:j.sticky},K=(0,Nn.jsxs)("div",{style:{display:"flex",gap:"4px",alignItems:"center"},children:[R.errors>0&&(0,Nn.jsxs)("div",{ref:"error"===N?D:void 0,style:{position:"relative"},children:[(0,Nn.jsxs)("button",{className:"elb-codebox-marker-badge elb-codebox-marker-badge--error",onClick:()=>M("error"===N?null:"error"),children:[(0,Nn.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,Nn.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Nn.jsx)("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),(0,Nn.jsx)("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),(0,Nn.jsx)("span",{children:R.errors})]}),"error"===N&&(0,Nn.jsx)(Dn,{markers:I.filter(e=>"error"===e.severity),onJump:X})]}),R.warnings>0&&(0,Nn.jsxs)("div",{ref:"warning"===N?D:void 0,style:{position:"relative"},children:[(0,Nn.jsxs)("button",{className:"elb-codebox-marker-badge elb-codebox-marker-badge--warning",onClick:()=>M("warning"===N?null:"warning"),children:[(0,Nn.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Nn.jsx)("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"}),(0,Nn.jsx)("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),(0,Nn.jsx)("circle",{cx:"12",cy:"17",r:".5"})]}),(0,Nn.jsx)("span",{children:R.warnings})]}),"warning"===N&&(0,Nn.jsx)(Dn,{markers:I.filter(e=>"warning"===e.severity),onJump:X})]}),f&&!r&&"json"===G&&(0,Nn.jsx)("button",{className:"elb-explorer-btn",onClick:()=>{if(t&&!r&&"json"===G)try{const e=JSON.parse(q),n=JSON.stringify(e,null,2);t(n)}catch(e){}},title:"Format JSON",children:(0,Nn.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Nn.jsx)("line",{x1:"3",y1:"5",x2:"16",y2:"5"}),(0,Nn.jsx)("line",{x1:"7",y1:"10",x2:"20",y2:"10"}),(0,Nn.jsx)("line",{x1:"7",y1:"15",x2:"18",y2:"15"}),(0,Nn.jsx)("line",{x1:"3",y1:"20",x2:"12",y2:"20"})]})}),g&&(0,Nn.jsx)("button",{className:"elb-explorer-btn",onClick:async()=>{try{await navigator.clipboard.writeText(q),S(!0),setTimeout(()=>S(!1),2e3)}catch{}},title:C?"Copied!":"Copy to clipboard",children:C?(0,Nn.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,Nn.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,Nn.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Nn.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,Nn.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),m&&(0,Nn.jsxs)("div",{ref:_,style:{position:"relative"},children:[(0,Nn.jsx)("button",{className:"elb-explorer-btn"+($?" active":""),onClick:()=>E(!$),title:"Editor settings",children:(0,Nn.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Nn.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,Nn.jsx)("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"})]})}),$&&(0,Nn.jsxs)("div",{className:"elb-codebox-settings",children:[(0,Nn.jsxs)("label",{className:"elb-codebox-settings-option",children:[(0,Nn.jsx)("input",{type:"checkbox",checked:j.lineNumbers,onChange:()=>P(e=>({...e,lineNumbers:!e.lineNumbers}))}),"Line numbers"]}),(0,Nn.jsxs)("label",{className:"elb-codebox-settings-option",children:[(0,Nn.jsx)("input",{type:"checkbox",checked:j.minimap,onChange:()=>P(e=>({...e,minimap:!e.minimap}))}),"Minimap"]}),(0,Nn.jsxs)("label",{className:"elb-codebox-settings-option",children:[(0,Nn.jsx)("input",{type:"checkbox",checked:j.wordWrap,onChange:()=>P(e=>({...e,wordWrap:!e.wordWrap}))}),"Word wrap"]}),(0,Nn.jsxs)("label",{className:"elb-codebox-settings-option",children:[(0,Nn.jsx)("input",{type:"checkbox",checked:j.sticky,onChange:()=>P(e=>({...e,sticky:!e.sticky}))}),"Sticky scroll"]})]})]})]}),Q=`${o?"elb-box--auto-height":""} ${x||""}`.trim(),Z=l?.map(e=>({id:e.id,label:e.label,content:(0,Nn.jsx)(_n,{code:e.code,language:e.language??n,onChange:t,disabled:r,autoHeight:o,onMount:U,onMarkerCounts:J,...T,...Y})}));return(0,Nn.jsx)(re,{header:H,headerActions:K,showHeader:i,tabs:Z,defaultTab:d,activeTab:c,onTabChange:B,showTrafficLights:p,footer:y,height:b,style:v,className:Q,children:!l&&(0,Nn.jsx)(_n,{code:e??"",language:n,onChange:t,disabled:r,autoHeight:o,onMount:U,onMarkerCounts:J,...T,...Y})})}function Dn({markers:e,onJump:n}){return(0,Nn.jsx)("div",{className:"elb-codebox-marker-menu",children:e.sort((e,n)=>e.line-n.line||e.column-n.column).map((e,t)=>(0,Nn.jsxs)("button",{className:"elb-codebox-marker-menu-item",onClick:()=>n(e.line,e.column),children:[(0,Nn.jsxs)("span",{className:"elb-codebox-marker-menu-line",children:["Ln ",e.line]}),(0,Nn.jsx)("span",{className:"elb-codebox-marker-menu-msg",children:e.message})]},t))})}function Ln(){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 An(){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 Wn(){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)}}}var Vn=require("react/jsx-runtime"),Bn='<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>',zn="* {\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}",qn='{\n "product": {\n "view": {\n "name": "view_item",\n "data": {\n "map": {\n "event": "name",\n "price": "data.price",\n "stage": "context.stage.0"\n }\n }\n },\n "add": {\n "name": "add_to_cart",\n "data": {\n "map": {\n "event": "event",\n "price": "data.price",\n "user": {\n "consent": { "marketing": true },\n "key": "user.session"\n },\n "isSale": {\n "fn": "(e) => !!e.data.old_price"\n }\n }\n }\n },\n "save": {\n "data": {\n "map": {\n "event": "event",\n "data": "data"\n }\n }\n }\n }\n}';function Gn({initialHtml:e=Bn,initialCss:n=zn,initialJs:t="",initialMapping:r=qn,labelCode:o="Code",labelPreview:a="Preview",labelEvents:s="Events",labelMapping:i="Mapping",labelResult:l="Result",destination:c}){const u=(0,B.useMemo)(()=>c??Ln(),[c]),[d,p]=(0,B.useState)(e),[g,f]=(0,B.useState)(n),[m,h]=(0,B.useState)(t),[y,b]=(0,B.useState)(r),[v,x]=(0,B.useState)("// Click elements in the preview to see events"),[w,k]=(0,B.useState)("// Click elements in the preview to see function call"),T=(0,B.useRef)(null),C=(0,B.useRef)(null),S=(0,B.useRef)(null),[$,E]=(0,B.useState)(!1);(0,B.useEffect)(()=>{let e=!0;return(async()=>{try{const n=JSON.parse(r),{collector:t,elb:o}=await(0,z.startFlow)({destinations:{rawCapture:{code:{type:"rawCapture",config:{},push:async n=>{e&&(S.current=n,x(JSON.stringify(n,null,2)))}}},gtag:{code:u,config:{mapping:n},env:{elb:n=>{e&&k(n)}}}},consent:{functional:!0,marketing:!0},user:{session:"playground"}});if(!e)return;T.current=t,C.current=o,E(!0)}catch{}})(),()=>{e=!1,T.current}},[r,u]);const j=(0,B.useCallback)(e=>{b(e);const n=setTimeout(()=>{try{const n=JSON.parse(e);T.current?.destinations?.gtag?.config&&(T.current.destinations.gtag.config.mapping=n),S.current&&T.current&&T.current.push(S.current)}catch{}},500);return()=>clearTimeout(n)},[]);return(0,Vn.jsxs)(X,{columns:5,rowHeight:600,children:[(0,Vn.jsx)(Fn,{label:o,html:d,css:g,js:m,onHtmlChange:p,onCssChange:f,onJsChange:h,showPreview:!1,initialTab:"html",lineNumbers:!1,wordWrap:!0}),(0,Vn.jsx)(le,{label:a,html:d,css:g,elb:$?C.current??void 0:void 0}),(0,Vn.jsx)(Mn,{label:s,code:v,onChange:x,language:"json",wordWrap:!0}),(0,Vn.jsx)(Mn,{label:i,code:y,onChange:j,language:"json",wordWrap:!0}),(0,Vn.jsx)(Mn,{label:l,code:w,language:"javascript",disabled:!0,wordWrap:!0})]})}var Hn=require("react"),Un=require("@walkeros/core"),Jn=p(require("prettier/standalone"),1),Xn=p(require("prettier/plugins/babel"),1),Yn=p(require("prettier/plugins/estree"),1),Kn=p(require("prettier/plugins/typescript"),1),Qn=p(require("prettier/plugins/html"),1);async function Zn(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 Jn.format(r,{parser:"babel",plugins:[Xn.default,Yn.default],semi:!0,singleQuote:!0,trailingComma:"all"}),n&&(t=t.replace(/^\(/,"").replace(/\);?\s*$/,""));break}case"typescript":case"ts":case"tsx":t=await Jn.format(e,{parser:"typescript",plugins:[Kn.default,Yn.default],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 Jn.format(e,{parser:"html",plugins:[Qn.default],htmlWhitespaceSensitivity:"css"});break;case"css":case"scss":t=await Jn.format(e,{parser:"css",plugins:[Qn.default]});break;default:return e}return t.trim()}catch(n){return e}}var et=require("react/jsx-runtime");function nt(e,n={}){if(void 0===e)return"";const t=(0,Un.isString)(e)?e.trim():JSON.stringify(e,null,2);return n.quotes&&(0,Un.isString)(e)?`"${t}"`:t}function tt({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:u=!1,disableConfig:d=!1,showQuotes:p=!0,className:g,language:f="json",format:m=!0,rowHeight:h,outputLanguage:y="json",configLanguage:b="json"}){const[v,x]=(0,Hn.useState)(nt(e)),[w,k]=(0,Hn.useState)(nt(n)),[T,C]=(0,Hn.useState)([nt(t)]);(0,Hn.useEffect)(()=>{if(m&&e){Zn(nt(e),f).then(x)}},[e,f,m]),(0,Hn.useEffect)(()=>{if(m&&n){Zn(nt(n),f).then(k)}},[n,f,m]);const S=(0,Hn.useCallback)((...e)=>{const n=e.map(e=>nt(e,{quotes:p})).join(", ");C([a?`${a}(${n})`:n])},[a,p]),$=(0,Hn.useCallback)((0,Un.debounce)(async(e,n,t)=>{o&&(C([]),await(0,Un.tryCatchAsync)(o,e=>{C([`Error: ${String(e)}`])})(e,n,S,t))},500,!0),[o,S]);return(0,Hn.useEffect)(()=>{$(v,w,r||{})},[v,w,r,$]),(0,et.jsxs)(X,{columns:3,className:g,rowHeight:h,children:[(0,et.jsx)(Mn,{label:s,code:v,onChange:u?void 0:x,disabled:u,language:f,showFormat:!u&&"json"===f}),w&&(0,et.jsx)(Mn,{label:i,code:w,onChange:d?void 0:k,disabled:d,language:b,showFormat:!d&&"json"===b}),(0,et.jsx)(Mn,{label:l,code:T[0]||c,disabled:!0,language:y})]})}var rt=require("react"),ot=require("@walkeros/collector"),at=require("react/jsx-runtime");function st({event:e,mapping:n,destination:t,label:r="Result",wordWrap:o=!1}){const[a,s]=(0,rt.useState)("// Click elements in the preview to see function call");return(0,rt.useEffect)(()=>{(async()=>{try{const r=JSON.parse(e),o=JSON.parse(n),{collector:a}=await(0,ot.startFlow)({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]),(0,at.jsx)(Mn,{code:a,language:"javascript",disabled:!0,label:r,wordWrap:o})}var it=require("react");var lt=Object.freeze({left:0,top:0,width:16,height:16}),ct=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ut=Object.freeze({...lt,...ct}),dt=Object.freeze({...ut,body:"",hidden:!1});function pt(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 dt)r in ct?r in e&&!(r in t)&&(t[r]=ct[r]):r in n?t[r]=n[r]:r in e&&(t[r]=e[r]);return t}function gt(e,n,t){const r=e.icons,o=e.aliases||Object.create(null);let a={};function s(e){a=pt(r[e]||o[e],a)}return s(n),t.forEach(s),pt(e,a)}function ft(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,gt(e,o,a)),t.push(o))}return t}var mt={provider:"",aliases:{},not_found:{},...lt};function ht(e,n){for(const t in n)if(t in e&&typeof e[t]!=typeof n[t])return!1;return!0}function yt(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(!ht(e,mt))return null;const t=n.icons;for(const e in t){const n=t[e];if(!e||"string"!=typeof n.body||!ht(n,dt))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]||!ht(n,dt))return null}return n}var bt=Object.create(null);function vt(e,n){const t=bt[e]||(bt[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 xt(e,n){return yt(n)?ft(n,(n,t)=>{t?e.icons[n]=t:e.missing.add(n)}):[]}var wt=/^[a-z0-9]+(-[a-z0-9]+)*$/,kt=(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&&!Tt(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&&!Tt(e)?null:e}if(t&&""===r){const e={provider:r,prefix:"",name:a};return n&&!Tt(e,t)?null:e}return null},Tt=(e,n)=>!!e&&!(!(n&&""===e.prefix||e.prefix)||!e.name),Ct=!1;function St(e){return"boolean"==typeof e&&(Ct=e),Ct}function $t(e){const n="string"==typeof e?kt(e,!0,Ct):e;if(n){const e=vt(n.provider,n.prefix),t=n.name;return e.icons[t]||(e.missing.has(t)?null:void 0)}}function Et(e,n){const t=kt(e,!0,Ct);if(!t)return!1;const r=vt(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 jt=Object.freeze({width:null,height:null}),Pt=Object.freeze({...jt,...ct}),_t=/(-?[0-9.]*[0-9]+[0-9.]*)/g,Rt=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Ft(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(_t);if(null===r||!r.length)return e;const o=[];let a=r.shift(),s=Rt.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 It=/\sid="(\S+)"/g,Ot="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16),Nt=0;function Mt(e,n=Ot){const t=[];let r;for(;r=It.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+(Nt++).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 Dt=Object.create(null);function Lt(e){return Dt[e]||Dt[""]}function At(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 Wt=Object.create(null),Vt=["https://api.simplesvg.com","https://api.unisvg.com"],Bt=[];Vt.length>0;)1===Vt.length||Math.random()>.5?Bt.push(Vt.shift()):Bt.push(Vt.pop());function zt(e,n){const t=At(n);return null!==t&&(Wt[e]=t,!0)}function qt(e){return Wt[e]}Wt[""]=At({resources:["https://api.iconify.design"].concat(Bt)});var Gt=(()=>{let e;try{if(e=fetch,"function"==typeof e)return e}catch(e){}})();var Ht={prepare:(e,n,t)=>{const r=[],o=function(e,n){const t=qt(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(!Gt)return void t("abort",424);let r=function(e){if("string"==typeof e){const n=qt(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;Gt(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 Ut(e,n){e.forEach(e=>{const t=e.loaderCallbacks;t&&(e.loaderCallbacks=t.filter(e=>e.id!==n))})}var Jt=0;var Xt={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Yt(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",u=0,d=null,p=[],g=[];function f(){d&&(clearTimeout(d),d=null)}function m(){"pending"===c&&(c="aborted"),f(),p.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),p=[]}function h(e,n){n&&(g=[]),"function"==typeof e&&g.push(e)}function y(){c="failed",g.forEach(e=>{e(void 0,l)})}function b(){p.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),p=[]}function v(){if("pending"!==c)return;f();const r=s.shift();if(void 0===r)return p.length?void(d=setTimeout(()=>{f(),"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(f(),b(),!e.random){const t=e.resources.indexOf(n.resource);-1!==t&&t!==e.index&&(e.index=t)}c="completed",g.forEach(e=>{e(r)})}(o,n,t)}};p.push(o),u++,d=setTimeout(v,e.rotate),t(r,n,o.callback)}return"function"==typeof r&&g.push(r),setTimeout(v),function(){return{startTime:i,payload:n,status:c,queriesSent:u,queriesPending:p.length,subscribe:h,abort:m}}}function Kt(e){const n={...Xt,...e};let t=[];function r(){t=t.filter(e=>"pending"===e().status)}return{query:function(e,o,a){const s=Yt(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 Qt(){}var Zt=Object.create(null);function er(e,n,t){let r,o;if("string"==typeof e){const n=Lt(e);if(!n)return t(void 0,424),Qt;o=n.send;const a=function(e){if(!Zt[e]){const n=qt(e);if(!n)return;const t={config:n,redundancy:Kt(n)};Zt[e]=t}return Zt[e]}(e);a&&(r=a.redundancy)}else{const n=At(e);if(n){r=Kt(n);const t=Lt(e.resources?e.resources[0]:"");t&&(o=t.send)}}return r&&o?r.query(n,o,t)().abort:(t(void 0,424),Qt)}function nr(){}function tr(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||Ut([e],n.id),n.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),n.abort))})}))}(e)}))}function rr(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(!xt(e,t).length)return void r()}catch(e){console.error(e)}r(),tr(e)}function or(e,n){e instanceof Promise?e.then(e=>{n(e)}).catch(()=>{n(null)}):n(e)}function ar(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 or(e.loadIcons(r,t,n),n=>{rr(e,r,n)});if(o)return void r.forEach(r=>{or(o(r,t,n),n=>{rr(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(wt)?n:t).push(e)}),{valid:n,invalid:t}}(r);if(s.length&&rr(e,s,null),!a.length)return;const i=t.match(wt)?Lt(n):null;if(!i)return void rr(e,a,null);i.prepare(n,t,a).forEach(t=>{er(n,t,n=>{rr(e,t.icons,n)})})}))}var sr=(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]=vt(o,a));let c;c=s in l.icons?n.loaded:""===a||l.missing.has(s)?n.missing:n.pending;const u={provider:o,prefix:a,name:s};c.push(u)}),n}(function(e,n=!0,t=!1){const r=[];return e.forEach(e=>{const o="string"==typeof e?kt(e,n,t):e;o&&r.push(o)}),r}(e,!0,St()));if(!t.pending.length){let e=!0;return n&&setTimeout(()=>{e&&n(t.loaded,t.missing,t.pending,nr)}),()=>{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(vt(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=vt(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&&ar(e,n)}),n?function(e,n,t){const r=Jt++,o=Ut.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):nr};var ir,lr=/[\s,]+/;function cr(e,n){n.split(lr).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}function ur(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 dr(e){return void 0===ir&&function(){try{ir=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch(e){ir=null}}(),ir?ir.createHTML(e):e}var pr={...Pt,inline:!1},gr={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},fr={display:"inline-block"},mr={backgroundColor:"currentColor"},hr={backgroundColor:"transparent"},yr={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},br={WebkitMask:mr,mask:mr,background:hr};for(const e in br){const n=br[e];for(const t in yr)n[e+t]=yr[t]}var vr={...pr,inline:!0};function xr(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}var wr,kr=(e,n,t)=>{const r=n.inline?vr:pr,o=function(e,n){const t={...e};for(const e in n){const r=n[e],o=typeof r;e in jt?(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?gr:{}};if(t){const e=kt(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&&cr(o,t);break;case"color":s.color=t;break;case"rotate":"string"==typeof t?o[e]=ur(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={...ut,...e},r={...Pt,...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 u,d;null===s?(d=null===i?"1em":"auto"===i?c:i,u=Ft(d,l/c)):(u="auto"===s?l:s,d=null===i?Ft(u,c/l):"auto"===i?c:i);const p={},g=(e,n)=>{(e=>"unset"===e||"undefined"===e||"none"===e)(n)||(p[e]=n.toString())};g("width",u),g("height",d);const f=[o.left,o.top,l,c];return p.viewBox=f.join(" "),{attributes:p,viewBox:f,body:a}}(e,o),u=c.attributes;if(o.inline&&(s.verticalAlign="-0.125em"),"svg"===a){l.style={...s,...i},Object.assign(l,u);let e=0,t=n.id;return"string"==typeof t&&(t=t.replace(/-/g,"_")),l.dangerouslySetInnerHTML={__html:dr(Mt(c.body,t?()=>t+"ID"+e++:"iconifyReact"))},(0,it.createElement)("svg",l)}const{body:d,width:p,height:g}=e,f="mask"===a||"bg"!==a&&-1!==d.indexOf("currentColor"),m=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>"}(d,{...u,width:p+"",height:g+""});var h;return l.style={...s,"--svg":(h=m,'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)}(h)+'")'),width:xr(u.width),height:xr(u.height),...fr,...f?mr:hr,...i},(0,it.createElement)("span",l)};if(St(!0),wr=Ht,Dt[""]=wr,"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||""),Ct&&!n&&!e.prefix){let n=!1;return yt(e)&&(e.prefix="",ft(e,(e,t)=>{Et(e,t)&&(n=!0)})),n}const t=e.prefix;return!!Tt({prefix:t,name:"a"})&&!!xt(vt(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;zt(e,r)||console.error(t)}catch(e){console.error(t)}}}}function Tr(e){const[n,t]=(0,it.useState)(!!e.ssr),[r,o]=(0,it.useState)({});const[a,s]=(0,it.useState)(function(n){if(n){const n=e.icon;if("object"==typeof n)return{name:"",data:n};const t=$t(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=$t(t);if(l({name:t,data:r}))if(void 0===r){const e=sr([t],c);o({callback:e})}else r&&(null===(n=e.onLoad)||void 0===n||n.call(e,t))}(0,it.useEffect)(()=>(t(!0),i),[]),(0,it.useEffect)(()=>{n&&c()},[e.icon,n]);const{name:u,data:d}=a;return d?kr({...ut,...d},e,u):e.children?e.children:e.fallback?e.fallback:(0,it.createElement)("span",{})}var Cr=(0,it.forwardRef)((e,n)=>Tr({...e,_ref:n}));(0,it.forwardRef)((e,n)=>Tr({inline:!0,...e,_ref:n}));function Sr(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=Sr(e[n]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}var $r=(e=new Map,n=null,t)=>({nextPart:e,validators:n,classGroupId:t}),Er="-",jr=[],Pr=e=>{const n=Fr(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return Rr(e);const t=e.split(Er),r=""===t[0]&&t.length>1?1:0;return _r(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||jr}return t[e]||jr}}},_r=(e,n,t)=>{if(0===e.length-n)return t.classGroupId;const r=e[n],o=t.nextPart.get(r);if(o){const t=_r(e,n+1,o);if(t)return t}const a=t.validators;if(null===a)return;const s=0===n?e.join(Er):e.slice(n).join(Er),i=a.length;for(let e=0;e<i;e++){const n=a[e];if(n.validator(s))return n.classGroupId}},Rr=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})(),Fr=e=>{const{theme:n,classGroups:t}=e;return Ir(t,n)},Ir=(e,n)=>{const t=$r();for(const r in e){const o=e[r];Or(o,t,r,n)}return t},Or=(e,n,t,r)=>{const o=e.length;for(let a=0;a<o;a++){const o=e[a];Nr(o,n,t,r)}},Nr=(e,n,t,r)=>{"string"!=typeof e?"function"!=typeof e?Lr(e,n,t,r):Dr(e,n,t,r):Mr(e,n,t)},Mr=(e,n,t)=>{(""===e?n:Ar(n,e)).classGroupId=t},Dr=(e,n,t,r)=>{Wr(e)?Or(e(r),n,t,r):(null===n.validators&&(n.validators=[]),n.validators.push(((e,n)=>({classGroupId:e,validator:n}))(t,e)))},Lr=(e,n,t,r)=>{const o=Object.entries(e),a=o.length;for(let e=0;e<a;e++){const[a,s]=o[e];Or(s,Ar(n,a),t,r)}},Ar=(e,n)=>{let t=e;const r=n.split(Er),o=r.length;for(let e=0;e<o;e++){const n=r[e];let o=t.nextPart.get(n);o||(o=$r(),t.nextPart.set(n,o)),t=o}return t},Wr=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,Vr=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)}}},Br=[],zr=(e,n,t,r,o)=>({modifiers:e,hasImportantModifier:n,baseClassName:t,maybePostfixModifierPosition:r,isExternal:o}),qr=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 zr(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)):zr(Br,!1,n,void 0,!0)}if(t){const e=r;r=n=>t({className:n,parseClassName:e})}return r},Gr=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}},Hr=/\s+/,Ur=e=>{if("string"==typeof e)return e;let n,t="";for(let r=0;r<e.length;r++)e[r]&&(n=Ur(e[r]))&&(t&&(t+=" "),t+=n);return t},Jr=[],Xr=e=>{const n=n=>n[e]||Jr;return n.isThemeGetter=!0,n},Yr=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Kr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Qr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Zr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eo=/\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$/,no=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,to=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ro=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oo=e=>Qr.test(e),ao=e=>!!e&&!Number.isNaN(Number(e)),so=e=>!!e&&Number.isInteger(Number(e)),io=e=>e.endsWith("%")&&ao(e.slice(0,-1)),lo=e=>Zr.test(e),co=()=>!0,uo=e=>eo.test(e)&&!no.test(e),po=()=>!1,go=e=>to.test(e),fo=e=>ro.test(e),mo=e=>!yo(e)&&!So(e),ho=e=>Io(e,Do,po),yo=e=>Yr.test(e),bo=e=>Io(e,Lo,uo),vo=e=>Io(e,Ao,ao),xo=e=>Io(e,Vo,co),wo=e=>Io(e,Wo,po),ko=e=>Io(e,No,po),To=e=>Io(e,Mo,fo),Co=e=>Io(e,Bo,go),So=e=>Kr.test(e),$o=e=>Oo(e,Lo),Eo=e=>Oo(e,Wo),jo=e=>Oo(e,No),Po=e=>Oo(e,Do),_o=e=>Oo(e,Mo),Ro=e=>Oo(e,Bo,!0),Fo=e=>Oo(e,Vo,!0),Io=(e,n,t)=>{const r=Yr.exec(e);return!!r&&(r[1]?n(r[1]):t(r[2]))},Oo=(e,n,t=!1)=>{const r=Kr.exec(e);return!!r&&(r[1]?n(r[1]):t)},No=e=>"position"===e||"percentage"===e,Mo=e=>"image"===e||"url"===e,Do=e=>"length"===e||"size"===e||"bg-size"===e,Lo=e=>"length"===e,Ao=e=>"number"===e,Wo=e=>"family-name"===e,Vo=e=>"number"===e||"weight"===e,Bo=e=>"shadow"===e,zo=((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}=n,s=[],i=e.trim().split(Hr);let l="";for(let e=i.length-1;e>=0;e-=1){const n=i[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:g}=t(n);if(c){l=n+(l.length>0?" "+l:l);continue}let f=!!g,m=r(f?p.substring(0,g):p);if(!m){if(!f){l=n+(l.length>0?" "+l:l);continue}if(m=r(p),!m){l=n+(l.length>0?" "+l:l);continue}f=!1}const h=0===u.length?"":1===u.length?u[0]:a(u).join(":"),y=d?h+"!":h,b=y+m;if(s.indexOf(b)>-1)continue;s.push(b);const v=o(m,f);for(let e=0;e<v.length;++e){const n=v[e];s.push(y+n)}l=n+(l.length>0?" "+l:l)}return l})(e,t);return o(e,a),a};return a=i=>{const l=n.reduce((e,n)=>n(e),e());return t=(e=>({cache:Vr(e.cacheSize),parseClassName:qr(e),sortModifiers:Gr(e),...Pr(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=Ur(n))&&(o&&(o+=" "),o+=t);return o})(...e))})(()=>{const e=Xr("color"),n=Xr("font"),t=Xr("text"),r=Xr("font-weight"),o=Xr("tracking"),a=Xr("leading"),s=Xr("breakpoint"),i=Xr("container"),l=Xr("spacing"),c=Xr("radius"),u=Xr("shadow"),d=Xr("inset-shadow"),p=Xr("text-shadow"),g=Xr("drop-shadow"),f=Xr("blur"),m=Xr("perspective"),h=Xr("aspect"),y=Xr("ease"),b=Xr("animate"),v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",So,yo],x=()=>[So,yo,l],w=()=>[oo,"full","auto",...x()],k=()=>[so,"none","subgrid",So,yo],T=()=>["auto",{span:["full",so,So,yo]},so,So,yo],C=()=>[so,"auto",So,yo],S=()=>["auto","min","max","fr",So,yo],$=()=>["auto",...x()],E=()=>[oo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],j=()=>[oo,"screen","full","dvw","lvw","svw","min","max","fit",...x()],P=()=>[oo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...x()],_=()=>[e,So,yo],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",jo,ko,{position:[So,yo]}],F=()=>["auto","cover","contain",Po,ho,{size:[So,yo]}],I=()=>[io,$o,bo],O=()=>["","none","full",c,So,yo],N=()=>["",ao,$o,bo],M=()=>[ao,io,jo,ko],D=()=>["","none",f,So,yo],L=()=>["none",ao,So,yo],A=()=>["none",ao,So,yo],W=()=>[ao,So,yo],V=()=>[oo,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[lo],breakpoint:[lo],color:[co],container:[lo],"drop-shadow":[lo],ease:["in","out","in-out"],font:[mo],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[lo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[lo],shadow:[lo],spacing:["px",ao],text:[lo],"text-shadow":[lo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oo,yo,So,h]}],container:["container"],columns:[{columns:[ao,yo,So,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:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[so,"auto",So,yo]}],basis:[{basis:[oo,"full","auto",i,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ao,oo,"auto","initial","none",yo]}],grow:[{grow:["",ao,So,yo]}],shrink:[{shrink:["",ao,So,yo]}],order:[{order:[so,"first","last","none",So,yo]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:T()}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:T()}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":S()}],"auto-rows":[{"auto-rows":S()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"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:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pbs:[{pbs:x()}],pbe:[{pbe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],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":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:E()}],"inline-size":[{inline:["auto",...j()]}],"min-inline-size":[{"min-inline":["auto",...j()]}],"max-inline-size":[{"max-inline":["none",...j()]}],"block-size":[{block:["auto",...P()]}],"min-block-size":[{"min-block":["auto",...P()]}],"max-block-size":[{"max-block":["none",...P()]}],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,$o,bo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Fo,xo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",io,yo]}],"font-family":[{font:[Eo,wo,n]}],"font-features":[{"font-features":[yo]}],"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,So,yo]}],"line-clamp":[{"line-clamp":[ao,"none",So,vo]}],leading:[{leading:[a,...x()]}],"list-image":[{"list-image":["none",So,yo]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",So,yo]}],"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:[ao,"from-font","auto",So,bo]}],"text-decoration-color":[{decoration:_()}],"underline-offset":[{"underline-offset":[ao,"auto",So,yo]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",So,yo]}],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",So,yo]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"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"]},so,So,yo],radial:["",So,yo],conic:[so,So,yo]},_o,To]}],"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:O()}],"rounded-s":[{"rounded-s":O()}],"rounded-e":[{"rounded-e":O()}],"rounded-t":[{"rounded-t":O()}],"rounded-r":[{"rounded-r":O()}],"rounded-b":[{"rounded-b":O()}],"rounded-l":[{"rounded-l":O()}],"rounded-ss":[{"rounded-ss":O()}],"rounded-se":[{"rounded-se":O()}],"rounded-ee":[{"rounded-ee":O()}],"rounded-es":[{"rounded-es":O()}],"rounded-tl":[{"rounded-tl":O()}],"rounded-tr":[{"rounded-tr":O()}],"rounded-br":[{"rounded-br":O()}],"rounded-bl":[{"rounded-bl":O()}],"border-w":[{border:N()}],"border-w-x":[{"border-x":N()}],"border-w-y":[{"border-y":N()}],"border-w-s":[{"border-s":N()}],"border-w-e":[{"border-e":N()}],"border-w-bs":[{"border-bs":N()}],"border-w-be":[{"border-be":N()}],"border-w-t":[{"border-t":N()}],"border-w-r":[{"border-r":N()}],"border-w-b":[{"border-b":N()}],"border-w-l":[{"border-l":N()}],"divide-x":[{"divide-x":N()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":N()}],"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":[ao,So,yo]}],"outline-w":[{outline:["",ao,$o,bo]}],"outline-color":[{outline:_()}],shadow:[{shadow:["","none",u,Ro,Co]}],"shadow-color":[{shadow:_()}],"inset-shadow":[{"inset-shadow":["none",d,Ro,Co]}],"inset-shadow-color":[{"inset-shadow":_()}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:_()}],"ring-offset-w":[{"ring-offset":[ao,bo]}],"ring-offset-color":[{"ring-offset":_()}],"inset-ring-w":[{"inset-ring":N()}],"inset-ring-color":[{"inset-ring":_()}],"text-shadow":[{"text-shadow":["none",p,Ro,Co]}],"text-shadow-color":[{"text-shadow":_()}],opacity:[{opacity:[ao,So,yo]}],"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":[ao]}],"mask-image-linear-from-pos":[{"mask-linear-from":M()}],"mask-image-linear-to-pos":[{"mask-linear-to":M()}],"mask-image-linear-from-color":[{"mask-linear-from":_()}],"mask-image-linear-to-color":[{"mask-linear-to":_()}],"mask-image-t-from-pos":[{"mask-t-from":M()}],"mask-image-t-to-pos":[{"mask-t-to":M()}],"mask-image-t-from-color":[{"mask-t-from":_()}],"mask-image-t-to-color":[{"mask-t-to":_()}],"mask-image-r-from-pos":[{"mask-r-from":M()}],"mask-image-r-to-pos":[{"mask-r-to":M()}],"mask-image-r-from-color":[{"mask-r-from":_()}],"mask-image-r-to-color":[{"mask-r-to":_()}],"mask-image-b-from-pos":[{"mask-b-from":M()}],"mask-image-b-to-pos":[{"mask-b-to":M()}],"mask-image-b-from-color":[{"mask-b-from":_()}],"mask-image-b-to-color":[{"mask-b-to":_()}],"mask-image-l-from-pos":[{"mask-l-from":M()}],"mask-image-l-to-pos":[{"mask-l-to":M()}],"mask-image-l-from-color":[{"mask-l-from":_()}],"mask-image-l-to-color":[{"mask-l-to":_()}],"mask-image-x-from-pos":[{"mask-x-from":M()}],"mask-image-x-to-pos":[{"mask-x-to":M()}],"mask-image-x-from-color":[{"mask-x-from":_()}],"mask-image-x-to-color":[{"mask-x-to":_()}],"mask-image-y-from-pos":[{"mask-y-from":M()}],"mask-image-y-to-pos":[{"mask-y-to":M()}],"mask-image-y-from-color":[{"mask-y-from":_()}],"mask-image-y-to-color":[{"mask-y-to":_()}],"mask-image-radial":[{"mask-radial":[So,yo]}],"mask-image-radial-from-pos":[{"mask-radial-from":M()}],"mask-image-radial-to-pos":[{"mask-radial-to":M()}],"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":[ao]}],"mask-image-conic-from-pos":[{"mask-conic-from":M()}],"mask-image-conic-to-pos":[{"mask-conic-to":M()}],"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:R()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",So,yo]}],filter:[{filter:["","none",So,yo]}],blur:[{blur:D()}],brightness:[{brightness:[ao,So,yo]}],contrast:[{contrast:[ao,So,yo]}],"drop-shadow":[{"drop-shadow":["","none",g,Ro,Co]}],"drop-shadow-color":[{"drop-shadow":_()}],grayscale:[{grayscale:["",ao,So,yo]}],"hue-rotate":[{"hue-rotate":[ao,So,yo]}],invert:[{invert:["",ao,So,yo]}],saturate:[{saturate:[ao,So,yo]}],sepia:[{sepia:["",ao,So,yo]}],"backdrop-filter":[{"backdrop-filter":["","none",So,yo]}],"backdrop-blur":[{"backdrop-blur":D()}],"backdrop-brightness":[{"backdrop-brightness":[ao,So,yo]}],"backdrop-contrast":[{"backdrop-contrast":[ao,So,yo]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ao,So,yo]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ao,So,yo]}],"backdrop-invert":[{"backdrop-invert":["",ao,So,yo]}],"backdrop-opacity":[{"backdrop-opacity":[ao,So,yo]}],"backdrop-saturate":[{"backdrop-saturate":[ao,So,yo]}],"backdrop-sepia":[{"backdrop-sepia":["",ao,So,yo]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",So,yo]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ao,"initial",So,yo]}],ease:[{ease:["linear","initial",y,So,yo]}],delay:[{delay:[ao,So,yo]}],animate:[{animate:["none",b,So,yo]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,So,yo]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:L()}],"rotate-x":[{"rotate-x":L()}],"rotate-y":[{"rotate-y":L()}],"rotate-z":[{"rotate-z":L()}],scale:[{scale:A()}],"scale-x":[{"scale-x":A()}],"scale-y":[{"scale-y":A()}],"scale-z":[{"scale-z":A()}],"scale-3d":["scale-3d"],skew:[{skew:W()}],"skew-x":[{"skew-x":W()}],"skew-y":[{"skew-y":W()}],transform:[{transform:[So,yo,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:V()}],"translate-x":[{"translate-x":V()}],"translate-y":[{"translate-y":V()}],"translate-z":[{"translate-z":V()}],"translate-none":["translate-none"],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",So,yo]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mbs":[{"scroll-mbs":x()}],"scroll-mbe":[{"scroll-mbe":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pbs":[{"scroll-pbs":x()}],"scroll-pbe":[{"scroll-pbe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"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",So,yo]}],fill:[{fill:["none",..._()]}],"stroke-w":[{stroke:[ao,$o,bo,vo]}],stroke:[{stroke:["none",..._()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function qo(...e){return zo(function(){for(var e,n,t=0,r="",o=arguments.length;t<o;t++)(e=arguments[t])&&(n=Sr(e))&&(r&&(r+=" "),r+=n);return r}(e))}var Go=require("react/jsx-runtime");function Ho({sources:e,center:n,centerTitle:t,destinations:r,arrowRight:o=(0,Go.jsx)(Cr,{icon:"mdi:arrow-right"}),arrowDown:a=(0,Go.jsx)(Cr,{icon:"mdi:arrow-down"}),className:s}){return(0,Go.jsx)("div",{className:qo("elb-architecture-flow",s),children:(0,Go.jsxs)("div",{className:"elb-architecture-flow__grid",children:[(0,Go.jsx)("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--desktop",children:e.title}),(0,Go.jsx)("div",{className:"elb-architecture-flow__spacer"}),(0,Go.jsx)("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--desktop",children:t}),(0,Go.jsx)("div",{className:"elb-architecture-flow__spacer"}),(0,Go.jsx)("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--desktop",children:r.title}),(0,Go.jsxs)("div",{className:"elb-architecture-flow__column",children:[(0,Go.jsx)("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--mobile",children:e.title}),(0,Go.jsx)("div",{className:"elb-architecture-flow__sections",children:e.sections.map(e=>(0,Go.jsx)(Uo,{section:e},e.title))})]}),(0,Go.jsx)("div",{className:"elb-architecture-flow__arrow elb-architecture-flow__arrow--desktop",children:o}),(0,Go.jsx)("div",{className:"elb-architecture-flow__arrow elb-architecture-flow__arrow--mobile",children:a}),(0,Go.jsxs)("div",{className:"elb-architecture-flow__center",children:[(0,Go.jsx)("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--mobile",children:t}),(0,Go.jsx)("div",{className:"elb-architecture-flow__center-content",children:n})]}),(0,Go.jsx)("div",{className:"elb-architecture-flow__arrow elb-architecture-flow__arrow--desktop",children:o}),(0,Go.jsx)("div",{className:"elb-architecture-flow__arrow elb-architecture-flow__arrow--mobile",children:a}),(0,Go.jsxs)("div",{className:"elb-architecture-flow__column",children:[(0,Go.jsx)("span",{className:"elb-architecture-flow__title elb-architecture-flow__title--mobile",children:r.title}),(0,Go.jsx)("div",{className:"elb-architecture-flow__sections",children:r.sections.map(e=>(0,Go.jsx)(Uo,{section:e},e.title))})]})]})})}function Uo({section:e}){return(0,Go.jsxs)("div",{className:"elb-architecture-flow__section",children:[(0,Go.jsx)("span",{className:"elb-architecture-flow__section-title",children:e.title}),(0,Go.jsxs)("div",{className:"elb-architecture-flow__items",children:[e.items.map(e=>{const n=(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)("span",{className:"elb-architecture-flow__item-icon",children:e.icon}),(0,Go.jsx)("span",{className:"elb-architecture-flow__item-label",children:e.label})]});return e.link?(0,Go.jsx)("a",{href:e.link,className:"elb-architecture-flow__item elb-architecture-flow__item--link",children:n},e.label):(0,Go.jsx)("div",{className:"elb-architecture-flow__item",children:n},e.label)}),e.moreLink?(0,Go.jsx)("a",{href:e.moreLink,className:"elb-architecture-flow__more elb-architecture-flow__more--link",children:"and more…"}):(0,Go.jsx)("span",{className:"elb-architecture-flow__more",children:"and more…"})]})]})}var Jo=require("react"),Xo=require("react"),Yo=require("@monaco-editor/react"),Ko=require("react/jsx-runtime"),Qo={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 Zo({original:e,modified:n,language:t="json",height:r="100%",renderSideBySide:o=!0,onSummaryChange:a,beforeMount:s,onMount:i,className:l}){const c=(0,Xo.useRef)(null),u=(0,Xo.useRef)(null),d=(0,Xo.useRef)([]),p=(0,Xo.useRef)(a);p.current=a;const[g,f]=(0,Xo.useState)(ye);(0,Xo.useEffect)(()=>{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;f(n?he:ye)};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)}},[]),(0,Xo.useEffect)(()=>{u.current?.updateOptions({renderSideBySide:o})},[o]);const m=(0,Xo.useCallback)(e=>{Ne(e),s?.(e)},[s]),h=(0,Xo.useCallback)((e,n)=>{u.current=e,d.current.push(Ae(e.getOriginalEditor())),d.current.push(Ae(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})});d.current.push(()=>t.dispose()),i?.(e)},[i]);(0,Xo.useEffect)(()=>()=>{for(const e of d.current)try{e()}catch{}d.current=[]},[]);const y=(0,Xo.useMemo)(()=>({...Qo,renderSideBySide:o}),[o]);return(0,Ko.jsx)("div",{ref:c,className:l,style:{height:"100%",width:"100%"},children:(0,Ko.jsx)(Yo.DiffEditor,{language:t,original:e,modified:n,theme:g,height:r,options:y,beforeMount:m,onMount:h})})}var ea=require("react/jsx-runtime"),na={width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};function ta({summary:e}){return(0,ea.jsxs)("div",{className:"flex items-center gap-1.5 text-xs font-medium tabular-nums",children:[(0,ea.jsxs)("span",{className:"text-green-600 dark:text-green-400",children:["+",e.added]}),(0,ea.jsxs)("span",{className:"text-red-600 dark:text-red-400",children:["-",e.deleted]}),(0,ea.jsxs)("span",{className:"text-zinc-500 dark:text-zinc-400",children:["~",e.modified]})]})}function ra({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(0,ea.jsxs)("div",{className:"flex rounded bg-zinc-100 p-0.5 dark:bg-zinc-800","aria-label":"Diff view mode",children:[(0,ea.jsx)("button",{type:"button",className:`${t} ${"split"===e?r:o}`,"aria-pressed":"split"===e,onClick:()=>n("split"),children:"Split"}),(0,ea.jsx)("button",{type:"button",className:`${t} ${"inline"===e?r:o}`,"aria-pressed":"inline"===e,onClick:()=>n("inline"),children:"Inline"})]})}function oa({value:e}){const[n,t]=(0,Jo.useState)("idle"),r=(0,Jo.useRef)(null);(0,Jo.useEffect)(()=>()=>{null!==r.current&&window.clearTimeout(r.current)},[]);const o="copied"===n?"Copied!":"failed"===n?"Copy failed":"Copy modified to clipboard";return(0,ea.jsxs)("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:[(0,ea.jsx)("span",{className:"sr-only","aria-live":"polite",children:"idle"!==n?o:""}),"copied"===n?(0,ea.jsx)("svg",{...na,children:(0,ea.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,ea.jsxs)("svg",{...na,children:[(0,ea.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,ea.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})]})}function aa({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:u="split",footer:d,height:p,style:g,className:f,onMount:m}){const[h,y]=(0,Jo.useState)(u),[b,v]=(0,Jo.useState)({added:0,deleted:0,modified:0}),x=(0,Jo.useCallback)(e=>v(e),[]),w=o??r??"Diff",k=(0,ea.jsxs)("div",{className:"flex items-center gap-2",children:[c&&(0,ea.jsx)(ta,{summary:b}),l&&(0,ea.jsx)(ra,{view:h,onChange:y}),i&&(0,ea.jsx)(oa,{value:n})]});return(0,ea.jsx)(re,{header:w,headerActions:k,showHeader:a,showTrafficLights:s,footer:d,height:p,style:g,className:f,children:(0,ea.jsx)(Zo,{original:e,modified:n,language:t,renderSideBySide:"split"===h,onSummaryChange:x,onMount:m})})}var sa=require("react"),ia=require("react/jsx-runtime");function la(e){const{code:n,language:t="javascript",className:r,disabled:o=!0,showCopy:a=!0,autoHeight:s={min:20,max:600},fontSize:i=15,format:l=!0,...c}=e,u=`elb-code-snippet ${r||""}`.trim(),[d,p]=(0,sa.useState)(n);return(0,sa.useEffect)(()=>{l&&n?Zn(n,t).then(p):p(n)},[n,t,l]),(0,ia.jsx)(Mn,{...c,code:d,language:t,className:u,showHeader:!1,disabled:o,showCopy:a,autoHeight:s,fontSize:i})}var ca=p(require("react"),1),ua=p(require("roughjs"),1),da=require("react/jsx-runtime");function pa({x:e,y:n,width:t,height:r,fill:o,stroke:a}){const s=(0,ca.useRef)(null);return(0,ca.useEffect)(()=>{if(!s.current)return;const i=s.current.ownerSVGElement;if(!i)return;s.current.replaceChildren();const l=ua.default.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`,u=l.path(c,{fill:o,fillStyle:"solid",stroke:a,strokeWidth:1.5,roughness:1.2,bowing:1});return s.current.appendChild(u),()=>{s.current?.replaceChildren()}},[e,n,t,r,o,a]),(0,da.jsx)("g",{ref:s})}function ga({cx:e,cy:n,diameter:t,fill:r,stroke:o}){const a=(0,ca.useRef)(null);return(0,ca.useEffect)(()=>{if(!a.current)return;const s=a.current.ownerSVGElement;if(!s)return;a.current.replaceChildren();const i=ua.default.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]),(0,da.jsx)("g",{ref:a})}function fa({x:e,y:n,text:t}){return(0,da.jsxs)("g",{children:[(0,da.jsx)(ga,{cx:e,cy:n,diameter:ja,fill:"var(--flow-marker-fill, #dc2626)",stroke:"var(--flow-marker-stroke, #991b1b)"}),(0,da.jsx)("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 ma({fromX:e,fromY:n,toX:t,toY:r,stroke:o,arrowSize:a=8,centerY:s}){const i=(0,ca.useRef)(null);return(0,ca.useEffect)(()=>{if(!i.current)return;const l=i.current.ownerSVGElement;if(!l)return;i.current.replaceChildren();const c=ua.default.svg(l),u=o,d=t-e,p=r-n,g=Math.sqrt(d*d+p*p),f=(e+t)/2,m=(n+r)/2;let h,y;if(Math.abs(p)<2)h=f,y=m-Math.min(.08*g,12);else if(void 0!==s){const t=Math.abs(n-s),o=Math.abs(r-s);h=e+.5*d,y=t>=o?n<s?m-.3*Math.abs(p):m+.3*Math.abs(p):r<s?m-.3*Math.abs(p):m+.3*Math.abs(p)}else h=e+.5*d,y=p>0?n-.3*Math.abs(p):n+.3*Math.abs(p);const b=t-h,v=r-y,x=Math.atan2(v,b),w=t-Math.cos(x)*a,k=r-Math.sin(x)*a,T=`M ${e} ${n} Q ${h} ${y} ${w} ${k}`,C=c.path(T,{stroke:u,strokeWidth:1.5,roughness:.8,fill:"none"});i.current.appendChild(C);const S=Math.PI/6,$=w-8*Math.cos(x-S),E=k-8*Math.sin(x-S),j=c.line(w,k,$,E,{stroke:u,strokeWidth:1.5,roughness:.5});i.current.appendChild(j);const P=w-8*Math.cos(x+S),_=k-8*Math.sin(x+S),R=c.line(w,k,P,_,{stroke:u,strokeWidth:1.5,roughness:.5});return i.current.appendChild(R),()=>{i.current?.replaceChildren()}},[e,n,t,r,o,a,s]),(0,da.jsx)("g",{ref:i})}var ha={labelSize:13,labelWeight:"600",textSize:12,textWeight:"normal",boxHeight:50,descriptionSize:13},ya=120,ba=50,va=12,xa=8,wa=8,ka=25,Ta=30,Ca=6;function Sa(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 $a(e,n){if(!e)return[];const t=new Set;for(const r of n){if(!r||!e[r])continue;Sa(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]),Sa(e,o)}function Ea(e,n){if(!e)return n.length;const t=n.findIndex(n=>n.name===e);return t>=0?t:n.length}var ja=16,Pa=4;function _a({stageBefore:e,sources:n,preTransformers:t,collector:r,postTransformers:o,destinations:a,stageAfter:s,title:i,layout:l=ha,boxHeight:c,descriptionHeight:u,markers:d,className:p,withReturn:g}){const f=Object.entries(n??{default:{}}),m=Object.entries(a??{default:{}}),h=f.map(([,e])=>e.next),y=$a(t,h),b=m.map(([,e])=>e.before),v=$a(o,b),x=[...f].sort(([,e],[,n])=>Ea(e.next,y)-Ea(n.next,y)),w=[...m].sort(([,e],[,n])=>Ea(e.before,v)-Ea(n.before,v)),k=(0,ca.useRef)(null),T=e?.description||f.some(([,e])=>e.description)||y.some(e=>e.config.description)||r?.description||v.some(e=>e.config.description)||m.some(([,e])=>e.description)||s?.description||m.some(([,e])=>e.after?.description),C=!1!==e?.link||f.some(([,e])=>!1!==e.link)||y.some(e=>!1!==e.config.link)||!1!==r?.link||v.some(e=>!1!==e.config.link)||m.some(([,e])=>!1!==e.link)||!1!==s?.link||m.some(([,e])=>!1!==e.after?.link),S=["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"],$=d?.some(e=>{return n=e.position,!!S.includes(n)||/^(source|destination|pre|post)-[^-]+(-left|-right)?$/.test(n);var n})??!1?ja/2+Pa:0,E=d?.filter(e=>e.text)??[],j=E.reduce((e,n)=>e+(n.text?.length??0),0),P=Math.max(1,Math.ceil(j/70)),_=E.length>0?18*P+8:0,R=c??l.boxHeight,F=u??30,I=T||C?F+10:0,O=Math.max(f.length,m.length,1),N=R*O+va*(O-1),M=s||m.some(([,e])=>e.after),D=function(e,n,t){return(n?0:ka)+ya*e+ba*(e-1)+(t?0:ka)}(1+(e?1:0)+y.length+1+v.length+1+(M?1:0),!!e,!!M),L=2*wa+N+I+$+_,A=i?L+Ta:L,W=(i?Ta:0)+wa+$,V=W+N/2,B=(e,n)=>V-(R*n+va*(n-1))/2+e*(R+va);let z=e?0:ka;const q={},G=[],H=[];e&&(q.before={x:z,y:V-R/2,width:ya,height:R},z+=ya+ba);const U=z;x.forEach(([e],n)=>{const t={x:U,y:B(n,x.length),width:ya,height:R};G.push({name:e,pos:t}),q[`source-${e}`]=t}),G.length>0&&(q.source=G[0].pos),z+=ya+ba;const J=[],X=new Map;x.forEach(([e,n])=>{const t=n.next;if(t){const n=X.get(t)??[];n.push(e),X.set(t,n)}}),y.forEach(({name:e,config:n})=>{if(n.next){X.get(e);const t=X.get(n.next)??[];X.set(n.next,[...new Set([...t,`chain:${e}`])])}}),y.forEach(({name:e})=>{const n=X.get(e)??[],t=n.filter(e=>!e.startsWith("chain:")),r=n.some(e=>e.startsWith("chain:"));let o;if(1!==t.length||r)o=V-R/2;else{const e=q[`source-${t[0]}`];o=e?e.y:V-R/2}const a={x:z,y:o,width:ya,height:R};J.push({name:e,pos:a}),q[`pre-${e}`]=a,z+=ya+ba}),q.collector={x:z,y:V-R/2,width:ya,height:R},z+=ya+ba;const Y=[],K=new Map;w.forEach(([e,n])=>{const t=n.before;if(t){const n=K.get(t)??[];n.push(e),K.set(t,n)}});for(let e=v.length-1;e>=0;e--){const{name:n,config:t}=v[e];if(t.next){K.get(t.next);const e=K.get(n)??[];K.set(n,[...new Set([...e,`chain:${t.next}`])])}}const Q=z+v.length*(ya+ba);w.forEach(([e],n)=>{const t={x:Q,y:B(n,w.length),width:ya,height:R};H.push({name:e,pos:t}),q[`destination-${e}`]=t}),H.length>0&&(q.destination=H[0].pos),v.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)if(t.length>1&&!r){const e=t.map(e=>q[`destination-${e}`]?.y).filter(e=>void 0!==e);if(e.length>0){o=e.reduce((e,n)=>e+n,0)/e.length}else o=V-R/2}else o=V-R/2;else{const e=q[`destination-${t[0]}`];o=e?e.y:V-R/2}const a={x:z,y:o,width:ya,height:R};Y.push({name:e,pos:a}),q[`post-${e}`]=a,z+=ya+ba});const Z=[];if(M){const e=z+ya+ba;w.forEach(([n,t],r)=>{const o=t.after??s;if(o){const t={x:e,y:B(r,w.length),width:ya,height:R};Z.push({name:n,pos:t,config:o}),q[`after-${n}`]=t}}),Z.length>0&&(q.after=Z[0].pos)}const ee=V,ne=[...e?[{key:"before",config:e,fillVar:"--flow-before-fill",strokeVar:"--flow-before-stroke",defaultLabel:"Before",defaultLink:void 0}]:[],...x.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"})),...w.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(0,da.jsx)("div",{ref:k,className:`elb-explorer elb-flow-map ${p||""}`,style:{width:"100%",maxWidth:D},children:(0,da.jsxs)("svg",{viewBox:`0 0 ${D} ${A}`,style:{width:"100%",height:"auto",display:"block"},children:[i&&(0,da.jsx)("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=q.collector,s=r.y+R/2;return(0,da.jsxs)(da.Fragment,{children:[!e&&1===f.length&&(0,da.jsx)(ma,{fromX:0,fromY:ee,toX:q.source.x,toY:ee,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),e&&(0,da.jsx)(ma,{fromX:q.before.x+ya,fromY:ee,toX:q.source.x,toY:q.source.y+R/2,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),(()=>{const e=new Map;return G.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)}),G.map(({name:o,pos:a})=>{const s=n?.[o]??{},i=((e,n)=>n.next&&t?.[n.next]?q[`pre-${n.next}`]:y.length>0?q[`pre-${y[0].name}`]:r)(0,s),l=a.y+R/2,c=i.y+R/2,u=s.next?`pre-${s.next}`:y.length>0?`pre-${y[0].name}`:"collector",d=e.get(u)??[],p=((e,n,t)=>{if(n<=1)return t;const r=Math.min(.6*R,12*(n-1));return t-r/2+e*(r/(n-1))})(d.findIndex(e=>e.name===o),d.length,c),f=g?Ca:0;return(0,da.jsxs)(ca.default.Fragment,{children:[(0,da.jsx)(ma,{fromX:a.x+ya,fromY:l-f,toX:i.x,toY:p-f,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),g&&(0,da.jsx)(ma,{fromX:i.x,fromY:p+f,toX:a.x+ya,toY:l+f,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]?q[`pre-${a.next}`]:r;const i=n.y+R/2,l=s.y+R/2,c=g?Ca:0;return(0,da.jsxs)(ca.default.Fragment,{children:[(0,da.jsx)(ma,{fromX:n.x+ya,fromY:i-c,toX:s.x,toY:l-c,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),g&&(0,da.jsx)(ma,{fromX:s.x,fromY:l+c,toX:n.x+ya,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]?q[`post-${n.before}`]:r)(0,a?.[e]??{}),s=n.y+R/2,i=t.y+R/2,l=g?Ca:0;return(0,da.jsxs)(ca.default.Fragment,{children:[(0,da.jsx)(ma,{fromX:t.x+ya,fromY:i-l,toX:n.x,toY:s-l,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),g&&(0,da.jsx)(ma,{fromX:n.x,fromY:s+l,toX:t.x+ya,toY:i+l,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]},`destination-${e}-arrows`)}),Y.slice(0,-1).map(({name:e,pos:n},t)=>{const r=Y[t+1];if(!r)return null;const o=r.pos,a=n.y+R/2,s=o.y+R/2,i=g?Ca:0;return(0,da.jsxs)(ca.default.Fragment,{children:[(0,da.jsx)(ma,{fromX:n.x+ya,fromY:a-i,toX:o.x,toY:s-i,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),g&&(0,da.jsx)(ma,{fromX:o.x,fromY:s+i,toX:n.x+ya,toY:a+i,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]},`post-${e}-chain`)}),v.length>0&&(()=>{const e=q[`post-${v[0].name}`],n=s,t=e.y+R/2,o=g?Ca:0;return(0,da.jsxs)(da.Fragment,{children:[(0,da.jsx)(ma,{fromX:r.x+ya,fromY:n-o,toX:e.x,toY:t-o,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee}),g&&(0,da.jsx)(ma,{fromX:e.x,fromY:t+o,toX:r.x+ya,toY:n+o,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee})]})})(),Z.map(({name:e,pos:n})=>{const t=q[`destination-${e}`];if(!t)return null;const r=t.y+R/2,o=n.y+R/2;return(0,da.jsx)(ma,{fromX:t.x+ya,fromY:r,toX:n.x,toY:o,stroke:"var(--flow-edge-stroke, #9ca3af)",centerY:ee},`dest-${e}-after`)}),!M&&1===m.length&&(0,da.jsx)(ma,{fromX:q.destination.x+ya,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=q[e],i=n?.icon,c=n?.label||o,u=n?.text,d=n?.description,p=n?.link,g=!1!==n?.highlight,f=u?s.y+.28*s.height:s.y+s.height/2,m=!1===p?null:"string"==typeof p?p:a,h=(0,da.jsxs)(da.Fragment,{children:[(0,da.jsx)(pa,{x:s.x,y:s.y,width:s.width,height:s.height,fill:`var(${t}, #6b7280)`,stroke:g?`var(${r}, #6b7280)`:"var(--flow-edge-stroke, #9ca3af)"}),(0,da.jsx)("foreignObject",{x:s.x+4,y:f-l.labelSize/2-2,width:s.width-8,height:l.labelSize+4,children:(0,da.jsxs)("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&&(0,da.jsx)(Cr,{icon:i,width:14,height:14}),(0,da.jsx)("span",{children:c})]})}),u&&(0,da.jsx)("foreignObject",{x:s.x+4,y:s.y+.34*s.height,width:s.width-8,height:.62*s.height,children:(0,da.jsx)("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:u})}),d&&(0,da.jsx)("foreignObject",{x:s.x,y:s.y+s.height+8,width:ya,height:F,children:(0,da.jsx)("div",{style:{fontSize:l.descriptionSize,color:"var(--color-text-muted)",textAlign:"center",fontFamily:"system-ui, -apple-system, sans-serif",lineHeight:1.3},children:d})})]});return m?(0,da.jsx)("a",{href:m,style:{cursor:"pointer",textDecoration:"none"},children:h},e):(0,da.jsx)("g",{children:h},e)}),d?.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+Pa,y:e.y-Pa}:{x:e.x+e.width-Pa,y:e.y-Pa}:null,u=e=>{if(!e)return null;const n=e.y+e.height/2;return{x:e.x+e.width+ba/2-6,y:n+ja/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:ka/2,y:t+ja/2+8};case"outgoing":return{x:r-ka/2,y:t+ja/2+8};case"before-source":return u(i);case"source-collector":return u(o);case"collector-destination":case"collector-post":return u(a);case"destination-after":return u(s);case"pre-collector":const d=Object.keys(n).filter(e=>e.startsWith("pre-"));return 0===d.length?null:u(n[d[d.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 u(n[`source-${i[1]}`]);const l=e.match(/^source-([^-]+)-collector$/);if(l)return u(n[`source-${l[1]}`]);const d=e.match(/^pre-([^-]+)-next$/);if(d)return u(n[`pre-${d[1]}`]);const p=e.match(/^post-([^-]+)-next$/);if(p)return u(n[`post-${p[1]}`]);const g=e.match(/^post-destination-([^-]+)$/);if(g){g[1];const e=Object.keys(n).filter(e=>e.startsWith("post-"));return 0===e.length?u(a):u(n[e[e.length-1]])}return null}}}(e.position,q,ee,D);if(!t)return null;const r=e.id??String(n+1);return(0,da.jsx)(fa,{x:t.x,y:t.y,text:r},`marker-${n}`)}),E.length>0&&(0,da.jsx)("foreignObject",{x:xa,y:W+N+I+4,width:D-2*xa,height:18*P,children:(0,da.jsx)("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((d?.indexOf(e)??n)+1);return(0,da.jsxs)("span",{children:[(0,da.jsx)("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}),(0,da.jsx)("span",{style:{marginRight:10},children:e.text})]},`legend-${n}`)})})})]})})}var Ra=require("react"),Fa=require("react/jsx-runtime"),Ia={"Mapping.Value":"/docs/mapping/value","Mapping.Rule":"/docs/mapping/rule","WalkerOS.Consent":"/docs/guides/consent"};function Oa(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 Na(e,n){const t=e=>{const t=Oa(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:Ia[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 Ma({property:e,isOpen:n,onClose:t}){if(!n||!e)return null;return(0,Fa.jsx)("div",{className:"elb-property-table__modal-backdrop",onClick:e=>{e.target===e.currentTarget&&t()},children:(0,Fa.jsxs)("div",{className:"elb-property-table__modal-content",children:[(0,Fa.jsxs)("div",{className:"elb-property-table__modal-header",children:[(0,Fa.jsxs)("h3",{className:"elb-property-table__modal-title",children:[(0,Fa.jsx)("code",{className:"elb-property-table__modal-property-name",children:e.name}),e.required&&(0,Fa.jsx)("span",{className:"elb-property-table__required-icon",children:"*"})]}),(0,Fa.jsx)("button",{className:"elb-property-table__close-button",onClick:t,"aria-label":"Close",children:(0,Fa.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Fa.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,Fa.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),(0,Fa.jsxs)("div",{className:"elb-property-table__modal-body",children:[(0,Fa.jsxs)("div",{className:"elb-property-table__modal-row",children:[(0,Fa.jsx)("span",{className:"elb-property-table__modal-label",children:"Type:"}),(0,Fa.jsx)("code",{className:"elb-property-table__modal-type elb-property-table__modal-type--wrap",children:e.type})]}),e.description&&(0,Fa.jsxs)("div",{className:"elb-property-table__modal-row",children:[(0,Fa.jsx)("span",{className:"elb-property-table__modal-label",children:"Description:"}),(0,Fa.jsx)("p",{className:"elb-property-table__modal-description",children:e.description})]}),e.default&&(0,Fa.jsxs)("div",{className:"elb-property-table__modal-row",children:[(0,Fa.jsx)("span",{className:"elb-property-table__modal-label",children:"Default:"}),(0,Fa.jsx)("code",{className:"elb-property-table__modal-default",children:e.default})]}),e.example&&(0,Fa.jsxs)("div",{className:"elb-property-table__modal-row",children:[(0,Fa.jsx)("span",{className:"elb-property-table__modal-label",children:"Example:"}),(0,Fa.jsx)("code",{className:"elb-property-table__modal-example",children:e.example})]})]})]})})}function Da(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?(0,Fa.jsx)("a",{href:t,className:"elb-property-table__type-link",children:e},n):(0,Fa.jsx)("span",{children:e},n)}return(0,Fa.jsx)("span",{children:e},n)})}function La({schema:e,className:n,emptyMessage:t}){const[r,o]=(0,Ra.useState)(null),[a,s]=(0,Ra.useState)(!1),i=function(e){const n=[],t=e;let r=e;if(Array.isArray(r.allOf)&&1===r.allOf.length&&"string"==typeof r.allOf[0].$ref){const e=Oa(r.allOf[0].$ref,t);e&&(r=e)}const o=r.required||[];if(!r.properties)return n;for(const[e,a]of Object.entries(r.properties)){const r=a,s=Na(r,t);let i,l;if(s)i=s.type,l=s.typeRefs;else{if(i=r.type||"any",r.enum&&(i=r.enum.map(e=>`'${e}'`).join(" | ")),"array"===i&&r.items){const e=r.items;i=e.enum?`Array<${e.enum.map(e=>`'${e}'`).join(" | ")}>`:`Array<${e.type||"any"}>`}"object"===i&&r.additionalProperties&&(i=`Record<string, ${r.additionalProperties.type||"any"}>`),(r.anyOf||r.oneOf)&&(i=(r.anyOf||r.oneOf).map(e=>e.type||"any").join(" | "))}let c,u=r.description||"";const d=u.match(/\(like\s+(.+?)\)$/);d&&(c=d[1],u=u.replace(/\s*\(like\s+.+?\)$/,"")),"any"===i&&u.toLowerCase().includes("function")&&(i="function"),n.push({name:e,type:i,typeRefs:l,description:u,required:o.includes(e),default:void 0!==r.default?String(r.default):void 0,example:c})}return n}(e);if(0===i.length)return(0,Fa.jsx)("div",{className:`elb-explorer elb-property-table__empty ${n||""}`,role:"note",children:t??"No specific properties available."});const l=i.some(e=>e.required),c=e=>e.length<=30?e:e.slice(0,30),u=e=>{o(e),s(!0)};return(0,Fa.jsxs)("div",{className:`elb-explorer ${n||""}`,children:[(0,Fa.jsx)("div",{className:"elb-property-table__container",children:(0,Fa.jsxs)("table",{className:"elb-property-table",children:[(0,Fa.jsx)("thead",{children:(0,Fa.jsxs)("tr",{children:[(0,Fa.jsx)("th",{children:"Property"}),(0,Fa.jsx)("th",{children:"Type"}),(0,Fa.jsx)("th",{children:"Description"}),(0,Fa.jsx)("th",{children:"More"})]})}),(0,Fa.jsx)("tbody",{children:i.map((e,n)=>{return(0,Fa.jsxs)("tr",{children:[(0,Fa.jsx)("td",{className:"elb-property-table__property-cell","data-label":"Property",children:(0,Fa.jsxs)("code",{className:"elb-property-table__property-name",children:[e.name,e.required&&(0,Fa.jsx)("span",{className:"elb-property-table__required-icon",children:"*"})]})}),(0,Fa.jsx)("td",{className:"elb-property-table__type-cell","data-label":"Type",children:e.typeRefs&&e.typeRefs.length>0?(0,Fa.jsx)("code",{className:"elb-property-table__property-type",children:Da(e.type,e.typeRefs)}):(t=e.type,t.length>30?(0,Fa.jsx)("button",{className:"elb-property-table__type-button",onClick:()=>u(e),"aria-label":`View full type for ${e.name}`,children:(0,Fa.jsx)("code",{className:"elb-property-table__property-type elb-property-table__property-type--truncated",children:c(e.type)})}):(0,Fa.jsx)("code",{className:"elb-property-table__property-type",children:e.type}))}),(0,Fa.jsx)("td",{className:"elb-property-table__description","data-label":"Description",children:e.description}),(0,Fa.jsx)("td",{className:"elb-property-table__action-cell","data-label":"More",children:(0,Fa.jsx)("button",{className:"elb-property-table__more-button",onClick:()=>u(e),"aria-label":`More info about ${e.name}`,children:(0,Fa.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Fa.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Fa.jsx)("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),(0,Fa.jsx)("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})})})]},n);var t})})]})}),l&&(0,Fa.jsxs)("div",{className:"elb-property-table__required-notice",children:[(0,Fa.jsx)("span",{className:"elb-property-table__required-icon",children:"*"})," Required fields"]}),(0,Fa.jsx)(Ma,{property:r,isOpen:a,onClose:()=>{s(!1),o(null)}})]})}var Aa=require("react/jsx-runtime");function Wa({trigger:e,isOpen:n,onToggle:t,children:r,align:o="left",ariaLabel:a,className:s=""}){return(0,Aa.jsxs)("div",{className:`elb-dropdown ${s}`.trim(),children:[(0,Aa.jsx)("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&&(0,Aa.jsx)("div",{className:`elb-dropdown__panel elb-dropdown__panel--${o}`,role:"menu",children:r})]})}function Va({children:e,onClick:n,disabled:t=!1,variant:r="default",className:o=""}){return(0,Aa.jsx)("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 Ba({className:e=""}){return(0,Aa.jsx)("div",{className:`elb-dropdown__divider ${e}`.trim(),role:"separator"})}var za=require("react"),qa=require("react"),Ga=require("shiki");function Ha(e){if(e)return e.startsWith("#")?e:`#${e}`}function Ua(e,n){const t=e.rules.map(e=>{const n={},t=Ha(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=Ha(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}}var Ja=require("react/jsx-runtime"),Xa=["json","javascript","typescript","tsx","jsx","bash","html","css","markdown"],Ya=Ua(Ie,{name:ye,type:"light",defaultBackground:"#ffffff",defaultForeground:"#24292E"}),Ka=Ua($e,{name:he,type:"dark",defaultBackground:"#292d3e",defaultForeground:"#bfc7d5"}),Qa=null;function Za(){if("undefined"==typeof document)return"dark";const e=document.documentElement;return"dark"===e.dataset.theme||e.classList.contains("dark")?"dark":"light"}function es(e){return e?Xa.includes(e)?e:"text":"json"}function ns({code:e,language:n,className:t,theme:r}){const[o,a]=(0,qa.useState)(""),[s,i]=(0,qa.useState)(r??Za());(0,qa.useEffect)(()=>{if(r)return void i(r);i(Za());const e=new MutationObserver(()=>i(Za()));return e.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"]}),()=>e.disconnect()},[r]),(0,qa.useEffect)(()=>{let t=!1;return(Qa||(Qa=(0,Ga.createHighlighter)({themes:[Ya,Ka],langs:[...Xa]})),Qa).then(r=>{if(t)return;const o=r.codeToHtml(e,{lang:es(n),theme:"dark"===s?he:ye});a(o)}),()=>{t=!0}},[e,n,s]);const l="elb-code-static"+(t?` ${t}`:"");return(0,Ja.jsx)("div",{className:l,dangerouslySetInnerHTML:{__html:o}})}var ts=require("react/jsx-runtime");function rs({code:e,language:n="javascript",tabs:t,activeTab:r,onTabChange:o,defaultTab:a,label:s,header:i,showHeader:l=!0,showTrafficLights:c=!1,showCopy:u=!0,footer:d,height:p,className:g,style:f}){const[m,h]=(0,za.useState)(!1),[y,b]=(0,za.useState)(r??a??t?.[0]?.id??""),v=r??y,x=(0,za.useCallback)(e=>{b(e),o?.(e)},[o]),w=t?.find(e=>e.id===v),k=w?.code??e??"",T=w?.language??n,C=i??s??"Code",S=u?(0,ts.jsx)("div",{style:{display:"flex",gap:"4px",alignItems:"center"},children:(0,ts.jsx)("button",{className:"elb-explorer-btn",onClick:async()=>{try{await navigator.clipboard.writeText(k),h(!0),setTimeout(()=>h(!1),2e3)}catch{}},title:m?"Copied!":"Copy to clipboard",children:m?(0,ts.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,ts.jsx)("polyline",{points:"20 6 9 17 4 12"})}):(0,ts.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ts.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),(0,ts.jsx)("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:(0,ts.jsx)(ns,{code:e.code,language:e.language??n})}));return(0,ts.jsx)(re,{header:C,headerActions:S,showHeader:l,tabs:$,defaultTab:a,activeTab:r,onTabChange:x,showTrafficLights:c,footer:d,height:p,style:f,className:g,children:!t&&(0,ts.jsx)(ns,{code:e??"",language:T})})}var os=require("react/jsx-runtime");function as({children:e,className:n=""}){return(0,os.jsx)("div",{className:`elb-explorer-footer ${n}`,children:e})}var ss=require("react/jsx-runtime");function is({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?(0,ss.jsx)("a",{href:t,className:l,children:o}):(0,ss.jsx)("button",{type:"button",className:l,onClick:r,disabled:s,children:o})}var ls=require("react/jsx-runtime");function cs({size:e="md",className:n=""}){return(0,ls.jsx)("span",{className:`elb-spinner elb-spinner--${e} ${n}`.trim(),role:"status","aria-label":"Loading"})}Et("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}),Et("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});var us=p(require("react"),1),ds={},ps=us.default.createContext(ds);function gs(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(ds):e.components||ds:function(e){const n=us.default.useContext(ps);return us.default.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}(e.components),us.default.createElement(ps.Provider,{value:n},e.children)}var fs=require("react"),ms=require("react/jsx-runtime"),hs=({className:e,children:n})=>{const t=fs.Children.toArray(n),r="string"==typeof e,o=t.some(e=>"string"==typeof e&&e.match(/[\n\r]/g));if(!r||!o)return(0,ms.jsx)("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(0,ms.jsx)(Mn,{code:i,language:s,disabled:!0,showCopy:!0,showHeader:!1,autoHeight:{min:100,max:600}})},ys=require("react/jsx-runtime"),bs=({children:e})=>{const n={code:hs,CodeBox:Mn,PropertyTable:La};return(0,ys.jsx)(gs,{components:n,children:e})},vs=require("react");function xs(){const[e,n]=(0,vs.useState)(!1),t=(0,vs.useRef)(null),r=(0,vs.useCallback)(()=>{n(e=>!e)},[]),o=(0,vs.useCallback)(()=>{n(!0)},[]),a=(0,vs.useCallback)(()=>{n(!1)},[]);return(0,vs.useEffect)(()=>{if(e)return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r);function r(e){t.current&&!t.current.contains(e.target)&&n(!1)}},[e]),(0,vs.useEffect)(()=>{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 ws(e,n){const t=JSON.parse(JSON.stringify(e));for(const[e,r]of Object.entries(n)){const n=""===e?t:ks(t,e);n&&"object"==typeof n&&Object.assign(n,r)}return t}function ks(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 Ts(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`, `windowElb`.\n\n```json\n"settings": {\n "windowCollector": "collector",\n "windowElb": "elb"\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 Cs(){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 Ss(){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}}]}}W();var $s=require("@walkeros/core");function Es(e){const n=e.source.replace(/^\^/,"").replace(/\$$/,"").replace(/\(\.\+\)\?$/,"([\\w.]+)?");return new RegExp(n,"g")}function js(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=Es($s.REF_SECRET);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=Es($s.REF_STORE);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=Es($s.REF_FLOW);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=Es($s.REF_ENV);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 Ps(e){let n;try{n=JSON.parse(e)}catch{return{}}if(!(_s(t=n)&&"version"in t&&"flows"in t&&_s(t.flows)))return{};var t;const r={},o=[],a=[],s=[],i=[],l=[],c=[],u={};let d;Rs(r,n.variables),Fs(c,n.contract),_s(n.contract)&&Object.assign(u,n.contract);for(const e of Object.values(n.flows))if(_s(e)){if(!d&&_s(e.config)){const n=e.config.platform;"web"!==n&&"server"!==n||(d=n)}if(Rs(r,e.variables),Fs(c,e.contract),_s(e.contract)&&Object.assign(u,e.contract),_s(e.sources))for(const[n,t]of Object.entries(e.sources))o.push(n),_s(t)&&(Rs(r,t.variables),"string"==typeof t.package&&l.push({package:t.package,shortName:n,type:"source",platform:d||"web"}));if(_s(e.destinations))for(const[n,t]of Object.entries(e.destinations))a.push(n),_s(t)&&(Rs(r,t.variables),"string"==typeof t.package&&l.push({package:t.package,shortName:n,type:"destination",platform:d||"web"}));if(_s(e.transformers))for(const[n,t]of Object.entries(e.transformers))s.push(n),_s(t)&&(Rs(r,t.variables),"string"==typeof t.package&&l.push({package:t.package,shortName:n,type:"transformer",platform:d||"web"}));if(_s(e.stores))for(const[n,t]of Object.entries(e.stores))i.push(n),_s(t)&&Rs(r,t.variables)}const p={variables:r,stepNames:{sources:o,destinations:a,transformers:s}};return d&&(p.platform=d),l.length>0&&(p.packages=l),c.length>0&&(p.contract=c),Object.keys(u).length>0&&(p.contractRaw=u),i.length>0&&(p.stores=i),p}function _s(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Rs(e,n){if(_s(n))for(const[t,r]of Object.entries(n))e[t]=r}function Fs(e,n){if(_s(n))for(const[t,r]of Object.entries(n)){if(t.startsWith("$")||!_s(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})}}//# sourceMappingURL=index.js.map