@thoughtspot/visual-embed-sdk 1.42.0 → 1.42.1-HE2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/cjs/package.json +2 -2
  2. package/cjs/src/embed/app.d.ts +20 -0
  3. package/cjs/src/embed/app.d.ts.map +1 -1
  4. package/cjs/src/embed/app.js +7 -1
  5. package/cjs/src/embed/app.js.map +1 -1
  6. package/cjs/src/embed/app.spec.js +52 -0
  7. package/cjs/src/embed/app.spec.js.map +1 -1
  8. package/cjs/src/embed/hostEventClient/contracts.d.ts +9 -2
  9. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  10. package/cjs/src/embed/hostEventClient/contracts.js +9 -1
  11. package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
  12. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +5 -5
  13. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  14. package/cjs/src/embed/hostEventClient/host-event-client.js +6 -6
  15. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  16. package/cjs/src/embed/liveboard.d.ts +2 -2
  17. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  18. package/cjs/src/embed/liveboard.js +6 -3
  19. package/cjs/src/embed/liveboard.js.map +1 -1
  20. package/cjs/src/embed/liveboard.spec.js +22 -0
  21. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  22. package/cjs/src/embed/ts-embed.d.ts +15 -2
  23. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  24. package/cjs/src/embed/ts-embed.js +63 -23
  25. package/cjs/src/embed/ts-embed.js.map +1 -1
  26. package/cjs/src/embed/ts-embed.spec.js +83 -0
  27. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  28. package/cjs/src/errors.d.ts +1 -0
  29. package/cjs/src/errors.d.ts.map +1 -1
  30. package/cjs/src/errors.js +1 -0
  31. package/cjs/src/errors.js.map +1 -1
  32. package/cjs/src/types.d.ts +119 -61
  33. package/cjs/src/types.d.ts.map +1 -1
  34. package/cjs/src/types.js +103 -60
  35. package/cjs/src/types.js.map +1 -1
  36. package/cjs/src/utils/processTrigger.d.ts +3 -1
  37. package/cjs/src/utils/processTrigger.d.ts.map +1 -1
  38. package/cjs/src/utils/processTrigger.js +4 -2
  39. package/cjs/src/utils/processTrigger.js.map +1 -1
  40. package/dist/{index-BpSohedu.js → index-CWQnMX2L.js} +1 -1
  41. package/dist/index-Djtv-y7A.js +7371 -0
  42. package/dist/index-UY-4yjBN.js +7371 -0
  43. package/dist/src/embed/app.d.ts +20 -0
  44. package/dist/src/embed/app.d.ts.map +1 -1
  45. package/dist/src/embed/hostEventClient/contracts.d.ts +9 -2
  46. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  47. package/dist/src/embed/hostEventClient/host-event-client.d.ts +5 -5
  48. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  49. package/dist/src/embed/liveboard.d.ts +2 -2
  50. package/dist/src/embed/liveboard.d.ts.map +1 -1
  51. package/dist/src/embed/ts-embed.d.ts +15 -2
  52. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  53. package/dist/src/errors.d.ts +1 -0
  54. package/dist/src/errors.d.ts.map +1 -1
  55. package/dist/src/types.d.ts +119 -61
  56. package/dist/src/types.d.ts.map +1 -1
  57. package/dist/src/utils/processTrigger.d.ts +3 -1
  58. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  59. package/dist/tsembed-react.es.js +202 -99
  60. package/dist/tsembed-react.js +201 -98
  61. package/dist/tsembed.es.js +202 -99
  62. package/dist/tsembed.js +201 -98
  63. package/dist/visual-embed-sdk-react-full.d.ts +164 -68
  64. package/dist/visual-embed-sdk-react.d.ts +164 -68
  65. package/dist/visual-embed-sdk.d.ts +164 -68
  66. package/lib/package.json +2 -2
  67. package/lib/src/embed/app.d.ts +20 -0
  68. package/lib/src/embed/app.d.ts.map +1 -1
  69. package/lib/src/embed/app.js +7 -1
  70. package/lib/src/embed/app.js.map +1 -1
  71. package/lib/src/embed/app.spec.js +52 -0
  72. package/lib/src/embed/app.spec.js.map +1 -1
  73. package/lib/src/embed/hostEventClient/contracts.d.ts +9 -2
  74. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  75. package/lib/src/embed/hostEventClient/contracts.js +8 -0
  76. package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
  77. package/lib/src/embed/hostEventClient/host-event-client.d.ts +5 -5
  78. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  79. package/lib/src/embed/hostEventClient/host-event-client.js +6 -6
  80. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  81. package/lib/src/embed/liveboard.d.ts +2 -2
  82. package/lib/src/embed/liveboard.d.ts.map +1 -1
  83. package/lib/src/embed/liveboard.js +6 -3
  84. package/lib/src/embed/liveboard.js.map +1 -1
  85. package/lib/src/embed/liveboard.spec.js +22 -0
  86. package/lib/src/embed/liveboard.spec.js.map +1 -1
  87. package/lib/src/embed/ts-embed.d.ts +15 -2
  88. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  89. package/lib/src/embed/ts-embed.js +63 -23
  90. package/lib/src/embed/ts-embed.js.map +1 -1
  91. package/lib/src/embed/ts-embed.spec.js +83 -0
  92. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  93. package/lib/src/errors.d.ts +1 -0
  94. package/lib/src/errors.d.ts.map +1 -1
  95. package/lib/src/errors.js +1 -0
  96. package/lib/src/errors.js.map +1 -1
  97. package/lib/src/types.d.ts +119 -61
  98. package/lib/src/types.d.ts.map +1 -1
  99. package/lib/src/types.js +103 -60
  100. package/lib/src/types.js.map +1 -1
  101. package/lib/src/utils/processTrigger.d.ts +3 -1
  102. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  103. package/lib/src/utils/processTrigger.js +4 -2
  104. package/lib/src/utils/processTrigger.js.map +1 -1
  105. package/package.json +2 -2
  106. package/src/embed/app.spec.ts +73 -0
  107. package/src/embed/app.ts +30 -0
  108. package/src/embed/hostEventClient/contracts.ts +11 -3
  109. package/src/embed/hostEventClient/host-event-client.ts +10 -5
  110. package/src/embed/liveboard.spec.ts +30 -0
  111. package/src/embed/liveboard.ts +10 -4
  112. package/src/embed/ts-embed.spec.ts +111 -0
  113. package/src/embed/ts-embed.ts +79 -27
  114. package/src/errors.ts +1 -0
  115. package/src/types.ts +119 -61
  116. package/src/utils/processTrigger.ts +6 -2
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.42.0 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.42.1-HE2.0 */
2
2
  'use client';
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -916,7 +916,7 @@ var EmbedEvent;
916
916
  */
