@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
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -278,7 +278,6 @@ const getOperationNameFromQuery = (query) => {
278
278
  function removeTypename(obj) {
279
279
  if (!obj || typeof obj !== 'object')
280
280
  return obj;
281
- // eslint-disable-next-line no-restricted-syntax
282
281
  for (const key in obj) {
283
282
  if (key === '__typename') {
284
283
  delete obj[key];
@@ -307,7 +306,11 @@ const setStyleProperties = (element, styleProperties) => {
307
306
  if (!(element === null || element === void 0 ? void 0 : element.style))
308
307
  return;
309
308
  Object.keys(styleProperties).forEach((styleProperty) => {
310
- element.style[styleProperty] = styleProperties[styleProperty].toString();
309
+ const styleKey = styleProperty;
310
+ const value = styleProperties[styleKey];
311
+ if (value !== undefined) {
312
+ element.style[styleKey] = value.toString();
313
+ }
311
314
  });
312
315
  };
313
316
  /**
@@ -435,6 +438,22 @@ const handleExitPresentMode = async () => {
435
438
  }
436
439
  }
437
440
  logger$3.warn('Exit fullscreen API is not supported by this browser.');
441
+ };
442
+ const calculateVisibleElementData = (element) => {
443
+ const rect = element.getBoundingClientRect();
444
+ const windowHeight = window.innerHeight;
445
+ const windowWidth = window.innerWidth;
446
+ const frameRelativeTop = Math.max(rect.top, 0);
447
+ const frameRelativeLeft = Math.max(rect.left, 0);
448
+ const frameRelativeBottom = Math.min(windowHeight, rect.bottom);
449
+ const frameRelativeRight = Math.min(windowWidth, rect.right);
450
+ const data = {
451
+ top: Math.max(0, rect.top * -1),
452
+ height: Math.max(0, frameRelativeBottom - frameRelativeTop),
453
+ left: Math.max(0, rect.left * -1),
454
+ width: Math.max(0, frameRelativeRight - frameRelativeLeft),
455
+ };
456
+ return data;
438
457
  };
439
458
 
440
459
  /**
@@ -1846,82 +1865,11 @@ var EmbedEvent;
1846
1865
  */
1847
1866
  EmbedEvent["ExitPresentMode"] = "exitPresentMode";
1848
1867
  /**
1849
- * Emitted when spotter response is text data
1850
- * @example
1851
- * ```js
1852
- * spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
1853
- * console.log('payload', payload);
1854
- * })
1855
- *```
1856
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1857
- */
1858
- EmbedEvent["SpotterData"] = "SpotterData";
1859
- /**
1860
- * Emitted when user opens up the worksheet preview modal in spotter embed.
1861
- * @example
1862
- * ```js
1863
- * spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
1864
- * console.log('payload', payload);
1865
- * })
1866
- *```
1867
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1868
- */
1869
- EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
1870
- /**
1871
- * Emitted when the spotter query is triggered in spotter embed.
1872
- * @example
1873
- * ```js
1874
- * spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
1875
- * console.log('payload', payload);
1876
- * })
1877
- *```
1878
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1879
- */
1880
- EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
1881
- /**
1882
- * Emitted when the last spotter query is edited in spotter embed.
1883
- * @example
1884
- * ```js
1885
- * spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
1886
- * console.log('payload', payload);
1887
- * })
1888
- *```
1889
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1890
- */
1891
- EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
1892
- /**
1893
- * Emitted when the last spotter query is deleted in spotter embed.
1894
- * @example
1895
- * ```js
1896
- * spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
1897
- * console.log('payload', payload);
1898
- * })
1899
- *```
1900
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1901
- */
1902
- EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
1903
- /**
1904
- * Emitted when the coversation is reset in spotter embed.
1905
- * @example
1906
- * ```js
1907
- * spotterEmbed.on(EmbedEvent.ResetSpotterConversation, (payload) => {
1908
- * console.log('payload', payload);
1909
- * })
1910
- *```
1911
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1912
- */
1913
- EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
1914
- /**
1915
- * Emitted when the *Spotter* is initialized.
1916
- * @example
1917
- * ```js
1918
- * spotterEmbed.on(EmbedEvent.SpotterInit, (payload) => {
1919
- * console.log('payload', payload);
1920
- * })
1921
- *```
1922
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1868
+ * Emitted when a user requests the full height lazy load data.
1869
+ * @version SDK : 1.39.0 | ThoughtSpot : 10.10.0.cl
1870
+ * @hidden
1923
1871
  */
1924
- EmbedEvent["SpotterInit"] = "SpotterInit";
1872
+ EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
1925
1873
  })(EmbedEvent || (EmbedEvent = {}));
1926
1874
  /**
1927
1875
  * Event types that can be triggered by the host application
@@ -2212,7 +2160,6 @@ var HostEvent;
2212
2160
  * @param
2213
2161
  * `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
2214
2162
  * Optional when pinning a new chart or table generated from a Search query.
2215
- * **Required** in Spotter Embed.
2216
2163
  * @param
2217
2164
  * `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
2218
2165
  * specify the `newLiveboardName` parameter to create a new Liveboard.
@@ -2260,12 +2207,6 @@ var HostEvent;
2260
2207
  * ```js
2261
2208
  * appEmbed.trigger(HostEvent.Pin)
2262
2209
  * ```
2263
- * @example
2264
- * ```js
2265
- * const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
2266
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2267
- * });
2268
- * ```
2269
2210
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2270
2211
  */
2271
2212
  HostEvent["Pin"] = "pin";
@@ -2359,12 +2300,6 @@ var HostEvent;
2359
2300
  * ```js
2360
2301
  * searchEmbed.trigger(HostEvent.MakeACopy)
2361
2302
  * ```
2362
- * @example
2363
- * ```js
2364
- * const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
2365
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2366
- * });
2367
- * ```
2368
2303
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2369
2304
  */
2370
2305
  HostEvent["MakeACopy"] = "makeACopy";
@@ -2437,7 +2372,6 @@ var HostEvent;
2437
2372
  * This event is not supported in visualization embed and search embed.
2438
2373
  * @param - object - To trigger the action for a specific visualization
2439
2374
  * in Liveboard embed, pass in `vizId` as a key.
2440
- * **Required** in Spotter embed.
2441
2375
  * @example
2442
2376
  * ```js
2443
2377
  * liveboardEmbed.trigger(HostEvent.Edit)
@@ -2446,12 +2380,6 @@ var HostEvent;
2446
2380
  * liveboardEmbed.trigger(HostEvent.Edit, {vizId:
2447
2381
  * '730496d6-6903-4601-937e-2c691821af3c'})
2448
2382
  * ```
2449
- * @example
2450
- * ```js
2451
- * const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2452
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2453
- * });
2454
- * ```
2455
2383
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2456
2384
  */
2457
2385
  HostEvent["Edit"] = "edit";
@@ -2499,16 +2427,6 @@ var HostEvent;
2499
2427
  * );
2500
2428
  * })
