@thoughtspot/visual-embed-sdk 1.39.3 → 1.40.1-alpha.1

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 (93) hide show
  1. package/cjs/src/embed/app.d.ts +56 -0
  2. package/cjs/src/embed/app.d.ts.map +1 -1
  3. package/cjs/src/embed/app.js +47 -8
  4. package/cjs/src/embed/app.js.map +1 -1
  5. package/cjs/src/embed/app.spec.js +322 -7
  6. package/cjs/src/embed/app.spec.js.map +1 -1
  7. package/cjs/src/embed/liveboard.d.ts +58 -1
  8. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  9. package/cjs/src/embed/liveboard.js +59 -8
  10. package/cjs/src/embed/liveboard.js.map +1 -1
  11. package/cjs/src/embed/liveboard.spec.js +206 -0
  12. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  13. package/cjs/src/embed/ts-embed.d.ts +7 -0
  14. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  15. package/cjs/src/embed/ts-embed.js +61 -7
  16. package/cjs/src/embed/ts-embed.js.map +1 -1
  17. package/cjs/src/types.d.ts +37 -6
  18. package/cjs/src/types.d.ts.map +1 -1
  19. package/cjs/src/types.js +35 -4
  20. package/cjs/src/types.js.map +1 -1
  21. package/cjs/src/utils/processTrigger.js +2 -1
  22. package/cjs/src/utils/processTrigger.js.map +1 -1
  23. package/cjs/src/utils.d.ts +6 -0
  24. package/cjs/src/utils.d.ts.map +1 -1
  25. package/cjs/src/utils.js +23 -3
  26. package/cjs/src/utils.js.map +1 -1
  27. package/cjs/src/utils.spec.js +212 -1
  28. package/cjs/src/utils.spec.js.map +1 -1
  29. package/dist/{index-ZrE8YYq8.js → index-CmEQfuE3.js} +1 -1
  30. package/dist/index-D1pyb7RG.js +7371 -0
  31. package/dist/index-DeFzsyFF.js +7371 -0
  32. package/dist/index-Dpf0rd6w.js +7371 -0
  33. package/dist/index-UuEbsISo.js +7447 -0
  34. package/dist/index-e3Uw3YFO.js +7371 -0
  35. package/dist/src/embed/app.d.ts +56 -0
  36. package/dist/src/embed/app.d.ts.map +1 -1
  37. package/dist/src/embed/bodyless-conversation.d.ts +0 -4
  38. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  39. package/dist/src/embed/liveboard.d.ts +56 -0
  40. package/dist/src/embed/liveboard.d.ts.map +1 -1
  41. package/dist/src/react/index.d.ts +0 -2
  42. package/dist/src/react/index.d.ts.map +1 -1
  43. package/dist/src/types.d.ts +16 -198
  44. package/dist/src/types.d.ts.map +1 -1
  45. package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  46. package/dist/src/utils.d.ts +6 -0
  47. package/dist/src/utils.d.ts.map +1 -1
  48. package/dist/tsembed-react.es.js +137 -224
  49. package/dist/tsembed-react.js +136 -223
  50. package/dist/tsembed.es.js +137 -224
  51. package/dist/tsembed.js +136 -223
  52. package/dist/visual-embed-sdk-react-full.d.ts +106 -204
  53. package/dist/visual-embed-sdk-react.d.ts +106 -204
  54. package/dist/visual-embed-sdk.d.ts +106 -202
  55. package/lib/src/embed/app.d.ts +56 -0
  56. package/lib/src/embed/app.d.ts.map +1 -1
  57. package/lib/src/embed/app.js +48 -9
  58. package/lib/src/embed/app.js.map +1 -1
  59. package/lib/src/embed/app.spec.js +322 -7
  60. package/lib/src/embed/app.spec.js.map +1 -1
  61. package/lib/src/embed/liveboard.d.ts +58 -1
  62. package/lib/src/embed/liveboard.d.ts.map +1 -1
  63. package/lib/src/embed/liveboard.js +60 -9
  64. package/lib/src/embed/liveboard.js.map +1 -1
  65. package/lib/src/embed/liveboard.spec.js +206 -0
  66. package/lib/src/embed/liveboard.spec.js.map +1 -1
  67. package/lib/src/embed/ts-embed.d.ts +7 -0
  68. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  69. package/lib/src/embed/ts-embed.js +61 -7
  70. package/lib/src/embed/ts-embed.js.map +1 -1
  71. package/lib/src/types.d.ts +37 -6
  72. package/lib/src/types.d.ts.map +1 -1
  73. package/lib/src/types.js +35 -4
  74. package/lib/src/types.js.map +1 -1
  75. package/lib/src/utils/processTrigger.js +2 -1
  76. package/lib/src/utils/processTrigger.js.map +1 -1
  77. package/lib/src/utils.d.ts +6 -0
  78. package/lib/src/utils.d.ts.map +1 -1
  79. package/lib/src/utils.js +21 -2
  80. package/lib/src/utils.js.map +1 -1
  81. package/lib/src/utils.spec.js +213 -2
  82. package/lib/src/utils.spec.js.map +1 -1
  83. package/lib/src/visual-embed-sdk.d.ts +106 -202
  84. package/package.json +1 -2
  85. package/src/embed/app.spec.ts +397 -8
  86. package/src/embed/app.ts +106 -12
  87. package/src/embed/liveboard.spec.ts +254 -1
  88. package/src/embed/liveboard.ts +109 -11
  89. package/src/embed/ts-embed.ts +84 -21
  90. package/src/types.ts +36 -5
  91. package/src/utils/processTrigger.ts +1 -1
  92. package/src/utils.spec.ts +250 -2
  93. package/src/utils.ts +28 -2
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.39.3 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.39.2-alpha.3 */
2
2
  'use client';