917
917
  EmbedEvent["Load"] = "load";
918
918
  /**
919
- * Data pertaining to an Answer or Liveboard is received.
919
+ * Data pertaining to an Answer, Liveboard or Spotter visualization is received.
920
920
  * The event payload includes the raw data of the object.
921
921
  * @return data - Answer of Liveboard data
922
922
  * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
@@ -2287,7 +2287,7 @@ var HostEvent;
2287
2287
  * the following parameters:
2288
2288
  *
2289
2289
  * @param
2290
- * `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
2290
+ * `vizId`- GUID of the saved Answer or Spotter visualization ID to pin to a Liveboard.
2291
2291
  * Optional when pinning a new chart or table generated from a Search query.
2292
2292
  * **Required** in Spotter Embed.
2293
2293
  * @param
@@ -2339,10 +2339,16 @@ var HostEvent;
2339
2339
  * ```
2340
2340
  * @example
2341
2341
  * ```js
2342
- * const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
2343
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2344
- * });
2345
- * ```
2342
+
2343
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
2344
+ * let latestSpotterVizId = '';
2345
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2346
+ * latestSpotterVizId = payload.data.id;
2347
+ * });
2348
+ *
2349
+ * spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });
2350
+ * ```
2351
+ *
2346
2352
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2347
2353
  */