2501
2429
  * ```
2502
- * @example
2503
- * ```js
2504
- * spotterEmbed.trigger(HostEvent.GetTML, {
2505
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2506
- * }).then((tml) => {
2507
- * console.log(
2508
- * tml.answer.search_query // TML representation of the search query
2509
- * );
2510
- * })
2511
- * ```
2512
2430
  * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
2513
2431
  * @important
2514
2432
  */
@@ -2596,12 +2514,7 @@ var HostEvent;
2596
2514
  * vizEmbed.trigger(HostEvent.DownloadAsPng)
2597
2515
  *
2598
2516
  * searchEmbed.trigger(HostEvent.DownloadAsPng)
2599
- *
2600
- * spotterEmbed.trigger(HostEvent.DownloadAsPng, {
2601
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2602
- * })
2603
2517
  * ```
2604
- *
2605
2518
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
2606
2519
  */
2607
2520
  HostEvent["DownloadAsPng"] = "downloadAsPng";
@@ -2619,11 +2532,6 @@ var HostEvent;
2619
2532
  * ```js
2620
2533
  * searchEmbed.trigger(HostEvent.DownloadAsCsv)
2621
2534
  * ```
2622
- * ```js
2623
- * spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
2624
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2625
- * })
2626
- * ```
2627
2535
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2628
2536
  */