3
3
  import * as React from 'react';
4
4
  import React__default, { useRef, useCallback } from 'react';
@@ -1592,82 +1592,11 @@ var EmbedEvent;
1592
1592
  */
1593
1593
  EmbedEvent["ExitPresentMode"] = "exitPresentMode";
1594
1594
  /**
1595
- * Emitted when spotter response is text data
1596
- * @example
1597
- * ```js
1598
- * spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
1599
- * console.log('payload', payload);
1600
- * })
1601
- *```
1602
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1603
- */
1604
- EmbedEvent["SpotterData"] = "SpotterData";
1605
- /**
1606
- * Emitted when user opens up the worksheet preview modal in spotter embed.
1607
- * @example
1608
- * ```js
1609
- * spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
1610
- * console.log('payload', payload);
1611
- * })
1612
- *```
1613
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1614
- */
1615
- EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
1616
- /**
1617
- * Emitted when the spotter query is triggered in spotter embed.
1618
- * @example
1619
- * ```js
1620
- * spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
1621
- * console.log('payload', payload);
1622
- * })
1623
- *```
1624
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1625
- */
1626
- EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
1627
- /**
1628
- * Emitted when the last spotter query is edited in spotter embed.
1629
- * @example
1630
- * ```js
1631
- * spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
1632
- * console.log('payload', payload);
1633
- * })
1634
- *```
1635
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1636
- */
1637
- EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
1638
- /**
1639
- * Emitted when the last spotter query is deleted in spotter embed.
1640
- * @example
1641
- * ```js
1642
- * spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
1643
- * console.log('payload', payload);
1644
- * })
1645
- *```
1646
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1647
- */
1648
- EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
1649
- /**
1650
- * Emitted when the coversation is reset in spotter embed.
1651
- * @example
1652
- * ```js
1653
- * spotterEmbed.on(EmbedEvent.ResetSpotterConversation, (payload) => {
1654
- * console.log('payload', payload);
1655
- * })
1656
- *```
1657
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1658
- */
1659
- EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
1660
- /**
1661
- * Emitted when the *Spotter* is initialized.
1662
- * @example
1663
- * ```js
1664
- * spotterEmbed.on(EmbedEvent.SpotterInit, (payload) => {
1665
- * console.log('payload', payload);
1666
- * })
1667
- *```
1668
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1595
+ * Emitted when a user requests the full height lazy load data.
1596
+ * @version SDK : 1.39.0 | ThoughtSpot : 10.10.0.cl
1597
+ * @hidden
1669
1598
  */