2348
2354
  HostEvent["Pin"] = "pin";
@@ -2417,10 +2423,15 @@ var HostEvent;
2417
2423
  * ```
2418
2424
  * @example
2419
2425
  * ```js
2420
- * spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
2421
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2422
- * });
2423
- * ```
2426
+
2427
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPdf host event.
2428
+ * let latestSpotterVizId = '';
2429
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2430
+ * latestSpotterVizId = payload.data.id;
2431
+ * });
2432
+ *
2433
+ * spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });
2434
+ * ```
2424
2435
  *
2425
2436
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2426
2437
  */
@@ -2447,10 +2458,14 @@ var HostEvent;
2447
2458
  * ```
2448
2459
  * @example
2449
2460
  * ```js
2450
- * const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
2451
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2452
- * });
2453
- * ```
2461
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in MakeACopy host event.
2462
+ * let latestSpotterVizId = '';
2463
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2464
+ * latestSpotterVizId = payload.data.id;
2465
+ * });
2466
+ *
2467
+ * spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
2468
+ * ```
2454
2469
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2455
2470
  */
2456
2471
  HostEvent["MakeACopy"] = "makeACopy";
@@ -2535,15 +2550,7 @@ var HostEvent;
2535
2550
  * ```
2536
2551
  * @example
2537
2552
  * ```js
2538
- * const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2539
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2540
- * });
2541
- * ```
2542
- * @example
2543
- * ```js
2544
- * const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2545
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2546
- * });
2553
+ * spotterEmbed.trigger(HostEvent.Edit);
2547
2554
  * ```
2548
2555
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2549
2556
  */
@@ -2592,16 +2599,23 @@ var HostEvent;
2592
2599
  * );
2593
2600
  * })
2594
2601
  * ```
2595
- * @example
2602
+ * * @example
2596
2603
  * ```js
2597
- * spotterEmbed.trigger(HostEvent.GetTML, {
2598
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2604
+
2605
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
2606
+ * let latestSpotterVizId = '';
2607
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2608
+ * latestSpotterVizId = payload.data.id;
2609
+ * });
2610
+ *
2611
+ * spotterEmbed.trigger(HostEvent.GetTML, {
2612
+ * vizId: latestSpotterVizId
2599
2613
  * }).then((tml) => {
2600
2614
  * console.log(
2601
2615
  * tml.answer.search_query // TML representation of the search query
2602
2616
  * );
2603
2617
  * })
2604
- * ```
2618
+ * ```
2605
2619
  * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
2606
2620
  * @important
2607
2621
  */
@@ -2665,7 +2679,7 @@ var HostEvent;
2665
2679
  /**
2666
2680
  * Trigger the **Download** action on charts in
2667
2681
  * the embedded view.
2668
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2682
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
2669
2683
  * @example
2670
2684
  * ```js
2671
2685
  * liveboardEmbed.trigger(HostEvent.Download, {vizId:
@@ -2675,10 +2689,14 @@ var HostEvent;
2675
2689
  * embed.trigger(HostEvent.Download)
2676
2690
  * ```
2677
2691
  * ```js
2678
- * spotterEmbed.trigger(HostEvent.Download, {
2679
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2680
- * });
2681
- * ```
2692
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in Download host event.
2693
+ * let latestSpotterVizId = '';
2694
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2695
+ * latestSpotterVizId = payload.data.id;
2696
+ * });
2697
+ *
2698
+ * spotterEmbed.trigger(HostEvent.Download, { vizId: latestSpotterVizId });
2699
+ * ```
2682
2700
  * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
2683
2701
  * Use {@link DownloadAsPng}
2684
2702
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
@@ -2696,9 +2714,13 @@ var HostEvent;
2696
2714
  *
2697
2715
  * searchEmbed.trigger(HostEvent.DownloadAsPng)
2698
2716
  *
2699
- * spotterEmbed.trigger(HostEvent.DownloadAsPng, {
2700
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2701
- * })
2717
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPng host event.
2718
+ * let latestSpotterVizId = '';
2719
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2720
+ * latestSpotterVizId = payload.data.id;
2721
+ * });
2722
+ *
2723
+ * spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
2702
2724
  * ```
2703
2725
  *
2704
2726
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
@@ -2707,7 +2729,7 @@ var HostEvent;
2707
2729
  /**
2708
2730
  * Trigger the **Download** > **CSV** action on tables in
2709
2731
  * the embedded view.
2710
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2732
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
2711
2733
  * @example
2712
2734
  * ```js
