@thoughtspot/visual-embed-sdk 1.41.1 → 1.42.1-HE2

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 (186) hide show
  1. package/cjs/package.json +9 -9
  2. package/cjs/src/css-variables.d.ts +52 -14
  3. package/cjs/src/css-variables.d.ts.map +1 -1
  4. package/cjs/src/embed/app.d.ts +20 -0
  5. package/cjs/src/embed/app.d.ts.map +1 -1
  6. package/cjs/src/embed/app.js +7 -1
  7. package/cjs/src/embed/app.js.map +1 -1
  8. package/cjs/src/embed/app.spec.js +52 -0
  9. package/cjs/src/embed/app.spec.js.map +1 -1
  10. package/cjs/src/embed/bodyless-conversation.d.ts +1 -0
  11. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  12. package/cjs/src/embed/bodyless-conversation.js +7 -3
  13. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  14. package/cjs/src/embed/conversation.d.ts +1 -0
  15. package/cjs/src/embed/conversation.d.ts.map +1 -1
  16. package/cjs/src/embed/conversation.js +7 -2
  17. package/cjs/src/embed/conversation.js.map +1 -1
  18. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +3 -3
  19. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  20. package/cjs/src/embed/hostEventClient/host-event-client.js +6 -6
  21. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  22. package/cjs/src/embed/liveboard.d.ts +1 -0
  23. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  24. package/cjs/src/embed/liveboard.js +10 -2
  25. package/cjs/src/embed/liveboard.js.map +1 -1
  26. package/cjs/src/embed/liveboard.spec.js +35 -0
  27. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  28. package/cjs/src/embed/sage.d.ts +1 -0
  29. package/cjs/src/embed/sage.d.ts.map +1 -1
  30. package/cjs/src/embed/sage.js +10 -6
  31. package/cjs/src/embed/sage.js.map +1 -1
  32. package/cjs/src/embed/search-bar.d.ts +1 -0
  33. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  34. package/cjs/src/embed/search-bar.js +11 -7
  35. package/cjs/src/embed/search-bar.js.map +1 -1
  36. package/cjs/src/embed/search.d.ts +1 -0
  37. package/cjs/src/embed/search.d.ts.map +1 -1
  38. package/cjs/src/embed/search.js +7 -8
  39. package/cjs/src/embed/search.js.map +1 -1
  40. package/cjs/src/embed/ts-embed.d.ts +20 -5
  41. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  42. package/cjs/src/embed/ts-embed.js +84 -31
  43. package/cjs/src/embed/ts-embed.js.map +1 -1
  44. package/cjs/src/embed/ts-embed.spec.js +83 -0
  45. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  46. package/cjs/src/errors.d.ts +1 -0
  47. package/cjs/src/errors.d.ts.map +1 -1
  48. package/cjs/src/errors.js +1 -0
  49. package/cjs/src/errors.js.map +1 -1
  50. package/cjs/src/react/all-types-export.spec.js +1 -1
  51. package/cjs/src/react/all-types-export.spec.js.map +1 -1
  52. package/cjs/src/react/util.js.map +1 -1
  53. package/cjs/src/react/util.spec.d.ts +2 -0
  54. package/cjs/src/react/util.spec.d.ts.map +1 -0
  55. package/cjs/src/react/util.spec.js +78 -0
  56. package/cjs/src/react/util.spec.js.map +1 -0
  57. package/cjs/src/types.d.ts +153 -64
  58. package/cjs/src/types.d.ts.map +1 -1
  59. package/cjs/src/types.js +136 -62
  60. package/cjs/src/types.js.map +1 -1
  61. package/cjs/src/utils/processTrigger.d.ts +2 -1
  62. package/cjs/src/utils/processTrigger.d.ts.map +1 -1
  63. package/cjs/src/utils/processTrigger.js +4 -2
  64. package/cjs/src/utils/processTrigger.js.map +1 -1
  65. package/dist/{index-DQueHwfQ.js → index-CWQnMX2L.js} +1 -1
  66. package/dist/index-Djtv-y7A.js +7371 -0
  67. package/dist/src/css-variables.d.ts +52 -14
  68. package/dist/src/css-variables.d.ts.map +1 -1
  69. package/dist/src/embed/app.d.ts +20 -0
  70. package/dist/src/embed/app.d.ts.map +1 -1
  71. package/dist/src/embed/bodyless-conversation.d.ts +1 -0
  72. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  73. package/dist/src/embed/conversation.d.ts +1 -0
  74. package/dist/src/embed/conversation.d.ts.map +1 -1
  75. package/dist/src/embed/hostEventClient/host-event-client.d.ts +3 -3
  76. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  77. package/dist/src/embed/liveboard.d.ts +1 -0
  78. package/dist/src/embed/liveboard.d.ts.map +1 -1
  79. package/dist/src/embed/sage.d.ts +1 -0
  80. package/dist/src/embed/sage.d.ts.map +1 -1
  81. package/dist/src/embed/search-bar.d.ts +1 -0
  82. package/dist/src/embed/search-bar.d.ts.map +1 -1
  83. package/dist/src/embed/search.d.ts +1 -0
  84. package/dist/src/embed/search.d.ts.map +1 -1
  85. package/dist/src/embed/ts-embed.d.ts +20 -5
  86. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  87. package/dist/src/errors.d.ts +1 -0
  88. package/dist/src/errors.d.ts.map +1 -1
  89. package/dist/src/react/util.spec.d.ts +2 -0
  90. package/dist/src/react/util.spec.d.ts.map +1 -0
  91. package/dist/src/types.d.ts +153 -64
  92. package/dist/src/types.d.ts.map +1 -1
  93. package/dist/src/utils/processTrigger.d.ts +2 -1
  94. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  95. package/dist/tsembed-react.es.js +294 -134
  96. package/dist/tsembed-react.js +293 -133
  97. package/dist/tsembed.es.js +294 -134
  98. package/dist/tsembed.js +293 -133
  99. package/dist/visual-embed-sdk-react-full.d.ts +9401 -9916
  100. package/dist/visual-embed-sdk-react.d.ts +9273 -9922
  101. package/dist/visual-embed-sdk.d.ts +9440 -9533
  102. package/lib/package.json +9 -9
  103. package/lib/src/css-variables.d.ts +52 -14
  104. package/lib/src/css-variables.d.ts.map +1 -1
  105. package/lib/src/embed/app.d.ts +20 -0
  106. package/lib/src/embed/app.d.ts.map +1 -1
  107. package/lib/src/embed/app.js +7 -1
  108. package/lib/src/embed/app.js.map +1 -1
  109. package/lib/src/embed/app.spec.js +52 -0
  110. package/lib/src/embed/app.spec.js.map +1 -1
  111. package/lib/src/embed/bodyless-conversation.d.ts +1 -0
  112. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  113. package/lib/src/embed/bodyless-conversation.js +7 -3
  114. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  115. package/lib/src/embed/conversation.d.ts +1 -0
  116. package/lib/src/embed/conversation.d.ts.map +1 -1
  117. package/lib/src/embed/conversation.js +7 -2
  118. package/lib/src/embed/conversation.js.map +1 -1
  119. package/lib/src/embed/hostEventClient/host-event-client.d.ts +3 -3
  120. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  121. package/lib/src/embed/hostEventClient/host-event-client.js +6 -6
  122. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  123. package/lib/src/embed/liveboard.d.ts +1 -0
  124. package/lib/src/embed/liveboard.d.ts.map +1 -1
  125. package/lib/src/embed/liveboard.js +10 -2
  126. package/lib/src/embed/liveboard.js.map +1 -1
  127. package/lib/src/embed/liveboard.spec.js +35 -0
  128. package/lib/src/embed/liveboard.spec.js.map +1 -1
  129. package/lib/src/embed/sage.d.ts +1 -0
  130. package/lib/src/embed/sage.d.ts.map +1 -1
  131. package/lib/src/embed/sage.js +10 -6
  132. package/lib/src/embed/sage.js.map +1 -1
  133. package/lib/src/embed/search-bar.d.ts +1 -0
  134. package/lib/src/embed/search-bar.d.ts.map +1 -1
  135. package/lib/src/embed/search-bar.js +11 -7
  136. package/lib/src/embed/search-bar.js.map +1 -1
  137. package/lib/src/embed/search.d.ts +1 -0
  138. package/lib/src/embed/search.d.ts.map +1 -1
  139. package/lib/src/embed/search.js +7 -8
  140. package/lib/src/embed/search.js.map +1 -1
  141. package/lib/src/embed/ts-embed.d.ts +20 -5
  142. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  143. package/lib/src/embed/ts-embed.js +84 -31
  144. package/lib/src/embed/ts-embed.js.map +1 -1
  145. package/lib/src/embed/ts-embed.spec.js +83 -0
  146. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  147. package/lib/src/errors.d.ts +1 -0
  148. package/lib/src/errors.d.ts.map +1 -1
  149. package/lib/src/errors.js +1 -0
  150. package/lib/src/errors.js.map +1 -1
  151. package/lib/src/react/all-types-export.spec.js +1 -1
  152. package/lib/src/react/all-types-export.spec.js.map +1 -1
  153. package/lib/src/react/util.js.map +1 -1
  154. package/lib/src/react/util.spec.d.ts +2 -0
  155. package/lib/src/react/util.spec.d.ts.map +1 -0
  156. package/lib/src/react/util.spec.js +76 -0
  157. package/lib/src/react/util.spec.js.map +1 -0
  158. package/lib/src/types.d.ts +153 -64
  159. package/lib/src/types.d.ts.map +1 -1
  160. package/lib/src/types.js +136 -62
  161. package/lib/src/types.js.map +1 -1
  162. package/lib/src/utils/processTrigger.d.ts +2 -1
  163. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  164. package/lib/src/utils/processTrigger.js +4 -2
  165. package/lib/src/utils/processTrigger.js.map +1 -1
  166. package/package.json +9 -9
  167. package/src/css-variables.ts +53 -16
  168. package/src/embed/app.spec.ts +73 -0
  169. package/src/embed/app.ts +30 -0
  170. package/src/embed/bodyless-conversation.ts +8 -3
  171. package/src/embed/conversation.ts +17 -2
  172. package/src/embed/hostEventClient/host-event-client.ts +7 -3
  173. package/src/embed/liveboard.spec.ts +44 -0
  174. package/src/embed/liveboard.ts +12 -1
  175. package/src/embed/sage.ts +14 -9
  176. package/src/embed/search-bar.tsx +14 -7
  177. package/src/embed/search.ts +18 -7
  178. package/src/embed/ts-embed.spec.ts +112 -1
  179. package/src/embed/ts-embed.ts +104 -37
  180. package/src/errors.ts +1 -0
  181. package/src/react/all-types-export.spec.ts +1 -1
  182. package/src/react/util.spec.tsx +88 -0
  183. package/src/react/util.ts +3 -3
  184. package/src/types.ts +211 -121
  185. package/src/utils/processTrigger.ts +5 -2
  186. package/lib/src/visual-embed-sdk.d.ts +0 -9779
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.41.1 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.42.1-HE2 */
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
  */