2629
2537
  HostEvent["DownloadAsCsv"] = "downloadAsCSV";
@@ -2641,11 +2549,6 @@ var HostEvent;
2641
2549
  * ```js
2642
2550
  * searchEmbed.trigger(HostEvent.DownloadAsXlsx)
2643
2551
  * ```
2644
- * ```js
2645
- * spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
2646
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2647
- * })
2648
- * ```
2649
2552
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2650
2553
  */
2651
2554
  HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
@@ -2665,7 +2568,6 @@ var HostEvent;
2665
2568
  /**
2666
2569
  * Trigger the **Save** action on a Liveboard or Answer.
2667
2570
  * Saves the changes.
2668
- * @param - `vizId` is required in Spotter Embed.
2669
2571
  * @example
2670
2572
  * ```js
2671
2573
  * liveboardEmbed.trigger(HostEvent.Save)
@@ -2673,11 +2575,6 @@ var HostEvent;
2673
2575
  * ```js
2674
2576
  * searchEmbed.trigger(HostEvent.Save)
2675
2577
  * ```
2676
- * ```js
2677
- * spotterEmbed.trigger(HostEvent.Save, {
2678
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2679
- * })
2680
- * ```
2681
2578
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2682
2579
  */
2683
2580
  HostEvent["Save"] = "save";
@@ -2961,7 +2858,7 @@ var HostEvent;
2961
2858
  HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
2962
2859
  /**
2963
2860
  * Triggers an action to update Parameter values on embedded
2964
- * Answers, Liveboard and Spotter answer in Edit mode.
2861
+ * Answers and Liveboard.
2965
2862
  *
2966
2863
  * @example
2967
2864
  * ```js
@@ -2980,13 +2877,6 @@ var HostEvent;
2980
2877
  * console.log('parameters', parameter);
2981
2878
  * });
2982
2879
  *```
2983
- *```js
2984
- * spotterEmbed.trigger(HostEvent.GetParameters, {
2985
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2986
- * }).then((parameter) => {
2987
- * console.log('parameters', parameter);
2988
- * });
2989
- *```
2990
2880
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
2991
2881
  */
2992
2882
  HostEvent["GetParameters"] = "GetParameters";
@@ -3054,64 +2944,6 @@ var HostEvent;
3054
2944
  * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
3055
2945
  */
3056
2946
  HostEvent["TransformTableVizData"] = "TransformTableVizData";