1670
- EmbedEvent["SpotterInit"] = "SpotterInit";
1599
+ EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
1671
1600
  })(EmbedEvent || (EmbedEvent = {}));
1672
1601
  /**
1673
1602
  * Event types that can be triggered by the host application
@@ -1958,7 +1887,6 @@ var HostEvent;
1958
1887
  * @param
1959
1888
  * `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
1960
1889
  * Optional when pinning a new chart or table generated from a Search query.
1961
- * **Required** in Spotter Embed.
1962
1890
  * @param
1963
1891
  * `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
1964
1892
  * specify the `newLiveboardName` parameter to create a new Liveboard.
@@ -2006,12 +1934,6 @@ var HostEvent;
2006
1934
  * ```js
2007
1935
  * appEmbed.trigger(HostEvent.Pin)
2008
1936
  * ```
2009
- * @example
2010
- * ```js
2011
- * const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
2012
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2013
- * });
2014
- * ```
2015
1937
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2016
1938
  */
2017
1939
  HostEvent["Pin"] = "pin";
@@ -2105,12 +2027,6 @@ var HostEvent;
2105
2027
  * ```js
2106
2028
  * searchEmbed.trigger(HostEvent.MakeACopy)
2107
2029
  * ```
2108
- * @example
2109
- * ```js
2110
- * const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
2111
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2112
- * });
2113
- * ```
2114
2030
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2115
2031
  */
2116
2032
  HostEvent["MakeACopy"] = "makeACopy";
@@ -2183,7 +2099,6 @@ var HostEvent;
2183
2099
  * This event is not supported in visualization embed and search embed.
2184
2100
  * @param - object - To trigger the action for a specific visualization
2185
2101
  * in Liveboard embed, pass in `vizId` as a key.
2186
- * **Required** in Spotter embed.
2187
2102
  * @example
2188
2103
  * ```js
2189
2104
  * liveboardEmbed.trigger(HostEvent.Edit)
@@ -2192,12 +2107,6 @@ var HostEvent;
2192
2107
  * liveboardEmbed.trigger(HostEvent.Edit, {vizId:
2193
2108
  * '730496d6-6903-4601-937e-2c691821af3c'})
2194
2109
  * ```
2195
- * @example
2196
- * ```js
2197
- * const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2198
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2199
- * });
2200
- * ```
2201
2110
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2202
2111
  */
2203
2112
  HostEvent["Edit"] = "edit";
@@ -2245,16 +2154,6 @@ var HostEvent;
2245
2154
  * );
2246
2155
  * })
2247
2156
  * ```
2248
- * @example
2249
- * ```js
2250
- * spotterEmbed.trigger(HostEvent.GetTML, {
2251
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2252
- * }).then((tml) => {
2253
- * console.log(
2254
- * tml.answer.search_query // TML representation of the search query
2255
- * );
2256
- * })
2257
- * ```
2258
2157
  * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
2259
2158
  * @important
2260
2159
  */
@@ -2342,12 +2241,7 @@ var HostEvent;
2342
2241
  * vizEmbed.trigger(HostEvent.DownloadAsPng)
2343
2242
  *
2344
2243
  * searchEmbed.trigger(HostEvent.DownloadAsPng)
2345
- *
2346
- * spotterEmbed.trigger(HostEvent.DownloadAsPng, {
2347
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2348
- * })
2349
2244
  * ```
2350
- *
2351
2245
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
2352
2246
  */
2353
2247
  HostEvent["DownloadAsPng"] = "downloadAsPng";
@@ -2365,11 +2259,6 @@ var HostEvent;
2365
2259
  * ```js
2366
2260
  * searchEmbed.trigger(HostEvent.DownloadAsCsv)
2367
2261
  * ```
2368
- * ```js
2369
- * spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
2370
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2371
- * })
2372
- * ```
2373
2262
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2374
2263
  */
2375
2264
  HostEvent["DownloadAsCsv"] = "downloadAsCSV";