@@ -2764,21 +2794,42 @@ var HostEvent;
2764
2794
  */
2765
2795
  HostEvent["Share"] = "share";
2766
2796
  /**
2767
- * Trigger the **Save** action on a Liveboard or Answer.
2797
+ * Trigger the **Save** action on a Liveboard, Answer, or Spotter.
2768
2798
  * Saves the changes.
2769
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2799
+ *
2800
+ * @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed.
2801
+ * It is required and can be retrieved from the data embed event.
2802
+ *
2770
2803
  * @example
2771
2804
  * ```js
2805
+ * // Save changes in a Liveboard
2772
2806
  * liveboardEmbed.trigger(HostEvent.Save)
2773
2807
  * ```
2808
+ *
2774
2809
  * ```js
2810
+ * // Save the current Answer in Search embed
2775
2811
  * searchEmbed.trigger(HostEvent.Save)
2776
2812
  * ```
2813
+ *
2777
2814
  * ```js
2815
+ * // Save a Visualization in Spotter (requires vizId)
2778
2816
  * spotterEmbed.trigger(HostEvent.Save, {
2779
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2817
+ * vizId: "730496d6-6903-4601-937e-2c691821af3c"
2780
2818
  * })
2781
2819
  * ```
2820
+ *
2821
+ * ```js
2822
+ * // How to get the vizId in Spotter?
2823
+ *
2824
+ * // You can use the Data event dispatched on each answer creation to get the vizId.
2825
+ * let latestSpotterVizId = '';
2826
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2827
+ * latestSpotterVizId = payload.data.id;
2828
+ * });
2829
+ *
2830
+ * spotterEmbed.trigger(HostEvent.Save, { vizId: latestSpotterVizId });
2831
+ * ```
2832
+ *
2782
2833
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2783
2834
  */