2713
2735
  * liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
@@ -2720,9 +2742,13 @@ var HostEvent;
2720
2742
  * searchEmbed.trigger(HostEvent.DownloadAsCsv)
2721
2743
  * ```
2722
2744
  * ```js
2723
- * spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
2724
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2725
- * })
2745
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsCsv host event.
2746
+ * let latestSpotterVizId = '';
2747
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2748
+ * latestSpotterVizId = payload.data.id;
2749
+ * });
2750
+ *
2751
+ * spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
2726
2752
  * ```
2727
2753
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2728
2754
  */
@@ -2730,7 +2756,7 @@ var HostEvent;
2730
2756
  /**
2731
2757
  * Trigger the **Download** > **XLSX** action on tables
2732
2758
  * in the embedded view.
2733
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2759
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
2734
2760
  * @example
2735
2761
  * ```js
2736
2762
  * liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
@@ -2743,9 +2769,13 @@ var HostEvent;
2743
2769
  * searchEmbed.trigger(HostEvent.DownloadAsXlsx)
2744
2770
  * ```
2745
2771
  * ```js
2746
- * spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
2747
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2748
- * })
2772
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsXlsx host event.
2773
+ * let latestSpotterVizId = '';
2774
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2775
+ * latestSpotterVizId = payload.data.id;
2776
+ * });
2777
+ *
2778
+ * spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
2749
2779
  * ```
2750
2780
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2751
2781
  */
@@ -2782,7 +2812,7 @@ var HostEvent;
2782
2812
  * ```
2783
2813
  *
2784
2814
  * ```js
2785
- * // Save an Answer in Spotter (requires vizId)
2815
+ * // Save a Visualization in Spotter (requires vizId)
2786
2816
  * spotterEmbed.trigger(HostEvent.Save, {
2787
2817
  * vizId: "730496d6-6903-4601-937e-2c691821af3c"
2788
2818
  * })
@@ -3104,11 +3134,13 @@ var HostEvent;
3104
3134
  * });
3105
3135
  *```
3106
3136
  *```js
3107
- * spotterEmbed.trigger(HostEvent.GetParameters, {
3108
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
3109
- * }).then((parameter) => {
3110
- * console.log('parameters', parameter);
3111
- * });
3137
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in GetParameters host event.
3138
+ * let latestSpotterVizId = '';
3139
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
3140
+ * latestSpotterVizId = payload.data.id;
3141
+ * });
3142
+ *
3143
+ * spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
3112
3144
  *```
3113
3145
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
3114
3146
  */
@@ -3151,11 +3183,13 @@ var HostEvent;
3151
3183
  * ```
3152
3184
  * @example
3153
3185
  * ```js
3154
- * const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {
3155
- * vizId: '730496d6-6903-4601-937e-2c691821af3c',
3156
- * name: "Sales by states",
3157
- * description: "Total sales by states in MidWest"
3186
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in SaveAnswer host event.
3187
+ * let latestSpotterVizId = '';
3188
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
3189
+ * latestSpotterVizId = payload.data.id;
3158
3190
  * });
3191
+ *
3192
+ * spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
3159
3193
  * ```
3160
3194
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
3161
3195
  */
@@ -3239,12 +3273,15 @@ var HostEvent;
3239
3273
  HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
3240
3274
  /**
3241
3275
  * Toggle the visualization to chart or table view.
3242
- * @param - `vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed.
3276
+ * @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
3243
3277
  * @example
3244
3278
  * ```js
3245
- * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
3246
- * vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
3279
+ * let latestSpotterVizId = '';
3280
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
3281
+ * latestSpotterVizId = payload.data.id;
3247
3282
  * });
3283
+ *
3284
+ * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId });
3248
3285
  *```