@@ -2387,11 +2276,6 @@ var HostEvent;
2387
2276
  * ```js
2388
2277
  * searchEmbed.trigger(HostEvent.DownloadAsXlsx)
2389
2278
  * ```
2390
- * ```js
2391
- * spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
2392
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2393
- * })
2394
- * ```
2395
2279
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2396
2280
  */
2397
2281
  HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
@@ -2411,7 +2295,6 @@ var HostEvent;
2411
2295
  /**
2412
2296
  * Trigger the **Save** action on a Liveboard or Answer.
2413
2297
  * Saves the changes.
2414
- * @param - `vizId` is required in Spotter Embed.
2415
2298
  * @example
2416
2299
  * ```js
2417
2300
  * liveboardEmbed.trigger(HostEvent.Save)
@@ -2419,11 +2302,6 @@ var HostEvent;
2419
2302
  * ```js
2420
2303
  * searchEmbed.trigger(HostEvent.Save)
2421
2304
  * ```
2422
- * ```js
2423
- * spotterEmbed.trigger(HostEvent.Save, {
2424
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2425
- * })
2426
- * ```
2427
2305
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2428
2306
  */
2429
2307
  HostEvent["Save"] = "save";
@@ -2707,7 +2585,7 @@ var HostEvent;
2707
2585
  HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
2708
2586
  /**
2709
2587
  * Triggers an action to update Parameter values on embedded
2710
- * Answers, Liveboard and Spotter answer in Edit mode.
2588
+ * Answers and Liveboard.
2711
2589
  *
2712
2590
  * @example
2713
2591
  * ```js
@@ -2726,13 +2604,6 @@ var HostEvent;
2726
2604
  * console.log('parameters', parameter);
2727
2605
  * });
2728
2606
  *```
2729
- *```js
2730
- * spotterEmbed.trigger(HostEvent.GetParameters, {
2731
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2732
- * }).then((parameter) => {
2733
- * console.log('parameters', parameter);
2734
- * });
2735
- *```
2736
2607
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
2737
2608
  */
2738
2609
  HostEvent["GetParameters"] = "GetParameters";
@@ -2800,64 +2671,6 @@ var HostEvent;
2800
2671
  * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
2801
2672
  */
2802
2673
  HostEvent["TransformTableVizData"] = "TransformTableVizData";
2803
- /**
2804
- * Triggers a search operation with the search tokens specified in
2805
- * the search query string in spotter embed.
2806
- * @param - `queryString`: Text string in Natural Language format
2807
- * @param - `executeSearch`: Boolean to execute search and update search query
2808
- * @example
2809
- * ```js
2810
- * spotterEmbed.trigger(HostEvent.SpotterSearch, {
2811
- * query: 'revenue per year',
2812
- * executeSearch: true,
2813
- * })
2814
- * ```
2815
- */
2816
- HostEvent["SpotterSearch"] = "SpotterSearch";
2817
- /**
2818
- * Edits the last prompt in spotter embed.
2819
- * @param - `query`: Text string
2820
- * @example
2821
- * ```js
2822
- * spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
2823
- * ```
2824
- */
2825
- HostEvent["EditLastPrompt"] = "EditLastPrompt";
2826
- /**
2827
- * Opens the Worksheet preview modal in Spotter Embed.
2828
- * @example
2829
- * ```js
2830
- * spotterEmbed.trigger(HostEvent.PreviewSpotterData);
2831
- * ```
2832
- */
2833
- HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
2834
- /**
2835
- * Resets the Spotter Embed Conversation.
2836
- * @example
2837
- * ```js
2838
- * spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
2839
- * ```
2840
- */
2841
- HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
2842
- /**
2843
- * Deletes the last prompt in spotter embed.
2844
- * @example
2845
- * ```js
2846
- * spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
2847
- * ```
2848
- */
2849
- HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
2850
- /**
2851
- * Toggle the visualization to chart or table view.
2852
- * @param - `vizId ` In Spotter Embed, vizId is required.
2853
- * @example
2854
- * ```js
2855
- * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
2856
- * vizId:"'b535c760-8bbe-4e6f-bb26-af56b4129a1e'"
2857
- * });
2858
- *```
2859
- */
2860
- HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
2861
2674
  /**
2862
2675
  * @hidden
2863
2676
  * Trigger exit from presentation mode when user exits fullscreen.
@@ -2869,15 +2682,18 @@ var HostEvent;
2869
2682
  */