2784
2835
  HostEvent["Save"] = "save";
@@ -3083,11 +3134,13 @@ var HostEvent;
3083
3134
  * });
3084
3135
  *```
3085
3136
  *```js
3086
- * spotterEmbed.trigger(HostEvent.GetParameters, {
3087
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
3088
- * }).then((parameter) => {
3089
- * console.log('parameters', parameter);
3090
- * });
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 });
3091
3144
  *```
3092
3145
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
3093
3146
  */
@@ -3130,11 +3183,13 @@ var HostEvent;
3130
3183
  * ```
3131
3184
  * @example
3132
3185
  * ```js
3133
- * const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {
3134
- * vizId: '730496d6-6903-4601-937e-2c691821af3c',
3135
- * name: "Sales by states",
3136
- * 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;
3137
3190
  * });
3191
+ *
3192
+ * spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
3138
3193
  * ```
3139
3194
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
3140
3195
  */
@@ -3218,12 +3273,15 @@ var HostEvent;
3218
3273
  HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
3219
3274
  /**
3220
3275
  * Toggle the visualization to chart or table view.
3221
- * @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.
3222
3277
  * @example
3223
3278
  * ```js
3224
- * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
3225
- * vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
3279
+ * let latestSpotterVizId = '';
3280
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
3281
+ * latestSpotterVizId = payload.data.id;
3226
3282
  * });
3283
+ *
3284
+ * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId });
3227
3285
  *```
3228
3286
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3229
3287
  */
@@ -3252,16 +3310,30 @@ var HostEvent;
3252
3310
  */
3253
3311
  HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
3254
3312
  /**
3255
- * Trigger the *Ask Spotter* action for visualizations
3256
- * @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.
3257
3315
  * @example
3258
3316
  * ```js
3259
- * spotterEmbed.trigger(HostEvent.AskSpotter,
3260
- * {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 });
3261
3323
  * ```
3262
3324
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
3263
3325
  */