3249
3286
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3250
3287
  */
@@ -3273,12 +3310,16 @@ var HostEvent;
3273
3310
  */
3274
3311
  HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
3275
3312
  /**
3276
- * Trigger the *Ask Spotter* action for visualizations
3277
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
3313
+ * Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
3314
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
3278
3315
  * @example
3279
3316
  * ```js
3280
- * spotterEmbed.trigger(HostEvent.AskSpotter,
3281
- * {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
3317
+ * let latestSpotterVizId = '';
3318
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
3319
+ * latestSpotterVizId = payload.data.id;
3320
+ * });
3321
+ *
3322
+ * spotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId });
3282
3323
  * ```
3283
3324
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
3284
3325
  */
@@ -3336,6 +3377,7 @@ var Param;
3336
3377
  Param["HideResult"] = "hideResult";
3337
3378
  Param["UseLastSelectedDataSource"] = "useLastSelectedSources";
3338
3379
  Param["Tag"] = "tag";
3380
+ Param["HideTagFilterChips"] = "hideTagFilterChips";
3339
3381
  Param["AutoLogin"] = "autoLogin";
3340
3382
  Param["searchTokenString"] = "searchTokenString";
3341
3383
  Param["executeSearch"] = "executeSearch";
@@ -3440,6 +3482,7 @@ var Param;
3440
3482
  Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
3441
3483
  Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
3442
3484
  Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
3485
+ Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
3443
3486
  })(Param || (Param = {}));
3444
3487
  /**
3445
3488
  * ThoughtSpot application pages include actions and menu commands
@@ -7232,6 +7275,7 @@ const ERROR_MESSAGE = {
7232
7275
  MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
7233
7276
  RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
7234
7277
  SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
7278
+ OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
7235
7279
  };
7236
7280
  const CUSTOM_ACTIONS_ERROR_MESSAGE = {
7237
7281
  INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
@@ -8141,7 +8185,7 @@ class AnswerService {
8141
8185
  async getTML() {
8142
8186
  const { object } = await this.executeQuery(getAnswerTML, {});
8143
8187
  const edoc = object[0].edoc;
8144
- const YAML = await import('./index-BpSohedu.js');
8188
+ const YAML = await import('./index-UY-4yjBN.js');
8145
8189
  const parsedDoc = YAML.parse(edoc);
8146
8190
  return {
8147
8191
  answer: {
@@ -17480,7 +17524,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
17480
17524
  return e;
17481
17525
  }
17482
17526
 
17483
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
17527
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-HE2.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
17484
17528
 
17485
17529
  /**
17486
17530
  * Reloads the ThoughtSpot iframe.
@@ -17499,6 +17543,7 @@ const reload = (iFrame) => {
17499
17543
  * @param message
17500
17544
  * @param message.type
17501
17545
  * @param message.data
17546
+ * @param message.context
17502
17547
  * @param thoughtSpotHost
17503
17548
  * @param channel
17504
17549
  */
@@ -17513,8 +17558,9 @@ const TRIGGER_TIMEOUT = 30000;
17513
17558
  * @param messageType
17514
17559
  * @param thoughtSpotHost
17515
17560
  * @param data
17561
+ * @param context
17516
17562
  */
17517
- function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17563
+ function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
17518
17564
  return new Promise((res, rej) => {
17519
17565
  var _a;
17520
17566
  if (messageType === HostEvent.Reload) {
@@ -17548,7 +17594,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17548
17594
  channel.port1.close();
17549
17595
  res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
17550
17596
  }, TRIGGER_TIMEOUT);
17551
- return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
17597
+ return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
17552
17598
  });
17553
17599
  }
17554
17600
 
@@ -17560,7 +17606,15 @@ var UIPassthroughEvent;
17560
17606
  UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
17561
17607
  UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
17562
17608
  UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