2870
2683
  HostEvent["ExitPresentMode"] = "exitPresentMode";
2871
2684
  /**
2872
- * Trigger the *Ask Sage* action for visualizations
2685
+ * Triggers the full height lazy load data.
2873
2686
  * @example
2874
2687
  * ```js
2875
- * liveboardEmbed.trigger(HostEvent.AskSpotter,
2876
- * {containerId:'730496d6-6903-4601-937e-2c691821af3c'})
2688
+ * liveboardEmbed.on(EmbedEvent.RequestVisibleEmbedCoordinates, (payload) => {
2689
+ * console.log(payload);
2690
+ * });
2877
2691
  * ```
2878
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
2692
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
2693
+ *
2694
+ * @hidden
2879
2695
  */
2880
- HostEvent["AskSpotter"] = "askSpotter";
2696
+ HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
2881
2697
  })(HostEvent || (HostEvent = {}));
2882
2698
  /**
2883
2699
  * The different visual modes that the data sources panel within
@@ -3022,6 +2838,8 @@ var Param;
3022
2838
  Param["PrimaryAction"] = "primaryAction";
3023
2839
  Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
3024
2840
  Param["IsLiveboardStylingAndGroupingEnabled"] = "isLiveboardStylingAndGroupingEnabled";
2841
+ Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
2842
+ Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
3025
2843
  })(Param || (Param = {}));
3026
2844
  /**
3027
2845
  * ThoughtSpot application pages include actions and menu commands
@@ -4643,7 +4461,6 @@ const getOperationNameFromQuery = (query) => {
4643
4461
  function removeTypename(obj) {
4644
4462
  if (!obj || typeof obj !== 'object')
4645
4463
  return obj;
4646
- // eslint-disable-next-line no-restricted-syntax
4647
4464
  for (const key in obj) {
4648
4465
  if (key === '__typename') {
4649
4466
  delete obj[key];
@@ -4672,7 +4489,11 @@ const setStyleProperties = (element, styleProperties) => {
4672
4489
  if (!(element === null || element === void 0 ? void 0 : element.style))
4673
4490
  return;
4674
4491
  Object.keys(styleProperties).forEach((styleProperty) => {
4675
- element.style[styleProperty] = styleProperties[styleProperty].toString();
4492
+ const styleKey = styleProperty;
4493
+ const value = styleProperties[styleKey];
4494
+ if (value !== undefined) {
4495
+ element.style[styleKey] = value.toString();
4496
+ }
4676
4497
  });
4677
4498
  };
4678
4499
  /**
@@ -4800,6 +4621,22 @@ const handleExitPresentMode = async () => {
4800
4621
  }
4801
4622
  }
4802
4623
  logger$3.warn('Exit fullscreen API is not supported by this browser.');
4624
+ };
4625
+ const calculateVisibleElementData = (element) => {
4626
+ const rect = element.getBoundingClientRect();
4627
+ const windowHeight = window.innerHeight;
4628
+ const windowWidth = window.innerWidth;
4629
+ const frameRelativeTop = Math.max(rect.top, 0);
4630
+ const frameRelativeLeft = Math.max(rect.left, 0);
4631
+ const frameRelativeBottom = Math.min(windowHeight, rect.bottom);
4632
+ const frameRelativeRight = Math.min(windowWidth, rect.right);
4633
+ const data = {
4634
+ top: Math.max(0, rect.top * -1),
4635
+ height: Math.max(0, frameRelativeBottom - frameRelativeTop),
4636
+ left: Math.max(0, rect.left * -1),
4637
+ width: Math.max(0, frameRelativeRight - frameRelativeLeft),
4638
+ };
4639
+ return data;
4803
4640
  };
4804
4641
 
4805
4642
  /**
@@ -7986,7 +7823,7 @@ class AnswerService {
7986
7823
  async getTML() {
7987
7824
  const { object } = await this.executeQuery(getAnswerTML, {});
7988
7825
  const edoc = object[0].edoc;
7989
- const YAML = await import('./index-ZrE8YYq8.js');
7826
+ const YAML = await import('./index-D1pyb7RG.js');
7990
7827
  const parsedDoc = YAML.parse(edoc);
7991
7828
  return {
7992
7829
  answer: {
@@ -15720,7 +15557,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
15720
15557
  return e;
15721
15558
  }
15722
15559
 
15723
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.3";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 | coveralls","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":"^8.2.6","@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",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.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":"^1.1.1",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:"31 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};
15560
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.2-alpha.3";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 | coveralls","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":"^8.2.6","@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",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.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":"^1.1.1",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:"31 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};
15724
15561
 
15725
15562
  /**
15726
15563
  * Reloads the ThoughtSpot iframe.
@@ -15743,7 +15580,8 @@ const reload = (iFrame) => {
15743
15580
  * @param channel
15744
15581
  */