3264
3326
  HostEvent["AskSpotter"] = "AskSpotter";
3327
+ /**
3328
+ * @hidden
3329
+ * Triggers the update of the embed params.
3330
+ *
3331
+ * @example
3332
+ * ```js
3333
+ * liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
3334
+ * ```
3335
+ */
3336
+ HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
3265
3337
  })(HostEvent || (HostEvent = {}));
3266
3338
  /**
3267
3339
  * The different visual modes that the data sources panel within
@@ -3305,6 +3377,7 @@ var Param;
3305
3377
  Param["HideResult"] = "hideResult";
3306
3378
  Param["UseLastSelectedDataSource"] = "useLastSelectedSources";
3307
3379
  Param["Tag"] = "tag";
3380
+ Param["HideTagFilterChips"] = "hideTagFilterChips";
3308
3381
  Param["AutoLogin"] = "autoLogin";
3309
3382
  Param["searchTokenString"] = "searchTokenString";
3310
3383
  Param["executeSearch"] = "executeSearch";
@@ -3409,6 +3482,7 @@ var Param;
3409
3482
  Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
3410
3483
  Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
3411
3484
  Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
3485
+ Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
3412
3486
  })(Param || (Param = {}));
3413
3487
  /**
3414
3488
  * ThoughtSpot application pages include actions and menu commands
@@ -7201,6 +7275,7 @@ const ERROR_MESSAGE = {
7201
7275
  MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
7202
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',
7203
7277
  SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
7278
+ OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
7204
7279
  };
7205
7280
  const CUSTOM_ACTIONS_ERROR_MESSAGE = {
7206
7281
  INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
@@ -8110,7 +8185,7 @@ class AnswerService {
8110
8185
  async getTML() {
8111
8186
  const { object } = await this.executeQuery(getAnswerTML, {});
8112
8187
  const edoc = object[0].edoc;
8113
- const YAML = await import('./index-DQueHwfQ.js');
8188
+ const YAML = await import('./index-Djtv-y7A.js');
8114
8189
  const parsedDoc = YAML.parse(edoc);
8115
8190
  return {
8116
8191
  answer: {
@@ -17449,7 +17524,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
17449
17524
  return e;
17450
17525
  }
17451
17526
 
17452
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.41.1";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 . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.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":"^0.7.3",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";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};
17453
17528
 
17454
17529
  /**
17455
17530
  * Reloads the ThoughtSpot iframe.
@@ -17468,6 +17543,7 @@ const reload = (iFrame) => {
17468
17543
  * @param message
17469
17544
  * @param message.type
17470
17545
  * @param message.data
17546
+ * @param message.context
17471
17547
  * @param thoughtSpotHost
17472
17548
  * @param channel
17473
17549
  */
@@ -17482,8 +17558,9 @@ const TRIGGER_TIMEOUT = 30000;
17482
17558
  * @param messageType
17483
17559
  * @param thoughtSpotHost
17484
17560
  * @param data
17561
+ * @param context
17485
17562
  */
17486
- function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17563
+ function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
17487
17564
  return new Promise((res, rej) => {
17488
17565
  var _a;
17489
17566
  if (messageType === HostEvent.Reload) {
@@ -17517,7 +17594,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17517
17594
  channel.port1.close();
17518
17595
  res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
17519
17596
  }, TRIGGER_TIMEOUT);
17520
- return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
17597
+ return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
17521
17598
  });
17522
17599
  }
17523
17600
 