3057
- /**
3058
- * Triggers a search operation with the search tokens specified in
3059
- * the search query string in spotter embed.
3060
- * @param - `queryString`: Text string in Natural Language format
3061
- * @param - `executeSearch`: Boolean to execute search and update search query
3062
- * @example
3063
- * ```js
3064
- * spotterEmbed.trigger(HostEvent.SpotterSearch, {
3065
- * query: 'revenue per year',
3066
- * executeSearch: true,
3067
- * })
3068
- * ```
3069
- */
3070
- HostEvent["SpotterSearch"] = "SpotterSearch";
3071
- /**
3072
- * Edits the last prompt in spotter embed.
3073
- * @param - `query`: Text string
3074
- * @example
3075
- * ```js
3076
- * spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
3077
- * ```
3078
- */
3079
- HostEvent["EditLastPrompt"] = "EditLastPrompt";
3080
- /**
3081
- * Opens the Worksheet preview modal in Spotter Embed.
3082
- * @example
3083
- * ```js
3084
- * spotterEmbed.trigger(HostEvent.PreviewSpotterData);
3085
- * ```
3086
- */
3087
- HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
3088
- /**
3089
- * Resets the Spotter Embed Conversation.
3090
- * @example
3091
- * ```js
3092
- * spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
3093
- * ```
3094
- */
3095
- HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
3096
- /**
3097
- * Deletes the last prompt in spotter embed.
3098
- * @example
3099
- * ```js
3100
- * spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
3101
- * ```
3102
- */
3103
- HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
3104
- /**
3105
- * Toggle the visualization to chart or table view.
3106
- * @param - `vizId ` In Spotter Embed, vizId is required.
3107
- * @example
3108
- * ```js
3109
- * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
3110
- * vizId:"'b535c760-8bbe-4e6f-bb26-af56b4129a1e'"
3111
- * });
3112
- *```
3113
- */
3114
- HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
3115
2947
  /**
3116
2948
  * @hidden
3117
2949
  * Trigger exit from presentation mode when user exits fullscreen.
@@ -3123,15 +2955,18 @@ var HostEvent;
3123
2955
  */
3124
2956
  HostEvent["ExitPresentMode"] = "exitPresentMode";
3125
2957
  /**
3126
- * Trigger the *Ask Sage* action for visualizations
2958
+ * Triggers the full height lazy load data.
3127
2959
  * @example
3128
2960
  * ```js
3129
- * liveboardEmbed.trigger(HostEvent.AskSpotter,
3130
- * {containerId:'730496d6-6903-4601-937e-2c691821af3c'})
2961
+ * liveboardEmbed.on(EmbedEvent.RequestVisibleEmbedCoordinates, (payload) => {
2962
+ * console.log(payload);
2963
+ * });
3131
2964
  * ```
3132
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
2965
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
2966
+ *
2967
+ * @hidden
3133
2968
  */
3134
- HostEvent["AskSpotter"] = "askSpotter";
2969
+ HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
3135
2970
  })(HostEvent || (HostEvent = {}));
3136
2971
  /**
3137
2972
  * The different visual modes that the data sources panel within
@@ -3276,6 +3111,8 @@ var Param;
3276
3111
  Param["PrimaryAction"] = "primaryAction";
3277
3112
  Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
3278
3113
  Param["IsLiveboardStylingAndGroupingEnabled"] = "isLiveboardStylingAndGroupingEnabled";
3114
+ Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
3115
+ Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
3279
3116
  })(Param || (Param = {}));
3280
3117
  /**
3281
3118
  * ThoughtSpot application pages include actions and menu commands
@@ -7871,7 +7708,7 @@ class AnswerService {
7871
7708
  async getTML() {
7872
7709
  const { object } = await this.executeQuery(getAnswerTML, {});
7873
7710
  const edoc = object[0].edoc;
7874
- const YAML = await import('./index-ZrE8YYq8.js');
7711
+ const YAML = await import('./index-D1pyb7RG.js');
7875
7712
  const parsedDoc = YAML.parse(edoc);
7876
7713
  return {
7877
7714
  answer: {
@@ -15771,7 +15608,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
15771
15608
  return e;
15772
15609
  }
15773
15610
 
15774
- 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};
15611
+ 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};
15775
15612
 
15776
15613
  /**
15777
15614
  * Reloads the ThoughtSpot iframe.
@@ -15794,7 +15631,8 @@ const reload = (iFrame) => {
15794
15631
  * @param channel
15795
15632
  */
15796
15633
  function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
15797
- return iFrame.contentWindow.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
15634
+ var _a;
15635
+ return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
15798
15636
  }
15799
15637
  const TRIGGER_TIMEOUT = 30000;