15745
15582
  function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
15746
- return iFrame.contentWindow.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
15583
+ var _a;
15584
+ return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
15747
15585
  }
15748
15586
  const TRIGGER_TIMEOUT = 30000;
15749
15587
  /**
@@ -17456,7 +17294,6 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
17456
17294
  /**
17457
17295
  * Pages within the ThoughtSpot app that can be embedded.
17458
17296
  */
17459
- // eslint-disable-next-line no-shadow
17460
17297
  var Page;
17461
17298
  (function (Page) {
17462
17299
  /**
@@ -17563,11 +17400,25 @@ var ListPage;
17563
17400
  * @group Embed components
17564
17401
  */
17565
17402
  let AppEmbed$1 = class AppEmbed extends V1Embed {
17566
- // eslint-disable-next-line no-useless-constructor
17567
17403
  constructor(domSelector, viewConfig) {
17568
17404
  viewConfig.embedComponentType = 'AppEmbed';
17569
17405
  super(domSelector, viewConfig);
17570
17406
  this.defaultHeight = '100%';
17407
+ this.sendFullHeightLazyLoadData = () => {
17408
+ const data = calculateVisibleElementData(this.iFrame);
17409
+ this.trigger(HostEvent.VisibleEmbedCoordinates, data);
17410
+ };
17411
+ /**
17412
+ * This is a handler for the RequestVisibleEmbedCoordinates event.
17413
+ * It is used to send the visible coordinates data to the host application.
17414
+ * @param data The event payload
17415
+ * @param responder The responder function
17416
+ */
17417
+ this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
17418
+ logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
17419
+ const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
17420
+ responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
17421
+ };
17571
17422
  /**
17572
17423
  * Set the iframe height as per the computed height received
17573
17424
  * from the ThoughtSpot app.
@@ -17576,6 +17427,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17576
17427
  this.updateIFrameHeight = (data) => {
17577
17428
  var _a;
17578
17429
  this.setIFrameHeight(Math.max(data.data, (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.scrollHeight));
17430
+ this.sendFullHeightLazyLoadData();
17579
17431
  };
17580
17432
  this.embedIframeCenter = (data, responder) => {
17581
17433
  const obj = this.getIframeCenter();
@@ -17605,6 +17457,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17605
17457
  this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
17606
17458
  this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
17607
17459
  this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
17460
+ this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
17608
17461
  }
17609
17462
  }
17610
17463
  /**
@@ -17612,9 +17465,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17612
17465
  * embedded Liveboard or visualization.
17613
17466
  */
17614
17467
  getEmbedParams() {
17615
- const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
17616
- /* eslint-disable-next-line max-len */
17617
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17468
+ const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17618
17469
  let params = {};
17619
17470
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
17620
17471
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -17643,6 +17494,10 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17643
17494
  }
17644
17495
  if (fullHeight === true) {
17645
17496
  params[Param.fullHeight] = true;
17497
+ if (this.viewConfig.lazyLoadingForFullHeight) {
17498
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
17499
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
17500
+ }
17646
17501
  }
17647
17502
  if (tag) {
17648
17503
  params[Param.Tag] = tag;
@@ -17663,7 +17518,6 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17663
17518
  params[Param.enableAskSage] = enableAskSage;
17664
17519
  }
17665
17520
  if (isOnBeforeGetVizDataInterceptEnabled) {
17666
- /* eslint-disable-next-line max-len */
17667
17521
  params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
17668
17522
  }
17669
17523
  if (homePageSearchBarMode) {
@@ -17684,11 +17538,9 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17684
17538
  === DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
17685
17539
  || dataPanelCustomGroupsAccordionInitialState
17686
17540
  === DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
17687
- /* eslint-disable-next-line max-len */
17688
17541
  params[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
17689
17542
  }
17690
17543
  else {
17691
- /* eslint-disable-next-line max-len */
17692
17544
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
17693
17545
  }
17694
17546
  if (discoveryExperience) {
@@ -17792,6 +17644,30 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17792
17644
  this.iFrame.src = `${iframeSrc.split(currentPath)[0]}${currentPath}/${path.replace(/^\/?#?\//, '')}`;
17793
17645
  }
17794
17646
  }
17647
+ /**
17648
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
17649
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
17650
+ */
17651
+ destroy() {
17652
+ super.destroy();
17653
+ this.unregisterLazyLoadEvents();
17654
+ }
17655
+ postRender() {
17656
+ this.registerLazyLoadEvents();
17657
+ }
17658
+ registerLazyLoadEvents() {
17659
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17660
+ // TODO: Use passive: true, install modernizr to check for passive
17661
+ window.addEventListener('resize', this.sendFullHeightLazyLoadData);
17662
+ window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
17663
+ }
17664
+ }
17665
+ unregisterLazyLoadEvents() {
17666
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17667
+ window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
17668
+ window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
17669
+ }
17670
+ }
17795
17671
  /**
17796
17672
  * Renders the embedded application pages in the ThoughtSpot app.
17797
17673
  * @param renderOptions An object containing the page ID
@@ -17801,6 +17677,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17801
17677
  await super.render();
17802
17678
  const src = this.getIFrameSrc();
17803
17679
  await this.renderV1Embed(src);
17680
+ this.postRender();
17804
17681
  return this;
17805
17682
  }
17806
17683
  };
@@ -17842,7 +17719,7 @@ const addPreviewStylesIfNotPresent = () => {
17842
17719
  return;
17843
17720
  }
17844
17721
  const previewStyles = `
17845
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css" integrity="sha384-PvEsKa6emq5KYa9mf+Q7eYF5C2OCacYzZ+hBngp21NA4o1A9iU9smnytEmqUFbEZ" crossorigin="anonymous">
17722
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css">
17846
17723
  <style id="ts-preview-style">
17847
17724
  .ts-viz-preview-loader {
17848
17725
  position: absolute;
@@ -17905,6 +17782,21 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17905
17782
  viewConfig.embedComponentType = 'LiveboardEmbed';
17906
17783
  super(domSelector, viewConfig);
17907
17784
  this.defaultHeight = 500;
17785
+ this.sendFullHeightLazyLoadData = () => {
17786
+ const data = calculateVisibleElementData(this.iFrame);
17787
+ this.trigger(HostEvent.VisibleEmbedCoordinates, data);
17788
+ };
17789
+ /**
17790
+ * This is a handler for the RequestVisibleEmbedCoordinates event.
17791
+ * It is used to send the visible coordinates data to the host application.
17792
+ * @param data The event payload
17793
+ * @param responder The responder function
17794
+ */
17795
+ this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
17796
+ logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
17797
+ const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
17798
+ responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
17799
+ };
17908
17800
  /**
17909
17801
  * Set the iframe height as per the computed height received
17910
17802
  * from the ThoughtSpot app.
@@ -17912,6 +17804,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17912
17804
  */