@@ -17541,12 +17618,12 @@ class HostEventClient {
17541
17618
  * @param {any} data Data to send with the host event
17542
17619
  * @returns {Promise<any>} - the response from the process trigger
17543
17620
  */
17544
- async processTrigger(message, data) {
17621
+ async processTrigger(message, data, context) {
17545
17622
  if (!this.iFrame) {
17546
17623
  throw new Error('Iframe element is not set');
17547
17624
  }
17548
17625
  const thoughtspotHost = getEmbedConfig().thoughtSpotHost;
17549
- return processTrigger(this.iFrame, message, thoughtspotHost, data);
17626
+ return processTrigger(this.iFrame, message, thoughtspotHost, data, context);
17550
17627
  }
17551
17628
  async handleHostEventWithParam(apiName, parameters) {
17552
17629
  var _a, _b, _c, _d;
@@ -17565,8 +17642,8 @@ class HostEventClient {
17565
17642
  }
17566
17643
  return { ...response.value };
17567
17644
  }
17568
- async hostEventFallback(hostEvent, data) {
17569
- return this.processTrigger(hostEvent, data);
17645
+ async hostEventFallback(hostEvent, data, context) {
17646
+ return this.processTrigger(hostEvent, data, context);
17570
17647
  }
17571
17648
  /**
17572
17649
  * Setter for the iframe element used for host events
@@ -17610,14 +17687,14 @@ class HostEventClient {
17610
17687
  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,
17611
17688
  };
17612
17689
  }
17613
- async triggerHostEvent(hostEvent, payload) {
17690
+ async triggerHostEvent(hostEvent, payload, context) {
17614
17691
  switch (hostEvent) {
17615
17692
  case HostEvent.Pin:
17616
17693
  return this.handlePinEvent(payload);
17617
17694
  case HostEvent.SaveAnswer:
17618
17695
  return this.handleSaveAnswerEvent(payload);
17619
17696
  default:
17620
- return this.hostEventFallback(hostEvent, payload);
17697
+ return this.hostEventFallback(hostEvent, payload, context);
17621
17698
  }
17622
17699
  }
17623
17700
  }
@@ -17760,10 +17837,10 @@ class TsEmbed {
17760
17837
  };
17761
17838
  this.showPreRenderByDefault = false;
17762
17839
  /**
17763
- * @hidden
17764
- * Internal state to track if the embed container is loaded.
17765
- * This is used to trigger events after the embed container is loaded.
17766
- */
17840
+ * @hidden
17841
+ * Internal state to track if the embed container is loaded.
17842
+ * This is used to trigger events after the embed container is loaded.
17843
+ */
17767
17844
  this.isEmbedContainerLoaded = false;
17768
17845
  /**
17769
17846
  * @hidden
@@ -17822,10 +17899,10 @@ class TsEmbed {
17822
17899
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
17823
17900
  ...viewConfig,
17824
17901
  });
17902
+ const embedConfig = getEmbedConfig();
17903
+ this.embedConfig = embedConfig;
17825
17904
  this.hostEventClient = new HostEventClient(this.iFrame);
17826
17905
  this.isReadyForRenderPromise = getInitPromise().then(async () => {
17827
- const embedConfig = getEmbedConfig();
17828
- this.embedConfig = embedConfig;
17829
17906
  if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
17830
17907
  this.embedConfig.authTriggerContainer = domSelector;
17831
17908
  }
@@ -17919,39 +17996,69 @@ class TsEmbed {
17919
17996
  return eventData;
17920
17997
  }
17921
17998
  /**
17922
- * Adds a global event listener to window for "message" events.
17923
- * ThoughtSpot detects if a particular event is targeted to this
17924
- * embed instance through an identifier contained in the payload,
17925
- * and executes the registered callbacks accordingly.
17999
+ * Subscribe to network events (online/offline) that should
18000
+ * work regardless of auth status
17926
18001
  */
17927
- subscribeToEvents() {
17928
- this.unsubscribeToEvents();
17929
- const messageEventListener = (event) => {
17930
- const eventType = this.getEventType(event);
17931
- const eventPort = this.getEventPort(event);
17932
- const eventData = this.formatEventData(event, eventType);
17933
- if (event.source === this.iFrame.contentWindow) {
17934
- this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
17935
- }
17936
- };
17937
- window.addEventListener('message', messageEventListener);
18002
+ subscribeToNetworkEvents() {
18003
+ this.unsubscribeToNetworkEvents();
17938
18004
  const onlineEventListener = (e) => {
17939
18005
  this.trigger(HostEvent.Reload);
17940
18006
  };
17941
18007
  window.addEventListener('online', onlineEventListener);
17942
18008
  const offlineEventListener = (e) => {
17943
- const offlineWarning = 'Network not Detected. Embed is offline. Please reconnect and refresh';
18009
+ const offlineWarning = ERROR_MESSAGE.OFFLINE_WARNING;
17944
18010
  this.executeCallbacks(EmbedEvent.Error, {
17945
18011
  offlineWarning,
17946
18012
  });
17947
18013
  logger$3.warn(offlineWarning);
17948
18014
  };
17949
18015
  window.addEventListener('offline', offlineEventListener);
17950
- this.subscribedListeners = {
17951
- message: messageEventListener,
17952
- online: onlineEventListener,
17953
- offline: offlineEventListener,
18016
+ this.subscribedListeners.online = onlineEventListener;
18017
+ this.subscribedListeners.offline = offlineEventListener;
18018
+ }
18019
+ /**
18020
+ * Subscribe to message events that depend on successful iframe setup
18021
+ */
18022
+ subscribeToMessageEvents() {
18023
+ this.unsubscribeToMessageEvents();
18024
+ const messageEventListener = (event) => {
18025
+ const eventType = this.getEventType(event);
18026
+ const eventPort = this.getEventPort(event);
18027
+ const eventData = this.formatEventData(event, eventType);
18028
+ if (event.source === this.iFrame.contentWindow) {
18029
+ this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
18030
+ }
17954
18031
  };
18032
+ window.addEventListener('message', messageEventListener);
18033
+ this.subscribedListeners.message = messageEventListener;
18034
+ }
18035
+ /**
18036
+ * Adds event listeners for both network and message events.
18037
+ * This maintains backward compatibility with the existing method.
18038
+ * Adds a global event listener to window for "message" events.
18039
+ * ThoughtSpot detects if a particular event is targeted to this
18040
+ * embed instance through an identifier contained in the payload,
18041
+ * and executes the registered callbacks accordingly.
18042
+ */
18043
+ subscribeToEvents() {
18044
+ this.subscribeToNetworkEvents();
18045
+ this.subscribeToMessageEvents();
18046
+ }
18047
+ unsubscribeToNetworkEvents() {
18048
+ if (this.subscribedListeners.online) {
18049
+ window.removeEventListener('online', this.subscribedListeners.online);
18050
+ delete this.subscribedListeners.online;
18051
+ }
18052
+ if (this.subscribedListeners.offline) {
18053
+ window.removeEventListener('offline', this.subscribedListeners.offline);
18054
+ delete this.subscribedListeners.offline;
18055
+ }
18056
+ }
18057
+ unsubscribeToMessageEvents() {
18058
+ if (this.subscribedListeners.message) {
18059
+ window.removeEventListener('message', this.subscribedListeners.message);
18060
+ delete this.subscribedListeners.message;
18061
+ }
17955
18062
  }
17956
18063
  unsubscribeToEvents() {
17957
18064
  Object.keys(this.subscribedListeners).forEach((key) => {
@@ -18021,6 +18128,11 @@ class TsEmbed {
18021
18128
  .join('/');
18022
18129
  return `${basePath}#`;
18023
18130
  }
18131
+ getUpdateEmbedParamsObject() {
18132
+ let queryParams = this.getEmbedParamsObject();
18133
+ queryParams = { ...this.viewConfig, ...queryParams };
18134
+ return queryParams;
18135
+ }
18024
18136
  /**
18025
18137
  * Common query params set for all the embed modes.
18026
18138
  * @param queryParams
@@ -18170,9 +18282,13 @@ class TsEmbed {
18170
18282
  return path;
18171
18283
  }
18172
18284
  getEmbedParams() {
18173
- const queryParams = this.getBaseQueryParams();
18285
+ const queryParams = this.getEmbedParamsObject();
18174
18286
  return getQueryParamString(queryParams);
18175
18287
  }
18288
+ getEmbedParamsObject() {
18289
+ const params = this.getBaseQueryParams();
18290
+ return params;
18291
+ }
18176
18292
  getRootIframeSrc() {
18177
18293
  const query = this.getEmbedParams();
18178
18294
  return this.getEmbedBasePath(query);
@@ -18243,6 +18359,8 @@ class TsEmbed {
18243
18359
  type: EmbedEvent.Init,
18244
18360
  });
18245
18361
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_START);
18362
+ // Always subscribe to network events, regardless of auth status
18363
+ this.subscribeToNetworkEvents();
18246
18364
  return (_a = getAuthPromise()) === null || _a === void 0 ? void 0 : _a.then((isLoggedIn) => {
18247
18365
  if (!isLoggedIn) {
18248
18366
  this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
@@ -18285,7 +18403,9 @@ class TsEmbed {
18285
18403
  el.remove();
18286
18404
  });
18287
18405
  }
18288
- this.subscribeToEvents();
18406
+ // Subscribe to message events only after successful
18407
+ // auth and iframe setup
18408
+ this.subscribeToMessageEvents();
18289
18409
  }).catch((error) => {
18290
18410
  nextInQueue();
18291
18411
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_FAILED, {
@@ -18595,7 +18715,7 @@ class TsEmbed {
18595
18715
  * @param {any} data The payload to send with the message
18596
18716
  * @returns A promise that resolves with the response from the embedded app
18597
18717
  */
18598
- async trigger(messageType, data = {}) {
18718
+ async trigger(messageType, data = {}, context = {}) {
18599
18719
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
18600
18720
  if (!this.isRendered) {
18601
18721
  this.handleError('Please call render before triggering events');
@@ -18605,8 +18725,14 @@ class TsEmbed {
18605
18725
  this.handleError('Host event type is undefined');
18606
18726
  return null;
18607
18727
  }
18728
+ // Check if iframe exists before triggering -
18729
+ // this prevents the error when auth fails
18730
+ if (!this.iFrame) {
18731
+ logger$3.debug(`Cannot trigger ${messageType} - iframe not available (likely due to auth failure)`);
18732
+ return null;
18733
+ }
18608
18734
  // send an empty object, this is needed for liveboard default handlers
18609
- return this.hostEventClient.triggerHostEvent(messageType, data);
18735
+ return this.hostEventClient.triggerHostEvent(messageType, data, context);
18610
18736
  }
18611
18737
  /**
18612
18738
  * Triggers an event to the embedded app, skipping the UI flow.
@@ -18737,7 +18863,12 @@ class TsEmbed {
18737
18863
  return this.preRender(true);
18738
18864
  }
18739
18865
  this.validatePreRenderViewConfig(this.viewConfig);
18866
+ logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
18867
+ this.executeAfterEmbedContainerLoaded(() => {
18868
+ this.trigger(HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
18869
+ });
18740
18870
  }
18871
+ this.beforePrerenderVisible();
18741
18872
  if (this.el) {
18742
18873
  this.syncPreRenderStyle();
18743
18874
  if (!this.viewConfig.doNotTrackPreRenderSize) {
@@ -18754,7 +18885,6 @@ class TsEmbed {
18754
18885
  this.resizeObserver.observe(this.el);
18755
18886
  }
18756
18887
  }
18757
- this.beforePrerenderVisible();
18758
18888
  removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
18759
18889
  this.subscribeToEvents();
18760
18890
  // Setup fullscreen change handler for prerendered components
@@ -19120,7 +19250,7 @@ class AppEmbed extends V1Embed {
19120
19250
  * embedded Liveboard or visualization.
19121
19251
  */
19122
19252
  getEmbedParams() {
19123
- 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;
19253
+ 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;
19124
19254
  let params = {};
19125
19255
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
19126
19256
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -19188,6 +19318,12 @@ class AppEmbed extends V1Embed {
19188
19318
  if (isPNGInScheduledEmailsEnabled !== undefined) {
19189
19319
  params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
19190
19320
  }
19321
+ if (hideTagFilterChips !== undefined) {
19322
+ params[Param.HideTagFilterChips] = hideTagFilterChips;
19323
+ }
19324
+ if (isLinkParametersEnabled !== undefined) {
19325
+ params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
19326
+ }
19191
19327
  params[Param.DataPanelV2Enabled] = dataPanelV2;
19192
19328
  params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
19193
19329
  params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
@@ -19535,9 +19671,14 @@ class LiveboardEmbed extends V1Embed {
19535
19671
  * embedded Liveboard or visualization.
19536
19672
  */
19537
19673
  getEmbedParams() {
19674
+ const params = this.getEmbedParamsObject();
19675
+ const queryParams = getQueryParamString(params, true);
19676
+ return queryParams;
19677
+ }
19678
+ getEmbedParamsObject() {
19538
19679
  let params = {};
19539
19680
  params = this.getBaseQueryParams(params);
19540
- 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;
19681
+ 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;
19541
19682
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
19542
19683
  || this.viewConfig.preventPinboardFilterRemoval;
19543
19684
  if (fullHeight === true) {
@@ -19602,6 +19743,9 @@ class LiveboardEmbed extends V1Embed {
19602
19743
  if (showSpotterLimitations !== undefined) {
19603
19744
  params[Param.ShowSpotterLimitations] = showSpotterLimitations;
19604
19745
  }
19746
+ if (isLinkParametersEnabled !== undefined) {
19747
+ params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
19748
+ }
19605
19749
  params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
19606
19750
  params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
19607
19751
  params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
@@ -19611,8 +19755,8 @@ class LiveboardEmbed extends V1Embed {
19611
19755
  params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
19612
19756
  params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
19613
19757
  params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
19614
- const queryParams = getQueryParamString(params, true);
19615
- return queryParams;
19758
+ getQueryParamString(params, true);
19759
+ return params;
19616
19760
  }
19617
19761
  getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
19618
19762
  let suffix = `/embed/viz/${liveboardId}`;
@@ -19854,11 +19998,9 @@ class SearchEmbed extends TsEmbed {
19854
19998
  const defaultAppInitData = await super.getAppInitData();
19855
19999
  return { ...defaultAppInitData, ...this.getSearchInitData() };
19856
20000
  }
19857
- getEmbedParams() {
20001
+ getEmbedParamsObject() {
19858
20002
  var _a;
19859
- const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
19860
- /* eslint-disable-next-line max-len */
19861
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
20003
+ const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
19862
20004
  const queryParams = this.getBaseQueryParams();
19863
20005
  queryParams[Param.HideActions] = [
19864
20006
  ...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
@@ -19891,7 +20033,6 @@ class SearchEmbed extends TsEmbed {
19891
20033
  queryParams[Param.HideSearchBar] = true;
19892
20034
  }
19893
20035
  if (isOnBeforeGetVizDataInterceptEnabled) {
19894
- /* eslint-disable-next-line max-len */
19895
20036
  queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
19896
20037
  }
19897
20038
  if (!focusSearchBarOnRender) {
@@ -19904,20 +20045,22 @@ class SearchEmbed extends TsEmbed {
19904
20045
  queryParams[Param.UseLastSelectedDataSource] = false;
19905
20046
  }
19906
20047
  queryParams[Param.searchEmbed] = true;
19907
- /* eslint-disable-next-line max-len */
19908
20048
  queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
19909
20049
  queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
19910
20050
  if (dataPanelCustomGroupsAccordionInitialState
19911
20051
  === DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
19912
20052
  || dataPanelCustomGroupsAccordionInitialState
19913
20053
  === DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
19914
- /* eslint-disable-next-line max-len */
19915
20054
  queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
19916
20055
  }
19917
20056
  else {
19918
- /* eslint-disable-next-line max-len */
19919
20057
  queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
19920
20058
  }
20059
+ return queryParams;
20060
+ }
20061
+ getEmbedParams() {
20062
+ const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
20063
+ const queryParams = this.getEmbedParamsObject();
19921
20064
  let query = '';
19922
20065
  const queryParamsString = getQueryParamString(queryParams, true);
19923
20066
  if (queryParamsString) {
@@ -19973,15 +20116,9 @@ class SearchBarEmbed extends TsEmbed {
19973
20116
  this.embedComponentType = 'SearchBarEmbed';
19974
20117
  this.viewConfig = viewConfig;
19975
20118
  }
19976
- /**
19977
- * Construct the URL of the embedded ThoughtSpot search to be
19978
- * loaded in the iframe
19979
- * @param dataSources A list of data source GUIDs
19980
- */
19981
- getIFrameSrc() {
20119
+ getEmbedParamsObject() {
19982
20120
  var _a;
19983
20121
  const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
19984
- const path = 'search-bar-embed';
19985
20122
  const queryParams = this.getBaseQueryParams();
19986
20123
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
19987
20124
  if (dataSources && dataSources.length) {
@@ -20003,6 +20140,16 @@ class SearchBarEmbed extends TsEmbed {
20003
20140
  queryParams[Param.UseLastSelectedDataSource] = false;
20004
20141
  }
20005
20142
  queryParams[Param.searchEmbed] = true;
20143
+ return queryParams;
20144
+ }
20145
+ /**
20146
+ * Construct the URL of the embedded ThoughtSpot search to be
20147
+ * loaded in the iframe
20148
+ * @param dataSources A list of data source GUIDs
20149
+ */
20150
+ getIFrameSrc() {
20151
+ const queryParams = this.getEmbedParamsObject();
20152
+ const path = 'search-bar-embed';
20006
20153
  let query = '';
20007
20154
  const queryParamsString = getQueryParamString(queryParams, true);
20008
20155
  if (queryParamsString) {
@@ -20425,13 +20572,17 @@ class ConversationMessage extends TsEmbed {
20425
20572
  super(container, viewConfig);
20426
20573
  this.viewConfig = viewConfig;
20427
20574
  }
20428
- getIframeSrc() {
20575
+ getEmbedParamsObject() {
20429
20576
  var _a;
20430
- const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
20431
- const path = 'conv-assist-answer';
20432
20577
  const queryParams = this.getBaseQueryParams();
20433
20578
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
20434
20579
  queryParams[Param.isSpotterAgentEmbed] = true;
20580
+ return queryParams;
20581
+ }
20582
+ getIframeSrc() {
20583
+ const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
20584
+ const path = 'conv-assist-answer';
20585
+ const queryParams = this.getEmbedParamsObject();
20435
20586
  let query = '';
20436
20587
  const queryParamsString = getQueryParamString(queryParams, true);
20437
20588
  if (queryParamsString) {
@@ -20592,9 +20743,8 @@ class SpotterEmbed extends TsEmbed {
20592
20743
  super(container, viewConfig);
20593
20744
  this.viewConfig = viewConfig;
20594
20745
  }
20595
- getIframeSrc() {
20746
+ getEmbedParamsObject() {
20596
20747
  const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
20597
- const path = 'insights/conv-assist';
20598
20748
  if (!worksheetId) {
20599
20749
  this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
20600
20750
  }
@@ -20615,6 +20765,12 @@ class SpotterEmbed extends TsEmbed {
20615
20765
  if (!isUndefined_1(hideSampleQuestions)) {
20616
20766
  queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
20617
20767
  }
20768
+ return queryParams;
20769
+ }
20770
+ getIframeSrc() {
20771
+ const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
20772
+ const path = 'insights/conv-assist';
20773
+ const queryParams = this.getEmbedParamsObject();
20618
20774
  let query = '';
20619
20775
  const queryParamsString = getQueryParamString(queryParams, true);
20620
20776
  if (queryParamsString) {
@@ -20686,12 +20842,7 @@ class SageEmbed extends V1Embed {
20686
20842
  viewConfig.embedComponentType = 'SageEmbed';
20687
20843
  super(domSelector, viewConfig);
20688
20844
  }
20689
- /**
20690
- * Constructs a map of parameters to be passed on to the
20691
- * embedded Eureka or Sage search page.
20692
- * @returns {string} query string
20693
- */
20694
- getEmbedParams() {
20845
+ getEmbedParamsObject() {
20695
20846
  const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
20696
20847
  const params = this.getBaseQueryParams();
20697
20848
  params[Param.DataPanelV2Enabled] = !!dataPanelV2;
@@ -20706,6 +20857,15 @@ class SageEmbed extends V1Embed {
20706
20857
  params[Param.HideSampleQuestions] = !!hideSampleQuestions;
20707
20858
  params[Param.IsProductTour] = !!isProductTour;
20708
20859
  params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
20860
+ return params;
20861
+ }
20862
+ /**
20863
+ * Constructs a map of parameters to be passed on to the
20864
+ * embedded Eureka or Sage search page.
20865
+ * @returns {string} query string
20866
+ */
20867
+ getEmbedParams() {
20868
+ const params = this.getEmbedParamsObject();
20709
20869
  return getQueryParamString(params, true);
20710
20870
  }
20711
20871
  /**