@sprig-technologies/sprig-browser 2.26.1 → 2.26.3

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.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-R4BhGZ2a.cjs");exports.DismissReason=e.DismissReason;exports.SprigAPI=e.SprigAPI;exports.SprigEvent=e.SprigEvent;exports.default=e.index;exports.sprig=e.sprig;
package/dist/index.d.ts CHANGED
@@ -992,38 +992,7 @@ declare const utils_d_shadowHostInDom: typeof shadowHostInDom;
992
992
  declare const utils_d_throttle: typeof throttle;
993
993
  declare const utils_d_uniqueTextMutations: typeof uniqueTextMutations;
994
994
  declare namespace utils_d {
995
- export {
996
- utils_d_AppendedIframe as AppendedIframe,
997
- utils_d_StyleSheetMirror as StyleSheetMirror,
998
- utils_d__mirror as _mirror,
999
- utils_d_getBaseDimension as getBaseDimension,
1000
- utils_d_getNestedRule as getNestedRule,
1001
- utils_d_getPositionsAndIndex as getPositionsAndIndex,
1002
- utils_d_getRootShadowHost as getRootShadowHost,
1003
- utils_d_getShadowHost as getShadowHost,
1004
- utils_d_getWindowHeight as getWindowHeight,
1005
- utils_d_getWindowScroll as getWindowScroll,
1006
- utils_d_getWindowWidth as getWindowWidth,
1007
- utils_d_hasShadowRoot as hasShadowRoot,
1008
- utils_d_hookSetter as hookSetter,
1009
- utils_d_inDom as inDom,
1010
- utils_d_isAncestorRemoved as isAncestorRemoved,
1011
- utils_d_isBlocked as isBlocked,
1012
- utils_d_isIgnored as isIgnored,
1013
- utils_d_isSerialized as isSerialized,
1014
- utils_d_isSerializedIframe as isSerializedIframe,
1015
- utils_d_isSerializedStylesheet as isSerializedStylesheet,
1016
- utils_d_iterateResolveTree as iterateResolveTree,
1017
- utils_d_legacy_isTouchEvent as legacy_isTouchEvent,
1018
- utils_d_nowTimestamp as nowTimestamp,
1019
- utils_d_on as on,
1020
- utils_d_patch as patch,
1021
- utils_d_polyfill as polyfill,
1022
- utils_d_queueToResolveTrees as queueToResolveTrees,
1023
- utils_d_shadowHostInDom as shadowHostInDom,
1024
- utils_d_throttle as throttle,
1025
- utils_d_uniqueTextMutations as uniqueTextMutations,
1026
- };
995
+ export { type utils_d_AppendedIframe as AppendedIframe, utils_d_StyleSheetMirror as StyleSheetMirror, utils_d__mirror as _mirror, utils_d_getBaseDimension as getBaseDimension, utils_d_getNestedRule as getNestedRule, utils_d_getPositionsAndIndex as getPositionsAndIndex, utils_d_getRootShadowHost as getRootShadowHost, utils_d_getShadowHost as getShadowHost, utils_d_getWindowHeight as getWindowHeight, utils_d_getWindowScroll as getWindowScroll, utils_d_getWindowWidth as getWindowWidth, utils_d_hasShadowRoot as hasShadowRoot, utils_d_hookSetter as hookSetter, utils_d_inDom as inDom, utils_d_isAncestorRemoved as isAncestorRemoved, utils_d_isBlocked as isBlocked, utils_d_isIgnored as isIgnored, utils_d_isSerialized as isSerialized, utils_d_isSerializedIframe as isSerializedIframe, utils_d_isSerializedStylesheet as isSerializedStylesheet, utils_d_iterateResolveTree as iterateResolveTree, utils_d_legacy_isTouchEvent as legacy_isTouchEvent, utils_d_nowTimestamp as nowTimestamp, utils_d_on as on, utils_d_patch as patch, utils_d_polyfill as polyfill, utils_d_queueToResolveTrees as queueToResolveTrees, utils_d_shadowHostInDom as shadowHostInDom, utils_d_throttle as throttle, utils_d_uniqueTextMutations as uniqueTextMutations };
1027
996
  }