17913
17805
  this.updateIFrameHeight = (data) => {
17914
17806
  this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
17807
+ this.sendFullHeightLazyLoadData();
17915
17808
  };
17916
17809
  this.embedIframeCenter = (data, responder) => {
17917
17810
  const obj = this.getIframeCenter();
@@ -17945,6 +17838,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17945
17838
  this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
17946
17839
  this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
17947
17840
  this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
17841
+ this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
17948
17842
  }
17949
17843
  }
17950
17844
  /**
@@ -17959,6 +17853,10 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17959
17853
  || this.viewConfig.preventPinboardFilterRemoval;
17960
17854
  if (fullHeight === true) {
17961
17855
  params[Param.fullHeight] = true;
17856
+ if (this.viewConfig.lazyLoadingForFullHeight) {
17857
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
17858
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
17859
+ }
17962
17860
  }
17963
17861
  if (defaultHeight) {
17964
17862
  this.defaultHeight = defaultHeight;
@@ -18114,6 +18012,30 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
18114
18012
  }
18115
18013
  return super.trigger(messageType, dataWithVizId);
18116
18014
  }
18015
+ /**
18016
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
18017
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
18018
+ */
18019
+ destroy() {
18020
+ super.destroy();
18021
+ this.unregisterLazyLoadEvents();
18022
+ }
18023
+ postRender() {
18024
+ this.registerLazyLoadEvents();
18025
+ }
18026
+ registerLazyLoadEvents() {
18027
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
18028
+ // TODO: Use passive: true, install modernizr to check for passive
18029
+ window.addEventListener('resize', this.sendFullHeightLazyLoadData);
18030
+ window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
18031
+ }
18032
+ }
18033
+ unregisterLazyLoadEvents() {
18034
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
18035
+ window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
18036
+ window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
18037
+ }
18038
+ }
18117
18039
  /**
18118
18040
  * Render an embedded ThoughtSpot Liveboard or visualization
18119
18041
  * @param renderOptions An object specifying the Liveboard ID,
@@ -18124,6 +18046,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
18124
18046
  const src = this.getIFrameSrc();
18125
18047
  await this.renderV1Embed(src);
18126
18048
  this.showPreviewLoader();
18049
+ this.postRender();
18127
18050
  return this;
18128
18051
  }
18129
18052
  navigateToLiveboard(liveboardId, vizId, activeTabId) {
@@ -18522,11 +18445,7 @@ class Conversation {
18522
18445
  return {
18523
18446
  convId: this.conversationId,
18524
18447
  messageId: responses[0].msgId,
18525
- data: {
18526
- ...data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18527
- convId: this.conversationId,
18528
- messageId: responses[0].msgId,
18529
- },
18448
+ data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18530
18449
  error: null,
18531
18450
  };
18532
18451
  }
@@ -18552,7 +18471,7 @@ let ConversationMessage$1 = class ConversationMessage extends TsEmbed {
18552
18471
  }
18553
18472
  getIframeSrc() {
18554
18473
  var _a;
18555
- const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
18474
+ const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
18556
18475
  const path = 'conv-assist-answer';
18557
18476
  const queryParams = this.getBaseQueryParams();
18558
18477
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
@@ -18567,8 +18486,6 @@ let ConversationMessage$1 = class ConversationMessage extends TsEmbed {
18567
18486
  genNo,
18568
18487
  acSessionId,
18569
18488
  acGenNo,
18570
- convId,
18571
- messageId,
18572
18489
  });
18573
18490
  return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
18574
18491
  }
@@ -18612,8 +18529,6 @@ class SpotterAgentEmbed {
18612
18529
  const container = document.createElement('div');
18613
18530
  const embed = new ConversationMessage$1(container, {
18614
18531
  ...this.viewConfig,
18615
- convId: data.convId,
18616
- messageId: data.messageId,
18617
18532
  sessionId: data.sessionId,
18618
18533
  genNo: data.genNo,
18619
18534
  acSessionId: data.stateKey.transactionId,
@@ -18634,8 +18549,6 @@ class SpotterAgentEmbed {
18634
18549
  return { error };
18635
18550
  }
18636
18551
  return { data: {
18637
- convId: data.convId,
18638
- messageId: data.messageId,
18639
18552
  sessionId: data.sessionId,
18640
18553
  genNo: data.genNo,
18641
18554
  acSessionId: data.stateKey.transactionId,