17563
- })(UIPassthroughEvent || (UIPassthroughEvent = {}));
17609
+ })(UIPassthroughEvent || (UIPassthroughEvent = {}));
17610
+ var ContextType;
17611
+ (function (ContextType) {
17612
+ ContextType["Search"] = "search";
17613
+ ContextType["Liveboard"] = "liveboard";
17614
+ ContextType["Answer"] = "answer";
17615
+ ContextType["Spotter"] = "spotter";
17616
+ ContextType["None"] = "";
17617
+ })(ContextType || (ContextType = {}));
17564
17618
 
17565
17619
  class HostEventClient {
17566
17620
  constructor(iFrame) {
@@ -17572,12 +17626,12 @@ class HostEventClient {
17572
17626
  * @param {any} data Data to send with the host event
17573
17627
  * @returns {Promise<any>} - the response from the process trigger
17574
17628
  */
17575
- async processTrigger(message, data) {
17629
+ async processTrigger(message, data, context) {
17576
17630
  if (!this.iFrame) {
17577
17631
  throw new Error('Iframe element is not set');
17578
17632
  }
17579
17633
  const thoughtspotHost = getEmbedConfig().thoughtSpotHost;
17580
- return processTrigger(this.iFrame, message, thoughtspotHost, data);
17634
+ return processTrigger(this.iFrame, message, thoughtspotHost, data, context);
17581
17635
  }
17582
17636
  async handleHostEventWithParam(apiName, parameters) {
17583
17637
  var _a, _b, _c, _d;
@@ -17596,8 +17650,8 @@ class HostEventClient {
17596
17650
  }
17597
17651
  return { ...response.value };
17598
17652
  }
17599
- async hostEventFallback(hostEvent, data) {
17600
- return this.processTrigger(hostEvent, data);
17653
+ async hostEventFallback(hostEvent, data, context) {
17654
+ return this.processTrigger(hostEvent, data, context);
17601
17655
  }
17602
17656
  /**
17603
17657
  * Setter for the iframe element used for host events
@@ -17641,14 +17695,14 @@ class HostEventClient {
17641
17695
  answerId: (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.saveResponse) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.Answer__save) === null || _c === void 0 ? void 0 : _c.answer) === null || _d === void 0 ? void 0 : _d.id,
17642
17696
  };
17643
17697
  }
17644
- async triggerHostEvent(hostEvent, payload) {
17698
+ async triggerHostEvent(hostEvent, payload, context) {
17645
17699
  switch (hostEvent) {
17646
17700
  case HostEvent.Pin:
17647
17701
  return this.handlePinEvent(payload);
17648
17702
  case HostEvent.SaveAnswer:
17649
17703
  return this.handleSaveAnswerEvent(payload);
17650
17704
  default:
17651
- return this.hostEventFallback(hostEvent, payload);
17705
+ return this.hostEventFallback(hostEvent, payload, context);
17652
17706
  }
17653
17707
  }
17654
17708
  }
@@ -17950,39 +18004,69 @@ class TsEmbed {
17950
18004
  return eventData;
17951
18005
  }
17952
18006
  /**
17953
- * Adds a global event listener to window for "message" events.
17954
- * ThoughtSpot detects if a particular event is targeted to this
17955
- * embed instance through an identifier contained in the payload,
17956
- * and executes the registered callbacks accordingly.
18007
+ * Subscribe to network events (online/offline) that should
18008
+ * work regardless of auth status
17957
18009
  */
17958
- subscribeToEvents() {
17959
- this.unsubscribeToEvents();
17960
- const messageEventListener = (event) => {
17961
- const eventType = this.getEventType(event);
17962
- const eventPort = this.getEventPort(event);
17963
- const eventData = this.formatEventData(event, eventType);
17964
- if (event.source === this.iFrame.contentWindow) {
17965
- this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
17966
- }
17967
- };
17968
- window.addEventListener('message', messageEventListener);
18010
+ subscribeToNetworkEvents() {
18011
+ this.unsubscribeToNetworkEvents();
17969
18012
  const onlineEventListener = (e) => {
17970
18013
  this.trigger(HostEvent.Reload);
17971
18014
  };
17972
18015
  window.addEventListener('online', onlineEventListener);
17973
18016
  const offlineEventListener = (e) => {
17974
- const offlineWarning = 'Network not Detected. Embed is offline. Please reconnect and refresh';
18017
+ const offlineWarning = ERROR_MESSAGE.OFFLINE_WARNING;
17975
18018
  this.executeCallbacks(EmbedEvent.Error, {
17976
18019
  offlineWarning,
17977
18020
  });
17978
18021
  logger$3.warn(offlineWarning);
17979
18022
  };
17980
18023
  window.addEventListener('offline', offlineEventListener);
17981
- this.subscribedListeners = {
17982
- message: messageEventListener,
17983
- online: onlineEventListener,
17984
- offline: offlineEventListener,
18024
+ this.subscribedListeners.online = onlineEventListener;
18025
+ this.subscribedListeners.offline = offlineEventListener;
18026
+ }
18027
+ /**
18028
+ * Subscribe to message events that depend on successful iframe setup
18029
+ */
18030
+ subscribeToMessageEvents() {
18031
+ this.unsubscribeToMessageEvents();
18032
+ const messageEventListener = (event) => {
18033
+ const eventType = this.getEventType(event);
18034
+ const eventPort = this.getEventPort(event);
18035
+ const eventData = this.formatEventData(event, eventType);
18036
+ if (event.source === this.iFrame.contentWindow) {
18037
+ this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
18038
+ }
17985
18039
  };
18040
+ window.addEventListener('message', messageEventListener);
18041
+ this.subscribedListeners.message = messageEventListener;
18042
+ }
18043
+ /**
18044
+ * Adds event listeners for both network and message events.
18045
+ * This maintains backward compatibility with the existing method.
18046
+ * Adds a global event listener to window for "message" events.
18047
+ * ThoughtSpot detects if a particular event is targeted to this
18048
+ * embed instance through an identifier contained in the payload,
18049
+ * and executes the registered callbacks accordingly.
18050
+ */
18051
+ subscribeToEvents() {
18052
+ this.subscribeToNetworkEvents();
18053
+ this.subscribeToMessageEvents();
18054
+ }
18055
+ unsubscribeToNetworkEvents() {
18056
+ if (this.subscribedListeners.online) {
18057
+ window.removeEventListener('online', this.subscribedListeners.online);
18058
+ delete this.subscribedListeners.online;
18059
+ }
18060
+ if (this.subscribedListeners.offline) {
18061
+ window.removeEventListener('offline', this.subscribedListeners.offline);
18062
+ delete this.subscribedListeners.offline;
18063
+ }
18064
+ }
18065
+ unsubscribeToMessageEvents() {
18066
+ if (this.subscribedListeners.message) {
18067
+ window.removeEventListener('message', this.subscribedListeners.message);
18068
+ delete this.subscribedListeners.message;
18069
+ }
17986
18070
  }
17987
18071
  unsubscribeToEvents() {
17988
18072
  Object.keys(this.subscribedListeners).forEach((key) => {
@@ -18283,6 +18367,8 @@ class TsEmbed {
18283
18367
  type: EmbedEvent.Init,
18284
18368
  });
18285
18369
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_START);
18370
+ // Always subscribe to network events, regardless of auth status
18371
+ this.subscribeToNetworkEvents();
18286
18372
  return (_a = getAuthPromise()) === null || _a === void 0 ? void 0 : _a.then((isLoggedIn) => {
18287
18373
  if (!isLoggedIn) {
18288
18374
  this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
@@ -18325,7 +18411,9 @@ class TsEmbed {
18325
18411
  el.remove();
18326
18412
  });
18327
18413
  }
18328
- this.subscribeToEvents();
18414
+ // Subscribe to message events only after successful
18415
+ // auth and iframe setup
18416
+ this.subscribeToMessageEvents();
18329
18417
  }).catch((error) => {
18330
18418
  nextInQueue();
18331
18419
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_FAILED, {
@@ -18635,7 +18723,7 @@ class TsEmbed {
18635
18723
  * @param {any} data The payload to send with the message
18636
18724
  * @returns A promise that resolves with the response from the embedded app
18637
18725
  */
18638
- async trigger(messageType, data = {}) {
18726
+ async trigger(messageType, data = {}, context) {
18639
18727
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
18640
18728
  if (!this.isRendered) {
18641
18729
  this.handleError('Please call render before triggering events');
@@ -18645,8 +18733,14 @@ class TsEmbed {
18645
18733
  this.handleError('Host event type is undefined');
18646
18734
  return null;
18647
18735
  }
18736
+ // Check if iframe exists before triggering -
18737
+ // this prevents the error when auth fails
18738
+ if (!this.iFrame) {
18739
+ logger$3.debug(`Cannot trigger ${messageType} - iframe not available (likely due to auth failure)`);
18740
+ return null;
18741
+ }
18648
18742
  // send an empty object, this is needed for liveboard default handlers
18649
- return this.hostEventClient.triggerHostEvent(messageType, data);
18743
+ return this.hostEventClient.triggerHostEvent(messageType, data, context);
18650
18744
  }
18651
18745
  /**
18652
18746
  * Triggers an event to the embedded app, skipping the UI flow.
@@ -19164,7 +19258,7 @@ class AppEmbed extends V1Embed {
19164
19258
  * embedded Liveboard or visualization.
19165
19259
  */
19166
19260
  getEmbedParams() {
19167
- const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, } = this.viewConfig;
19261
+ const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLinkParametersEnabled, } = this.viewConfig;
19168
19262
  let params = {};
19169
19263
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
19170
19264
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -19232,6 +19326,12 @@ class AppEmbed extends V1Embed {
19232
19326
  if (isPNGInScheduledEmailsEnabled !== undefined) {
19233
19327
  params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
19234
19328
  }
19329
+ if (hideTagFilterChips !== undefined) {
19330
+ params[Param.HideTagFilterChips] = hideTagFilterChips;
19331
+ }
19332
+ if (isLinkParametersEnabled !== undefined) {
19333
+ params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
19334
+ }
19235
19335
  params[Param.DataPanelV2Enabled] = dataPanelV2;
19236
19336
  params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
19237
19337
  params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
@@ -19586,7 +19686,7 @@ class LiveboardEmbed extends V1Embed {
19586
19686
  getEmbedParamsObject() {
19587
19687
  let params = {};
19588
19688
  params = this.getBaseQueryParams(params);
19589
- const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, } = this.viewConfig;
19689
+ const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isLinkParametersEnabled, } = this.viewConfig;
19590
19690
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
19591
19691
  || this.viewConfig.preventPinboardFilterRemoval;
19592
19692
  if (fullHeight === true) {
@@ -19651,6 +19751,9 @@ class LiveboardEmbed extends V1Embed {
19651
19751
  if (showSpotterLimitations !== undefined) {
19652
19752
  params[Param.ShowSpotterLimitations] = showSpotterLimitations;
19653
19753
  }
19754
+ if (isLinkParametersEnabled !== undefined) {
19755
+ params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
19756
+ }
19654
19757
  params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
19655
19758
  params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
19656
19759
  params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
@@ -19747,7 +19850,7 @@ class LiveboardEmbed extends V1Embed {
19747
19850
  * @param {any} data The payload to send with the message
19748
19851
  * @returns A promise that resolves with the response from the embedded app
19749
19852
  */
19750
- trigger(messageType, data = {}) {
19853
+ trigger(messageType, data = {}, context) {
19751
19854
  const dataWithVizId = data;
19752
19855
  if (messageType === HostEvent.SetActiveTab) {
19753
19856
  this.setActiveTab(data);
@@ -19756,7 +19859,7 @@ class LiveboardEmbed extends V1Embed {
19756
19859
  if (typeof dataWithVizId === 'object' && this.viewConfig.vizId) {
19757
19860
  dataWithVizId.vizId = this.viewConfig.vizId;
19758
19861
  }
19759
- return super.trigger(messageType, dataWithVizId);
19862
+ return super.trigger(messageType, dataWithVizId, context);
19760
19863
  }
19761
19864
  /**
19762
19865
  * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.