1028
997
 
1029
998
  declare class Timer {
@@ -1392,13 +1361,13 @@ type StringifyOptions = {
1392
1361
  depthOfLimit: number;
1393
1362
  };
1394
1363
  type LogRecordOptions = {
1395
- level?: LogLevel[];
1364
+ level?: LogLevel$1[];
1396
1365
  lengthThreshold?: number;
1397
1366
  stringifyOptions?: StringifyOptions;
1398
1367
  logger?: Logger | 'console';
1399
1368
  };
1400
1369
  type LogData = {
1401
- level: LogLevel;
1370
+ level: LogLevel$1;
1402
1371
  trace: string[];
1403
1372
  payload: string[];
1404
1373
  };
@@ -1423,13 +1392,13 @@ type Logger = {
1423
1392
  trace?: typeof console.trace;
1424
1393
  warn?: typeof console.warn;
1425
1394
  };
1426
- type LogLevel = keyof Logger;
1395
+ type LogLevel$1 = keyof Logger;
1427
1396
  declare const PLUGIN_NAME = "rrweb/console@1";
1428
1397
  declare const getRecordConsolePlugin: (options?: LogRecordOptions) => RecordPlugin;
1429
1398
 
1430
- type ReplayLogger = Partial<Record<LogLevel, (data: LogData) => void>>;
1399
+ type ReplayLogger = Partial<Record<LogLevel$1, (data: LogData) => void>>;
1431
1400
  type LogReplayConfig = {
1432
- level?: LogLevel[];
1401
+ level?: LogLevel$1[];
1433
1402
  replayLogger?: ReplayLogger;
1434
1403
  };
1435
1404
  declare const getReplayConsolePlugin: (options?: LogReplayConfig) => ReplayPlugin;
@@ -1439,7 +1408,6 @@ declare const rrweb_EventType: typeof EventType;
1439
1408
  type rrweb_IncrementalSource = IncrementalSource;
1440
1409
  declare const rrweb_IncrementalSource: typeof IncrementalSource;
1441
1410
  type rrweb_LogData = LogData;
1442
- type rrweb_LogLevel = LogLevel;
1443
1411
  type rrweb_Logger = Logger;
1444
1412
  type rrweb_MouseInteractions = MouseInteractions;
1445
1413
  declare const rrweb_MouseInteractions: typeof MouseInteractions;
@@ -1458,28 +1426,7 @@ declare const rrweb_record: typeof record;
1458
1426
  type rrweb_recordOptions<T> = recordOptions<T>;
1459
1427
  declare const rrweb_unpack: typeof unpack;
1460
1428
  declare namespace rrweb {
1461
- export {
1462
- rrweb_EventType as EventType,
1463
- rrweb_IncrementalSource as IncrementalSource,
1464
- rrweb_LogData as LogData,
1465
- rrweb_LogLevel as LogLevel,
1466
- rrweb_Logger as Logger,
1467
- rrweb_MouseInteractions as MouseInteractions,
1468
- rrweb_PLUGIN_NAME as PLUGIN_NAME,
1469
- rrweb_Replayer as Replayer,
1470
- rrweb_ReplayerEvents as ReplayerEvents,
1471
- rrweb_StringifyOptions as StringifyOptions,
1472
- rrweb_addCustomEvent as addCustomEvent,
1473
- rrweb_freezePage as freezePage,
1474
- rrweb_getRecordConsolePlugin as getRecordConsolePlugin,
1475
- rrweb_getReplayConsolePlugin as getReplayConsolePlugin,
1476
- _mirror as mirror,
1477
- rrweb_pack as pack,
1478
- rrweb_record as record,
1479
- rrweb_recordOptions as recordOptions,
1480
- rrweb_unpack as unpack,
1481
- utils_d as utils,
1482
- };
1429
+ export { rrweb_EventType as EventType, rrweb_IncrementalSource as IncrementalSource, type rrweb_LogData as LogData, type LogLevel$1 as LogLevel, type rrweb_Logger as Logger, rrweb_MouseInteractions as MouseInteractions, rrweb_PLUGIN_NAME as PLUGIN_NAME, rrweb_Replayer as Replayer, rrweb_ReplayerEvents as ReplayerEvents, type rrweb_StringifyOptions as StringifyOptions, rrweb_addCustomEvent as addCustomEvent, rrweb_freezePage as freezePage, rrweb_getRecordConsolePlugin as getRecordConsolePlugin, rrweb_getReplayConsolePlugin as getReplayConsolePlugin, _mirror as mirror, rrweb_pack as pack, rrweb_record as record, type rrweb_recordOptions as recordOptions, rrweb_unpack as unpack, utils_d as utils };
1483
1430
  }
1484
1431
 
1485
1432
  interface XhrResponse {
@@ -1608,7 +1555,7 @@ declare class UpChunk {
1608
1555
  */
1609
1556
  private sendChunks;
1610
1557
  }
1611
- declare const createUpload$1: typeof UpChunk.createUpload;
1558
+ declare function createUpload$1(options: UpChunkOptions): UpChunk;
1612
1559
 
1613
1560
  type _mux_upchunk_ChunkedStreamIterable = ChunkedStreamIterable;
1614
1561
  declare const _mux_upchunk_ChunkedStreamIterable: typeof ChunkedStreamIterable;
@@ -1619,15 +1566,7 @@ type _mux_upchunk_UpChunkOptions = UpChunkOptions;
1619
1566
  declare const _mux_upchunk_getChunkSizeError: typeof getChunkSizeError;
1620
1567
  declare const _mux_upchunk_isValidChunkSize: typeof isValidChunkSize;
1621
1568
  declare namespace _mux_upchunk {
1622
- export {
1623
- _mux_upchunk_ChunkedStreamIterable as ChunkedStreamIterable,
1624
- _mux_upchunk_ChunkedStreamIterableOptions as ChunkedStreamIterableOptions,
1625
- _mux_upchunk_UpChunk as UpChunk,
1626
- _mux_upchunk_UpChunkOptions as UpChunkOptions,
1627
- createUpload$1 as createUpload,
1628
- _mux_upchunk_getChunkSizeError as getChunkSizeError,
1629
- _mux_upchunk_isValidChunkSize as isValidChunkSize,
1630
- };
1569
+ export { _mux_upchunk_ChunkedStreamIterable as ChunkedStreamIterable, type _mux_upchunk_ChunkedStreamIterableOptions as ChunkedStreamIterableOptions, _mux_upchunk_UpChunk as UpChunk, type _mux_upchunk_UpChunkOptions as UpChunkOptions, createUpload$1 as createUpload, _mux_upchunk_getChunkSizeError as getChunkSizeError, _mux_upchunk_isValidChunkSize as isValidChunkSize };
1631
1570
  }
1632
1571
 
1633
1572
  declare enum NOTIFICATION_TYPES {
@@ -1876,74 +1815,6 @@ declare class Emitter<Events extends EventMap> {
1876
1815
  rawListeners<EventName extends keyof Events>(eventName: EventName): Array<Listener<Events[EventName]>>;
1877
1816
  }
1878
1817
 
1879
- declare enum DismissReason {
1880
- Closed = "close.click",
1881
- Complete = "survey.completed",
1882
- PageChange = "page.change",
1883
- API = "api",
1884
- Override = "override"
1885
- }
1886
- declare enum SprigEvent {
1887
- ReplayCapture = "replay.capture",
1888
- SDKReady = "sdk.ready",
1889
- SurveyAppeared = "survey.appeared",
1890
- SurveyClosed = "survey.closed",
1891
- SurveyDimensions = "survey.dimensions",
1892
- SurveyFadingOut = "survey.fadingOut",
1893
- SurveyHeight = "survey.height",
1894
- SurveyPresented = "survey.presented",
1895
- SurveyLifeCycle = "survey.lifeCycle",
1896
- SurveyWidth = "survey.width",
1897
- SurveyWillClose = "survey.willClose",
1898
- SurveyWillPresent = "survey.will.present",
1899
- CloseSurveyOnOverlayClick = "close.survey.overlayClick",
1900
- VisitorIDUpdated = "visitor.id.updated",
1901
- QuestionAnswered = "question.answered"
1902
- }
1903
- declare enum SprigEventData {
1904
- SurveyId = "survey.id"
1905
- }
1906
- declare const EVENTS: {
1907
- SDK_READY: SprigEvent;
1908
- SURVEY_APPEARED: SprigEvent;
1909
- SURVEY_CLOSED: SprigEvent;
1910
- SURVEY_DIMENSIONS: SprigEvent;
1911
- SURVEY_FADING_OUT: SprigEvent;
1912
- SURVEY_HEIGHT: SprigEvent;
1913
- SURVEY_PRESENTED: SprigEvent;
1914
- SURVEY_LIFE_CYCLE: SprigEvent;
1915
- SURVEY_WILL_CLOSE: SprigEvent;
1916
- SURVEY_WILL_PRESENT: SprigEvent;
1917
- QUESTION_ANSWERED: SprigEvent;
1918
- REPLAY_CAPTURE: SprigEvent;
1919
- CLOSE_SURVEY_ON_OVERLAY_CLICK: SprigEvent;
1920
- VISITOR_ID_UPDATED: SprigEvent;
1921
- DATA: {
1922
- DISMISS_REASONS: {
1923
- API: DismissReason;
1924
- CLOSED: DismissReason;
1925
- COMPLETE: DismissReason;
1926
- PAGE_CHANGE: DismissReason;
1927
- OVERRIDE: DismissReason;
1928
- };
1929
- SURVEY_ID: SprigEventData;
1930
- };
1931
- };
1932
- declare const enum InternalEventName {
1933
- VerifyViewVersion = "verify.view.version",
1934
- CurrentQuestion = "survey.question",
1935
- ViewPrototypeClick = "question.prototype.click",
1936
- ViewAgreementClick = "question.agreement.click",
1937
- RecordedTaskStart = "recorded.task.start",
1938
- RecordedTaskPermissionScreen = "recorded.task.permission.screen",
1939
- SurveyComplete = "survey.complete"
1940
- }
1941
- declare const enum InternalEventData {
1942
- ViewVersion = "view.version",
1943
- QuestionId = "qid",
1944
- Props = "props"
1945
- }
1946
-
1947
1818
  declare const enum MediaType {
1948
1819
  Video = "video",
1949
1820
  Audio = "audio",
@@ -1986,34 +1857,6 @@ interface PassthroughData {
1986
1857
  responseGroupUid: UUID;
1987
1858
  }
1988
1859
 
1989
- interface Experiment {
1990
- id: string;
1991
- variation?: string;
1992
- }
1993
-
1994
- type QueueItem = [string, ...unknown[]] | (() => void);
1995
- declare class SprigQueue {
1996
- paused: boolean;
1997
- queue: QueueItem[];
1998
- ul: WindowSprig;
1999
- constructor(ul: WindowSprig, queue: QueueItem[]);
2000
- flush(queue: QueueItem[]): void;
2001
- isPaused(): boolean;
2002
- pause(): void;
2003
- unpause(): void;
2004
- push(action: QueueItem): void;
2005
- perform(func: () => void): void | Promise<unknown>;
2006
- /**
2007
- * Removes all queued items
2008
- */
2009
- empty(): void;
2010
- }
2011
-
2012
- declare enum SurveyState {
2013
- Ready = "ready",
2014
- NoSurvey = "no survey"
2015
- }
2016
-
2017
1860
  interface RecordedTaskResponseValueType {
2018
1861
  mediaRecordingUids?: string[] | null;
2019
1862
  taskDurationMillisecond?: number;
@@ -2253,7 +2096,9 @@ interface MultipleChoiceOption {
2253
2096
  id: number;
2254
2097
  label: string;
2255
2098
  optionProperties: null | {
2256
- allowsTextEntry: boolean;
2099
+ allowsTextEntry?: boolean;
2100
+ noneOfTheAbove?: boolean;
2101
+ isPinned?: boolean;
2257
2102
  };
2258
2103
  order: number;
2259
2104
  productId: number;
@@ -2269,7 +2114,7 @@ interface CommonMultipleChoiceProps {
2269
2114
  buttonText?: string;
2270
2115
  captionText: string;
2271
2116
  conceptUrl: ConceptUrl;
2272
- randomize: "none" | "keeplast" | "all";
2117
+ randomize: "none" | "all";
2273
2118
  required: boolean;
2274
2119
  };
2275
2120
  }
@@ -2345,12 +2190,132 @@ interface VideoVoiceCard extends BaseCard {
2345
2190
  }
2346
2191
  type Card = TextUrlPromptCard | ConsentLegalCard | RecordedTaskCard | LikertCard | OpenTextCard | MatrixCard | MultipleChoiceSingleSelectCard | MultipleChoiceMultiSelectCard | NPSCard | VideoVoiceCard;
2347
2192
 
2193
+ type MatchType = "exactly" | "legacy";
2194
+ interface InteractiveEvent {
2195
+ id: number;
2196
+ matchType: MatchType;
2197
+ name: string;
2198
+ pattern: string;
2199
+ properties: {
2200
+ innerText: string;
2201
+ selector?: string;
2202
+ type?: "click";
2203
+ };
2204
+ }
2205
+ interface PageUrlEvent {
2206
+ id: number;
2207
+ matchType: MatchType | "contains" | "notContains" | "regex" | "startsWith";
2208
+ pattern: string;
2209
+ }
2210
+
2211
+ declare enum DismissReason {
2212
+ Closed = "close.click",
2213
+ Complete = "survey.completed",
2214
+ PageChange = "page.change",
2215
+ API = "api",
2216
+ Override = "override"
2217
+ }
2218
+ declare enum SprigEvent {
2219
+ ReplayCapture = "replay.capture",
2220
+ SDKReady = "sdk.ready",
2221
+ SurveyAppeared = "survey.appeared",
2222
+ SurveyClosed = "survey.closed",
2223
+ SurveyDimensions = "survey.dimensions",
2224
+ SurveyFadingOut = "survey.fadingOut",
2225
+ SurveyHeight = "survey.height",
2226
+ SurveyPresented = "survey.presented",
2227
+ SurveyLifeCycle = "survey.lifeCycle",
2228
+ SurveyWidth = "survey.width",
2229
+ SurveyWillClose = "survey.willClose",
2230
+ SurveyWillPresent = "survey.will.present",
2231
+ CloseSurveyOnOverlayClick = "close.survey.overlayClick",
2232
+ VisitorIDUpdated = "visitor.id.updated",
2233
+ QuestionAnswered = "question.answered"
2234
+ }
2235
+ declare enum SprigEventData {
2236
+ SurveyId = "survey.id"
2237
+ }
2238
+ declare const EVENTS: {
2239
+ SDK_READY: SprigEvent;
2240
+ SURVEY_APPEARED: SprigEvent;
2241
+ SURVEY_CLOSED: SprigEvent;
2242
+ SURVEY_DIMENSIONS: SprigEvent;
2243
+ SURVEY_FADING_OUT: SprigEvent;
2244
+ SURVEY_HEIGHT: SprigEvent;
2245
+ SURVEY_PRESENTED: SprigEvent;
2246
+ SURVEY_LIFE_CYCLE: SprigEvent;
2247
+ SURVEY_WILL_CLOSE: SprigEvent;
2248
+ SURVEY_WILL_PRESENT: SprigEvent;
2249
+ QUESTION_ANSWERED: SprigEvent;
2250
+ REPLAY_CAPTURE: SprigEvent;
2251
+ CLOSE_SURVEY_ON_OVERLAY_CLICK: SprigEvent;
2252
+ VISITOR_ID_UPDATED: SprigEvent;
2253
+ DATA: {
2254
+ DISMISS_REASONS: {
2255
+ API: DismissReason;
2256
+ CLOSED: DismissReason;
2257
+ COMPLETE: DismissReason;
2258
+ PAGE_CHANGE: DismissReason;
2259
+ OVERRIDE: DismissReason;
2260
+ };
2261
+ SURVEY_ID: SprigEventData;
2262
+ };
2263
+ };
2264
+ declare const enum InternalEventName {
2265
+ VerifyViewVersion = "verify.view.version",
2266
+ CurrentQuestion = "survey.question",
2267
+ ViewPrototypeClick = "question.prototype.click",
2268
+ ViewAgreementClick = "question.agreement.click",
2269
+ RecordedTaskStart = "recorded.task.start",
2270
+ RecordedTaskPermissionScreen = "recorded.task.permission.screen",
2271
+ SurveyComplete = "survey.complete"
2272
+ }
2273
+ declare const enum InternalEventData {
2274
+ ViewVersion = "view.version",
2275
+ QuestionId = "qid",
2276
+ Props = "props"
2277
+ }
2278
+
2348
2279
  interface RecordedTaskResponseType {
2349
2280
  questionId: number;
2350
2281
  type: CardType;
2351
2282
  value: RecordedTaskResponseValueType;
2352
2283
  }
2353
2284
 
2285
+ declare enum ReplayDurationType {
2286
+ After = "after",
2287
+ Before = "before",
2288
+ BeforeAndAfter = "beforeAndAfter"
2289
+ }
2290
+ declare enum ReplayEventType {
2291
+ Click = "Sprig_Click",
2292
+ Event = "Sprig_TrackEvent",
2293
+ PageView = "Sprig_PageView",
2294
+ SurveyShown = "Sprig_ShowSurvey",
2295
+ SurveySubmitted = "Sprig_SubmitSurvey",
2296
+ Noop = "Sprig_Noop"
2297
+ }
2298
+ type EventDigest = {
2299
+ timestamp: number;
2300
+ type: ReplayEventType.Click;
2301
+ } | {
2302
+ timestamp: number;
2303
+ name: string;
2304
+ type: ReplayEventType.Event;
2305
+ } | {
2306
+ timestamp: number;
2307
+ type: ReplayEventType.PageView;
2308
+ url: string;
2309
+ } | {
2310
+ timestamp: number;
2311
+ surveyId: string;
2312
+ type: ReplayEventType.SurveyShown;
2313
+ } | {
2314
+ timestamp: number;
2315
+ surveyId: string;
2316
+ type: ReplayEventType.SurveySubmitted;
2317
+ };
2318
+
2354
2319
  interface MobileReplayConfig {
2355
2320
  maxMobileReplayDurationSeconds?: number;
2356
2321
  mobileReplaySettings?: {
@@ -2491,23 +2456,13 @@ type SprigEventMap = {
2491
2456
  declare const eventEmitter: Emitter<SprigEventMap>;
2492
2457
  type SprigEventEmitter = typeof eventEmitter;
2493
2458
 
2494
- type MatchType = "exactly" | "legacy";
2495
- interface InteractiveEvent {
2496
- id: number;
2497
- matchType: MatchType;
2498
- name: string;
2499
- pattern: string;
2500
- properties: {
2501
- innerText: string;
2502
- selector?: string;
2503
- type?: "click";
2504
- };
2505
- }
2506
- interface PageUrlEvent {
2507
- id: number;
2508
- matchType: MatchType | "contains" | "notContains" | "regex" | "startsWith";
2509
- pattern: string;
2510
- }
2459
+ declare const LogLevels: {
2460
+ readonly Error: 1;
2461
+ readonly Warn: 2;
2462
+ readonly Info: 3;
2463
+ readonly Debug: 4;
2464
+ };
2465
+ type LogLevel = typeof LogLevels[keyof typeof LogLevels];
2511
2466
 
2512
2467
  declare const enum FramePosition {
2513
2468
  BottomLeft = "bottomLeft",
@@ -2598,7 +2553,7 @@ interface Config extends MobileReplayConfig {
2598
2553
  /** @example "2.18.0" */
2599
2554
  "x-ul-sdk-version": string;
2600
2555
  /** For web-bundled sdk */
2601
- "x-ul-bundled-sdk-version"?: string;
2556
+ "x-ul-package-version"?: string;
2602
2557
  [HttpHeader.UserID]?: string;
2603
2558
  [HttpHeader.VisitorID]?: UUID;
2604
2559
  };
@@ -2608,6 +2563,8 @@ interface Config extends MobileReplayConfig {
2608
2563
  isPreview?: boolean;
2609
2564
  launchDarklyEnabled?: boolean;
2610
2565
  locale: string;
2566
+ logLevel?: LogLevel;
2567
+ logBufferLimit?: number;
2611
2568
  marketingUrl?: string;
2612
2569
  maxAttrNameLength: number;
2613
2570
  maxAttrValueLength: number;
@@ -2651,39 +2608,33 @@ interface Config extends MobileReplayConfig {
2651
2608
  };
2652
2609
  }
2653
2610
 
2654
- declare enum ReplayDurationType {
2655
- After = "after",
2656
- Before = "before",
2657
- BeforeAndAfter = "beforeAndAfter"
2611
+ interface Experiment {
2612
+ id: string;
2613
+ variation?: string;
2658
2614
  }
2659
- declare enum ReplayEventType {
2660
- Click = "Sprig_Click",
2661
- Event = "Sprig_TrackEvent",
2662
- PageView = "Sprig_PageView",
2663
- SurveyShown = "Sprig_ShowSurvey",
2664
- SurveySubmitted = "Sprig_SubmitSurvey",
2665
- Noop = "Sprig_Noop"
2615
+
2616
+ type QueueItem = [string, ...unknown[]] | (() => void);
2617
+ declare class SprigQueue {
2618
+ paused: boolean;
2619
+ queue: QueueItem[];
2620
+ ul: WindowSprig;
2621
+ constructor(ul: WindowSprig, queue: QueueItem[]);
2622
+ flush(queue: QueueItem[]): void;
2623
+ isPaused(): boolean;
2624
+ pause(): void;
2625
+ unpause(): void;
2626
+ push(action: QueueItem): void;
2627
+ perform(func: () => void): void | Promise<unknown>;
2628
+ /**
2629
+ * Removes all queued items
2630
+ */
2631
+ empty(): void;
2632
+ }
2633
+
2634
+ declare enum SurveyState {
2635
+ Ready = "ready",
2636
+ NoSurvey = "no survey"
2666
2637
  }
2667
- type EventDigest = {
2668
- timestamp: number;
2669
- type: ReplayEventType.Click;
2670
- } | {
2671
- timestamp: number;
2672
- name: string;
2673
- type: ReplayEventType.Event;
2674
- } | {
2675
- timestamp: number;
2676
- type: ReplayEventType.PageView;
2677
- url: string;
2678
- } | {
2679
- timestamp: number;
2680
- surveyId: string;
2681
- type: ReplayEventType.SurveyShown;
2682
- } | {
2683
- timestamp: number;
2684
- surveyId: string;
2685
- type: ReplayEventType.SurveySubmitted;
2686
- };
2687
2638
 
2688
2639
  declare namespace optimizely {
2689
2640
  interface Optimizely {
@@ -2751,7 +2702,7 @@ declare namespace sprigConfig {
2751
2702
  surveyId: number;
2752
2703
  responseGroupUuid: string;
2753
2704
  eventDigest?: EventDigest[];
2754
- }) => Promise<void>;
2705
+ }) => Promise<boolean>;
2755
2706
  _generateVideoUploadUrl: (body: {
2756
2707
  mediaRecordingUid?: string;
2757
2708
  mediaType?: MediaType;
@@ -2780,7 +2731,7 @@ declare namespace sprigConfig {
2780
2731
  importLaunchDarklyData: (data: Record<string, number | undefined>) => void;
2781
2732
  integrateOptimizely: (
2782
2733
  strData: string | { experiments: Experiment[] },
2783
- isOverride?: boolean
2734
+ isOverride?: boolean,
2784
2735
  ) => void;
2785
2736
  integrateOptimizelyClient: (client: Client) => void;
2786
2737
  logoutUser: () => void;
@@ -2790,22 +2741,22 @@ declare namespace sprigConfig {
2790
2741
  removeAttributes: (attributes: SprigAttributes) => IdentifyResult;
2791
2742
  removeListener: (
2792
2743
  event: SprigEvent,
2793
- listener: SprigListener
2744
+ listener: SprigListener,
2794
2745
  ) => Promise<void>;
2795
2746
  removeSurveyListener: (listener: SprigListener) => Promise<void>;
2796
2747
  reviewSurvey: (surveyId: number) => void;
2797
2748
  setAttribute: (attribute: string, value: string | number) => IdentifyResult;
2798
2749
  setAttributes: (attributes?: SprigAttributes) => IdentifyResult;
2799
2750
  setPartnerAnonymousId: (
2800
- partnerAnonymousId: string
2751
+ partnerAnonymousId: string,
2801
2752
  ) => Promise<{ success: boolean; message?: string }>;
2802
2753
  setVisitorAttribute: (
2803
2754
  attribute: string,
2804
- value: string | number
2755
+ value: string | number,
2805
2756
  ) => IdentifyResult;
2806
2757
  setWindowDimensions: (
2807
2758
  width: number | string,
2808
- height: number | string
2759
+ height: number | string,
2809
2760
  ) => void;
2810
2761
  setEmail: (email: string) => IdentifyResult;
2811
2762
  setPreviewKey: (previewKey: string) => void;
@@ -2817,12 +2768,12 @@ declare namespace sprigConfig {
2817
2768
  eventName: string,
2818
2769
  properties?: TrackPayload["properties"],
2819
2770
  metadata?: SprigMetadata,
2820
- showSurveyCallback?: (surveyId?: number) => Promise<boolean>
2771
+ showSurveyCallback?: (surveyId?: number) => Promise<boolean>,
2821
2772
  ) => IdentifyResult;
2822
2773
  trackPageView: (
2823
2774
  url: string,
2824
2775
  properties?: SprigProperties,
2825
- showSurveyCallback?: (surveyId?: number) => Promise<boolean>
2776
+ showSurveyCallback?: (surveyId?: number) => Promise<boolean>,
2826
2777
  ) => void;
2827
2778
  unmute: () => void;
2828
2779
  }
@@ -2874,16 +2825,19 @@ type ArgumentType<T> = T extends (arg1: infer U, ...args: unknown[]) => unknown
2874
2825
  ? U
2875
2826
  : unknown;
2876
2827
  type PublicOf<T> = { [K in keyof T]: T[K] };
2877
- type createUpload = typeof _mux_upchunk["createUpload"];
2878
- type rrwebRecord = typeof rrweb["record"];
2879
- type rrwebCustomEvent = typeof rrweb["record"]["addCustomEvent"];
2828
+ type createUpload = (typeof _mux_upchunk)["createUpload"];
2829
+ type rrwebRecord = (typeof rrweb)["record"];
2830
+ type rrwebCustomEvent = (typeof rrweb)["record"]["addCustomEvent"];
2880
2831
  declare global {
2881
2832
  interface Window {
2882
2833
  __cfg: Config;
2883
2834
  attachEvent?: typeof window.addEventListener;
2835
+ Backbone: {
2836
+ history: typeof window.history;
2837
+ };
2884
2838
  Intercom: { ul_wasVisible?: boolean } & ((
2885
2839
  method: string,
2886
- data: unknown
2840
+ data: unknown,
2887
2841
  ) => void);
2888
2842
  optimizely?: optimizely.Optimizely;
2889
2843
  optimizelyDatafile?: object;
@@ -2901,7 +2855,7 @@ declare global {
2901
2855
  ...args: ArgumentTypes<rrwebCustomEvent>
2902
2856
  ) => PublicOf<ReturnType<rrwebCustomEvent>>;
2903
2857
  } & ((
2904
- arg: Omit<ArgumentType<rrwebRecord>, "hooks">
2858
+ arg: Omit<ArgumentType<rrwebRecord>, "hooks">,
2905
2859
  ) => PublicOf<ReturnType<rrwebRecord>>);
2906
2860
  sprigAPI?: object;
2907
2861
  }
@@ -3072,4 +3026,4 @@ declare const _default: {
3072
3026
  configure: (config: NpmConfig) => sprigConfig.WindowSprig;
3073
3027
  };
3074
3028
 
3075
- export { DismissReason, SprigAPI, SprigEvent, WindowSprig$1 as WindowSprig, _default as default, sprig };
3029
+ export { DismissReason, SprigAPI, SprigEvent, type WindowSprig$1 as WindowSprig, _default as default, sprig };