15800
15638
  /**
@@ -17179,7 +17017,6 @@ class V1Embed extends TsEmbed {
17179
17017
  /**
17180
17018
  * Pages within the ThoughtSpot app that can be embedded.
17181
17019
  */
17182
- // eslint-disable-next-line no-shadow
17183
17020
  var Page;
17184
17021
  (function (Page) {
17185
17022
  /**
@@ -17286,11 +17123,25 @@ var ListPage;
17286
17123
  * @group Embed components
17287
17124
  */
17288
17125
  class AppEmbed extends V1Embed {
17289
- // eslint-disable-next-line no-useless-constructor
17290
17126
  constructor(domSelector, viewConfig) {
17291
17127
  viewConfig.embedComponentType = 'AppEmbed';
17292
17128
  super(domSelector, viewConfig);
17293
17129
  this.defaultHeight = '100%';
17130
+ this.sendFullHeightLazyLoadData = () => {
17131
+ const data = calculateVisibleElementData(this.iFrame);
17132
+ this.trigger(HostEvent.VisibleEmbedCoordinates, data);
17133
+ };
17134
+ /**
17135
+ * This is a handler for the RequestVisibleEmbedCoordinates event.
17136
+ * It is used to send the visible coordinates data to the host application.
17137
+ * @param data The event payload
17138
+ * @param responder The responder function
17139
+ */
17140
+ this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
17141
+ logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
17142
+ const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
17143
+ responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
17144
+ };
17294
17145
  /**
17295
17146
  * Set the iframe height as per the computed height received
17296
17147
  * from the ThoughtSpot app.
@@ -17299,6 +17150,7 @@ class AppEmbed extends V1Embed {
17299
17150
  this.updateIFrameHeight = (data) => {
17300
17151
  var _a;
17301
17152
  this.setIFrameHeight(Math.max(data.data, (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.scrollHeight));
17153
+ this.sendFullHeightLazyLoadData();
17302
17154
  };
17303
17155
  this.embedIframeCenter = (data, responder) => {
17304
17156
  const obj = this.getIframeCenter();
@@ -17328,6 +17180,7 @@ class AppEmbed extends V1Embed {
17328
17180
  this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
17329
17181
  this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
17330
17182
  this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
17183
+ this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
17331
17184
  }
17332
17185
  }
17333
17186
  /**
@@ -17335,9 +17188,7 @@ class AppEmbed extends V1Embed {
17335
17188
  * embedded Liveboard or visualization.
17336
17189
  */
17337
17190
  getEmbedParams() {
17338
- 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,
17339
- /* eslint-disable-next-line max-len */
17340
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17191
+ 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$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17341
17192
  let params = {};
17342
17193
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
17343
17194
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -17366,6 +17217,10 @@ class AppEmbed extends V1Embed {
17366
17217
  }
17367
17218
  if (fullHeight === true) {
17368
17219
  params[Param.fullHeight] = true;
17220
+ if (this.viewConfig.lazyLoadingForFullHeight) {
17221
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
17222
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
17223
+ }
17369
17224
  }
17370
17225
  if (tag) {
17371
17226
  params[Param.Tag] = tag;
@@ -17386,7 +17241,6 @@ class AppEmbed extends V1Embed {
17386
17241
  params[Param.enableAskSage] = enableAskSage;
17387
17242
  }
17388
17243
  if (isOnBeforeGetVizDataInterceptEnabled) {
17389
- /* eslint-disable-next-line max-len */
17390
17244
  params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
17391
17245
  }
17392
17246
  if (homePageSearchBarMode) {
@@ -17407,11 +17261,9 @@ class AppEmbed extends V1Embed {
17407
17261
  === DataPanelCustomColumnGroupsAccordionState$1.COLLAPSE_ALL
17408
17262
  || dataPanelCustomGroupsAccordionInitialState
17409
17263
  === DataPanelCustomColumnGroupsAccordionState$1.EXPAND_FIRST) {
17410
- /* eslint-disable-next-line max-len */
17411
17264
  params[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
17412
17265
  }
17413
17266
  else {
17414
- /* eslint-disable-next-line max-len */
17415
17267
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
17416
17268
  }
17417
17269
  if (discoveryExperience) {
@@ -17515,6 +17367,30 @@ class AppEmbed extends V1Embed {
17515
17367
  this.iFrame.src = `${iframeSrc.split(currentPath)[0]}${currentPath}/${path.replace(/^\/?#?\//, '')}`;
17516
17368
  }
17517
17369
  }
17370
+ /**
17371
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
17372
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
17373
+ */
17374
+ destroy() {
17375
+ super.destroy();
17376
+ this.unregisterLazyLoadEvents();
17377
+ }
17378
+ postRender() {
17379
+ this.registerLazyLoadEvents();
17380
+ }
17381
+ registerLazyLoadEvents() {
17382
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17383
+ // TODO: Use passive: true, install modernizr to check for passive
17384
+ window.addEventListener('resize', this.sendFullHeightLazyLoadData);
17385
+ window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
17386
+ }
17387
+ }
17388
+ unregisterLazyLoadEvents() {
17389
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17390
+ window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
17391
+ window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
17392
+ }
17393
+ }
17518
17394
  /**
17519
17395
  * Renders the embedded application pages in the ThoughtSpot app.
17520
17396
  * @param renderOptions An object containing the page ID
@@ -17524,6 +17400,7 @@ class AppEmbed extends V1Embed {
17524
17400
  await super.render();
17525
17401
  const src = this.getIFrameSrc();
17526
17402
  await this.renderV1Embed(src);
17403
+ this.postRender();
17527
17404
  return this;
17528
17405
  }
17529
17406
  }
@@ -17565,7 +17442,7 @@ const addPreviewStylesIfNotPresent = () => {
17565
17442
  return;
17566
17443
  }
17567
17444
  const previewStyles = `
17568
- <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">
17445
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css">
17569
17446
  <style id="ts-preview-style">
17570
17447
  .ts-viz-preview-loader {
17571
17448
  position: absolute;
@@ -17628,6 +17505,21 @@ class LiveboardEmbed extends V1Embed {
17628
17505
  viewConfig.embedComponentType = 'LiveboardEmbed';
17629
17506
  super(domSelector, viewConfig);
17630
17507
  this.defaultHeight = 500;
17508
+ this.sendFullHeightLazyLoadData = () => {
17509
+ const data = calculateVisibleElementData(this.iFrame);
17510
+ this.trigger(HostEvent.VisibleEmbedCoordinates, data);
17511
+ };
17512
+ /**
17513
+ * This is a handler for the RequestVisibleEmbedCoordinates event.
17514
+ * It is used to send the visible coordinates data to the host application.
17515
+ * @param data The event payload
17516
+ * @param responder The responder function
17517
+ */
17518
+ this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
17519
+ logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
17520
+ const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
17521
+ responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
17522
+ };
17631
17523
  /**
17632
17524
  * Set the iframe height as per the computed height received
17633
17525
  * from the ThoughtSpot app.
@@ -17635,6 +17527,7 @@ class LiveboardEmbed extends V1Embed {
17635
17527
  */
17636
17528
  this.updateIFrameHeight = (data) => {
17637
17529
  this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
17530
+ this.sendFullHeightLazyLoadData();
17638
17531
  };
17639
17532
  this.embedIframeCenter = (data, responder) => {
17640
17533
  const obj = this.getIframeCenter();
@@ -17668,6 +17561,7 @@ class LiveboardEmbed extends V1Embed {
17668
17561
  this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
17669
17562
  this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
17670
17563
  this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
17564
+ this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
17671
17565
  }
17672
17566
  }
17673
17567
  /**
@@ -17682,6 +17576,10 @@ class LiveboardEmbed extends V1Embed {
17682
17576
  || this.viewConfig.preventPinboardFilterRemoval;
17683
17577
  if (fullHeight === true) {
17684
17578
  params[Param.fullHeight] = true;
17579
+ if (this.viewConfig.lazyLoadingForFullHeight) {
17580
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
17581
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
17582
+ }
17685
17583
  }
17686
17584
  if (defaultHeight) {
17687
17585
  this.defaultHeight = defaultHeight;
@@ -17837,6 +17735,30 @@ class LiveboardEmbed extends V1Embed {
17837
17735
  }
17838
17736
  return super.trigger(messageType, dataWithVizId);
17839
17737
  }
17738
+ /**
17739
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
17740
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
17741
+ */
17742
+ destroy() {
17743
+ super.destroy();
17744
+ this.unregisterLazyLoadEvents();
17745
+ }
17746
+ postRender() {
17747
+ this.registerLazyLoadEvents();
17748
+ }
17749
+ registerLazyLoadEvents() {
17750
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17751
+ // TODO: Use passive: true, install modernizr to check for passive
17752
+ window.addEventListener('resize', this.sendFullHeightLazyLoadData);
17753
+ window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
17754
+ }
17755
+ }
17756
+ unregisterLazyLoadEvents() {
17757
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17758
+ window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
17759
+ window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
17760
+ }
17761
+ }
17840
17762
  /**
17841
17763
  * Render an embedded ThoughtSpot Liveboard or visualization
17842
17764
  * @param renderOptions An object specifying the Liveboard ID,
@@ -17847,6 +17769,7 @@ class LiveboardEmbed extends V1Embed {
17847
17769
  const src = this.getIFrameSrc();
17848
17770
  await this.renderV1Embed(src);
17849
17771
  this.showPreviewLoader();
17772
+ this.postRender();
17850
17773
  return this;
17851
17774
  }
17852
17775
  navigateToLiveboard(liveboardId, vizId, activeTabId) {
@@ -18500,11 +18423,7 @@ class Conversation {
18500
18423
  return {
18501
18424
  convId: this.conversationId,
18502
18425
  messageId: responses[0].msgId,
18503
- data: {
18504
- ...data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18505
- convId: this.conversationId,
18506
- messageId: responses[0].msgId,
18507
- },
18426
+ data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18508
18427
  error: null,
18509
18428
  };
18510
18429
  }
@@ -18530,7 +18449,7 @@ class ConversationMessage extends TsEmbed {
18530
18449
  }
18531
18450
  getIframeSrc() {
18532
18451
  var _a;
18533
- const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
18452
+ const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
18534
18453
  const path = 'conv-assist-answer';
18535
18454
  const queryParams = this.getBaseQueryParams();
18536
18455
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
@@ -18545,8 +18464,6 @@ class ConversationMessage extends TsEmbed {
18545
18464
  genNo,
18546
18465
  acSessionId,
18547
18466
  acGenNo,
18548
- convId,
18549
- messageId,
18550
18467
  });
18551
18468
  return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
18552
18469
  }
@@ -18590,8 +18507,6 @@ class SpotterAgentEmbed {
18590
18507
  const container = document.createElement('div');
18591
18508
  const embed = new ConversationMessage(container, {
18592
18509
  ...this.viewConfig,
18593
- convId: data.convId,
18594
- messageId: data.messageId,
18595
18510
  sessionId: data.sessionId,
18596
18511
  genNo: data.genNo,
18597
18512
  acSessionId: data.stateKey.transactionId,
@@ -18612,8 +18527,6 @@ class SpotterAgentEmbed {
18612
18527
  return { error };
18613
18528
  }
18614
18529
  return { data: {
18615
- convId: data.convId,
18616
- messageId: data.messageId,
18617
18530
  sessionId: data.sessionId,
18618
18531
  genNo: data.genNo,
18619
18532
  acSessionId: data.stateKey.transactionId,